|
@@ -552,6 +552,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
excelTab.setStatus(3);
|
|
excelTab.setStatus(3);
|
|
baseMapper.updateById(excelTab);
|
|
baseMapper.updateById(excelTab);
|
|
connection.disconnect();
|
|
connection.disconnect();
|
|
|
|
+ System.out.println("123456");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
editCallback.setError(1);
|
|
editCallback.setError(1);
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -1048,7 +1049,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
@Override
|
|
@Override
|
|
public R getBussPdfInfo(Long pkeyId) throws Exception {
|
|
public R getBussPdfInfo(Long pkeyId) throws Exception {
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
- //String file_path = "C:\\Users\\泓创开发\\Desktop";
|
|
|
|
|
|
+ // String file_path = "/Users/hongchuangyanfa/Desktop/";
|
|
|
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
@@ -1089,7 +1090,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
int all = sheet.getRow(0).getLastCellNum();
|
|
int all = sheet.getRow(0).getLastCellNum();
|
|
int mergedCellCnt = sheet.getNumMergedRegions();
|
|
int mergedCellCnt = sheet.getNumMergedRegions();
|
|
- List<Map<String, Integer>> titleList = new ArrayList<>();
|
|
|
|
for (int i = 0; i < mergedCellCnt - 1; i++) {
|
|
for (int i = 0; i < mergedCellCnt - 1; i++) {
|
|
CellRangeAddress mergedCell = sheet.getMergedRegion(i);
|
|
CellRangeAddress mergedCell = sheet.getMergedRegion(i);
|
|
int xx = mergedCell.getNumberOfCells();
|
|
int xx = mergedCell.getNumberOfCells();
|
|
@@ -1100,39 +1100,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
short fontIndex = cell.getCellStyle().getFontIndex();
|
|
short fontIndex = cell.getCellStyle().getFontIndex();
|
|
Font fontAt = workbook.getFontAt(fontIndex);
|
|
Font fontAt = workbook.getFontAt(fontIndex);
|
|
short fontHeightInPoints = fontAt.getFontHeightInPoints();
|
|
short fontHeightInPoints = fontAt.getFontHeightInPoints();
|
|
- if (fontHeightInPoints >= 14) {
|
|
|
|
- Map<String, Integer> titleMap = new HashMap<>();
|
|
|
|
- titleMap.put("index", i);
|
|
|
|
- titleMap.put("x", firsrCol);
|
|
|
|
- titleMap.put("y", fisRow);
|
|
|
|
- String data = cell.getStringCellValue();
|
|
|
|
- if (StringUtils.isNotEmpty(data)) {
|
|
|
|
- titleMap.put("val", 2);
|
|
|
|
- } else {
|
|
|
|
- titleMap.put("val", 1);
|
|
|
|
- }
|
|
|
|
- titleList.add(titleMap);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //添加标题
|
|
|
|
- System.out.println(titleList.size());
|
|
|
|
- if (titleList != null) {
|
|
|
|
- if (titleList.size() == 1) {
|
|
|
|
- Map<String, Integer> titData = titleList.get(0);
|
|
|
|
- if (titData.get("val") == 1) {
|
|
|
|
- Cell cell = sheet.getRow(titData.get("y")).getCell(titData.get("x"));
|
|
|
|
|
|
+ if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow<=8) {
|
|
cell.setCellValue(projectInfo.getProjectName());
|
|
cell.setCellValue(projectInfo.getProjectName());
|
|
- }
|
|
|
|
- } else if (titleList.size() >= 2) {
|
|
|
|
- for (int i = 0; i < titleList.size(); i++) {
|
|
|
|
- Map<String, Integer> titData = titleList.get(i);
|
|
|
|
- if (titData.get("val") == 2) {
|
|
|
|
- Map<String, Integer> titData2 = titleList.get(i - 1);
|
|
|
|
- Cell cell = sheet.getRow(titData2.get("y")).getCell(titData2.get("x"));
|
|
|
|
- cell.setCellValue(projectInfo.getProjectName());
|
|
|
|
- }
|
|
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1219,17 +1189,25 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
|
|
FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
|
|
|
|
|
|
} else if (myData.equals("1") && data.html().indexOf("hc-form-checkbox-group") >= 0) {
|
|
} else if (myData.equals("1") && data.html().indexOf("hc-form-checkbox-group") >= 0) {
|
|
- Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
|
|
|
|
- String exceVal = cell.getStringCellValue().replaceAll(" ", "");
|
|
|
|
- short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
|
- Font fontAt = workbook.getFontAt(fontIndex);
|
|
|
|
- fontAt.setFontName("EUDC");
|
|
|
|
- cell.setCellValue(exceVal.replace("□", "\u2611"));
|
|
|
|
|
|
+ Row row = sheet.getRow(y1 - 1);
|
|
|
|
+ if(row!=null){
|
|
|
|
+ Cell cell = row.getCell(x1 - 1);
|
|
|
|
+ if(cell!=null || ObjectUtils.isNotEmpty(cell)) {
|
|
|
|
+ String exceVal = cell.getStringCellValue().replaceAll(" ", "");
|
|
|
|
+ short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
|
+ Font fontAt = workbook.getFontAt(fontIndex);
|
|
|
|
+ fontAt.setFontName("EUDC");
|
|
|
|
+ cell.setCellValue(exceVal.replace("□", "\u2611"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
|
|
|
|
- cell.setCellValue(myData);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ Row row = sheet.getRow(y1 - 1);
|
|
|
|
+ if(row!=null){
|
|
|
|
+ Cell cell = row.getCell(x1 - 1);
|
|
|
|
+ if(cell!=null || ObjectUtils.isNotEmpty(cell)){
|
|
|
|
+ cell.setCellValue(myData);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1254,18 +1232,26 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
}
|
|
}
|
|
int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
|
|
int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
|
|
|
|
|
|
- Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
|
|
|
|
- cell.setCellValue(e.getId() + "");
|
|
|
|
- short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
|
- Font oldfontAt = workbook.getFontAt(fontIndex);
|
|
|
|
-
|
|
|
|
- Font redFont = workbook.createFont();
|
|
|
|
- redFont.setColor(IndexedColors.WHITE.getIndex());
|
|
|
|
- redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());
|
|
|
|
- redFont.setFontName(oldfontAt.getFontName());
|
|
|
|
- CellStyle cellStyle = workbook.createCellStyle();
|
|
|
|
- cellStyle.setFont(redFont);
|
|
|
|
- cell.setCellStyle(cellStyle);
|
|
|
|
|
|
+ Row row = sheet.getRow(y1 - 1);
|
|
|
|
+ if(row!=null){
|
|
|
|
+ Cell cell = sheet.getRow(y1-1).getCell(x1-1);
|
|
|
|
+ if(cell!=null || ObjectUtils.isNotEmpty(cell)){
|
|
|
|
+ short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
|
+ Font oldfontAt = workbook.getFontAt(fontIndex);
|
|
|
|
+
|
|
|
|
+ Font redFont = workbook.createFont();
|
|
|
|
+ redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
|
|
|
|
+ redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());//设置字体大小
|
|
|
|
+ redFont.setFontName(oldfontAt.getFontName());//设置字体
|
|
|
|
+
|
|
|
|
+ CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
|
|
|
|
+ newStyle.cloneStyleFrom(cell.getCellStyle());
|
|
|
|
+ newStyle.setFont(redFont);
|
|
|
|
+ cell.setCellStyle(newStyle);
|
|
|
|
+ cell.setCellValue(e.getId() + "");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1330,7 +1316,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
@Override
|
|
@Override
|
|
public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
|
|
public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
- //String file_path = "/Users/hongchuangyanfa/Desktop/";
|
|
|
|
|
|
+ // String file_path = "/Users/hongchuangyanfa/Desktop/";
|
|
// 获取有权限的节点信息
|
|
// 获取有权限的节点信息
|
|
List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
List<String> data = new ArrayList<>();
|
|
List<String> data = new ArrayList<>();
|
|
@@ -1361,8 +1347,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
//获取当前填报节点sort
|
|
//获取当前填报节点sort
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
|
|
|
|
|
|
- // 合并pdf集合
|
|
|
|
- String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = " + (ObjectUtil.isNotEmpty(wbsTreeContract) ? wbsTreeContract.getSort() : 0) + " where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
|
|
|
|
|
|
+ // 获取顺序
|
|
|
|
+ int sort =0;
|
|
|
|
+ if(ObjectUtil.isNotEmpty(wbsTreeContract)){
|
|
|
|
+ if(wbsTreeContract.getSort()!=null){
|
|
|
|
+ sort = wbsTreeContract.getSort();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = "+ sort +" where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
|
|
jdbcTemplate.execute(sql);
|
|
jdbcTemplate.execute(sql);
|
|
}
|
|
}
|
|
|
|
|