Use 提交人(xxx): 单据撤回 prefix for retract events (no Hose nodeName)

This commit is contained in:
gitea committed 2026-09-14 18:18:25 +08:00
1 parent 047c877c1f
commit 870975b5f7
2 files changed
+12 -6

No files matched your search

+2 -2
View File
@@ -906,7 +906,7 @@ describe("Hose Flow Domain", () => {
const r1 = aligned.get("run-retracted")!;
expect(r1.eHumanAction).toBe("已撤回");
expect(r1.eHumanComment).toBe("刘佳琼: 单据撤回");
expect(r1.eHumanComment).toBe("提交人(刘佳琼): 单据撤回");
expect(r1.auditDrift).toBe(false);
const r2 = aligned.get("run-active")!;
@@ -1204,7 +1204,7 @@ describe("Hose Flow Domain", () => {
const r1 = aligned.get("run-round-1")!;
expect(r1.eHumanAction).toBe("已撤回");
expect(r1.eHumanComment).toBe(
"1. 费用类型是研发费(宁艳楠): 同意\n2. 袁锦: 单据撤回"
"1. 费用类型是研发费(宁艳楠): 同意\n2. 提交人(袁锦): 单据撤回"
);
expect(r1.eHumanComment).not.toContain("合思审批节点");
expect(r1.eHumanComment).not.toContain("审批驳回");
+10 -4
View File
@@ -707,7 +707,13 @@ export function formatHumanOpinionLines(events: HoseFlowTimelineEntry[]): string
}
const opName = ev.operator?.name || ev.operator?.id || "未知";
const nodePrefix = ev.nodeName?.trim() ? `${ev.nodeName.trim()}(${opName})` : opName;
// freeflow.retract has no nodeName in Hose; the actor is always the submitter
const isRetractAction = ev.rawAction === "freeflow.retract" || ev.action === "单据撤回";
const nodePrefix = ev.nodeName?.trim()
? `${ev.nodeName.trim()}(${opName})`
: isRetractAction
? `提交人(${opName})`
: opName;
let comment = ev.comment;
if (!comment) {
if (ev.rawAction === "freeflow.agree" || ev.action === "审批同意") {
@@ -1109,14 +1115,14 @@ export function alignApprovalRunsWithHoseFlow(
if (!operator && ev.operator) operator = ev.operator;
}
if (retractEvent && !opinionLines.some((l) => l.includes("单据撤回"))) {
opinionLines.push(`${retractEvent.operator?.name || "提交人"}: 单据撤回`);
opinionLines.push(`提交人(${retractEvent.operator?.name || "提交人"}): 单据撤回`);
}
eHumanComment =
opinionLines.length > 1
? formatNumberedHumanOpinions(opinionLines, [], "forward")
: opinionLines.length === 1
? opinionLines[0]!
: (retractEvent ? `${retractEvent.operator?.name || "提交人"}: 单据撤回` : "单据已撤回");
: (retractEvent ? `提交人(${retractEvent.operator?.name || "提交人"}): 单据撤回` : "单据已撤回");
} else {
eHumanAction = "已修改重提";
const opinionLines = formatHumanOpinionLines(subsequentHumanEvents);
@@ -1175,7 +1181,7 @@ export function alignApprovalRunsWithHoseFlow(
if (!operator && ev.operator) operator = ev.operator;
}
if (retractEvent && !opinionLines.some((l) => l.includes("单据撤回"))) {
opinionLines.push(`${retractEvent.operator?.name || "提交人"}: 单据撤回`);
opinionLines.push(`提交人(${retractEvent.operator?.name || "提交人"}): 单据撤回`);
}
eHumanComment =
opinionLines.length > 1