From e2d34ea4bd85a14f6eee1ce78f4e3c34e891f8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 21 Nov 2019 11:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=B0=B8=E8=BE=89excel?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/yonghui/yonghui.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) 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() { + +}