- 饿百售后单
- 售后单重构一下下
This commit is contained in:
@@ -1,42 +1,26 @@
|
||||
package jd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
func OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
if curPurchaseHandler != nil {
|
||||
if retVal = curPurchaseHandler.OnOrderMsg(msg); retVal == nil {
|
||||
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
|
||||
}
|
||||
retVal = curPurchaseHandler.OnOrderMsg(msg)
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
func OnWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *jdapi.CallbackResponse) {
|
||||
if curPurchaseHandler != nil {
|
||||
if retVal = curPurchaseHandler.OnWaybillMsg(msg); retVal == nil {
|
||||
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
|
||||
}
|
||||
retVal = curPurchaseHandler.OnWaybillMsg(msg)
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
func OnStoreMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
if curPurchaseHandler != nil {
|
||||
retVal = curPurchaseHandler.onStoreMsg(msg)
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
func OnFinancialMsg2(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
if curPurchaseHandler != nil {
|
||||
utils.CallFuncAsync(func() {
|
||||
OnFinancialMsg(msg)
|
||||
})
|
||||
retVal = curPurchaseHandler.OnStoreMsg(msg)
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
@@ -9,8 +9,15 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
func (p *PurchaseHandler) OnFinancialMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
utils.CallFuncAsync(func() {
|
||||
retVal = p.onFinancialMsg(msg)
|
||||
})
|
||||
return retVal
|
||||
}
|
||||
|
||||
// 京东正向/退款订单类型处理--存储
|
||||
func OnFinancialMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
func (p *PurchaseHandler) onFinancialMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
var err error
|
||||
// if msg.StatusID == jdapi.OrderStatusPayFinishedSettle || msg.StatusID == jdapi.OrderStatusTipChanged || msg.StatusID == jdapi.OrderStatusSwitch2SelfSettle { // 如果是正向单
|
||||
if msg.StatusID == jdapi.OrderStatusPayFinishedSettle || msg.StatusID == jdapi.OrderStatusTipChanged || msg.StatusID == jdapi.OrderStatusAdjustSettle || msg.StatusID == jdapi.OrderStatusSwitch2SelfSettle { // 如果是正向单
|
||||
|
||||
@@ -42,7 +42,9 @@ func (c *PurchaseHandler) OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) onOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
if msg.MsgURL == jdapi.CallbackMsgAfterSaleBillStatus {
|
||||
if msg.MsgURL == jdapi.CallbackMsgOrderAccounting {
|
||||
retVal = c.OnFinancialMsg(msg)
|
||||
} else if msg.MsgURL == jdapi.CallbackMsgAfterSaleBillStatus {
|
||||
retVal = c.OnAfsOrderMsg(msg)
|
||||
} else {
|
||||
if jdapi.OrderStatusNew == msg.StatusID {
|
||||
|
||||
@@ -302,7 +302,7 @@ func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, vendorStoreID s
|
||||
}
|
||||
|
||||
// 当前京东的storeCrud消息不会在门店状态改变时发送,所以意义不大,先放在这里
|
||||
func (c *PurchaseHandler) onStoreMsg(msg *jdapi.CallbackOrderMsg) (response *jdapi.CallbackResponse) {
|
||||
func (c *PurchaseHandler) OnStoreMsg(msg *jdapi.CallbackOrderMsg) (response *jdapi.CallbackResponse) {
|
||||
var err error
|
||||
if msg.StatusID == jdapi.StatusIDUpdateStore {
|
||||
var storeStatus int
|
||||
|
||||
Reference in New Issue
Block a user