label location
This commit is contained in:
parent
e4c4bb09dd
commit
da0e356438
|
@ -56,7 +56,7 @@ class HrmService:
|
|||
)
|
||||
dhClient.request(**dhapis['person_update'], json=json_data)
|
||||
# 开人脸卡 长时间
|
||||
if ep.job_state in [Employee.JOB_ON] and ep.type == 'employee':
|
||||
if ep.job_state in [Employee.JOB_ON]:
|
||||
if not ep.third_info.get('dh_face_card', None):
|
||||
dh_face_card = cls.open_face_card(ep=ep, dh_id=dh_id, departmentId=departmentId)
|
||||
else:
|
||||
|
@ -107,9 +107,14 @@ class HrmService:
|
|||
cardId = res['id']
|
||||
cardNumber = str(ep.id)[3:8] + rannum(5)
|
||||
now = datetime.now()
|
||||
startDate = now.strftime("%Y-%m-%d %H:%M:%S")
|
||||
endDate = (datetime(year=now.year+50,
|
||||
month=now.month, day=1)).strftime("%Y-%m-%d %H:%M:%S")
|
||||
if ep.type == 'employee': # 如果是内部人员
|
||||
startDate = now.strftime("%Y-%m-%d %H:%M:%S")
|
||||
endDate = (datetime(year=now.year+50,
|
||||
month=now.month, day=1)).strftime("%Y-%m-%d %H:%M:%S")
|
||||
elif ep.type == 'remployee':
|
||||
pass
|
||||
elif ep.type == 'visitor':
|
||||
pass
|
||||
json_data = {
|
||||
"id": cardId,
|
||||
"cardNumber": cardNumber,
|
||||
|
|
|
@ -47,9 +47,10 @@ class BindAreaSerializer(serializers.Serializer):
|
|||
|
||||
|
||||
class LabelLocationSerializer(CustomModelSerializer):
|
||||
code = serializers.CharField(label='设备唯一标识')
|
||||
class Meta:
|
||||
model = TDevice
|
||||
fields = ['type', 'location', 'area', 'areas', 'code', 'name']
|
||||
fields = ['type', 'location', 'area', 'areas', 'name', 'code']
|
||||
|
||||
|
||||
class BindAreasSerializer(serializers.Serializer):
|
||||
|
|
Loading…
Reference in New Issue