fix: clear_bgl_r

This commit is contained in:
caoqianming 2023-10-10 12:04:55 +08:00
parent 3a07c2b47c
commit 702fe8f87e
1 changed files with 12 additions and 8 deletions

View File

@ -477,11 +477,15 @@ class HrmService:
_, res = dhClient.request(**dhapis['card_door_authority_list'], json={
"pageNum": 1, "pageSize": 1000, "channelCode": "1002222$7$0$0"})
for i in res['pageData']:
ep = Employee.objects.get(third_info__dh_face_card=i['cardNumber'])
dh_face_card = i['cardNumber']
dh_id = ep.third_info['dh_id']
rdict = {"personIdsString": str(dh_id),
"cardNumberString": str(dh_face_card), "channelCode": "1002222$7$0$0"}
dhClient.request(
**dhapis['card_door_authority_delete'], json=rdict)
print(f'{ep.name}-办公室打卡权限已删除')
try:
ep = Employee.objects.get(third_info__dh_id=i['cardNumber'])
except:
print(f'{ep.name}-卡片不存在')
if ep.type in ['remployee', 'visitor', 'driver']:
dh_face_card = i['cardNumber']
dh_id = ep.third_info['dh_id']
rdict = {"personIdsString": str(dh_id),
"cardNumberString": str(dh_face_card), "channelCode": "1002222$7$0$0"}
dhClient.request(
**dhapis['card_door_authority_delete'], json=rdict)
print(f'{ep.name}-办公室打卡权限已删除')