diff --git a/business/jxstore/yonghui/yonghui.go b/business/jxstore/yonghui/yonghui.go index 4477fad48..4374bea0c 100644 --- a/business/jxstore/yonghui/yonghui.go +++ b/business/jxstore/yonghui/yonghui.go @@ -89,8 +89,10 @@ func LoadExcelByYongHui(ctx *jxcontext.Context, files []*multipart.FileHeader, i return "", errors.New("没有文件上传!") } fileHeader := files[0] + fileName := fileHeader.Filename + fmt.Println(fileName) file, err := fileHeader.Open() - hint, err = LoadExcelBinByYongHui(ctx, file, true, true) + // hint, err = LoadExcelBinByYongHui(ctx, file, true, true) file.Close() return hint, err } @@ -128,6 +130,10 @@ func LoadExcelBinByYongHui(ctx *jxcontext.Context, reader io.Reader, isAsync, is return "", errors.New(errMsg) } } + //修改分组名 + // 分类名格式为:可定XX日 + // XX为上传永辉 提供的 价格表时间 +2天 + case 1: //获取微盟所有商品 goodsList, err = GetWeiMobGoodsList() @@ -292,15 +298,15 @@ func updateWeiMobGoods(costPrice, salePrice float64, goodsDetail *weimobapi.Good return 0, nil, errors.New(fmt.Sprintf("未查询到此商品的分类信息!goodsID : [%v] ,", goodsDetail.GoodsID)) } + //获取分组 selectedClassifyList := goodsDetail.SelectedClassifyList var selectedClassifyListID []int64 if len(selectedClassifyList) > 0 { for _, v := range selectedClassifyList { - selectedClassifyListID = append(selectedClassifyListID, v.ChildrenClassify[0].ClassifyID) + for _, vv := range v.ChildrenClassify { + selectedClassifyListID = append(selectedClassifyListID, vv.ClassifyID) + } } - // categoryID = categoryList[len(categoryList)-1].CategoryID - } else { - return 0, nil, errors.New(fmt.Sprintf("未查询到此商品的分类信息!goodsID : [%v] ,", goodsDetail.GoodsID)) } b2CSku := &weimobapi.B2CSku{ Weight: skuListInfo.B2CSku.Weight, @@ -417,3 +423,7 @@ func GetCellIntoMap(skuIDCol, skuPriceCol, orgSkuIDCol, orgSkuPriceCol int, skuM func Float64Round(f float64) (flt float64) { return math.Round(f*100) / 100 } + +func UpdateClassifyName() { + +}