From d76fce41ade70acc1c5d110831c6282eaa760429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 14 Jul 2026 14:26:57 +0800 Subject: [PATCH] 1 --- business/jxutils/jxutils.go | 2 - business/model/dao/store_sku.go | 4 -- business/partner/purchase/mtwm/store_sku2.go | 6 +-- controllers/mtwm_callback.go | 41 ++++++++------------ 4 files changed, 17 insertions(+), 36 deletions(-) diff --git a/business/jxutils/jxutils.go b/business/jxutils/jxutils.go index 5298e7e32..9573c08da 100644 --- a/business/jxutils/jxutils.go +++ b/business/jxutils/jxutils.go @@ -360,7 +360,6 @@ func IntCoordinate2MarsStandard(gpsLng, gpsLat int, coordinateType int) (marsLng Type: coordSys, }) if err != nil { - globals.SugarLogger.Debugf("--TencentCoordinateChange err := %v", err) return marsLng, marsLat, nil } @@ -1130,7 +1129,6 @@ func MixWatermarkImg(imgWatermark, img string, exPrefixBegin, exPrefixEnd *time. } else { imgUrl = img + "?imageView2/0/q/75|watermark/1/image/" + baseURL + "/dissolve/100/gravity/Center/dx/0/dy/0" } - globals.SugarLogger.Debugf("---imgUrl := %s", imgUrl) if resBinary, _, err := DownloadFileByURL(imgUrl); err == nil { downloadURL, err := UploadExportContent(resBinary, utils.Int64ToStr(time.Now().Unix())+img[strings.LastIndex(img, "/")+1:len(img)]) if err == nil { diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index d142b9349..47a48c027 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -702,10 +702,6 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo } sql = fmt.Sprintf(sql, fmtParams...) sql += " ORDER BY t1.price" - if storeID == 669148 { - globals.SugarLogger.Debugf("----------sql := %s", sql) - globals.SugarLogger.Debugf("----------sqlParams := %s", utils.Format4Output(sqlParams, false)) - } if err = GetRows(db, &skus, sql, sqlParams...); err != nil { return nil, err } diff --git a/business/partner/purchase/mtwm/store_sku2.go b/business/partner/purchase/mtwm/store_sku2.go index ddf0fcb1f..7a2e5879c 100644 --- a/business/partner/purchase/mtwm/store_sku2.go +++ b/business/partner/purchase/mtwm/store_sku2.go @@ -400,7 +400,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI // img5 = storeSku.Img //} if storeSku.ImgMix != "" && ((storeSku.BrandID == storeSku.ExBrandID && storeSku.ExBrandID != 0) || storeSku.ExBrandID == 0) { - foodData["picture"] = strings.Join(jxutils.BatchString2Slice(storeSku.ImgMix, img2, img3, img4, img5), ",") + foodData["picture"] = strings.Join(jxutils.BatchString2Slice(storeSku.ImgMix, storeSku.Img, img2, img3, img4, img5), ",") } else { foodData["picture"] = strings.Join(jxutils.BatchString2Slice(storeSku.Img, img2, img3, img4, img5), ",") } @@ -471,10 +471,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI } - if storeID == 668530 { - globals.SugarLogger.Debugf("------storeSkuList:%s,%s", syncType, utils.Format4Output(storeSkuList, false)) - globals.SugarLogger.Debugf("------foodDataList:%s", utils.Format4Output(foodDataList, false)) - } api := getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID) if globals.EnableMtwmStoreWrite { if len(foodDataList) == 1 { diff --git a/controllers/mtwm_callback.go b/controllers/mtwm_callback.go index 4d48e38c5..5589c2703 100644 --- a/controllers/mtwm_callback.go +++ b/controllers/mtwm_callback.go @@ -223,26 +223,22 @@ func pushMTWMOrder2GY(value url.Values, msgType string, serverType string) *mtwm // ImgCheckOutCallback 针对返图订单,当实拍审核失败时,通过该消息通知三方重新修改实拍 // http://callback.jxc4.com//mtwm/imgCheckOutCallback func (c *MtwmController) ImgCheckOutCallback() { - data, err := ioutil.ReadAll(c.Ctx.Request.Body) - if err != nil { + msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request) + if callbackResponse != nil { c.Data["json"] = map[string]interface{}{"result_code": -1} c.ServeJSON() return } - ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "美团返图审核通知", fmt.Sprintf("美团返图审核:%s", string(data))) - globals.SugarLogger.Debugf("-----data := %s", string(data)) - callback := &CheckBackParam{} - if err = json.Unmarshal(data, callback); err != nil { - globals.SugarLogger.Debugf("-----data := %s", string(data)) - c.Data["json"] = map[string]interface{}{"result_code": -1} - c.ServeJSON() - return - } - globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(callback, false)) + data := &CheckBackParam{} + utils.Map2StructByJson(utils.URLValues2Map(msg.FormData), data, false) + + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "ImgCheckOutCallback", fmt.Sprintf("美团返图审核:%s", utils.Format4Output(data, false))) + globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(data, false)) c.Data["json"] = map[string]interface{}{"result_code": 1} c.ServeJSON() + } type CheckBackParam struct { @@ -258,27 +254,22 @@ type CheckBackParam struct { // OrderImgStatusCallback 针对强制返图订单,当订单返图就绪满足发配条件时,通过该消息通知三方是否可发配 // http://callback.jxc4.com//mtwm/orderImgStatusCallback func (c *MtwmController) OrderImgStatusCallback() { - data, err := ioutil.ReadAll(c.Ctx.Request.Body) - if err != nil { - c.Data["json"] = map[string]interface{}{"result_code": -1} - c.ServeJSON() - return - } - ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "美团返图发货通知", fmt.Sprintf("美团发货审核:%s", string(data))) - globals.SugarLogger.Debugf("-----data := %s", string(data)) - callback := &CanSendDelivery{} - if err = json.Unmarshal(data, callback); err != nil { - globals.SugarLogger.Debugf("-----data := %s", string(data)) + msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request) + if callbackResponse != nil { c.Data["json"] = map[string]interface{}{"result_code": -1} c.ServeJSON() return } - globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(callback, false)) + + data := &CanSendDelivery{} + utils.Map2StructByJson(utils.URLValues2Map(msg.FormData), data, false) + + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "OrderImgStatusCallback", fmt.Sprintf("美团返图审核可发配:%s", utils.Format4Output(data, false))) + globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(data, false)) c.Data["json"] = map[string]interface{}{"result_code": 1} c.ServeJSON() - } type CanSendDelivery struct {