1
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/dadaapi"
|
"git.rosy.net.cn/baseapi/platformapi/dadaapi"
|
||||||
@@ -20,7 +19,6 @@ func (c *DadaDeliveryController) Msg() {
|
|||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
obj, callbackResponse := api.DadaAPI.GetOrderCallbackMsg(c.Ctx.Input.RequestBody)
|
obj, callbackResponse := api.DadaAPI.GetOrderCallbackMsg(c.Ctx.Input.RequestBody)
|
||||||
if callbackResponse == nil {
|
if callbackResponse == nil {
|
||||||
globals.SugarLogger.Debugf("---------err := %s", utils.Format4Output(obj, false))
|
|
||||||
callbackResponse = dada.OnWaybillMsg(obj)
|
callbackResponse = dada.OnWaybillMsg(obj)
|
||||||
}
|
}
|
||||||
if callbackResponse != nil && callbackResponse.Code != 200 {
|
if callbackResponse != nil && callbackResponse.Code != 200 {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ type MtwmController struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var MTWMVendorStoreIDMap = new(sync.Map)
|
var MTWMVendorStoreIDMap = new(sync.Map)
|
||||||
var MTWMVendorStoreIDDontHaveMap = new(sync.Map)
|
var MTWMVendorStoreIDDontHaveMap = make(map[string]string, 1000)
|
||||||
|
|
||||||
func (c *MtwmController) onCallbackMsg(msgType string) {
|
func (c *MtwmController) onCallbackMsg(msgType string) {
|
||||||
msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request)
|
msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request)
|
||||||
@@ -43,7 +43,7 @@ func (c *MtwmController) onCallbackMsg(msgType string) {
|
|||||||
if _, have := MTWMVendorStoreIDMap.Load(vendorStoreId); vendorStoreId != "" && !have {
|
if _, have := MTWMVendorStoreIDMap.Load(vendorStoreId); vendorStoreId != "" && !have {
|
||||||
storeDetail, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreId, model.VendorIDMTWM, "")
|
storeDetail, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreId, model.VendorIDMTWM, "")
|
||||||
if storeDetail == nil {
|
if storeDetail == nil {
|
||||||
MTWMVendorStoreIDDontHaveMap.Store(vendorStoreId, "2")
|
MTWMVendorStoreIDDontHaveMap[vendorStoreId] = "2"
|
||||||
switch web.BConfig.RunMode {
|
switch web.BConfig.RunMode {
|
||||||
case model.ServerTypeVegetable, "dev":
|
case model.ServerTypeVegetable, "dev":
|
||||||
callbackResponse = pushMTWMOrder2GY(msg.FormData, msgType, model.ServerTypeFruits)
|
callbackResponse = pushMTWMOrder2GY(msg.FormData, msgType, model.ServerTypeFruits)
|
||||||
@@ -52,7 +52,10 @@ func (c *MtwmController) onCallbackMsg(msgType string) {
|
|||||||
case model.ServerTypePet:
|
case model.ServerTypePet:
|
||||||
callbackResponse = mtwmapi.Err2CallbackResponse(nil, "") // mtwmapi.Err2CallbackResponse(fmt.Errorf("美团菜市推果园,果园退超市未找到门店cmd:%s,storeId:%s", msgType, vendorStoreId), "")
|
callbackResponse = mtwmapi.Err2CallbackResponse(nil, "") // mtwmapi.Err2CallbackResponse(fmt.Errorf("美团菜市推果园,果园退超市未找到门店cmd:%s,storeId:%s", msgType, vendorStoreId), "")
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("MTWMVendorStoreIDDontHaveMap := %s", utils.Format4Output(MTWMVendorStoreIDDontHaveMap, false))
|
|
||||||
|
if time.Now().Hour()%2 == 0 {
|
||||||
|
globals.SugarLogger.Debugf("MTWMVendorStoreIDDontHaveMap := %s", utils.Format4Output(MTWMVendorStoreIDDontHaveMap, false))
|
||||||
|
}
|
||||||
//c.Data["json"] = callbackResponse
|
//c.Data["json"] = callbackResponse
|
||||||
c.Data["json"] = mtwmapi.Err2CallbackResponse(nil, "")
|
c.Data["json"] = mtwmapi.Err2CallbackResponse(nil, "")
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
|
|||||||
Reference in New Issue
Block a user