forked from yoone/WEB
fix(logistics): 修改courierCompany验证规则并移除冗余逻辑
将logistics.dto.ts中的courierCompany验证规则从string()改为any() 移除logistics.service.ts中关于courierCompany的条件判断逻辑,直接使用原始值
This commit is contained in:
parent
97ae006468
commit
f2f72f8c44
|
|
@ -25,7 +25,7 @@ export class ShipmentBookDTO {
|
|||
shipmentPlatform: string;
|
||||
|
||||
@ApiProperty()
|
||||
@Rule(RuleType.string())
|
||||
@Rule(RuleType.any())
|
||||
courierCompany: string;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -733,15 +733,10 @@ export class LogisticsService {
|
|||
}
|
||||
|
||||
if (data.shipmentPlatform === 'freightwaves') {
|
||||
|
||||
let courierCompany: string = "";
|
||||
if (data.courierCompany != "最优物流") {
|
||||
courierCompany = data.courierCompany;
|
||||
}
|
||||
// 根据TMS系统对接说明文档格式化参数
|
||||
const reqBody: any = {
|
||||
// shipCompany: 'UPSYYZ7000NEW',
|
||||
shipCompany: courierCompany,
|
||||
shipCompany: data.courierCompany,
|
||||
partnerOrderNumber: order.siteId + '-' + order.externalOrderId,
|
||||
warehouseId: '25072621030107400060',
|
||||
shipper: {
|
||||
|
|
@ -822,11 +817,7 @@ export class LogisticsService {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将ShipmentFeeBookDTO转换为freightwaves的RateTryRequest格式
|
||||
* @param data ShipmentFeeBookDTO数据
|
||||
* @returns RateTryRequest格式的数据
|
||||
*/
|
||||
|
||||
/**
|
||||
* 将ShipmentFeeBookDTO转换为freightwaves的RateTryRequest格式
|
||||
* @param data ShipmentFeeBookDTO数据
|
||||
|
|
@ -841,14 +832,10 @@ export class LogisticsService {
|
|||
})
|
||||
|
||||
const address = shipments?.address;
|
||||
let courierCompany: string = "";
|
||||
if (data.courierCompany != "最优物流") {
|
||||
courierCompany = data.courierCompany;
|
||||
}
|
||||
// 转换为RateTryRequest格式
|
||||
const r = {
|
||||
// shipCompany: 'UPSYYZ7000NEW',
|
||||
shipCompany: courierCompany,
|
||||
shipCompany: data.courierCompany,
|
||||
partnerOrderNumber: `order-${Date.now()}`, // 必填,使用时间戳生成
|
||||
warehouseId: '25072621030107400060', // 可选,使用stockPointId转换
|
||||
shipper: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue