!3776 添加功能

Merge pull request !3776 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-07-11 04:11:10 +00:00
committed by Gitee
@@ -347,15 +347,14 @@ class AppletAttendance(Controller):
check_in_status = '缺卡' if not check_in else ('迟到' if is_late_card else '正常')
check_out_status = '缺卡' if not check_out else ('早退' if is_early_card else '正常')
if check_in:
check_in_str = (check_in + timedelta(hours=8)).strftime('%H:%M:%S')
if check_in_status in ['迟到', '早退', '缺卡']:
check_in_str += f" ({check_in_status})"
check_in_time = (check_in + timedelta(hours=8)).strftime('%H:%M:%S')
check_in_str = f"{check_in_status} {check_in_time}" if check_in_status in ['迟到', '早退'] else check_in_time
else:
check_in_str = '缺卡'
if check_out:
check_out_str = (check_out + timedelta(hours=8)).strftime('%H:%M:%S')
if check_out_status in ['迟到', '早退', '缺卡']:
check_out_str += f" ({check_out_status})"
check_out_time = (check_out + timedelta(hours=8)).strftime('%H:%M:%S')
check_out_str = f"{check_out_status} {check_out_time}" if check_out_status in ['迟到', '早退'] else check_out_time
else:
check_out_str = '缺卡'
@@ -367,7 +366,7 @@ class AppletAttendance(Controller):
# 添加到记录列表
records.append({
'date': att.current_data.strftime('%Y/%m/%d'),
'class': [f"{att.shift_name}",f"{standard_check_in_str}-{standard_check_out_str}"],
'class': [f"{att.shift_name} ",f"{standard_check_in_str}-{standard_check_out_str}"],
'user_id': user_id,
'check_in': check_in_str,
'check_out': check_out_str,