|
@@ -4380,26 +4380,28 @@ public R<Object> customAddContractNode(@RequestBody CustomAddContractNodeDTO dto
|
|
|
}
|
|
|
WbsTreeContract parentNode = wbsTreeContractClient.getContractNodeByPrimaryKeyId(dto.getPrimaryKeyId());
|
|
|
if (parentNode != null) {
|
|
|
- Integer targetType;//当前节点类型
|
|
|
- Integer sourceType;//父节点类型
|
|
|
- if(parentNode.getNodeType()!=1){
|
|
|
- sourceType=parentNode.getNodeType()+1;
|
|
|
- }else {
|
|
|
- sourceType=parentNode.getNodeType();
|
|
|
- }
|
|
|
- if(parentNode.getNodeType()==18){
|
|
|
- sourceType=2;
|
|
|
- }
|
|
|
- if(dto.getNodeType()!=1){
|
|
|
- targetType=dto.getNodeType()+1;
|
|
|
- }else {
|
|
|
- targetType=dto.getNodeType();
|
|
|
- }
|
|
|
- if(dto.getNodeType()==18){
|
|
|
- targetType=2;
|
|
|
- }
|
|
|
- if(sourceType>=targetType){
|
|
|
- throw new ServiceException("当前新增选择的节点类型不能大于或等于父级节点类型");
|
|
|
+ if(dto.getTemplateType()!=null&&dto.getTemplateType()==2){
|
|
|
+ Integer targetType;//当前节点类型
|
|
|
+ Integer sourceType;//父节点类型
|
|
|
+ if(parentNode.getNodeType()!=1){
|
|
|
+ sourceType=parentNode.getNodeType()+1;
|
|
|
+ }else {
|
|
|
+ sourceType=parentNode.getNodeType();
|
|
|
+ }
|
|
|
+ if(parentNode.getNodeType()==18){
|
|
|
+ sourceType=2;
|
|
|
+ }
|
|
|
+ if(dto.getNodeType()!=1){
|
|
|
+ targetType=dto.getNodeType()+1;
|
|
|
+ }else {
|
|
|
+ targetType=dto.getNodeType();
|
|
|
+ }
|
|
|
+ if(dto.getNodeType()==18){
|
|
|
+ targetType=2;
|
|
|
+ }
|
|
|
+ if(sourceType>=targetType){
|
|
|
+ throw new ServiceException("当前新增选择的节点类型不能大于或等于父级节点类型");
|
|
|
+ }
|
|
|
}
|
|
|
WbsTreeContract obj = new WbsTreeContract();
|
|
|
obj.setPKeyId(SnowFlakeUtil.getId());
|