feat(shipping-notice,receipt-report): 新增收料报表功能并优化发货通知流程
清理废弃的shipping xfa ocr automark相关代码和job配置 新增收料报表管理的前端页面、路由和侧边栏入口 新增后端收料报表配置接口、数据库模型和RPA脚本 优化发货通知流程的重试策略,将shipping相关job默认不自动重试 移除废弃的库存源确认相关逻辑,更新流程门禁规则 重构订单模板的值适配器模块,新增坐标OCR值适配器 清理前端shipping菜单和action的废弃选项 更新相关文档和测试用例,调整.gitignore忽略规则
This commit is contained in:
1 parent
260465b72d
commit
1b6483a4ea
466 files changed
+32115
-33796
No files matched your search
@@ -28,27 +28,22 @@ const ACTION_CODE_TO_INTENT: Record<string, ShippingProcessingActionIntent> = {
|
||||
open_order_processing: 'open_order_review',
|
||||
enter_manual_review: 'open_order_review',
|
||||
edit_formal_task: 'edit_formal_task',
|
||||
freeze_order: 'edit_formal_task',
|
||||
open_profile_review: 'open_profile_review',
|
||||
confirm_customer: 'confirm_customer',
|
||||
resolve_field_conflicts: 'resolve_field_conflicts',
|
||||
adjudicate_duplicate: 'adjudicate_duplicate',
|
||||
open_inventory_source_review: 'open_inventory_source_review',
|
||||
confirm_inventory_source: 'open_inventory_source_review',
|
||||
retry_resolve_inventory_source: 'open_inventory_source_review',
|
||||
open_inventory_match_review: 'open_inventory_match_review',
|
||||
rematch: 'open_inventory_match_review',
|
||||
match_inventory: 'open_inventory_match_review',
|
||||
open_shortage_review: 'open_shortage_review',
|
||||
upload_inventory_file: 'upload_inventory_file',
|
||||
retry_inventory_preparation: 'retry',
|
||||
retry_inventory_matching: 'open_inventory_match_review',
|
||||
retry: 'retry',
|
||||
reparse_batch: 'reparse_batch',
|
||||
retry_parse: 'retry',
|
||||
retry_failed_documents: 'retry',
|
||||
retry_failed_attachments: 'retry',
|
||||
retry_upload: 'retry',
|
||||
retry_freight_upload_rpa: 'retry',
|
||||
retry_order_extraction: 'retry',
|
||||
retry_layout_parsing: 'retry',
|
||||
// 订单识别复核卡后端动作码:统一复用右侧「进入订单处理/重试解析/查看结果」执行器。
|
||||
edit_draft: 'open_order_review',
|
||||
reconcile_and_progress: 'open_order_review',
|
||||
@@ -57,8 +52,7 @@ const ACTION_CODE_TO_INTENT: Record<string, ShippingProcessingActionIntent> = {
|
||||
reparse: 'retry',
|
||||
view: 'view_result',
|
||||
refresh: 'refresh',
|
||||
regenerate_excel: 'regenerate_excel',
|
||||
generate_excel: 'regenerate_excel',
|
||||
regenerate_excel_artifact: 'regenerate_excel',
|
||||
download_excel: 'download_excel',
|
||||
open_manual_upload: 'open_manual_upload',
|
||||
wait_manual_upload: 'open_manual_upload',
|
||||
@@ -77,6 +71,48 @@ const ACTION_CODE_TO_INTENT: Record<string, ShippingProcessingActionIntent> = {
|
||||
const AUTOMATING_STATUSES = new Set(['processing', 'automating', 'queued']);
|
||||
/** 永不升为主 CTA 的动作码(仍可作次要/溢出)。 */
|
||||
const NEVER_PRIMARY_CODES = new Set(['cancel_task', 'cancel_run', 'view_details']);
|
||||
/**
|
||||
* 仅供执行编排或历史审计使用的库存恢复动作;不得重新暴露为正式用户 CTA。
|
||||
* 它们会绕过当前库存步骤的标准语义,用户入口必须使用 retry_inventory_preparation
|
||||
* 或 retry_inventory_matching 等稳定动作码。
|
||||
*/
|
||||
const INTERNAL_INVENTORY_ACTION_CODES = new Set([
|
||||
'retry_inventory_from_preparation',
|
||||
'retry_inventory_from_matching',
|
||||
'retry_inventory_field_mapping',
|
||||
'retry_inventory_from_field_mapping',
|
||||
'poll_inventory_preparation',
|
||||
'refresh_inventory_candidate_projection',
|
||||
'recheck_inventory_sufficiency',
|
||||
]);
|
||||
|
||||
/**
|
||||
* 返回库存业务动作的唯一展示文案键。
|
||||
* 核心逻辑:所有 Surface 以 action_code 为准共享同一翻译,而不改变后端 Gate 的执行码。
|
||||
* @param code - 后端下发的库存 Gate 动作码
|
||||
* @returns 统一翻译键;非库存动作返回 null
|
||||
*/
|
||||
export function inventoryActionLabelKey(code: string | null | undefined): string | null {
|
||||
const normalized = String(code || '').trim().toLowerCase();
|
||||
const keyByCode: Record<string, string> = {
|
||||
retry_inventory_preparation: 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryPreparation',
|
||||
retry_inventory_matching: 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryMatching',
|
||||
open_inventory_match_review: 'workspace.shippingNotice.processGate.inventoryActions.openInventoryMatchReview',
|
||||
open_shortage_review: 'workspace.shippingNotice.processGate.inventoryActions.openShortageReview',
|
||||
download_inventory_file: 'workspace.shippingNotice.processGate.inventoryActions.downloadInventoryFile',
|
||||
release_inventory_shortage: 'workspace.shippingNotice.processGate.inventoryActions.releaseInventoryShortage',
|
||||
};
|
||||
return keyByCode[normalized] || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断动作是否只能留在内部恢复编排中。
|
||||
* @param code - Gate / Projection 原始动作码
|
||||
* @returns true 表示正式用户界面必须 fail-closed 隐藏
|
||||
*/
|
||||
export function isInternalInventoryAction(code: string | null | undefined): boolean {
|
||||
return INTERNAL_INVENTORY_ACTION_CODES.has(String(code || '').trim().toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* 将原始动作码映射为统一意图;未知码返回 null。
|
||||
@@ -106,10 +142,12 @@ function toItem(
|
||||
// 只读导航动作码而误显示为订单处理。该分支不改变权限或路由目标。
|
||||
if (targetLifecycleStage === 'intake_parse') {
|
||||
labelKey = 'chat.shippingProcessing.action.open_intake_parse';
|
||||
} else if (normalized === 'retry_inventory_preparation') {
|
||||
labelKey = 'workspace.shippingNotice.processGate.actionCodes.retry_inventory_preparation';
|
||||
} else if (normalized === 'retry_freight_upload_rpa' || normalized === 'retry_upload') {
|
||||
} else if (inventoryActionLabelKey(normalized)) {
|
||||
labelKey = inventoryActionLabelKey(normalized)!;
|
||||
} else if (normalized === 'retry_freight_upload_rpa') {
|
||||
labelKey = 'chat.shippingNoticeRetryUploadAction';
|
||||
} else if (normalized === 'reparse_batch') {
|
||||
labelKey = 'chat.shippingProcessing.action.reparse_batch';
|
||||
} else if (intent === 'retry' && chatOrRight) {
|
||||
labelKey = 'chat.shippingProcessing.action.retry_parse';
|
||||
} else if (normalized === 'focus_task' && chatOrRight) {
|
||||
@@ -205,6 +243,7 @@ export function resolveProcessingActionPresentation(
|
||||
const code = String(raw || '').trim();
|
||||
if (!code) return;
|
||||
const key = code.toLowerCase();
|
||||
if (isInternalInventoryAction(key)) return;
|
||||
// 仅用于管理员恢复缺失待办记录,不作为普通用户履约动作展示。
|
||||
if (key === 'regenerate_manual_upload_todo') return;
|
||||
if (seen.has(key)) return;
|
||||
@@ -299,6 +338,7 @@ export function resolveConversationTaskActionPresentation(
|
||||
const code = String(raw || '').trim();
|
||||
if (!code) return;
|
||||
const key = code.toLowerCase();
|
||||
if (isInternalInventoryAction(key)) return;
|
||||
if (seen.has(key)) return;
|
||||
// 任务卡同样禁止通过“待处理 + view”补造订单生命周期权限。
|
||||
const intent = mapActionCodeToIntent(code);
|
||||
|
||||
Reference in new issue
Block a user