- add warning order:%v get after some other message:%d.

This commit is contained in:
gazebo
2018-06-18 16:13:50 +08:00
parent 15582a4283
commit 8850307f7f

View File

@@ -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 {