mtps回调优化
This commit is contained in:
@@ -12,6 +12,10 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
const (
|
||||
fakeContactEmail = "fakeemail@163.com"
|
||||
)
|
||||
|
||||
var (
|
||||
auditStatusMap = map[int]int{
|
||||
mtpsapi.ShopStatusAuditCreated: model.StoreAuditStatusCreated,
|
||||
@@ -53,6 +57,7 @@ func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.S
|
||||
SecondCategory: mtpsapi.ShopCategoryFruitFruit,
|
||||
ContactName: storeDetail.PayeeName,
|
||||
ContactPhone: storeDetail.Tel1,
|
||||
ContactEmail: fakeContactEmail,
|
||||
ShopAddress: storeDetail.Address,
|
||||
ShopLng: storeDetail.Lng,
|
||||
ShopLat: storeDetail.Lat,
|
||||
@@ -105,7 +110,7 @@ func (c *DeliveryHandler) IsErrStoreExist(err error) bool {
|
||||
|
||||
func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (err error) {
|
||||
if globals.EnableStoreWrite {
|
||||
err = api.MtpsAPI.PagePoiUpdate(storeDetail.VendorStoreID, storeDetail.PayeeName, storeDetail.Tel1, "fakeemail@163.com")
|
||||
err = api.MtpsAPI.PagePoiUpdate(storeDetail.VendorStoreID, storeDetail.PayeeName, storeDetail.Tel1, fakeContactEmail)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/delivery/mtps"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego"
|
||||
@@ -16,19 +15,14 @@ type MtpsController struct {
|
||||
|
||||
func (c *MtpsController) Status() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
var callbackResponse *mtpsapi.CallbackResponse
|
||||
if c.GetString("exception_id") != "" { // 美团配送的回调设置好象有问题,配送异常也会发到这里来,作一下兼容处理
|
||||
var obj *mtpsapi.CallbackOrderExceptionMsg
|
||||
obj, callbackResponse = api.MtpsAPI.GetOrderExceptionCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
callbackResponse = mtps.OnWaybillExcept(obj)
|
||||
}
|
||||
} else {
|
||||
var obj *mtpsapi.CallbackOrderMsg
|
||||
obj, callbackResponse = api.MtpsAPI.GetOrderCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
callbackResponse = mtps.OnWaybillMsg(obj)
|
||||
}
|
||||
c.Except()
|
||||
return
|
||||
}
|
||||
|
||||
obj, callbackResponse := api.MtpsAPI.GetOrderCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
callbackResponse = mtps.OnWaybillMsg(obj)
|
||||
}
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
|
||||
Reference in New Issue
Block a user