This commit is contained in:
邹宗楠
2025-07-14 09:37:45 +08:00
parent f86aff2614
commit 1523099d3a

View File

@@ -3,9 +3,11 @@ package controllers
import (
"encoding/json"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api"
"github.com/astaxie/beego/server/web"
"io/ioutil"
@@ -21,6 +23,7 @@ type MtwmController struct {
}
var MTWMVendorStoreIDMap = new(sync.Map)
var StoreMap2Gy = make(map[string]string, 0)
func (c *MtwmController) onCallbackMsg(msgType string) {
msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request)
@@ -40,6 +43,7 @@ func (c *MtwmController) onCallbackMsg(msgType string) {
if storeDetail == nil {
switch web.BConfig.RunMode {
case model.ServerTypeVegetable, "dev":
StoreMap2Gy[vendorStoreId] = "1"
callbackResponse = pushMTWMOrder2GY(msg.FormData, msgType, model.ServerTypeFruits)
case model.ServerTypeFruits:
callbackResponse = pushMTWMOrder2GY(msg.FormData, msgType, model.ServerTypePet)
@@ -47,7 +51,8 @@ func (c *MtwmController) onCallbackMsg(msgType string) {
callbackResponse = mtwmapi.Err2CallbackResponse(nil, "") // mtwmapi.Err2CallbackResponse(fmt.Errorf("美团菜市推果园,果园退超市未找到门店cmd:%s,storeId:%s", msgType, vendorStoreId), "")
return
}
c.Data["json"] = callbackResponse
//c.Data["json"] = callbackResponse
c.Data["json"] = mtwmapi.Err2CallbackResponse(nil, "")
c.ServeJSON()
return
} else {
@@ -61,6 +66,9 @@ func (c *MtwmController) onCallbackMsg(msgType string) {
}
}
if time.Now().After(utils.Str2Time("2025-07-14 12:40:00")) {
globals.SugarLogger.Debugf("StoreMap2Gy-----%s", utils.Format4Output(StoreMap2Gy, false))
}
c.Data["json"] = callbackResponse
c.ServeJSON()
}