事件触发 区域名称bug
This commit is contained in:
parent
86d22b478d
commit
1921015120
|
@ -87,7 +87,8 @@ def notify_event(event: Event, voice_msg=''):
|
||||||
# 生成通知文本
|
# 生成通知文本
|
||||||
ep = event.employee
|
ep = event.employee
|
||||||
obj_cate = event.obj_cate
|
obj_cate = event.obj_cate
|
||||||
params = {'area': event.area.name, 'employee': '', 'event': ''}
|
area_name = event.area.name if event.area else ''
|
||||||
|
params = {'area': area_name, 'employee': '', 'event': ''}
|
||||||
if ep:
|
if ep:
|
||||||
ep_name = ep.name
|
ep_name = ep.name
|
||||||
ep_type = '员工'
|
ep_type = '员工'
|
||||||
|
|
|
@ -272,3 +272,24 @@ class DhClient:
|
||||||
"cascade": True
|
"cascade": True
|
||||||
}
|
}
|
||||||
self.request(**dhapis['face_bind'], json=json_data)
|
self.request(**dhapis['face_bind'], json=json_data)
|
||||||
|
|
||||||
|
def face_deploy(self):
|
||||||
|
|
||||||
|
params = {
|
||||||
|
"id": "001001001",
|
||||||
|
"checkStat": "1",
|
||||||
|
"type": "001;00_1;1",
|
||||||
|
"capability": "1_00000000000000000000000100000000",
|
||||||
|
"curCount": "0",
|
||||||
|
"isDomain": 0
|
||||||
|
}
|
||||||
|
_, res = self.request(**dhapis['dev_tree'], params=params)
|
||||||
|
for i in json.loads(res):
|
||||||
|
json_data = {
|
||||||
|
"minSimilarity": "70",
|
||||||
|
"dpMinSimilarity": 70,
|
||||||
|
"surveyType": ["1"],
|
||||||
|
"groups": str(settings.DAHUA_FACEGROUPID_1),
|
||||||
|
"chnId": i['id']
|
||||||
|
}
|
||||||
|
self.request(**dhapis['face_deploy'], json=json_data)
|
||||||
|
|
|
@ -119,6 +119,10 @@ dhapis = {
|
||||||
"face_search": {
|
"face_search": {
|
||||||
"url": "/evo-apigw/evo-face/faceSearch/third/faceSearchSync",
|
"url": "/evo-apigw/evo-face/faceSearch/third/faceSearchSync",
|
||||||
"method": "post"
|
"method": "post"
|
||||||
|
},
|
||||||
|
"face_deploy": {
|
||||||
|
"url": "/evo-apigw/evo-face/channelGroup/add/batch",
|
||||||
|
"method": "post"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@ class DahuaTestView(MyLoggingMixin, APIView):
|
||||||
permission_classes = [IsAuthenticated]
|
permission_classes = [IsAuthenticated]
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
res = dhClient.face_search(path='/media/2022/07/13/three.jpg')
|
# res = dhClient.face_search(path='/media/2022/07/13/three.jpg')
|
||||||
|
res = dhClient.face_deploy()
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue