- refactor basesch, move register partner to partner.
This commit is contained in:
@@ -186,7 +186,6 @@ func init() {
|
||||
basesch.FixedBaseScheduler = &sch.BaseScheduler
|
||||
FixedScheduler = sch
|
||||
sch.IsReallyCallPlatformAPI = globals.ReallyCallPlatformAPI
|
||||
sch.Init()
|
||||
scheduler.CurrentScheduler = sch
|
||||
sch.defWorkflowConfig = []map[int]*StatusActionConfig{
|
||||
map[int]*StatusActionConfig{
|
||||
@@ -199,7 +198,7 @@ func init() {
|
||||
if err = sch.AcceptOrRefuseOrder(order, isAcceptIt, ""); err != nil && err != scheduler.ErrOrderStatusAlreadySatisfyCurOperation {
|
||||
// 为了解决京东新消息与接单消息乱序的问题
|
||||
if errWithCode, ok := err.(*utils.ErrorWithCode); ok && errWithCode.Level() == 1 && errWithCode.IntCode() == -1 {
|
||||
if order2, err2 := sch.GetPurchasePlatformFromVendorID(order.VendorID).GetOrder(order.VendorOrderID); err2 == nil && order2.Status > order.Status {
|
||||
if order2, err2 := partner.GetPurchasePlatformFromVendorID(order.VendorID).GetOrder(order.VendorOrderID); err2 == nil && order2.Status > order.Status {
|
||||
sch.OnOrderStatusChanged(model.Order2Status(order2), false)
|
||||
err = nil
|
||||
} else {
|
||||
@@ -472,7 +471,7 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
|
||||
if savedOrderInfo.retryCount <= maxWaybillRetryCount {
|
||||
successCount := 0
|
||||
for _, vendorID := range savedOrderInfo.supported3rdCarriers {
|
||||
handlerInfo := s.GetDeliveryPlatformFromVendorID(vendorID)
|
||||
handlerInfo := partner.GetDeliveryPlatformFromVendorID(vendorID)
|
||||
if handlerInfo != nil && handlerInfo.Use4CreateWaybill && savedOrderInfo.waybills[vendorID] == nil && (excludeBill == nil || vendorID != excludeBill.WaybillVendorID) {
|
||||
if _, err = s.CreateWaybill(vendorID, order, func(deliveryFee, addFee int64) error {
|
||||
if addFee > maxAddFee {
|
||||
@@ -736,7 +735,7 @@ func (s *DefScheduler) handleAutoAcceptOrder(orderID string, vendorID int, userM
|
||||
}
|
||||
|
||||
func (s *DefScheduler) mergeOrderStatusConfig(statusType, status int, purchaseVendorID int) (retVal *StatusActionConfig) {
|
||||
vendorTimeout := s.GetPurchasePlatformFromVendorID(purchaseVendorID).GetStatusActionTimeout(statusType, status)
|
||||
vendorTimeout := partner.GetPurchasePlatformFromVendorID(purchaseVendorID).GetStatusActionTimeout(statusType, status)
|
||||
defConfig := s.defWorkflowConfig[statusType][status]
|
||||
if defConfig == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user