diff --git a/business/jd/controller/order.go b/business/jd/controller/order.go index 8fd0572e1..87f0f79f1 100644 --- a/business/jd/controller/order.go +++ b/business/jd/controller/order.go @@ -101,7 +101,7 @@ func (c *OrderController) OrderStatus(order *jdapi.JDOrderMsg) *jdapi.JDCallback order.Id = rec.Id if created { if order.StatusId != jdapi.JdOrderStatusNew { - globals.SugarLogger.Warnf("order:%s get %s before create", order.BillId, order.StatusId) + globals.SugarLogger.Warnf("order:%v get before create", order) oldStatusId := order.StatusId order.StatusId = jdapi.JdOrderStatusNew addOrderMsg(order) @@ -110,12 +110,15 @@ func (c *OrderController) OrderStatus(order *jdapi.JDOrderMsg) *jdapi.JDCallback addOrderMsg(order) } else { if rec.OrderStatus != status { - rec.OrderStatus = status - rec.OrderStatusTime = order.Timestamp - rec.Code = MsgNotHandledCode - db.Update(rec, "OrderStatus", "OrderStatusTime", "Code") - - addOrderMsg(order) + if order.StatusId == jdapi.JdOrderStatusNew { + globals.SugarLogger.Warnf("order:%v get after some other message:%d", order, rec.OrderStatus) + } else { + rec.OrderStatus = status + rec.OrderStatusTime = order.Timestamp + rec.Code = MsgNotHandledCode + db.Update(rec, "OrderStatus", "OrderStatusTime", "Code") + addOrderMsg(order) + } } else { globals.SugarLogger.Warnf("duplicated jd order msg %v", order) } @@ -145,8 +148,6 @@ func acceptOrder(order *jdapi.JDOrderMsg) { } func newOrder(order *jdapi.JDOrderMsg) error { - globals.SugarLogger.Debug("NewOrder2") - result, err := globals.Jdapi.LegacyQuerySingleOrder(order.BillId) acceptOrder(order) if err != nil {