|
@@ -26,6 +26,7 @@ from Object.EIoTClubObject import EIoTClubObject
|
|
|
from Object.Enums.WXOperatorEnum import WXOperatorEnum
|
|
|
from Object.RedisObject import RedisObject
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
+from Object.TelecomObject import TelecomObject
|
|
|
from Object.TokenObject import TokenObject
|
|
|
from Object.UnicomObject import UnicomObjeect
|
|
|
from Object.WXTechObject import WXTechObject
|
|
@@ -403,6 +404,11 @@ class UnicomComboView(View):
|
|
|
params['status'] = 2
|
|
|
UnicomDeviceInfo.objects.create(**params)
|
|
|
return response.json(0)
|
|
|
+ elif cls.is_telecom_sim(iccid): # 鼎芯电信
|
|
|
+ params['card_type'] = 3
|
|
|
+ params['status'] = 2
|
|
|
+ UnicomDeviceInfo.objects.create(**params)
|
|
|
+ return response.json(0)
|
|
|
elif cls.check_iccid(iccid): # 五兴物联卡
|
|
|
params['card_type'] = 1
|
|
|
params['status'] = 2
|
|
@@ -417,6 +423,22 @@ class UnicomComboView(View):
|
|
|
logger.info('UnicomComboView.iccid_bind_serial_no error{}'.format(ex))
|
|
|
return response.json(177, repr(e))
|
|
|
|
|
|
+ @classmethod
|
|
|
+ def is_telecom_sim(cls, iccid):
|
|
|
+ """
|
|
|
+ 判断是否电信SIM卡
|
|
|
+ @param iccid: iccid
|
|
|
+ @return: 是否鼎芯电信卡
|
|
|
+ """
|
|
|
+ try:
|
|
|
+ telecom = TelecomObject()
|
|
|
+ result = telecom.query_card_main_status(iccid[0:19])
|
|
|
+ return result['resultCode'] == '0'
|
|
|
+ except Exception as e:
|
|
|
+ LOGGER.info('*****UnicomComboView.is_telecom_sim*****error_line:{}, error_msg:{}'
|
|
|
+ .format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
+ return False
|
|
|
+
|
|
|
@classmethod
|
|
|
def is_unicom_sim(cls, iccid):
|
|
|
"""
|