Преглед на файлове

编号引用子分项或分项

cr преди 4 дни
родител
ревизия
d0d64a5cf3
променени са 1 файла, в които са добавени 12 реда и са изтрити 10 реда
  1. 12 10
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

+ 12 - 10
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -2189,16 +2189,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 if(StringUtils.isNotEmpty(node.getPartitionCode())){
                     nodePartitionCode=node.getPartitionCode();
                 }else {
-                    List<WbsTreeContract> list = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().in(WbsTreeContract::getPKeyId, node.getAncestorsPId()).in(WbsTreeContract::getNodeType, Arrays.asList(4, 5)));
-                    if(!list.isEmpty()){
-                        // 获取第一个节点类型为5的元素
-                        WbsTreeContract result = list.stream().filter(item -> item.getNodeType() == 5).findFirst().orElse(null);
-                        if(result!=null){
-                            nodePartitionCode=result.getPartitionCode();
-                        }else {
-                            WbsTreeContract result2 = list.stream().filter(item -> item.getNodeType() == 4).findFirst().orElse(null);
-                            if(result2!=null){
-                                nodePartitionCode=result2.getPartitionCode();
+                    if(StringUtils.isNotEmpty(node.getAncestorsPId())){
+                        List<WbsTreeContract> list = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().in(WbsTreeContract::getPKeyId, Func.toLongList(",", node.getAncestorsPId())).in(WbsTreeContract::getNodeType, Arrays.asList(4, 5)));
+                        if(!list.isEmpty()){
+                            // 获取第一个节点类型为5的元素
+                            WbsTreeContract result = list.stream().filter(item -> item.getNodeType() == 5).findFirst().orElse(null);
+                            if(result!=null){
+                                nodePartitionCode=result.getPartitionCode();
+                            }else {
+                                WbsTreeContract result2 = list.stream().filter(item -> item.getNodeType() == 4).findFirst().orElse(null);
+                                if(result2!=null){
+                                    nodePartitionCode=result2.getPartitionCode();
+                                }
                             }
                         }
                     }