baodan/api/insurance/db/migrate_033.py
wsb1224 ed9f0327d2 已完成:
OCR 表格模式改为更适合计划书的 PSM 4。
分别支持斜杠年度、独立年度/年龄列、纵向压缩表格、保证/非保证双栏。
防止错误的坐标解析结果覆盖正确 OCR 数据。
身故利益表与退保价值表按保单年度合并。
修复吸烟状态、保额、年缴/单缴金额和缴费年期。
补齐 SIUL3、SBIUL2、GIUL3、FWD IF、AIA PIL2 产品配置。
多份计划书现在保留全部保司,不再只取第一家公司。
用户端保司选项、生成快照和渲染过程统一使用后台脱敏名
2026-08-01 19:12:17 +08:00

45 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""迁移 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 产品配置")