Ver código fonte

Merge remote-tracking branch 'origin/master'

Zimo 2 dias atrás
pai
commit
21f13f1386

+ 57 - 5
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/IotRdDailyReportController.java

@@ -1377,6 +1377,9 @@ public class IotRdDailyReportController {
         // key 部门id-队伍id      value队伍工作量数据 台次 当日泵车台次 当日仪表/混砂
         Map<String, BigDecimal> groupMixSandPair = new HashMap<>();
 
+        // key 部门id-队伍id   value 累计完工井
+        Map<String, Set<Long>> groupFinishedWellPair = new HashMap<>();
+
         // key小组最后1条记录id   value 桥塞(个数)
         Map<Long, BigDecimal> groupIdBridgePlugPair = new HashMap<>();
         // key小组最后1条记录id      value趟数
@@ -1397,6 +1400,13 @@ public class IotRdDailyReportController {
         Map<Long, BigDecimal> groupIdMixSandPair = new HashMap<>();
         // 已经完工的任务id集合
         Set<Long> finishedTaskIds = new HashSet<>();
+
+        // key小组最后1条记录id      value累计完工井
+        Map<Long, Set<Long>> groupIdFinishedWellPair = new HashMap<>();
+
+        // keykey小组最后1条记录id   value完工井id集合
+        Map<Long, Set<Long>> cumulativeWellsPair = new HashMap<>();
+
         // key日报id   value生产动态明细
         Map<Long, List<IotRdDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
 
@@ -1426,7 +1436,7 @@ public class IotRdDailyReportController {
         if (CollUtil.isNotEmpty(deptTaskDailyReports)) {
             deptTaskDailyReports.forEach(report -> {
                 String uniqueKey = StrUtil.join("-", report.getDeptId(), report.getTaskId());
-
+                // 油耗
                 BigDecimal dailyFuel = report.getDailyFuel();
                 dailyFuel = ObjUtil.isEmpty(dailyFuel) ? BigDecimal.ZERO : dailyFuel;
                 if (groupFuelPair.containsKey(uniqueKey)) {
@@ -1436,6 +1446,20 @@ public class IotRdDailyReportController {
                 } else {
                     groupFuelPair.put(uniqueKey, dailyFuel);
                 }
+                // 累计完工井
+                // 日报关联的任务井id
+                Long taskId = report.getTaskId();
+                if (ObjUtil.isNotEmpty(taskId) && finishedTaskIds.contains(taskId)) {
+                    if (groupFinishedWellPair.containsKey(uniqueKey)) {
+                        Set<Long> existTaskIds = groupFinishedWellPair.get(uniqueKey);
+                        existTaskIds.add(taskId);
+                        groupFinishedWellPair.put(uniqueKey, existTaskIds);
+                    } else {
+                        Set<Long> existTaskIds = new HashSet<>();
+                        existTaskIds.add(taskId);
+                        groupFinishedWellPair.put(uniqueKey, existTaskIds);
+                    }
+                }
 
                 // 设置每个任务的工作量数据  单位相同的工作量值作合并处理
                 List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
@@ -1590,8 +1614,11 @@ public class IotRdDailyReportController {
                     if (groupRunCountPair.containsKey(uniqueKey)) {
                         groupIdRunCountPair.put(groupId, groupRunCountPair.get(uniqueKey));
                     }
-                    if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
+                    /* if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
                         groupIdCumulativeWorkingWellPair.put(groupId, groupCumulativeWorkingWellPair.get(uniqueKey));
+                    } */
+                    if (groupFinishedWellPair.containsKey(uniqueKey)) {
+                        groupIdFinishedWellPair.put(groupId, groupFinishedWellPair.get(uniqueKey));
                     }
                     if (groupHourCountPair.containsKey(uniqueKey)) {
                         groupIdHourCountPair.put(groupId, groupHourCountPair.get(uniqueKey));
@@ -1965,7 +1992,7 @@ public class IotRdDailyReportController {
             // 趟数
             findAndThen(groupIdRunCountPair, reportVO.getId(), runCount -> reportVO.setGroupIdRunCount(runCount));
             // 井数
-            findAndThen(groupIdCumulativeWorkingWellPair, reportVO.getId(), workingWell -> reportVO.setGroupIdCumulativeWorkingWell(workingWell));
+            findAndThen(groupIdFinishedWellPair, reportVO.getId(), workingWells -> reportVO.setGroupIdCumulativeWorkingWell(new BigDecimal(workingWells.size())));
             // 小时H
             findAndThen(groupIdHourCountPair, reportVO.getId(), hourCount -> reportVO.setGroupIdHourCount(hourCount));
             // 油耗
@@ -2031,6 +2058,9 @@ public class IotRdDailyReportController {
         // key 部门id-队伍id      value队伍工作量数据 台次 当日泵车台次 当日仪表/混砂
         Map<String, BigDecimal> groupMixSandPair = new HashMap<>();
 
+        // key 部门id-队伍id   value 完工井id集合
+        Map<String, Set<Long>> groupFinishedWellPair = new HashMap<>();
+
         // key小组最后1条记录id   value 桥塞(个数)
         Map<Long, BigDecimal> groupIdBridgePlugPair = new HashMap<>();
         // key小组最后1条记录id      value趟数
@@ -2051,6 +2081,10 @@ public class IotRdDailyReportController {
         Map<Long, BigDecimal> groupIdMixSandPair = new HashMap<>();
         // 已经完工的任务id集合
         Set<Long> finishedTaskIds = new HashSet<>();
+
+        // key小组最后1条记录id      value完工井id集合
+        Map<Long, Set<Long>> groupIdFinishedWellPair = new HashMap<>();
+
         // key日报id   value生产动态明细
         Map<Long, List<IotRdDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
 
@@ -2094,6 +2128,21 @@ public class IotRdDailyReportController {
                     groupFuelPair.put(uniqueKey, dailyFuel);
                 }
 
+                // 累计完工井
+                // 日报关联的任务井id
+                Long taskId = report.getTaskId();
+                if (ObjUtil.isNotEmpty(taskId) && finishedTaskIds.contains(taskId)) {
+                    if (groupFinishedWellPair.containsKey(uniqueKey)) {
+                        Set<Long> existTaskIds = groupFinishedWellPair.get(uniqueKey);
+                        existTaskIds.add(taskId);
+                        groupFinishedWellPair.put(uniqueKey, existTaskIds);
+                    } else {
+                        Set<Long> existTaskIds = new HashSet<>();
+                        existTaskIds.add(taskId);
+                        groupFinishedWellPair.put(uniqueKey, existTaskIds);
+                    }
+                }
+
                 // 设置每个任务的工作量数据  单位相同的工作量值作合并处理
                 List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
                 // 暂存不同单位的工作量属性值
@@ -2247,8 +2296,11 @@ public class IotRdDailyReportController {
                     if (groupRunCountPair.containsKey(uniqueKey)) {
                         groupIdRunCountPair.put(groupId, groupRunCountPair.get(uniqueKey));
                     }
-                    if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
+                    /* if (groupCumulativeWorkingWellPair.containsKey(uniqueKey)) {
                         groupIdCumulativeWorkingWellPair.put(groupId, groupCumulativeWorkingWellPair.get(uniqueKey));
+                    } */
+                    if (groupFinishedWellPair.containsKey(uniqueKey)) {
+                        groupIdFinishedWellPair.put(groupId, groupFinishedWellPair.get(uniqueKey));
                     }
                     if (groupHourCountPair.containsKey(uniqueKey)) {
                         groupIdHourCountPair.put(groupId, groupHourCountPair.get(uniqueKey));
@@ -2628,7 +2680,7 @@ public class IotRdDailyReportController {
             // 趟数
             findAndThen(groupIdRunCountPair, reportVO.getId(), runCount -> reportVO.setGroupIdRunCount(runCount));
             // 井数
-            findAndThen(groupIdCumulativeWorkingWellPair, reportVO.getId(), workingWell -> reportVO.setGroupIdCumulativeWorkingWell(workingWell));
+            findAndThen(groupIdFinishedWellPair, reportVO.getId(), workingWells -> reportVO.setGroupIdCumulativeWorkingWell(new BigDecimal(workingWells.size())));
             // 小时H
             findAndThen(groupIdHourCountPair, reportVO.getId(), hourCount -> reportVO.setGroupIdHourCount(hourCount));
             // 油耗

+ 84 - 32
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/stat/IotStaticController.java

@@ -2670,6 +2670,9 @@ public class IotStaticController {
         // key施工队伍id   value状态为LY的项目部id
         Map<Long, Long> teamProjectIdPair = new HashMap<>();
 
+        // key施工队伍id   value队伍上级项目部id
+        Map<Long, Long> teamIdProjectIdPair = new HashMap<>();
+
         // key项目部id     value项目部年累计注气量
         Map<Long, BigDecimal> projectYearGasInjectionPair = new HashMap<>();
         // key项目部id     value项目部年累计注水量
@@ -2741,6 +2744,9 @@ public class IotStaticController {
                             // 设置队伍与上级项目部的关联关系集合
                             teamProjectIdPair.put(dept.getId(), dept.getParentId());
                         }
+                        if (projectDeptId.equals(dept.getParentId()) && teamDepartmentIds.contains(deptId)) {
+                            teamIdProjectIdPair.put(dept.getId(), dept.getParentId());
+                        }
                     });
                 }
             });
@@ -2768,27 +2774,13 @@ public class IotStaticController {
 
         if (CollUtil.isNotEmpty(yearDailyReports)) {
             yearDailyReports.forEach(yearReport -> {
+                Long deptId = yearReport.getDeptId();
+                BigDecimal dailyGasInjection = yearReport.getDailyGasInjection();
+                BigDecimal dailyWaterInjection = yearReport.getDailyWaterInjection();
+
                 if (CollUtil.isNotEmpty(projectTeamPair)) {
-                    projectTeamPair.forEach((projectDeptId, teamDeptIds) -> {
-                        if (teamDeptIds.contains(yearReport.getDeptId())) {
-                            BigDecimal dailyGasInjection = yearReport.getDailyGasInjection();
-                            BigDecimal dailyWaterInjection = yearReport.getDailyWaterInjection();
-                            // 项目部 年累计注气量
-                            if (projectYearGasInjectionPair.containsKey(projectDeptId)) {
-                                BigDecimal tempGasInjection = projectYearGasInjectionPair.get(projectDeptId);
-                                BigDecimal subtotal = tempGasInjection.add(dailyGasInjection);
-                                projectYearGasInjectionPair.put(projectDeptId, subtotal);
-                            } else {
-                                projectYearGasInjectionPair.put(projectDeptId, dailyGasInjection);
-                            }
-                            // 项目部 年累计注水量
-                            if (projectYearWaterInjectionPair.containsKey(projectDeptId)) {
-                                BigDecimal tempWaterInjection = projectYearWaterInjectionPair.get(projectDeptId);
-                                BigDecimal subtotal = tempWaterInjection.add(dailyWaterInjection);
-                                projectYearWaterInjectionPair.put(projectDeptId, subtotal);
-                            } else {
-                                projectYearWaterInjectionPair.put(projectDeptId, dailyWaterInjection);
-                            }
+                    /* projectTeamPair.forEach((projectDeptId, teamDeptIds) -> {
+                        if (teamDeptIds.contains(deptId)) {
                             // 各项目部年度 运行时效(按小时统计的设备利用率)
                             // 按小时数 统计设备利用率
                             BigDecimal gasInjectionTime = ObjUtil.defaultIfNull(yearReport.getDailyInjectGasTime(), BigDecimal.ZERO);
@@ -2803,7 +2795,46 @@ public class IotStaticController {
                                 projectYearWorkTimePair.merge(projectDeptId, workTime, BigDecimal::add);
                             }
                         }
-                    });
+                    }); */
+
+                    // 设置各项目部 按照时间统计的 设备利用率
+                    // 各项目部年度 运行时效(按小时统计的设备利用率)
+                    // 按小时数 统计设备利用率
+                    BigDecimal gasInjectionTime = ObjUtil.defaultIfNull(yearReport.getDailyInjectGasTime(), BigDecimal.ZERO);
+                    BigDecimal waterInjectionTime = ObjUtil.defaultIfNull(yearReport.getDailyInjectWaterTime(), BigDecimal.ZERO);
+                    // 取 注气时间 注水时间 的较大者
+                    BigDecimal workTime = gasInjectionTime.compareTo(BigDecimal.ZERO) > 0
+                            ? gasInjectionTime
+                            : waterInjectionTime.compareTo(BigDecimal.ZERO) > 0
+                            ? waterInjectionTime
+                            : BigDecimal.ZERO;
+                    if (workTime.compareTo(BigDecimal.ZERO) > 0) {
+                        Long projectDeptId = teamProjectIdPair.get(deptId);
+                        if (ObjUtil.isNotEmpty(projectDeptId) && projectTeamPair.containsKey(projectDeptId)) {
+                            projectYearWorkTimePair.merge(projectDeptId, workTime, BigDecimal::add);
+                        }
+                    }
+                }
+
+                // 年累计的工作量 注气 注水 运行时效 不考虑队伍是否包含主设备
+                if (teamIdProjectIdPair.containsKey(deptId)) {
+                    Long projectDeptId = teamIdProjectIdPair.get(deptId);
+                    // 项目部 年累计注气量
+                    if (projectYearGasInjectionPair.containsKey(projectDeptId)) {
+                        BigDecimal tempGasInjection = projectYearGasInjectionPair.get(projectDeptId);
+                        BigDecimal subtotal = tempGasInjection.add(dailyGasInjection);
+                        projectYearGasInjectionPair.put(projectDeptId, subtotal);
+                    } else {
+                        projectYearGasInjectionPair.put(projectDeptId, dailyGasInjection);
+                    }
+                    // 项目部 年累计注水量
+                    if (projectYearWaterInjectionPair.containsKey(projectDeptId)) {
+                        BigDecimal tempWaterInjection = projectYearWaterInjectionPair.get(projectDeptId);
+                        BigDecimal subtotal = tempWaterInjection.add(dailyWaterInjection);
+                        projectYearWaterInjectionPair.put(projectDeptId, subtotal);
+                    } else {
+                        projectYearWaterInjectionPair.put(projectDeptId, dailyWaterInjection);
+                    }
                 }
             });
         }
@@ -2845,9 +2876,13 @@ public class IotStaticController {
 
             // 整理出每个项目部下的队伍填报的日报数量
             dailyReports.forEach(report -> {
+                Long deptId = report.getDeptId();
+                BigDecimal dailyGasInjection = report.getDailyGasInjection();
+                BigDecimal dailyWaterInjection = report.getDailyWaterInjection();
+
                 if (CollUtil.isNotEmpty(projectTeamPair)) {
                     projectTeamPair.forEach((projectDeptId, teamDeptIds) -> {
-                        if (teamDeptIds.contains(report.getDeptId())) {
+                        if (teamDeptIds.contains(deptId)) {
                             // 以施工区域为维度统计 队伍总数 施工队伍数 准备队伍数 待命队伍数量
                             Long taskId = report.getTaskId();
                             String taskLocation = StrUtil.EMPTY;
@@ -2855,16 +2890,13 @@ public class IotStaticController {
                                 taskLocation = taskLocationPair.get(taskId);
                             }
 
-                            BigDecimal dailyGasInjection = report.getDailyGasInjection();
-                            BigDecimal dailyWaterInjection = report.getDailyWaterInjection();
-
                             // 项目部下 施工区域内 队伍总数量
                             if (StrUtil.isNotBlank(taskLocation)) {
                                 // 总队伍(去重)
                                 projectLocationTeamSet
                                         .computeIfAbsent(projectDeptId, k -> new HashMap<>())
                                         .computeIfAbsent(taskLocation, k -> new HashSet<>())
-                                        .add(report.getDeptId());
+                                        .add(deptId);
                             }
 
                             if (dailyGasInjection.compareTo(BigDecimal.ZERO) > 0 || dailyWaterInjection.compareTo(BigDecimal.ZERO) > 0) {
@@ -2876,7 +2908,7 @@ public class IotStaticController {
                                     projectReportPair.put(projectDeptId, 1);
                                 }
                                 // 施工队伍数量
-                                if (haveDeviceDeptIds.contains(report.getDeptId())) {
+                                if (haveDeviceDeptIds.contains(deptId)) {
                                     if (sgTeamCountPair.containsKey(projectDeptId)) {
                                         Integer tempCount = sgTeamCountPair.get(projectDeptId);
                                         sgTeamCountPair.put(projectDeptId, ++tempCount);
@@ -2889,7 +2921,7 @@ public class IotStaticController {
                                     projectLocationSgTeamSet
                                             .computeIfAbsent(projectDeptId, k -> new HashMap<>())
                                             .computeIfAbsent(taskLocation, k -> new HashSet<>())
-                                            .add(report.getDeptId());
+                                            .add(deptId);
                                 }
                             }
 
@@ -2905,21 +2937,21 @@ public class IotStaticController {
                             }
 
                             // 项目部 指定时间的注气量
-                            if (projectGasInjectionPair.containsKey(projectDeptId)) {
+                            /* if (projectGasInjectionPair.containsKey(projectDeptId)) {
                                 BigDecimal tempGasInjection = projectGasInjectionPair.get(projectDeptId);
                                 BigDecimal subtotal = tempGasInjection.add(dailyGasInjection);
                                 projectGasInjectionPair.put(projectDeptId, subtotal);
                             } else {
                                 projectGasInjectionPair.put(projectDeptId, dailyGasInjection);
-                            }
+                            } */
                             // 项目部 指定时间的注水量
-                            if (projectWaterInjectionPair.containsKey(projectDeptId)) {
+                            /* if (projectWaterInjectionPair.containsKey(projectDeptId)) {
                                 BigDecimal tempWaterInjection = projectWaterInjectionPair.get(projectDeptId);
                                 BigDecimal subtotal = tempWaterInjection.add(dailyWaterInjection);
                                 projectWaterInjectionPair.put(projectDeptId, subtotal);
                             } else {
                                 projectWaterInjectionPair.put(projectDeptId, dailyWaterInjection);
-                            }
+                            } */
 
                             // 日报关联的任务井号
                             Long reportTaskId = report.getTaskId();
@@ -2972,6 +3004,26 @@ public class IotStaticController {
                         }
                     });
                 }
+                // 统计所有队伍的注气量 注水量 不区分是否包含主设备
+                if (teamIdProjectIdPair.containsKey(deptId)) {
+                    Long projectId = teamIdProjectIdPair.get(deptId);
+                    // 项目部 指定时间的注气量
+                    if (projectGasInjectionPair.containsKey(projectId)) {
+                        BigDecimal tempGasInjection = projectGasInjectionPair.get(projectId);
+                        BigDecimal subtotal = tempGasInjection.add(dailyGasInjection);
+                        projectGasInjectionPair.put(projectId, subtotal);
+                    } else {
+                        projectGasInjectionPair.put(projectId, dailyGasInjection);
+                    }
+                    // 项目部 指定时间的注水量
+                    if (projectWaterInjectionPair.containsKey(projectId)) {
+                        BigDecimal tempWaterInjection = projectWaterInjectionPair.get(projectId);
+                        BigDecimal subtotal = tempWaterInjection.add(dailyWaterInjection);
+                        projectWaterInjectionPair.put(projectId, subtotal);
+                    } else {
+                        projectWaterInjectionPair.put(projectId, dailyWaterInjection);
+                    }
+                }
             });
             // 计算指定时间区间内包含的天数
             long daysCount;

+ 41 - 8
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrddailyreport/IotRdDailyReportServiceImpl.java

@@ -1250,6 +1250,11 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
         // key工作量标识   value累计 台次 当日泵车台次
         Map<String, BigDecimal> cumulativePumpTripsPair = new HashMap<>();
 
+        // 已经完工的任务id集合
+        Set<Long> finishedTaskIds = new HashSet<>();
+        // key井唯一标识   value累计完工井id集合
+        Map<String, Set<Long>> cumulativeWellsPair = new HashMap<>();
+
         // 查询 瑞都 施工状态 字典数据 筛选出施工设备为 LY 的记录
         Set<String> lyStatuses = new HashSet<>();
         List<DictDataDO> rdStatuses = dictDataService.getDictDataListByDictType("rdStatus");
@@ -1326,6 +1331,21 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
         List<IotRdDailyReportDO> dailyReports = iotRdDailyReportMapper.dailyReports(pageReqVO);
         // 累加所有日报的 工作量 数据 油耗 桥塞 趟数 井数...
         if (CollUtil.isNotEmpty(dailyReports)) {
+            // 遍历日报 找到每个日报关联的任务的 施工队伍
+            List<Long> taskIds = convertList(dailyReports, IotRdDailyReportDO::getTaskId);
+            Set<Long> uniqueTaskIds = new HashSet<>(taskIds);
+            IotProjectTaskPageReqVO relatedTaskReqVO = new IotProjectTaskPageReqVO();
+            relatedTaskReqVO.setTaskIds(new ArrayList<>(uniqueTaskIds));
+            List<IotProjectTaskDO> relatedTasks = iotProjectTaskMapper.selectList(relatedTaskReqVO);
+            if (CollUtil.isNotEmpty(relatedTasks)) {
+                relatedTasks.forEach(task -> {
+                    // 筛选出 完工 的任务集合 任务完工 施工井数 +1
+                    if ("wg".equals(task.getRdStatus())) {
+                        finishedTaskIds.add(task.getId());
+                    }
+                });
+            }
+
             // 筛选出所有日报关联的任务集合
             dailyReports.forEach(report -> {
                 // 筛选出日报中施工的 主设备id 集合
@@ -1336,9 +1356,22 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
                             .filter(abDeviceIds::contains)
                             .forEach(reportMainDeviceIds::add);
                 }
-                /* if (CollUtil.isNotEmpty(report.getDeviceIds())) {
-                    reportDeviceIds.addAll(report.getDeviceIds());
-                } */
+                // 累计完工井
+                // 日报关联的任务井id
+                Long taskId = report.getTaskId();
+                if (ObjUtil.isNotEmpty(taskId) && finishedTaskIds.contains(taskId)) {
+                    // 统计各项目部下的完工井
+                    if (cumulativeWellsPair.containsKey("cumulativeWorkingWell")) {
+                        Set<Long> existTaskIds = cumulativeWellsPair.get("cumulativeWorkingWell");
+                        existTaskIds.add(taskId);
+                        cumulativeWellsPair.put("cumulativeWorkingWell", existTaskIds);
+                    } else {
+                        Set<Long> existTaskIds = new HashSet<>();
+                        existTaskIds.add(taskId);
+                        cumulativeWellsPair.put("cumulativeWorkingWell", existTaskIds);
+                    }
+                }
+                // 油耗
                 BigDecimal dailyFuel = report.getDailyFuel();
                 dailyFuel = ObjUtil.isEmpty(dailyFuel) ? BigDecimal.ZERO : dailyFuel;
                 if (cumulativeFuelsPair.containsKey("cumulativeFuels")) {
@@ -1519,12 +1552,12 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
             waterVolumeResp.setDeptName("cumulativeWaterVolume");
             result.add(waterVolumeResp);
         }
-        if (CollUtil.isNotEmpty(cumulativeWorkingWellPair)) {
-            Collection<BigDecimal> cumulativeWorkingWells = cumulativeWorkingWellPair.values();
-            Optional<BigDecimal> workingWells = cumulativeWorkingWells.stream().findAny();
-            BigDecimal workingWell = workingWells.get();
+        if (CollUtil.isNotEmpty(cumulativeWellsPair)) {
+            Collection<Set<Long>> taskIds = cumulativeWellsPair.values();
+            Optional<Set<Long>> workingWells = taskIds.stream().findAny();
+            Set<Long> workingWell = workingWells.get();
             IotRdDailyReportStatisticsRespVO workingWellResp = new IotRdDailyReportStatisticsRespVO();
-            workingWellResp.setCumulativeWorkingWell(workingWell);
+            workingWellResp.setCumulativeWorkingWell(new BigDecimal(workingWell.size()));
             workingWellResp.setDeptName("cumulativeWorkingWell");
             result.add(workingWellResp);
         }

+ 4 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/maintain/IotMaintainServiceImpl.java

@@ -416,6 +416,10 @@ public class IotMaintainServiceImpl implements IotMaintainService {
             ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
             ids.add(pageReqVO.getDeptId());
         }
+        Set<Long> deptIds = pageReqVO.getDeptIds();
+        if (CollUtil.isNotEmpty(deptIds)) {
+            ids.addAll(deptIds);
+        }
         return iotMaintainMapper.selectPage(pageReqVO, ids);
     }