From a8c63d6925247bbc693443fb717955491ddfa049 Mon Sep 17 00:00:00 2001 From: zhouzhou <123@qq.com> Date: Wed, 18 Dec 2024 19:18:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_wechat/models/hr_attendance_detail.py | 44 ++++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/yuthon_wechat/models/hr_attendance_detail.py b/yuthon_wechat/models/hr_attendance_detail.py index 3243ed07f..b0aa1a3c0 100644 --- a/yuthon_wechat/models/hr_attendance_detail.py +++ b/yuthon_wechat/models/hr_attendance_detail.py @@ -333,26 +333,26 @@ class HrAttendanceDetail(models.Model): "check_out": checkin_time, "is_early_card": planning_slot_id.end_datetime > checkin_time, }) - elif attendance_obj.check_in and checkin_time and checkin_type == "上班打卡" and checkin_time < attendance_obj.check_in: - attendance_obj.sudo().write({ - "check_in": checkin_time, - "is_late_card": checkin_time > planning_slot_id.start_datetime, - }) - elif attendance_obj.check_out and checkin_time and checkin_type == "下班打卡" and checkin_time > attendance_obj.check_out: - attendance_obj.sudo().write({ - "check_out": checkin_time, - "is_early_card": planning_slot_id.end_datetime > checkin_time, - }) - elif checkin_time and not attendance_obj.check_in and not attendance_obj.check_out: - attendance_obj.sudo().write({ - "check_in": checkin_time, - "is_late_card": checkin_time > planning_slot_id.start_datetime, - }) - elif checkin_time and attendance_obj.check_in and not attendance_obj.check_out: - attendance_obj.sudo().write({ - "check_out": checkin_time, - "is_early_card": planning_slot_id.end_datetime > checkin_time, - }) + # elif attendance_obj.check_in and checkin_time and checkin_type == "上班打卡" and checkin_time < attendance_obj.check_in: + # attendance_obj.sudo().write({ + # "check_in": checkin_time, + # "is_late_card": checkin_time > planning_slot_id.start_datetime, + # }) + # elif attendance_obj.check_out and checkin_time and checkin_type == "下班打卡" and checkin_time > attendance_obj.check_out: + # attendance_obj.sudo().write({ + # "check_out": checkin_time, + # "is_early_card": planning_slot_id.end_datetime > checkin_time, + # }) + # elif checkin_time and not attendance_obj.check_in and not attendance_obj.check_out: + # attendance_obj.sudo().write({ + # "check_in": checkin_time, + # "is_late_card": checkin_time > planning_slot_id.start_datetime, + # }) + # elif checkin_time and attendance_obj.check_in and not attendance_obj.check_out: + # attendance_obj.sudo().write({ + # "check_out": checkin_time, + # "is_early_card": planning_slot_id.end_datetime > checkin_time, + # }) elif attendance_obj.is_early_card or attendance_obj.is_late_card: attendance_obj.sudo().write({"is_abnormal": True}) else: @@ -604,8 +604,8 @@ class HrAttendanceDetail(models.Model): # else: # attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True}) # # 进行关联 - attendance_detail_obj.hr_attendance_id = attendance_obj.id - return True + attendance_detail_obj.hr_attendance_id = attendance_obj.id + return True def get_hr_attendance_time(self): """ 获取企业微信打卡数据的核心逻辑