先短暂去除限制,上传迁移脚本
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m51s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m51s
This commit is contained in:
@@ -621,6 +621,20 @@ def _write_iot_cards(
|
||||
card_status = 2 if shop_code else 1
|
||||
shop_id_expr = _shop_id_sub(shop_code)
|
||||
|
||||
# 免停机迁移:代理配置 no_downtime=true 且卡在奇成有当前生效正式套餐
|
||||
# finalize 保证最后执行,此时 step2 套餐已落库,轮询系统不会在此之前触碰这张卡
|
||||
is_no_downtime = bool(meta.current_meal_id) and mapping.is_no_downtime_agent(meta.agent_id)
|
||||
if is_no_downtime:
|
||||
activation_status = 1
|
||||
real_name_status = 1 # 卡在线说明已实名,写 1 防止 EvaluateAndAct 因 not_realname 停机
|
||||
network_status = 1
|
||||
stop_reason_expr = "NULL"
|
||||
else:
|
||||
activation_status = 0
|
||||
real_name_status = 0
|
||||
network_status = 0
|
||||
stop_reason_expr = _sql_str(_initial_polling_stop_reason(c))
|
||||
|
||||
f.write(
|
||||
"INSERT INTO tb_iot_card (\n"
|
||||
" iccid, iccid_19, iccid_20,\n"
|
||||
@@ -636,9 +650,9 @@ def _write_iot_cards(
|
||||
f" {_sql_str(c.iccid_full)}, {_sql_str(c.iccid_19)}, {iccid_20_expr},\n"
|
||||
f" {carrier.target_carrier_id}, {_sql_str(carrier.target_carrier_type)}, {_sql_str(carrier.target_carrier_name)},\n"
|
||||
f" {_sql_str(card_category)}, {_sql_str(mapping.migration_batch_no)},\n"
|
||||
f" {card_status}, 0, 0, 0,\n"
|
||||
f" {card_status}, {activation_status}, {real_name_status}, {network_status},\n"
|
||||
f" 1, 1, {is_standalone},\n"
|
||||
f" 'after_order', {_sql_str(_initial_polling_stop_reason(c))},\n"
|
||||
f" 'after_order', {stop_reason_expr},\n"
|
||||
f" {_sql_str(meta.msisdn) if meta.msisdn else 'NULL'}, "
|
||||
f"{_sql_str(card_virtual_no) if card_virtual_no else 'NULL'}, "
|
||||
f"{shop_id_expr}, {series_id_expr},\n"
|
||||
|
||||
Reference in New Issue
Block a user