|
@@ -65,10 +65,7 @@ import org.springblade.manager.formula.NodeTable;
|
|
|
import org.springblade.manager.formula.impl.TableElementConverter;
|
|
|
import org.springblade.manager.mapper.ExcelTabMapper;
|
|
|
import org.springblade.manager.service.*;
|
|
|
-import org.springblade.manager.utils.FileUtils;
|
|
|
-import org.springblade.manager.utils.PdfAddContextUtils;
|
|
|
-import org.springblade.manager.utils.PdfAddimgUtil;
|
|
|
-import org.springblade.manager.utils.RandomNumberHolder;
|
|
|
+import org.springblade.manager.utils.*;
|
|
|
import org.springblade.manager.vo.*;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
@@ -88,6 +85,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
|
|
|
|
|
import java.io.*;
|
|
|
+import java.net.URL;
|
|
|
import java.nio.file.Files;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -130,6 +128,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
private final TableInfoServiceImpl tableInfoService;
|
|
|
private final INodeBaseInfoService nodeBaseInfoService;
|
|
|
private final TrialSelfInspectionRecordClient trialSelfInspectionRecordClient;
|
|
|
+ private final WbsTreeContractOldHtmlService wbsTreeContractOldHtmlService;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -852,7 +851,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
int status = callback.getStatus();
|
|
|
int saved = 0;
|
|
|
//status=6,表示点击保存按钮 2 关闭保存
|
|
|
- /*if (status == 3 || status == 6) //MustSave, Corrupted
|
|
|
+ if (status == 3 || status == 6) //MustSave, Corrupted
|
|
|
{
|
|
|
//获取url
|
|
|
String downloadUri = callback.getUrl();
|
|
@@ -901,7 +900,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
editCallback.setError(1);
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }*/
|
|
|
+ }
|
|
|
return editCallback;
|
|
|
}
|
|
|
|
|
@@ -1329,7 +1328,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//保存操作记录
|
|
|
this.operationLogClient.saveUserOperationLog(1, "资料填报", "工序填报页面", json);
|
|
|
// 更新redis
|
|
|
- informationQueryClient.AsyncWbsTree(wbsTreeContractByP.getParentId() + "", wbsTreeContractByP.getParentId() + "", wbsTreeContractByP.getContractId(), "", "1");
|
|
|
+// informationQueryClient.AsyncWbsTree(wbsTreeContractByP.getParentId() + "", wbsTreeContractByP.getParentId() + "", wbsTreeContractByP.getContractId(), "", "1");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return R.fail("操作失败");
|
|
@@ -1445,6 +1444,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
String keyNameList="";
|
|
|
// 匹配关联
|
|
|
try {
|
|
|
+ // 这里先从旧html表中获取 如果有用旧的html m_wbs_tree_contract_old_html
|
|
|
+ WbsTreeContractOldHtml oldHtml = wbsTreeContractOldHtmlService.getOne(Wrappers.<WbsTreeContractOldHtml>lambdaQuery()
|
|
|
+ .eq(WbsTreeContractOldHtml::getContractFormId, pkeyId)
|
|
|
+ .eq(WbsTreeContractOldHtml::getIsDeleted, 0)
|
|
|
+ .last("limit 1"));
|
|
|
+ if(oldHtml != null){
|
|
|
+ wbsTreeContract.setHtmlUrl(oldHtml.getOldHtmlUrl());
|
|
|
+ }
|
|
|
+
|
|
|
InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsTreeContract.getHtmlUrl());
|
|
|
String htmlString = IoUtil.readToString(inputStreamByUrl);
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
@@ -5532,6 +5540,48 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
jdbcTemplate.update(sql);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Async("taskExecutor1")
|
|
|
+ public void synchronizedPdf(List<TableInfo> tableInfoList, String nodeId, String classify, String contractId, String projectId) {
|
|
|
+ try {
|
|
|
+ List<String> errorPKeyIds = new ArrayList<>();
|
|
|
+ //单个pdf加载
|
|
|
+ if (tableInfoList != null) {
|
|
|
+ tableInfoList.parallelStream().forEach(tableInfo -> {
|
|
|
+ R bussPdfInfo = null;
|
|
|
+ try {
|
|
|
+ bussPdfInfo = this.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isEmpty(bussPdfInfo) || bussPdfInfo.getCode() != 200) {
|
|
|
+ //如果返回的单张pdfUrl为空,那么表示发生异常,返回异常信息
|
|
|
+ errorPKeyIds.add(tableInfo.getPkeyId());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //发生异常后直接返回,不进行合并
|
|
|
+// if (errorPKeyIds.size() > 0) {
|
|
|
+// List<AppWbsTreeContractVO> errorTabs = new LinkedList<>();
|
|
|
+// for (AppWbsTreeContractVO appWbsTreeContractVO : tableAll) {
|
|
|
+// if (errorPKeyIds.contains(appWbsTreeContractVO.getPKeyId().toString())) {
|
|
|
+// errorTabs.add(appWbsTreeContractVO);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (errorTabs.size() > 0) {
|
|
|
+// List<String> names = errorTabs.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList());
|
|
|
+// return R.fail("以下的表在生成pdf文件时发生了异常【" + StringUtils.join(names, "、") + "】");
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ //合并pdf加载
|
|
|
+ this.getBussPdfs(nodeId, classify, contractId, projectId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new ServiceException("问题");
|
|
|
+ }
|
|
|
+ }
|
|
|
@Override
|
|
|
public void synPdfKeyInfo(String nodeId, String classify, String contractId, String projectId) throws Exception {
|
|
|
// 获取有权限的节点信息
|