v0.8测试

This commit is contained in:
2026-04-16 07:55:46 +08:00
parent 7c743293be
commit c8262cf92e
16 changed files with 84 additions and 39 deletions

View File

@@ -32,7 +32,8 @@ class AttendanceService:
status: str,
reason: Optional[str],
apply_deduction: bool,
recorder_id: int
recorder_id: int,
custom_deduction: Optional[int] = None
) -> Dict[str, Any]:
"""添加考勤记录"""
# 检查权限
@@ -57,8 +58,10 @@ class AttendanceService:
# 应用扣分
if apply_deduction and status in ["absent", "late", "leave"]:
# 确定扣分数值
if status == "absent":
# 确定扣分数值(优先使用自定义扣分)
if custom_deduction is not None:
points_change = -custom_deduction
elif status == "absent":
points_change = -settings.DEDUCTION_ATTENDANCE_ABSENT
elif status == "late":
points_change = -settings.DEDUCTION_ATTENDANCE_LATE