1
This commit is contained in:
@@ -385,9 +385,9 @@ func Init() {
|
||||
func (s *DefScheduler) OnOrderNew(order *model.GoodsOrder, isPending bool, isAuto bool) (err error) {
|
||||
savedOrderInfo := s.loadSavedOrderFromMap(model.Order2Status(order), false)
|
||||
savedOrderInfo.SetOrder(order)
|
||||
s.resetTimer(savedOrderInfo, nil, isPending)
|
||||
if order.VendorID == model.VendorIDEBAI { //饿百订单待接单的时候就推所有东西
|
||||
if order.Status == model.OrderStatusWaitAccepted || order.Status == model.OrderStatusNew || order.Status >= model.OrderStatusFinishedPickup { //错序
|
||||
s.resetTimer(savedOrderInfo, nil, isPending)
|
||||
if order.Flag&model.OrderFlagMaskFake == 0 {
|
||||
utils.CallFuncAsync(func() {
|
||||
// order = setFakeActualPayPrice(order)
|
||||
@@ -410,7 +410,6 @@ func (s *DefScheduler) OnOrderNew(order *model.GoodsOrder, isPending bool, isAut
|
||||
}
|
||||
}
|
||||
if order.Status >= model.OrderStatusNew {
|
||||
s.resetTimer(savedOrderInfo, nil, isPending)
|
||||
if !isPending && order.Status >= model.OrderStatusAccepted { // 有订单消息错序,先收到接单消息,再收到新订单消息,导致接单TIMER不动作,这里补一下
|
||||
s.notifyNewOrder(order, isAuto)
|
||||
msghub.OnNewOrder(order)
|
||||
@@ -1723,15 +1722,7 @@ func (s *DefScheduler) notifyNewOrder(order *model.GoodsOrder, isAuto bool) {
|
||||
if order.Flag&model.OrderFlagMaskFake == 0 && order.VendorID != model.VendorIDEBAI {
|
||||
utils.CallFuncAsync(func() {
|
||||
// order = setFakeActualPayPrice(order)
|
||||
if order.VendorID == 0 {
|
||||
globals.SugarLogger.Debugf("==order2 := %s", utils.Format4Output(order, false))
|
||||
}
|
||||
result, err := netprinter.PrintOrderByOrder(jxcontext.AdminCtx, order, model.PrintTypeOrder, nil)
|
||||
if order.VendorID == 0 {
|
||||
globals.SugarLogger.Debugf("==result := %s", utils.Format4Output(result, false))
|
||||
globals.SugarLogger.Debugf("==err := %v", err)
|
||||
|
||||
}
|
||||
netprinter.PrintOrderByOrder(jxcontext.AdminCtx, order, model.PrintTypeOrder, nil)
|
||||
//目前暂且认为AdjustCount > 0 就是调整单
|
||||
if order.AdjustCount > 0 {
|
||||
weixinmsg.NotifyAdjustOrder(order)
|
||||
|
||||
@@ -281,8 +281,8 @@ func CopyMtToMT(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, isA
|
||||
}
|
||||
|
||||
// BatchInitSkuMT2MT 批量创建商品
|
||||
func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, offset int) (errList []*mtwmapi.AppFoodResult, err error) {
|
||||
errList = make([]*mtwmapi.AppFoodResult, 0, 0)
|
||||
func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string, offset int) ([]*mtwmapi.AppFoodResult, error) {
|
||||
errList := make([]*mtwmapi.AppFoodResult, 0, 0)
|
||||
foodDataList := make([]map[string]interface{}, len(fromSku))
|
||||
for k, storeSku := range fromSku {
|
||||
foodData := make(map[string]interface{})
|
||||
@@ -363,11 +363,13 @@ func BatchInitSkuMT2MT(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi
|
||||
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:])
|
||||
if len(failedFoodList) != 0 {
|
||||
errList = append(errList, failedFoodList...)
|
||||
globals.SugarLogger.Debugf("failedFoodList := %s", utils.Format4Output(failedFoodList, false))
|
||||
}
|
||||
} else {
|
||||
failedFoodList, _ := toApi.RetailBatchInitData(ctx.GetTrackInfo(), vendorStoreID, foodDataList[i*10:(i+1)*10])
|
||||
if len(failedFoodList) != 0 {
|
||||
errList = append(errList, failedFoodList...)
|
||||
globals.SugarLogger.Debugf("failedFoodList := %s", utils.Format4Output(failedFoodList, false))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -491,10 +491,15 @@ func UpdateFakeWayBillToTiktok() {
|
||||
} else {
|
||||
partner.CurOrderManager.OnOrderMsg(order, tao_vegetable.OrderStatusDelivery, "订单配送中")
|
||||
}
|
||||
|
||||
// 还没到下一状态时间
|
||||
if fakeWayBill[i].StatusTime.After(time.Now()) {
|
||||
continue
|
||||
}
|
||||
|
||||
}
|
||||
if order.VendorID == model.VendorIDEBAI {
|
||||
ebai.OrderStatussync(utils.Struct2Map(riderInfo, "", true))
|
||||
}
|
||||
//
|
||||
//allTime := order.ExpectedDeliveredTime.Unix() - order.OrderCreatedAt.Unix()
|
||||
|
||||
@@ -194,11 +194,12 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *ebaiapi.CallbackMsg) (retVal *ebaia
|
||||
}
|
||||
if utils.Str2Int(orderStatus.VendorStatus) == ebaiapi.OrderUserCancelMerchantAgreed {
|
||||
afs, _ := partner.CurOrderManager.LoadAfsOrder(orderStatus.RefVendorOrderID, model.VendorIDEBAI)
|
||||
afs.Status = orderStatus.Status
|
||||
afs.VendorStatus = orderStatus.VendorStatus
|
||||
afs.Flag = model.YES
|
||||
dao.UpdateEntity(dao.GetDB(), afs, "Status", "VendorStatus", "Flag")
|
||||
|
||||
if afs != nil {
|
||||
afs.Status = orderStatus.Status
|
||||
afs.VendorStatus = orderStatus.VendorStatus
|
||||
afs.Flag = model.YES
|
||||
dao.UpdateEntity(dao.GetDB(), afs, "Status", "VendorStatus", "Flag")
|
||||
}
|
||||
}
|
||||
|
||||
retVal = api.EbaiAPI.Err2CallbackResponse(msg.Cmd, err, nil)
|
||||
|
||||
Reference in New Issue
Block a user