refector: 离职或退休可提供当前8h内的门禁时间

This commit is contained in:
caoqianming 2023-03-23 17:15:56 +08:00
parent 023dd12195
commit 1f8963514f
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class EmployeeCreateUpdateSerializer(CustomModelSerializer):
end_time = now + timedelta(days=7300)
if instance.job_state in [20, 30] and old_job_state == 10: # 离职或退休
start_time = now
end_time = now + timedelta(minutes=60)
end_time = now + timedelta(hours=8)
elif instance.job_state == 10 and old_job_state in [20, 30] and instance.type == 'employee': # 正式员工重新在职
start_time = now
end_time = now + timedelta(days=7300)