|
@@ -10,8 +10,7 @@ from django.db import transaction, connection
|
|
|
from django.views.generic.base import View
|
|
|
|
|
|
from Controller.UnicomCombo.UnicomComboController import UnicomComboView
|
|
|
-from Model.models import UnicomDeviceInfo, UnicomCombo, Pay_Type, UnicomComboOrderInfo, Device_User, Device_Info, \
|
|
|
- Order_Model
|
|
|
+from Model.models import UnicomDeviceInfo, UnicomCombo, Pay_Type, UnicomComboOrderInfo, Device_User, Order_Model
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.UnicomObject import UnicomObjeect
|
|
|
from Service.CommonService import CommonService
|
|
@@ -56,6 +55,8 @@ class UnicomManageControllerView(View):
|
|
|
# 获取 / 筛选4G流量卡订单信息
|
|
|
elif operation == 'query-order':
|
|
|
return self.query_4G_user_order(request_dict, response)
|
|
|
+ elif operation == 'sim-info':
|
|
|
+ return self.get_iccid_info(request_dict, response)
|
|
|
else:
|
|
|
return response.json(0)
|
|
|
|
|
@@ -496,3 +497,21 @@ class UnicomManageControllerView(View):
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
|
return response.json(500, repr(e))
|
|
|
+
|
|
|
+ @classmethod
|
|
|
+ def get_iccid_info(cls, request_dict, response):
|
|
|
+ """
|
|
|
+ 获取联通iccid最新状态
|
|
|
+ """
|
|
|
+ try:
|
|
|
+ iccid = request_dict.get('iccid', None)
|
|
|
+ if not iccid:
|
|
|
+ return response.json(444)
|
|
|
+ re_data = {'iccid': iccid}
|
|
|
+ result = UnicomObjeect().query_device_status(**re_data)
|
|
|
+ res_dict = UnicomObjeect().get_text_dict(result)
|
|
|
+ # 状态不等于1(激活)时进行激活 1:激活;2:停用
|
|
|
+ return response.json(0, res_dict['data']['status'])
|
|
|
+ except Exception as e:
|
|
|
+ print(e)
|
|
|
+ return response.json(500, repr(e))
|