luoweijian
cd7dadec3a
feat(dict): 种 attachment_type 商机资料类型 (产品录入 20260825)
- attachment_type 5 项: 现场资料/涉及清单图纸/客户需求资料/招投标相关资料/其他 (票09 附件分类)
- 分组 21→22, item 163→168; 种子测试断言同步, 全绿
行业树形仍挂起: 路② (DictItem 加 parent_id 建两级树) = crm-dict 基础模型扩展, 待立 spec 票 + grill 拍板不变式后单独 implement
2 weeks ago
luoweijian
e083071da6
feat(dict): 再种 5 个商机子表字典分组 (产品录入 20260825)
新增分组 (契约 code 对齐实体字段):
- locality_type 项目属地 (本地项目/异地项目, 主表 Opportunity.localityType 必填)
- follow_way 跟进方式 (5 项, OpportunityFollow.followWay)
- survey_seq 勘察次数 (第一/二/三次+三次以上封顶, OpportunitySiteSurvey.surveySeq)
- apply_way 申请方式 (工单申请/线下申请, OpportunitySiteSurvey.applyWay)
- customer_role 客户角色 (6 项, OpportunityCustomer.customerRole)
分组 16→21, item 144→163 (+19); 种子测试断言同步, 45 全绿
仍缺: attachment_type 商机资料类型 (未给值); industry_code 挂起待产品
2 weeks ago
luoweijian
d68aa067e2
feat(dict): 初始化 9 个商机字典分组种子 (产品录入 20260825)
新增分组 (契约 code 对齐 PRD §10/票 09/票 01):
- opp_source 商机来源 (线索转入/线下挖掘/客户转介绍)
- opp_type 商机类型 (新建/改造/升级)
- bid_form 招标形式 (ZC政采/GC工程/BC EPC总分包/YB邀标)
- result_tag 跟进结果标签 (8 项)
- design_config 设计配置 (6 项, 方案卡字段选项集)
- pause_reason 暂缓原因 (6 项)
- pool_reason 进入公海原因 (5 项)
- project_role 商机项目角色 (6 项, OpportunityTeam.projectRole)
- close_reason 关闭原因 (6 项)
item code = 分组前缀_序号 (同构 OPP_STAGE_0x, 避免中文项英译歧义), 47 项
分组 7→16, item 97→144; 种子测试断言同步更新, 45 全绿
2 weeks ago
luoweijian
01900ca76a
feat(opportunity): 票 06 商机阶段模板 + 阶段运行时落地(轴2)
- crm-rule:阶段模板 V-CONFIG 版本状态机(头表/适用部门/阶段节点三实体 + 草稿三分支/发布顶替/默认顶替/复制/停用/仅草稿可删),固定节点「已转项目」系统规范化(入参拒绝伪造、末位补唯一),节点字典引用校验(仅「商机阶段」分组启用项可新增引用,票01 定稿方向引入 crm-dict 依赖),绑定匹配(部门专用优先/多命中取最近创建/默认兜底),错误码 64013-64017,权限种子仅菜单
- crm-opportunity:opportunity_stage_history 快照 + 阶段自由切换(CAS 锚 current_stage_id、仅推进中可切 66005、固定节点/跨版本禁切 66006)、三态进度/历史查询端点;转项目端口 E8 成功后联动驱动固定节点(系统身份 0L、幂等、缺固定节点告警跳过)
- crm-dict:新增「商机阶段」字典分组种子(OPP_STAGE_01..05)及初始化测试断言同步
- 测试:阶段模板状态机 41 用例 + 阶段运行时 17 用例 + ConvertPort 联动断言;全反应器 662 用例绿
2 weeks ago
luoweijian
f11b840c3e
commit
3 weeks ago
luoweijian
ea212fa8b6
feat: 字典种子对齐蓝湖原型——lead_source 改渠道 38 项并新增 brand/product/scene(frontend-integration 票据 02)
3 weeks ago
luoweijian
0b4c4d2bbb
refactor: align dict tests with DTO return types (ADR-0017 tickets 03/04)
4 weeks ago
luoweijian
a542e48f86
commit
4 weeks ago
luoweijian
51b7e2a749
feat(auth,dict,base): extract PermissionSeeder seam to replace shadow entities (ADR-0016)
- Add PermissionSeeder interface + PermissionModuleDescriptor/ButtonSeed records in crm-base
- Implement PermissionSeederImpl in crm-auth with find-or-create idempotent seeding
- Refactor DataInitializer to use seam (3 seedModule calls) + @Order(1)
- Refactor DictPermissionInitializer to use seam (1 seedModule call) + @Order(10)
- Delete 6 shadow entity/mapper files from crm-dict (SysMenuSeed, SysRoleSeed, SysRoleMenuSeed + mappers)
- Rewrite DictPermissionInitializerTest to mock PermissionSeeder (no more H2 auth tables)
- Add PermissionSeederImplTest (H2 integration test covering idempotency, catalog sharing, role-not-found)
- Add ADR-0016 documenting the decision, rationale, alternatives, and consequences
- Create crm-base/CONTEXT.md with PermissionSeeder domain glossary
- Update CONTEXT-MAP.md to link crm-base/CONTEXT.md
Eliminates schema leakage: crm-dict no longer knows sys_menu's physical schema.
Runtime dependency accepted: crm-dict needs crm-auth's PermissionSeederImpl at runtime (via crm-app classpath aggregation).
4 weeks ago
luoweijian
ab9f64483c
refactor(crm-dict): judgement call #6 #7 — pom version extraction + VO independent fields
#6 mybatis-spring 版本提取到父 pom:
- 父 pom properties 新增 mybatis-spring.version=3.0.3
- 父 pom dependencyManagement 新增 mybatis-spring 依赖声明
- crm-dict/pom.xml 去掉 version 和 scope=compile(由父 pom 统一管理)
#7 VO extends 实体重构为独立字段:
- DictGroupVO:不 extends DictGroup,独立定义 9 个字段(排除审计字段和软删内部字段)
- DictItemVO:不 extends DictItem,独立定义 14 个字段
- DictGroupServiceImpl:DictGroup::getId -> DictGroupVO::getId(fillItemCount)
- DictItemServiceImpl:DictItem::getGroupId -> DictItemVO::getGroupId(enrich)
- DictGroupServiceTest:pageGroups 断言 DictGroup::getCode -> DictGroupVO::getCode
全量 48/48 测试通过。
1 month ago
luoweijian
f3fba4a229
fix(dict): clear client-supplied audit fields in saveGroup/saveItem — prevent strictFill bypass forgery
saveGroup/saveItem accepted entity params whose createTime/creatorId/updaterId
were not sanitized; MetaObjectFillHandler uses strictInsertFill/strictUpdateFill
which only fills null fields, so client-supplied audit values were retained.
Now: null out all audit fields on entry (framework refills), restore
createTime/creatorId from exist on edit.
1 month ago
luoweijian
3d55eeb196
feat(dict): data dictionary module — two-level flat model, CRUD/default/cache/permission/seed (ADR-0015)
- 4 tables (dict_group/dict_item/dict_group_default/dict_ref_count), delete_key soft-delete reuse
- DictGroup/DictItem full CRUD + force-delete + status toggle + enabled-list
- DictReferenceService: increment/decrement/batchApply/isReferenced, same-tx ref_count, no cache
- DictQueryService: Caffeine 10s cache + 2s negative cache for empty results, group.status join
- Default item: INSERT ON DUPLICATE KEY UPDATE, hibernate on group disable, auto-restore
- Permission seeds: 10 perm codes → sys_menu tree, bound to ROLE_ADMIN, no crm-auth import
- Built-in dict initializer: idempotent upsert, builtin=false never touched (US-41), value not overwritten
- 48 tests pass; full project compiles
1 month ago