|
|
@@ -112,6 +112,23 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
throw new IllegalOperatorException("您上传的信息列信息不正确,请与模板的列做比较");
|
|
|
}
|
|
|
}
|
|
|
+ //获取第十列的表头,看是否与用户上传的模板对应上
|
|
|
+ Cell templeatePriceTitle = headerRow.getCell(9);
|
|
|
+ Object priceCellObj = readWorkBookCell(templeatePriceTitle, Cell.CELL_TYPE_STRING, 0, 9);
|
|
|
+ if(StringUtils.isEmpty(priceCellObj)) {
|
|
|
+ throw new IllegalOperatorException("您上传的信息列信息不正确,请与模板的列做比较");
|
|
|
+ }else{
|
|
|
+ if(Currency.USD.equals(currency)) {
|
|
|
+ if (!priceCellObj.toString().equals("单价USD")) {
|
|
|
+ throw new IllegalOperatorException("您上传的文件表头与美金模板不符");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (!priceCellObj.toString().equals("单价RMB")) {
|
|
|
+ throw new IllegalOperatorException("您上传的文件表头与人民币模板不符");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
for (int r = 1; r <= rowNum; r++) {
|
|
|
Row row = sheet.getRow(r);
|
|
|
// 英文品牌名称
|
|
|
@@ -124,7 +141,11 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
|
|
|
Cell cell = row.getCell(1);
|
|
|
Object cellValue = readWorkBookCell(cell, Cell.CELL_TYPE_STRING, r, 1);
|
|
|
- releaseProductByBatch.setBrandNameEn(String.valueOf(cellValue));
|
|
|
+ if(StringUtils.isEmpty(cellValue)) {
|
|
|
+ releaseProductByBatch.addErrmsg("2:英文品牌为必填字段");
|
|
|
+ }else {
|
|
|
+ releaseProductByBatch.setBrandNameEn(String.valueOf(cellValue));
|
|
|
+ }
|
|
|
|
|
|
// 中文品牌名
|
|
|
Object brandNameCnCellValue = readWorkBookCell(row.getCell(0), Cell.CELL_TYPE_STRING, r, 0);
|
|
|
@@ -139,6 +160,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
if(!matcher.find()) {
|
|
|
releaseProductByBatch.addErrmsg("3:产品型号仅限英文、数字、特殊字符");
|
|
|
}
|
|
|
+ }else {
|
|
|
+ releaseProductByBatch.addErrmsg("3:产品型号为必填字段");
|
|
|
}
|
|
|
|
|
|
// 可拆卖
|
|
|
@@ -233,8 +256,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}else {
|
|
|
releaseProductByBatch.setMinPackage(minPackQty);
|
|
|
}
|
|
|
- }else {
|
|
|
+ }if(StringUtils.isEmpty(minPackQtyCellValue)) {
|
|
|
releaseProductByBatch.setMinPackage(DoubleConstant.minReserve);
|
|
|
+ }else {
|
|
|
+ releaseProductByBatch.addErrmsg("9:最小包数量包含非数字字符");
|
|
|
}
|
|
|
|
|
|
// 最小起订量
|
|
|
@@ -266,8 +291,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ }else if(StringUtils.isEmpty(minBuyCellValue)){
|
|
|
releaseProductByBatch.setMinBuyQty(releaseProductByBatch.getMinPackage());
|
|
|
+ }else {
|
|
|
+ releaseProductByBatch.addErrmsg("8:最小起订量包含非数字的字符");
|
|
|
}
|
|
|
|
|
|
// 确认币别
|