| | |
| | | if(CollectionUtils.isEmpty(query.getDispatchIds())){ |
| | | return pageInfo; |
| | | } |
| | | List<TSamplingRecordOperation> samplingRecordOperations = samplingRecordOperationMapper.selectList(null); |
| | | List<TSamplingRecordVO> list = this.baseMapper.pageList(query); |
| | | List<TSamplingRecordVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | for (TSamplingRecordVO tSamplingRecordVO : list) { |
| | | if (query.getRoleType()==5){ |
| | | if (tSamplingRecordVO.getStatus()==2){ |
| | | List<TSamplingRecordOperation> samplingRecordOperationsIds = samplingRecordOperations.stream().filter(e -> e.getSamplingId().equals(tSamplingRecordVO.getId())).collect(Collectors.toList()); |
| | | // 如果samplingRecordOperationsIds的状态全部都为3 |
| | | if(!samplingRecordOperationsIds.stream().allMatch(e -> e.getStatus() == 3)){ |
| | | res.add(tSamplingRecordVO); |
| | | } |
| | | } |
| | | }else{ |
| | | res.add(tSamplingRecordVO); |
| | | } |
| | | } |
| | | // for (TSamplingRecordVO tSamplingRecordVO : list) { |
| | | // if (query.getRoleType()==5){ |
| | | // if (tSamplingRecordVO.getStatus()==1){ |
| | | // List<TSamplingRecordOperation> samplingRecordOperationsIds = samplingRecordOperations.stream().filter(e -> e.getSamplingId().equals(tSamplingRecordVO.getId())).collect(Collectors.toList()); |
| | | // // 如果samplingRecordOperationsIds的状态全部都为3 |
| | | // if(!samplingRecordOperationsIds.stream().allMatch(e -> e.getStatus() == 3)){ |
| | | // res.add(tSamplingRecordVO); |
| | | // } |
| | | // } |
| | | // }else{ |
| | | // res.add(tSamplingRecordVO); |
| | | // } |
| | | // } |
| | | List<String> recordIds = list.stream().map(TSamplingRecordVO::getId).collect(Collectors.toList()); |
| | | List<TSamplingRecordOperation> recordOperationList = samplingRecordOperationMapper.selectList(Wrappers.lambdaQuery(TSamplingRecordOperation.class) |
| | | .in(TSamplingRecordOperation::getSamplingId, recordIds)); |
| | |
| | | } |
| | | } |
| | | // 手动对res进行分页 |
| | | res = res.stream().skip((long) (query.getPageNum() - 1) * query.getPageSize()).limit(query.getPageSize()).collect(Collectors.toList()); |
| | | pageInfo.setTotal(res.size()); |
| | | pageInfo.setRecords(res); |
| | | // res = res.stream().skip((long) (query.getPageNum() - 1) * query.getPageSize()).limit(query.getPageSize()).collect(Collectors.toList()); |
| | | // pageInfo.setTotal(res.size()); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |