门禁授权时需要等待1s

This commit is contained in:
曹前明 2022-08-23 19:38:15 +08:00
parent 73ccc83637
commit 93a4fa7a8e
1 changed files with 3 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import time
from apps.hrm.models import ClockRecord, Employee
from apps.third.models import TDevice
from apps.third.tapis import dhapis
@ -121,6 +122,7 @@ class HrmService:
"endDate": endDate,
"departmentId": departmentId,
}
time.sleep(1)
_, res = dhClient.request(**dhapis['card_update'], json=json_data)
return cardNumber
else:
@ -145,6 +147,7 @@ class HrmService:
"startDate": startDate,
"endDate": endDate
}
time.sleep(1)
_, res = dhClient.request(**dhapis['card_add'], json=json_data)
cls.save(ep, data={'dh_face_card': cardNumber})
return cardNumber