feat(shipping-notice,receipt-report): 新增收料报表功能并优化发货通知流程

清理废弃的shipping xfa ocr automark相关代码和job配置
新增收料报表管理的前端页面、路由和侧边栏入口
新增后端收料报表配置接口、数据库模型和RPA脚本
优化发货通知流程的重试策略,将shipping相关job默认不自动重试
移除废弃的库存源确认相关逻辑,更新流程门禁规则
重构订单模板的值适配器模块,新增坐标OCR值适配器
清理前端shipping菜单和action的废弃选项
更新相关文档和测试用例,调整.gitignore忽略规则
This commit is contained in:
hugo committed 2026-08-20 20:23:10 +08:00
1 parent 260465b72d
commit 1b6483a4ea
466 files changed
+32115 -33796

No files matched your search

@@ -257,6 +257,25 @@ const fileRows = computed(() => props.state.documents || []);
const isEmailRow = (row: ShippingOrderExtractionFileState) => (
row.documentType === 'email_body' || row.fileName?.toLowerCase().endsWith('.eml')
);
/**
* 返回当前 Run 快照中的唯一业务 PDF,隔离历史 Unit/Review Case 汇总。
* 核心逻辑:优先用稳定 documentId 去重;旧快照缺失时才回退 unitId 或文件名。
*/
const currentBusinessFileRows = computed(() => {
const seen = new Set<string>();
return fileRows.value.filter((row) => {
if (isEmailRow(row)) return false;
const key = row.documentId > 0
? `document:${row.documentId}`
: row.unitId > 0
? `unit:${row.unitId}`
: `filename:${String(row.fileName || '').trim().toLowerCase()}`;
if (seen.has(key)) return false;
seen.add(key);
return true;
});
});
const hasCurrentBusinessFileRows = computed(() => currentBusinessFileRows.value.length > 0);
const emailRows = computed(() => fileRows.value.filter(isEmailRow));
const isFailedParseRow = (row: ShippingOrderExtractionFileState) => (
row.status === 'failed'
@@ -310,6 +329,9 @@ const processedCount = computed(() => {
// “处理过”口径累计为完成,否则会与批次进度中心的 completed_files 冲突。
return Math.max(0, Number(summary?.completed_files || 0));
}
// 当前 Run 仅表达抽取/候选状态,不能把 candidate_ready 或历史复核 Case 伪装成
// 已完成通知生命周期;生命周期完成数只由会话权威投影下发。
if (hasCurrentBusinessFileRows.value) return 0;
return emlAggregate.value?.aggregateSummary?.completed
?? (props.state.summary.completedDocuments + props.state.summary.reviewRequiredDocuments);
});
@@ -324,6 +346,7 @@ const batchFileCount = computed(() => {
if (hasConversationStatusGroups.value) {
return Math.max(0, Number(conversationProcessing.value?.summary?.total_files || 0));
}
if (hasCurrentBusinessFileRows.value) return currentBusinessFileRows.value.length;
return Math.max(0, Number(emlAggregate.value?.sourceSummary.documentCount ?? props.state.summary.totalDocuments));
});
@@ -453,6 +476,9 @@ const handlingSummaryLine = computed(() => {
if (!first) return '';
const totalCount = items.reduce((sum, item) => sum + Math.max(0, Number(item.count || 0)), 0);
const count = totalCount > 0 ? totalCount : items.length;
// 旧 Run 的 Case 是跨版本历史记录。当前卡片已有 PDF 快照时,数目不一致即说明
// handling 来自另一集合,不能在“本批文件”标题下误导为当前待复核文件。
if (hasCurrentBusinessFileRows.value && count !== currentBusinessFileRows.value.length) return '';
return t('chat.shippingOrderExtractionHandling.summaryLine', {
title: handlingTitle(first),
count,