feat(shipping): 实现订单批处理聊天聚合展示与优化后端逻辑
This commit is contained in:
1 parent
11cef575b4
commit
523b791c92
38 files changed
+2868
-414
No files matched your search
@@ -185,6 +185,7 @@ const normalizeShippingOrderExtractionState = (
|
||||
: null;
|
||||
return {
|
||||
status: status as ShippingOrderExtractionState['status'],
|
||||
uploadBatchId: String(data.uploadBatchId || '').trim() || null,
|
||||
summary: {
|
||||
totalDocuments: Math.max(0, Number(rawSummary.totalDocuments || 0)),
|
||||
pendingDocuments: Math.max(0, Number(rawSummary.pendingDocuments || 0)),
|
||||
@@ -207,6 +208,27 @@ const normalizeShippingOrderExtractionState = (
|
||||
: [],
|
||||
}
|
||||
: null,
|
||||
documents: Array.isArray(data.documents)
|
||||
? data.documents.map((item) => {
|
||||
const row = item && typeof item === 'object' ? item as Record<string, unknown> : {};
|
||||
return {
|
||||
unitId: Math.max(0, Number(row.unitId || 0)),
|
||||
documentId: Math.max(0, Number(row.documentId || 0)),
|
||||
intakeId: row.intakeId != null ? Math.max(0, Number(row.intakeId || 0)) || null : null,
|
||||
documentType: String(row.documentType || '').trim() || null,
|
||||
fileName: String(row.fileName || '').trim() || null,
|
||||
status: String(row.status || '').trim(),
|
||||
userVisibleStage: String(row.userVisibleStage || '').trim() || null,
|
||||
reasonCode: String(row.reasonCode || '').trim() || null,
|
||||
explainability: row.explainability && typeof row.explainability === 'object'
|
||||
? row.explainability as { message?: string | null }
|
||||
: null,
|
||||
emailSupplement: row.emailSupplement && typeof row.emailSupplement === 'object'
|
||||
? row.emailSupplement as { status?: string | null }
|
||||
: null,
|
||||
};
|
||||
})
|
||||
: [],
|
||||
selectionPlan: rawSelectionPlan
|
||||
? {
|
||||
selectionVersion: String(rawSelectionPlan.selectionVersion || '').trim() || null,
|
||||
|
||||
Reference in new issue
Block a user