|
|
@@ -128,7 +128,11 @@ public class PurcProductServiceImpl implements PurcProductService {
|
|
|
row.getCell(6).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
if (null != row.getCell(6).getStringCellValue().trim()
|
|
|
&& !row.getCell(6).getStringCellValue().trim().equals("")) {
|
|
|
- product.setMinPack(Double.valueOf(row.getCell(6).getStringCellValue()));
|
|
|
+ try {
|
|
|
+ product.setMinPack(Double.valueOf(row.getCell(6).getStringCellValue()));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ throw new IllegalOperatorException("第" + (r + 1) + "行最小包装量填写不规范,请填数字");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 最小订购量
|
|
|
@@ -136,7 +140,11 @@ public class PurcProductServiceImpl implements PurcProductService {
|
|
|
row.getCell(7).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
if (null != row.getCell(7).getStringCellValue().trim()
|
|
|
&& !row.getCell(7).getStringCellValue().trim().equals("")) {
|
|
|
- product.setMinOrder(Double.valueOf(row.getCell(7).getStringCellValue()));
|
|
|
+ try {
|
|
|
+ product.setMinOrder(Double.valueOf(row.getCell(7).getStringCellValue()));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ throw new IllegalOperatorException("第" + (r + 1) + "行最小订购量填写不规范,请填数字");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 交货周期
|
|
|
@@ -144,7 +152,11 @@ public class PurcProductServiceImpl implements PurcProductService {
|
|
|
row.getCell(8).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
if (null != row.getCell(8).getStringCellValue().trim()
|
|
|
&& !row.getCell(8).getStringCellValue().trim().equals("")) {
|
|
|
- product.setLeadtime(Double.valueOf(row.getCell(8).getStringCellValue()));
|
|
|
+ try {
|
|
|
+ product.setLeadtime(Double.valueOf(row.getCell(8).getStringCellValue()));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ throw new IllegalOperatorException("第" + (r + 1) + "行交货周期填写不规范,请填数字");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 交货提前期
|
|
|
@@ -152,7 +164,11 @@ public class PurcProductServiceImpl implements PurcProductService {
|
|
|
row.getCell(9).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
if (null != row.getCell(9).getStringCellValue().trim()
|
|
|
&& !row.getCell(9).getStringCellValue().trim().equals("")) {
|
|
|
- product.setLtinstock(Double.valueOf(row.getCell(9).getStringCellValue()));
|
|
|
+ try {
|
|
|
+ product.setLtinstock(Double.valueOf(row.getCell(9).getStringCellValue()));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ throw new IllegalOperatorException("第" + (r + 1) + "行交货提前期填写不规范,请填数字");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
List<Product> prods = productDao.findByEnUUAndCode(SystemSession.getUser().getEnterprise().getUu(),
|