1
This commit is contained in:
@@ -84,15 +84,10 @@ func (c *OrderManager) OnOrderNew(order *model.GoodsOrder, orderStatus *model.Or
|
||||
isDuplicated, err = c.SaveOrder(order, false, db)
|
||||
}
|
||||
}
|
||||
if order.VendorID == 0 {
|
||||
globals.SugarLogger.Debugf("=========isDuplicated :=%v", isDuplicated)
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
dao.Commit(db, txDB)
|
||||
if !isDuplicated {
|
||||
if order.VendorID == 0 {
|
||||
globals.SugarLogger.Debugf("=========order94 :=%s", utils.Format4Output(order, false))
|
||||
}
|
||||
err = scheduler.CurrentScheduler.OnOrderNew(order, false, false)
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -383,9 +383,6 @@ func Init() {
|
||||
|
||||
// 以下是订单
|
||||
func (s *DefScheduler) OnOrderNew(order *model.GoodsOrder, isPending bool, isAuto bool) (err error) {
|
||||
if order.VendorID == 0 {
|
||||
globals.SugarLogger.Debugf("=====print := %s", utils.Format4Output(order, false))
|
||||
}
|
||||
savedOrderInfo := s.loadSavedOrderFromMap(model.Order2Status(order), false)
|
||||
savedOrderInfo.SetOrder(order)
|
||||
if order.VendorID == model.VendorIDEBAI { //饿百订单待接单的时候就推所有东西
|
||||
@@ -413,14 +410,7 @@ func (s *DefScheduler) OnOrderNew(order *model.GoodsOrder, isPending bool, isAut
|
||||
}
|
||||
}
|
||||
if order.Status >= model.OrderStatusNew {
|
||||
if order.VendorID == 0 {
|
||||
globals.SugarLogger.Debugf("=====print := %s", utils.Format4Output(order, false))
|
||||
}
|
||||
s.resetTimer(savedOrderInfo, nil, isPending)
|
||||
if order.VendorID == 0 {
|
||||
globals.SugarLogger.Debugf("=====print := %s", utils.Format4Output(order, false))
|
||||
globals.SugarLogger.Debugf("=====isPending := %s", utils.Format4Output(isPending, false))
|
||||
}
|
||||
if !isPending && order.Status >= model.OrderStatusAccepted { // 有订单消息错序,先收到接单消息,再收到新订单消息,导致接单TIMER不动作,这里补一下
|
||||
s.notifyNewOrder(order, isAuto)
|
||||
msghub.OnNewOrder(order)
|
||||
|
||||
@@ -1138,7 +1138,6 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
|
||||
) a WHERE 1 = 1`
|
||||
|
||||
if params["jxIncomeBegin"] != nil {
|
||||
//globals.SugarLogger.Debugf("test begin====%d", utils.MustInterface2Int64(params["jxIncomeBegin"]))
|
||||
//if utils.MustInterface2Int64(params["jxIncomeBegin"]) != 0 {
|
||||
sql += " AND a.jx_income >= ?"
|
||||
sqlParams = append(sqlParams, utils.MustInterface2Int64(params["jxIncomeBegin"]))
|
||||
|
||||
@@ -84,8 +84,6 @@ func (c *PurchaseHandler) updateOrderFinancialInfo(a *jdapi.API, orderID string)
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) onOrderMsg(a *jdapi.API, msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
globals.SugarLogger.Debugf("==========onOrderMsg := %s", utils.Format4Output(msg, false))
|
||||
// a := getAPI(vendorOrgCode)
|
||||
if afsMsgMap[msg.MsgURL] {
|
||||
retVal = c.OnAfsOrderMsg(a, msg)
|
||||
} else {
|
||||
@@ -103,8 +101,6 @@ func (c *PurchaseHandler) onOrderMsg(a *jdapi.API, msg *jdapi.CallbackOrderMsg)
|
||||
} else {
|
||||
// 新订单事件,与订单状态有点冲突
|
||||
if jdapi.StatusIDNewOrder == msg.StatusID {
|
||||
globals.SugarLogger.Debugf("==========onOrderMsg := %s", utils.Format4Output(msg, false))
|
||||
globals.SugarLogger.Debugf("==========status := %s", utils.Format4Output(status, false))
|
||||
retVal = c.onOrderNew(a, msg, status)
|
||||
} else if jdapi.OrderStatusAdjust == msg.StatusID {
|
||||
retVal = c.onOrderAdjust(a, msg, status)
|
||||
|
||||
@@ -86,7 +86,6 @@ func (p *PurchaseHandler) getStatusFromVendorStatus(vendorStatus string) int {
|
||||
|
||||
func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID string) (order *model.GoodsOrder, orderMap map[string]interface{}, err error) {
|
||||
result, err := getAPI(vendorOrgCode, 0, vendorStoreID).OrderGetOrderDetail(utils.Str2Int64(vendorOrderID), true)
|
||||
globals.SugarLogger.Debugf("=====result2 := %s", utils.Format4Output(result, false))
|
||||
if err == nil {
|
||||
result[keyVendorOrgCode] = vendorOrgCode
|
||||
order = p.Map2Order(result)
|
||||
@@ -365,7 +364,7 @@ func (c *PurchaseHandler) onOrderMsg(msg *mtwmapi.CallbackMsg) (response *mtwmap
|
||||
}
|
||||
} else if msg.Cmd == mtwmapi.MsgTypeOrderModified {
|
||||
order, result, err2 := c.getOrder(msg.AppID, GetOrderIDFromMsg(msg), GetVendorStoreIDFromMsg(msg))
|
||||
globals.SugarLogger.Debugf("=====order := %s", utils.Format4Output(order, false))
|
||||
globals.SugarLogger.Debugf("====order := %s", utils.Format4Output(order, false))
|
||||
globals.SugarLogger.Debugf("=====result := %s", utils.Format4Output(result, false))
|
||||
if err = err2; err == nil {
|
||||
localOrder, _ := partner.CurOrderManager.LoadOrder(GetOrderIDFromMsg(msg), model.VendorIDMTWM)
|
||||
|
||||
@@ -28,7 +28,6 @@ func (c *Djsw2Controller) handleMsg(handler func(*jdapi.API, interface{}) *jdapi
|
||||
func (c *Djsw2Controller) orderStatus() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
|
||||
globals.SugarLogger.Debugf("========jds2 := %s", utils.Format4Output(obj, false))
|
||||
if orderMsg, ok := obj.(*jdapi.CallbackOrderMsg); ok {
|
||||
orderman.FixedOrderManager.OnNewFakeJdOrder(orderMsg.BillID)
|
||||
}
|
||||
@@ -42,7 +41,6 @@ func (c *Djsw2Controller) orderStatus() {
|
||||
}
|
||||
|
||||
func (c *Djsw2Controller) NewOrder() {
|
||||
globals.SugarLogger.Debugf("========jds2 := %s", "NewOrder")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
@@ -51,22 +49,18 @@ func (c *Djsw2Controller) OrderAdjust() {
|
||||
}
|
||||
|
||||
func (c *Djsw2Controller) OrderWaitOutStore() {
|
||||
globals.SugarLogger.Debugf("========jds2 := %s", "OrderWaitOutStore")
|
||||
c.nullOperation()
|
||||
}
|
||||
|
||||
func (c *Djsw2Controller) PickFinishOrder() {
|
||||
globals.SugarLogger.Debugf("========jds2 := %s", "PickFinishOrder")
|
||||
c.nullOperation()
|
||||
}
|
||||
|
||||
func (c *Djsw2Controller) DeliveryOrder() {
|
||||
globals.SugarLogger.Debugf("========jds2 := %s", "DeliveryOrder")
|
||||
c.nullOperation()
|
||||
}
|
||||
|
||||
func (c *Djsw2Controller) FinishOrder() {
|
||||
globals.SugarLogger.Debugf("========jds2 := %s", "FinishOrder")
|
||||
c.nullOperation()
|
||||
}
|
||||
|
||||
@@ -79,7 +73,6 @@ func (c *Djsw2Controller) UnlockOrder() {
|
||||
}
|
||||
|
||||
func (c *Djsw2Controller) UserCancelOrder() {
|
||||
globals.SugarLogger.Debugf("========jds2 := %s", "UserCancelOrder")
|
||||
c.nullOperation()
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,8 @@ func (c *DjswController) handleMsg(handler func(*jdapi.API, interface{}) *jdapi.
|
||||
}
|
||||
|
||||
func (c *DjswController) orderStatus() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "orderStatus")
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
|
||||
globals.SugarLogger.Debugf("========obj := %s", utils.Format4Output(obj, false))
|
||||
callbackResponse = jd.OnOrderMsg(obj.(*jdapi.CallbackOrderMsg), a)
|
||||
return callbackResponse
|
||||
})
|
||||
@@ -50,37 +48,30 @@ func (c *DjswController) orderStatus() {
|
||||
}
|
||||
|
||||
func (c *DjswController) NewOrder() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "NewOrder")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
func (c *DjswController) OrderAdjust() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "OrderAdjust")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
func (c *DjswController) OrderWaitOutStore() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "OrderWaitOutStore")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
func (c *DjswController) PickFinishOrder() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "PickFinishOrder")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
func (c *DjswController) DeliveryOrder() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "DeliveryOrder")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
func (c *DjswController) FinishOrder() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "FinishOrder")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
func (c *DjswController) LockOrder() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "LockOrder")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
@@ -89,7 +80,6 @@ func (c *DjswController) UnlockOrder() {
|
||||
}
|
||||
|
||||
func (c *DjswController) UserCancelOrder() {
|
||||
globals.SugarLogger.Debugf("========jds := %s", "UserCancelOrder")
|
||||
c.orderStatus()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user