- all call CallFuncLogError add order info

- callLegacyMsgHandler, callNewMsgHandler and generateLegacyJxOrder config
- call legacy lefted msg handler in new process(elm urge order and bad comment on jd)
This commit is contained in:
gazebo
2018-07-22 13:45:16 +08:00
parent dcdf432ac9
commit 0cb34fe089
14 changed files with 213 additions and 127 deletions

View File

@@ -27,15 +27,19 @@ func (c *MTPSOrderController) URLMapping() {
func (c *MTPSOrderController) Status() {
obj, callbackResponse := api.MtpsAPI.GetOrderCallbackMsg(c.Ctx.Request)
if callbackResponse == nil {
if globals.CallLegacy {
if globals.CallLegacyMsgHandler {
cc := &controller.OrderController{}
callbackResponse = cc.OrderStatusChanged(obj)
}
if globals.CallNew {
utils.CallFuncAsync(func() {
cc2 := &mtps.WaybillController{}
cc2.OnWaybillMsg(obj)
})
if globals.CallNewMsgHandler {
cc2 := &mtps.WaybillController{}
if globals.CallLegacyMsgHandler {
utils.CallFuncAsync(func() {
cc2.OnWaybillMsg(obj)
})
} else {
callbackResponse = cc2.OnWaybillMsg(obj)
}
}
}
c.Data["json"] = callbackResponse
@@ -50,15 +54,19 @@ func (c *MTPSOrderController) Status() {
func (c *MTPSOrderController) Except() {
obj, callbackResponse := api.MtpsAPI.GetOrderExceptionCallbackMsg(c.Ctx.Request)
if callbackResponse == nil {
if globals.CallLegacy {
if globals.CallLegacyMsgHandler {
cc := &controller.OrderController{}
callbackResponse = cc.OrderException(obj)
}
if globals.CallNew {
utils.CallFuncAsync(func() {
cc2 := &mtps.WaybillController{}
cc2.OnWaybillExcept(obj)
})
if globals.CallNewMsgHandler {
cc2 := &mtps.WaybillController{}
if globals.CallLegacyMsgHandler {
utils.CallFuncAsync(func() {
cc2.OnWaybillExcept(obj)
})
} else {
callbackResponse = cc2.OnWaybillExcept(obj)
}
}
}
c.Data["json"] = callbackResponse