|
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import io.github.classgraph.utils.LogNode;
|
|
|
import io.swagger.annotations.*;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -71,6 +72,7 @@ import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
|
|
@@ -1339,104 +1341,486 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 15)
|
|
|
@ApiOperation(value = "复制节点(新)")
|
|
|
public R<Boolean> copyContractTreeNode(@RequestBody CopyContractTreeNodeVO vo) {
|
|
|
- //首先查询需要复制的节点及其下级所有子节点的信息
|
|
|
- WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
|
|
|
- // 获取当前节点的所有子节点
|
|
|
- String vocational = SnowFlakeUtil.getId() + "";
|
|
|
- //新增施工台账
|
|
|
- List<WbsTreeContract> saveList = new ArrayList<>();
|
|
|
- List<ConstructionLedger> saveLedger = new ArrayList<>();
|
|
|
- // 获取附件
|
|
|
- List<WbsTreeContract> nodeChildAll = informationQueryService.getNodeChildAllByNodeId(needCopyNode.getId() + "", needCopyNode.getContractId(), vo.getNeedCopyPrimaryKeyId());
|
|
|
- // 获取实体表列对象
|
|
|
- List<QueryProcessDataVO> nodeTabCols = informationQueryService.getNodeChildTabColsAllByNodeId(needCopyNode.getId() + "", needCopyNode.getContractId());
|
|
|
- // 转化为map
|
|
|
- Map<String, String> nodeTabColsMap = nodeTabCols.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
|
|
|
- StringBuilder copeSql = new StringBuilder();
|
|
|
-
|
|
|
- if (StringUtils.isNotEmpty(vo.getNeedCopyPrimaryKeyId())) {
|
|
|
- WbsTreeContract parent = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getParentPrimaryKeyId());
|
|
|
- //重塑关键信息
|
|
|
- Map<Long, Long> oldToNewIdMap = new HashMap<>();
|
|
|
- //节点信息
|
|
|
- Map<String, WbsTreeContract> nodeMap = new HashMap<>();
|
|
|
- nodeChildAll.forEach(node -> {
|
|
|
- oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId());
|
|
|
- nodeMap.put(node.getId().toString(), node);
|
|
|
- });
|
|
|
+ //TODO 单份复制
|
|
|
+ if (("1").equals(vo.getCopyType())) {
|
|
|
+ //首先查询需要复制的节点及其下级所有子节点的信息
|
|
|
+ WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
|
|
|
+ // 获取当前节点的所有子节点
|
|
|
+ String vocational = SnowFlakeUtil.getId() + "";
|
|
|
+ //新增施工台账
|
|
|
+ List<WbsTreeContract> saveList = new ArrayList<>();
|
|
|
+ List<ConstructionLedger> saveLedger = new ArrayList<>();
|
|
|
+ // 获取附件
|
|
|
+ List<WbsTreeContract> nodeChildAll = informationQueryService.getNodeChildAllByNodeId(needCopyNode.getId() + "", needCopyNode.getContractId(), vo.getNeedCopyPrimaryKeyId());
|
|
|
+ // 获取实体表列对象
|
|
|
+ List<QueryProcessDataVO> nodeTabCols = informationQueryService.getNodeChildTabColsAllByNodeId(needCopyNode.getId() + "", needCopyNode.getContractId());
|
|
|
+ // 转化为map
|
|
|
+ Map<String, String> nodeTabColsMap = nodeTabCols.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
|
|
|
+ StringBuilder copeSql = new StringBuilder();
|
|
|
|
|
|
- //todo 单份复制
|
|
|
- nodeChildAll.forEach(node -> {
|
|
|
- WbsTreeContract newData = new WbsTreeContract();
|
|
|
- BeanUtils.copyProperties(node, newData);
|
|
|
+ if (StringUtils.isNotEmpty(vo.getNeedCopyPrimaryKeyId())) {
|
|
|
+ WbsTreeContract parent = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getParentPrimaryKeyId());
|
|
|
//重塑关键信息
|
|
|
- //重塑primaryKeyId
|
|
|
- newData.setPKeyId(SnowFlakeUtil.getId());
|
|
|
- //设置旧ID
|
|
|
- if (StringUtils.isNotEmpty(node.getOldId())) {
|
|
|
- newData.setOldId(node.getOldId());
|
|
|
- } else {
|
|
|
- newData.setOldId(node.getId().toString());
|
|
|
+ Map<Long, Long> oldToNewIdMap = new HashMap<>();
|
|
|
+ //节点信息
|
|
|
+ Map<String, WbsTreeContract> nodeMap = new HashMap<>();
|
|
|
+ nodeChildAll.forEach(node -> {
|
|
|
+ oldToNewIdMap.put(node.getId(), SnowFlakeUtil.getId());
|
|
|
+ nodeMap.put(node.getId().toString(), node);
|
|
|
+ });
|
|
|
+
|
|
|
+ nodeChildAll.forEach(node -> {
|
|
|
+ WbsTreeContract newData = new WbsTreeContract();
|
|
|
+ BeanUtils.copyProperties(node, newData);
|
|
|
+ //重塑关键信息
|
|
|
+ //重塑primaryKeyId
|
|
|
+ newData.setPKeyId(SnowFlakeUtil.getId());
|
|
|
+ //设置旧ID
|
|
|
+ if (StringUtils.isNotEmpty(node.getOldId())) {
|
|
|
+ newData.setOldId(node.getOldId());
|
|
|
+ } else {
|
|
|
+ newData.setOldId(node.getId().toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ //设置新ID
|
|
|
+ if (new Integer("1").equals(node.getType())) {
|
|
|
+ //如果是节点类型才重塑ID
|
|
|
+ newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
|
|
|
+ //划分编号
|
|
|
+ newData.setPartitionCode(StringUtils.isNotEmpty(vo.getPartitionCode()) ? vo.getPartitionCode() : null);
|
|
|
+ }
|
|
|
+ //设置父节点ID
|
|
|
+ if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
|
|
|
+ //找到复制的节点,将parentId更改为 parent.getId()
|
|
|
+ newData.setParentId(parent.getId());
|
|
|
+ //设置新名称
|
|
|
+ newData.setNodeName(vo.getNeedCopyNodeName());
|
|
|
+ newData.setFullName(vo.getNeedCopyNodeName());
|
|
|
+ } else {
|
|
|
+ newData.setParentId(oldToNewIdMap.containsKey(node.getParentId()) ? oldToNewIdMap.get(node.getParentId()) : SnowFlakeUtil.getId());
|
|
|
+ }
|
|
|
+ newData.setCreateTime(new Date());
|
|
|
+ newData.setUpdateTime(new Date());
|
|
|
+ //初始化是否显示表格,默认显示
|
|
|
+ newData.setIsBussShow(1);
|
|
|
+ //初始化表格是否上传附件,默认未上传
|
|
|
+ newData.setTabFileType(1);
|
|
|
+ //初始化单表是否可以预览,默认不能
|
|
|
+ newData.setIsTabPdf(1);
|
|
|
+ //初始化PDF路径
|
|
|
+ newData.setPdfUrl(null);
|
|
|
+ newData.setCreateUser(AuthUtil.getUserId());
|
|
|
+ //重塑父节点关联关系
|
|
|
+ this.restoreParent(newData, oldToNewIdMap);
|
|
|
+ //保存到集合中
|
|
|
+ saveList.add(newData);
|
|
|
+ if (new Integer("6").equals(node.getNodeType())) {
|
|
|
+ //生成施工日志
|
|
|
+ this.createLedger(newData, saveLedger, nodeMap, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 组织复制值Sql
|
|
|
+ if (nodeTabColsMap != null && node.getType() == 2) {
|
|
|
+ String tableName = newData.getInitTableName();
|
|
|
+ String col = nodeTabColsMap.get(tableName);
|
|
|
+ String colVal = nodeTabColsMap.get(tableName);
|
|
|
+ colVal = colVal.replaceAll("id,p_key_id,", "'" + SnowFlakeUtil.getId() + "' as id,'" + newData.getPKeyId() + "' as p_key_id,");
|
|
|
+ copeSql.append("insert into " + tableName + " (" + col + ") select " + colVal + " from " + tableName + " where p_key_id='" + node.getPKeyId() + "' ;");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //保存节点信息
|
|
|
+ R<Boolean> booleanR = this.saveOrCopyNodeTree(saveList, saveLedger, 32, needCopyNode);
|
|
|
+
|
|
|
+ //复制数据逻辑
|
|
|
+ if (nodeTabColsMap != null && copeSql.length() >= 10) {
|
|
|
+ jdbcTemplate.execute(copeSql.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取父节点信息
|
|
|
+ informationQueryService.AsyncWbsTree(needCopyNode.getParentId() + "", needCopyNode.getParentId() + "", needCopyNode.getContractId(), "", "1");
|
|
|
+ return booleanR;
|
|
|
+
|
|
|
+ /** TODO 多份复制
|
|
|
+ * @Author liuYC
|
|
|
+ * @Date 2023年4月10日18:06:53
|
|
|
+ * @Description
|
|
|
+ * 解析复制节点位置信息:
|
|
|
+ * 1:同节点复制(同一个父级下)
|
|
|
+ * 1.1 如果点击选择的是当前复制节点的父级,那么就新增一个当前需要复制的节点-新的子级-新的表-新的表数据(根据所属方查询对应数据)。
|
|
|
+ * 1.2 如果点击选择的是当前复制节点的同级节点(自己本身节点是无法点击进行复制的),那么复制对应表数据,如果没有对应表,那么跳过。
|
|
|
+ * 2:跨节点复制(不同父级下)
|
|
|
+ * 2.1 如果点击选择的是其他父级节点的父级,那么新增一个新的当前选择的复制的节点-新的表-新的表数据(根据所属方查询对应数据)。
|
|
|
+ * 2.2 如果点击选择的是当前复制节点本身的同等级节点,那么复制对应表数据,如果没有对应表,那么跳过。
|
|
|
+ */
|
|
|
+ } else if (("2").equals(vo.getCopyType())) {
|
|
|
+ //首先查询需要复制的节点的信息
|
|
|
+ WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
|
|
|
+ //获取需要复制到的位置节点信息的集合
|
|
|
+ List<CopyContractTreeNodeVO.CopyBatch> copyBatches = vo.getCopyBatchToPaths();
|
|
|
+ if (needCopyNode != null && copyBatches.size() > 0) {
|
|
|
+ //获取当前需要复制到的位置节点信息,判断同节点复制或跨节点复制
|
|
|
+ List<Long> toCopyNodePKeyIds = copyBatches.stream().map(CopyContractTreeNodeVO.CopyBatch::getPrimaryKeyId).map(Long::valueOf).collect(Collectors.toList());
|
|
|
+ List<WbsTreeContract> toCopyNodes = wbsTreeContractClient.queryContractTreeNodeByPKIds(toCopyNodePKeyIds);
|
|
|
+ Map<String, CopyContractTreeNodeVO.CopyBatch> toCopyMaps = copyBatches.stream().collect(Collectors.toMap(CopyContractTreeNodeVO.CopyBatch::getPrimaryKeyId, Function.identity()));
|
|
|
+
|
|
|
+ //结果集
|
|
|
+ List<WbsTreeContract> addChildNodes = null;
|
|
|
+ List<WbsTreeContract> addChildNodesTables = null;
|
|
|
+ List<WbsTreeContract> addChildNodesTablesOld = null; //原始表单
|
|
|
+ List<String> resultTablesData = new ArrayList<>();
|
|
|
+
|
|
|
+ //表单所属方
|
|
|
+ String tabOwner = "";
|
|
|
+ if (("1,2").equals(vo.getClassifyType()) || ("2,1").equals(vo.getClassifyType())) {
|
|
|
+ tabOwner = "1,2,3,4,5,6";
|
|
|
+ } else if (("1").equals(vo.getClassifyType())) {
|
|
|
+ tabOwner = "1,2,3";
|
|
|
+ } else if (("2").equals(vo.getClassifyType())) {
|
|
|
+ tabOwner = "4,5,6";
|
|
|
}
|
|
|
|
|
|
- //设置新ID
|
|
|
- if (new Integer("1").equals(node.getType())) {
|
|
|
- //如果是节点类型才重塑ID
|
|
|
- newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
|
|
|
- //划分编号
|
|
|
- newData.setPartitionCode(StringUtils.isNotEmpty(vo.getPartitionCode()) ? vo.getPartitionCode() : null);
|
|
|
+ //解析位置信息,进行复制数据构造
|
|
|
+ for (WbsTreeContract toCopyNode : toCopyNodes) {
|
|
|
+ CopyContractTreeNodeVO.CopyBatch toCopyVO = toCopyMaps.get(toCopyNode.getPKeyId().toString());
|
|
|
+ if (toCopyVO != null) {
|
|
|
+ //TODO 同节点复制
|
|
|
+ if (new Integer(1).equals(toCopyVO.getIsSameNode())) {
|
|
|
+ //1.1 选择的同级的父级节点,新增
|
|
|
+ if (needCopyNode.getParentId().equals(toCopyNode.getId())) {
|
|
|
+ toCopyNode.setNodeName(toCopyVO.getNodeName());
|
|
|
+ toCopyNode.setPartitionCode(toCopyVO.getPartitionCode());
|
|
|
+
|
|
|
+ //获取需要复制的所有子节点节点
|
|
|
+ addChildNodes = this.getChildNodes(needCopyNode);
|
|
|
+
|
|
|
+ if (ObjectUtil.isEmpty(addChildNodes) || addChildNodes.size() == 0) {
|
|
|
+ //最下层级节点复制
|
|
|
+ addChildNodes = new ArrayList<>();
|
|
|
+ addChildNodes.add(needCopyNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取所有复制的表
|
|
|
+ addChildNodesTables = this.getChildNodesTables(addChildNodes, toCopyNode.getContractId());
|
|
|
+ addChildNodesTablesOld = addChildNodesTables;
|
|
|
+ //构造新的节点、表、数据
|
|
|
+ this.addCopyNodesAndTabsBuildData(addChildNodes, addChildNodesTables, needCopyNode, toCopyNode, resultTablesData, 1, tabOwner, vo.getIsCopyData());
|
|
|
+
|
|
|
+ //1.2 选择的同级的同级节点,只复制数据
|
|
|
+ } else if (needCopyNode.getParentId().equals(toCopyNode.getParentId())) {
|
|
|
+ //构造数据
|
|
|
+ this.addCopyTabData(needCopyNode, toCopyNode, tabOwner, resultTablesData, vo.getIsCopyData());
|
|
|
+ }
|
|
|
+
|
|
|
+ //TODO 跨节点复制
|
|
|
+ } else if (new Integer(0).equals(toCopyVO.getIsSameNode())) {
|
|
|
+ //获取需要复制节点的上级
|
|
|
+ WbsTreeContract parentNodeNeed = wbsTreeContractClient.getContractWbsTreeByContractIdAndId(needCopyNode.getParentId(), Long.parseLong(needCopyNode.getContractId()));
|
|
|
+ //2.1 选择的父级的同级的父级节点,新增(跨节点新增)
|
|
|
+ //当复制节点父级与选择复制到的位置节点的父级id相同时,表示新增
|
|
|
+ if (parentNodeNeed != null && parentNodeNeed.getParentId().equals(toCopyNode.getParentId())) {
|
|
|
+ toCopyNode.setNodeName(toCopyVO.getNodeName());
|
|
|
+ toCopyNode.setPartitionCode(toCopyVO.getPartitionCode());
|
|
|
+
|
|
|
+ //获取需要复制的所有子节点节点
|
|
|
+ addChildNodes = this.getChildNodes(needCopyNode);
|
|
|
+
|
|
|
+ if (ObjectUtil.isEmpty(addChildNodes) || addChildNodes.size() == 0) {
|
|
|
+ //最下层级节点复制
|
|
|
+ addChildNodes = new ArrayList<>();
|
|
|
+ addChildNodes.add(needCopyNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取所有复制的表
|
|
|
+ addChildNodesTables = this.getChildNodesTables(addChildNodes, toCopyNode.getContractId());
|
|
|
+ addChildNodesTablesOld = addChildNodesTables;
|
|
|
+ //构造新的节点、表、数据
|
|
|
+ this.addCopyNodesAndTabsBuildData(addChildNodes, addChildNodesTables, needCopyNode, toCopyNode, resultTablesData, 0, tabOwner, vo.getIsCopyData());
|
|
|
+
|
|
|
+ //2.2 如果点击选择的是当前复制节点本身的同等级节点,那么就只复制数据。(如果是跨节点,类型相同的情况下,只复制数据)
|
|
|
+ } else if (needCopyNode.getNodeType().equals(toCopyNode.getNodeType()) && !needCopyNode.getParentId().equals(toCopyNode.getParentId())) {
|
|
|
+ //构造数据
|
|
|
+ this.addCopyTabData(needCopyNode, toCopyNode, tabOwner, resultTablesData, vo.getIsCopyData());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- //设置父节点ID
|
|
|
- if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
|
|
|
- //找到复制的节点,将parentId更改为 parent.getId()
|
|
|
- newData.setParentId(parent.getId());
|
|
|
- //设置新名称
|
|
|
- newData.setNodeName(vo.getNeedCopyNodeName());
|
|
|
- newData.setFullName(vo.getNeedCopyNodeName());
|
|
|
- } else {
|
|
|
- newData.setParentId(oldToNewIdMap.containsKey(node.getParentId()) ? oldToNewIdMap.get(node.getParentId()) : SnowFlakeUtil.getId());
|
|
|
+
|
|
|
+ //节点
|
|
|
+ if (addChildNodes != null && addChildNodes.size() > 0) {
|
|
|
+ wbsTreeContractClient.saveBatch(addChildNodes);
|
|
|
+ //更新redis缓存
|
|
|
+ Map<Long, List<WbsTreeContract>> collect = addChildNodes.stream().filter(f -> new Integer(1).equals(f.getType()) && ObjectUtil.isNotEmpty(f.getParentId())).collect(Collectors.groupingBy(WbsTreeContract::getParentId));
|
|
|
+ for (Map.Entry<Long, List<WbsTreeContract>> longListEntry : collect.entrySet()) {
|
|
|
+ informationQueryService.AsyncWbsTree("", longListEntry.getKey().toString(), needCopyNode.getContractId(), "", "1");
|
|
|
+ }
|
|
|
}
|
|
|
- newData.setCreateTime(new Date());
|
|
|
- newData.setUpdateTime(new Date());
|
|
|
+ //元素表
|
|
|
+ if (addChildNodesTables != null && addChildNodesTables.size() > 0) {
|
|
|
+ wbsTreeContractClient.saveBatch(addChildNodesTables);
|
|
|
+
|
|
|
+ if (addChildNodesTablesOld.size() > 0) {
|
|
|
+ //文件附件新增 TODO
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //实体表数据
|
|
|
+ if (resultTablesData.size() > 0) {
|
|
|
+ jdbcTemplate.execute(StringUtils.join(resultTablesData, ""));
|
|
|
+ }
|
|
|
+ return R.success("操作成功");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.fail("操作失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 复制数据
|
|
|
+ */
|
|
|
+ private void addCopyTabData(WbsTreeContract needCopyNode, WbsTreeContract toCopyNode, String tabOwner, List<String> resultTablesData, Integer isCopyData) {
|
|
|
+ List<WbsTreeContract> wbsTreeContractsNeed = Collections.singletonList(needCopyNode);
|
|
|
+ List<WbsTreeContract> wbsTreeContractsTo = Collections.singletonList(toCopyNode);
|
|
|
+ List<WbsTreeContract> needCopyNodeTabs = getChildNodesTables(wbsTreeContractsNeed, needCopyNode.getContractId());
|
|
|
+ List<WbsTreeContract> toCopyNodeTabs = getChildNodesTables(wbsTreeContractsTo, needCopyNode.getContractId());
|
|
|
+ if (needCopyNodeTabs.size() > 0) {
|
|
|
+ for (WbsTreeContract needTab : needCopyNodeTabs) {
|
|
|
+ for (WbsTreeContract toCopyNodeTab : toCopyNodeTabs) {
|
|
|
+ //获取相同表单 nodeName 、HtmlUrl相同
|
|
|
+ if (needTab.getNodeName().equals(toCopyNodeTab.getNodeName()) && (ObjectUtil.isNotEmpty(needTab.getHtmlUrl()) && ObjectUtil.isNotEmpty(toCopyNodeTab.getHtmlUrl()) && needTab.getHtmlUrl().equals(toCopyNodeTab.getHtmlUrl()))) {
|
|
|
+ if (StringUtils.isEmpty(needTab.getInitTableName())) {
|
|
|
+ //没有对应实体表,跳过
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Long oldPKeyId = needTab.getPKeyId();
|
|
|
+
|
|
|
+ //表单所属方,只有勾选了对应的所属方权限才复制数据;勾选了复制数据才能复制,否则只是创建节点、表
|
|
|
+ if (tabOwner.contains(needTab.getTableOwner()) && isCopyData == 1) {
|
|
|
+ //获取实体表列对象
|
|
|
+ List<QueryProcessDataVO> nodeTabColOneTab = informationQueryService.getNodeChildTabColsAllByTabName(needTab.getInitTableName());
|
|
|
+ //转化为map
|
|
|
+ Map<String, String> nodeTabColsMap = nodeTabColOneTab.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
|
|
|
+ //组织复制表的数据的sql
|
|
|
+ if (nodeTabColsMap.size() > 0) {
|
|
|
+ StringBuilder copyDataSql = new StringBuilder();
|
|
|
+ String tableName = needTab.getInitTableName();
|
|
|
+ String col = nodeTabColsMap.get(tableName);
|
|
|
+ String colVal = nodeTabColsMap.get(tableName);
|
|
|
+ colVal = colVal.replaceAll("id,p_key_id,", "'" + SnowFlakeUtil.getId() + "' as id,'" + toCopyNodeTab.getPKeyId() + "' as p_key_id,");
|
|
|
+ //delete SQL (先删除旧数据,再新增)
|
|
|
+ String delSql = "delete from " + tableName + " where p_key_id = " + toCopyNodeTab.getPKeyId() + " ; ";
|
|
|
+ //insert into SQL
|
|
|
+ copyDataSql.append(delSql).append("insert into ").append(tableName).append(" (").append(col).append(") select ").append(colVal).append(" from ").append(tableName).append(" where p_key_id='").append(oldPKeyId).append("' ;");
|
|
|
+ resultTablesData.add(copyDataSql.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增复制节点、表的数据构造
|
|
|
+ */
|
|
|
+ private void addCopyNodesAndTabsBuildData(List<WbsTreeContract> needNodes, List<WbsTreeContract> needTabs, WbsTreeContract needCopyNode, WbsTreeContract toCopyNode, List<String> resultTablesData, Integer isSameNode, String tabOwner, Integer isCopyData) {
|
|
|
+ int var = 0;
|
|
|
+ if (needNodes.size() == 1) {
|
|
|
+ //判断是否为最下级节点
|
|
|
+ WbsTreeContract wbsTreeContract = needNodes.stream().filter(f -> f.getPKeyId().equals(needCopyNode.getPKeyId())).findAny().orElse(null);
|
|
|
+ if (wbsTreeContract != null) {
|
|
|
+ var = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //最下层级节点复制
|
|
|
+ if (var == 1) {
|
|
|
+ //构造节点
|
|
|
+ Long id = SnowFlakeUtil.getId();
|
|
|
+ for (WbsTreeContract needNode : needNodes) {
|
|
|
+ if (isSameNode == 0) {
|
|
|
+ //跨节点复制,更改父级id
|
|
|
+ needNode.setParentId(toCopyNode.getId());
|
|
|
+ }
|
|
|
+ needNode.setOldId(needNode.getId() + "");
|
|
|
+ needNode.setPKeyId(SnowFlakeUtil.getId());
|
|
|
+ needNode.setId(id);
|
|
|
+ needNode.setNodeName(toCopyNode.getNodeName());
|
|
|
+ needNode.setFullName(toCopyNode.getNodeName());
|
|
|
+ needNode.setPartitionCode(toCopyNode.getPartitionCode());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //构造当前节点下所有元素表
|
|
|
+ for (WbsTreeContract needTab : needTabs) {
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(needTab.getInitTableName())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Long oldPKeyId = needTab.getPKeyId();
|
|
|
+
|
|
|
+ Long tabId = SnowFlakeUtil.getId();
|
|
|
+ needTab.setAncestors(needTab.getAncestors().replace(needTab.getParentId().toString(), id.toString()));
|
|
|
+ needTab.setId(tabId);
|
|
|
+ needTab.setParentId(id);
|
|
|
+ needTab.setPKeyId(SnowFlakeUtil.getId());
|
|
|
//初始化是否显示表格,默认显示
|
|
|
- newData.setIsBussShow(1);
|
|
|
+ needTab.setIsBussShow(1);
|
|
|
//初始化表格是否上传附件,默认未上传
|
|
|
- newData.setTabFileType(1);
|
|
|
+ needTab.setTabFileType(1);
|
|
|
//初始化单表是否可以预览,默认不能
|
|
|
- newData.setIsTabPdf(1);
|
|
|
+ needTab.setIsTabPdf(1);
|
|
|
//初始化PDF路径
|
|
|
- newData.setPdfUrl(null);
|
|
|
- newData.setCreateUser(AuthUtil.getUserId());
|
|
|
- //重塑父节点关联关系
|
|
|
- this.restoreParent(newData, oldToNewIdMap);
|
|
|
- //保存到集合中
|
|
|
- saveList.add(newData);
|
|
|
- if (new Integer("6").equals(node.getNodeType())) {
|
|
|
- //生成施工日志
|
|
|
- this.createLedger(newData, saveLedger, nodeMap, null);
|
|
|
+ needTab.setPdfUrl(null);
|
|
|
+
|
|
|
+ //表单所属方,只有勾选了对应的所属方权限才复制数据;勾选了复制数据才能复制,否则只是创建节点、表
|
|
|
+ if (tabOwner.contains(needTab.getTableOwner()) && isCopyData == 1) {
|
|
|
+ //获取实体表列对象
|
|
|
+ List<QueryProcessDataVO> nodeTabColOneTab = informationQueryService.getNodeChildTabColsAllByTabName(needTab.getInitTableName());
|
|
|
+ //转化为map
|
|
|
+ Map<String, String> nodeTabColsMap = nodeTabColOneTab.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
|
|
|
+ //组织复制表的数据的sql
|
|
|
+ if (nodeTabColsMap.size() > 0) {
|
|
|
+ StringBuilder copyDataSql = new StringBuilder();
|
|
|
+ String tableName = needTab.getInitTableName();
|
|
|
+ String col = nodeTabColsMap.get(tableName);
|
|
|
+ String colVal = nodeTabColsMap.get(tableName);
|
|
|
+ colVal = colVal.replaceAll("id,p_key_id,", "'" + SnowFlakeUtil.getId() + "' as id,'" + needTab.getPKeyId() + "' as p_key_id,");
|
|
|
+ copyDataSql.append("insert into ").append(tableName).append(" (").append(col).append(") select ").append(colVal).append(" from ").append(tableName).append(" where p_key_id='").append(oldPKeyId).append("' ;");
|
|
|
+ resultTablesData.add(copyDataSql.toString());
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- // 组织复制值Sql
|
|
|
- if (nodeTabColsMap != null && node.getType() == 2) {
|
|
|
- String tableName = newData.getInitTableName();
|
|
|
- String col = nodeTabColsMap.get(tableName);
|
|
|
- String colVal = nodeTabColsMap.get(tableName);
|
|
|
- colVal = colVal.replaceAll("id,p_key_id,", "'" + SnowFlakeUtil.getId() + "' as id,'" + newData.getPKeyId() + "' as p_key_id,");
|
|
|
- copeSql.append("insert into " + tableName + " (" + col + ") select " + colVal + " from " + tableName + " where p_key_id='" + node.getPKeyId() + "' ;");
|
|
|
+ //多层级节点复制
|
|
|
+ } else {
|
|
|
+ //根节点id
|
|
|
+ Long toCopyNodeOldId = toCopyNode.getId();
|
|
|
+ toCopyNode.setId(SnowFlakeUtil.getId());
|
|
|
+
|
|
|
+ Map<Long, Long> parentIdToId = new HashMap<>();
|
|
|
+ Map<Long, List<WbsTreeContract>> tabMap = needTabs.stream().collect(Collectors.groupingBy(WbsTreeContract::getParentId));
|
|
|
+
|
|
|
+ for (WbsTreeContract node : needNodes) {
|
|
|
+ Long oldId = node.getId();
|
|
|
+ //构造节点
|
|
|
+ Long newParentId;
|
|
|
+ if (parentIdToId.size() > 0) {
|
|
|
+ //去数据源节点获取父级id对应的新id,设置成重设后的新的父级id
|
|
|
+ newParentId = parentIdToId.get(node.getParentId());
|
|
|
+ } else {
|
|
|
+ //根节点
|
|
|
+ newParentId = toCopyNode.getId();
|
|
|
}
|
|
|
- });
|
|
|
+ if (ObjectUtils.isEmpty(newParentId)) {
|
|
|
+ newParentId = toCopyNode.getId();
|
|
|
+ }
|
|
|
+ node.setPKeyId(SnowFlakeUtil.getId());
|
|
|
+ node.setOldId(node.getId().toString());
|
|
|
+ Long id = SnowFlakeUtil.getId();
|
|
|
+ //数据源节点的老id与新的id的Map,作为下一级的节点的父级id的替换
|
|
|
+ parentIdToId.put(node.getId(), id);
|
|
|
+ //重设祖级id
|
|
|
+ node.setAncestors(node.getAncestors().replace(node.getParentId().toString(), id.toString()));
|
|
|
+ //重设Id
|
|
|
+ node.setId(id);
|
|
|
+ node.setParentId(newParentId);
|
|
|
+
|
|
|
+ //构造当前节点下所有元素表
|
|
|
+ List<WbsTreeContract> tabs = tabMap.get(oldId);
|
|
|
+ //构造节点下的表
|
|
|
+ if (tabs != null && tabs.size() > 0) {
|
|
|
+ for (WbsTreeContract needTab : tabs) {
|
|
|
+ if (StringUtils.isEmpty(needTab.getInitTableName())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Long oldPKeyId = needTab.getPKeyId();
|
|
|
+
|
|
|
+ Long tabId = SnowFlakeUtil.getId();
|
|
|
+ needTab.setAncestors(needTab.getAncestors().replace(needTab.getParentId().toString(), id.toString()));
|
|
|
+ needTab.setId(tabId);
|
|
|
+ needTab.setParentId(id);
|
|
|
+ needTab.setPKeyId(SnowFlakeUtil.getId());
|
|
|
+ //初始化是否显示表格,默认显示
|
|
|
+ needTab.setIsBussShow(1);
|
|
|
+ //初始化表格是否上传附件,默认未上传
|
|
|
+ needTab.setTabFileType(1);
|
|
|
+ //初始化单表是否可以预览,默认不能
|
|
|
+ needTab.setIsTabPdf(1);
|
|
|
+ //初始化PDF路径
|
|
|
+ needTab.setPdfUrl(null);
|
|
|
+
|
|
|
+ //表单所属方,只有勾选了对应的所属方权限才复制数据;勾选了复制数据才能复制,否则只是创建节点、表
|
|
|
+ if (tabOwner.contains(needTab.getTableOwner()) && isCopyData == 1) {
|
|
|
+ //获取实体表列对象
|
|
|
+ List<QueryProcessDataVO> nodeTabColOneTab = informationQueryService.getNodeChildTabColsAllByTabName(needTab.getInitTableName());
|
|
|
+ //转化为map
|
|
|
+ Map<String, String> nodeTabColsMap = nodeTabColOneTab.stream().collect(Collectors.toMap(QueryProcessDataVO::getQueryType, QueryProcessDataVO::getAncestors, (key1, key2) -> key2));
|
|
|
+ //组织复制表的数据的sql
|
|
|
+ if (nodeTabColsMap.size() > 0) {
|
|
|
+ StringBuilder copyDataSql = new StringBuilder();
|
|
|
+ String tableName = needTab.getInitTableName();
|
|
|
+ String col = nodeTabColsMap.get(tableName);
|
|
|
+ String colVal = nodeTabColsMap.get(tableName);
|
|
|
+ colVal = colVal.replaceAll("id,p_key_id,", "'" + SnowFlakeUtil.getId() + "' as id,'" + needTab.getPKeyId() + "' as p_key_id,");
|
|
|
+ copyDataSql.append("insert into ").append(tableName).append(" (").append(col).append(") select ").append(colVal).append(" from ").append(tableName).append(" where p_key_id='").append(oldPKeyId).append("' ;");
|
|
|
+ resultTablesData.add(copyDataSql.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加根节点
|
|
|
+ toCopyNode.setOldId(needCopyNode.getId() + "");
|
|
|
+ if (isSameNode == 1) {
|
|
|
+ //同节点
|
|
|
+ toCopyNode.setParentId(needCopyNode.getParentId());
|
|
|
+ } else {
|
|
|
+ //跨节点
|
|
|
+ toCopyNode.setParentId(toCopyNodeOldId);
|
|
|
+ }
|
|
|
+ toCopyNode.setPKeyId(SnowFlakeUtil.getId());
|
|
|
+ toCopyNode.setNodeName(toCopyNode.getNodeName());
|
|
|
+ toCopyNode.setFullName(toCopyNode.getNodeName());
|
|
|
+ toCopyNode.setPartitionCode(toCopyNode.getPartitionCode());
|
|
|
+ needNodes.add(toCopyNode);
|
|
|
}
|
|
|
- //保存节点信息
|
|
|
- R<Boolean> booleanR = this.saveOrCopyNodeTree(saveList, saveLedger, 32, needCopyNode);
|
|
|
+ }
|
|
|
|
|
|
- //复制数据逻辑
|
|
|
- if (nodeTabColsMap != null && copeSql.length() >= 10) {
|
|
|
- jdbcTemplate.execute(copeSql.toString());
|
|
|
+ /**
|
|
|
+ * 获取所有子级节点
|
|
|
+ */
|
|
|
+ private List<WbsTreeContract> getChildNodes(WbsTreeContract obj) {
|
|
|
+ if (obj != null) {
|
|
|
+ List<WbsTreeContract> wbsTreeContracts = Collections.singletonList(obj);
|
|
|
+ List<WbsTreeContract> result = new ArrayList<>();
|
|
|
+ this.recursionGetChildNodes(wbsTreeContracts, result, obj.getContractId());
|
|
|
+ if (result.size() > 0) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
- //获取父节点信息
|
|
|
- informationQueryService.AsyncWbsTree(needCopyNode.getParentId() + "", needCopyNode.getParentId() + "", needCopyNode.getContractId(), "", "1");
|
|
|
- return booleanR;
|
|
|
+ private void recursionGetChildNodes(List<WbsTreeContract> list, List<WbsTreeContract> result, String contractId) {
|
|
|
+ List<Long> ids = list.stream().map(WbsTreeContract::getId).collect(Collectors.toList());
|
|
|
+ if (ids.size() > 0) {
|
|
|
+ List<WbsTreeContract> query = jdbcTemplate.query("select * from m_wbs_tree_contract where type = 1 and parent_id in(" + StringUtils.join(ids, ",") + ") and status = 1 and is_deleted = 0 and contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
+ if (query.size() > 0) {
|
|
|
+ result.addAll(query);
|
|
|
+ recursionGetChildNodes(query, result, contractId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取所有子级下的表
|
|
|
+ */
|
|
|
+ private List<WbsTreeContract> getChildNodesTables(List<WbsTreeContract> list, String contractId) {
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ List<Long> parentIds = list.stream().map(WbsTreeContract::getId).collect(Collectors.toList());
|
|
|
+ return jdbcTemplate.query("select * from m_wbs_tree_contract where type = 2 and is_deleted = 0 and status = 1 and parent_id in(" + StringUtils.join(parentIds, ",") + ") and contract_id = " + contractId, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
+ }
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1619,17 +2003,6 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
newData.setPdfUrl(null);
|
|
|
|
|
|
//获取当前所有复制的节点的最大sort
|
|
|
- /*String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
|
|
|
- List<WbsTreeContract> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
- List<Integer> collect = query.stream().filter(f -> ObjectUtils.isNotEmpty(f.getSort())).collect(Collectors.toList()).stream().map(WbsTreeContract::getSort).collect(Collectors.toList());
|
|
|
- Integer max = 1;
|
|
|
- if (collect.size() > 0) {
|
|
|
- max = collect.stream().reduce(collect.get(0), Integer::max);
|
|
|
- } else {
|
|
|
- max = 1;
|
|
|
- }
|
|
|
- //设置sort
|
|
|
- newData.setSort(max);*/
|
|
|
newData.setSort(ObjectUtils.isNotEmpty(node.getSort()) ? node.getSort() : 0);
|
|
|
|
|
|
//重塑父节点关联关系
|
|
@@ -1676,7 +2049,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
/**
|
|
|
* 生成施工日志记录
|
|
|
*/
|
|
|
- private void createLedger(WbsTreeContract newData, List<ConstructionLedger> saveLedger, Map<String, WbsTreeContract> contractNodeMap, Map<String, WbsTreePrivate> projectNodeMap) {
|
|
|
+ private void createLedger(WbsTreeContract
|
|
|
+ newData, List<ConstructionLedger> saveLedger, Map<String, WbsTreeContract> contractNodeMap, Map<String, WbsTreePrivate> projectNodeMap) {
|
|
|
//工序,需要新增施工台账
|
|
|
ConstructionLedger ledger = new ConstructionLedger();
|
|
|
//获取这个节点的原始信息
|
|
@@ -1730,7 +2104,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
* @param parentList 父节点集合
|
|
|
* @param childList 保存集合
|
|
|
*/
|
|
|
- private void foreachQueryChildContract(List<WbsTreeContract> parentList, List<WbsTreeContract> childList, Map<String, List<WbsTreeContract>> contractAllNodeMap) {
|
|
|
+ private void foreachQueryChildContract
|
|
|
+ (List<WbsTreeContract> parentList, List<WbsTreeContract> childList, Map<String, List<WbsTreeContract>> contractAllNodeMap) {
|
|
|
parentList.forEach(parent -> {
|
|
|
List<WbsTreeContract> childs;
|
|
|
if (contractAllNodeMap.containsKey(parent.getId().toString())) {
|
|
@@ -1771,7 +2146,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "wbsType", value = "模板类型, 1质检,2试验", required = true),
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
- public R<List<WbsTreeContractTreeVOS>> queryMappingStructureTree(@RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
|
|
|
+ public R<List<WbsTreeContractTreeVOS>> queryMappingStructureTree(@RequestParam String
|
|
|
+ parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
|
|
|
List<WbsTreeContractTreeVOS> result = this.informationQueryService.queryContractTree(parentId, contractId, contractIdRelation, null);
|
|
|
if (result.size() == 1) {
|
|
|
//只有一个子节点,继续向下
|
|
@@ -1823,7 +2199,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "nodeName", value = "节点的title", required = true),
|
|
|
@ApiImplicitParam(name = "partitionCode", value = "划分编号")
|
|
|
})
|
|
|
- public R<Boolean> updateContractNodeParameter(@RequestParam Long pKeyId, @RequestParam String nodeName, @RequestParam String partitionCode) {
|
|
|
+ public R<Boolean> updateContractNodeParameter(@RequestParam Long pKeyId, @RequestParam String
|
|
|
+ nodeName, @RequestParam String partitionCode) {
|
|
|
WbsTreeContract node = new WbsTreeContract();
|
|
|
node.setPKeyId(pKeyId);
|
|
|
node.setNodeName(nodeName);
|
|
@@ -2133,7 +2510,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
return booleanR;
|
|
|
}
|
|
|
|
|
|
- private List<WbsTreePrivate> unifiedCode(List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract) {
|
|
|
+ private List<WbsTreePrivate> unifiedCode
|
|
|
+ (List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract) {
|
|
|
//获取主键
|
|
|
List<String> halfSelectedList = allSelectedNodeList.stream().map(AddContractTreeNodeVO.Node::getPrimaryKeyId).distinct().collect(Collectors.toList());
|
|
|
//查询数据
|
|
@@ -2145,7 +2523,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
@NotNull
|
|
|
- private R<Boolean> saveOrCopyNodeTree(List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer operationType, WbsTreeContract currentNode) {
|
|
|
+ private R<Boolean> saveOrCopyNodeTree
|
|
|
+ (List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer
|
|
|
+ operationType, WbsTreeContract currentNode) {
|
|
|
|
|
|
if (saveList.size() > 0) {
|
|
|
StringBuilder str = new StringBuilder();
|
|
@@ -2199,7 +2579,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
/**
|
|
|
* 处理半选集合
|
|
|
*/
|
|
|
- private void disposeHalfSelectList(@RequestBody WbsTreeContract treeContract, List<AddContractTreeNodeVO.Node> allSelectedNodeList, List<WbsTreePrivate> selectedNodeList) {
|
|
|
+ private void disposeHalfSelectList(@RequestBody WbsTreeContract
|
|
|
+ treeContract, List<AddContractTreeNodeVO.Node> allSelectedNodeList, List<WbsTreePrivate> selectedNodeList) {
|
|
|
if (allSelectedNodeList != null && allSelectedNodeList.size() > 0) {
|
|
|
//获取主键
|
|
|
List<String> allSelectedList = allSelectedNodeList.stream().map(AddContractTreeNodeVO.Node::getPrimaryKeyId).distinct().collect(Collectors.toList());
|
|
@@ -2245,7 +2626,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "projectId", value = "项目ID"),
|
|
|
@ApiImplicitParam(name = "id", value = "点击节点ID")
|
|
|
})
|
|
|
- public R<List<WbsTreeContractTreeVOS>> queryWbsTreePrivateByProjectIdAndId(@RequestParam String projectId, @RequestParam String id) {
|
|
|
+ public R<List<WbsTreeContractTreeVOS>> queryWbsTreePrivateByProjectIdAndId(@RequestParam String
|
|
|
+ projectId, @RequestParam String id) {
|
|
|
List<WbsTreeContractTreeVOS> result = new ArrayList<>();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
@@ -2419,7 +2801,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
- public R<List<WbsTreeContractTreeVOS>> queryStandingBookContractWbsTree(@RequestParam String primaryKeyId, @RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
|
|
|
+ public R<List<WbsTreeContractTreeVOS>> queryStandingBookContractWbsTree(@RequestParam String
|
|
|
+ primaryKeyId, @RequestParam String parentId, @RequestParam String contractId, @RequestParam String
|
|
|
+ contractIdRelation) {
|
|
|
if (StringUtils.isNotEmpty(primaryKeyId)) {
|
|
|
parentId = primaryKeyId;
|
|
|
}
|
|
@@ -2442,7 +2826,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
|
|
|
@ApiImplicitParam(name = "classifyType", value = "所属方,监理、总监办的资料查询使用,=1施工数据(默认),=2监理数据")
|
|
|
})
|
|
|
- public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String primaryKeyId,
|
|
|
+ public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String
|
|
|
+ primaryKeyId,
|
|
|
@RequestParam String parentId,
|
|
|
@RequestParam String contractId,
|
|
|
@RequestParam String contractIdRelation,
|
|
@@ -2510,7 +2895,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
- public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByFirstInfo(@RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
|
|
|
+ public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByFirstInfo(@RequestParam String
|
|
|
+ parentId, @RequestParam String contractId, @RequestParam String contractIdRelation) {
|
|
|
List<WbsTreeContractTreeVOS> rootTreeNode = informationQueryService.queryContractTree(parentId, contractId, contractIdRelation, null);
|
|
|
//查询被标记为首件的数据
|
|
|
rootTreeNode = rootTreeNode.stream().filter(WbsTreeContractTreeVOS::getIsFirst).collect(Collectors.toList());
|