|
@@ -318,7 +318,7 @@ public class WbsTreeContractController extends BladeController {
|
|
//获取单元格所属的合并单元格区域
|
|
//获取单元格所属的合并单元格区域
|
|
CellRangeAddress mergedRegion = findMergedRegion(poiSheet, cell.getRowIndex(), cell.getColumnIndex());
|
|
CellRangeAddress mergedRegion = findMergedRegion(poiSheet, cell.getRowIndex(), cell.getColumnIndex());
|
|
if (mergedRegion != null) {
|
|
if (mergedRegion != null) {
|
|
- // 存储需要修改的合并单元格信息
|
|
|
|
|
|
+ //存储需要修改的合并单元格信息
|
|
cellsToModify.add(new CellModificationInfo(cell, mergedRegion));
|
|
cellsToModify.add(new CellModificationInfo(cell, mergedRegion));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -335,7 +335,7 @@ public class WbsTreeContractController extends BladeController {
|
|
CellStyle cellStyle = poiWorkbook.createCellStyle();
|
|
CellStyle cellStyle = poiWorkbook.createCellStyle();
|
|
CellStyle sourceCellStyle = cell.getCellStyle(); //获取原单元格的样式
|
|
CellStyle sourceCellStyle = cell.getCellStyle(); //获取原单元格的样式
|
|
cellStyle.cloneStyleFrom(sourceCellStyle); //复制样式
|
|
cellStyle.cloneStyleFrom(sourceCellStyle); //复制样式
|
|
- setBlackBorder(cellStyle); // 设置边框
|
|
|
|
|
|
+ setBlackBorder(cellStyle); //设置边框
|
|
cell.setCellStyle(cellStyle);
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
if (info.hasMergedRegion()) { //修改合并单元格边框线
|
|
if (info.hasMergedRegion()) { //修改合并单元格边框线
|
|
@@ -459,7 +459,7 @@ public class WbsTreeContractController extends BladeController {
|
|
SimpleDateFormat inputDateFormat = new SimpleDateFormat("yyyy/M/dd");
|
|
SimpleDateFormat inputDateFormat = new SimpleDateFormat("yyyy/M/dd");
|
|
SimpleDateFormat outputDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
SimpleDateFormat outputDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
|
|
|
- //把导入的excel转换为html
|
|
|
|
|
|
+ //导入的excel转换html的路径
|
|
Long id = SnowFlakeUtil.getId();
|
|
Long id = SnowFlakeUtil.getId();
|
|
String importExcelFilePath = FileUtils.getSysLocalFileUrl();
|
|
String importExcelFilePath = FileUtils.getSysLocalFileUrl();
|
|
String importExcelTOHtmlPath = importExcelFilePath + "/pdf//" + id + ".html";
|
|
String importExcelTOHtmlPath = importExcelFilePath + "/pdf//" + id + ".html";
|
|
@@ -468,6 +468,7 @@ public class WbsTreeContractController extends BladeController {
|
|
String url_1 = "";
|
|
String url_1 = "";
|
|
com.spire.xls.Workbook workbook = null;
|
|
com.spire.xls.Workbook workbook = null;
|
|
try {
|
|
try {
|
|
|
|
+ //把导入的excel转换成html
|
|
workbook = new com.spire.xls.Workbook();
|
|
workbook = new com.spire.xls.Workbook();
|
|
workbook.loadFromHtml(file.getInputStream());
|
|
workbook.loadFromHtml(file.getInputStream());
|
|
workbook.saveToFile(importExcelTOHtmlPath, FileFormat.HTML);
|
|
workbook.saveToFile(importExcelTOHtmlPath, FileFormat.HTML);
|
|
@@ -476,9 +477,9 @@ public class WbsTreeContractController extends BladeController {
|
|
url_1 = importExcelTOHtmlPath.split("pdf//")[0];
|
|
url_1 = importExcelTOHtmlPath.split("pdf//")[0];
|
|
String excelToHtmlFileUrl = url_1 + "/pdf/" + id + "_files/" + sheet.getName() + ".html";
|
|
String excelToHtmlFileUrl = url_1 + "/pdf/" + id + "_files/" + sheet.getName() + ".html";
|
|
String htmlString_2 = IoUtil.readToString(new FileInputStream(ResourceUtil.getFile(excelToHtmlFileUrl)));
|
|
String htmlString_2 = IoUtil.readToString(new FileInputStream(ResourceUtil.getFile(excelToHtmlFileUrl)));
|
|
- //循环遍历解析tr、td
|
|
|
|
- Document doc_1 = Jsoup.parse(htmlString_1);
|
|
|
|
- Document doc_2 = Jsoup.parse(htmlString_2);
|
|
|
|
|
|
+ //循环遍历解析两张html的tr、td
|
|
|
|
+ Document doc_1 = Jsoup.parse(htmlString_1); //合同段表的html
|
|
|
|
+ Document doc_2 = Jsoup.parse(htmlString_2); //导入excel转换的html
|
|
Elements trElements1 = doc_1.select("table tbody tr");
|
|
Elements trElements1 = doc_1.select("table tbody tr");
|
|
Elements trElements2 = doc_2.select("table tbody tr");
|
|
Elements trElements2 = doc_2.select("table tbody tr");
|
|
for (int i = 0; i < trElements1.size(); i++) {
|
|
for (int i = 0; i < trElements1.size(); i++) {
|
|
@@ -609,9 +610,9 @@ public class WbsTreeContractController extends BladeController {
|
|
|
|
|
|
@PostMapping("/getConcealedWorksNodeTree")
|
|
@PostMapping("/getConcealedWorksNodeTree")
|
|
@ApiOperationSupport(order = 15)
|
|
@ApiOperationSupport(order = 15)
|
|
- @ApiOperation(value = "获取合同段隐蔽工程节点树", notes = "传入合同段id")
|
|
|
|
- public R<List<WbsTreeContractVO>> getConcealedWorksNodeTree(@RequestParam String contractId) {
|
|
|
|
- List<WbsTreeContractVO> result = iWbsTreeContractService.getConcealedWorksNodeTree(contractId);
|
|
|
|
|
|
+ @ApiOperation(value = "获取合同段隐蔽工程节点树-懒加载", notes = "传入合同段id、父级id")
|
|
|
|
+ public R<List<WbsTreeContractVO>> getConcealedWorksNodeTree(@RequestParam String contractId, @RequestParam String parentId) {
|
|
|
|
+ List<WbsTreeContractVO> result = iWbsTreeContractService.getConcealedWorksNodeTree(contractId, parentId);
|
|
return R.data(result);
|
|
return R.data(result);
|
|
}
|
|
}
|
|
|
|
|