45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
|
|
"""迁移 033:补充宏利 SIUL 3 IUL 产品配置。"""
|
|||
|
|
import json
|
|||
|
|
import logging
|
|||
|
|
|
|||
|
|
from sqlalchemy import text
|
|||
|
|
|
|||
|
|
logger = logging.getLogger(__name__)
|
|||
|
|
|
|||
|
|
|
|||
|
|
def migrate():
|
|||
|
|
from insurance.db.compat import db
|
|||
|
|
|
|||
|
|
db.session.execute(text(
|
|||
|
|
"INSERT INTO insurance_ppt_products "
|
|||
|
|
"(id, company_id, plan_type, display_name, aliases_json, "
|
|||
|
|
"required_modules_json, status, sort_order) "
|
|||
|
|
"SELECT :id, :company_id, :plan_type, :display_name, :aliases_json, "
|
|||
|
|
":required_modules_json, 1, 20 "
|
|||
|
|
"WHERE NOT EXISTS ("
|
|||
|
|
"SELECT 1 FROM insurance_ppt_products WHERE id = :id"
|
|||
|
|
")"
|
|||
|
|
), {
|
|||
|
|
"id": "manulife-siul3-iul",
|
|||
|
|
"company_id": "manulife",
|
|||
|
|
"plan_type": "iul",
|
|||
|
|
"display_name": "Manulife SIUL 3",
|
|||
|
|
"aliases_json": json.dumps([
|
|||
|
|
"SIUL 3",
|
|||
|
|
"SIUL3",
|
|||
|
|
"Manulife SIUL",
|
|||
|
|
"Manulife Strategic Indexed Universal Life",
|
|||
|
|
], ensure_ascii=False),
|
|||
|
|
"required_modules_json": json.dumps([
|
|||
|
|
"cover",
|
|||
|
|
"company",
|
|||
|
|
"index-account-configuration",
|
|||
|
|
"guaranteed-floor-analysis",
|
|||
|
|
"legacy-leverage-analysis",
|
|||
|
|
"recommendation",
|
|||
|
|
"closing",
|
|||
|
|
], ensure_ascii=False),
|
|||
|
|
})
|
|||
|
|
db.session.commit()
|
|||
|
|
logger.info("[migrate_033] 已补充宏利 SIUL 3 产品配置")
|