forked from yoone/WEB
feat(logistics): 添加courierCompany字段并更新相关逻辑
在ShipmentBookDTO和ShipmentFeeBookDTO中添加courierCompany字段 更新物流服务中shipCompany的赋值逻辑,优先使用courierCompany
This commit is contained in:
parent
f6327a9e09
commit
c3acb66fd9
|
|
@ -23,6 +23,10 @@ export class ShipmentBookDTO {
|
|||
@ApiProperty()
|
||||
@Rule(RuleType.string())
|
||||
shipmentPlatform: string;
|
||||
|
||||
@ApiProperty()
|
||||
@Rule(RuleType.string())
|
||||
courierCompany: string;
|
||||
}
|
||||
|
||||
export class ShipmentFeeBookDTO {
|
||||
|
|
@ -30,6 +34,8 @@ export class ShipmentFeeBookDTO {
|
|||
@ApiProperty()
|
||||
shipmentPlatform: string;
|
||||
@ApiProperty()
|
||||
courierCompany: string;
|
||||
@ApiProperty()
|
||||
stockPointId: number;
|
||||
@ApiProperty()
|
||||
sender: string;
|
||||
|
|
|
|||
|
|
@ -467,7 +467,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}`);
|
||||
|
|
@ -737,7 +737,8 @@ export class LogisticsService {
|
|||
if (data.shipmentPlatform === 'freightwaves') {
|
||||
// 根据TMS系统对接说明文档格式化参数
|
||||
const reqBody: any = {
|
||||
shipCompany: 'UPSYYZ7000NEW',
|
||||
// shipCompany: 'UPSYYZ7000NEW',
|
||||
shipCompany: data.courierCompany || "",
|
||||
partnerOrderNumber: order.siteId + '-' + order.externalOrderId,
|
||||
warehouseId: '25072621030107400060',
|
||||
shipper: {
|
||||
|
|
@ -836,7 +837,8 @@ export class LogisticsService {
|
|||
const address = shipments?.address;
|
||||
// 转换为RateTryRequest格式
|
||||
const r = {
|
||||
shipCompany: 'UPSYYZ7000NEW', // 必填,但ShipmentFeeBookDTO中缺少
|
||||
// shipCompany: 'UPSYYZ7000NEW',
|
||||
shipCompany: data.courierCompany || "",
|
||||
partnerOrderNumber: `order-${Date.now()}`, // 必填,使用时间戳生成
|
||||
warehouseId: '25072621030107400060', // 可选,使用stockPointId转换
|
||||
shipper: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue