diff --git a/apps/hrm/services.py b/apps/hrm/services.py index 543f49c0..b3367d64 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -290,13 +290,13 @@ class HrmService: cr_10_q = ClockRecord.objects.filter( type=10, employee=ep, create_time__gte=first_time, create_time__lte=end_time) first_obj = cr_10_q.order_by('create_time').first() - cr_10_q.exclude(id=first_obj.id).update(type=30) + cr_10_q.exclude(id=first_obj.id).update(type=30, exception_type=None) elif card_type == 20: # 查找当天的出门记录 cr_20_q = ClockRecord.objects.filter( type=20, employee=ep, create_time__gte=first_time, create_time__lte=end_time) last_obj = cr_20_q.order_by('-create_time').first() - cr_20_q.exclude(id=last_obj.id).update(type=30) + cr_20_q.exclude(id=last_obj.id).update(type=30, exception_type=None) # 判断是否有异常 # 找到最近的上下打卡时间不一定是当天的 cr_e = ClockRecord.objects.filter(create_time__lt=last_obj.create_time, employee=ep, type__in=[10, 20]).order_by('-create_time').first()