fix: swipe_next 先创建cr bug

This commit is contained in:
caoqianming 2023-03-15 21:01:57 +08:00
parent 0608d9045a
commit 1c5e236e15
1 changed files with 11 additions and 1 deletions

View File

@ -274,7 +274,17 @@ class HrmService:
trigger = 'panel'
# 先直接创建记录
ClockRecord.objects.get_or_create(employee=ep, create_time=s_time_f, defaults={'type':card_type, 'employee':ep, 'trigger': trigger, 'detail': detail, 'create_time': s_time_f})
cr = ClockRecord.objects.filter(employee=ep, create_time=s_time_f).first()
if cr:
pass
else:
cr = ClockRecord()
cr.type = card_type
cr.employee = ep
cr.trigger = trigger
cr.detail = detail
cr.create_time = s_time_f
cr.save()
if card_type == 10:
# 查找当天的进门记录