Files
ecom-dmb/ecom-dmb-frontend/apps/web-antd/src/api/ec/cost-sync/apis.ts
T
2026-08-29 17:04:14 +08:00

49 lines
1.1 KiB
TypeScript

import { requestClient } from '#/api/request';
export namespace CostSyncVO {
export interface Impact {
id: number;
productId: number;
skuId: number;
dateFrom: string;
dateTo: string;
status: string;
lastProductCost?: number;
lastShippingCost?: number;
lastOtherCost?: number;
createTime?: string;
appliedTime?: string;
applyBatchId?: string;
}
export interface ApplyTaskBrief {
costSyncTaskId: number;
shopId: number;
biCalcTaskId?: number;
dateFrom: string;
dateTo: string;
totalDays: number;
status: string;
createTime?: string;
}
export interface ApplyResult {
applyBatchId: string;
impactCount: number;
taskCount: number;
tasks: ApplyTaskBrief[];
}
}
/** 待同步成本影响面 */
export async function listPendingCostImpactsApi() {
return requestClient.get<CostSyncVO.Impact[]>('/ec/cost-sync/impacts/pending');
}
/** 一键同步全部 PENDING → 成本任务 + BI 全量 */
export async function applyPendingCostImpactsApi() {
return requestClient.post<CostSyncVO.ApplyResult>(
'/ec/cost-sync/apply-pending',
);
}