Commit Graph

4 Commits

Author SHA1 Message Date
2dcc0c61bf F2-6: candidateGroup URL 膨胀修复 + 角色缓存失效钩子
- flowable-service: 新增 POST /api/flow/tasks/todo 端点(TodoRequest body),
  避免 ceshi 236 角色 × 36 字符拼 GET URL 超 8KB 限制
- FlowableClient.todo() 改用 POST body 传 candidateGroups,
  新增 post() ParameterizedTypeReference 重载支持 List 返回类型
- AdminWriteController: 注入 RoleResolver,用户组成员增减调 evict(userId),
  用户组角色增减/删除调 evictAll(),确保权限变更后缓存及时失效
- platform-metadata/pom.xml 加 platform-auth 依赖
- AdminWriteControllerTest 适配 RoleResolver mock 参数
2026-06-12 03:09:36 +08:00
6dbb205e94 F2-7: 审批办理 UI 后端——trace/delegate 端点增补
- flowable-service:新增 GET /api/flow/process/{id}/trace(历史任务节点+
  审批意见+结果,biz 库不可达时用户名 1s 超时降级),TraceNodeDto;
  biz 数据源加 connectionTimeout/socketTimeout 快速失败
- platform-flow-gateway:FlowableClient 增加 trace/delegate 方法;
  TodoController 增加 /api/flow/process/{id}/trace 和 /api/task/{id}/delegate
  网关透传端点;GatewayRequests.DelegateRequest;TraceNodeDto 镜像
- 单测:TraceAndDelegateTest 3 个(MockRestServiceServer),全套 34/34 通过
- application-dev.yml:eip4.flow.read-timeout-ms=60000 适配慢查询

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 23:09:11 +08:00
ba6e7559fa P4-6: platform-flow-gateway 待办→业务页映射(tablename→templateId→pageUrl)
- 侦察口径:sys_entity+view_templateentity+view_template 两步映射;
  多模板优先级 type=7(表单)>1(列表)>其余升序,同 type 按 templateid 字典序取首个
- 新建 PageTemplateService:findTemplateId() 查只读客户库,
  @Cacheable("pageTemplateByTable") Caffeine TTL=10min/maxSize=2000
- FlowGatewayConfig 启用 @EnableCaching + flowGatewayCacheManager(Caffeine)
- TodoItem 增加 pageTemplateId/pageUrl/pageUrlReason;
  查不到映射时 pageUrl=null+reason,前端据此禁用跳转(优雅降级)
- TodoAggregator 注入 PageTemplateService,aggregate 逐条 fillPageTemplate
- PageTemplateMappingTest 10 单测;TodoAggregatorTest 补 @Mock PageTemplateService
- 验证:真实用户(829cdcca)3 条待办带出 templateId=7042cb37(PM_SAFE_CLARIFICATION/安全技术交底),
  与客户库直查一致;全反应堆 31+ArchUnit 绿

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 16:52:50 +08:00
ac9812e0a1 P3-4: platform-flow-gateway 单体侧流程网关(Flowable REST 客户端 + 待办聚合 + 事件回写)
- FlowableClient:RestClient 调 flowable-service(eip4.flow.base-url,默认 8089);
  超时/重试(仅连接级)/熔断降级——引擎不可达 → 503 语义(非 500 堆栈),业务错 4xx/5xx 透传。
- 待办聚合(经 platform-app 暴露):GET /api/todo(JWT userId+roles 候选组)、GET /api/done、
  POST /api/task/{id}/complete、POST /api/process/start;聚合层把 Flowable 任务与业务摘要连接
  (businessKey → SYS_DATASTATUS.tablename → loadPOJO 只读标题字段;业务摘要数据源客户库只读,
  拼不到优雅降级为仅流程字段)。
- 事件回写:complete 后按老系统 ProcessCoreServiceImpl.passProcess + WfChangeStatus 语义更新
  SYS_DATASTATUS(结束→STATUS_PASS=3,未结束→STATUS_PROCESSING=2,守卫 oldstatus<status 单调递增;
  upsert UPDATE 命中或 0 行 INSERT);本地库验证,客户库只读。
- flowable-service 契约增强:Flowable 6.8.1 TaskInfo 无 getBusinessKey(),todo/done 出参由查询侧
  从实例补全 businessKey;新增 GET /api/flow/process/{id} 查实例(供办理后判定流程是否结束)。

验证(8089 连本地 eip4flow+客户库只读,8090 连本地 eip4m0,8084 未动):
- 待办聚合数=直查一致:真实用户 829cdcca /api/todo=4 == 8089 直查 count=4。
- 业务摘要拼接正确 + 优雅降级共存:命中条目拼到 SYS_USERGROUP 标题字段,同列表 3 条无映射降级为仅流程字段。
- 熔断:kill 8089 后 /api/todo 返回 503 干净 JSON,platform-app 进程存活不崩。
- 事件回写:本地构造 datastatus=1,经 8090 complete(流程结束)回写为 3;引擎侧实例确结束。
- 21 单测(客户端重试/降级、聚合拼接、回写守卫)+ 全模块 mvn test + ArchUnit 绿。

坑入手册 §6.8(TaskInfo 无 businessKey)/§6.9(503 熔断 + 回写守卫 + SYS_DATASTATUS 无主键)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 15:12:03 +08:00