|
|
|
@ -100,6 +100,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook(is); |
|
|
|
importNotifyExcel(inData, workbook, site, currentUser, excelList); |
|
|
|
} catch (NullPointerException e) { |
|
|
|
log.error("导入失败:{}", e.getMessage()); |
|
|
|
throw new RuntimeException("导入失败:网络错误,请重新上传文档"); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException("导入失败:" + e.getMessage()); |
|
|
|
@ -184,8 +185,16 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
for (int j = 1; j < rows; j++) { |
|
|
|
// 创建对象 |
|
|
|
EcssCoDelNotifyData task = new EcssCoDelNotifyData(); |
|
|
|
XSSFRow row0 = sheet.getRow(0); |
|
|
|
if (row0.getCell(0) == null || StringUtils.isBlank(getStringCellValue(row0, 0)) |
|
|
|
|| !getStringCellValue(row0, 0).equals("Ready Date")) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
// 获得该行 |
|
|
|
XSSFRow row = sheet.getRow(j); |
|
|
|
if (row.getCell(11) == null || StringUtils.isBlank(getStringCellValue(row, 11))) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (row.getCell(0) == null ) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的Ready Date不能为空!"); |
|
|
|
} |
|
|
|
@ -204,7 +213,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
if (row.getCell(13) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的Destination不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(17) == null) { |
|
|
|
if (row.getCell(15) == null) { |
|
|
|
throw new RuntimeException("第" + (j+1) + "行的Shipping Mode不能为空!"); |
|
|
|
} |
|
|
|
if (row.getCell(19) == null) { |
|
|
|
@ -255,13 +264,13 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
task.setCurrency(getStringCellValue(row, 19)); |
|
|
|
task.setTp(getNumericCellValueOrDefault(row, 20)); |
|
|
|
task.setTtlAmount(getNumericCellValueOrDefault(row, 21)); |
|
|
|
task.setVat(getStringCellValue(row, 22)); |
|
|
|
task.setVat(getNumericCellValueOrDefault(row, 22)); |
|
|
|
task.setSumPrice(getNumericCellValueOrDefault(row, 23)); |
|
|
|
task.setSo(getStringCellValue(row, 24)); |
|
|
|
task.setUpc(getStringCellValue(row, 25)); |
|
|
|
task.setRemark(getStringCellValue(row, 26)); |
|
|
|
task.setRoll(getStringCellValue(row, 27)); |
|
|
|
task.setCarton(getStringCellValue(row, 28)); |
|
|
|
task.setRoll(getNumericCellValueOrDefault(row, 27)); |
|
|
|
task.setCarton(Objects.requireNonNull(getNumericCellValueOrDefault(row, 28)).setScale(1, RoundingMode.HALF_UP)); |
|
|
|
task.setErpFlag("N"); |
|
|
|
task.setNotifyStatus("已计划"); |
|
|
|
task.setUsername(inData.getUsername()); |
|
|
|
|