feat(shipping-notice): 新增货代发货通知全流程业务功能
- 新增后端完整业务支持:数据库模型、API接口、核心服务与RPA对接逻辑 - 新增前端工作台页面、路由适配与多语言国际化 - 新增Dify自定义工具OpenAPI规范、Agent配置脚本与部署文档 - 新增发货Excel模板生成脚本与默认模板 - 修复测试配置文件中的环境变量命名错误 - 更新本地开发环境变量配置
This commit is contained in:
1 parent
93e99793d8
commit
2d7bdecc43
46 files changed
+3462
-7
No files matched your search
@@ -0,0 +1,60 @@
|
||||
import { getAuthHeaders } from '../utils/auth';
|
||||
|
||||
export interface ShippingCaseSummary {
|
||||
id: number;
|
||||
case_no: string;
|
||||
source_type: string;
|
||||
customer_name?: string | null;
|
||||
process_status: string;
|
||||
review_status?: string | null;
|
||||
match_status?: string | null;
|
||||
pending_human_reason?: string | null;
|
||||
conversation_id?: string | null;
|
||||
export_file_name?: string | null;
|
||||
freight_ref_no?: string | null;
|
||||
created_at?: string | null;
|
||||
updated_at?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingCaseEvent {
|
||||
event_type: string;
|
||||
detail_json?: Record<string, unknown> | null;
|
||||
created_at?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingCaseDetail extends ShippingCaseSummary {
|
||||
customer_code?: string | null;
|
||||
ship_to?: string | null;
|
||||
required_date?: string | null;
|
||||
lines: Array<Record<string, unknown>>;
|
||||
shortage?: Record<string, unknown> | null;
|
||||
line_results?: Array<Record<string, unknown>>;
|
||||
parse_confidence?: number | null;
|
||||
error_message?: string | null;
|
||||
events: ShippingCaseEvent[];
|
||||
}
|
||||
|
||||
async function getJson<T>(url: string): Promise<T> {
|
||||
const res = await fetch(url, { headers: getAuthHeaders() });
|
||||
if (!res.ok) {
|
||||
const body = await res.json().catch(() => ({}));
|
||||
throw new Error((body as { error?: string }).error || res.statusText);
|
||||
}
|
||||
return res.json() as Promise<T>;
|
||||
}
|
||||
|
||||
export const listWorkspaceShippingCases = (params?: { process_status?: string; limit?: number }) => {
|
||||
const sp = new URLSearchParams();
|
||||
if (params?.process_status) sp.set('process_status', params.process_status);
|
||||
if (params?.limit) sp.set('limit', String(params.limit));
|
||||
const qs = sp.toString();
|
||||
return getJson<ShippingCaseSummary[]>(`/api/workspace/shipping-cases${qs ? '?' + qs : ''}`);
|
||||
};
|
||||
|
||||
export const getWorkspaceShippingCase = (caseNo: string) =>
|
||||
getJson<ShippingCaseDetail>(`/api/workspace/shipping-cases/${encodeURIComponent(caseNo)}`);
|
||||
|
||||
export const workspaceShippingExportUrl = (caseNo: string) =>
|
||||
`/api/workspace/shipping-cases/${encodeURIComponent(caseNo)}/export`;
|
||||
|
||||
export const SHIPPING_NOTICE_AGENT_NAME = '货代发货通知 Agent';
|
||||
Reference in new issue
Block a user