| | |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineVO; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | | import org.springblade.mdm.program.mapper.NcNodeMapper; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramQueryVO; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramVO; |
| | | import org.springblade.mdm.program.vo.NcNodeQueryVO; |
| | | import org.springblade.mdm.program.vo.NcNodeVO; |
| | | import org.springblade.mdm.program.vo.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * 获取程序包名的数据 |
| | | * @param programName 程序名称(程序包名) |
| | | * @return 程序报包名的节点 |
| | | */ |
| | | public NcNode getProgramPackageByName(String programName) { |
| | | List<NcNode> pkgs = this.lambdaQuery().eq(NcNode::getName, programName).eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE).list(); |
| | | if(pkgs.isEmpty()){ |
| | | return null; |
| | | }else{ |
| | | return pkgs.get(0); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Transactional(readOnly = true) |
| | | public List<NcNodeVO> historyByNodeId(Long id) { |
| | | NcNode node = this.getById(id); |
| | | return this.baseMapper.historyByParentIdAndName(node.getParentId(),node.getName()); |
| | | } |
| | | |
| | | /** |
| | | * 获取“程序包名”的最新版本 |
| | | * @param name 节点名称 |
| | | * @return 最新版本程序报名节点 |
| | | */ |
| | | public NcNode getLastEditionProgramPackage(String name){ |
| | | List<NcNode> pkgList = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE) |
| | | .eq(NcNode::getName, name).eq(NcNode::getIsLastEdition,1).orderByDesc(NcNode::getCreateTime).list(); |
| | | |
| | | if(pkgList.isEmpty()){ |
| | | return null; |
| | | }else{ |
| | | return pkgList.get(0); |
| | | } |
| | | } |
| | | |
| | | } |