From a2c0692d64828d4ccdeac6fc4276db619decca7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 28 Apr 2025 18:20:26 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/store_sku.go | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 8553d336a..fc59d5d6b 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -6615,7 +6615,7 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo task2 := tasksch.NewParallelTask("美团到京东, 建商品", tasksch.NewParallelConfig().SetIsContinueWhenError(true).SetParallelCount(1), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { mtSku := batchItemList[0].(*mtwmapi.AppFood) - catMaps, _ := dao.GetMtJdCategoryMap(db, utils.Int2Str(mtSku.TagID), "") + //catMaps, _ := dao.GetMtJdCategoryMap(db, utils.Int2Str(mtSku.TagID), "") //if len(catMaps) == 0 { // results, _ := dao.GetVendorCategoriesWithMap(db, model.VendorIDMTWM, mtSku.TagID) // results2, _ := dao.GetVendorCategoriesWithMap(db, model.VendorIDMTWM, utils.Str2Int(results[0].ParentID)) @@ -6625,18 +6625,25 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo param := &jdapi.OpSkuParam{ TraceID: ctx.GetTrackInfo(), OutSkuID: mtSku.AppFoodCode, - ShopCategories: []int64{}, // 商家分类 - CategoryID: utils.Str2Int64(catMaps[0].JdID), // 到家分类 - BrandID: 35247, - SkuName: mtSku.Name, - SkuPrice: int(jxutils.StandardPrice2Int(mtSku.Price)), - Weight: float64(jxutils.IntWeight2Float(utils.Str2Int(mtSku.SkuList[0].Weight))), - FixedStatus: 1, - IsSale: -1, - Upc: mtSku.SkuList[0].Upc, - Images: mtSku.PictureList, + ShopCategories: []int64{}, // 商家分类 + //CategoryID: utils.Str2Int64(catMaps[0].JdID), // 到家分类 + BrandID: 35247, + SkuName: mtSku.Name, + SkuPrice: int(jxutils.StandardPrice2Int(mtSku.Price)), + Weight: float64(jxutils.IntWeight2Float(utils.Str2Int(mtSku.SkuList[0].Weight))), + FixedStatus: 1, + IsSale: -1, + Upc: mtSku.SkuList[0].Upc, + Images: mtSku.PictureList, } - if len(catMaps) == 0 { + if param.OutSkuID == "" { + param.OutSkuID = fmt.Sprintf("%d_%d", time.Now().Unix(), param.SkuPrice) + } + handler, _ := partner.GetPurchasePlatformFromVendorID(model.VendorIDDD).(partner.IPurchasePlatformStoreSkuHandler) + vendorCategoryId, _ := handler.GetSkuCategoryIdByName(jdOrgCode, mtSku.Name) + if vendorCategoryId != "" { + param.CategoryID = utils.Str2Int64(vendorCategoryId) // 其他水果 + } else { param.CategoryID = 22410 // 其他水果 } param.ShopCategories = append(param.ShopCategories, 33313305) // 暂无分类