| | |
| | | * @param name 节点名称 |
| | | * @return 最新版本程序报名节点 |
| | | */ |
| | | public NcNode getLastEditionTryingProgramPackage(String name,String processEdition){ |
| | | public NcNode getLastEditionTryingProgramPackage(String name){ |
| | | //.or(NcNode::getIsCured,0) |
| | | List<NcNode> pkgList = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE) |
| | | .eq(NcNode::getName, name).and(i->{ |
| | | i.eq(NcNode::getIsCured, 0).or().isNull(NcNode::getIsCured); |
| | | }).likeRight(NcNode::getParentIds,"0,1,") |
| | | .eq(NcNode::getIsLastEdition,1).eq(NcNode::getProcessEdition,processEdition).orderByDesc(NcNode::getCreateTime).list(); |
| | | .eq(NcNode::getIsLastEdition,1).orderByDesc(NcNode::getCreateTime).list();//.eq(NcNode::getProcessEdition,processEdition) |
| | | |
| | | if(pkgList.isEmpty()){ |
| | | return null; |
| | |
| | | * @param programPkgName |
| | | * @return |
| | | */ |
| | | public NcNode getLastEditionCuredProgramPackage(String programPkgName,String processEdition) { |
| | | public NcNode getLastEditionCuredProgramPackage(String programPkgName) { |
| | | 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::getProcessEdition, processEdition) |
| | | //.eq(NcNode::getProcessEdition, processEdition) |
| | | .eq(NcNode::getIsLastEdition,1).list(); |
| | | |
| | | if(nodes.isEmpty()){ |
| | |
| | | |
| | | /** |
| | | * 获取最新的固化程序,不用工序版次匹配 |
| | | * @param programPkgName |
| | | * @param drawingNo |
| | | * @param processNo |
| | | * @param machineCode |
| | | * @return |
| | | */ |
| | | public NcNode getLastCuredProgramPackageWithoutProcessEdition(String programPkgName,String machineCode) { |
| | | public NcNode getLastCuredProgramWithoutProcessEdition(String drawingNo, String processNo, 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) |
| | | .eq(NcNode::getDrawingNo, drawingNo).eq(NcNode::getProcessNo, processNo) |
| | | .likeRight(NcNode::getParentIds,"0,2,").eq(NcNode::getIsCured,1) |
| | | .in(!machineCodesInGroup.isEmpty(),NcNode::getMachineCode,machineCodesInGroup) |
| | | .eq(NcNode::getIsLastEdition,1).orderByDesc(NcNode::getCreateTime).list(); |
| | |
| | | * @param programPkgName 程序包名 |
| | | * @return 偏离的程序节点 |
| | | */ |
| | | public NcNode getLastEditionDeviationProgramPackage(String programPkgName,String processEdition) { |
| | | public NcNode getLastEditionDeviationProgramPackage(String programPkgName) {//,String processEdition |
| | | List<NcNode> nodes = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE) |
| | | .eq(NcNode::getName, programPkgName) |
| | | .eq(NcNode::getProcessEdition, processEdition) |
| | | //.eq(NcNode::getProcessEdition, processEdition) |
| | | .likeRight(NcNode::getParentIds,"0,3,") |
| | | .eq(NcNode::getIsLastEdition,1).list(); |
| | | |