feat(in-transit-transfer): 落地证据流重解析并纳入货代与排程配套改动

外部单号进入异动档自然键,圈档按 T-2 成熟封顶,当前归档可单独重解析。同批带上 Crane 禁整页刷新、ODM 白名单降级、排程抽屉与执行记录日期窗,以及 YAML 库存源下线。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-10-22 00:48:37 +08:00
1 parent 911afa0f73
commit 4c2a7e2a23
145 files changed
+11695 -4214

No files matched your search

@@ -7,6 +7,7 @@
matching_id 时按 ID 恢复匹配卡(最近匹配入口);勾选/执行按明细 item_id;
来源选择卡重试入站 RPA 为 202 异步——存在抓取中来源时组合式函数自动轮询
GET /sources,RPA 回调收口后状态自动刷新,离开来源卡即停轮询;
来源卡证据清单「重新解析」完成 emit reparsed → loadSources 同步芯片(不走路由 retry);
来源选择卡挂载时并行拉取来源列表与调拨类型配置(Task 7 接口化,
类型选项=GET /transfer-types 接口下发);
恢复处理 = 按明细 id 重查库存(batch-requery 唯一后端),完成后刷新待处理池并
@@ -129,13 +130,19 @@ watch(mode, (value) => {
if (value !== 'source-select') transfer.stopSourcePolling();
});
/** 打包下载选中来源的最新归档入站文件 */
async function onDownloadSources(sourceCodes: string[]) {
if (!sourceCodes.length) return;
/**
* 打包下载选中来源的证据文件。
* 核心逻辑:把来源卡传来的调拨类型一并 POST;保存名用后端 Content-Disposition
* (evidence-files-N.zip),响应没给文件名时才用同一前缀兜底。
* @param sourceCodes - 来源编码
* @param transferType - 当前所选调拨类型
*/
async function onDownloadSources(sourceCodes: string[], transferType?: string) {
if (!sourceCodes.length || !transferType) return;
busy.value = true;
try {
const result = await downloadTransferSourceFiles(sourceCodes);
triggerBlobDownload(result.blob, result.filename ?? `inbound-files-${sourceCodes.length}.zip`);
const result = await downloadTransferSourceFiles(sourceCodes, transferType);
triggerBlobDownload(result.blob, result.filename ?? `evidence-files-${sourceCodes.length}.zip`);
} catch (e) {
reportError(e);
} finally {
@@ -388,18 +395,25 @@ async function onSourceConfirm(
}
}
/** 对来源(单个或批量)重新触发入站 RPA 抓取,重试期间标记该来源(busy 独立于 confirm busy)。 */
async function onSourceRetry(sourceCodes: string[]) {
/**
* 对来源重试证据流,重试期间标记该来源(busy 独立于 confirm busy)。
* 核心逻辑:批量按钮无论选中几个来源都走 retry-rpa-batch,body 由组合式函数写成
* { source_codes, transfer_type }。只有行内 ↻(detail.recordKind)走单源重试,body 为 { record_kind }。
* @param sourceCodes - 来源编码
* @param detail - 行内 ↻ 带 recordKind;批量按钮只带 transferType
*/
async function onSourceRetry(
sourceCodes: string[],
detail?: { recordKind?: 'inbound' | 'outbound'; transferType?: string },
) {
const codes = Array.isArray(sourceCodes) ? sourceCodes : [sourceCodes];
retryingSource.value = new Set([...retryingSource.value, ...codes]);
try {
// 多来源一次批量端点(合并单 batch trigger,Worker 单次浏览器会话串行导出);
// 单来源沿用原接口(行级 ↻ 一源一文件语义不变)。
const [first, ...rest] = codes;
if (rest.length > 0) {
await transfer.retrySourcesRpaBatch(codes);
} else if (first !== undefined) {
await transfer.retrySourceRpa(first);
const [first] = codes;
if (detail?.recordKind && first !== undefined && codes.length === 1) {
await transfer.retrySourceRpa(first, detail.recordKind);
} else if (codes.length > 0) {
await transfer.retrySourcesRpaBatch(codes, detail?.transferType);
}
} catch (e) {
reportError(e);
@@ -426,6 +440,7 @@ async function onSourceRetry(sourceCodes: string[]) {
@confirm="onSourceConfirm"
@download="onDownloadSources"
@retry="onSourceRetry"
@reparsed="transfer.loadSources()"
/>
<TransferMatchCard
v-else-if="mode === 'match' && summaryRef"