From dc660cfb77f0c2b53666783236e730a012abb698 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, 23 Jun 2022 17:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8D=A1=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/hrm/services.py | 8 ++++---- apps/utils/dahua.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/hrm/services.py b/apps/hrm/services.py index c1334829..de958aac 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -78,7 +78,7 @@ class HrmService: dh_face_card = cardNumber else: _, res = dhClient.request(**dhapis['person_gen_id']) - personId = res['id'] + dh_id = res['id'] departmentId = 1 if ep.belong_dept: try: @@ -87,7 +87,7 @@ class HrmService: pass json_data = { "service": "ehs", - "id": personId, + "id": dh_id, "name": ep.name, "code": ep.number, "paperType": 111, @@ -125,11 +125,11 @@ class HrmService: "cardNumber": cardNumber, "category": 0, "cardType": 0, - "personId": personId, + "personId": dh_id, "departmentId": departmentId, "startDate": startDate, "endDate": endDate } _, res = dhClient.request(**dhapis['card_add'], json=json_data) dh_face_card = res['id'] - return {'dh_id': personId, 'dh_photo': dh_photo, 'dh_face_card': dh_face_card} + return {'dh_id': dh_id, 'dh_photo': dh_photo, 'dh_face_card': dh_face_card} diff --git a/apps/utils/dahua.py b/apps/utils/dahua.py index 2d1dc903..f225dd26 100755 --- a/apps/utils/dahua.py +++ b/apps/utils/dahua.py @@ -72,8 +72,8 @@ class DhClient: if raise_exception: raise APIException(**DH_REQUEST_ERROR) return 'error', DH_REQUEST_ERROR - # if settings.DEBUG: - # print_roundtrip(r) + if settings.DEBUG: + print_roundtrip(r) if r.status_code == 200: ret = r.json() if ret.get('code') == '27001007':