luoweijian
|
042401c57b
|
feat(opportunity): 票11/12/13 线索转商机新建端口实现 + ADR-0029 技术债
实现 crm-lead 的 outbound port OpportunityCreationPort(此前定义未实现,
根因是 crm-opportunity 未依赖 crm-lead):
- OpportunityCreationPortImpl(同库同事务,ADR-0020):
· 票12 source_lead_id 唯一性预检(应用层友好报错 + DB uk 并发最终防线,
DuplicateKeyException 转译为 OpportunityCreationException)
· 票11 建商机主表:初始推进中(2) + 落归属/来源快照 + claimTime
· 票13 customerId 非空 → 建 is_primary_intended=1 主要意向客户子表 +
刷主表冗余 primary_customer_id/name(走法甲:customerId 可空则跳过,
不倒退现有自由文本转商机)
- 5 单测:唯一性命中/带客户建子表刷冗余/无客户跳过/初始态快照/并发uk转译
- crm-opportunity/pom.xml 依赖 crm-lead
- ADR-0029 记技术债:下游反向依赖上游,埋循环依赖雷(crm-lead 将来读商机即死循环),
当前同库单体阶段可接受,触发条件出现时改抽共享 port 契约模块并 supersede
省市 TODO:cmd 单 regionCode → 主表 province/city 两列 not null,暂同填占位,
待省市拆分专票。mvn -pl crm-opportunity -am test 152 全绿。
|
2 weeks ago |
luoweijian
|
f7e06f699f
|
feat(opportunity): 票 07 方案卡运行时收尾 + V-CONFIG 三族版本机制抽公共
方案卡(票 07):
- 创建改手动选模板版本(PRD §7.2/L499 不自动匹配),候选=发布中且适用范围
命中负责人部门(专用∪通用),空则前端置灰;新增 listSelectableTemplates 下拉数据
- DTO 收敛:删 SchemeCardSaveDTO,统一双向 SchemeCardDTO(ADR-0017 Route A),
values→valuesJson 隐式表单绑定;StageController 同步改齐 SwitchStageDTO
- 软删对齐 §7:新建卡 delete_key=0
V-CONFIG 抽公共(票 05/06/07 同族):
- 新增 VersionedConfigSupport 基类,收敛 minor 版本号顺延/编码顺延/纯状态迁移;
三 ServiceImpl 继承,领域校验与子表替换仍各票自持
- 种子字段库 SchemeFieldDefInitializer:16 项系统字段 + 全公司通用兜底模板
(OPP_SCHEME_TPL_01,幂等键=编码含已停用,停用后重启不复活)
CONTEXT/ADR/PRD spec 回填 + 错别字修正(兑底→兜底)
测试:crm-rule 129 + crm-opportunity 100 全绿
|
2 weeks ago |
luoweijian
|
6583863b49
|
commit
|
2 weeks ago |
luoweijian
|
3d0699df6f
|
commit
|
3 weeks ago |
luoweijian
|
1d6c9c6d7a
|
commit
|
3 weeks ago |
luoweijian
|
dfd1fc6f01
|
commit
|
3 weeks ago |
luoweijian
|
70b53de34c
|
commit
|
3 weeks ago |
luoweijian
|
b345c4dc7b
|
commit
|
3 weeks ago |
luoweijian
|
78aa9748e4
|
feat: 数据权限按业务模块可配(ADR-0018)
将数据权限从「单一全局档位」改造为「按业务模块分别配置档位」:
- 新增 sys_data_scope_module 注册表 + sys_role_data_scope 角色×模块档位表
- @DataScope 注解新增必填 module 属性,启动时校验 code 在注册表中存在
- DataVisibility 持有 Map<String, DataScopeLevel> 替代单个 level
- DataVisibilityContext.currentScope(moduleCode) 加参数取该模块的 scope
- DataScopeInterceptor 顺序调换:先找表→查注解→取该模块 scope→注入 WHERE
- PermissionResolverImpl 查 sys_role_data_scope 按 module_code 分组取最宽
- 删除 SysRole.dataScope 列 + 删除 DataScopeEnum.CUSTOM(5)
- RoleController saveOrUpdate 用 moduleScopes JSON 替代 dataScope
- 新增 GET /api/data-scope/modules 端点
- saveRoleWithScopes 原子事务(角色保存+范围全量替换同提交同回滚)
- DataScopeModuleController 返回 DTO 不泄露 BaseEntity 审计字段
- 一次性迁移 SQL 脚本(单事务,CROSS JOIN 旧值,DROP 旧列)
- DataInitializer 初始化 4 个内置模块 + ADMIN 每模块 ALL 档位
- 全量测试通过:crm-base 80 tests + crm-auth 153 tests
|
4 weeks ago |
luoweijian
|
96230913ae
|
refactor: SystemController IO to DTOs (ADR-0017 ticket 07)
- new DeptDTO (extends BaseDTO, children tree, fromEntity/toEntity)
- new AssignDeptDTO (plain POJO, no key semantics)
- rename UserStatsVO -> UserStatsDTO
- menuTree returns List<ResourceNodeDTO>; PermissionResolver.visibleMenuTree maps entity->DTO before tree build
- deptTree returns List<DeptDTO>; saveDept takes DeptDTO; assignUserDepts takes AssignDeptDTO
- userPage drops @RequestBody -> form binding (aligns with documented form-urlencoded convention)
- sync role-management doc RoleDetailVO -> RoleDTO
- DataScopeIntegrationTest updated for ResourceNodeDTO
|
4 weeks ago |
luoweijian
|
f989b566cc
|
refactor: rename ResourceNode to ResourceNodeDTO extending BaseDTO (ADR-0017 ticket 05)
|
4 weeks ago |
luoweijian
|
b50002f47f
|
commit
|
4 weeks ago |
luoweijian
|
ae103a1f1c
|
refactor: BaseDTO 重构为 abstract 基类 + IBaseService 清理死代码 (ADR-0017 ticket 01)
- BaseDTO 改为 abstract,仅保留 id/createTime/updateTime(均加 @JsonInclude NON_NULL)
- 移除 creatorId/updaterId/deleted 字段及默认值——防止出参侧泄露
- 移除泛型 toEntity(Supplier) 方法——转换方法下沉到各 DTO 类
- IBaseService 删除 saveDTO/updateDTO 死代码(零调用方)
- BeanCopyUtils javadoc 同步更新(移除 BaseDTO.toEntity 引用)
- README §3/§4/§10 同步更新 BaseDTO 和 IBaseService 说明
- 修复 ResourceController/RoleController 预存 UTF-8 BOM 问题
- 新增 ADR-0017、spec.md、7 个 implementation tickets
Refs: ADR-0017, .scratch/controller-io-conventions/
|
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
|
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 |
luoweijian
|
50f79a884d
|
commit
|
1 month ago |
luoweijian
|
3499353b28
|
feat(file): thumbnail preview - async generation + sync fallback, PDFBox/LibreOffice renderers, retry (ADR-0013)
|
1 month ago |
luoweijian
|
a263f1736c
|
feat(auth): role management — ancestor completion, CRUD, permission assignment, cascade delete (ADR-0012)
Implements ADR-0005 (backend ancestor completion) and ADR-0012 (role management
architecture) across 5 tracer-bullet tickets:
- ISysMenuService.getAncestorIds: batch query full table, in-memory parentId
traversal, returns complete ancestor set (ADR-0005)
- SysRole.builtin field + DataInitializer idempotent refactor + 5 button
permission seeds (crm:role:list/detail/save/delete/assign) bound to ADMIN
- RoleController (/api/roles/*): page, saveOrUpdate, detail, assign-resources,
delete — pure hasAuthority, POST + action suffix, form params
- SysRoleServiceImpl.saveRole: roleCode uniqueness, builtin protection,
dataScope 1-4 range, create can't set builtin=true
- assignResources: calls getAncestorIds for ancestor completion, then
full replacement (delete + insert) of sys_role_menu
- getRoleDetail: returns RoleDetailVO with basic info + resourceIds
- deleteRoleCascade: cleans sys_role_menu + sys_user_role, builtin rejection,
three-table transaction
- SystemController: all role endpoints removed, unused deps cleaned
- Dead code removed: assignMenus, getMenuIdsByRoleId (superseded by
assignResources, getRoleDetail)
- H2 test schemas updated with builtin column
- 150 tests pass (16 new in SysRoleServiceImplTest, 7 in SysMenuServiceImplTest)
|
1 month ago |
luoweijian
|
ae038a1398
|
feat: /api/resources/list 后端组树返回 — TreeUtils.buildTree + sort
- ResourceNode 新增 children 字段
- listAll() 改用 TreeUtils.buildTree 组树,按 sort 排序
- 前端无需自行组树,直接渲染 data
- 测试适配树结构,前端文档同步更新
|
1 month ago |
luoweijian
|
170c16b226
|
refactor: ResourceController 对齐全局接口契约 — POST + 动作后缀 + 表单参数
- GET /api/resources → GET /api/resources/list
- POST /api/resources + @RequestBody → POST /api/resources/saveOrUpdate + 表单字段
- DELETE /api/resources/{id} → POST /api/resources/delete + @RequestParam
- 前端对接文档同步更新
|
1 month ago |
luoweijian
|
73304b7734
|
commit
|
1 month ago |
luoweijian
|
6329a6ba74
|
first-commit
|
1 month ago |