refactor(shipping-notice): 重构货代发货通知状态管理,移除废弃的process_status字段

统一货代发货通知的业务阶段为四个标准阶段:接收解析、订单复核、发货准备、上传完成
设置 ui_state 为前端唯一状态数据源,不再依赖 process_status 驱动业务流程
删除 shipping_notices 表的废弃 process_status 列及对应复合索引,新增数据库迁移脚本
替换全栈代码中所有对 process_status 的引用为生命周期、上传状态等领域字段
更新相关文档、测试用例与前端展示逻辑适配新的状态管理规则
This commit is contained in:
hugo committed 2026-08-15 10:19:10 +08:00
1 parent 6684e7181a
commit 5ef8329bd8
178 files changed
+5091 -1734

No files matched your search

@@ -693,6 +693,34 @@ describe('ShippingOrderReviewView layout phase 1', () => {
expect(wrapper.find('[data-testid="mock-process-gate"]').attributes('data-actions')).toBe('hidden');
});
it('does not revive a Case Gate action when the formal OT ui_state explicitly has no action', async () => {
activeCase.value = {
...activeCase.value,
status: 'confirmed', has_formal_ot: true, task_missing: false,
confirmed_task_id: 89, confirmed_task_no: 'SN-NO-ACTION-1',
process_gate: {
execution_no: 'EXEC-NO-ACTION-1', status: 'blocked', owner_type: 'human', technical_auto_only: false,
current_blocking_gate: { gate_code: 'customer_confirmation', status: 'blocked' },
primary_action: { code: 'confirm_customer', label_key: 'chat.shippingNotice.processGate.actionCodes.confirm_customer' },
},
automation: { status: 'running', can_auto_create: false, can_build: true },
};
shippingProcessingProjection.value = {
workItemType: 'order_task', workItemNo: 'SN-NO-ACTION-1', sourceType: 'direct_pdf',
rootOrderTaskNo: 'SN-NO-ACTION-1', shippingNoticeNo: 'SN-NO-ACTION-1', conversationId: 'conv-1',
submissionNo: 'SUB-NO-ACTION', intakeNo: 'SNI-NO-ACTION', status: 'processing', stage: 'order_creating',
progressVersion: 1, lastActivityAt: '2026-08-14T00:00:00Z', currentGate: null, availableActions: ['confirm_customer'],
sourceSummary: { emailSubject: null, filename: 'no-action.pdf', documentCount: 1, parsedDocumentCount: 1, candidateCount: 1, customerName: null, poNumber: null },
childOrderTasks: [], uiState: { status: 'processing', stage: 'order_creating', blocking_reason: null, primary_action: null, secondary_actions: [] },
};
const wrapper = await mountView();
await flushPromises();
// 正式 OT 已有后端 ui_state,Case Gate 只是诊断/建单前兼容来源,不能复活按钮。
expect(wrapper.find('[data-testid="review-current-task-primary-action"]').exists()).toBe(false);
});
it('shows restored version as current and latest version only as failed attempt', async () => {
reviewProgressContext.value = {
item_no: 'WFI-1',
@@ -766,7 +794,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
vi.mocked(taskApi.getWorkspaceShippingTask).mockResolvedValueOnce({
task_no: 'SN-MOCK',
status: 'completed',
process_status: 'uploaded',
upload_status: 'uploaded',
upload_status: 'uploaded',
lines: [],
line_results: [{