v0.8测试
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user