- fix state machine bug.
This commit is contained in:
@@ -159,7 +159,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
|
||||
if order.WaybillVendorID == model.VendorIDUnknown {
|
||||
s.cancelOtherWaybills(savedOrderInfo, bill)
|
||||
s.updateOrderByBill(order, bill, false)
|
||||
} else {
|
||||
} else if !(order.WaybillVendorID == bill.WaybillVendorID && order.VendorWaybillID == bill.VendorWaybillID) && bill.WaybillVendorID != order.VendorID {
|
||||
// todo 当前逻辑,加载PENDING的ORDER时,正常状态也可能进这里
|
||||
s.CancelWaybill(bill)
|
||||
globals.SugarLogger.Warnf("OnWaybillStatusChanged Accepted orderID:%s got multiple bill:%v, order details:%v", order.VendorOrderID, bill, order)
|
||||
|
||||
@@ -189,7 +189,8 @@ func (c *BaseScheduler) SelfDeliverDelievering(order *model.GoodsOrder) (err err
|
||||
|
||||
func (c *BaseScheduler) SelfDeliverDelievered(order *model.GoodsOrder) (err error) {
|
||||
globals.SugarLogger.Infof("SelfDeliverDelievered orderID:%s", order.VendorOrderID)
|
||||
if order.Status == model.OrderStatusDelivering {
|
||||
// todo
|
||||
if true { //order.Status == model.OrderStatusDelivering {
|
||||
if c.IsReallyCallPlatformAPI {
|
||||
err = utils.CallFuncLogError(func() error {
|
||||
return c.GetPurchasePlatformFromVendorID(order.VendorID).SelfDeliverDelievered(order)
|
||||
@@ -225,6 +226,7 @@ func (c *BaseScheduler) CancelWaybill(bill *model.Waybill) (err error) {
|
||||
err = utils.CallFuncLogError(func() error {
|
||||
return handlerInfo.Handler.CancelWaybill(bill)
|
||||
}, "CancelWaybill bill:%v", bill)
|
||||
globals.SugarLogger.Debugf("CancelWaybill bill:%v canceled by myself")
|
||||
}
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user