feat(workflow): 补齐 workFlow 族 104 条端点并同步契约三处

- 影响:面 B 新增 104 条 `/api/workflow/**` 端点(契约端点 610 → 714),官方端点覆盖 596/602 → 700/706,`fe-gap` 的 `workFlow` 列 0/104 → 104/104。
- 改动:新增 `platform/compat/workflow.rs` —— 真实现 62 条(流程模板/版本/节点/任务/评论/委托/监控读),诚实失败 42 条(引擎动作 27 + 无文件服务 2 + 无在线表单设计器 13)。
- 改动:新增 24 张 `workflow_*` 表(官方 DDL 逐字导入),登记为 `WORKFLOW_TABLES` 固定装置,不导 Flowable 的 `act_*` 引擎表。
- 改动:契约生成器新增 workflow 族(控制器映射 / 官方前端独有路径 / 引擎·文件·表单三类 partial),`[ENDPOINT]` +104、`[OFFICIAL]` +104。
- 改动:修 pglite 参数类型推断坑(`$N::integer` → `$N::text::integer`),workflow 21 处、report 3 处潜伏 bug。
- 设计:官方流程引擎是独立 HTTP 服务(`FlowAbleUrl`)⇒ 动作类端点一律明确业务失败,不返假流程号、不返假 URL。

Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
adminandClaude Code committed 2026-11-02 19:42:12 +08:00
1 parent 1c224b7b79
commit 4ffd1e0ccb
12 files changed
+6561 -29

No files matched your search

+244 -1
View File
@@ -207,6 +207,149 @@ _VISUALDEV_CONTROLLERS = {
},
}
# 🔴 **流程族(批次 19)**:官方 `jnpf-flowable` 的 Controller。
# 键 = `(method, 本仓路径)`(本仓路径与官方路径**同段**,只把路径段名归一)。
_WORKFLOW_CONTROLLERS = {
# 官方 `jnpf-flowable` 的 `TemplateController`(`@RequestMapping("/api/workflow/template")`)
"TemplateController.java": {
"GET /api/workflow/template": 117,
"GET /api/workflow/template/Selector": 150,
"GET /api/workflow/template/TreeList": 202,
"GET /api/workflow/template/{id}": 216,
"GET /api/workflow/template/Version/{id}": 230,
"GET /api/workflow/template/Info/{id}": 253,
"POST /api/workflow/template": 265,
"PUT /api/workflow/template/{id}": 285,
"PUT /api/workflow/template/{id}/UpdateType": 308,
"DELETE /api/workflow/template/{id}": 323,
"DELETE /api/workflow/template/Info/{id}": 338,
"PUT /api/workflow/template/{id}/UpDownShelf": 364,
"POST /api/workflow/template/{id}/Actions/Copy": 385,
"POST /api/workflow/template/Info/{id}": 400,
"POST /api/workflow/template/Save": 415,
"GET /api/workflow/template/{id}/Actions/Export": 428,
"POST /api/workflow/template/GetFlowList": 467,
"GET /api/workflow/template/{id}/FormInfo": 487,
"GET /api/workflow/template/{id}/DecisionParameter": 499,
# 🔴 官方路径段名是 `{formId}`(`getFlowByFormId`)—— 本仓按前端调用
# 归一成 `{id}`(**同一条路由**),语义在 `workflow.rs` 里写明。
"GET /api/workflow/template/{id}/FlowList": 511,
"GET /api/workflow/template/{id}/SubFlowUserList": 524,
"POST /api/workflow/template/SetCommonFlow/{id}": 540,
"GET /api/workflow/template/getCommonFlowList": 553,
"GET /api/workflow/template/StartForm/{id}": 566,
"GET /api/workflow/template/StartFormId/{id}": 578,
},
# 官方 `CommentController`(`@RequestMapping("/api/workflow/comment")`)
"CommentController.java": {
"GET /api/workflow/comment": 76,
"POST /api/workflow/comment": 150,
"DELETE /api/workflow/comment/{id}": 166,
},
# 官方 `DelegateController`(`@RequestMapping("/api/workflow/delegate")`)
"DelegateController.java": {
"GET /api/workflow/delegate": 76,
"GET /api/workflow/delegate/Info/{id}": 94,
"GET /api/workflow/delegate/{id}": 106,
"POST /api/workflow/delegate": 133,
"PUT /api/workflow/delegate/{id}": 177,
"PUT /api/workflow/delegate/Stop/{id}": 263,
"DELETE /api/workflow/delegate/{id}": 285,
"GET /api/workflow/delegate/UserList": 300,
"POST /api/workflow/delegate/Notarize/{id}": 314,
},
# 官方 `OperatorController`(`@RequestMapping("/api/workflow/operator")`)
"OperatorController.java": {
"POST /api/workflow/operator/CandidateNode/{id}": 99,
"POST /api/workflow/operator/CandidateUser/{id}": 115,
"GET /api/workflow/operator/List/{category}": 134,
"POST /api/workflow/operator/Sign": 184,
"POST /api/workflow/operator/Transact": 196,
"POST /api/workflow/operator/SaveAudit/{id}": 209,
"POST /api/workflow/operator/Audit/{id}": 224,
"POST /api/workflow/operator/AddSign/{id}": 274,
"POST /api/workflow/operator/AddSignUserIdList/{id}": 293,
"POST /api/workflow/operator/ReduceApprover/{id}": 308,
"GET /api/workflow/operator/SendBackNodeList/{id}": 325,
"POST /api/workflow/operator/SendBack/{id}": 339,
"POST /api/workflow/operator/Recall/{id}": 367,
"POST /api/workflow/operator/Transfer/{id}": 406,
"POST /api/workflow/operator/Assist/{id}": 428,
"POST /api/workflow/operator/AssistSave/{id}": 443,
"GET /api/workflow/operator/BatchFlowSelector": 455,
"GET /api/workflow/operator/BatchVersionSelector/{id}": 467,
"GET /api/workflow/operator/BatchNodeSelector/{id}": 479,
"GET /api/workflow/operator/BatchNode": 491,
"GET /api/workflow/operator/BatchCandidate": 505,
"POST /api/workflow/operator/BatchOperation": 518,
"GET /api/workflow/operator/{id}/Info": 549,
"GET /api/workflow/operator/RecordList": 579,
"GET /api/workflow/operator/CirculateList": 592,
},
# 官方 `TaskController`(`@RequestMapping("/api/workflow/task")`)
"TaskController.java": {
"GET /api/workflow/task/{id}": 103,
"POST /api/workflow/task": 127,
"PUT /api/workflow/task/{id}": 147,
"DELETE /api/workflow/task/{id}": 181,
"GET /api/workflow/task": 193,
"PUT /api/workflow/task/Recall/{id}": 218,
"POST /api/workflow/task/Press/{id}": 233,
"PUT /api/workflow/task/Revoke/{id}": 247,
"GET /api/workflow/task/TaskUserList/{id}": 261,
"GET /api/workflow/task/SubFlowInfo": 279,
"GET /api/workflow/task/ViewStartForm/{id}": 291,
"GET /api/workflow/task/Hooks/Retry/{id}": 301,
},
# 官方 `TriggerWebHookController`(`@RequestMapping("/api/workflow/Hooks")`)
"TriggerWebHookController.java": {
"GET /api/workflow/Hooks/getUrl": 92,
"GET /api/workflow/Hooks/{id}/start/{randomStr}": 170,
"GET /api/workflow/Hooks/getParams/{randomStr}": 180,
},
# 官方 `WorkflowMonitorController`(`@RequestMapping("/api/workflow/monitor")`)
"WorkflowMonitorController.java": {
"GET /api/workflow/monitor": 64,
"DELETE /api/workflow/monitor": 102,
"GET /api/workflow/monitor/AnySubFlow/{id}": 115,
"POST /api/workflow/monitor/Pause/{id}": 127,
"POST /api/workflow/monitor/Reboot/{id}": 143,
"POST /api/workflow/monitor/Cancel/{id}": 159,
"POST /api/workflow/monitor/Activate/{id}": 175,
"POST /api/workflow/monitor/Assign/{id}": 191,
"POST /api/workflow/monitor/FlowTodoCount": 205,
"GET /api/workflow/monitor/FlowTodo": 218,
},
# 官方 `TriggerTaskController`(`@RequestMapping("/api/workflow/trigger/task")`)
"TriggerTaskController.java": {
"GET /api/workflow/trigger/task/List": 59,
"GET /api/workflow/trigger/task": 72,
"POST /api/workflow/trigger/task/Retry/{id}": 97,
"DELETE /api/workflow/trigger/task": 110,
},
}
# 🔴 **流程族里官方 Java 没有对应 `@XxxMapping`** 的 13 条 ⇒ 出处指向官方前端
# `api/workFlow/**`(官方就是靠前端声明访问这些端点的)。
#
# 🔴 `/api/flowForm/Form/**` 11 条:官方**整个 `jnpf-java-boot` 树里没有**
# 任何 Controller 声明过这个前缀(在线表单设计器官方也没后端)⇒ 全部前端出处。
_WORKFLOW_FRONTEND_ONLY = {
"GET /api/workflow/task/{id}/EventLog": "api/workFlow/task.ts:51",
"GET /api/workflow/monitor/{id}/EventLog": "api/workFlow/flowMonitor.ts:17",
"GET /api/flowForm/Form": "api/workFlow/formDesign.ts:9",
"POST /api/flowForm/Form": "api/workFlow/formDesign.ts:13",
"PUT /api/flowForm/Form": "api/workFlow/formDesign.ts:17",
"GET /api/flowForm/Form/{id}": "api/workFlow/formDesign.ts:21",
"DELETE /api/flowForm/Form/{id}": "api/workFlow/formDesign.ts:25",
"POST /api/flowForm/Form/Release/{id}": "api/workFlow/formDesign.ts:29",
"GET /api/flowForm/Form/{id}/Actions/Copy": "api/workFlow/formDesign.ts:33",
"GET /api/flowForm/Form/{id}/Actions/Export": "api/workFlow/formDesign.ts:37",
"GET /api/flowForm/Form/{id}/getField": "api/workFlow/formDesign.ts:41",
"GET /api/flowForm/Form/select": "api/workFlow/formDesign.ts:45",
"GET /api/flowForm/Form/getFormById/{id}": "api/workFlow/formDesign.ts:49",
}
# 🔴 **官方没有 Java Controller** 的少数几条 ⇒ 出处指向**官方前端 api 文件**
# (官方就是靠前端声明访问这些端点的)。
FRONTEND_ONLY_SOURCES = {
@@ -379,9 +522,93 @@ PARTIAL_NOTES = {
"partial", "本仓无地图服务 ⇒ **明确业务失败**(**不返假坐标**)"),
}
# 🔴 ---- 流程族(批次 19)----
#
# 🔴 **官方流程引擎是独立 HTTP 服务**:官方前端把引擎地址配在 `FlowAbleUrl`
# (`<flowDomain>/api/Flow/*`)—— 本仓**没有**该服务 ⇒ 凡是「动作类」
# (发起 / 审批 / 办理 / 转审 / 撤回 / 撤销 / 退回 / 加签 / 减签 / 协办 /
# 批量审批 / 暂停 / 终止 / 复活 / 重试 / 催办 / 签收 / 触发器)的端点
# ⇒ **明确业务失败**(绝不返假结果、假流程号)。
_WORKFLOW_ENGINE_PATHS = [
("GET", "/api/workflow/Hooks/getUrl"),
("GET", "/api/workflow/Hooks/getParams/{randomStr}"),
("GET", "/api/workflow/Hooks/{id}/start/{randomStr}"),
("POST", "/api/workflow/task"),
("PUT", "/api/workflow/task/{id}"),
("PUT", "/api/workflow/task/Recall/{id}"),
("PUT", "/api/workflow/task/Revoke/{id}"),
("POST", "/api/workflow/task/Press/{id}"),
("GET", "/api/workflow/task/Hooks/Retry/{id}"),
("POST", "/api/workflow/operator/Sign"),
("POST", "/api/workflow/operator/Transact"),
("POST", "/api/workflow/operator/Audit/{id}"),
("POST", "/api/workflow/operator/ReduceApprover/{id}"),
("POST", "/api/workflow/operator/SaveAudit/{id}"),
("POST", "/api/workflow/operator/AssistSave/{id}"),
("POST", "/api/workflow/operator/Recall/{id}"),
("POST", "/api/workflow/operator/Transfer/{id}"),
("POST", "/api/workflow/operator/Assist/{id}"),
("POST", "/api/workflow/operator/BatchOperation"),
("POST", "/api/workflow/operator/SendBack/{id}"),
("POST", "/api/workflow/operator/AddSign/{id}"),
("POST", "/api/workflow/monitor/Cancel/{id}"),
("POST", "/api/workflow/monitor/Assign/{id}"),
("POST", "/api/workflow/monitor/Activate/{id}"),
("POST", "/api/workflow/monitor/Pause/{id}"),
("POST", "/api/workflow/monitor/Reboot/{id}"),
("POST", "/api/workflow/trigger/task/Retry/{id}"),
]
for _m, _p in _WORKFLOW_ENGINE_PATHS:
PARTIAL_NOTES[(_m, _p)] = (
"partial", "本仓未接入流程引擎(Flowable,官方是**独立 HTTP 服务** "
"`FlowAbleUrl`)⇒ **明确业务失败**")
# 🔴 **文件类**:本仓无文件服务 ⇒ 导出端点明确失败(**不返假文件 / 假 URL**)。
_WORKFLOW_FILE_PATHS = [
("GET", "/api/workflow/template/{id}/Actions/Export"),
("GET", "/api/flowForm/Form/{id}/Actions/Export"),
]
for _m, _p in _WORKFLOW_FILE_PATHS:
PARTIAL_NOTES[(_m, _p)] = (
"partial", "本仓无文件服务 ⇒ **明确业务失败**(**不返假文件 / 假 URL**)")
# 🔴 **在线表单设计器类**:本仓**没有 `visualdev_*` 表**(官方表单设计器是
# `jnpf-visualdev` 的在线表单)⇒ 表单本体查不到 ⇒ 明确失败。
_WORKFLOW_FORM_PATHS = [
("GET", "/api/workflow/template/{id}/FormInfo"),
("GET", "/api/workflow/template/StartForm/{id}"),
("GET", "/api/workflow/template/StartFormId/{id}"),
("GET", "/api/workflow/task/ViewStartForm/{id}"),
("GET", "/api/flowForm/Form"),
("POST", "/api/flowForm/Form"),
("PUT", "/api/flowForm/Form"),
("GET", "/api/flowForm/Form/{id}"),
("DELETE", "/api/flowForm/Form/{id}"),
("POST", "/api/flowForm/Form/Release/{id}"),
("GET", "/api/flowForm/Form/{id}/Actions/Copy"),
("GET", "/api/flowForm/Form/{id}/getField"),
("GET", "/api/flowForm/Form/select"),
]
for _m, _p in _WORKFLOW_FORM_PATHS:
PARTIAL_NOTES[(_m, _p)] = (
"partial", "本仓无在线表单设计器(无 `visualdev_*` 表)⇒ **明确业务失败**")
# 🔴 两条**已落地但形状有讲究**的 ⇒ 状态仍是 `implemented`,只补说明。
PARTIAL_NOTES[("GET", "/api/workflow/template/{id}/FlowList")] = (
"implemented", "面 B 已落地:官方路径段名是 `{formId}`(`getFlowByFormId`),"
"前端按 `/{id}/FlowList` 调(**同一条路由**)⇒ 本仓按**表单主键**"
"查 `workflow_node.f_form_id` → 版本 → 模板;`data` 是裸对象 "
"`{list,isConfig}`(官方 `FlowByFormModel`)")
PARTIAL_NOTES[("GET", "/api/flowForm/Form/getFormById/{id}")] = (
"implemented", "面 B 已落地:官方**没有**对应 Java Controller(整个 "
"`jnpf-java-boot` 树里没人声明过 `/api/flowForm/Form`)⇒ 按官方"
"前端 `api/workFlow/formDesign.ts:49` 的契约实现;用 "
"`workflow_form_relation.f_form_id → f_flow_id` 返流程主键"
"(**不返假流程号**)")
# 🔴 **端点顺序**:按官方模块分组,组内按路径排 —— 与 `routes.rs` 的注册顺序对齐
# (⇒ 契约读起来与代码读起来同序 ⇒ 人工 review 不用来回跳)。
MODULE_ORDER = ["core", "online_dev", "report"]
MODULE_ORDER = ["core", "online_dev", "report", "workflow"]
# 🔴 **默认 note**(未在 `PARTIAL_NOTES` 里显式标注的端点)。
DEFAULT_NOTES = {
@@ -391,6 +618,9 @@ DEFAULT_NOTES = {
"report": "面 B 已落地:官方 `/api/Report/*` 在官方是**独立部署的第三方服务**"
"(`jnpf-java-datareport-univer`,端口 32000)⇒ 本仓把报表元数据**就地落库**"
"(`report_template` + `report_version`,表结构照官方 DDL 逐字导入)",
"workflow": "面 B 已落地:流程**元数据**(模板 / 版本 / 节点 / 评论 / 委托 / "
"监控 / 触发记录)**真落库**到官方 24 张 `workflow_*` 表(DDL 逐字照官方);"
"**引擎动作**(发起 / 审批 / 办理 …)因本仓未接入 Flowable ⇒ **明确业务失败**",
}
@@ -470,6 +700,19 @@ def official_entry(mod, key, path):
status, note = PARTIAL_NOTES.get(key, ("implemented", DEFAULT_NOTES["core"]))
return src, status, note
raise SystemExit("core 族没有官方出处可登记:%s %s" % (method, path))
if mod == "workflow":
# 🔴 流程族(批次 19):官方 `jnpf-flowable` 的 Controller 优先,
# 官方 Java **没有**映射的 13 条 ⇒ 落到官方前端 `api/workFlow/**`。
for ctrl, table in _WORKFLOW_CONTROLLERS.items():
if k in table:
src = "%s:%d" % (ctrl, table[k])
status, note = PARTIAL_NOTES.get(key, ("implemented", DEFAULT_NOTES["workflow"]))
return src, status, note
src = _WORKFLOW_FRONTEND_ONLY.get(k)
if src:
status, note = PARTIAL_NOTES.get(key, ("implemented", DEFAULT_NOTES["workflow"]))
return src, status, note
raise SystemExit("workflow 族没有官方出处可登记:%s %s" % (method, path))
# onlineDev
for ctrl, table in _VISUALDEV_CONTROLLERS.items():
if k in table: