|
@@ -37,9 +37,6 @@ class UnicomManageControllerView(View):
|
|
|
# 添加和编辑卡套餐
|
|
|
elif operation == 'edit/combo':
|
|
|
return self.edit_combo(request_dict, response)
|
|
|
- # 获取卡用户信息
|
|
|
- elif operation == 'get/user':
|
|
|
- return self.get_user_combo(request_dict, response)
|
|
|
# 获取/筛选设备套餐订单信息
|
|
|
elif operation == 'order/info':
|
|
|
return self.get_order_info(request_dict, response)
|
|
@@ -49,13 +46,13 @@ class UnicomManageControllerView(View):
|
|
|
# 删除卡套餐
|
|
|
elif operation == 'dele/combo/info':
|
|
|
return self.combo_order_info(request_dict, response)
|
|
|
- # 筛选用户信息
|
|
|
+ # 获取/筛选用户信息
|
|
|
elif operation == 'filter/user':
|
|
|
return self.get_user_info(request_dict, response)
|
|
|
|
|
|
def get_user_info(self, request_dict, response):
|
|
|
"""
|
|
|
- 筛选卡用户信息
|
|
|
+ 获取/筛选卡用户信息
|
|
|
@param request_dict:
|
|
|
@param response:
|
|
|
@return:
|
|
@@ -104,6 +101,7 @@ class UnicomManageControllerView(View):
|
|
|
'serialNo': unicom_device.serial_no,
|
|
|
'userID': unicom_device.user_id,
|
|
|
'cardType': unicom_device.card_type,
|
|
|
+ 'status':unicom_device.status,
|
|
|
'mainCard': unicom_device.main_card,
|
|
|
'createdTime': unicom_device.created_time,
|
|
|
'updatedTime': unicom_device.updated_time
|
|
@@ -117,51 +115,6 @@ class UnicomManageControllerView(View):
|
|
|
print(e)
|
|
|
return response.json(500, repr(e))
|
|
|
|
|
|
- @staticmethod
|
|
|
- def get_user_combo(request_dict, response):
|
|
|
- """
|
|
|
- 获取卡用户信息
|
|
|
- @param request_dict:
|
|
|
- @param response:
|
|
|
- @return:
|
|
|
- """
|
|
|
- pageNo = request_dict.get('pageNo', None)
|
|
|
- pageSize = request_dict.get('pageSize', None)
|
|
|
- if not all([pageNo, [pageSize]]):
|
|
|
- return response.json(444)
|
|
|
- page = int(pageNo)
|
|
|
- line = int(pageSize)
|
|
|
- unicom_device_info_qs = UnicomDeviceInfo.objects.filter().values(
|
|
|
- 'iccid', 'serial_no', 'user_id', 'card_type', 'main_card', 'created_time', 'updated_time', 'status'
|
|
|
- ).order_by('-updated_time')
|
|
|
- total = unicom_device_info_qs.count()
|
|
|
- get_info_qs = unicom_device_info_qs[(page - 1) * line:page * line]
|
|
|
- try:
|
|
|
- res_list = []
|
|
|
- for item in get_info_qs:
|
|
|
- res = {
|
|
|
- 'serialNo': item['serial_no'],
|
|
|
- 'iccid': item['iccid'],
|
|
|
- 'status': item['status'],
|
|
|
- 'cardType': item['card_type'],
|
|
|
- 'mainCard': item['main_card'],
|
|
|
- 'createdTime': item['created_time'],
|
|
|
- 'updatedTime': item['updated_time']
|
|
|
- }
|
|
|
- usreID = item['user_id']
|
|
|
- user_info_qs = Device_User.objects.filter(userID=usreID).values(
|
|
|
- 'NickName', 'phone', 'username')
|
|
|
- if user_info_qs.exists():
|
|
|
- res['userID'] = usreID
|
|
|
- res['NickName'] = user_info_qs.first()['NickName']
|
|
|
- res['phone'] = user_info_qs.first()['phone']
|
|
|
- res['username'] = user_info_qs.first()['username']
|
|
|
- else:
|
|
|
- res['usreID'] = ''
|
|
|
- res_list.append(res)
|
|
|
- return response.json(0, {'list': res_list, 'total': total})
|
|
|
- except Exception as e:
|
|
|
- return response.json(500, repr(e))
|
|
|
|
|
|
@staticmethod
|
|
|
def get_order_info(request_dict, response):
|