- save real order status when new order msg came.

This commit is contained in:
gazebo
2018-07-22 21:57:56 +08:00
parent 7ae0944fc9
commit 52ac5ca64a
5 changed files with 70 additions and 30 deletions

View File

@@ -19,6 +19,7 @@ var (
ErrCanNotCreateAtLeastOneWaybill = errors.New("一个运单都不能创建")
ErrCanNotFindOrder = errors.New("不能找到订单(一般是由于事件错序)")
ErrCanNotFindWaybill = errors.New("不能找到运单(一般是由于事件错序)")
ErrOrderIsNotSolid = errors.New("订单是临时订单,不完整,不能用于创建运单")
)
type StatusActionConfig struct {
@@ -27,6 +28,7 @@ type StatusActionConfig struct {
}
type PurchasePlatformHandler interface {
GetStatusFromVendorStatus(vendorStatus string) int
GetOrder(vendorOrderID string) (order *model.GoodsOrder, err error)
GetStatusActionConfig(status int) *StatusActionConfig
@@ -157,6 +159,10 @@ func (c *BaseScheduler) SelfDeliverDelievered(order *model.GoodsOrder) (err erro
func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOrder) (err error) {
globals.SugarLogger.Infof("CreateWaybill orderID:%s, vendorID:%d", order.VendorOrderID, platformVendorID)
if !model.IsOrderSolid(order) { // 如果订单是不完整的
globals.SugarLogger.Warnf("CreateWaybill orderID:%s, vendorID:%d is not solid!!!", order.VendorOrderID, platformVendorID)
return ErrOrderIsNotSolid
}
if c.IsReallyCallPlatformAPI {
err = utils.CallFuncLogError(func() error {
return c.GetDeliveryPlatformFromVendorID(platformVendorID).CreateWaybill(order)