|
@@ -290,7 +290,7 @@ class UnicomComboView(View):
|
|
|
if combo_experience_history_qs.exists():
|
|
|
combo_experience_history_qs.delete()
|
|
|
redis.set_data(key, iccid, 60 * 30) # 缓存当前SIM卡,记录为半个小时内无法赠送免费流量套餐。
|
|
|
- UnicomObjeect().change_device_to_activate(iccid)
|
|
|
+ UnicomObjeect().change_device_to_disable(iccid)
|
|
|
logger.info('4GResetFlow相关订单号:{}'.format(order_list))
|
|
|
describe = '重置4G流量序列号{},iccid:{}'.format(serial_no, iccid)
|
|
|
ip = CommonService.get_ip_address(request)
|
|
@@ -379,19 +379,18 @@ class UnicomComboView(View):
|
|
|
n_time = int(time.time())
|
|
|
try:
|
|
|
logger.info('--->参数验证通过,sign验证通过')
|
|
|
- redis = RedisObject()
|
|
|
with transaction.atomic():
|
|
|
ip = CommonService.get_ip_address(request)
|
|
|
# 待完善代码 根据uid与用户id验证系统设备mdcmd
|
|
|
unicom_device_qs = UnicomDeviceInfo.objects.filter(iccid=iccid)
|
|
|
if unicom_device_qs.exists():
|
|
|
- if unicom_device_qs.first().status == 1:
|
|
|
- key = 'ASJ:UNICOM:RESET:{}'.format(serial_no)
|
|
|
- reset_cache = redis.get_data(key)
|
|
|
- if reset_cache:
|
|
|
- logger.info('--->三十分后再次访问接口生效赠送流量套餐')
|
|
|
- return response.json(0, 'Thirty minutes later to visit again take effect')
|
|
|
- cls.user_activate_flow(iccid)
|
|
|
+ # if unicom_device_qs.first().status == 1:
|
|
|
+ # key = 'ASJ:UNICOM:RESET:{}'.format(serial_no)
|
|
|
+ # reset_cache = redis.get_data(key)
|
|
|
+ # if reset_cache:
|
|
|
+ # logger.info('--->三十分后再次访问接口生效赠送流量套餐')
|
|
|
+ # return response.json(0, 'Thirty minutes later to visit again take effect')
|
|
|
+ # cls.user_activate_flow(iccid)
|
|
|
if unicom_device_qs.first().serial_no != serial_no:
|
|
|
unicom_device_qs.update(main_card=sim, updated_time=n_time, serial_no=serial_no)
|
|
|
cls.create_operation_log('unicom/api/device-bind',
|
|
@@ -416,7 +415,7 @@ class UnicomComboView(View):
|
|
|
if res_dict['data']['status'] == 0:
|
|
|
logger.info('--->设备请求绑定{}验证不存在{}'.format(iccid, res_dict))
|
|
|
return response.json(173)
|
|
|
- unicom_obj.change_device_to_activate(iccid)
|
|
|
+ # unicom_obj.change_device_to_activate(iccid)
|
|
|
UnicomDeviceInfo.objects.create(**params)
|
|
|
cls.create_operation_log('unicom/api/device-bind',
|
|
|
ip, request_dict, '4G序列号{}绑定{}'.format(serial_no, iccid))
|