yangys
2025-08-06 053a438acf9ec33e182b25211ce8108f0367feac
blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/service/NcNodeService.java
@@ -170,10 +170,16 @@
   }
   /**
    * 查询节点的历史列表(节点的上级节点”程序包名“因为存在多个版本,所以历史记录也需要根据不同版本程序包名进行查询)
    * @param id
    * @return
    */
   @Transactional(readOnly = true)
    public List<NcNodeVO> historyByNodeId(Long id) {
      NcNode node = this.getById(id);
      return this.baseMapper.historyByParentIdAndName(node.getParentId(),node.getName());
      NcNode parentNode = this.getById(node.getParentId());
      return this.baseMapper.historyByParentIdAndName(node.getName(),parentNode);
    }
   /**
@@ -192,4 +198,29 @@
      }
   }
   /**
    * 根据父节点和名称,查询文件界节点列表
    * @param name 节点/文件名称
    * @param parentId 父节点id
    */
    public NcNode getLastEditionProgramFile(String name,Long parentId) {
      List<NcNode> nodes = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_FILE)
         .eq(NcNode::getName, name).eq(NcNode::getParentId,parentId)
         .eq(NcNode::getIsLastEdition,1).list();
      if(nodes.isEmpty()){
         return null;
      }else {
         return nodes.get(0);
      }
   }
   /**
    * 获取node的历史列表(同一个父节点下,同名的所有节点)
    * @param pkgNode node
    * @return 历史列表,报错节点本身
    */
    public List<NcNode> getNodeHistorys(NcNode pkgNode) {
      return this.lambdaQuery().eq(NcNode::getParentId,pkgNode.getParentId())
         .eq(NcNode::getName,pkgNode.getName()).list();
    }
}