fix: e_type为3 card_type判定

This commit is contained in:
caoqianming 2023-03-15 20:14:54 +08:00
parent dbf7fe7b20
commit 0608d9045a
1 changed files with 12 additions and 0 deletions

View File

@ -259,6 +259,18 @@ class HrmService:
elif e_type == 2:
card_type = 20
else:
time_10_x = datetime(year=s_time_f.year, month=s_time_f.month,
day=s_time_f.day, hour=3, minute=0, second=0, tzinfo=tzinfo)
time_10_y = datetime(year=s_time_f.year, month=s_time_f.month,
day=s_time_f.day, hour=11, minute=0, second=0, tzinfo=tzinfo)
time_20_x = datetime(year=s_time_f.year, month=s_time_f.month,
day=s_time_f.day, hour=16, minute=0, second=0, tzinfo=tzinfo)
time_20_y = datetime(year=s_time_f.year, month=s_time_f.month,
day=s_time_f.day, hour=23, minute=0, second=0, tzinfo=tzinfo)
if time_10_x < s_time_f < time_10_y:
card_type = 10
elif time_20_x < s_time_f < time_20_y:
card_type = 20
trigger = 'panel'
# 先直接创建记录