- 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 {
|
if order.WaybillVendorID == model.VendorIDUnknown {
|
||||||
s.cancelOtherWaybills(savedOrderInfo, bill)
|
s.cancelOtherWaybills(savedOrderInfo, bill)
|
||||||
s.updateOrderByBill(order, bill, false)
|
s.updateOrderByBill(order, bill, false)
|
||||||
} else {
|
} else if !(order.WaybillVendorID == bill.WaybillVendorID && order.VendorWaybillID == bill.VendorWaybillID) && bill.WaybillVendorID != order.VendorID {
|
||||||
// todo 当前逻辑,加载PENDING的ORDER时,正常状态也可能进这里
|
// todo 当前逻辑,加载PENDING的ORDER时,正常状态也可能进这里
|
||||||
s.CancelWaybill(bill)
|
s.CancelWaybill(bill)
|
||||||
globals.SugarLogger.Warnf("OnWaybillStatusChanged Accepted orderID:%s got multiple bill:%v, order details:%v", order.VendorOrderID, bill, order)
|
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) {
|
func (c *BaseScheduler) SelfDeliverDelievered(order *model.GoodsOrder) (err error) {
|
||||||
globals.SugarLogger.Infof("SelfDeliverDelievered orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Infof("SelfDeliverDelievered orderID:%s", order.VendorOrderID)
|
||||||
if order.Status == model.OrderStatusDelivering {
|
// todo
|
||||||
|
if true { //order.Status == model.OrderStatusDelivering {
|
||||||
if c.IsReallyCallPlatformAPI {
|
if c.IsReallyCallPlatformAPI {
|
||||||
err = utils.CallFuncLogError(func() error {
|
err = utils.CallFuncLogError(func() error {
|
||||||
return c.GetPurchasePlatformFromVendorID(order.VendorID).SelfDeliverDelievered(order)
|
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 {
|
err = utils.CallFuncLogError(func() error {
|
||||||
return handlerInfo.Handler.CancelWaybill(bill)
|
return handlerInfo.Handler.CancelWaybill(bill)
|
||||||
}, "CancelWaybill bill:%v", bill)
|
}, "CancelWaybill bill:%v", bill)
|
||||||
|
globals.SugarLogger.Debugf("CancelWaybill bill:%v canceled by myself")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user