|
@@ -329,9 +329,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
/*用来保存日志执行情况*/
|
|
|
StringBuilder log = new StringBuilder();
|
|
|
/*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
|
|
|
- List<NodeTable> tableAll = createNodeTables(nodeId,tableInfoList.get(0).getContractId(),tableInfoList.get(0).getProjectId(),type);
|
|
|
+ List<NodeTable> tableAll = createNodeTables(nodeId, tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId(), type);
|
|
|
StopWatch stopWatch = new StopWatch();
|
|
|
- List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()), tableInfoList.get(0).getProjectId(), String.valueOf(nodeId),type);
|
|
|
+ List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()), tableInfoList.get(0).getProjectId(), String.valueOf(nodeId), type);
|
|
|
if (Func.isNotEmpty(keyMappers)) {
|
|
|
Map<String, Map<String, String>> coordinateMap = createCoordinateMap(keyMappers);
|
|
|
stopWatch.start("公式处理");
|
|
@@ -354,21 +354,21 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
StaticLog.info("公式执行用时:{}", totalTime);
|
|
|
updateFormulaLog(log, wtc);
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- private List<NodeTable> createNodeTables(Long nodeId,String contractId,String projectId,ExecuteType type){
|
|
|
- List<NodeTable> tableAll =new ArrayList<>();
|
|
|
- if(type.equals(ExecuteType.INSPECTION)){
|
|
|
+ private List<NodeTable> createNodeTables(Long nodeId, String contractId, String projectId, ExecuteType type) {
|
|
|
+ List<NodeTable> tableAll = new ArrayList<>();
|
|
|
+ if (type.equals(ExecuteType.INSPECTION)) {
|
|
|
List<AppWbsTreeContractVO> treeNode = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", contractId, projectId);
|
|
|
- tableAll = BeanUtil.copyProperties(treeNode,NodeTable.class);
|
|
|
- }else if(type.equals(ExecuteType.TESTING)){
|
|
|
+ tableAll = BeanUtil.copyProperties(treeNode, NodeTable.class);
|
|
|
+ } else if (type.equals(ExecuteType.TESTING)) {
|
|
|
List<WbsTreePrivateVO4> wbsTreePrivateVO4s = wbsTreePrivateService.searchNodeAllTable(nodeId.toString(), "1", "9", contractId, projectId, null, null);
|
|
|
- tableAll = BeanUtil.copyProperties(wbsTreePrivateVO4s,NodeTable.class);
|
|
|
+ tableAll = BeanUtil.copyProperties(wbsTreePrivateVO4s, NodeTable.class);
|
|
|
}
|
|
|
return tableAll;
|
|
|
}
|
|
@@ -379,7 +379,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if (!coordinateMap.containsKey(keyMapper.getTableName())) {
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
.eq(WbsTreeContract::getPKeyId, keyMapper.getPkId()));
|
|
|
- if(wbsTreeContract!=null&&Func.isNotBlank(wbsTreeContract.getHtmlUrl())) {
|
|
|
+ if (wbsTreeContract != null && Func.isNotBlank(wbsTreeContract.getHtmlUrl())) {
|
|
|
coordinateMap.put(keyMapper.getTableName(), FormulaUtils.getElementCell(wbsTreeContract.getHtmlUrl()));
|
|
|
}
|
|
|
}
|
|
@@ -548,7 +548,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
URL url = new URL(downloadUri);
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
|
- String dataUrl=file_path + "/excel/" + filecode + ".pdf";
|
|
|
+ String dataUrl = file_path + "/excel/" + filecode + ".pdf";
|
|
|
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
|
|
|
connection.setRequestMethod("GET");
|
|
|
connection.setConnectTimeout(5 * 1000);
|
|
@@ -559,8 +559,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
String tabId = callback.getKey();
|
|
|
if (tabId == null) {
|
|
|
throw new Exception("excel为空");
|
|
|
- }else{
|
|
|
- tabId = tabId.substring(0,tabId.lastIndexOf("_"));
|
|
|
+ } else {
|
|
|
+ tabId = tabId.substring(0, tabId.lastIndexOf("_"));
|
|
|
}
|
|
|
//获取数据库信息
|
|
|
ExcelTab excelTab = baseMapper.selectById(Long.parseLong(tabId));
|
|
@@ -578,7 +578,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
excelTab.setFileUrl(bladeFile.getLink());
|
|
|
baseMapper.updateById(excelTab);
|
|
|
File file = new File(dataUrl);
|
|
|
- if(file.exists()){
|
|
|
+ if (file.exists()) {
|
|
|
file.delete();
|
|
|
}
|
|
|
System.out.println("123456");
|
|
@@ -716,7 +716,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
//获取上传的文件相关
|
|
|
- String sourceUrl = tableInfoList.get(0).getSourceUrl(),
|
|
|
+ String sourceUrl = tableInfoList.get(0).getSourceUrl(),
|
|
|
pdfUrl = tableInfoList.get(0).getPdfUrl(),
|
|
|
firstFileName = tableInfoList.get(0).getFirstFileName();
|
|
|
|
|
@@ -956,32 +956,32 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return dataMap;
|
|
|
}
|
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
- if(file1.exists()){
|
|
|
-
|
|
|
-
|
|
|
- FileInputStream fileInputStream = new FileInputStream(file1);
|
|
|
- String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
- Document doc = Jsoup.parse(htmlString);
|
|
|
- Element table = doc.select("table").first();
|
|
|
- Elements trs = table.select("tr");
|
|
|
-
|
|
|
- for (int i = 0; i <= trs.size() - 1; i++) {
|
|
|
- Element tr = trs.get(i);
|
|
|
- Elements tds = tr.select("td");
|
|
|
- for (int j = 0; j < tds.size(); j++) {
|
|
|
- Element data = tds.get(j);
|
|
|
- if (!data.children().isEmpty()) {
|
|
|
- String keyVal = i + "_" + j;
|
|
|
- String keyname = data.children().get(0).attr("keyname");
|
|
|
- if (StringUtils.isNotEmpty(keyname)) {
|
|
|
- String[] keys = keyname.split("__");
|
|
|
- String datakey = keys[0];
|
|
|
- dataMap.merge(datakey, keyVal, (v1, v2) -> v1 + ";" + v2);
|
|
|
+ if (file1.exists()) {
|
|
|
+
|
|
|
+
|
|
|
+ FileInputStream fileInputStream = new FileInputStream(file1);
|
|
|
+ String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
+ Element table = doc.select("table").first();
|
|
|
+ Elements trs = table.select("tr");
|
|
|
+
|
|
|
+ for (int i = 0; i <= trs.size() - 1; i++) {
|
|
|
+ Element tr = trs.get(i);
|
|
|
+ Elements tds = tr.select("td");
|
|
|
+ for (int j = 0; j < tds.size(); j++) {
|
|
|
+ Element data = tds.get(j);
|
|
|
+ if (!data.children().isEmpty()) {
|
|
|
+ String keyVal = i + "_" + j;
|
|
|
+ String keyname = data.children().get(0).attr("keyname");
|
|
|
+ if (StringUtils.isNotEmpty(keyname)) {
|
|
|
+ String[] keys = keyname.split("__");
|
|
|
+ String datakey = keys[0];
|
|
|
+ dataMap.merge(datakey, keyVal, (v1, v2) -> v1 + ";" + v2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
return dataMap;
|
|
|
}
|
|
|
|
|
@@ -1014,102 +1014,102 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
// 匹配关联
|
|
|
try {
|
|
|
File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
- if(file1.exists()){
|
|
|
+ if (file1.exists()) {
|
|
|
|
|
|
- String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
- Document doc = Jsoup.parse(htmlString);
|
|
|
+ String htmlString = IoUtil.readToString(new FileInputStream(file1));
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
|
|
|
- // 解析
|
|
|
- // 模糊匹配
|
|
|
- Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
- Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
|
|
|
- Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
|
|
|
- sgtitle.addAll(sgtitle1);
|
|
|
+ // 解析
|
|
|
+ // 模糊匹配
|
|
|
+ Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
|
|
|
+ Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
|
|
|
+ Elements sgtitle1 = doc.select("el-input[placeholder=安装单位]");
|
|
|
+ sgtitle.addAll(sgtitle1);
|
|
|
|
|
|
- Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
|
|
|
- Elements htdtitle1 = doc.select("el-input[placeholder~=合同名称.*]");
|
|
|
- htdtitle.addAll(htdtitle1);
|
|
|
+ Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
|
|
|
+ Elements htdtitle1 = doc.select("el-input[placeholder~=合同名称.*]");
|
|
|
+ htdtitle.addAll(htdtitle1);
|
|
|
|
|
|
- Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
|
|
|
+ Elements jltitle = doc.select("el-input[placeholder~=监理单位.*]");
|
|
|
|
|
|
- Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
- Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
|
|
|
- bhtitle.addAll(bhtitle1);
|
|
|
+ Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
|
|
|
+ Elements bhtitle1 = doc.select("el-input[placeholder~=合同编号.*]");
|
|
|
+ bhtitle.addAll(bhtitle1);
|
|
|
|
|
|
|
|
|
- Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
+ Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
|
|
|
|
|
|
|
|
|
- // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
+ // Elements title = doc.select("el-input[placeholder~=^编号]");
|
|
|
|
|
|
- /**
|
|
|
- * 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
|
- * 监理单位:引用监理单位名称
|
|
|
- * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
- *
|
|
|
- * 施工单位:施工单位 和 安装单位
|
|
|
- *
|
|
|
- */
|
|
|
- ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
|
|
|
- // 施工单位名称
|
|
|
- if (dwtitle.size() >= 1) {
|
|
|
- int y = Integer.parseInt(dwtitle.attr("trindex"));
|
|
|
- if (y <= 10) {
|
|
|
- reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 承包单位 承包单位、施工单位:引用施工单位名称 ,
|
|
|
+ * 监理单位:引用监理单位名称
|
|
|
+ * 合同段、所属建设项目(合同段):引用合同段编号
|
|
|
+ *
|
|
|
+ * 施工单位:施工单位 和 安装单位
|
|
|
+ *
|
|
|
+ */
|
|
|
+ ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
|
|
|
+ // 施工单位名称
|
|
|
+ if (dwtitle.size() >= 1) {
|
|
|
+ int y = Integer.parseInt(dwtitle.attr("trindex"));
|
|
|
+ if (y <= 10) {
|
|
|
+ reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- if (sgtitle.size() >= 1) {
|
|
|
- int y = Integer.parseInt(sgtitle.attr("trindex"));
|
|
|
- if (y <= 10) {
|
|
|
- reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
}
|
|
|
- }
|
|
|
+ if (sgtitle.size() >= 1) {
|
|
|
+ int y = Integer.parseInt(sgtitle.attr("trindex"));
|
|
|
+ if (y <= 10) {
|
|
|
+ reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- // 合同段名称
|
|
|
- if (htdtitle.size() >= 1) {
|
|
|
- for (Element element : htdtitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 8) {
|
|
|
- reData.put(element.attr("keyName"), contractInfo.getContractNumber());
|
|
|
+ // 合同段名称
|
|
|
+ if (htdtitle.size() >= 1) {
|
|
|
+ for (Element element : htdtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 8) {
|
|
|
+ reData.put(element.attr("keyName"), contractInfo.getContractNumber());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- // 监理单位名称
|
|
|
- if (jltitle.size() >= 1) {
|
|
|
+ // 监理单位名称
|
|
|
+ if (jltitle.size() >= 1) {
|
|
|
|
|
|
- for (Element element : jltitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 10) {
|
|
|
- reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
+ for (Element element : jltitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 10) {
|
|
|
+ reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- //获取父节点划分编号
|
|
|
- WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
|
|
|
- .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
|
|
|
- // 编号
|
|
|
- if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
|
|
|
- for (Element element : bhtitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 10) {
|
|
|
- reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
|
|
|
+ //获取父节点划分编号
|
|
|
+ WbsTreeContract node = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
+ .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
|
|
|
+ .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
|
|
|
+ // 编号
|
|
|
+ if (bhtitle.size() >= 1 && contractInfo.getIsReferenceNumber() == 1) {
|
|
|
+ for (Element element : bhtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 10) {
|
|
|
+ reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- // 项目名称
|
|
|
- if (xmtitle.size() >= 1) {
|
|
|
- for (Element element : xmtitle) {
|
|
|
- int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trindex <= 6) {
|
|
|
- ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
|
|
|
- reData.put(element.attr("keyName"), projectInfo.getProjectName());
|
|
|
+ // 项目名称
|
|
|
+ if (xmtitle.size() >= 1) {
|
|
|
+ for (Element element : xmtitle) {
|
|
|
+ int trindex = Integer.parseInt(element.attr("trindex"));
|
|
|
+ if (trindex <= 6) {
|
|
|
+ ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
|
|
|
+ reData.put(element.attr("keyName"), projectInfo.getProjectName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
} catch (FileNotFoundException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -1170,7 +1170,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
String[] strings = StringUtils.strip(tabData[0], "[]").split(",");
|
|
|
|
|
|
reData.put(key + "__" + tabData[1], strings);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
|
}
|
|
@@ -1332,7 +1332,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
x1 = 1;
|
|
|
}
|
|
|
String myData = DataInfo.get(val) + "";
|
|
|
- if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)){
|
|
|
+ if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
|
|
sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
|
|
|
SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
|
|
@@ -1356,13 +1356,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(myData.indexOf("lang.String")>=0){
|
|
|
- String[] dataDate = (String[]) DataInfo.get(val);
|
|
|
- myData = dataDate[0]+" - "+dataDate[1].trim();
|
|
|
+ if (myData.indexOf("lang.String") >= 0) {
|
|
|
+ String[] dataDate = (String[]) DataInfo.get(val);
|
|
|
+ myData = dataDate[0] + " - " + dataDate[1].trim();
|
|
|
}
|
|
|
|
|
|
//https:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1
|
|
|
- if ((myData.indexOf("https") >= 0 ||myData.indexOf("http") >= 0) && myData.indexOf("aliyuncs") >= 0) {
|
|
|
+ if ((myData.indexOf("https") >= 0 || myData.indexOf("http") >= 0) && myData.indexOf("aliyuncs") >= 0) {
|
|
|
|
|
|
InputStream imageIn = CommonUtil.getOSSInputStream(myData);
|
|
|
|
|
@@ -2036,7 +2036,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));
|
|
|
}
|
|
|
|
|
|
- org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(CommonUtil.getOSSInputStream(excelTab.getFileUrl()));
|
|
|
+ org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(Objects.requireNonNull(CommonUtil.getOSSInputStream(excelTab.getFileUrl())));
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
sheet.setForceFormulaRecalculation(true);
|
|
|
Header header = sheet.getHeader();
|
|
@@ -2386,7 +2386,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//没有excel表单的不生成pdf
|
|
|
if (StringUtils.isNotEmpty(record.getHtmlUrl())) {
|
|
|
//生成记录表pdf
|
|
|
- String bussPdfInfo = this.getBussPDFTrial(record.getPKeyId(), contractId, id, recordPageNumber++, recordPageNumberCount,null);
|
|
|
+ String bussPdfInfo = this.getBussPDFTrial(record.getPKeyId(), contractId, id, recordPageNumber++, recordPageNumberCount, null);
|
|
|
if (StringUtils.isNotEmpty(bussPdfInfo)) {
|
|
|
dataPdfUrls.add(bussPdfInfo);
|
|
|
}
|
|
@@ -2402,21 +2402,19 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
FileUtils.mergePdfPublicMethods(dataPdfUrls, listPdf);
|
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
|
|
|
-
|
|
|
- //获取试验记录id的试验项目名称
|
|
|
- String trialProjectName = baseMapper.selectTrialRecordOne(id);
|
|
|
-
|
|
|
- //修改合并后的pdf路径
|
|
|
- String querySql = "select id from u_information_query where classify ='" + classify + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
|
|
|
- List<InformationQuery> query = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
- if (query.size() > 0) {
|
|
|
- String updateSql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + (StringUtils.isNotEmpty(trialProjectName) ? trialProjectName : "") + "' where classify='" + classify + "' and wbs_id='" + id + "' and contract_id ='" + contractId + "'";
|
|
|
- jdbcTemplate.execute(updateSql);
|
|
|
- } else {
|
|
|
- informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink(), StringUtils.isNotEmpty(trialProjectName) ? trialProjectName : "");
|
|
|
+ if (bladeFile != null) {
|
|
|
+ //修改合并后的pdf路径
|
|
|
+ String querySql = "select id from u_information_query where classify ='" + classify + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
|
|
|
+ List<InformationQuery> query = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
+ if (query.size() > 0) {
|
|
|
+ String updateSql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='" + (StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : "") + "' where classify='" + classify + "' and wbs_id='" + id + "' and contract_id ='" + contractId + "'";
|
|
|
+ jdbcTemplate.execute(updateSql);
|
|
|
+ } else {
|
|
|
+ informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink(), StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : "");
|
|
|
+ }
|
|
|
+ return bladeFile.getLink();
|
|
|
}
|
|
|
-
|
|
|
- return bladeFile.getLink();
|
|
|
+ return "";
|
|
|
}
|
|
|
|
|
|
/**
|