|
@@ -335,7 +335,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if (Func.isNotEmpty(tableInfoList)) {
|
|
|
try {
|
|
|
/*用来保存日志执行情况*/
|
|
|
- FormulaLog log =new FormulaLog();
|
|
|
+ FormulaLog log = new FormulaLog();
|
|
|
/*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
|
|
|
List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type);
|
|
|
StopWatch stopWatch = new StopWatch();
|
|
@@ -371,11 +371,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
this.formulaService.execute(tec);
|
|
|
tec.after();
|
|
|
} else {
|
|
|
- tec.getLog().put(FormulaLog.OTHER,"没有执行任何公式");
|
|
|
+ tec.getLog().put(FormulaLog.OTHER, "没有执行任何公式");
|
|
|
}
|
|
|
stopWatch.stop();
|
|
|
long totalTime = stopWatch.getTotalTimeMillis();
|
|
|
- log.put(FormulaLog.PF,"公式执行消耗时间:"+totalTime/1000+"秒");
|
|
|
+ log.put(FormulaLog.PF, "公式执行消耗时间:" + totalTime / 1000 + "秒");
|
|
|
StaticLog.info("公式执行用时:{}", totalTime);
|
|
|
updateFormulaLog(log.toJsonString(), pKeyId);
|
|
|
}
|
|
@@ -955,8 +955,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R saveOrUpdateInfo(List<TableInfo> tableInfoList) {
|
|
|
-
|
|
|
+ public R<Object> saveOrUpdateInfo(List<TableInfo> tableInfoList) {
|
|
|
if (ListUtils.isNotEmpty(tableInfoList)) {
|
|
|
//施工资料填报
|
|
|
String pkids = "";
|
|
@@ -1359,10 +1358,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
|
|
|
|
if (wbsTreeContract == null) {
|
|
|
- return R.fail("该数据下无此节点!");
|
|
|
+ return R.fail("未获取到该表单的信息");
|
|
|
}
|
|
|
if (wbsTreeContract.getHtmlUrl() == null) {
|
|
|
- return R.fail("请关联清表!");
|
|
|
+ return R.fail("htmlUrl is null");
|
|
|
}
|
|
|
|
|
|
String pdfPath = file_path + "/pdf//" + pkeyId + ".pdf";
|
|
@@ -1376,7 +1375,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//获取清表信息
|
|
|
ExcelTab excelTab = this.getById(wbsTreeContract.getExcelId());
|
|
|
if (excelTab == null) {
|
|
|
- return R.fail("失败");
|
|
|
+ return R.fail("未获取到清表信息");
|
|
|
}
|
|
|
|
|
|
Map<String, Object> DataInfo = (Map<String, Object>) getBussDataInfo(pkeyId, 0).getData();
|
|
@@ -1403,8 +1402,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
CellRangeAddress mergedCell = sheet.getMergedRegion(i);
|
|
|
int xx = mergedCell.getNumberOfCells();
|
|
|
- if(xx>=all){
|
|
|
- all=xx;
|
|
|
+ if (xx >= all) {
|
|
|
+ all = xx;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1444,7 +1443,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//数据不为空
|
|
|
if (StringUtils.isNotEmpty(wbsTreeContract.getHtmlUrl())) {
|
|
|
InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsTreeContract.getHtmlUrl());
|
|
@@ -1453,7 +1451,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
Element table = doc.select("table").first();
|
|
|
Elements trs = table.select("tr");
|
|
|
- Elements cols = table.select("col");
|
|
|
+ //Elements cols = table.select("col");
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(DataInfo)) {
|
|
|
for (String val : DataInfo.keySet()) {
|
|
@@ -1508,9 +1506,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
Object obj = DataInfo.get(val);
|
|
|
if (obj instanceof String[]) {
|
|
|
String[] dataDate = (String[]) obj;
|
|
|
- if((dataDate[0].trim()).equals((dataDate[1].trim()))){
|
|
|
+ if ((dataDate[0].trim()).equals((dataDate[1].trim()))) {
|
|
|
myData = dataDate[0];
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
myData = dataDate[0] + "-" + dataDate[1].trim();
|
|
|
}
|
|
|
|
|
@@ -1598,7 +1596,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
|
|
|
List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
|
|
|
|
- // table.getElementsByAttribute("dq")
|
|
|
+ // table.getElementsByAttribute("dq")
|
|
|
|
|
|
if (textdictInfos != null && !textdictInfos.isEmpty()) {
|
|
|
for (TextdictInfo e : textdictInfos) {
|
|
@@ -1648,8 +1646,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //输出流
|
|
|
|
|
|
+ //输出流
|
|
|
FileOutputStream outputStream = new FileOutputStream(excelPath);
|
|
|
workbook.write(outputStream);
|
|
|
|
|
@@ -1683,12 +1681,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
tableFileList.sort(Comparator.comparing(TableFile::getType));
|
|
|
|
|
|
List<String> dataListPdf = new ArrayList<>();
|
|
|
- if(wbsTreeContract.getIsBussShow() == 1){
|
|
|
+ if (wbsTreeContract.getIsBussShow() == 1) {
|
|
|
dataListPdf = tableFileList.stream().filter(tableFile -> tableFile.getDomainPdfUrl() != null && (tableFile.getType() == 1 || tableFile.getType() == 2)).map(TableFile::getDomainPdfUrl).collect(Collectors.toList());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
dataListPdf = tableFileList.stream().filter(tableFile -> tableFile.getDomainPdfUrl() != null && tableFile.getType() == 2).map(TableFile::getDomainPdfUrl).collect(Collectors.toList());
|
|
|
}
|
|
|
-// List<String> dataListPdf = tableFileList.stream().filter(tableFile -> tableFile.getDomainPdfUrl() != null && (tableFile.getType() == 1 || tableFile.getType() == 2)).map(TableFile::getDomainPdfUrl).collect(Collectors.toList());
|
|
|
+ //List<String> dataListPdf = tableFileList.stream().filter(tableFile -> tableFile.getDomainPdfUrl() != null && (tableFile.getType() == 1 || tableFile.getType() == 2)).map(TableFile::getDomainPdfUrl).collect(Collectors.toList());
|
|
|
|
|
|
String pdfPath2 = file_path + "/pdf//" + pkeyId + "_2.pdf";
|
|
|
|
|
@@ -1696,7 +1694,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if (tabPdf2.exists()) {
|
|
|
tabPdf2.delete();
|
|
|
}
|
|
|
- String fileUrl ="";
|
|
|
+ String fileUrl = "";
|
|
|
if (dataListPdf.size() > 0) {
|
|
|
FileUtils.mergePdfPublicMethods(dataListPdf, pdfPath2);
|
|
|
BladeFile bladeFile2 = newIOSSClient.uploadFile(pkeyId + "2.pdf", pdfPath2);
|
|
@@ -1708,14 +1706,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
updateWrapper.set("pdf_url", fileUrl);
|
|
|
wbsTreeContractService.update(updateWrapper);
|
|
|
|
|
|
- if (outputStream != null) {
|
|
|
- IoUtil.closeQuietly(outputStream);
|
|
|
- }
|
|
|
- if (exceInp != null) {
|
|
|
- IoUtil.closeQuietly(exceInp);
|
|
|
- }
|
|
|
- return R.data(fileUrl);
|
|
|
+ //关闭流
|
|
|
+ IoUtil.closeQuietly(outputStream);
|
|
|
+ IoUtil.closeQuietly(exceInp);
|
|
|
|
|
|
+ return R.data(fileUrl);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1728,14 +1723,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
for (WbsTreeContract wbsInfo : wbsTreeContractList) {
|
|
|
// 隐藏的不生成pdf
|
|
|
// if (wbsInfo.getIsBussShow() == null || wbsInfo.getIsBussShow() != 2) { //
|
|
|
- if (StringUtils.isNotEmpty(wbsInfo.getPdfUrl())) {
|
|
|
- data.add(wbsInfo.getPdfUrl());
|
|
|
- } else {
|
|
|
- R bussPdfInfo = this.getBussPdfInfo(wbsInfo.getPKeyId());
|
|
|
- if (bussPdfInfo.getCode() == 200) {
|
|
|
- data.add(bussPdfInfo.getData() + "");
|
|
|
- }
|
|
|
+ if (StringUtils.isNotEmpty(wbsInfo.getPdfUrl())) {
|
|
|
+ data.add(wbsInfo.getPdfUrl());
|
|
|
+ } else {
|
|
|
+ R bussPdfInfo = this.getBussPdfInfo(wbsInfo.getPKeyId());
|
|
|
+ if (bussPdfInfo.getCode() == 200) {
|
|
|
+ data.add(bussPdfInfo.getData() + "");
|
|
|
}
|
|
|
+ }
|
|
|
// }
|
|
|
}
|
|
|
}
|