This commit is contained in:
邹宗楠
2022-03-31 09:09:50 +08:00
parent 54d4ad2fb0
commit 9b0a2d08b6
3 changed files with 21 additions and 40 deletions

View File

@@ -2,8 +2,6 @@ package controllers
import (
"fmt"
"git.rosy.net.cn/baseapi/platformapi/fnpsapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/partner/delivery/fn"
"git.rosy.net.cn/jx-callback/globals/api"
"github.com/astaxie/beego/server/web"
@@ -18,7 +16,7 @@ type FnController struct {
func (c *FnController) FnOrderStatus() {
if c.Ctx.Input.Method() == http.MethodPost {
fmt.Println("开始回调订单状态==========================")
msg, callbackResponse := api.FnAPI.GetChainstoreStatusNotify(c.Ctx.Request)
msg, callbackResponse := api.FnAPI.GetChainOrderStatusNotify(c.Ctx.Request)
fmt.Println("开始回调订单状态==========================msg", msg)
fmt.Println("开始回调订单状态==========================callbackResponse", callbackResponse)
if callbackResponse.Code != 1 {
@@ -28,10 +26,7 @@ func (c *FnController) FnOrderStatus() {
}
// 订单回调
if msg["callback_business_type"] != nil {
callbackResponse = fn.OnWaybillMsg(msg)
}
callbackResponse = fn.OnWaybillMsg(msg)
c.Data["json"] = callbackResponse
c.ServeJSON()
} else {
@@ -43,7 +38,7 @@ func (c *FnController) FnOrderStatus() {
func (c *FnController) FnAbnormal() {
if c.Ctx.Input.Method() == http.MethodPost {
fmt.Println("开始回调异常回调==========================")
msg, callbackResponse := api.FnAPI.GetChainstoreStatusNotify(c.Ctx.Request)
msg, callbackResponse := api.FnAPI.GetChainAbnormaltatusNotify(c.Ctx.Request)
fmt.Println("开始回调异常回调==========================msg", msg)
fmt.Println("开始回调异常回调==========================callbackResponse", callbackResponse)
if callbackResponse.Code != 1 {
@@ -52,18 +47,7 @@ func (c *FnController) FnAbnormal() {
return
}
// 订单回调
if msg["callback_business_type"] != nil {
data := &fnpsapi.AbnormalReportNotify{}
if err := utils.Map2StructByJson(msg, data, true); err != nil {
callbackResponse = &fnpsapi.CallbackResponse{Code: -1}
c.Data["json"] = callbackResponse
c.ServeJSON()
return
}
callbackResponse = fn.OnWaybillExceptFn(data)
}
callbackResponse = fn.OnWaybillExceptFn(msg.Param)
c.Data["json"] = callbackResponse
c.ServeJSON()
} else {
@@ -84,10 +68,7 @@ func (c *FnController) FnStoreStatus() {
return
}
if msg["callback_business_type"] != nil {
callbackResponse = fn.OnStoreStatus(msg)
}
callbackResponse = fn.OnStoreStatus(msg)
c.Data["json"] = callbackResponse
c.ServeJSON()
} else {