feat(shipping-notice): 收敛复核阶段同源投影与 OT 后履约推进
统一 Case/Progress 阶段 label_key、修复 Job 成功未推进 OT 的可重试失败投影与写路径,并落地 OT 后行级匹配/波次履约与版面诊断开关。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
74270adc22
commit
fd6a23f870
100 files changed
+12138
-1017
No files matched your search
@@ -140,6 +140,7 @@ export function normalizeShippingProcessingProjection(
|
||||
intakeNo: readString(item, 'intake_no', 'intakeNo'),
|
||||
status: (readString(item, 'status', 'status') || 'processing') as ShippingProcessingStatus,
|
||||
stage: (readString(item, 'stage', 'stage') || 'upload_received') as ShippingProcessingStage,
|
||||
stageLabelKey: readNullableString(item, 'stage_label_key', 'stageLabelKey'),
|
||||
progressVersion: Number(item.progress_version ?? item.progressVersion ?? 0) || 0,
|
||||
lastActivityAt: readString(item, 'last_activity_at', 'lastActivityAt'),
|
||||
stageNodes: stageNodes?.length ? stageNodes : undefined,
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* features/chat/shipping/shippingProcessingLabels.ts
|
||||
* 用途:将统一 ShippingProcessing 状态/阶段码映射到四语言 i18n 键。
|
||||
* 依赖:vue-i18n Composer(由调用方传入 t / te)。
|
||||
* 逻辑:统一读 chat.shippingProcessing.*(含原 shippingWorkflow 合并键,如 taskStatus)。
|
||||
* 逻辑:统一读 chat.shippingProcessing.*;阶段展示优先消费后端 label_key
|
||||
* (如 waiting_system_start),禁止把 stage code 直接当用户文案。
|
||||
*/
|
||||
|
||||
/** 会话 processing 旧 status_label → 统一 ShippingProcessingStatus。 */
|
||||
@@ -79,7 +80,7 @@ export function resolveShippingProcessingMessage(
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析统一处理阶段的展示文案键。
|
||||
* 解析统一处理阶段的展示文案键(技术阶段码)。
|
||||
* @param stage - ShippingProcessingStage 码
|
||||
* @returns i18n key
|
||||
*/
|
||||
@@ -90,6 +91,41 @@ export function shippingProcessingStageKey(stage: string): string {
|
||||
: 'chat.shippingProcessing.stage.upload_received';
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析阶段用户文案:优先后端 label_key,禁止直接展示 stage code。
|
||||
* 核心逻辑:label_key → stageLabel.* / currentProcessing.stages.*;再回退 stage.*。
|
||||
*
|
||||
* @param stage - 技术阶段码
|
||||
* @param te - i18n te
|
||||
* @param t - i18n t
|
||||
* @param labelKey - 后端投影 label_key(如 waiting_system_start)
|
||||
* @returns 本地化文案
|
||||
*/
|
||||
export function resolveShippingProcessingStageLabel(
|
||||
stage: string,
|
||||
te: (key: string) => boolean,
|
||||
t: (key: string) => string,
|
||||
labelKey?: string | null,
|
||||
): string {
|
||||
const lk = String(labelKey || '').trim();
|
||||
if (lk) {
|
||||
const stageLabelKey = `chat.shippingProcessing.stageLabel.${lk}`;
|
||||
if (te(stageLabelKey)) return t(stageLabelKey);
|
||||
const reviewKey = `chat.shippingOrderReview.currentProcessing.stages.${lk}`;
|
||||
if (te(reviewKey)) return t(reviewKey);
|
||||
}
|
||||
const code = String(stage || '').trim();
|
||||
if (!code) return '—';
|
||||
const stageKey = shippingProcessingStageKey(code);
|
||||
if (te(stageKey)) return t(stageKey);
|
||||
const reviewCodeKey = `chat.shippingOrderReview.currentProcessing.stages.${code}`;
|
||||
if (te(reviewCodeKey)) return t(reviewCodeKey);
|
||||
// 禁止把码当文案:无键时回退通用等待文案,而非裸 code。
|
||||
return te('chat.shippingProcessing.stageLabel.waiting_system_start')
|
||||
? t('chat.shippingProcessing.stageLabel.waiting_system_start')
|
||||
: code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析工作项类型文案键。
|
||||
* @param workItemType - order_intake | order_task
|
||||
|
||||
Reference in new issue
Block a user