|
@@ -369,7 +369,7 @@ class UnicomComboView(View):
|
|
sign = request_dict.get('sign', None)
|
|
sign = request_dict.get('sign', None)
|
|
sim = int(request_dict.get('sim', 1))
|
|
sim = int(request_dict.get('sim', 1))
|
|
logger = logging.getLogger('info')
|
|
logger = logging.getLogger('info')
|
|
- logger.info('--->设备调用4G注册接口')
|
|
|
|
|
|
+ logger.info('--->设备调用4G注册接口{}'.format(request_dict))
|
|
logger.info('iccid:{},serial_no:{}'.format(iccid, serial_no))
|
|
logger.info('iccid:{},serial_no:{}'.format(iccid, serial_no))
|
|
if not all([iccid, serial_no, sign, time_stamp]):
|
|
if not all([iccid, serial_no, sign, time_stamp]):
|
|
return response.json(444)
|
|
return response.json(444)
|
|
@@ -378,8 +378,8 @@ class UnicomComboView(View):
|
|
return response.json(13)
|
|
return response.json(13)
|
|
n_time = int(time.time())
|
|
n_time = int(time.time())
|
|
try:
|
|
try:
|
|
- logger.info('--->参数验证通过,sign验证通过')
|
|
|
|
ip = CommonService.get_ip_address(request)
|
|
ip = CommonService.get_ip_address(request)
|
|
|
|
+ logger.info('--->参数验证通过,sign验证通过{}:{}'.format(serial_no, ip))
|
|
# 待完善代码 根据uid与用户id验证系统设备mdcmd
|
|
# 待完善代码 根据uid与用户id验证系统设备mdcmd
|
|
unicom_device_qs = UnicomDeviceInfo.objects.filter(iccid=iccid)
|
|
unicom_device_qs = UnicomDeviceInfo.objects.filter(iccid=iccid)
|
|
if unicom_device_qs.exists():
|
|
if unicom_device_qs.exists():
|
|
@@ -400,6 +400,7 @@ class UnicomComboView(View):
|
|
cls.create_operation_log('unicom/api/device-bind',
|
|
cls.create_operation_log('unicom/api/device-bind',
|
|
ip, request_dict, '4G序列号{}新绑定鼎芯{}'.format(serial_no, iccid))
|
|
ip, request_dict, '4G序列号{}新绑定鼎芯{}'.format(serial_no, iccid))
|
|
return response.json(0)
|
|
return response.json(0)
|
|
|
|
+ logger.error("{}外置卡或判断鼎芯国际卡异常".format(serial_no))
|
|
return response.json(0, '外置卡不保存相关信息{}'.format(serial_no))
|
|
return response.json(0, '外置卡不保存相关信息{}'.format(serial_no))
|
|
|
|
|
|
if cls.is_unicom_sim(iccid): # 联通卡
|
|
if cls.is_unicom_sim(iccid): # 联通卡
|
|
@@ -500,7 +501,7 @@ class UnicomComboView(View):
|
|
assert result['code'] == '200'
|
|
assert result['code'] == '200'
|
|
return True
|
|
return True
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- print(repr(e))
|
|
|
|
|
|
+ LOGGER.error("{}iccid判断是否鼎芯国际卡异常{}".format(iccid, repr(e)))
|
|
return False
|
|
return False
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -697,7 +698,8 @@ class UnicomComboView(View):
|
|
notify_url,
|
|
notify_url,
|
|
unicom_combo_qs['remark'], response)
|
|
unicom_combo_qs['remark'], response)
|
|
res_data = {'redirectUrl': order_dict['pay_url'], 'orderID': order_id}
|
|
res_data = {'redirectUrl': order_dict['pay_url'], 'orderID': order_id}
|
|
- cls.create_order_pay_log(order_id, f'{serial_number}购买联通4G套餐', notify_url, 'aliPay', 'SUCCESS')
|
|
|
|
|
|
+ cls.create_order_pay_log(order_id, f'{serial_number}购买联通4G套餐', notify_url, 'aliPay',
|
|
|
|
+ 'SUCCESS')
|
|
elif pay_type == 3: # 微信支付
|
|
elif pay_type == 3: # 微信支付
|
|
notify_url = 'unicom/wap/pay/wechat-notify'
|
|
notify_url = 'unicom/wap/pay/wechat-notify'
|
|
ip = CommonService.get_ip_address(request)
|
|
ip = CommonService.get_ip_address(request)
|
|
@@ -709,7 +711,8 @@ class UnicomComboView(View):
|
|
product_name,
|
|
product_name,
|
|
response)
|
|
response)
|
|
result['result'] = sign_params
|
|
result['result'] = sign_params
|
|
- cls.create_order_pay_log(order_id, f'{serial_number}购买联通4G套餐', notify_url, 'wechatPay', 'SUCCESS')
|
|
|
|
|
|
+ cls.create_order_pay_log(order_id, f'{serial_number}购买联通4G套餐', notify_url, 'wechatPay',
|
|
|
|
+ 'SUCCESS')
|
|
else:
|
|
else:
|
|
return response.json(444, {'param': 'pay_type'})
|
|
return response.json(444, {'param': 'pay_type'})
|
|
|
|
|
|
@@ -1177,7 +1180,8 @@ class UnicomComboView(View):
|
|
LOGGER.info(f'{serial_no}有正在使用的套餐')
|
|
LOGGER.info(f'{serial_no}有正在使用的套餐')
|
|
return True
|
|
return True
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- LOGGER.info('{}判断是否4G设备异常,errLine:{}, errMsg:{}'.format(serial_number, e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
+ LOGGER.info(
|
|
|
|
+ '{}判断是否4G设备异常,errLine:{}, errMsg:{}'.format(serial_number, e.__traceback__.tb_lineno, repr(e)))
|
|
return False
|
|
return False
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|