feat(freight-rpa): 增加出站报表配置与回调支持,重构相关服务

- 将 RPA 管理 API 扩展至出站报表配置,新增出站相关的回调接口。
- 重构 freight_rpa_report_config_service,支持入站与出站报表配置的管理。
- 更新 ORM 模型,增加出站报表相关的持久化模型。
- 统一命名规范,确保在手、入站与出站的概念一致性。
This commit is contained in:
hugo committed 2026-10-19 18:45:16 +08:00
1 parent 39fe3c05f2
commit 911afa0f73
152 files changed
+9861 -2984

No files matched your search

+12 -4
View File
@@ -295,9 +295,9 @@ export const createShippingOnhandStructureAnalysis = (file: File) => {
method: 'POST', body: form, ...auth(),
});
};
/** 读取标准异动字段目录(只读领域契约,供收料异动解析规则映射表单)。 */
/** 读取标准异动字段目录(只读领域契约,供入站/出站报表规则映射表单)。 */
export const fetchMovementFields = () => requestJson<Array<{ code: string; value_type: string; required: boolean; is_identity: boolean }>>(
'/api/admin/shipping-notice/movement-fields', auth(),
'/api/admin/freight-rpa/movement-fields', auth(),
);
/** 用已分析的真实栏位创建库存文件解析方案草稿。 */
export const createShippingOnhandParsingDraftFromAnalysis = (id: number, payload: Record<string, unknown>) => requestJson<unknown>(
@@ -339,13 +339,21 @@ export const saveShippingOnhandSource = (payload: Record<string, unknown>, id?:
{ method: id ? 'PUT' : 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
/** 读取/保存站点独立入站报表配置(/freight-rpa/sources/<id>/inbound-report-config);严禁通过库存站点保存接口夹带这些字段。 */
export const getShippingReceiptReportConfig = (sourceId: number) => requestJson<Record<string, unknown> | null>(
export const getInboundReportConfig = (sourceId: number) => requestJson<Record<string, unknown> | null>(
`/api/admin/freight-rpa/sources/${sourceId}/inbound-report-config`, auth(),
);
export const saveShippingReceiptReportConfig = (sourceId: number, payload: Record<string, unknown>) => requestJson<Record<string, unknown>>(
export const saveInboundReportConfig = (sourceId: number, payload: Record<string, unknown>) => requestJson<Record<string, unknown>>(
`/api/admin/freight-rpa/sources/${sourceId}/inbound-report-config`,
{ method: 'PUT', body: JSON.stringify(payload), ...jsonAuth() },
);
/** 读取/保存站点独立出站报表配置;载荷键与入站相同,严禁夹带来源站点字段。 */
export const getOutboundReportConfig = (sourceId: number) => requestJson<Record<string, unknown> | null>(
`/api/admin/freight-rpa/sources/${sourceId}/outbound-report-config`, auth(),
);
export const saveOutboundReportConfig = (sourceId: number, payload: Record<string, unknown>) => requestJson<Record<string, unknown>>(
`/api/admin/freight-rpa/sources/${sourceId}/outbound-report-config`,
{ method: 'PUT', body: JSON.stringify(payload), ...jsonAuth() },
);
/** 直接绑定停用库存站点到已发布解析方案;服务端自动写入操作审计。 */
export const bindShippingOnhandSourceParsingProfile = (id: number, payload: { parsing_profile_id: number }) => requestJson<unknown>(
`/api/admin/freight-rpa/sources/${id}/bind-parsing-profile`, { method: 'POST', body: JSON.stringify(payload), ...jsonAuth() },
@@ -1,6 +1,6 @@
/**
* features/admin/api/schedule.api.ts
* 管理后台定时任务 HTTP API:任务 CRUD、配置、测试执行、运行记录。
* 管理后台定时任务 HTTP API:任务 CRUD、配置、测试执行、运行记录、库存/入站/出站 raw-zip。
*/
import { getAuthHeaders } from '@/shared/utils/auth';
import { requestJson } from '@/shared/api/client';
@@ -159,8 +159,11 @@ export const adminRunExcelUrl = (runId: number) => `/api/admin/schedule-runs/${r
export const adminRunInventoryRawZipUrl = (runId: number) =>
`/api/admin/schedule-runs/${runId}/inventory-raw-zip`;
export const adminRunReceiptRawZipUrl = (runId: number) =>
`/api/admin/schedule-runs/${runId}/receipt-raw-zip`;
export const adminRunInboundRawZipUrl = (runId: number) =>
`/api/admin/schedule-runs/${runId}/inbound-raw-zip`;
export const adminRunOutboundRawZipUrl = (runId: number) =>
`/api/admin/schedule-runs/${runId}/outbound-raw-zip`;
export interface RpaWorkerHeartbeatWorker {
worker_id?: string;
@@ -181,7 +184,7 @@ export interface RpaWorkerHeartbeatWorker {
}
export interface RpaWorkerHeartbeatSummary {
scope?: 'onhand' | 'inbound' | string;
scope?: 'onhand' | 'inbound' | 'outbound' | string;
ready: boolean;
message: string;
detail_message?: string;
@@ -195,7 +198,7 @@ export interface RpaWorkerHeartbeatSummary {
workers: RpaWorkerHeartbeatWorker[];
}
export const getAdminRpaWorkersStatus = (scope: 'onhand' | 'inbound' = 'onhand') =>
export const getAdminRpaWorkersStatus = (scope: 'onhand' | 'inbound' | 'outbound' = 'onhand') =>
getJson<RpaWorkerHeartbeatSummary>(`/api/admin/rpa-workers/status?scope=${encodeURIComponent(scope)}`);
export type { DifyExecutionSnapshot, ScheduleRun, ScheduleTask, StepLog, TestScheduleRunResult, TestScheduleSqlResult };