|
@@ -9,7 +9,7 @@ from django.views.generic.base import View
|
|
|
|
|
|
from Ansjer.config import OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, \
|
|
|
SERVER_TYPE
|
|
|
-from Model.models import Device_Info, VodBucketModel
|
|
|
+from Model.models import Device_Info, VodBucketModel, DeviceTypeModel
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.TokenObject import TokenObject
|
|
|
from Model import models
|
|
@@ -90,10 +90,10 @@ class MassageView(View):
|
|
|
return response.json(0, {"list": [], "total": 0})
|
|
|
|
|
|
# 过滤条件
|
|
|
- if user_id is not None:
|
|
|
+ if user_id is not None and user_id != "":
|
|
|
query &= Q(device_user_id=user_id)
|
|
|
|
|
|
- if uids is not None:
|
|
|
+ if uids is not None and uids != "":
|
|
|
uid_list = uids.split(',')
|
|
|
query &= Q(device_uid__in=uid_list)
|
|
|
|
|
@@ -230,6 +230,7 @@ class MassageView(View):
|
|
|
img_list = []
|
|
|
|
|
|
uid_type = Device_Info.objects.filter(UID=uid).values('Type').first()
|
|
|
+ device_type = DeviceTypeModel.objects.filter(type=uid_type['Type']).values('name').first()
|
|
|
border_coords = '' if border_coords == '' else eval(border_coords)
|
|
|
ai_event_type_list = []
|
|
|
|
|
@@ -238,7 +239,6 @@ class MassageView(View):
|
|
|
ai_event_type_list = list(map(int, str(event_type)))
|
|
|
if EquipmentInfoService.is_combo_tag(event_type, event_tag):
|
|
|
ai_event_type_list += EquipmentInfoService.get_combo_types(event_type, event_tag)
|
|
|
-
|
|
|
equipment_info_data = {
|
|
|
"uid": uid,
|
|
|
"status": equipment_info.status,
|
|
@@ -255,8 +255,8 @@ class MassageView(View):
|
|
|
"eventTag": event_tag,
|
|
|
"img": img_url,
|
|
|
"imgList": img_list,
|
|
|
- "uidType": uid_type["Type"],
|
|
|
- "aiEventTypeList": ai_event_type_list,
|
|
|
+ "uidType": device_type["name"],
|
|
|
+ "aiEventTypeList": str(ai_event_type_list),
|
|
|
}
|
|
|
equipment_info_list.append(equipment_info_data)
|
|
|
|