|
@@ -3318,30 +3318,31 @@ public R<Boolean> saveContractTreeNode(@RequestBody AddContractTreeNodeVO vo) {
|
|
|
));
|
|
|
}
|
|
|
}
|
|
|
- //新增节点类型不能大于选择节点类型
|
|
|
- Set<Integer> nodeType = query.stream()
|
|
|
- .filter(wbsTreeContract -> wbsTreeContract.getNodeType() != null)
|
|
|
- .map(WbsTreePrivate::getNodeType)
|
|
|
- .collect(Collectors.toSet());
|
|
|
- Integer type = treeContract.getNodeType();
|
|
|
- if(type<=6||type==18){
|
|
|
- type = (type == 1) ? 1 : (type == 18) ? 2 : type + 1;
|
|
|
- for (Integer i : nodeType) {
|
|
|
- i = (i == 1) ? 1 : (i == 18) ? 2 : i + 1;
|
|
|
- if("1".equals(vo.getSaveType())){
|
|
|
- if (i <type) {
|
|
|
- throw new ServiceException("当前新增节点类型不能大于或等于父级节点类型");
|
|
|
- }
|
|
|
- }else {
|
|
|
- if (i <=type) {
|
|
|
- throw new ServiceException("当前新增节点类型不能大于或等于父级节点类型");
|
|
|
+ //只有底层节点才有这个限制
|
|
|
+ if(vo.getTemplateType()!=null&&vo.getTemplateType()==2){
|
|
|
+ //新增节点类型不能大于选择节点类型
|
|
|
+ Set<Integer> nodeType = query.stream()
|
|
|
+ .filter(wbsTreeContract -> wbsTreeContract.getNodeType() != null)
|
|
|
+ .map(WbsTreePrivate::getNodeType)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ Integer type = treeContract.getNodeType();
|
|
|
+ if(type<=6||type==18){
|
|
|
+ type = (type == 1) ? 1 : (type == 18) ? 2 : type + 1;
|
|
|
+ for (Integer i : nodeType) {
|
|
|
+ i = (i == 1) ? 1 : (i == 18) ? 2 : i + 1;
|
|
|
+ if("1".equals(vo.getSaveType())){
|
|
|
+ if (i <type) {
|
|
|
+ throw new ServiceException("当前新增节点类型不能大于或等于父级节点类型");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (i <=type) {
|
|
|
+ throw new ServiceException("当前新增节点类型不能大于或等于父级节点类型");
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
//保存集合
|
|
|
List<WbsTreeContract> saveList = new ArrayList<>();
|
|
|
List<ConstructionLedger> saveLedger = new ArrayList<>();
|