Browse Source

Merge remote-tracking branch 'origin/master'

lipenghui 1 day ago
parent
commit
3c3ff4d690

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

@@ -994,6 +994,15 @@ public class IotRhDailyReportController {
                 // 赋值
                 reportVO.setTransitTimeRate(transitTimeRate);
             }
+
+            // 转换用电量 单位 kWh 转换成 MWh
+            // 用电量 kWh 转换单位 MWh
+            if (reportVO.getDailyPowerUsage().compareTo(BigDecimal.ZERO) > 0) {
+                BigDecimal powerW = reportVO.getDailyPowerUsage()
+                        .divide(BigDecimal.valueOf(1000), 4, RoundingMode.HALF_UP);
+                reportVO.setDailyPowerUsage(powerW);
+            }
+
             // 2.1 拼接部门信息
             findAndThen(deptMap, reportVO.getDeptId(), dept -> reportVO.setDeptName(dept.getName()));
 
@@ -1265,6 +1274,12 @@ public class IotRhDailyReportController {
                 // 赋值
                 reportVO.setTransitTimeRate(transitTimeRate);
             }
+            // 用电量 kWh 转换单位 MWh
+            if (reportVO.getDailyPowerUsage().compareTo(BigDecimal.ZERO) > 0) {
+                BigDecimal powerW = reportVO.getDailyPowerUsage()
+                        .divide(BigDecimal.valueOf(1000), 4, RoundingMode.HALF_UP);
+                reportVO.setDailyPowerUsage(powerW);
+            }
             // 2.1 拼接部门信息
             findAndThen(deptMap, reportVO.getDeptId(), dept -> reportVO.setDeptName(dept.getName()));
 

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

@@ -1381,14 +1381,15 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
                 if (ObjUtil.isNotEmpty(report.getDeptId()) && teamProjectIdPair.containsKey(report.getDeptId())) {
                     // projectDeptId可能是项目部 也可能是项目的上级
                     Long detailDeptId = 0l;
-                    if (teamDeptPair.containsKey(report.getDeptId())) {
+                    detailDeptId = report.getDeptId();
+                    /* if (teamDeptPair.containsKey(report.getDeptId())) {
                         // 日报deptId如果是队伍 获取队伍的上级项目部
                         detailDeptId = teamProjectIdPair.get(report.getDeptId());
                     }
                     if (projectDeptPair.containsKey(report.getDeptId())) {
                         // 日报deptId如果是项目部 使用当前项目部
                         detailDeptId = report.getDeptId();
-                    }
+                    } */
                     if (ObjUtil.isNotEmpty(detailDeptId) && (detailDeptId > 0)) {
                         if (cumulativeFuelsPair.containsKey(detailDeptId)) {
                             BigDecimal existTotalFuel = cumulativeFuelsPair.get(detailDeptId);
@@ -1516,7 +1517,29 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
             });
         }
 
-        // 生成返回的数据列表集合
+        // 项目部数据
+        projectDeptPair.forEach((projectDeptId, dept) -> {
+            IotRdDailyReportStatisticsRespVO statistics = new IotRdDailyReportStatisticsRespVO();
+            statistics.setTeamId(projectDeptId);
+            statistics.setProjectDeptName(dept.getName());
+            statistics.setSort(dept.getSort());
+            if (projectDeptPair.containsKey(projectDeptId)) {
+                statistics.setSort(0);
+                statistics.setType("2");
+            }
+            statistics.setCumulativeBridgePlug(cumulativeBridgePlugPair.get(projectDeptId));
+            statistics.setCumulativeRunCount(cumulativeRunCountPair.get(projectDeptId));
+            statistics.setCumulativeWorkingWell(cumulativeWorkingWellPair.get(projectDeptId));
+            statistics.setCumulativeHourCount(cumulativeHourCountPair.get(projectDeptId));
+            statistics.setCumulativeWaterVolume(cumulativeWaterVolumePair.get(projectDeptId));
+            statistics.setCumulativeWorkingLayers(cumulativeWorkingLayersPair.get(projectDeptId));
+            statistics.setCumulativeMixSand(cumulativeMixSandPair.get(projectDeptId));
+            statistics.setCumulativePumpTrips(cumulativePumpTripsPair.get(projectDeptId));
+            statistics.setTotalDailyFuel(cumulativeFuelsPair.get(projectDeptId));
+            result.add(statistics);
+        });
+
+        // 队伍数据  生成返回的数据列表集合
         teamDeptPair.forEach((teamDeptId, dept) -> {
             IotRdDailyReportStatisticsRespVO statistics = new IotRdDailyReportStatisticsRespVO();
             statistics.setTeamId(teamDeptId);
@@ -1525,10 +1548,6 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
             if (teamDeptPair.containsKey(teamDeptId)) {
                 statistics.setType("3");    // 最好是 项目部小队同时展示 因为有的瑞都日报挂在了项目部下
             }
-            if (projectDeptPair.containsKey(teamDeptId)) {
-                statistics.setSort(0);
-                statistics.setType("2");
-            }
             statistics.setCumulativeBridgePlug(cumulativeBridgePlugPair.get(teamDeptId));
             statistics.setCumulativeRunCount(cumulativeRunCountPair.get(teamDeptId));
             statistics.setCumulativeWorkingWell(cumulativeWorkingWellPair.get(teamDeptId));

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojecttask/IotRdDailyReportMapper.xml

@@ -305,6 +305,7 @@
         SELECT status AS status, COUNT(status) AS num FROM rq_iot_rd_daily_report a
         <where>
             a.deleted = 0
+            AND (a.platform_well = 0 OR a.platform_well = 1)
             <if test="reqVO.createTime[0] != null">
                 AND a.create_time &gt;= #{reqVO.createTime[0]}
             </if>