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':