Преглед изворни кода

pms 油服生产概况推送 5号国 月度压裂层 年度压裂层

zhangcl пре 2 дана
родитељ
комит
b712968e4e

+ 18 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/job/dailyreport/CreateYfDailyReportStatisticsJob.java

@@ -501,8 +501,16 @@ public class CreateYfDailyReportStatisticsJob implements JobHandler {
             List<IotFiveDailyReportDO> fiveMonthReports = pageMonthFiveReports.getList();
             // 5号公司月完工井
             BigDecimal fiveMonthCompleteWells = BigDecimal.ZERO;
+            // 5号公司月压裂层
+            BigDecimal fiveMonthSumLayers = BigDecimal.ZERO;
             Set<Long> fiveMonthCompleteTaskIds = new HashSet<>();
             if (CollUtil.isNotEmpty(fiveMonthReports)) {
+                // 求和:所有日报压裂层 单位:层
+                fiveMonthSumLayers = fiveReports.stream()
+                        .map(IotFiveDailyReportDO::getDailyWorkingLayers)
+                        .filter(Objects::nonNull)
+                        .reduce(BigDecimal.ZERO, BigDecimal::add);
+
                 fiveMonthReports.forEach(report -> {
                     Long taskId = report.getTaskId();
                     String fiveStatus = report.getFiveStatus();
@@ -521,8 +529,16 @@ public class CreateYfDailyReportStatisticsJob implements JobHandler {
             List<IotFiveDailyReportDO> fiveYearReports = pageYearFiveReports.getList();
             // 5号公司 年完工井
             BigDecimal fiveYearCompleteWells = BigDecimal.ZERO;
+            // 5号公司年压裂层
+            BigDecimal fiveYearSumLayers = BigDecimal.ZERO;
             Set<Long> fiveYearCompleteTaskIds = new HashSet<>();
             if (CollUtil.isNotEmpty(fiveYearReports)) {
+                // 求和:所有日报压裂层 单位:层
+                fiveYearSumLayers = fiveReports.stream()
+                        .map(IotFiveDailyReportDO::getDailyWorkingLayers)
+                        .filter(Objects::nonNull)
+                        .reduce(BigDecimal.ZERO, BigDecimal::add);
+
                 fiveYearReports.forEach(report -> {
                     Long taskId = report.getTaskId();
                     String fiveStatus = report.getFiveStatus();
@@ -574,8 +590,8 @@ public class CreateYfDailyReportStatisticsJob implements JobHandler {
             finalMsgBuilder.append("═ ═ ═ ═ ═ ═ ═ ═  \n");
             finalMsgBuilder.append("公司:5#项目公司  \n");
             finalMsgBuilder.append("日压裂层:").append(fiveDaySumLayers).append(" 层  \n");
-            finalMsgBuilder.append("月完工井:").append(fiveMonthCompleteTaskIds.size()).append(" 井  \n");
-            finalMsgBuilder.append("年完工井:").append(fiveYearCompleteTaskIds.size()).append(" 井  \n");
+            finalMsgBuilder.append("月压裂层:").append(fiveMonthSumLayers).append(" 井  \n");
+            finalMsgBuilder.append("年压裂层:").append(fiveYearSumLayers).append(" 井  \n");
             finalMsgBuilder.append("设备利用率:").append(fiveDeviceUtilization).append("  \n");
             finalMsgBuilder.append("═ ═ ═ ═ ═ ═ ═ ═  \n");