- 侦察口径: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>
58 lines
3.2 KiB
XML
58 lines
3.2 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<parent>
|
|
<groupId>com.eip4</groupId>
|
|
<artifactId>eip4-platform</artifactId>
|
|
<version>0.1.0-SNAPSHOT</version>
|
|
</parent>
|
|
<artifactId>platform-flow-gateway</artifactId>
|
|
<name>platform-flow-gateway</name>
|
|
<description>
|
|
P3-4 单体侧流程网关:Flowable REST 客户端 + 待办聚合 + 事件回写。
|
|
引擎在独立 flowable-service(端口 8089),本模块只做 HTTP 客户端(架构第三节)。
|
|
- FlowableClient:RestClient 调 flowable-service(基址 eip4.flow.base-url,默认 http://localhost:8089),
|
|
超时/重试/熔断降级(服务不可达 → FlowServiceUnavailableException → 503 语义,非 500 堆栈)。
|
|
- 待办聚合(经 platform-app 暴露):GET /api/todo、GET /api/done、POST /api/task/{id}/complete、
|
|
POST /api/process/start;聚合层把 Flowable 任务与业务摘要连接(businessKey → SYS_DATASTATUS.tablename
|
|
→ 引擎 loadPOJO 只读标题字段;业务摘要数据源=客户库只读;拼不到优雅降级为仅流程字段)。
|
|
- 事件回写:complete 后按老系统 ProcessCoreServiceImpl/WfChangeStatus 语义更新 SYS_DATASTATUS
|
|
(STATUS_PROCESSING=2/STATUS_PASS=3,守卫 oldstatus < status 单调递增);本地库验证,客户库只读。
|
|
</description>
|
|
|
|
<dependencies>
|
|
<!-- 业务摘要经引擎 loadPOJO 只读(SYS_DATASTATUS 映射 + 业务表标题字段);回写经 JdbcTemplate -->
|
|
<dependency><groupId>com.eip4</groupId><artifactId>platform-legacy-core</artifactId></dependency>
|
|
<!-- 待办聚合从 JWT 上下文取 userId / roles(候选组待办) -->
|
|
<dependency><groupId>com.eip4</groupId><artifactId>platform-auth</artifactId></dependency>
|
|
|
|
<!-- REST 客户端(RestClient,Spring 6/Boot 3.3 内置)+ Controller 门面 -->
|
|
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>
|
|
<!-- 回写/业务摘要走 JdbcTemplate -->
|
|
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency>
|
|
<!-- OpenAPI 注解(与现代层口径一致) -->
|
|
<dependency>
|
|
<groupId>org.springdoc</groupId>
|
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Caffeine 本地缓存:模板关联低频变更,tablename→templateId 映射缓存以减少只读库查询 -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-cache</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.github.ben-manes.caffeine</groupId>
|
|
<artifactId>caffeine</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-test</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
</project>
|