|
@@ -3149,7 +3149,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
saveList.clear();
|
|
|
saveList.addAll(customResult);
|
|
|
}
|
|
|
-
|
|
|
+ //找到最顶级节点设置parentId
|
|
|
+ WbsTreeContract topLevelNode = findTopLevelNode(saveList);
|
|
|
+ if(ObjectUtils.isNotEmpty(topLevelNode)){
|
|
|
+ for (WbsTreeContract wbsTreeContract : saveList) {
|
|
|
+ if(topLevelNode.getPKeyId().equals(wbsTreeContract.getPKeyId())){
|
|
|
+ wbsTreeContract.setParentId(treeContract.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
R<Boolean> booleanR = this.saveOrCopyNodeTree(saveList, saveLedger, 2, treeContract);
|
|
|
|
|
|
List<WbsTreeContract> nowTabs = saveList.stream().filter(f -> new Integer(2).equals(f.getType())).collect(Collectors.toList());
|
|
@@ -3159,6 +3167,18 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
return booleanR;
|
|
|
}
|
|
|
+ public static WbsTreeContract findTopLevelNode(List<WbsTreeContract> saveList) {
|
|
|
+ Set<Long> nodeIds = new HashSet<>();
|
|
|
+ for (WbsTreeContract node : saveList) {
|
|
|
+ nodeIds.add(node.getId());
|
|
|
+ }
|
|
|
+ for (WbsTreeContract node : saveList) {
|
|
|
+ if (!nodeIds.contains(node.getParentId())) {
|
|
|
+ return node;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
private void child(List<WbsTreeContract> resultChild, List<WbsTreeContract> nodeAll, WbsTreeContract root) {
|
|
|
for (WbsTreeContract node : nodeAll) {
|
|
@@ -3246,8 +3266,10 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//剔除与当前操作节点相同的ID,(如果saveType=1,表示当前及子级节点,那么就要剔除自己本身,否则视为仅当前节点操作,会存在自己本身)
|
|
|
if ("1".equals(saveType)) {
|
|
|
query.removeIf(wbsTreePrivate -> {
|
|
|
- Long id = wbsTreePrivate.getId();
|
|
|
- return treeContract.getId() != null && treeContract.getId().equals(id);
|
|
|
+ /*Long id = wbsTreePrivate.getId();
|
|
|
+ return treeContract.getId() != null && treeContract.getId().equals(id);*/
|
|
|
+ Long pKeyId = wbsTreePrivate.getPKeyId();
|
|
|
+ return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -3278,8 +3300,10 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//剔除与当前操作节点相同的ID,(如果saveType=1,表示当前及子级节点,那么就要剔除自己本身,否则视为仅当前节点操作,会存在自己本身)
|
|
|
if ("1".equals(saveType)) {
|
|
|
query.removeIf(wbsTreePrivate -> {
|
|
|
- Long id = wbsTreePrivate.getId();
|
|
|
- return treeContract.getId() != null && treeContract.getId().equals(id);
|
|
|
+ /*Long id = wbsTreePrivate.getId();
|
|
|
+ return treeContract.getId() != null && treeContract.getId().equals(id);*/
|
|
|
+ Long pKeyId = wbsTreePrivate.getPKeyId();
|
|
|
+ return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -3411,8 +3435,10 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//剔除与当前操作节点相同的ID
|
|
|
query.removeIf(wbsTreePrivate -> {
|
|
|
- Long id = wbsTreePrivate.getId();
|
|
|
- return treeContract.getId() != null && treeContract.getId().equals(id);
|
|
|
+ /*Long id = wbsTreePrivate.getId();
|
|
|
+ return treeContract.getId() != null && treeContract.getId().equals(id);*/
|
|
|
+ Long pKeyId = wbsTreePrivate.getPKeyId();
|
|
|
+ return treeContract.getIsTypePrivatePid() != null && treeContract.getIsTypePrivatePid().equals(pKeyId);
|
|
|
});
|
|
|
|
|
|
//设置到集合中
|