调用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,6 +258,7 @@ func getRefundSkuDetailList(msg *mtwmapi.CallbackMsg) (skuList []*mtwmapi.Refund
} }
func getSkuWeight(product map[string]interface{}) (weight int) { func getSkuWeight(product map[string]interface{}) (weight int) {
if weight = int(utils.Interface2Int64WithDefault(product["weight"], 0)); weight == 0 {
searchResult := specPat.FindStringSubmatch(product["spec"].(string)) searchResult := specPat.FindStringSubmatch(product["spec"].(string))
if len(searchResult) == 3 { if len(searchResult) == 3 {
weight = jxutils.FormatSkuWeight(float32(utils.Str2Float64WithDefault(searchResult[1], 0)), utils.TrimBlankChar(searchResult[2])) weight = jxutils.FormatSkuWeight(float32(utils.Str2Float64WithDefault(searchResult[1], 0)), utils.TrimBlankChar(searchResult[2]))
@@ -266,6 +267,7 @@ func getSkuWeight(product map[string]interface{}) (weight int) {
_, _, _, specUnit, _, specQuality := jxutils.SplitSkuName(product["food_name"].(string)) _, _, _, specUnit, _, specQuality := jxutils.SplitSkuName(product["food_name"].(string))
weight = jxutils.FormatSkuWeight(specQuality, specUnit) weight = jxutils.FormatSkuWeight(specQuality, specUnit)
} }
}
return weight return weight
} }

View File

@@ -256,7 +256,7 @@ func (p *PurchaseHandler) UpdateStoreSkusStatus(ctx *jxcontext.Context, storeID
skuList := storeSku2Mtwm(storeSkuList, updateTypeStatus) skuList := storeSku2Mtwm(storeSkuList, updateTypeStatus)
mtwmStatus := skuStatusJX2Mtwm(status) mtwmStatus := skuStatusJX2Mtwm(status)
if globals.EnableMtwmStoreWrite { 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 err = err2; err == nil {
if len(failedFoodList) > 0 { if len(failedFoodList) > 0 {
successList = putils.UnselectStoreSkuListByVendorSkuIDs(storeSkuList, getAppFoodCodeList(failedFoodList)) successList = putils.UnselectStoreSkuListByVendorSkuIDs(storeSkuList, getAppFoodCodeList(failedFoodList))