读取永辉excel文件

This commit is contained in:
苏尹岚
2019-11-21 11:48:21 +08:00
parent e6460c7756
commit e2d34ea4bd

View File

@@ -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() {
}