xiejun
2023-10-11 623fac73aabf8064e5126dd33a7f27f1a4bf19ce
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -595,7 +595,12 @@
      if(StringUtils.isNotBlank(libName)){
         libNameList=VciBaseUtil.str2List(libName);
      }
      List<CodeClassify> doList =codeClassifyMapper.getRMLibByName(libNameList,"Enabled",AuthUtil.getTenantId());
      List<CodeClassify> doList =codeClassifyMapper.getRMLibByName(libNameList,"Enabled",AuthUtil.getTenantId()
         .equals(
            nacosConfigCache
               .getAdminUserInfo()
               .getTenantId()
         ) ? null:AuthUtil.getTenantId());
      List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList);
      return voList;
   }
@@ -764,7 +769,8 @@
      if(allLevel){
         List<CodeClassify> classifyDOS = codeClassifyMapper.selectAllLevelChildHasPath(codeClassifyOid,fieldInPath);
         if(!CollectionUtils.isEmpty(classifyDOS)){
            classifyDOS = classifyDOS.stream().filter(s->FRAMEWORK_DATA_ENABLED.equalsIgnoreCase(s.getLcStatus())).collect(Collectors.toList());
            // 这儿用stream有点慢
            classifyDOS = classifyDOS.parallelStream().filter(s->FRAMEWORK_DATA_ENABLED.equalsIgnoreCase(s.getLcStatus())).collect(Collectors.toList());
         }
         return codeClassifyDO2VOs(classifyDOS);
      }else{
@@ -1144,7 +1150,8 @@
      List<Map<String,Object>> cbos = codeClassifyMapper.selectAllLevelParentByOid(oid);
      Map<String,String> oidLevelMap = new HashMap<>();
      Optional.ofNullable(cbos).orElseGet(()->new ArrayList<>()).stream().forEach(cbo->{
         oidLevelMap.put(cbo.get("OID").toString(),cbo.get("LEVEL").toString());
         // 用key取map值并且不区分大小写
         oidLevelMap.put(cbo.getOrDefault("OID",cbo.get("oid")).toString(),cbo.get("LEVEL").toString());
      });
      if(CollectionUtils.isEmpty(oidLevelMap)){
         return new ArrayList<>();