- 调整京东售后单处理流程
This commit is contained in:
@@ -9,14 +9,8 @@ import (
|
|||||||
|
|
||||||
func OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
func OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||||
if curPurchaseHandler != nil {
|
if curPurchaseHandler != nil {
|
||||||
if msg.MsgURL == jdapi.CallbackMsgAfterSaleBillStatus {
|
if retVal = curPurchaseHandler.OnOrderMsg(msg); retVal == nil {
|
||||||
utils.CallFuncAsync(func() {
|
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
|
||||||
retVal = OnAfsOrderMsg(msg)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
if retVal = curPurchaseHandler.OnOrderMsg(msg); retVal == nil {
|
|
||||||
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retVal
|
return retVal
|
||||||
@@ -31,15 +25,6 @@ func OnWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *jdapi.CallbackR
|
|||||||
return retVal
|
return retVal
|
||||||
}
|
}
|
||||||
|
|
||||||
func OnAfsOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
|
||||||
if curPurchaseHandler != nil {
|
|
||||||
if retVal = curPurchaseHandler.OnAfsOrderMsg(msg); retVal == nil {
|
|
||||||
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return retVal
|
|
||||||
}
|
|
||||||
|
|
||||||
func OnStoreMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
func OnStoreMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||||
if curPurchaseHandler != nil {
|
if curPurchaseHandler != nil {
|
||||||
retVal = curPurchaseHandler.onStoreMsg(msg)
|
retVal = curPurchaseHandler.onStoreMsg(msg)
|
||||||
|
|||||||
@@ -42,22 +42,26 @@ func (c *PurchaseHandler) OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) onOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
func (c *PurchaseHandler) onOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||||
if jdapi.OrderStatusNew == msg.StatusID {
|
if msg.MsgURL == jdapi.CallbackMsgAfterSaleBillStatus {
|
||||||
retVal = c.onOrderNew(msg)
|
retVal = c.OnAfsOrderMsg(msg)
|
||||||
} else if jdapi.OrderStatusAdjust == msg.StatusID {
|
|
||||||
retVal = c.onOrderAdjust(msg)
|
|
||||||
} else {
|
} else {
|
||||||
status := c.callbackMsg2Status(msg)
|
if jdapi.OrderStatusNew == msg.StatusID {
|
||||||
if msg.StatusID == jdapi.OrderStatusAddComment || msg.StatusID == jdapi.OrderStatusModifyComment {
|
retVal = c.onOrderNew(msg)
|
||||||
utils.CallFuncAsync(func() {
|
} else if jdapi.OrderStatusAdjust == msg.StatusID {
|
||||||
c.onOrderComment2(msg)
|
retVal = c.onOrderAdjust(msg)
|
||||||
})
|
} else {
|
||||||
|
status := c.callbackMsg2Status(msg)
|
||||||
|
if msg.StatusID == jdapi.OrderStatusAddComment || msg.StatusID == jdapi.OrderStatusModifyComment {
|
||||||
|
utils.CallFuncAsync(func() {
|
||||||
|
c.onOrderComment2(msg)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
err := partner.CurOrderManager.OnOrderStatusChanged(status)
|
||||||
|
// if globals.HandleLegacyJxOrder && err == nil {
|
||||||
|
// c.legacyJdOrderStatusChanged(status)
|
||||||
|
// }
|
||||||
|
retVal = jdapi.Err2CallbackResponse(err, status.VendorStatus)
|
||||||
}
|
}
|
||||||
err := partner.CurOrderManager.OnOrderStatusChanged(status)
|
|
||||||
// if globals.HandleLegacyJxOrder && err == nil {
|
|
||||||
// c.legacyJdOrderStatusChanged(status)
|
|
||||||
// }
|
|
||||||
retVal = jdapi.Err2CallbackResponse(err, status.VendorStatus)
|
|
||||||
}
|
}
|
||||||
return retVal
|
return retVal
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package jd
|
|||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner"
|
"git.rosy.net.cn/jx-callback/business/partner"
|
||||||
@@ -60,9 +59,9 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (c *PurchaseHandler) OnAfsOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
func (c *PurchaseHandler) OnAfsOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||||
jxutils.CallMsgHandler(func() {
|
utils.CallFuncAsync(func() {
|
||||||
retVal = c.onAfsOrderMsg(msg)
|
retVal = c.onAfsOrderMsg(msg)
|
||||||
}, jxutils.ComposeUniversalOrderID(msg.BillID, model.VendorIDJD))
|
})
|
||||||
return retVal
|
return retVal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user