取消订单,同时也要取消顺丰同城的配送订单
This commit is contained in:
parent
cb0d5e0cc3
commit
6575858004
@ -5391,14 +5391,20 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 取消顺丰同城配送订单
|
// 取消顺丰同城配送订单
|
||||||
|
|
||||||
// === 7. 特殊场景:顺丰同城配送、且全单退的时候,才触发顺丰同城订单取消 ===
|
// === 7. 特殊场景:顺丰同城配送、且全单退的时候,才触发顺丰同城订单取消 ===
|
||||||
if (orderInfo.getDelivery_type_id() != null
|
if (orderInfo.getDelivery_type_id() != null
|
||||||
&& StateCode.DELIVERY_TYPE_SAME_CITY == orderInfo.getDelivery_type_id().intValue()) {
|
&& StateCode.DELIVERY_TYPE_SAME_CITY == orderInfo.getDelivery_type_id().intValue()) {
|
||||||
try {
|
try {
|
||||||
sfExpressApiService.cancelOrder(order_id, 313, "用户或商家取消订单。");
|
ThirdApiRes sfResult = sfExpressApiService.cancelOrder(order_id, 313, "用户或商家取消订单。");
|
||||||
|
if (sfResult != null && !sfResult.getError_code().equals(0)) {
|
||||||
|
log.error("顺丰同城取消订单返回错误,orderId: {}, errorCode: {}, errorMsg: {}",
|
||||||
|
order_id, sfResult.getError_code(), sfResult.getError_msg());
|
||||||
|
} else {
|
||||||
|
log.info("顺丰同城订单取消成功,orderId: {}", order_id);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("顺丰同城取消订单失败", e);
|
log.error("顺丰同城取消订单异常,orderId: {}", order_id, e);
|
||||||
|
// 可以考虑添加补偿机制或异步重试
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user