From 0608d9045acf6e6c137d7ef59be03e005eefd44c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 15 Mar 2023 20:14:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20e=5Ftype=E4=B8=BA3=20card=5Ftype?= =?UTF-8?q?=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/hrm/services.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/hrm/services.py b/apps/hrm/services.py index 49405a3e..a8d3a02d 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -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' # 先直接创建记录