| | |
| | | } |
| | | List<NcNodeVO> oriList = this.getBaseMapper().searchList2(queryVO); |
| | | |
| | | |
| | | List<NcNodeVO> allVos = new ArrayList<>();//已经加入过的节点,用于去重 |
| | | List<NcNodeVO> rootVos = new ArrayList<>(); |
| | | |
| | |
| | | List<NcNodeVO> parents = this.getBaseMapper().searchListInIds(Func.toLongList(vo.getParentIds())); |
| | | |
| | | for(NcNodeVO pvo : parents){ |
| | | if(pvo.getParentId() == 0L){ |
| | | if(pvo.getParentId() == 0L && !rootVos.contains(pvo)){ |
| | | rootVos.add(pvo); |
| | | } |
| | | allVos.add(pvo); |
| | | if(!allVos.contains(pvo)){ |
| | | allVos.add(pvo); |
| | | } |
| | | |
| | | } |
| | | } |
| | | for(NcNodeVO root : rootVos){ |
| | |
| | | } |
| | | } |
| | | |
| | | NcNodeVO toNodeVO(NcNode node){ |
| | | NcNodeVO vo = new NcNodeVO(); |
| | | |
| | | BeanUtils.copyProperties(node, vo); |
| | | |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * 获取程序包名的数据 |
| | |
| | | * @param machineCode 机床编号 |
| | | * @return |
| | | */ |
| | | public NcNode getCuredProgramPackage(String programPkgName,String machineCode) { |
| | | public NcNode getCuredProgramPackage(String programPkgName,String processEdition,String machineCode) { |
| | | Machine machine = machineService.getByCode(machineCode); |
| | | List<Machine> sameGroupMachines = machineService.lambdaQuery().eq(Machine::getMachineGroupCode,machine.getMachineGroupCode()).list(); |
| | | List<String> machineCodesInGroup = sameGroupMachines.stream().map(Machine::getCode).toList(); |
| | | List<NcNode> nodes = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE) |
| | | .eq(NcNode::getName, programPkgName).likeRight(NcNode::getParentIds,"0,2,").eq(NcNode::getIsCured,1) |
| | | .eq(NcNode::getName, programPkgName) |
| | | .eq(NcNode::getProcessEdition,processEdition) |
| | | .likeRight(NcNode::getParentIds,"0,2,").eq(NcNode::getIsCured,1) |
| | | .in(!machineCodesInGroup.isEmpty(),NcNode::getMachineCode,machineCodesInGroup) |
| | | .eq(NcNode::getIsLastEdition,1).list(); |
| | | |