|
@@ -925,7 +925,7 @@ class DeviceManagement(View):
|
|
|
@staticmethod
|
|
|
def get_uid_push(request_dict, response):
|
|
|
"""
|
|
|
- 查询UID对应的推送信息
|
|
|
+ 查询设备信息详情信息
|
|
|
@param request_dict: 请求参数
|
|
|
@request_dict UID: UID
|
|
|
@param response: 响应对象
|
|
@@ -935,8 +935,25 @@ class DeviceManagement(View):
|
|
|
if not uid:
|
|
|
return response.json(444)
|
|
|
try:
|
|
|
- uid_set_qs = UidSetModel.objects.get(uid=uid)
|
|
|
+ uid_set_qs = UidSetModel.objects.filter(uid=uid).first()
|
|
|
data = model_to_dict(uid_set_qs)
|
|
|
+ ALGORITHM_COMBO_TYPES = ['移动', '人形', '车型', '宠物', '人脸', '异响', '闯入', '离开', '徘徊',
|
|
|
+ '无人', '往来', '哭声', '手势', '火焰', '婴儿', '包裹']
|
|
|
+ if data['ai_type'] > 0:
|
|
|
+ num = data['ai_type']
|
|
|
+ result = ""
|
|
|
+ while num != 0:
|
|
|
+ ret = num % 2
|
|
|
+ num //= 2
|
|
|
+ result = str(ret) + result
|
|
|
+ types = []
|
|
|
+ event_type = result
|
|
|
+ len_type = len(event_type)
|
|
|
+ for i in range(len_type):
|
|
|
+ e_type = event_type[len_type - 1 - i]
|
|
|
+ if e_type == '1':
|
|
|
+ types.append(str(ALGORITHM_COMBO_TYPES[i]))
|
|
|
+ data['ai_type'] = types
|
|
|
# uid_set查uid_push
|
|
|
uid_pushes_qs = UidPushModel.objects.filter(uid_set_id=uid_set_qs.id).select_related('userID')
|
|
|
uid_push_data = []
|