diff --git a/skills/seal-use/SKILL.md b/skills/seal-use/SKILL.md index b464b64..8b1203e 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -88,7 +88,7 @@ seal-use corps list - 规则本地工作流: `seal-use rules pull` 导出草稿规则,`rules lint` 做质量检查,`rules push --dry-run` 预览增量更新,确认后用 `--yes` 写入;`rules map` 查询 `corps sync-test` 生成的跨企业规则映射。规则版本与草稿/发布 code 空间的区别详见 `references/rule-lightweight.md` 和 `references/cli.md`。 - Seal AI 智能审核发布到合思费控: `seal-use deploy hosecloud --corp `; read `references/hose-enterprise-deploy.md`. - 审核决策偏好与思考深度: `seal-use preference get --corp `, `preference decision update --json '...' --corp `, `preference thinking-depth set --default --corp `, `preference thinking-depth policies --corp `. -- 审核大盘统计与去重分析: `seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] --corp `, `approval-runs count`, `analytics insight|risks|performance|analyze`, 以及 `approval-runs export`(Excel 报表);需要追踪单据时再使用 `url` 或 `bridge`。 +- 审核大盘统计与去重分析: `seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] --corp `, `approval-runs count`, `analytics insight|risks|performance|analyze`, 以及 `approval-runs export`(Excel 报表,默认仅含 Seal 系统字段;追加 `--with-flow` 可额外输出 **E人工行为** / **E人工意见** 两列——基于合思原生审批流对齐,需调用合思 Open API,200 条以上单据约增加 30 秒);需要追踪单据时再使用 `url` 或 `bridge`。 - User-facing 合思 authorization link (合思/易快报授权): `seal-use auth hose-link --corp --expire 7200`; read `references/hose-enterprise-auth.md`. Never use this route when the user says Seal 协助. Always provide BOTH a code block (` ```text ... ``` `) AND a hyperlink. - Delegation links management: `seal-use delegation list --corp `, `create [--note ...] --corp `, `create --from-link [--note ...]`, `revoke --corp `. - User & Contacts Management (用户搜索、激活与一键代生成授权): `seal-use users search [keyword] --corp `, `users delegation --corp ` (仅适用于 Seal 本地创建的账号 `provider: local`;对合思同步账号系统拒绝重置密码,需改用 `auth hose-link`), `users activate --corp `, `users create --name ... --phone ... --corp `, `users reset-password --corp `, `users get --corp `, `users delete --corp `. @@ -159,6 +159,8 @@ seal-use simulation batch-records --corp seal-use simulation status --corp seal-use simulation approval-definitions --corp seal-use approval-runs export --corp --downloads --completed-only +# Add --with-flow to also populate E人工行为 / E人工意见 columns (Hose Open API, adds ~30s): +seal-use approval-runs export --corp --downloads --with-flow seal-use analytics insight --corp seal-use contacts departments --corp seal-use data invoices --corp --limit 20 diff --git a/src/cli/help.ts b/src/cli/help.ts index 9526c7e..e600bf1 100644 --- a/src/cli/help.ts +++ b/src/cli/help.ts @@ -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 ] [--end ] [--force] [--status ] [--manual-status ] [--completed-only] [--limit ] [--downloads|--to-downloads] [--with-flow|--no-flow] [--out ] [--corp ]"] + 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 ] [--end ] [--force] [--status ] [--manual-status ] [--completed-only] [--limit ] [--downloads|--to-downloads] [--with-flow] [--out ] [--corp ]"] }, { name: "flow", diff --git a/src/domains/seal/approval-runs-export.ts b/src/domains/seal/approval-runs-export.ts index 728f544..d0429c7 100644 --- a/src/domains/seal/approval-runs-export.ts +++ b/src/domains/seal/approval-runs-export.ts @@ -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(); const deletedSNs = new Set(); 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(); for (const record of fetchedRecords) {