调用mtwmapi.RetailSkuSellStatus的地方替换为RetailSellStatus

This commit is contained in:
gazebo
2019-10-14 18:43:59 +08:00
parent a0a668e546
commit 0e58dece1b
2 changed files with 10 additions and 8 deletions

View File

@@ -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
}

View File

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