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