| | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 程序节点 |
| | |
| | | |
| | | |
| | | /** |
| | | * 车讯节点 |
| | | * @param queryVO |
| | | * @return |
| | | */ |
| | | public List<Long> searchDrawing(NcNodeQueryVO queryVO) { |
| | | List<NcNode> nodes = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_DRAWING_NO) |
| | | .eq(NcNode::getIsLastEdition,1) |
| | | .eq(NcNode::getName,queryVO.getDrawingNo()) |
| | | .ge(queryVO.getCreateTimeBegin()!=null,NcNode::getCreateTime,queryVO.getCreateTimeBegin()) |
| | | .le(queryVO.getCreateTimeEnd()!=null,NcNode::getCreateTime,queryVO.getCreateTimeEnd()) |
| | | .and(i->{ |
| | | |
| | | i.or().likeRight(queryVO.getProgramStatus().contains("1"),NcNode::getParentIds,"0,1,"); |
| | | i.or().likeRight(queryVO.getProgramStatus().contains("2"),NcNode::getParentIds,"0,2,"); |
| | | i.or().likeRight(queryVO.getProgramStatus().contains("3"),NcNode::getParentIds,"0,3,"); |
| | | }).list(); |
| | | |
| | | return nodes.stream().map(NcNode::getId).toList(); |
| | | } |
| | | /** |
| | | * 首页树查询 |
| | | * @param queryVO |
| | | * @return |
| | | */ |
| | | /* |
| | | public List<NcNodeVO> searchList(NcNodeQueryVO queryVO) { |
| | | //1.根据关进字和节点类型查询初始列表,查询的原始列表,需要hasChild字段,所以使用mapper.xml |
| | | List<NcNodeVO> oriList = this.getBaseMapper().searchList(queryVO); |
| | |
| | | } |
| | | return rootVos; |
| | | } |
| | | |
| | | */ |
| | | void addNodeChildren(NcNodeVO node, List<NcNodeVO> allNodes) { |
| | | for(NcNodeVO vo : allNodes){ |
| | | if(Objects.equals(vo.getParentId(), node.getId())){ |
| | |
| | | * @param name 节点名称 |
| | | * @return 最新版本程序报名节点 |
| | | */ |
| | | public NcNode getLastEditionTryingProgramPackage(String name){ |
| | | public NcNode getLastEditionTryingProgramPackage(String name,String processEdition){ |
| | | //.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).orderByDesc(NcNode::getCreateTime).list(); |
| | | .eq(NcNode::getIsLastEdition,1).eq(NcNode::getProcessEdition,processEdition).orderByDesc(NcNode::getCreateTime).list(); |
| | | |
| | | if(pkgList.isEmpty()){ |
| | | return null; |
| | |
| | | * @param programPkgName |
| | | * @return |
| | | */ |
| | | public NcNode getLastEditionCuredProgramPackage(String programPkgName) { |
| | | public NcNode getLastEditionCuredProgramPackage(String programPkgName,String processEdition) { |
| | | 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::getIsLastEdition,1).list(); |
| | | |
| | | if(nodes.isEmpty()){ |
| | |
| | | * @param programPkgName 程序包名 |
| | | * @return 偏离的程序节点 |
| | | */ |
| | | public NcNode getLastEditionDeviationProgramPackage(String programPkgName) { |
| | | public NcNode getLastEditionDeviationProgramPackage(String programPkgName,String processEdition) { |
| | | List<NcNode> nodes = lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE) |
| | | .eq(NcNode::getName, programPkgName).likeRight(NcNode::getParentIds,"0,3,") |
| | | .eq(NcNode::getName, programPkgName) |
| | | .eq(NcNode::getProcessEdition, processEdition) |
| | | .likeRight(NcNode::getParentIds,"0,3,") |
| | | .eq(NcNode::getIsLastEdition,1).list(); |
| | | |
| | | if(nodes.isEmpty()){ |