|
@@ -2340,11 +2340,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// 组装电签设置
|
|
// 组装电签设置
|
|
QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.select("col_key", "id");
|
|
queryWrapper.select("col_key", "id");
|
|
- queryWrapper.in("type", 2);
|
|
|
|
|
|
+ queryWrapper.in("type", 2, 6);
|
|
queryWrapper.eq("tab_id", wbsTreePrivate.getPKeyId());
|
|
queryWrapper.eq("tab_id", wbsTreePrivate.getPKeyId());
|
|
|
|
|
|
List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
|
|
@@ -2405,11 +2404,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
|
|
BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
|
|
|
|
|
|
if (bladeFile != null) {
|
|
if (bladeFile != null) {
|
|
- //附件
|
|
|
|
- TableFile tableFile1 = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getType, 1)).stream().findAny().orElse(null);
|
|
|
|
|
|
+ //附件,type=1表示表单,如果表单pdf存在就修改最新pdf,没有就新增
|
|
|
|
+ TableFile tableFile1 = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getType, 1).eq(TableFile::getTrialRecordId, id)).stream().findAny().orElse(null);
|
|
if (tableFile1 != null) {
|
|
if (tableFile1 != null) {
|
|
- /*tableFile1.setDomainPdfUrl(bladeFile.getLink());
|
|
|
|
- tableFileService.saveOrUpdate(tableFile1);*/
|
|
|
|
tableFileService.update(Wrappers.<TableFile>lambdaUpdate().set(TableFile::getDomainPdfUrl, bladeFile.getLink()).eq(TableFile::getId, tableFile1.getId()));
|
|
tableFileService.update(Wrappers.<TableFile>lambdaUpdate().set(TableFile::getDomainPdfUrl, bladeFile.getLink()).eq(TableFile::getId, tableFile1.getId()));
|
|
} else {
|
|
} else {
|
|
TableFile tableFile = new TableFile();
|
|
TableFile tableFile = new TableFile();
|
|
@@ -2425,23 +2422,22 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
tableFileService.saveOrUpdate(tableFile);
|
|
tableFileService.saveOrUpdate(tableFile);
|
|
}
|
|
}
|
|
|
|
|
|
- //获取当前试验记录的中的元素表的附件文件
|
|
|
|
|
|
+ //获取当前试验记录的中的元素表附件文件,所有的包括表单pdf+附件pdf
|
|
List<TableFile> tableFileList = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getTrialRecordId, id));
|
|
List<TableFile> tableFileList = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId + "").eq(TableFile::getTrialRecordId, id));
|
|
- if (tableFileList.size() > 0) {
|
|
|
|
|
|
+ if (tableFileList.size() >= 2) { //表示有附件信息,重新合并
|
|
tableFileList.sort(Comparator.comparing(TableFile::getType));
|
|
tableFileList.sort(Comparator.comparing(TableFile::getType));
|
|
List<String> dataListPdf = tableFileList.stream().filter(tableFile ->
|
|
List<String> dataListPdf = tableFileList.stream().filter(tableFile ->
|
|
tableFile.getDomainPdfUrl() != null
|
|
tableFile.getDomainPdfUrl() != null
|
|
&& (tableFile.getType() == 1 || tableFile.getType() == 2)
|
|
&& (tableFile.getType() == 1 || tableFile.getType() == 2)
|
|
).map(TableFile::getDomainPdfUrl).collect(Collectors.toList());
|
|
).map(TableFile::getDomainPdfUrl).collect(Collectors.toList());
|
|
|
|
|
|
|
|
+ //合并
|
|
String pdfPath2 = file_path + "/pdf//" + pkeyId + "_2.pdf";
|
|
String pdfPath2 = file_path + "/pdf//" + pkeyId + "_2.pdf";
|
|
-
|
|
|
|
File tabPdf2 = ResourceUtil.getFile(pdfPath2);
|
|
File tabPdf2 = ResourceUtil.getFile(pdfPath2);
|
|
if (tabPdf2.exists()) {
|
|
if (tabPdf2.exists()) {
|
|
tabPdf2.delete();
|
|
tabPdf2.delete();
|
|
}
|
|
}
|
|
FileUtils.mergePdfPublicMethods(dataListPdf, pdfPath2);
|
|
FileUtils.mergePdfPublicMethods(dataListPdf, pdfPath2);
|
|
-
|
|
|
|
BladeFile bladeFile2 = newIOSSClient.uploadFile(pkeyId + "2.pdf", pdfPath2);
|
|
BladeFile bladeFile2 = newIOSSClient.uploadFile(pkeyId + "2.pdf", pdfPath2);
|
|
if (bladeFile2 != null) {
|
|
if (bladeFile2 != null) {
|
|
bladeFile.setLink(bladeFile2.getLink());
|
|
bladeFile.setLink(bladeFile2.getLink());
|
|
@@ -2527,7 +2523,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
String querySql = "select id from u_information_query where classify ='" + classify + "' and wbs_id ='" + id + "' and contract_id ='" + contractId + "'";
|
|
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));
|
|
List<InformationQuery> query = jdbcTemplate.query(querySql, new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
if (query.size() > 0) {
|
|
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 + "'";
|
|
|
|
|
|
+ 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);
|
|
jdbcTemplate.execute(updateSql);
|
|
} else {
|
|
} else {
|
|
informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink(), StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : "");
|
|
informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink(), StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : "");
|