div #69

Merged
longbot merged 3 commits from zhuotianyuan/API:div into stable 2026-01-29 03:52:49 +00:00
1 changed files with 10 additions and 9 deletions
Showing only changes of commit d354267572 - Show all commits

View File

@ -339,8 +339,6 @@ export class LogisticsService {
throw new Error('不支持的运单平台'); throw new Error('不支持的运单平台');
} }
} catch (e) { } catch (e) {
throw e; throw e;
} }
@ -363,12 +361,7 @@ export class LogisticsService {
try { try {
resShipmentOrder = await this.mepShipment(data, order); resShipmentOrder = await this.mepShipment(data, order);
// 记录物流信息,并将订单状态转到完成,uniuni状态为SUCCESStms.freightwaves状态为00000200 order.orderStatus = ErpOrderStatus.COMPLETED;
if (resShipmentOrder.status === 'SUCCESS' || resShipmentOrder.code === '00000200') {
order.orderStatus = ErpOrderStatus.COMPLETED;
} else {
throw new Error('运单生成失败');
}
const dataSource = this.dataSourceManager.getDataSource('default'); const dataSource = this.dataSourceManager.getDataSource('default');
let transactionError = undefined; let transactionError = undefined;
let shipmentId = undefined; let shipmentId = undefined;
@ -732,6 +725,11 @@ export class LogisticsService {
}; };
// 添加运单 // 添加运单
resShipmentOrder = await this.uniExpressService.createShipment(reqBody); resShipmentOrder = await this.uniExpressService.createShipment(reqBody);
// 记录物流信息,并将订单状态转到完成,uniuni状态为SUCCESStms.freightwaves状态为00000200
if (resShipmentOrder.status !== 'SUCCESS') {
throw new Error('运单生成失败');
}
} }
if (data.shipmentPlatform === 'freightwaves') { if (data.shipmentPlatform === 'freightwaves') {
@ -805,7 +803,10 @@ export class LogisticsService {
resShipmentOrder = await this.freightwavesService.createOrder(reqBody); // 创建订单 resShipmentOrder = await this.freightwavesService.createOrder(reqBody); // 创建订单
//tms只返回了物流订单号需要查询一次来获取完整的物流信息 //tms只返回了物流订单号需要查询一次来获取完整的物流信息
const queryRes = await this.freightwavesService.queryOrder({ shipOrderId: resShipmentOrder.shipOrderId }); // 查询订单 const queryRes = await this.freightwavesService.queryOrder({ shipOrderId: resShipmentOrder.shipOrderId }); // 查询订单
resShipmentOrder.push(queryRes); return {
...resShipmentOrder,
...queryRes
}
} }
return resShipmentOrder; return resShipmentOrder;