|
@@ -146,10 +146,36 @@ public class CwProjectReportArchiveService extends ServiceImpl<CwProjectReportAr
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public IPage<ReportDTO> findReportList(Page<ReportDTO> page, ReportDTO reportDTO) throws Exception{
|
|
|
+ String repId = "";
|
|
|
+ if (ObjectUtil.isNotEmpty(reportDTO)) {
|
|
|
+ if (StringUtils.isNotBlank(reportDTO.getAchiveId())) {
|
|
|
+ CwProjectReportArchive byId = this.getById(reportDTO.getAchiveId());
|
|
|
+ if (ObjectUtil.isNotEmpty(byId)) {
|
|
|
+ if (StringUtils.isNotBlank(byId.getReportId())) {
|
|
|
+ repId = byId.getReportId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String finalRepId = repId;
|
|
|
+ List<String> reportIds = this.list().stream().filter(item -> {
|
|
|
+ if (StringUtils.isNotBlank(item.getReportId())) {
|
|
|
+ if (StringUtils.isNotBlank(finalRepId)) {
|
|
|
+ if (item.getReportId().equals(finalRepId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }).distinct().map(CwProjectReportArchive::getReportId).collect(Collectors.toList());
|
|
|
QueryWrapper<ReportDTO> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("cw_pr.del_flag","0");
|
|
|
queryWrapper.orderByDesc("cw_pr.create_date");
|
|
|
queryWrapper.eq("cw_pr.status", "5");
|
|
|
+ if (CollectionUtil.isNotEmpty(reportIds)) {
|
|
|
+ queryWrapper.notIn("cw_pr.id",reportIds);
|
|
|
+ }
|
|
|
if (ObjectUtil.isNotEmpty(reportDTO)) {
|
|
|
if (StringUtils.isNotBlank(reportDTO.getProjectId())) {
|
|
|
queryWrapper.eq("cw_pr.project_id",reportDTO.getProjectId());
|