|
@@ -572,13 +572,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
wbsTreeZi.setIsConcrete(0);
|
|
|
wbsTreeZi.setIsExpernode(0);
|
|
|
}
|
|
|
-
|
|
|
baseMapper.insert(wbsTreeZi);
|
|
|
break;
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
trees = tree;
|
|
|
}
|
|
|
}
|
|
@@ -601,9 +598,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
wbsTreeZi.setDeptName(maps.getValue());
|
|
|
wbsTreeZi.setDeptCategory(Integer.valueOf(maps.getKey()));
|
|
|
wbsTreeZi.setWbsId(wbsTreeFu.getWbsId());
|
|
|
-
|
|
|
wbsTreeZi.setParentId(wbsTreeFu.getParentId());
|
|
|
-
|
|
|
wbsTreeZi.setAncestors(wbsTreeFu.getAncestors());
|
|
|
wbsTreeZi.setProjectNodeId(wbsTree1.getProjectNodeId());
|
|
|
|
|
@@ -616,6 +611,7 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
StringBuilder stringBuffer = new StringBuilder();
|
|
|
StringBuilder appendStr = stringBuffer.append(",").append(wbsTreeZi.getParentId());
|
|
|
String ancestors = wbsTreeZi.getAncestors() + appendStr;
|
|
|
+
|
|
|
wbsTreeZi.setAncestors(ancestors);
|
|
|
|
|
|
wbsTreeFu.setParentId(id);
|
|
@@ -640,23 +636,32 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
}
|
|
|
|
|
|
private WbsTree buildTreeNode(WbsTree wbsTreeZi, List<WbsTree> allNodeData) {
|
|
|
- List<WbsTree> wbsTrees = new ArrayList<>();
|
|
|
+ /*List<WbsTree> wbsTrees = new ArrayList<>();
|
|
|
//判重
|
|
|
for (WbsTree tree : allNodeData) {
|
|
|
if (tree.getDeptName().equals(wbsTreeZi.getDeptName())
|
|
|
+ && tree.getWbsId().equals(wbsTreeZi.getWbsId())
|
|
|
&& tree.getDeptCategory().equals(wbsTreeZi.getDeptCategory())
|
|
|
&& tree.getProjectNodeId().equals(wbsTreeZi.getProjectNodeId())
|
|
|
- && !tree.getAncestors().equals(wbsTreeZi.getAncestors())
|
|
|
- ) {
|
|
|
+ && !tree.getAncestors().equals(wbsTreeZi.getAncestors())) {
|
|
|
//判断上级节点不同,当前节点名相同的tree选择问题,例如:第X跨的上级有上部构造现场浇筑、上部构造预制和安装,导致下方新增重复节点判断时找到的是前一个
|
|
|
wbsTrees.add(tree);
|
|
|
break;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ List<WbsTree> wbsTrees = allNodeData.stream().filter(f ->
|
|
|
+ f.getWbsId().equals(wbsTreeZi.getWbsId()) &&
|
|
|
+ f.getDeptName().equals(wbsTreeZi.getDeptName()) &&
|
|
|
+ f.getDeptCategory().equals(wbsTreeZi.getDeptCategory()) &&
|
|
|
+ f.getProjectNodeId().equals(wbsTreeZi.getProjectNodeId()) &&
|
|
|
+ !f.getAncestors().equals(wbsTreeZi.getAncestors())
|
|
|
+ ).collect(Collectors.toList());
|
|
|
|
|
|
WbsTree wbsTree = null;
|
|
|
+
|
|
|
//不重复 直接新增
|
|
|
- if (wbsTrees.size() == 0) {
|
|
|
+ if (wbsTrees.size() <= 0) {
|
|
|
wbsTreeZi.setStatus(1);
|
|
|
wbsTreeZi.setType(1);
|
|
|
wbsTreeZi.setMajorDataType(0);
|
|
@@ -679,10 +684,12 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
if (wbsTreeZi.getDeptCategory() == 6) {
|
|
|
wbsTreeZi.setIsConcrete(0);
|
|
|
wbsTreeZi.setIsExpernode(0);
|
|
|
- break;
|
|
|
}
|
|
|
+ // wbsTree = null;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
wbsTree = tree;
|
|
|
}
|
|
|
}
|
|
@@ -921,37 +928,6 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- /**
|
|
|
- * 不清楚为什么之前要节点+表分开判断
|
|
|
- */
|
|
|
- /*
|
|
|
- //公有
|
|
|
- //查询所有公共节点+表单
|
|
|
- List<WbsTree> trees = baseMapper.selectList(Wrappers.<WbsTree>query().lambda().eq(WbsTree::getWbsId, pawDTO.getWbsId()));
|
|
|
- List<WbsTree> treesTable = trees.stream().filter(f -> f.getType() == 2).collect(Collectors.toList());
|
|
|
- //根据id获取指定WbsTree节点数据
|
|
|
- List<WbsTree> listTree = new ArrayList<>();
|
|
|
- trees.stream().map(tree -> {
|
|
|
- diffRent.stream().forEach(id -> {
|
|
|
- if (id.equals(String.valueOf(tree.getId()))) {
|
|
|
- listTree.add(tree);
|
|
|
- }
|
|
|
- });
|
|
|
- return null;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- //初始化
|
|
|
- //节点
|
|
|
- listTree.stream().forEach(tree -> {
|
|
|
- WbsTreePrivate wbsTreePrivate2 = getWbsTreePrivate1(tree, pawDTO);
|
|
|
- insertData.add(wbsTreePrivate2);
|
|
|
- });
|
|
|
- //元素表
|
|
|
- treesTable.stream().forEach(tree -> {
|
|
|
- WbsTreePrivate wbsTreePrivate2 = getWbsTreePrivate1(tree, pawDTO);
|
|
|
- insertData.add(wbsTreePrivate2);
|
|
|
- });
|
|
|
- */
|
|
|
-
|
|
|
} else if (pawDTO.getReferenceType().equals("private")) {
|
|
|
//引用私有
|
|
|
|
|
@@ -971,37 +947,6 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
insertData2.add(wbsTreePrivate2);
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
- /**
|
|
|
- * 不清楚为什么之前要节点+表分开判断
|
|
|
- */
|
|
|
- /* List<WbsTreePrivate> wbsTreePrivatesList = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
- .eq(WbsTreePrivate::getWbsId, pawDTO.getWbsId())
|
|
|
- .eq(WbsTreePrivate::getProjectId, pawDTO.getReferencePrivateWbsProjectId())
|
|
|
- );
|
|
|
- //表单
|
|
|
- List<WbsTreePrivate> wbsTreePrivatesListTable = wbsTreePrivatesList.stream().filter(f -> f.getType() == 2).collect(Collectors.toList());
|
|
|
- List<WbsTreePrivate> listTree = new ArrayList<>();
|
|
|
- wbsTreePrivatesList.stream().map(tree -> {
|
|
|
- diffRent.stream().forEach(id -> {
|
|
|
- if (id.equals(String.valueOf(tree.getId()))) {
|
|
|
- listTree.add(tree);
|
|
|
- }
|
|
|
- });
|
|
|
- return null;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- //初始化
|
|
|
- //节点
|
|
|
- listTree.stream().forEach(wbsTreePrivate -> {
|
|
|
- WbsTreePrivate wbsTreePrivate2 = getWbsTreePrivate2(wbsTreePrivate, pawDTO);
|
|
|
- insertData2.add(wbsTreePrivate2);
|
|
|
- });
|
|
|
- //元素表
|
|
|
- wbsTreePrivatesListTable.stream().forEach(wbsTreePrivate -> {
|
|
|
- WbsTreePrivate wbsTreePrivate2 = getWbsTreePrivate2(wbsTreePrivate, pawDTO);
|
|
|
- insertData2.add(wbsTreePrivate2);
|
|
|
- });*/
|
|
|
-
|
|
|
}
|
|
|
|
|
|
if (pawDTO.getReferenceType().equals("public")) {
|