|
|
@@ -382,6 +382,21 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
devices.forEach(device -> {
|
|
|
deptIds.add(device.getDeptId());
|
|
|
});
|
|
|
+ // 根据部门id集合查询所有部门信息
|
|
|
+ // 查询所有部门信息
|
|
|
+ Map<Long, DeptDO> allDepts = deptService.getDeptMap(deptIds);
|
|
|
+ // 过滤后的所有部门信息
|
|
|
+ Map<Long, DeptDO> filteredDepts = new HashMap<>();
|
|
|
+ // 过滤掉部门中的 ‘项目部’
|
|
|
+ if (CollUtil.isNotEmpty(allDepts)) {
|
|
|
+ allDepts.forEach((deptId, dept) -> {
|
|
|
+ if (!dept.getName().contains("项目部") && !dept.getName().contains("瑞恒兴域")
|
|
|
+ && !dept.getName().contains("基地") && !dept.getName().contains("服务部")) {
|
|
|
+ filteredDepts.put(deptId, dept);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 比如有20个队伍 某个时间区间D内 必须有20*D份日报 时间区间最好是1天
|
|
|
// 查询出指定时间区间内 已经填写的日报数量
|
|
|
List<IotRhDailyReportDO> dailyReports = iotRhDailyReportMapper.dailyReports(reqVO);
|
|
|
@@ -396,7 +411,7 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
// 计算天数:日期差 + 1(包含首尾两天)
|
|
|
long days = ChronoUnit.DAYS.between(startDate, endDate) + 1;
|
|
|
// 计算指定时间区间内所有日报数量总数
|
|
|
- long totalRequiredReports = (long) deptIds.size() * days;
|
|
|
+ long totalRequiredReports = (long) filteredDepts.size() * days;
|
|
|
// 获取【实际已报的日报数量】
|
|
|
long totalReportedReports = CollUtil.isNotEmpty(dailyReports) ? dailyReports.size() : 0l;
|
|
|
// 计算指定时间区间内未填报的日报数量
|
|
|
@@ -530,6 +545,7 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
IotRhDailyReportStatisticsVO dailyReportVO = new IotRhDailyReportStatisticsVO();
|
|
|
dailyReportVO.setReportDate(reportDate);
|
|
|
dailyReportVO.setDeptNames(deptList.stream().collect(Collectors.joining(",")));
|
|
|
+ dailyReportVO.setCount(deptList.size());
|
|
|
results.add(dailyReportVO);
|
|
|
});
|
|
|
// 使用Comparator进行排序
|