feat(ecom-dmb): 优化商品成本同步逻辑

后端:
- UpdateProductResultDTO 改回只返回成本变更的规格ID列表
- ProductServiceImpl 构建 ID 列表而非完整对象
- 新增 BatchSyncCostDTO 批量同步请求DTO
- ProductSpecService 新增 getByIds 批量查询规格方法
- ProductSpecController 新增批量同步接口 batch-sync-costs-to-orders
- ProductSpecController 新增 batch-get-by-ids 接口查询规格详情

前端:
- UpdateProductResult 类型改为返回 costChangedSpecIds: number[]
- 新增 BatchSyncCost 和 getProductSpecsByIdsApi 批量接口
- ProductFormModal 改为批量同步,修复 responseReturn .data 的误用 bug
This commit is contained in:
小蟑螂
2026-04-17 11:40:23 +08:00
parent ac39f5d850
commit 5c4ef6c990
10 changed files with 171 additions and 104 deletions
@@ -31,24 +31,8 @@ export namespace ProductVO {
/** 更新商品响应 */
export interface UpdateProductResult {
/** 本次更新中成本发生变更的规格列表 */
costChangedSpecs: CostChangedSpec[];
}
/** 成本变更的规格信息 */
export interface CostChangedSpec {
/** 规格ID */
id: number;
/** 规格名称 */
name: string;
/** 规格编码 */
specCode?: string;
/** 商品成本 */
productCost: number;
/** 运费成本 */
shippingCost?: number;
/** 其他成本 */
otherCost?: number;
/** 本次更新中成本发生变更的规格ID列表 */
costChangedSpecIds: number[];
}
/** 商品规格信息 */