feat(shipping): 新增货代发货批量自动处理与任务重试功能
本次提交完整实现货代发货通知的自动化批量处理能力: 1. 新增发货单票后台任务类型与专用worker队列,实现任务持久化调度 2. 实现发货批次后台编排器,支持上传后自动逐票推进解析、匹配、导出全流程 3. 新增单票重试、批次待处理重试的API与前端操作界面 4. 补充全量多语言翻译,新增重试、任务列表、状态展示相关文案 5. 优化上传交互逻辑,改为后台自动处理任务,无需手动触发解析指令 6. 修复文件检核工具无数据预检逻辑,避免创建空检核批次 7. 调整发货工作流细节,优化Excel生成幂等性与任务状态同步 8. 更新环境配置与API文档,修正货代工具接口地址端口
This commit is contained in:
1 parent
70e8f700ff
commit
08360a4142
40 files changed
+2515
-371
No files matched your search
@@ -45,6 +45,8 @@ const CURRENT_STEP_INDEX_MAP: Record<string, number> = {
|
||||
step7_finish: 6,
|
||||
};
|
||||
|
||||
const TERMINAL_PROCESS_STATUSES = new Set(['uploaded', 'closed']);
|
||||
|
||||
function deriveCurrentIndex(task: ShippingTaskStepperSource | null | undefined): number {
|
||||
const currentStep = String(task?.current_step || '').trim();
|
||||
const processStatus = String(task?.process_status || '').trim();
|
||||
@@ -60,7 +62,7 @@ function deriveCurrentIndex(task: ShippingTaskStepperSource | null | undefined):
|
||||
}
|
||||
}
|
||||
|
||||
if (processStatus === 'uploaded' || processStatus === 'closed') return 6;
|
||||
if (TERMINAL_PROCESS_STATUSES.has(processStatus)) return 6;
|
||||
if (processStatus === 'waiting_upload' || processStatus === 'upload_failed' || hasExport) return 5;
|
||||
if (processStatus === 'matched') return 4;
|
||||
if (reviewStatus === 'shortage_review' || pendingReason === 'shortage_review' || pendingReason === 'shortage') return 4;
|
||||
@@ -102,7 +104,10 @@ export function buildShippingWorkflowSteps(
|
||||
|
||||
return SHIPPING_WORKFLOW_STEP_LABELS.map((label, index) => {
|
||||
let status: ShippingWorkflowStepItem['status'] = 'pending';
|
||||
if (index < currentIndex) {
|
||||
// [STEP 1] uploaded/closed 是整票已完成的终态,不能再被 current_step 渲染成“第 7 步进行中”。
|
||||
if (TERMINAL_PROCESS_STATUSES.has(processStatus)) {
|
||||
status = 'completed';
|
||||
} else if (index < currentIndex) {
|
||||
status = 'completed';
|
||||
} else if (index === currentIndex) {
|
||||
status = 'current';
|
||||
|
||||
Reference in new issue
Block a user