| | |
| | | return 0, errors.New(errMsg) |
| | | } |
| | | material.CategoryId = mapProductCategory[strings.Trim(insert[3], " ")] |
| | | if len(insert) > 5 && insert[4] != "" { |
| | | //errMsg = "第" + strconv.Itoa(index+1) + "行,产品编码:" + insert[0] + ",未填写单位" |
| | | //return 0, errors.New(errMsg) |
| | | material.Unit = insert[4] |
| | | } |
| | | |
| | | material.Unit = insert[4] |
| | | |
| | | var moreUnit = true |
| | | if len(insert) > 6 && insert[5] != "" { |
| | | material.MoreUnit = &moreUnit |
| | | var ut models.UnitItems |
| | | ut.Unit = insert[4] |
| | | ut.Unit = insert[5] |
| | | if len(insert) < 13 || insert[12] == "" { |
| | | errMsg = "第" + strconv.Itoa(index+2) + "行,产品编码:" + insert[0] + ",请填写与辅计量单位1相关的单位换算比例1" |
| | | return 0, errors.New(errMsg) |
| | |
| | | if len(insert) > 7 && insert[6] != "" { |
| | | material.MoreUnit = &moreUnit |
| | | var ut models.UnitItems |
| | | ut.Unit = insert[5] |
| | | ut.Unit = insert[6] |
| | | if len(insert) < 15 || insert[14] == "" { |
| | | errMsg = "第" + strconv.Itoa(index+2) + "行,产品编码:" + insert[0] + ",请填写与辅计量单位2相关的单位换算比例2" |
| | | return 0, errors.New(errMsg) |