zksu
/
API
forked from yoone/API
1
0
Fork 0

Compare commits

..

4 Commits

Author SHA1 Message Date
tikkhun 792ec5aaf0 fix(订单服务): 修复产品分类可能为空的错误并优化产品查询
修复订单服务中产品分类可能为空导致的错误,改为可选链操作
优化产品服务中组件查询逻辑,使用sku查询并添加关联关系
移除产品服务中不必要的组件查询逻辑
2026-01-29 09:19:16 +08:00
tikkhun e0cbfe7320 refactor(订单服务): 移除getComponentDetailFromSiteSku中不必要的quantity参数
简化组件详情查询逻辑,默认数量设为1,不再需要外部传入quantity参数
2026-01-28 21:27:37 +08:00
tikkhun 5530c3220f fix(product): 修复产品属性重复检查逻辑并添加日志记录
修复产品属性重复检查时未考虑属性数量的问题,确保只有当属性数量完全匹配时才认为重复
添加导入结果的调试日志记录
2026-01-28 18:58:52 +08:00
tikkhun efba2278b0 fix: 修复父产品ID可能为undefined时的处理 2026-01-27 20:12:50 +08:00
3 changed files with 8 additions and 33 deletions

View File

@ -23,10 +23,6 @@ export class ShipmentBookDTO {
@ApiProperty()
@Rule(RuleType.string())
shipmentPlatform: string;
@ApiProperty()
@Rule(RuleType.string())
courierCompany: string;
}
export class ShipmentFeeBookDTO {
@ -34,8 +30,6 @@ export class ShipmentFeeBookDTO {
@ApiProperty()
shipmentPlatform: string;
@ApiProperty()
courierCompany: string;
@ApiProperty()
stockPointId: number;
@ApiProperty()
sender: string;

View File

@ -247,9 +247,6 @@ export class FreightwavesService {
};
const response = await this.sendRequest<RateTryResponseData>('/shipService/order/rateTry', requestData);
if (response.code !== '00000200') {
throw new Error(response.msg);
}
return response.data;
}
@ -265,10 +262,7 @@ export class FreightwavesService {
};
const response = await this.sendRequest<CreateOrderResponseData>('/shipService/order/createOrder', requestData);
if (response.code !== '00000200') {
throw new Error(response.msg);
}
return response.data;
return response;
}
/**
@ -301,9 +295,6 @@ export class FreightwavesService {
};
const response = await this.sendRequest<ModifyOrderResponseData>('/shipService/order/modifyOrder', requestData);
if (response.code !== '00000200') {
throw new Error(response.msg);
}
return response.data;
}
@ -318,9 +309,6 @@ export class FreightwavesService {
partner: this.config.partner,
};
const response = await this.sendRequest<RefundOrderResponseData>('/shipService/order/refundOrder', requestData);
if (response.code !== '00000200') {
throw new Error(response.msg);
}
return response.data;
}

View File

@ -464,7 +464,7 @@ export class LogisticsService {
}
};
} catch (error) {
if (resShipmentOrder?.status === 'SUCCESS') {
if (resShipmentOrder.status === 'SUCCESS') {
await this.uniExpressService.deleteShipment(resShipmentOrder.data.tno);
}
throw new Error(`上游请求错误:${error}`);
@ -733,9 +733,8 @@ export class LogisticsService {
if (data.shipmentPlatform === 'freightwaves') {
// 根据TMS系统对接说明文档格式化参数
const reqBody: any = {
// shipCompany: 'UPSYYZ7000NEW',
shipCompany: data.courierCompany || "",
partnerOrderNumber: order.siteId + '-1-' + order.externalOrderId,
shipCompany: 'UPSYYZ7000NEW',
partnerOrderNumber: order.siteId + '-' + order.externalOrderId,
warehouseId: '25072621030107400060',
shipper: {
name: data.details.origin.contact_name, // 姓名
@ -799,20 +798,15 @@ export class LogisticsService {
};
resShipmentOrder = await this.freightwavesService.createOrder(reqBody); // 创建订单
//tms只返回了物流订单号需要查询一次来获取完整的物流信息
const queryRes = await this.freightwavesService.queryOrder({ shipOrderId: resShipmentOrder.shipOrderId }); // 查询订单
return {
...resShipmentOrder,
...queryRes
}
resShipmentOrder.push(queryRes);
}
return resShipmentOrder;
} catch (error) {
// 处理错误,例如记录日志或抛出异常
throw new Error(`物流订单处理失败: ${error}`);
console.log('物流订单处理失败:', error); // 使用console.log代替this.log
throw error;
}
}
@ -832,8 +826,7 @@ export class LogisticsService {
const address = shipments?.address;
// 转换为RateTryRequest格式
const r = {
//shipCompany: 'UPSYYZ7000NEW', // 必填但ShipmentFeeBookDTO中缺少
shipCompany: data.courierCompany || "",
shipCompany: 'UPSYYZ7000NEW', // 必填但ShipmentFeeBookDTO中缺少
partnerOrderNumber: `order-${Date.now()}`, // 必填,使用时间戳生成
warehouseId: '25072621030107400060', // 可选使用stockPointId转换
shipper: {