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