|
|
@@ -158,14 +158,6 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
} else {
|
|
|
throw new RuntimeException("签单方式不能为空");
|
|
|
}
|
|
|
- //PAYMODE
|
|
|
- /*if (ObjectUtils.isNotNull(sheet.getRow(21).getCell(4))) {
|
|
|
- String payMode = sheet.getRow(21).getCell(4).getStringCellValue();
|
|
|
- System.out.println("payMode:" + payMode);
|
|
|
- bills.setHpaymode(payMode);
|
|
|
- } else {
|
|
|
- throw new RuntimeException("运费支付方式不能为空");
|
|
|
- }*/
|
|
|
//PLACE OF ISSUE
|
|
|
if (ObjectUtils.isNotNull(sheet.getRow(22).getCell(1))) {
|
|
|
String placeOfIssue = sheet.getRow(22).getCell(1).getStringCellValue();
|
|
|
@@ -182,22 +174,6 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
} else {
|
|
|
throw new RuntimeException("付费地不能为空");
|
|
|
}
|
|
|
- //CONTRACTNO
|
|
|
- /*if (ObjectUtils.isNotNull(sheet.getRow(23).getCell(1))) {
|
|
|
- String contractno = sheet.getRow(23).getCell(1).getStringCellValue();
|
|
|
- System.out.println("contractno:" + contractno);
|
|
|
- bills.setCorpArgreementNo(contractno);
|
|
|
- } else {
|
|
|
- throw new RuntimeException("约号不能为空");
|
|
|
- }*/
|
|
|
- //VOLUME
|
|
|
- /*if (ObjectUtils.isNotNull(sheet.getRow(23).getCell(4))) {
|
|
|
- String volume = sheet.getRow(23).getCell(4).getStringCellValue();
|
|
|
- System.out.println("volume:" + volume);
|
|
|
- bills.setQuantityCntrDescr(volume);
|
|
|
- } else {
|
|
|
- throw new RuntimeException("箱型箱量不能为空");
|
|
|
- }*/
|
|
|
//MARKS
|
|
|
StringBuilder marks = new StringBuilder();
|
|
|
for (int i = 25; i <= 46; i++) {
|
|
|
@@ -265,68 +241,13 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
System.out.println("finalDestination:" + finalDestination);
|
|
|
bills.setFinalDestinationName(finalDestination);
|
|
|
}
|
|
|
-
|
|
|
- /*for (int i = 0; i <= sheet.getLastRowNum(); i++) {
|
|
|
- String rowStr = "";
|
|
|
- //循环获取sheet页的每一行
|
|
|
- Row row = sheet.getRow(i);
|
|
|
- //循环每一行的每一个单元格
|
|
|
- for (int l = 0; l <= 6; l++) {
|
|
|
- //判断是否是合并单元格并返回值
|
|
|
- String value = getValue(sheet, i, row.getCell(l).getColumnIndex());
|
|
|
- //数值为空说明不是合并单元格或者当前单元格为空,则直接获取当前单元格值
|
|
|
- if ("".equals(value)) {
|
|
|
- if (ObjectUtils.isNull(row.getCell(l))) {
|
|
|
- value = "";
|
|
|
- } else {
|
|
|
- CellType cellType = row.getCell(l).getCellTypeEnum();
|
|
|
- switch (cellType.name()) {
|
|
|
- case "STRING":
|
|
|
- value = row.getCell(l).getStringCellValue();
|
|
|
- // 处理字符串类型的值
|
|
|
- break;
|
|
|
- case "NUMERIC":
|
|
|
- value = row.getCell(l).getNumericCellValue() + "";
|
|
|
- // 处理数字类型的值
|
|
|
- break;
|
|
|
- case "FORMULA":
|
|
|
- value = row.getCell(l).getNumericCellValue() + "";
|
|
|
- // 处理数字类型的值
|
|
|
- break;
|
|
|
- case "_NONE":
|
|
|
- value = "";
|
|
|
- // 处理数字类型的值
|
|
|
- break;
|
|
|
- case "BLANK":
|
|
|
- value = "";
|
|
|
- // 处理数字类型的值
|
|
|
- break;
|
|
|
- case "BOOLEAN":
|
|
|
- value = "";
|
|
|
- // 处理数字类型的值
|
|
|
- break;
|
|
|
- case "ERROR":
|
|
|
- value = "";
|
|
|
- // 处理数字类型的值
|
|
|
- break;
|
|
|
- // 可以添加其他类型的处理
|
|
|
- default:
|
|
|
- System.out.println("cellType:" + cellType.name());
|
|
|
- throw new RuntimeException("数据类型错误");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- rowStr += "--" + value;
|
|
|
- }
|
|
|
- for (Cell cell : row) {
|
|
|
- //判断是否是合并单元格并返回值
|
|
|
- String value = getValue(sheet, i, cell.getColumnIndex());
|
|
|
- //数值为空说明不是合并单元格或者当前单元格为空,则直接获取当前单元格值
|
|
|
- if("".equals(value)){
|
|
|
- value=cell.getStringCellValue();
|
|
|
- }
|
|
|
- rowStr+="--"+value;
|
|
|
- }*/
|
|
|
+ bills.setContainersList(new ArrayList<>());
|
|
|
+ bills.setPreContainersList(new ArrayList<>());
|
|
|
+ bills.setContainersReportsList(new ArrayList<>());
|
|
|
+ bills.setFeeCenterListC(new ArrayList<>());
|
|
|
+ bills.setFeeCenterListD(new ArrayList<>());
|
|
|
+ bills.setFilesList(new ArrayList<>());
|
|
|
+ bills.setWaitingBoxList(new ArrayList<>());
|
|
|
return R.data(bills);
|
|
|
}
|
|
|
|
|
|
@@ -415,6 +336,13 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
} else {
|
|
|
throw new RuntimeException("体积不能为空");
|
|
|
}
|
|
|
+ bills.setContainersList(new ArrayList<>());
|
|
|
+ bills.setPreContainersList(new ArrayList<>());
|
|
|
+ bills.setContainersReportsList(new ArrayList<>());
|
|
|
+ bills.setFeeCenterListC(new ArrayList<>());
|
|
|
+ bills.setFeeCenterListD(new ArrayList<>());
|
|
|
+ bills.setFilesList(new ArrayList<>());
|
|
|
+ bills.setWaitingBoxList(new ArrayList<>());
|
|
|
return R.data(bills);
|
|
|
}
|
|
|
|
|
|
@@ -495,6 +423,14 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
} else {
|
|
|
throw new RuntimeException("体积不能为空");
|
|
|
}
|
|
|
+ bills.setContainersList(new ArrayList<>());
|
|
|
+ bills.setPreContainersList(new ArrayList<>());
|
|
|
+ bills.setContainersReportsList(new ArrayList<>());
|
|
|
+ bills.setFeeCenterListC(new ArrayList<>());
|
|
|
+ bills.setFeeCenterListD(new ArrayList<>());
|
|
|
+ bills.setFeeCenterList(new ArrayList<>());
|
|
|
+ bills.setFilesList(new ArrayList<>());
|
|
|
+ bills.setWaitingBoxList(new ArrayList<>());
|
|
|
return R.data(bills);
|
|
|
}
|
|
|
|
|
|
@@ -509,7 +445,6 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
|
|
|
// 创建FileInputStream来读取临时文件
|
|
|
FileInputStream fis = new FileInputStream(tempFile.toFile());
|
|
|
-// Workbook workbook = new HSSFWorkbook(fis);
|
|
|
Workbook workbook = new XSSFWorkbook(fis);
|
|
|
Sheet sheet = workbook.getSheetAt(0); // 获取第一个工作表
|
|
|
|