|
|
@ -98,6 +98,9 @@ public class ExcelController { |
|
|
|
JSONArray headerJsonArray = JSONArray.parse(jsonObject.getString("ttsupplierrsheader")); |
|
|
|
JSONArray lineJsonArray = JSONArray.parse(jsonObject.getString("ttsupplierrsline")); |
|
|
|
List<String> fileNames = new ArrayList<>(); |
|
|
|
if(headerJsonArray == null) { |
|
|
|
return AjaxResult.error(HttpStatus.TTSUPPLIERRSHEADER_FAIL, "数据不存在ttsupplierrsheader"); |
|
|
|
} |
|
|
|
for(int i = 0; i < headerJsonArray.size(); i++) { |
|
|
|
JSONObject jsonObjectHeader = headerJsonArray.getJSONObject(i); |
|
|
|
String schmHeaderOrder = jsonObjectHeader.getString("schm_header_order"); |
|
|
@ -333,9 +336,11 @@ public class ExcelController { |
|
|
|
nextCell.setCellStyle(cellStyle7); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!forecastArray.isEmpty()) { |
|
|
|
// 合并单元格
|
|
|
|
CellRangeAddress cellRangeAddress3 = new CellRangeAddress(14, 14, firmArray.size() + 6, firmArray.size() + forecastArray.size() + 5); |
|
|
|
sheet.addMergedRegion(cellRangeAddress3); |
|
|
|
} |
|
|
|
inputStream.close(); |
|
|
|
FileOutputStream outputStream = new FileOutputStream(filePath + "/" + fileName); |
|
|
|
workbook.write(outputStream); |
|
|
@ -507,9 +512,11 @@ public class ExcelController { |
|
|
|
nextCell.setCellStyle(cellStyle7); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!forecastArray.isEmpty()) { |
|
|
|
// 合并单元格
|
|
|
|
CellRangeAddress cellRangeAddress3 = new CellRangeAddress(14, 14, firmArray.size() + 9, firmArray.size() + forecastArray.size() + 8); |
|
|
|
sheet.addMergedRegion(cellRangeAddress3); |
|
|
|
} |
|
|
|
inputStream.close(); |
|
|
|
FileOutputStream outputStream = new FileOutputStream(filePath + "/" + fileName); |
|
|
|
workbook.write(outputStream); |
|
|
@ -696,6 +703,7 @@ public class ExcelController { |
|
|
|
private String fillGuowai2(String orderNo, JSONObject jsonObjectHeader, JSONArray orderArray, JSONArray firmArray, JSONArray forecastArray) throws IOException { |
|
|
|
ClassPathResource templateFile = new ClassPathResource("guowai2.xls"); |
|
|
|
String filePath = WinConfig.getUploadPath(); |
|
|
|
orderNo = orderNo.toUpperCase(); |
|
|
|
String fileName = orderNo + ".xls"; |
|
|
|
File file = new File(filePath); |
|
|
|
if (!file.exists()) { |
|
|
|