- add warning order:%v get after some other message:%d.
This commit is contained in:
@@ -101,7 +101,7 @@ func (c *OrderController) OrderStatus(order *jdapi.JDOrderMsg) *jdapi.JDCallback
|
|||||||
order.Id = rec.Id
|
order.Id = rec.Id
|
||||||
if created {
|
if created {
|
||||||
if order.StatusId != jdapi.JdOrderStatusNew {
|
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
|
oldStatusId := order.StatusId
|
||||||
order.StatusId = jdapi.JdOrderStatusNew
|
order.StatusId = jdapi.JdOrderStatusNew
|
||||||
addOrderMsg(order)
|
addOrderMsg(order)
|
||||||
@@ -110,12 +110,15 @@ func (c *OrderController) OrderStatus(order *jdapi.JDOrderMsg) *jdapi.JDCallback
|
|||||||
addOrderMsg(order)
|
addOrderMsg(order)
|
||||||
} else {
|
} else {
|
||||||
if rec.OrderStatus != status {
|
if rec.OrderStatus != status {
|
||||||
rec.OrderStatus = status
|
if order.StatusId == jdapi.JdOrderStatusNew {
|
||||||
rec.OrderStatusTime = order.Timestamp
|
globals.SugarLogger.Warnf("order:%v get after some other message:%d", order, rec.OrderStatus)
|
||||||
rec.Code = MsgNotHandledCode
|
} else {
|
||||||
db.Update(rec, "OrderStatus", "OrderStatusTime", "Code")
|
rec.OrderStatus = status
|
||||||
|
rec.OrderStatusTime = order.Timestamp
|
||||||
addOrderMsg(order)
|
rec.Code = MsgNotHandledCode
|
||||||
|
db.Update(rec, "OrderStatus", "OrderStatusTime", "Code")
|
||||||
|
addOrderMsg(order)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
globals.SugarLogger.Warnf("duplicated jd order msg %v", order)
|
globals.SugarLogger.Warnf("duplicated jd order msg %v", order)
|
||||||
}
|
}
|
||||||
@@ -145,8 +148,6 @@ func acceptOrder(order *jdapi.JDOrderMsg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newOrder(order *jdapi.JDOrderMsg) error {
|
func newOrder(order *jdapi.JDOrderMsg) error {
|
||||||
globals.SugarLogger.Debug("NewOrder2")
|
|
||||||
|
|
||||||
result, err := globals.Jdapi.LegacyQuerySingleOrder(order.BillId)
|
result, err := globals.Jdapi.LegacyQuerySingleOrder(order.BillId)
|
||||||
acceptOrder(order)
|
acceptOrder(order)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user