This commit is contained in:
邹宗楠
2025-08-21 18:28:03 +08:00
parent 65b5013baf
commit 5e12103f24
2 changed files with 7 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ const (
minute2Schedule3rdCarrier4Ebai = 30 // 饿百的最少转自配送需要的时间(分钟) minute2Schedule3rdCarrier4Ebai = 30 // 饿百的最少转自配送需要的时间(分钟)
minMinute2Schedule3rdCarrier = 5 // 转三方配送最少等待时间(分钟) minMinute2Schedule3rdCarrier = 5 // 转三方配送最少等待时间(分钟)
time2AutoPickupMin = 6 * time.Minute // 自动拣货等待时间这个只有在没有PickDeadline信息才有用否则会根据PickDeadline设置 time2AutoPickupMin = 9 * time.Minute // 自动拣货等待时间这个只有在没有PickDeadline信息才有用否则会根据PickDeadline设置
second2AutoPickupGap = 60 //随机60秒 second2AutoPickupGap = 60 //随机60秒
time2AutoPickupAhead = 120 * time.Second // 有最后拣货时间的提前值 time2AutoPickupAhead = 120 * time.Second // 有最后拣货时间的提前值

View File

@@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/baseapi/platformapi/dingdingapi"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi" "git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg" "git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
@@ -24,6 +25,7 @@ type MtwmController struct {
} }
var MTWMVendorStoreIDMap = new(sync.Map) var MTWMVendorStoreIDMap = new(sync.Map)
var MTWMVendorStoreIDDontHaveMap = new(sync.Map)
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)
@@ -41,6 +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")
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)
@@ -48,7 +51,9 @@ func (c *MtwmController) onCallbackMsg(msgType string) {
callbackResponse = pushMTWMOrder2GY(msg.FormData, msgType, model.ServerTypePet) callbackResponse = pushMTWMOrder2GY(msg.FormData, msgType, model.ServerTypePet)
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), "")
return }
if time.Now().Hour() > 9 && time.Now().Hour() < 10 {
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "淘鲜达token过期", utils.Format4Output(MTWMVendorStoreIDDontHaveMap, false))
} }
//c.Data["json"] = callbackResponse //c.Data["json"] = callbackResponse
c.Data["json"] = mtwmapi.Err2CallbackResponse(nil, "") c.Data["json"] = mtwmapi.Err2CallbackResponse(nil, "")