Repository navigation
feat: 记录办理人与办理身份,补齐已办留痕 (#306) - #307
Merged
Merged
Conversation
办结动作此前不写任何身份字段:current_* 是待办归属、submit_* 是创建该记录时的上游提交人, 最后一步办理身份因此没有落点。新增 handle_operator_id/name/identity 三元组,由办结动作显式写入。 - FlowRecord 新增 handleOperator 三元组与 markHandleOperator / clearHandleOperator - Pass / Return / Reject / Transfer / Delegate 办结后写入;SaveAction 暂存与 notifyRecord 抄送不写 - FlowRecordEntity / FlowRecordConvertor / FlowRecordContent 补齐映射(存量数据为空) - DDL 脚本补三列,operator-identity.md 更新留痕口径 Closes #306
查询层通过 FlowRecordContentConvertor.convert(FlowRecordEntity) 组装列表数据, 不走领域对象链路;本次只改了领域对象与实体映射,漏了该转换器, 导致已落库的办理人/办理身份在已办、全部流程列表始终返回 null, 前端只能回退到待办归属人。 - 转换器补 handleOperatorId/Name/Identity 映射(存量数据身份归一化为空串) - 新增 FlowRecordContentConvertorTest 覆盖已办记录与存量记录两种情况
xlorne
changed the base branch from
feature/issue-303-operator-script-resolver
to
dev
December 3, 2026 08:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Closes #306。
办结一条记录时,此前不写任何身份字段:
current_operator_*submit_operator_*interfered_operator_*FlowRecord#update(flowSession, pass)只更新表单、动作、意见、状态,没有身份赋值;FlowActionService拿到的办理人身份只用于生成下游记录的submitOperator。因此最后一步(无下游、当前也不产生 END 记录)办理身份彻底丢失,中间节点也只能跳一条到下游submit_*间接推断。复现场景:
department1发起,审批节点以department2同意,库里整条链路只有department1。变更
领域模型
FlowRecord新增handleOperatorId / handleOperatorName / handleOperatorIdentity;markHandleOperator(IFlowOperator)与clearHandleOperator(),后者在newRecord()中调用,避免记录回到未办理状态时残留办理人。写入点(显式,不放
update()内)PassAction、ReturnAction、RejectAction、TransferAction、DelegateAction办结后调用markHandleOperator(flowSession.getCurrentOperator())。不写入:
SaveAction(暂存,pass=false)与notifyRecord()(抄送刷新)。这两处也走update(),若在里面隐式写入,会把暂存人、抄送接收人误记成办理人 —— 这是本次刻意不用update()集中处理的原因。持久化与查询
FlowRecordEntity增 3 列、FlowRecordConvertor双向映射(identity 走normalize/validate);FlowRecordContent暴露三个字段(from(FlowTodoRecord)不返回,待办没有办理人语义);docs/Integration/sql/0.3.0-operator-identity.sql补列。文档:
operator-identity.md§4.1 列表补列,§4.4 留痕口径改成三字段对照表并说明 #306 之前的行为,§5 兼容性补回填说明。兼容性
ddl-auto=update自动加列;存量记录handle_*为空;currentOperatorIdentity/submitOperatorIdentity语义,待办合并键、STRICT 回溯、verifyOperator均不受影响;handleOperatorIdentity || currentOperatorIdentity回退,升级前后展示一致(见 feat(app-pc): 已办列表展示本次办理人与办理身份 (#306) flow-frontend#90)。测试
新增
HandleOperatorIdentityFlowTest(3 例,USER_ONLY):current_*保持默认身份不被改写,handleOperator*=department2;handle_*=department2,下游待办submit_*同为department2;handle_*保持空值。./mvnw -pl flow-engine-framework test:518 例通过(原 515 + 新增 3),0 失败 0 错误。依赖
base 为
feature/issue-303-operator-script-resolver(#304 未合入dev)。#304 合入后本 PR 可随之进入主线。