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))