根据excel创建标品解决图片上传

This commit is contained in:
苏尹岚
2020-04-10 15:02:59 +08:00
parent 1b97f69b53
commit 28a1907bf7
2 changed files with 4 additions and 1 deletions

View File

@@ -1899,6 +1899,10 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader) (hint stri
skuName.Price = v.Price * 100
}
if v.Unit != "" {
if v.Unit == model.UnitNames[0] {
createUpcSkuByExcelErrList = append(createUpcSkuByExcelErrList, buildCreateUpcSkuByExcelErr(v, "标品的单位不能为份!"))
continue
}
skuName.Unit = v.Unit
} else {
createUpcSkuByExcelErrList = append(createUpcSkuByExcelErrList, buildCreateUpcSkuByExcelErr(v, "未查询到商品单位,请补充商品单位!"))

View File

@@ -464,7 +464,6 @@ func (s SkuList) Swap(i, j int) {
func DownloadFileByURL(fileURL string) (bodyData []byte, fileMD5 string, err error) {
response, err := http.Get(fileURL)
globals.SugarLogger.Debugf("TryRegisterDataResource2, response:%v", utils.Format4Output(response, false))
if err == nil {
defer response.Body.Close()
if response.StatusCode == http.StatusOK {