|
@@ -323,20 +323,14 @@ class EquipmentManagerV3(View):
|
|
|
UidChannelSet_bulk.append(UidChannelSet)
|
|
|
UidChannelSetModel.objects.bulk_create(UidChannelSet_bulk)
|
|
|
|
|
|
- # # 获取当前用户下最大 sort_order
|
|
|
- # max_sort_order = Device_Info.objects.filter(userID_id=userID).aggregate(
|
|
|
- # Max('sort_order'))['sort_order__max'] or 0
|
|
|
- # userDevice = Device_Info(id=id, userID_id=userID, UID=UID, NickName=NickName, View_Account=View_Account,
|
|
|
- # View_Password=View_Password, Type=Type, ChannelIndex=ChannelIndex,
|
|
|
- # version=version,
|
|
|
- # vodPrimaryUserID=vodPrimaryUserID, vodPrimaryMaster=vodPrimaryMaster,
|
|
|
- # sort_order=max_sort_order + 1)
|
|
|
-
|
|
|
+ # 获取当前用户下最大 sort_order
|
|
|
+ max_sort_order = Device_Info.objects.filter(userID_id=userID).aggregate(
|
|
|
+ Max('sort_order'))['sort_order__max'] or 0
|
|
|
userDevice = Device_Info(id=id, userID_id=userID, UID=UID, NickName=NickName, View_Account=View_Account,
|
|
|
View_Password=View_Password, Type=Type, ChannelIndex=ChannelIndex,
|
|
|
version=version,
|
|
|
- vodPrimaryUserID=vodPrimaryUserID, vodPrimaryMaster=vodPrimaryMaster)
|
|
|
-
|
|
|
+ vodPrimaryUserID=vodPrimaryUserID, vodPrimaryMaster=vodPrimaryMaster,
|
|
|
+ sort_order=max_sort_order + 1)
|
|
|
userDevice.save()
|
|
|
# 保存用户推送按钮信息
|
|
|
button_qs = UserAudioVideoPush.objects.filter(uid=UID)
|
|
@@ -835,7 +829,7 @@ class EquipmentManagerV3(View):
|
|
|
if tko.code != 0:
|
|
|
return response.json(tko.code)
|
|
|
userID = tko.userID
|
|
|
- # UserDeviceService.init_device_sort_order(userID)
|
|
|
+ UserDeviceService.init_device_sort_order(userID)
|
|
|
group_id = int(request_dict.get('groupId', 0))
|
|
|
# 查询设备列表以及设备uid集合
|
|
|
dv_list, uid_list = UserDeviceService.query_device_list(userID, uid, NickName, page, line, group_id)
|