From 0e58dece1b034bd4b0a59690bd299034ebee8bc7 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 14 Oct 2019 18:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E7=94=A8mtwmapi.RetailSkuSellStatus?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E6=96=B9=E6=9B=BF=E6=8D=A2=E4=B8=BARetailSel?= =?UTF-8?q?lStatus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/mtwm/order.go | 16 +++++++++------- business/partner/purchase/mtwm/store_sku2.go | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/business/partner/purchase/mtwm/order.go b/business/partner/purchase/mtwm/order.go index 983e04127..eb08f522a 100644 --- a/business/partner/purchase/mtwm/order.go +++ b/business/partner/purchase/mtwm/order.go @@ -258,13 +258,15 @@ func getRefundSkuDetailList(msg *mtwmapi.CallbackMsg) (skuList []*mtwmapi.Refund } func getSkuWeight(product map[string]interface{}) (weight int) { - searchResult := specPat.FindStringSubmatch(product["spec"].(string)) - if len(searchResult) == 3 { - weight = jxutils.FormatSkuWeight(float32(utils.Str2Float64WithDefault(searchResult[1], 0)), utils.TrimBlankChar(searchResult[2])) - } - if weight == 0 { - _, _, _, specUnit, _, specQuality := jxutils.SplitSkuName(product["food_name"].(string)) - weight = jxutils.FormatSkuWeight(specQuality, specUnit) + if weight = int(utils.Interface2Int64WithDefault(product["weight"], 0)); weight == 0 { + searchResult := specPat.FindStringSubmatch(product["spec"].(string)) + if len(searchResult) == 3 { + weight = jxutils.FormatSkuWeight(float32(utils.Str2Float64WithDefault(searchResult[1], 0)), utils.TrimBlankChar(searchResult[2])) + } + if weight == 0 { + _, _, _, specUnit, _, specQuality := jxutils.SplitSkuName(product["food_name"].(string)) + weight = jxutils.FormatSkuWeight(specQuality, specUnit) + } } return weight } diff --git a/business/partner/purchase/mtwm/store_sku2.go b/business/partner/purchase/mtwm/store_sku2.go index 5ffc2a6a9..25ca98cc4 100644 --- a/business/partner/purchase/mtwm/store_sku2.go +++ b/business/partner/purchase/mtwm/store_sku2.go @@ -256,7 +256,7 @@ func (p *PurchaseHandler) UpdateStoreSkusStatus(ctx *jxcontext.Context, storeID skuList := storeSku2Mtwm(storeSkuList, updateTypeStatus) mtwmStatus := skuStatusJX2Mtwm(status) if globals.EnableMtwmStoreWrite { - failedFoodList, err2 := api.MtwmAPI.RetailSkuSellStatus(ctx.GetTrackInfo(), vendorStoreID, skuList, mtwmStatus) + failedFoodList, err2 := api.MtwmAPI.RetailSellStatus(ctx.GetTrackInfo(), vendorStoreID, skuList, mtwmStatus) if err = err2; err == nil { if len(failedFoodList) > 0 { successList = putils.UnselectStoreSkuListByVendorSkuIDs(storeSkuList, getAppFoodCodeList(failedFoodList))