Make --with-flow opt-in: E人工行为/E人工意见 columns require explicit --with-flow flag
This commit is contained in:
1 parent
870975b5f7
commit
de79e9735b
3 files changed
+10
-8
No files matched your search
+2
-2
@@ -350,8 +350,8 @@ export const HELP_REGISTRY: AreaHelp[] = [
|
||||
},
|
||||
{
|
||||
name: "export",
|
||||
summary: "Export approval run audit records to Excel workbook",
|
||||
usage: ["seal-use approval-runs export [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--force] [--status <status>] [--manual-status <status>] [--completed-only] [--limit <n>] [--downloads|--to-downloads] [--with-flow|--no-flow] [--out <file>] [--corp <corpId>]"]
|
||||
summary: "Export approval run audit records to Excel workbook. Add --with-flow to include E人工行为 / E人工意见 columns (requires Hose Open API; adds ~30s for large batches).",
|
||||
usage: ["seal-use approval-runs export [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--force] [--status <status>] [--manual-status <status>] [--completed-only] [--limit <n>] [--downloads|--to-downloads] [--with-flow] [--out <file>] [--corp <corpId>]"]
|
||||
},
|
||||
{
|
||||
name: "flow",
|
||||
|
||||
@@ -347,8 +347,8 @@ export async function exportApprovalRunsToExcel(
|
||||
|
||||
console.error(`已就绪 ${sortedRuleKeys.length} 个规则列。开始拉取单据...`);
|
||||
|
||||
// 1.5 如果是合思企业且开启审批流对齐,先探测单据规模并做耗时与频控提示
|
||||
if (options.withFlow !== false && corp.source.type === "hose") {
|
||||
// 1.5 如果是合思企业且显式启用 withFlow,先探测单据规模并做耗时与频控提示
|
||||
if (options.withFlow === true && corp.source.type === "hose") {
|
||||
try {
|
||||
const probeData = await api.listApprovalRuns(client, {
|
||||
limit: 1,
|
||||
@@ -364,7 +364,7 @@ export async function exportApprovalRunsToExcel(
|
||||
const estSeconds = Math.max(1, Math.ceil((probeTotal / concurrency) * 0.4));
|
||||
if (probeTotal > 50) {
|
||||
console.error(
|
||||
`⚠️ [审批流对齐提示] 目标区间内单据规模约为 ${probeTotal} 笔。系统已启用合思 Open API 保护限流(并发 ${concurrency}),预计审批流拉取耗时约 ${estSeconds} 秒。若无需原生人工流转行为与意见,可追加 --no-flow 快速导出。`
|
||||
`⚠️ [审批流对齐提示] 目标区间内单据规模约为 ${probeTotal} 笔。系统已启用合思 Open API 保护限流(并发 ${concurrency}),预计审批流拉取耗时约 ${estSeconds} 秒。`
|
||||
);
|
||||
}
|
||||
} catch {
|
||||
@@ -540,12 +540,12 @@ export async function exportApprovalRunsToExcel(
|
||||
let rejectReasonCount = 0;
|
||||
let driftCount = 0;
|
||||
|
||||
// 3.5 如果是合思租户且未显式关闭 withFlow,获取原生审批流并对齐真实人工行为与意见
|
||||
// 3.5 如果是合思租户且显式启用 withFlow(--with-flow),获取原生审批流并对齐 E人工行为 / E人工意见
|
||||
const alignmentsByRecordId = new Map<string, HoseRunAlignment>();
|
||||
const deletedSNs = new Set<string>();
|
||||
const excludeDeleted = options.excludeDeleted ?? true;
|
||||
|
||||
if (options.withFlow !== false && corp.source.type === "hose") {
|
||||
if (options.withFlow === true && corp.source.type === "hose") {
|
||||
try {
|
||||
const runsByDocKey = new Map<string, ApprovalRun[]>();
|
||||
for (const record of fetchedRecords) {
|
||||
|
||||
Reference in new issue
Block a user