- disable cancelwaybill

- autopickup use jxstorefeature.
This commit is contained in:
gazebo
2018-07-26 17:39:03 +08:00
parent 1b9e1a50d6
commit 81752da82d
2 changed files with 30 additions and 3 deletions

View File

@@ -82,7 +82,7 @@ func init() {
Timeout: time2AutoPickupMin,
TimeoutGap: time2AutoPickupGap,
TimeoutAction: func(order *model.GoodsOrder) (err error) {
return sch.PickedUpGoods(order)
return sch.autoPickupGood(order)
},
},
},
@@ -477,6 +477,24 @@ func (s *DefScheduler) isOrderSupport3rdDelivery(order *model.GoodsOrder) (retVa
return retVal
}
func (s *DefScheduler) isOrderSupportAutoPickup(order *model.GoodsOrder) (retVal bool) {
retVal = true
storefeature := &model.Jxstorefeature{
Id: jxutils.GetJxStoreIDFromOrder(order),
}
db := orm.NewOrm()
utils.CallFuncLogError(func() error {
err := db.Read(storefeature, "Id")
if err == nil {
if storefeature.Autopickup == 0 {
retVal = false
}
}
return err
}, "isOrderSupportAutoPickup")
return retVal
}
func (s *DefScheduler) updateOrderByBill(order *model.GoodsOrder, bill *model.Waybill, revertStatus bool) {
if bill.WaybillVendorID == model.VendorIDUnknown {
bill.VendorWaybillID = ""
@@ -488,3 +506,12 @@ func (s *DefScheduler) updateOrderByBill(order *model.GoodsOrder, bill *model.Wa
order.Status = model.OrderStatusFinishedPickup
}
}
func (s *DefScheduler) autoPickupGood(order *model.GoodsOrder) (err error) {
if s.isOrderSupportAutoPickup(order) {
err = s.PickedUpGoods(order)
} else {
globals.SugarLogger.Debugf("autoPickupGood orderID:%s doesn't support auto pickup", order.VendorOrderID)
}
return err
}

View File

@@ -224,9 +224,9 @@ func (c *BaseScheduler) CancelWaybill(bill *model.Waybill) (err error) {
if c.IsReallyCallPlatformAPI && bill.OrderVendorID != bill.WaybillVendorID {
if handlerInfo := c.GetDeliveryPlatformFromVendorID(bill.WaybillVendorID); handlerInfo != nil {
err = utils.CallFuncLogError(func() error {
return handlerInfo.Handler.CancelWaybill(bill)
return nil //handlerInfo.Handler.CancelWaybill(bill)
}, "CancelWaybill bill:%v", bill)
globals.SugarLogger.Debugf("CancelWaybill bill:%v canceled by myself")
globals.SugarLogger.Debugf("CancelWaybill bill:%v canceled by myself", bill)
}
}
return err