创建标品优化,同步物料测试

This commit is contained in:
苏尹岚
2020-04-24 18:10:53 +08:00
parent ab46db1871
commit fe6de10570
2 changed files with 148 additions and 0 deletions

View File

@@ -2145,6 +2145,11 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader, categoryID
skuName.CategoryID = categoryID
}
skuName.Skus[0].Status = model.SkuStatusNormal
if resBinary, _, err := jxutils.DownloadFileByURL(skuName.Img); err == nil {
if model.ValidMimeTypes[http.DetectContentType(resBinary)] == 0 {
skuName.Img = model.NOSkuNameImg
}
}
_, err = AddSkuName(ctx, skuName, ctx.GetUserName())
if err != nil {
retVal = []*CreateUpcSkuByExcelErr{buildCreateUpcSkuByExcelErr(v, err.Error())}