|
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
|
|
@@ -86,6 +87,9 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
import java.io.*;
|
|
|
import java.net.URLEncoder;
|
|
|
+import java.nio.file.Files;
|
|
|
+import java.nio.file.Path;
|
|
|
+import java.nio.file.StandardCopyOption;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
@@ -112,6 +116,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
private final ContractClient contractClient;
|
|
|
|
|
|
private final WbsTreeContractClient wbsTreeContractClient;
|
|
|
+ private final WbsTreeContractOldHtmlClient wbsTreeContractOldHtmlClient;
|
|
|
|
|
|
private final WbsTreePrivateClient wbsTreePrivateClient;
|
|
|
|
|
@@ -157,6 +162,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
private final IRecycleBinService recycleBinService;
|
|
|
private final WbsTreeContractStatisticsClientImpl wbsTreeContractStatisticsClient;
|
|
|
+ private final IRecycleBinInfoService recycleBinInfoService;
|
|
|
+ private final INodeBaseInfoServiceClient nodeBaseInfoServiceClient;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -215,7 +222,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String sgSuffix="";
|
|
|
String jlSuffix="";
|
|
|
if(queryList.size()>0){
|
|
|
- String sql1="Select sg_suffix,jl_suffix from m_project_info where id="+queryList.get(0).getProjectId()+" and is_deleted=0";
|
|
|
+ String sql1="Select sg_suffix,jl_suffix,template_type from m_project_info where id="+queryList.get(0).getProjectId()+" and is_deleted=0";
|
|
|
List<ProjectInfo> projectInfos = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(ProjectInfo.class));
|
|
|
if(projectInfos.size()>0){
|
|
|
sgSuffix=projectInfos.get(0).getSgSuffix()==null?"":projectInfos.get(0).getSgSuffix();
|
|
@@ -226,7 +233,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
String sql="select * from m_wbs_tree_contract where p_key_id="+query.getWbsId()+" and is_deleted=0";
|
|
|
WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
if(dto.getType()==1){
|
|
|
- result=wbsParamClient.createFileTitle(contract);
|
|
|
+ R<List<String>> nameRuleList = wbsParamClient.getNameRuleByPkeyId(contract.getPKeyId(), Long.valueOf(contract.getProjectId()));
|
|
|
+ String nameRule = "";
|
|
|
+ if (nameRuleList != null && nameRuleList.getData() != null && !nameRuleList.getData().isEmpty()) {
|
|
|
+ nameRule = String.join("-", nameRuleList.getData());
|
|
|
+ }
|
|
|
+ if(projectInfos.get(0)!=null&&projectInfos.get(0).getTemplateType()==2){
|
|
|
+ result = nodeBaseInfoServiceClient.getNameRuleByRule(nameRule, contract.getPKeyId()+"");
|
|
|
+ }else {
|
|
|
+ result=wbsParamClient.createFileTitle(contract);
|
|
|
+ }
|
|
|
}else {
|
|
|
result=nodeNameMap.get(query.getId());
|
|
|
//同时修改工程划分节点命名规则
|
|
@@ -260,6 +276,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
return R.status(this.informationQueryService.updateBatchById(queryList));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public List<String> getNameRuleByPkeyId(Long pKeyId, Long projectId) {
|
|
|
NameRuleVo vo = new NameRuleVo();
|
|
|
String sql2="select * from m_wbs_param where node_id="+pKeyId+" and type=200"+" and is_deleted=0 and k='FILE_TITLE'";
|
|
@@ -391,13 +408,14 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if(StringUtils.isEmpty(dto1.getNameRule())){
|
|
|
throw new ServiceException("请输入题名规则");
|
|
|
}
|
|
|
- String sql="select p_key_id,ancestors_p_id from m_wbs_tree_contract where p_key_id="+dto1.getWbsId()+" and is_deleted=0";
|
|
|
- WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
- String result="";
|
|
|
- if(contract!=null){
|
|
|
- result= createFileTitle(contract, dto1.getNameRule());
|
|
|
- }
|
|
|
- list.add(new PreviewNodeNameVO1(dto1.getWbsId(),result));
|
|
|
+ String result=nodeBaseInfoServiceClient.getNameRuleByRule(dto1.getNameRule(),dto1.getWbsId());
|
|
|
+// String sql="select p_key_id,ancestors_p_id from m_wbs_tree_contract where p_key_id="+dto1.getWbsId()+" and is_deleted=0";
|
|
|
+// WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
+// String result="";
|
|
|
+// if(contract!=null){
|
|
|
+// result= createFileTitle(contract, dto1.getNameRule());
|
|
|
+// }
|
|
|
+ list.add(new PreviewNodeNameVO1(dto1.getWbsId(),result.toString()));
|
|
|
}
|
|
|
return R.data(list);
|
|
|
}
|
|
@@ -412,7 +430,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
String result="";
|
|
|
if(nameRules!=null){
|
|
|
- result= createFileTitle(contract, String.join("-", nameRules));
|
|
|
+ result = nodeBaseInfoServiceClient.getNameRuleByRule(String.join("-", nameRules), contract.getPKeyId() + "");
|
|
|
}
|
|
|
list.add(new PreviewNodeNameVO(dto.getWbsId(),result,nameRules));
|
|
|
}
|
|
@@ -1212,8 +1230,48 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
return R.data(300, false, "未查询到填报信息,上报失败");
|
|
|
}
|
|
|
} else { //质检
|
|
|
+ //记录选中节点的所有表单旧html
|
|
|
+ List<Long> list = Arrays.stream(startTaskVO.getIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
+ List<WbsTreeContract> wbsTreeContracts = wbsTreeContractClient.queryListByPIds(list);
|
|
|
+
|
|
|
+
|
|
|
businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, startTaskVO.getIds().replaceAll(",", "")).eq(InformationQuery::getClassify, startTaskVO.getClassify().toString()).eq(InformationQuery::getType, 1).last("order by id desc limit 1"));
|
|
|
if (businessData != null) {
|
|
|
+
|
|
|
+ //处理html 复制之后记录在新表中w
|
|
|
+ if (CollectionUtils.isNotEmpty(wbsTreeContracts)) {
|
|
|
+ List<WbsTreeContractOldHtml> data = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ for (WbsTreeContract wbsTreeContract : wbsTreeContracts) {
|
|
|
+ ExcelTab byId = excelTabClient.getById(String.valueOf(wbsTreeContract.getExcelId()));
|
|
|
+ WbsTreeContractOldHtml oldHtml = new WbsTreeContractOldHtml();
|
|
|
+ oldHtml.setId(SnowFlakeUtil.getId());
|
|
|
+ oldHtml.setCreateUser(getUser().getUserId());
|
|
|
+ String htmlUrl = wbsTreeContract.getHtmlUrl();
|
|
|
+ // 获取或下载文件
|
|
|
+ Path sourcePath = FileUtils.getOrDownloadFile(htmlUrl);
|
|
|
+ // 生成副本路径
|
|
|
+ Path copyPath = FileUtils.generateCopyPath(sourcePath,wbsTreeContract.getPKeyId());
|
|
|
+ // 执行复制操作(覆盖已存在的文件)
|
|
|
+ Files.copy(sourcePath, copyPath, StandardCopyOption.REPLACE_EXISTING);
|
|
|
+
|
|
|
+ oldHtml.setContractFormId(wbsTreeContract.getPKeyId());
|
|
|
+ oldHtml.setOldHtmlUrl(copyPath.toFile().getAbsolutePath());
|
|
|
+ //记录历史excel路径
|
|
|
+ oldHtml.setOldExcelUrl(byId.getFileUrl());
|
|
|
+ data.add(oldHtml);
|
|
|
+ }
|
|
|
+ List<Long> collect = data.stream().map(WbsTreeContractOldHtml::getContractFormId).collect(Collectors.toList());
|
|
|
+ //删除旧记录
|
|
|
+ wbsTreeContractOldHtmlClient.deleteByContractFormIds(collect);
|
|
|
+
|
|
|
+ wbsTreeContractOldHtmlClient.save(data);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new ServiceException(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//设置业务数据ID
|
|
|
startTaskVO.setIds(businessData.getId().toString());
|
|
|
return this.batchTask(startTaskVO);
|
|
@@ -1961,11 +2019,14 @@ public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
|
|
|
|
|
|
//旧节点的pkeyId和新节点的pkeyId
|
|
|
Map<Long, Long> oldPKeyIdToNewPKeyIdMap = new HashMap<>();
|
|
|
+ Map<Long, Long> oldIdToNewIdMap = new HashMap<>();
|
|
|
//节点和表的id 与 节点/表 实体类
|
|
|
Map<String, WbsTreeContract> nodeMap = new HashMap<>();
|
|
|
|
|
|
nodeChildAll.forEach(node -> {
|
|
|
- oldPKeyIdToNewPKeyIdMap.put(node.getPKeyId(),SnowFlakeUtil.getId());
|
|
|
+ Long id = SnowFlakeUtil.getId();
|
|
|
+ oldPKeyIdToNewPKeyIdMap.put(node.getPKeyId(), id);
|
|
|
+ oldIdToNewIdMap.put(node.getId(), id);
|
|
|
oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId());
|
|
|
nodeMap.put(node.getId().toString(), node);
|
|
|
});
|
|
@@ -1981,53 +2042,55 @@ public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
|
|
|
.distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
//表名集合转逗号拼接的字符串
|
|
|
- String inClausePlaceholders = String.join(",", Collections.nCopies(tabNames.size(), "?"));
|
|
|
- String sql = "SELECT table_name AS queryType, GROUP_CONCAT(COLUMN_name) AS ancestors " +
|
|
|
- "FROM information_schema.COLUMNS WHERE table_name IN (" + inClausePlaceholders + ") " +
|
|
|
- "GROUP BY table_name";
|
|
|
- Object[] params = tabNames.toArray();
|
|
|
- //数据库中查询 表与表对应的列名
|
|
|
- List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, params);
|
|
|
-
|
|
|
- //表名集合转Map key=表名 value=表对应的数据集合
|
|
|
- Map<String, List<WbsTreeContract>> tabsGroup = nodeChildAll.stream()
|
|
|
- .filter(f -> f.getType() == 2 && ObjectUtil.isNotEmpty(f.getInitTableName()))
|
|
|
- .collect(Collectors.groupingBy(WbsTreeContract::getInitTableName));
|
|
|
-
|
|
|
- Set<Long> continuePkeyIds = new HashSet<>();
|
|
|
- for (Map<String, Object> result : results) {
|
|
|
- String tabName = (String) result.get("queryType");
|
|
|
- String col = (String) result.get("ancestors");
|
|
|
- if (ObjectUtil.isEmpty(col) || ObjectUtil.isEmpty(tabName)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- //字段集合 过滤掉不存在指定字段的表
|
|
|
- List<String> filteredList = Arrays.stream(col.split(","))
|
|
|
- .filter(value -> !value.equals("id") && !value.equals("p_key_id") && !value.equals("group_id"))
|
|
|
- .collect(Collectors.toList());
|
|
|
- //过滤之后的字段集合
|
|
|
- String keys = StringUtils.join(filteredList, ",");
|
|
|
- //根据表明查询指定数据集合
|
|
|
- List<WbsTreeContract> tabs = tabsGroup.get(tabName);
|
|
|
- for (WbsTreeContract tab : tabs) {
|
|
|
- // 在复制数据时,测量记录表 的数据不需要复制
|
|
|
- if(tab.getType()==2 && tab.getTableType()==6){
|
|
|
+ if (!tabNames.isEmpty()) {
|
|
|
+ String inClausePlaceholders = String.join(",", Collections.nCopies(tabNames.size(), "?"));
|
|
|
+ String sql = "SELECT table_name AS queryType, GROUP_CONCAT(COLUMN_name) AS ancestors " +
|
|
|
+ "FROM information_schema.COLUMNS WHERE table_name IN (" + inClausePlaceholders + ") " +
|
|
|
+ "GROUP BY table_name";
|
|
|
+ Object[] params = tabNames.toArray();
|
|
|
+ //数据库中查询 表与表对应的列名
|
|
|
+ List<Map<String, Object>> results = jdbcTemplate.queryForList(sql, params);
|
|
|
+
|
|
|
+ //表名集合转Map key=表名 value=表对应的数据集合
|
|
|
+ Map<String, List<WbsTreeContract>> tabsGroup = nodeChildAll.stream()
|
|
|
+ .filter(f -> f.getType() == 2 && ObjectUtil.isNotEmpty(f.getInitTableName()))
|
|
|
+ .collect(Collectors.groupingBy(WbsTreeContract::getInitTableName));
|
|
|
+
|
|
|
+ Set<Long> continuePkeyIds = new HashSet<>();
|
|
|
+ for (Map<String, Object> result : results) {
|
|
|
+ String tabName = (String) result.get("queryType");
|
|
|
+ String col = (String) result.get("ancestors");
|
|
|
+ if (ObjectUtil.isEmpty(col) || ObjectUtil.isEmpty(tabName)) {
|
|
|
continue;
|
|
|
}
|
|
|
- //根据字段
|
|
|
- String dataSql = "SELECT " + keys + " FROM " + tabName + " WHERE p_key_id = " + tab.getPKeyId() + " LIMIT 1;";
|
|
|
- try {
|
|
|
- //查询指定表指定表节点的数据
|
|
|
- Map<String, Object> resultMap = jdbcTemplate.queryForMap(dataSql);
|
|
|
- //删除空值
|
|
|
- resultMap.values().removeIf(value -> value == null || (value instanceof String && ObjectUtil.isEmpty(value)));
|
|
|
- colMaps.put(tab.getPKeyId(), resultMap);
|
|
|
- } catch (EmptyResultDataAccessException e) {
|
|
|
- continuePkeyIds.add(tab.getPKeyId());
|
|
|
+ //字段集合 过滤掉不存在指定字段的表
|
|
|
+ List<String> filteredList = Arrays.stream(col.split(","))
|
|
|
+ .filter(value -> !value.equals("id") && !value.equals("p_key_id") && !value.equals("group_id"))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ //过滤之后的字段集合
|
|
|
+ String keys = StringUtils.join(filteredList, ",");
|
|
|
+ //根据表明查询指定数据集合
|
|
|
+ List<WbsTreeContract> tabs = tabsGroup.get(tabName);
|
|
|
+ for (WbsTreeContract tab : tabs) {
|
|
|
+ // 在复制数据时,测量记录表 的数据不需要复制
|
|
|
+ if(tab.getType()==2 && tab.getTableType()==6){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //根据字段
|
|
|
+ String dataSql = "SELECT " + keys + " FROM " + tabName + " WHERE p_key_id = " + tab.getPKeyId() + " LIMIT 1;";
|
|
|
+ try {
|
|
|
+ //查询指定表指定表节点的数据
|
|
|
+ Map<String, Object> resultMap = jdbcTemplate.queryForMap(dataSql);
|
|
|
+ //删除空值
|
|
|
+ resultMap.values().removeIf(value -> value == null || (value instanceof String && ObjectUtil.isEmpty(value)));
|
|
|
+ colMaps.put(tab.getPKeyId(), resultMap);
|
|
|
+ } catch (EmptyResultDataAccessException e) {
|
|
|
+ continuePkeyIds.add(tab.getPKeyId());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ logger.info("以下元素表没有获取到对应实体表数据,已跳过 ===> 表pKeyId:[{}]", StringUtils.join(continuePkeyIds, ","));
|
|
|
}
|
|
|
- logger.info("以下元素表没有获取到对应实体表数据,已跳过 ===> 表pKeyId:[{}]", StringUtils.join(continuePkeyIds, ","));
|
|
|
}
|
|
|
// 节点+表节点
|
|
|
for (WbsTreeContract nodeOld : nodeChildAll) {
|
|
@@ -2080,7 +2143,7 @@ public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
|
|
|
//如果不是 判断旧节点的父级id是否在旧节点集合中 如果在 则设置新节点的父级id为旧节点的父级id的映射id 否则就是随机id
|
|
|
newData.setParentId(oldToNewIdMap.containsKey(nodeOld.getParentId()) ? oldToNewIdMap.get(nodeOld.getParentId()) : SnowFlakeUtil.getId());
|
|
|
//TODO 20250414-lhb-新增
|
|
|
- newData.setPId(oldPKeyIdToNewPKeyIdMap.containsKey(nodeOld.getPId()) ? oldPKeyIdToNewPKeyIdMap.get(nodeOld.getPId()) : SnowFlakeUtil.getId());
|
|
|
+ newData.setPId(oldPKeyIdToNewPKeyIdMap.containsKey(nodeOld.getPId()) ? oldPKeyIdToNewPKeyIdMap.get(nodeOld.getPId()) : oldToNewIdMap.get(nodeOld.getParentId()) == null ? SnowFlakeUtil.getId() : oldToNewIdMap.get(nodeOld.getParentId()));
|
|
|
}
|
|
|
newData.setCreateTime(new Date());
|
|
|
newData.setUpdateTime(new Date());
|
|
@@ -2480,8 +2543,9 @@ private Map<String, String> reviseValue(WbsTreeContract wtc, WbsTreeContract par
|
|
|
if (wtc != null) {
|
|
|
try {
|
|
|
String tableName = wtc.getInitTableName();
|
|
|
- if (!ekvMap.containsKey(tableName)) {
|
|
|
- Map<String, String> map = ekvMap.computeIfAbsent(wtc.getInitTableName(), K -> new HashMap<>());
|
|
|
+// if (!ekvMap.containsKey(tableName)) {
|
|
|
+// Map<String, String> map = ekvMap.computeIfAbsent(wtc.getInitTableName(), K -> new HashMap<>());
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
if (parent == null) {
|
|
|
parent = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(wtc.getParentId(), Long.parseLong(wtc.getContractId()));
|
|
|
}
|
|
@@ -2517,8 +2581,9 @@ private Map<String, String> reviseValue(WbsTreeContract wtc, WbsTreeContract par
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- return ekvMap.getOrDefault(tableName, new HashMap<>());
|
|
|
+// }
|
|
|
+// return ekvMap.getOrDefault(tableName, new HashMap<>());
|
|
|
+ return map;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -2573,7 +2638,11 @@ private Object reviseValue(Map<String, String> p2, String key, Object value) {
|
|
|
/*重做随机值*/
|
|
|
List<RangeJson> rjs = JSON.parseArray(setting, RangeJson.class);
|
|
|
if (value != null && !value.toString().isEmpty() && Func.isNotEmpty(rjs)) {
|
|
|
- List<RangeJson> rangeJsons = rjs.stream().filter(rj -> rj.getPkeyId().equals(pKeyId)).collect(Collectors.toList());
|
|
|
+ List<RangeJson> temp = rjs.stream().filter(rj -> rj.getPkeyId().equals(pKeyId)).collect(Collectors.toList());
|
|
|
+ if (temp.isEmpty()) {
|
|
|
+ temp = rjs;
|
|
|
+ }
|
|
|
+ List<RangeJson> rangeJsons = temp;
|
|
|
if (!rangeJsons.isEmpty()) {
|
|
|
List<String[]> la = Arrays.stream(value.toString().split("☆")).map(s -> s.split("_\\^_")).collect(Collectors.toList());
|
|
|
/*全部为一个数的时候不用修改*/
|
|
@@ -3642,23 +3711,21 @@ public R removeContractTreeNodeJudge(@RequestParam String ids) {
|
|
|
String wbsIds = removeList.stream().map(Object::toString).collect(Collectors.joining(","));
|
|
|
/** 判断是否子节点有上报或审批过的资料,因为父id和祖级节点错误,直接使用上面的值去查询上报情况*/
|
|
|
List<String> unRemoveIds = jdbcTemplate.queryForList("SELECT wbs_id from u_information_query WHERE wbs_id in (" + wbsIds + ") and is_deleted = 0 and status in (1,2) GROUP BY wbs_id HAVING count(1) > 0", String.class);
|
|
|
- if (!unRemoveIds.isEmpty()) {
|
|
|
- // 剔除此节点
|
|
|
- Map<String, String> map = unRemoveIds.stream().collect(Collectors.toMap(id -> id, Function.identity()));
|
|
|
- removeNodeList.removeIf(node -> {
|
|
|
- //删除掉表格 TODO(不清楚为什么要剔除表格,按理说删除节点后,节点下的表也应该一起删除的,猜测或许是为了方便恢复节点的时候表数据还存在)2023年9月19日
|
|
|
- boolean removeIf = node.getType() != null && new Integer("2").equals(node.getType());
|
|
|
- boolean equals = map.containsKey(node.getPKeyId().toString());
|
|
|
- if (equals) {
|
|
|
- unremoveNodeMap.put(node.getPKeyId(), node);
|
|
|
- }
|
|
|
- return removeIf || equals;
|
|
|
- });
|
|
|
- Map<Long, WbsTreeContract> contractMap = removeNodeList.stream().collect(Collectors.toMap(WbsTreeContract::getId, Function.identity()));
|
|
|
- Map<Long, WbsTreeContract> tempMap = new HashMap<>();
|
|
|
- unremoveNodeMap.forEach((key, value) -> collectNodeAndAncestors(value, contractMap, tempMap));
|
|
|
- unremoveNodeMap.putAll(tempMap);
|
|
|
- }
|
|
|
+ // 剔除此节点
|
|
|
+ Map<String, String> map = unRemoveIds.stream().collect(Collectors.toMap(id -> id, Function.identity()));
|
|
|
+ removeNodeList.removeIf(node -> {
|
|
|
+ //删除掉表格 TODO(不清楚为什么要剔除表格,按理说删除节点后,节点下的表也应该一起删除的,猜测或许是为了方便恢复节点的时候表数据还存在)2023年9月19日
|
|
|
+ boolean removeIf = node.getType() != null && new Integer("2").equals(node.getType());
|
|
|
+ boolean equals = map.containsKey(node.getPKeyId().toString());
|
|
|
+ if (equals) {
|
|
|
+ unremoveNodeMap.put(node.getPKeyId(), node);
|
|
|
+ }
|
|
|
+ return removeIf || equals;
|
|
|
+ });
|
|
|
+ Map<Long, WbsTreeContract> contractMap = removeNodeList.stream().collect(Collectors.toMap(WbsTreeContract::getId, Function.identity()));
|
|
|
+ Map<Long, WbsTreeContract> tempMap = new HashMap<>();
|
|
|
+ unremoveNodeMap.forEach((key, value) -> collectNodeAndAncestors(value, contractMap, tempMap));
|
|
|
+ unremoveNodeMap.putAll(tempMap);
|
|
|
}
|
|
|
if(removeNodeList.isEmpty()) {
|
|
|
return R.fail("删除失败,该节点下有已填报的资料");
|
|
@@ -3685,6 +3752,7 @@ public R removeContractTreeNodeJudge(@RequestParam String ids) {
|
|
|
this.recycleBinService.save(new RecycleBin(String.join(",", idArray), "工程划分批量删除", 2, positionStr, projectId, contractId));
|
|
|
//改为物理删除 (8.28改为逻辑删除,方便恢复)
|
|
|
this.wbsTreeContractClient.removeContractTreeNode(idArray);
|
|
|
+ this.recycleBinInfoService.saveRecycleBinInfoByWbsTreeContract(String.join(",", idArray),ids);
|
|
|
//更新redis
|
|
|
this.informationQueryService.delAsyncWbsTree(removeWbsTreeContracts.get(0).getContractId());
|
|
|
this.wbsTreeContractStatisticsClient.delWbsTreeContractNodes(String.join(",", idArray));
|
|
@@ -5211,4 +5279,42 @@ public R<Object> customAddContractNode(@RequestBody CustomAddContractNodeDTO dto
|
|
|
}
|
|
|
throw new IllegalArgumentException("新数据中未找到根节点");
|
|
|
}
|
|
|
+
|
|
|
+ // pdf 检查任务添加
|
|
|
+ /**
|
|
|
+ * 首件wbs 树
|
|
|
+ *
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @GetMapping("/updateCheckPdfInfo")
|
|
|
+ @ApiOperationSupport(order = 40)
|
|
|
+ @ApiOperation(value = "添加pdf检查接口")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "type", value = "1:节点添加 2:文件添加",required = true),
|
|
|
+ @ApiImplicitParam(name = "classify", value = "1施工2监理",required = true),
|
|
|
+ @ApiImplicitParam(name = "ids", value = "多个用,拼接", required = true)
|
|
|
+ })
|
|
|
+ public R updateCheckPdfInfo(@RequestParam String type, @RequestParam String ids,@RequestParam String classify) {
|
|
|
+
|
|
|
+ return informationQueryService.updateCheckPdfInfo(type, ids,classify);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 首件wbs 树
|
|
|
+ *
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @GetMapping("/getCheckPdfPaceInfo")
|
|
|
+ @ApiOperationSupport(order = 40)
|
|
|
+ @ApiOperation(value = "添加pdf检查接口")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "type", value = "1:节点添加 2:文件添加",required = true),
|
|
|
+ @ApiImplicitParam(name = "classify", value = "1施工2监理",required = true),
|
|
|
+ @ApiImplicitParam(name = "ids", value = "多个用,拼接", required = true)
|
|
|
+ })
|
|
|
+ public R<ChekPdfPaceVo> getCheckPdfPaceInfo(@RequestParam String contractId,@RequestParam String classify) {
|
|
|
+
|
|
|
+ ChekPdfPaceVo checkPdfPaceInfo = informationQueryService.getCheckPdfPaceInfo(contractId, classify);
|
|
|
+ return R.data(checkPdfPaceInfo);
|
|
|
+ }
|
|
|
}
|