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