|
@@ -9,7 +9,7 @@ from django.views.generic.base import View
|
|
|
|
|
|
from Ansjer.config import OSS_STS_ACCESS_SECRET, OSS_STS_ACCESS_KEY
|
|
|
from Model.models import Device_Info, UID_Bucket, UID_Preview, UidSetModel, UidPushModel, UidChannelSetModel, \
|
|
|
- iotdeviceInfoModel
|
|
|
+ iotdeviceInfoModel, UIDModel
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.TokenObject import TokenObject
|
|
|
from Service.CommonService import CommonService
|
|
@@ -325,6 +325,13 @@ class EquipmentManagerV2(View):
|
|
|
uv_dict[us['uid']]['channels'] = channels
|
|
|
|
|
|
for p in dvls:
|
|
|
+ # 如果存在序列号组织序列号数据返回
|
|
|
+ if p['serial_number']:
|
|
|
+ p2p_type = str(UIDModel.objects.filter(uid=p['UID']).values('p2p_type')[0]['p2p_type'])
|
|
|
+ # 设备类型转为16进制并补齐4位
|
|
|
+ device_type = hex(p['Type'])[2:]
|
|
|
+ device_type = (4-len(device_type)) * '0' + device_type
|
|
|
+ p['UID'] = p['serial_number'] + p2p_type + device_type
|
|
|
# 新增IOT
|
|
|
p['iot'] = []
|
|
|
for iot in iotqs:
|