Ver código fonte

pms 瑞恒 单井队伍统计 单位

zhangcl 1 dia atrás
pai
commit
6b9c334504

+ 10 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/IotRhDailyReportController.java

@@ -1271,11 +1271,19 @@ public class IotRhDailyReportController {
             // 小组内最后1条记录标识
             findAndThen(groupIdGasInjectionPair, reportVO.getId(), gasInjection -> reportVO.setLastGroupIdFlag(true));
             // 小组内累计注气量
-            findAndThen(groupIdGasInjectionPair, reportVO.getId(), gasInjection -> reportVO.setGroupIdGasInjection(gasInjection));
+            findAndThen(groupIdGasInjectionPair, reportVO.getId(), gasInjection -> {
+                BigDecimal gasInjectionWanFang = gasInjection
+                        .divide(BigDecimal.valueOf(10000), 4, RoundingMode.HALF_UP);
+                reportVO.setGroupIdGasInjection(gasInjectionWanFang);
+            });
             // 小组内累计注水量
             findAndThen(groupIdWaterInjectionPair, reportVO.getId(), waterInjection -> reportVO.setGroupIdWaterInjection(waterInjection));
             // 小组内累计用电量
-            findAndThen(groupIdPowerPair, reportVO.getId(), power -> reportVO.setGroupIdPower(power));
+            findAndThen(groupIdPowerPair, reportVO.getId(), power -> {
+                BigDecimal powerW = power
+                        .divide(BigDecimal.valueOf(1000), 4, RoundingMode.HALF_UP);
+                reportVO.setGroupIdPower(powerW);
+            });
             // 小组内累计油耗
             findAndThen(groupIdFuelPair, reportVO.getId(), fuel -> reportVO.setGroupIdFuel(fuel));
             // 小组内累计注气时间

+ 14 - 4
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrhdailyreport/IotRhDailyReportServiceImpl.java

@@ -1013,7 +1013,8 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
 
         // 构建项目部映射和父子部门关系
         depts.forEach(dept -> {
-            if ("2".equals(dept.getType())) {
+            // 暂时过滤掉 欧洲项目部 克拉玛依项目部
+            if ("2".equals(dept.getType()) && dept.getId() != 352 && dept.getId() != 166) {
                 // 项目部
                 projectDeptIds.add(dept.getId());
                 projectDeptPair.put(dept.getId(), dept);
@@ -1035,11 +1036,20 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
                 LocalDate endLocalDate = endTime.toLocalDate();
                 if (startLocalDate.isEqual(endLocalDate)) {
                     // 查询日期区间是 同一天
-                    // 设置每个项目部下的队伍数量
+                    // 设置每个项目部下的队伍数量 只筛选 包含设备的队伍数量
+                    Set<Long> deviceDeptIds = new HashSet<>();
+                    IotDevicePageReqVO deviceReqVO = new IotDevicePageReqVO();
+                    deviceReqVO.setDeptIds(new ArrayList<>(allRhChildDeptIds));
+                    List<IotDeviceDO> devices = iotDeviceMapper.selectListAlone(deviceReqVO);
+                    if (CollUtil.isNotEmpty(devices)) {
+                        devices.forEach(device -> {
+                            deviceDeptIds.add(device.getDeptId());
+                        });
+                    }
                     projectDeptPair.forEach((projectDeptId, projectDept) -> {
-                        // 找到每个项目部下的队伍
+                        // 找到每个项目部下的队伍 只筛选 包含设备的队伍
                         teamProjectIdPair.forEach((deptId, parentDeptId) -> {
-                            if (parentDeptId.equals(projectDeptId)) {
+                            if (parentDeptId.equals(projectDeptId) && deviceDeptIds.contains(deptId)) {
                                 if (teamCountPair.containsKey(projectDeptId)) {
                                     Integer tempCount = teamCountPair.get(projectDeptId);
                                     teamCountPair.put(projectDeptId, ++tempCount);