This commit is contained in:
richboo111
2023-01-31 11:01:20 +08:00
parent a4f19220eb
commit e0e461d958
6 changed files with 44 additions and 30 deletions

View File

@@ -247,8 +247,8 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
func (c *BaseScheduler) CancelWaybill(bill *model.Waybill, cancelReasonID int, cancelReason string) (err error) {
// 部分快递平台在取消成功后有时会不发运单取消消息过来比如达达904200512000442为避免二次取消报错添加状态判断
if c.IsReallyCallPlatformAPI && bill.Status != model.WaybillStatusCanceled { //此行测试用
//if c.IsReallyCallPlatformAPI && bill.OrderVendorID != bill.WaybillVendorID && bill.Status != model.WaybillStatusCanceled {
//if c.IsReallyCallPlatformAPI && bill.Status != model.WaybillStatusCanceled { //此行测试用
if c.IsReallyCallPlatformAPI && bill.OrderVendorID != bill.WaybillVendorID && bill.Status != model.WaybillStatusCanceled {
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(bill.WaybillVendorID); handlerInfo != nil {
if err = utils.CallFuncLogErrorWithInfo(func() error {
if err := handlerInfo.Handler.CancelWaybill(bill, cancelReasonID, cancelReason); err != nil {

View File

@@ -1099,7 +1099,6 @@ func (s *DefScheduler) loadSavedOrderFromMap(status *model.OrderStatus, isForceL
var realSavedInfo *WatchOrderInfo
if savedInfo, ok := s.orderMap.Load(universalOrderID); ok {
realSavedInfo = savedInfo.(*WatchOrderInfo)
globals.SugarLogger.Debugf("loadSavedOrderFromMap savedInfo=%s", utils.Format4Output(savedInfo, false))
} else {
realSavedInfo = NewWatchOrderInfo(nil)
s.orderMap.StoreWithTimeout(universalOrderID, realSavedInfo, orderMapStoreMaxTime)

View File

@@ -45,7 +45,7 @@ func (s *DefScheduler) SelfDeliveringAndUpdateStatus(ctx *jxcontext.Context, ven
err = s.SelfDeliverDelivering(order, phone)
}
} else {
if (order.Status < model.OrderStatusDelivering) || (order.VendorID == model.VendorIDDD && order.Status <= model.OrderStatusDelivering) {
if order.Status < model.OrderStatusDelivering || (order.VendorID == model.VendorIDDD && order.Status <= model.OrderStatusDelivering) {
err = s.Swtich2SelfDeliver(order, userName)
} else if order.VendorID == order.WaybillVendorID { // 状态为配送中,且是购物平台运单,不能转自送了
err = scheduler.ErrOrderStatusIsNotSuitable4CurOperation