From 477bde5af846197c0168b4d638950dde2c0112aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Thu, 24 Nov 2022 13:14:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=9C=BA=E6=89=93=E5=8D=A1bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/develop/views.py | 2 +- apps/hrm/services.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/develop/views.py b/apps/develop/views.py index 851d9e80..a3611abb 100755 --- a/apps/develop/views.py +++ b/apps/develop/views.py @@ -202,7 +202,7 @@ class TestViewSet(CustomGenericViewSet): """ from apps.hrm.services import HrmService # data = {'id': 25198, 'category': 'alarm', 'method': 'alarm.msg', 'info': {'orgName': '河北省', 'nodeCode': '1000096$7$0$0', 'deviceCode': '1000096', 'alarmCode': 'd38c98b842334581a8219b3125ca72d5', 'alarmPicture': '6ad010cf-ce45-11ec-9715-e4246c7d1635/20221123/1/dsf_43aee9e6-6ae2-11ed-9872-e4246c7d1635_42018473_42037732.jpg', 'nodeType': '2', 'alarmDate': 1669187805, 'alarmGrade': 2, 'isSave': False, 'unitType': 7, 'extend': {'deptName': '设备管理部', 'deptIdList': [25], 'acsChannelCode': '1000096$7$0$0', 'maskState': 0, 'enterOrExit': 1, 'openTypeStr': '人脸刷门', 'swingTime': '2022-11-23 15:16:45', 'deviceName': '厂区门入', 'personCode': '8jtfoa', 'openType': '61', 'isOverTemp': False, 'orgCode': '001', 'paperNumber': '61012419850304335X', 'errorDetail': '', 'from': 'evo-accesscontrol', 'id': 1044994923113353216, 'beginTime': 1669187805000, 'acsChannelName': '厂区门入_门禁通道_1', 'cardStatus': '0', 'faceImageUrl': ['http://10.99.5.24:8927/6ad010cf-ce45-11ec-9715-e4246c7d1635/20221123/1/dsf_43aee9e6-6ae2-11ed-9872-e4246c7d1635_42018473_42037732.jpg'], 'orgName': '河北省', 'openFailedCode': 0, 'sex': 1, 'deptId': '25', 'cardType': 0, 'curTemp': 35.5, 'deviceCode': '1000096', 'personName': '谭刚位', 'personImg': '6ae577ee-ce45-11ec-bb54-e4246c7d1635/20221110/1/3313679c-6092-11ed-b963-e4246c7d1635.jpg', 'openResult': 1, 'personId': 673, 'recordImage1': '6ad010cf-ce45-11ec-9715-e4246c7d1635/20221123/1/dsf_43aee9e6-6ae2-11ed-9872-e4246c7d1635_42018473_42037732.jpg', 'category': '0', 'cardNumber': '0525871590', 'rfidType': 0, 'age': 0}, 'alarmType': 61, 'channelSeq': 0, 'orgCode': '001', 'channelName': '厂区门入_门禁通道_1', 'alarmStat': 1, 'isEvent': True}, 'subsystem': 'evo-accesscontrol', 'userIds': None, 'sid': None, 'domainId': None, 'infoArray': None, 'protocol': None} - data = {'id': 24533, 'category': 'alarm', 'method': 'alarm.msg', 'info': {'orgName': '河北省', 'nodeCode': '1002222$7$0$0', 'deviceCode': '1002222', 'alarmCode': 'a0141063f44f40469a81adeec710831b', 'nodeType': '2', 'alarmDate': 1669177165, 'alarmGrade': 2, 'isSave': False, 'unitType': 7, 'extend': {'orgName': '河北省', 'acsChannelCode': '1002222$7$0$0', 'enterOrExit': 3, 'openTypeStr': '正常关门', 'openFailedCode': 0, 'cardType': 0, 'swingTime': '2022-11-23 12:19:25', 'deviceCode': '1002222', 'deviceName': '办公楼考勤面板', 'openType': '56', 'orgCode': '001', 'openResult': 1, 'errorDetail': '', 'from': 'evo-accesscontrol', 'id': 1044950302815555584, 'acsChannelName': '办公楼考勤面板_门禁通道_1', 'cardStatus': '0', 'rfidType': 0}, 'alarmType': 56, 'channelSeq': 0, 'orgCode': '001', 'channelName': '办公楼考勤面板_门禁通道_1', 'alarmStat': 1, 'isEvent': True}, 'subsystem': 'evo-accesscontrol', 'userIds': None, 'sid': None, 'domainId': None, 'infoArray': None, 'protocol': None} + data = {'id': 29870, 'category': 'alarm', 'method': 'alarm.msg', 'info': {'orgName': '河北省', 'nodeCode': '1002222$7$0$0', 'deviceCode': '1002222', 'alarmCode': '191f4a8d0a2c4b6282448af04df6ec11', 'alarmPicture': '6ad010cf-ce45-11ec-9715-e4246c7d1635/20221124/1/dsf_b8662018-6b9c-11ed-9872-e4246c7d1635_51799202_51816153.jpg', 'nodeType': '2', 'alarmDate': 1669263013, 'alarmGrade': 2, 'isSave': False, 'unitType': 7, 'extend': {'deptName': '安全生产部', 'deptIdList': [28], 'acsChannelCode': '1002222$7$0$0', 'maskState': 3, 'enterOrExit': 3, 'openTypeStr': '人脸刷门', 'swingTime': '2022-11-24 12:10:13', 'deviceName': '办公楼考勤面板', 'personCode': '13911097513', 'openType': '61', 'orgCode': '001', 'paperNumber': '110107196804040335', 'errorDetail': '', 'from': 'evo-accesscontrol', 'id': 1045310360703340544, 'beginTime': 1669263013000, 'acsChannelName': '办公楼考勤面板_门禁通道_1', 'cardStatus': '0', 'faceImageUrl': ['http://10.99.5.24:8927/6ad010cf-ce45-11ec-9715-e4246c7d1635/20221124/1/dsf_b8662018-6b9c-11ed-9872-e4246c7d1635_51799202_51816153.jpg'], 'orgName': '河北省', 'openFailedCode': 0, 'sex': 1, 'deptId': '28', 'cardType': 0, 'deviceCode': '1002222', 'personName': '刘静元', 'personImg': '6ae577ee-ce45-11ec-bb54-e4246c7d1635/20220907/1/d841d821-2e67-11ed-b073-e4246c7d1635.jpg', 'openResult': 1, 'personId': 237, 'recordImage1': '6ad010cf-ce45-11ec-9715-e4246c7d1635/20221124/1/dsf_b8662018-6b9c-11ed-9872-e4246c7d1635_51799202_51816153.jpg', 'category': '0', 'cardNumber': '5973291203', 'rfidType': 0, 'age': 0}, 'alarmType': 61, 'channelSeq': 0, 'orgCode': '001', 'channelName': '办公楼考勤面板_门禁通道_1', 'alarmStat': 1, 'isEvent': True}, 'subsystem': 'evo-accesscontrol', 'userIds': None, 'sid': None, 'domainId': None, 'infoArray': None, 'protocol': None} HrmService.swipe(data=data) return Response() diff --git a/apps/hrm/services.py b/apps/hrm/services.py index 0ed56d91..af1259af 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -278,13 +278,13 @@ class HrmService: card_type = None time_10_x = datetime(year=s_time_f.year, month=s_time_f.month, day=s_time_f.day, hour=4, minute=0, second=0, tzinfo=tzinfo) - time_10_x = datetime(year=s_time_f.year, month=s_time_f.month, + 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_20_x: + 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