|
@@ -132,12 +132,12 @@ class UnicomComboTaskView(View):
|
|
flow_total = combo_qs['flow_total']
|
|
flow_total = combo_qs['flow_total']
|
|
# 队列已使用总流量总量
|
|
# 队列已使用总流量总量
|
|
flow_total_usage = unicom_api.get_flow_usage_total(iccid)
|
|
flow_total_usage = unicom_api.get_flow_usage_total(iccid)
|
|
- logger.info('--->{}-{},iccid:{};套餐总值:{},激活时当月用量值:{},套餐队列已使用流量量:{}'
|
|
|
|
- .format(year, month, iccid, flow_total, activate_usage_flow, flow_total_usage))
|
|
|
|
|
|
+ logger.info('--->iccid:{};套餐总值:{},激活时队列已用总流量:{},当前最新套餐队列已使用流量量:{}'
|
|
|
|
+ .format(iccid, flow_total, activate_usage_flow, flow_total_usage))
|
|
is_expire = False
|
|
is_expire = False
|
|
|
|
+ flow = activate_usage_flow + flow_total
|
|
if flow_total_usage > 0:
|
|
if flow_total_usage > 0:
|
|
# 初始套餐已使用流量 + 套餐总流量
|
|
# 初始套餐已使用流量 + 套餐总流量
|
|
- flow = activate_usage_flow + flow_total
|
|
|
|
if flow_total_usage >= flow:
|
|
if flow_total_usage >= flow:
|
|
is_expire = True
|
|
is_expire = True
|
|
usage = (flow_total_usage - activate_usage_flow) if flow_total_usage > activate_usage_flow else 0
|
|
usage = (flow_total_usage - activate_usage_flow) if flow_total_usage > activate_usage_flow else 0
|
|
@@ -146,7 +146,9 @@ class UnicomComboTaskView(View):
|
|
|
|
|
|
# 检查是否有当月未使用套餐 没有则停卡
|
|
# 检查是否有当月未使用套餐 没有则停卡
|
|
if is_expire:
|
|
if is_expire:
|
|
- UnicomComboOrderInfo.objects.filter(id=item['id']).update(status=2, updated_time=now_time)
|
|
|
|
|
|
+ flow_exceed = flow_total_usage - flow
|
|
|
|
+ UnicomComboOrderInfo.objects.filter(id=item['id']) \
|
|
|
|
+ .update(status=2, updated_time=now_time, flow_exceed=flow_exceed)
|
|
activate_status = cls.query_unused_combo_and_activate(iccid, year, month,
|
|
activate_status = cls.query_unused_combo_and_activate(iccid, year, month,
|
|
flow_total_usage)
|
|
flow_total_usage)
|
|
if not activate_status:
|
|
if not activate_status:
|