Browse Source

报告记录时间筛选问题修复

fuyuchuan 6 months ago
parent
commit
3177251d14

+ 7 - 1
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkContentServiceImpl.java

@@ -180,6 +180,7 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
         LocalDateTime endDateTime = null;
         LocalDate start = null;
         LocalDate end = null;
+        List<PmWorkContent> workContentList = new ArrayList<>();
         List<Integer> reportIds = new ArrayList<>();
         if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
             DateTimeFormatter formatter = null;
@@ -195,9 +196,11 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
             LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
             reportQuery.select(PmWorkReport::getId).between(PmWorkReport::getReportDate, start, end);
             reportIds = pmWorkReportMapper.selectList(reportQuery).stream().map(PmWorkReport::getId).collect(Collectors.toList());
+            if (reportIds.isEmpty()){
+                return workContentList;
+            }
         }
 
-        List<PmWorkContent> workContentList = new ArrayList<>();
 
         LambdaQueryWrapper<PmWorkContent> contentLambdaQuery = Wrappers.lambdaQuery();
         contentLambdaQuery.select(PmWorkContent::getProjectId);
@@ -446,6 +449,9 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
             LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
             reportQuery.select(PmWorkReport::getId).eq(PmWorkReport::getReportStatus, 1).between(PmWorkReport::getReportDate, start, end);
             reportIds = pmWorkReportMapper.selectList(reportQuery).stream().map(PmWorkReport::getId).collect(Collectors.toList());
+            if (reportIds.isEmpty()){
+                return returnPage;
+            }
         }
 
         if (projectId != null && projectId > 0) {