- 调整京东售后单处理流程

This commit is contained in:
gazebo
2019-05-10 14:24:15 +08:00
parent 5af086fe25
commit fbea78dc53
3 changed files with 22 additions and 34 deletions

View File

@@ -9,16 +9,10 @@ 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 {
utils.CallFuncAsync(func() {
retVal = OnAfsOrderMsg(msg)
})
} else {
if retVal = curPurchaseHandler.OnOrderMsg(msg); retVal == nil { if retVal = curPurchaseHandler.OnOrderMsg(msg); retVal == nil {
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "") 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)

View File

@@ -42,6 +42,9 @@ 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 msg.MsgURL == jdapi.CallbackMsgAfterSaleBillStatus {
retVal = c.OnAfsOrderMsg(msg)
} else {
if jdapi.OrderStatusNew == msg.StatusID { if jdapi.OrderStatusNew == msg.StatusID {
retVal = c.onOrderNew(msg) retVal = c.onOrderNew(msg)
} else if jdapi.OrderStatusAdjust == msg.StatusID { } else if jdapi.OrderStatusAdjust == msg.StatusID {
@@ -59,6 +62,7 @@ func (c *PurchaseHandler) onOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi
// } // }
retVal = jdapi.Err2CallbackResponse(err, status.VendorStatus) retVal = jdapi.Err2CallbackResponse(err, status.VendorStatus)
} }
}
return retVal return retVal
} }

View File

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