Explorar el Código

Merge remote-tracking branch 'origin/master'

lipenghui hace 2 semanas
padre
commit
07c57421a1
Se han modificado 12 ficheros con 1214 adiciones y 148 borrados
  1. 297 4
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/IotRdDailyReportController.java
  2. 35 75
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportRespVO.java
  3. 112 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportStatisticsRespExportVO.java
  4. 10 11
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportStatisticsRespVO.java
  5. 430 6
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/IotRhDailyReportController.java
  6. 5 8
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/vo/IotRhDailyReportRespVO.java
  7. 118 8
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/IotRyDailyReportController.java
  8. 30 34
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportRespVO.java
  9. 8 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportStatisticsRespVO.java
  10. 81 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyXjDailyReportStatisticsRespVO.java
  11. 80 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyZjDailyReportStatisticsRespVO.java
  12. 8 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrddailyreport/IotRdDailyReportServiceImpl.java

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

@@ -66,6 +66,7 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -1273,6 +1274,16 @@ public class IotRdDailyReportController {
             }
         });
 
+        // key施工状态数据字典value   value施工状态数据字典label
+        Map<String, String> constructStatusPair = new HashMap<>();
+        // 施工状态 字典数据
+        List<DictDataDO> rdStatusData = dictDataService.getDictDataListByDictType("rdStatus");
+        if (CollUtil.isNotEmpty(rdStatusData)) {
+            rdStatusData.forEach(data -> {
+                constructStatusPair.put(data.getValue(), data.getLabel());
+            });
+        }
+
         DataPermissionUtils.executeIgnore(() -> {
             // 查询日报关联的项目信息
             IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
@@ -1510,6 +1521,16 @@ public class IotRdDailyReportController {
             }
         });
         return BeanUtils.toBean(reports, IotRdDailyReportRespVO.class, (reportVO) -> {
+            // 施工状态 导出使用
+            if (StrUtil.isNotBlank(reportVO.getRdStatus())) {
+                if (constructStatusPair.containsKey(reportVO.getRdStatus())) {
+                    reportVO.setRdStatusLabel(constructStatusPair.get(reportVO.getRdStatus()));
+                }
+            }
+            // 创建时间 格式化 yyyy-MM-dd
+            if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
+                reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
+            }
             // 部门信息 任务中关联的施工队伍
             findAndThen(taskTeamsPair, reportVO.getTaskId(), deptNames -> reportVO.setDeptName(deptNames));
             // 日报关联的项目信息
@@ -1816,6 +1837,16 @@ public class IotRdDailyReportController {
             }
         });
 
+        // key施工状态数据字典value   value施工状态数据字典label
+        Map<String, String> constructStatusPair = new HashMap<>();
+        // 施工状态 字典数据
+        List<DictDataDO> rdStatusData = dictDataService.getDictDataListByDictType("rdStatus");
+        if (CollUtil.isNotEmpty(rdStatusData)) {
+            rdStatusData.forEach(data -> {
+                constructStatusPair.put(data.getValue(), data.getLabel());
+            });
+        }
+
         DataPermissionUtils.executeIgnore(() -> {
             // 查询日报关联的项目信息
             IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
@@ -2053,6 +2084,16 @@ public class IotRdDailyReportController {
             }
         });
         return BeanUtils.toBean(reports, IotRdDailyReportRespVO.class, (reportVO) -> {
+            // 创建时间格式化 yyyy-MM-dd 导出
+            if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
+                reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
+            }
+            // 施工状态 导出使用
+            if (StrUtil.isNotBlank(reportVO.getRdStatus())) {
+                if (constructStatusPair.containsKey(reportVO.getRdStatus())) {
+                    reportVO.setRdStatusLabel(constructStatusPair.get(reportVO.getRdStatus()));
+                }
+            }
             // 部门信息 任务中关联的施工队伍
             findAndThen(taskTeamsPair, reportVO.getTaskId(), deptNames -> reportVO.setDeptName(deptNames));
             // 日报关联的项目信息
@@ -2159,6 +2200,15 @@ public class IotRdDailyReportController {
         Map<String, String> relatedWellStatusPair = new HashMap<>();
         // key关联井任务id     value关联井号
         Map<Long, String> relatedPlatformsPair = new HashMap<>();
+        // key施工状态数据字典value   value施工状态数据字典label
+        Map<String, String> constructStatusPair = new HashMap<>();
+        // 施工状态 字典数据
+        List<DictDataDO> rdStatusData = dictDataService.getDictDataListByDictType("rdStatus");
+        if (CollUtil.isNotEmpty(rdStatusData)) {
+            rdStatusData.forEach(data -> {
+                constructStatusPair.put(data.getValue(), data.getLabel());
+            });
+        }
         DataPermissionUtils.executeIgnore(() -> {
             // 查询日报关联的项目信息
             IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
@@ -2396,6 +2446,16 @@ public class IotRdDailyReportController {
             }
         });
         return BeanUtils.toBean(reports, IotRdDailyReportRespVO.class, (reportVO) -> {
+            // 施工状态 导出使用
+            if (StrUtil.isNotBlank(reportVO.getRdStatus())) {
+                if (constructStatusPair.containsKey(reportVO.getRdStatus())) {
+                    reportVO.setRdStatusLabel(constructStatusPair.get(reportVO.getRdStatus()));
+                }
+            }
+            // 创建时间 格式化 yyyy-MM-dd
+            if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
+                reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
+            }
             // 部门信息 任务中关联的施工队伍
             findAndThen(taskTeamsPair, reportVO.getTaskId(), deptNames -> reportVO.setDeptName(deptNames));
             // 日报关联的项目信息
@@ -2423,16 +2483,249 @@ public class IotRdDailyReportController {
     }
 
     @GetMapping("/export-excel")
-    @Operation(summary = "导出瑞都日报 Excel")
+    @Operation(summary = "导出瑞都日报汇总 Excel")
     @PreAuthorize("@ss.hasPermission('pms:iot-rd-daily-report:export')")
     @ApiAccessLog(operateType = EXPORT)
     public void exportIotRdDailyReportExcel(@Valid IotRdDailyReportPageReqVO pageReqVO,
               HttpServletResponse response) throws IOException {
         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
-        List<IotRdDailyReportDO> list = iotRdDailyReportService.getIotRdDailyReportPage(pageReqVO).getList();
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 分页查询
+        Set<Long> projectIds = new HashSet<>();
+        Set<Long> taskIds = new HashSet<>();
+        if (StrUtil.isNotBlank(pageReqVO.getContractName())) {
+            IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
+            reqVO.setContractName(pageReqVO.getContractName());
+            List<IotProjectInfoDO> projects = iotProjectInfoService.getIotProjectInfos(reqVO);
+            if (CollUtil.isNotEmpty(projects)) {
+                projects.forEach(project -> {
+                    projectIds.add(project.getId());
+                });
+                pageReqVO.setProjectIds(projectIds);
+            }
+        }
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName())) {
+            IotProjectTaskPageReqVO reqVO = new IotProjectTaskPageReqVO();
+            reqVO.setSearchKey(pageReqVO.getTaskName());
+            List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(reqVO);
+            if (CollUtil.isNotEmpty(tasks)) {
+                tasks.forEach(task -> {
+                    taskIds.add(task.getId());
+                });
+                pageReqVO.setTaskIds(taskIds);
+            }
+        }
+        List<IotRdDailyReportStatisticsRespVO> result = iotRdDailyReportService.statistics(pageReqVO);
+        // 提取出所有工作量数据
+        if (CollUtil.isNotEmpty(result)) {
+            // key施工状态数据字典value   value施工状态数据字典label
+            Map<String, String> constructStatusPair = new HashMap<>();
+            // 施工状态 字典数据
+            List<DictDataDO> rdStatusData = dictDataService.getDictDataListByDictType("rdStatus");
+            if (CollUtil.isNotEmpty(rdStatusData)) {
+                rdStatusData.forEach(data -> {
+                    constructStatusPair.put(data.getValue(), data.getLabel());
+                });
+            }
+
+            result.forEach(well -> {
+                // 施工状态
+                if (constructStatusPair.containsKey(well.getRdStatus())) {
+                    well.setRdStatusLabel(constructStatusPair.get(well.getRdStatus()));
+                }
+                // 统计了井信息
+                List<IotRdDailyReportStatisticsItemVO> items = well.getItems();
+                if (CollUtil.isNotEmpty(items)) {
+                    items.forEach(item -> {
+                        // 设置每个工作量的值
+                        if ("个数".equals(item.getUnit())) {
+                            well.setCumulativeBridgePlug(item.getWorkload());
+                        }
+                        if ("趟数".equals(item.getUnit())) {
+                            well.setCumulativeRunCount(item.getWorkload());
+                        }
+                        if ("小时".equals(item.getUnit())) {
+                            well.setCumulativeHourCount(item.getWorkload());
+                        }
+                        if ("方".equals(item.getUnit())) {
+                            well.setCumulativeWaterVolume(item.getWorkload());
+                        }
+                        if ("井数".equals(item.getUnit())) {
+                            well.setCumulativeWorkingWell(item.getWorkload());
+                        }
+                        if ("段数".equals(item.getUnit())) {
+                            well.setCumulativeWorkingLayers(item.getWorkload());
+                        }
+                        if ("台次".equals(item.getUnit())) {
+                            well.setTaici(item.getWorkload());
+                        }
+                    });
+                }
+            });
+        }
+        // 导出 Excel
+        ExcelUtils.write(response, "瑞都日报汇总.xls", "日报汇总", IotRdDailyReportStatisticsRespVO.class,
+                result);
+    }
+
+    @GetMapping("/exportStatistics")
+    @Operation(summary = "导出瑞都日报工作量汇总 Excel")
+    @PreAuthorize("@ss.hasPermission('pms:iot-rd-daily-report:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportStatistics(@Valid IotRdDailyReportPageReqVO pageReqVO,
+                                 HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 分页查询
+        Set<Long> projectIds = new HashSet<>();
+        Set<Long> taskIds = new HashSet<>();
+        if (StrUtil.isNotBlank(pageReqVO.getContractName())) {
+            IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
+            reqVO.setContractName(pageReqVO.getContractName());
+            List<IotProjectInfoDO> projects = iotProjectInfoService.getIotProjectInfos(reqVO);
+            if (CollUtil.isNotEmpty(projects)) {
+                projects.forEach(project -> {
+                    projectIds.add(project.getId());
+                });
+                pageReqVO.setProjectIds(projectIds);
+            }
+        }
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName())) {
+            IotProjectTaskPageReqVO reqVO = new IotProjectTaskPageReqVO();
+            reqVO.setSearchKey(pageReqVO.getTaskName());
+            List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(reqVO);
+            if (CollUtil.isNotEmpty(tasks)) {
+                tasks.forEach(task -> {
+                    taskIds.add(task.getId());
+                });
+                pageReqVO.setTaskIds(taskIds);
+            }
+        }
+        List<IotRdDailyReportStatisticsRespVO> statistics = iotRdDailyReportService.summaryStatistics(pageReqVO);
+        // 修改油耗单位 为 万升
+        if (CollUtil.isNotEmpty(statistics)) {
+            statistics.forEach(stat -> {
+                BigDecimal totalDailyFuel = stat.getTotalDailyFuel();
+                BigDecimal fuelWan = totalDailyFuel
+                        .divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
+                stat.setTotalDailyFuel(fuelWan);
+            });
+        }
+        // 导出 Excel
+        ExcelUtils.write(response, "瑞都日报汇总.xls", "日报汇总数据",
+                IotRdDailyReportStatisticsRespExportVO.class, BeanUtils.toBean(statistics, IotRdDailyReportStatisticsRespExportVO.class));
+    }
+
+    @GetMapping("/export-detail")
+    @Operation(summary = "导出瑞都日报明细 Excel")
+    @PreAuthorize("@ss.hasPermission('pms:iot-rd-daily-report:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportIotRdDailyReportExcelDetail(@Valid IotRdDailyReportPageReqVO pageReqVO,
+                                            HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 分页查询
+        Set<Long> projectIds = new HashSet<>();
+        Set<Long> taskIds = new HashSet<>();
+        if (StrUtil.isNotBlank(pageReqVO.getContractName())) {
+            IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
+            reqVO.setContractName(pageReqVO.getContractName());
+            List<IotProjectInfoDO> projects = iotProjectInfoService.getIotProjectInfos(reqVO);
+            if (CollUtil.isNotEmpty(projects)) {
+                projects.forEach(project -> {
+                    projectIds.add(project.getId());
+                });
+                pageReqVO.setProjectIds(projectIds);
+            }
+        }
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName())) {
+            IotProjectTaskPageReqVO reqVO = new IotProjectTaskPageReqVO();
+            reqVO.setSearchKey(pageReqVO.getTaskName());
+            List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(reqVO);
+            if (CollUtil.isNotEmpty(tasks)) {
+                tasks.forEach(task -> {
+                    taskIds.add(task.getId());
+                });
+                pageReqVO.setTaskIds(taskIds);
+            }
+        }
+        List<IotRdDailyReportDO> result = iotRdDailyReportService.getIotRdDailyReportPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "瑞都日报明细.xls", "日报明细", IotRdDailyReportRespVO.class,
+                buildDailyReportList(result));
+    }
+
+    @GetMapping("/exportSingleWells")
+    @Operation(summary = "导出瑞都日报 单井 统计 Excel")
+    @PreAuthorize("@ss.hasPermission('pms:iot-rd-daily-report:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportSingleWells(@Valid IotRdDailyReportPageReqVO pageReqVO,
+                                                  HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 分页查询
+        Set<Long> projectIds = new HashSet<>();
+        Set<Long> taskIds = new HashSet<>();
+        if (StrUtil.isNotBlank(pageReqVO.getContractName())) {
+            IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
+            reqVO.setContractName(pageReqVO.getContractName());
+            List<IotProjectInfoDO> projects = iotProjectInfoService.getIotProjectInfos(reqVO);
+            if (CollUtil.isNotEmpty(projects)) {
+                projects.forEach(project -> {
+                    projectIds.add(project.getId());
+                });
+                pageReqVO.setProjectIds(projectIds);
+            }
+        }
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName())) {
+            IotProjectTaskPageReqVO reqVO = new IotProjectTaskPageReqVO();
+            reqVO.setSearchKey(pageReqVO.getTaskName());
+            List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(reqVO);
+            if (CollUtil.isNotEmpty(tasks)) {
+                tasks.forEach(task -> {
+                    taskIds.add(task.getId());
+                });
+                pageReqVO.setTaskIds(taskIds);
+            }
+        }
+        List<IotRdDailyReportDO> result = iotRdDailyReportService.teamReports(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "瑞都日报单井统计.xls", "瑞都日报单井统计", IotRdDailyReportRespVO.class,
+                buildSubtotalRdDailyReports(result, pageReqVO));
+    }
+
+    @GetMapping("/exportSingleTeams")
+    @Operation(summary = "导出瑞都日报 单队伍 统计 Excel")
+    @PreAuthorize("@ss.hasPermission('pms:iot-rd-daily-report:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportSingleTeams(@Valid IotRdDailyReportPageReqVO pageReqVO,
+                                  HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 分页查询
+        Set<Long> projectIds = new HashSet<>();
+        Set<Long> taskIds = new HashSet<>();
+        if (StrUtil.isNotBlank(pageReqVO.getContractName())) {
+            IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
+            reqVO.setContractName(pageReqVO.getContractName());
+            List<IotProjectInfoDO> projects = iotProjectInfoService.getIotProjectInfos(reqVO);
+            if (CollUtil.isNotEmpty(projects)) {
+                projects.forEach(project -> {
+                    projectIds.add(project.getId());
+                });
+                pageReqVO.setProjectIds(projectIds);
+            }
+        }
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName())) {
+            IotProjectTaskPageReqVO reqVO = new IotProjectTaskPageReqVO();
+            reqVO.setSearchKey(pageReqVO.getTaskName());
+            List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(reqVO);
+            if (CollUtil.isNotEmpty(tasks)) {
+                tasks.forEach(task -> {
+                    taskIds.add(task.getId());
+                });
+                pageReqVO.setTaskIds(taskIds);
+            }
+        }
+        List<IotRdDailyReportDO> result = iotRdDailyReportService.wellReports(pageReqVO).getList();
         // 导出 Excel
-        ExcelUtils.write(response, "瑞都日报.xls", "数据", IotRdDailyReportRespVO.class,
-                        BeanUtils.toBean(list, IotRdDailyReportRespVO.class));
+        ExcelUtils.write(response, "瑞都日报单队伍统计.xls", "瑞都日报单队伍统计", IotRdDailyReportRespVO.class,
+                buildWellRdDailyReports(result, pageReqVO));
     }
 
 }

+ 35 - 75
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportRespVO.java

@@ -22,24 +22,50 @@ import java.util.Set;
 @ExcelIgnoreUnannotated
 public class IotRdDailyReportRespVO {
 
+    @Schema(description = "创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "创建时间")
+    @ExcelProperty("创建时间")
+    private String createTimeStr;
+
+    @Schema(description = "部门名称", example = "压裂二队,压裂五队")
+    @ExcelProperty("施工队伍")
+    private String deptName;
+
+    @Schema(description = "合同/项目名称", example = "酸化压裂合同")
+    @ExcelProperty("项目")
+    private String contractName;
+
+    @Schema(description = "任务名称", example = "YS45-211平台-山西兴县")
+    @ExcelProperty("任务")
+    private String taskName;
+
+    @Schema(description = "施工状态(动迁上井/动迁下井/施工准备/施工...)", example = "1")
+    @ExcelProperty("施工状态")
+    private String rdStatusLabel;
+
+    @Schema(description = "带班干部姓名", example = "张三,李四...")
+    @ExcelProperty("带班干部")
+    private String responsiblePersonNames;
+
+    @Schema(description = "填报人姓名", example = "张三,李四...")
+    @ExcelProperty("填报人")
+    private String submitterNames;
+
     @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13853")
-    @ExcelProperty("主键id")
     private Long id;
 
     @Schema(description = "施工队伍id", example = "22577")
-    @ExcelProperty("施工队伍id")
     private Long deptId;
 
     @Schema(description = "平台井标识 2非平台井 1平台井 0默认值", example = "1")
-    @ExcelProperty("平台井标识 2非平台井 1平台井 0默认值")
     private Integer platformWell;
 
     @Schema(description = "平台井组", example = "463e3996-be48-4758-8229-c1351cbf3e37")
-    @ExcelProperty("平台井组")
     private String platformGroup;
 
     @Schema(description = "任务平台井标识", example = "463e3996-be48-4758-8229-c1351cbf3e37")
-    @ExcelProperty("任务平台井标识")
     private String taskPlatform;
 
     @Schema(description = "日报名称", example = "西南压裂项目部/2025-10-17日报填报")
@@ -47,31 +73,24 @@ public class IotRdDailyReportRespVO {
     private String reportName;
 
     @Schema(description = "项目id", example = "32587")
-    @ExcelProperty("项目id")
     private Long projectId;
 
     @Schema(description = "任务id", example = "15678")
-    @ExcelProperty("任务id")
     private Long taskId;
 
     @Schema(description = "项目类别(钻井 修井 注氮 酸化压裂... )")
-    @ExcelProperty("项目类别(钻井 修井 注氮 酸化压裂... )")
     private String projectClassification;
 
     @Schema(description = "施工工艺([123,233])")
-    @ExcelProperty("施工工艺([123,233])")
     private Set<Long> techniqueIds;
 
     @Schema(description = "施工设备([123,233])")
-    @ExcelProperty("施工设备([123,233])")
     private Set<Long> deviceIds;
 
     @Schema(description = "时间节点-开始")
-    @ExcelProperty("时间节点-开始")
     private LocalTime startTime;
 
     @Schema(description = "时间节点-结束")
-    @ExcelProperty("时间节点-结束")
     private LocalTime endTime;
 
     @Schema(description = "累计施工井")
@@ -106,27 +125,22 @@ public class IotRdDailyReportRespVO {
     @ExcelProperty("时间H")
     private BigDecimal hourCount;
 
-    @Schema(description = "当日油耗()")
-    @ExcelProperty("当日油耗()")
+    @Schema(description = "当日油耗(L)")
+    @ExcelProperty("当日油耗(L)")
     private BigDecimal dailyFuel;
 
     @Schema(description = "当日用电量(kWh)")
-    @ExcelProperty("当日用电量(kWh)")
     private BigDecimal dailyPowerUsage;
 
     @Schema(description = "生产时间(H)")
-    @ExcelProperty("生产时间(H)")
     private BigDecimal productionTime;
 
     @Schema(description = "非生产时间(H)")
-    @ExcelProperty("非生产时间(H)")
     private BigDecimal nonProductionTime;
 
     @Schema(description = "非生产时间原因", example = "不喜欢")
-    @ExcelProperty("非生产时间原因")
     private String rdNptReason;
 
-
     @Schema(description = "事故非生产时间(H)")
     private BigDecimal accidentTime;
     @Schema(description = "修理非生产时间(H)")
@@ -154,21 +168,18 @@ public class IotRdDailyReportRespVO {
     @Schema(description = "其它非生产时间原因")
     private String otherNptReason;
 
-
     @Schema(description = "施工开始日期")
-    @ExcelProperty("施工开始日期")
     private LocalDateTime constructionStartDate;
 
     @Schema(description = "施工结束日期")
-    @ExcelProperty("施工结束日期")
     private LocalDateTime constructionEndDate;
 
     @Schema(description = "当日生产情况生产动态", example = "2")
-    @ExcelProperty("当日生产情况生产动态")
+    @ExcelProperty("当日生产动态")
     private String productionStatus;
 
     @Schema(description = "外租情况(可能有附件)")
-    @ExcelProperty("外租情况(可能有附件)")
+    @ExcelProperty("外租情况")
     private String externalRental;
 
     @Schema(description = "下步工作计划")
@@ -176,7 +187,6 @@ public class IotRdDailyReportRespVO {
     private String nextPlan;
 
     @Schema(description = "施工状态(动迁上井/动迁下井/施工准备/施工...)", example = "1")
-    @ExcelProperty("施工状态(动迁上井/动迁下井/施工准备/施工...)")
     private String rdStatus;
 
     @Schema(description = "故障情况")
@@ -188,23 +198,18 @@ public class IotRdDailyReportRespVO {
     private BigDecimal faultDowntime;
 
     @Schema(description = "人员情况")
-    @ExcelProperty("人员情况")
     private String personnel;
 
     @Schema(description = "全员数量")
-    @ExcelProperty("全员数量")
     private BigDecimal totalStaffNum;
 
     @Schema(description = "休假人员数量")
-    @ExcelProperty("休假人员数量")
     private BigDecimal leaveStaffNum;
 
     @Schema(description = "不同专业公司的扩展属性值")
-    @ExcelProperty("不同专业公司的扩展属性值")
     private List<IotTaskAttrModelProperty> extProperty;
 
     @Schema(description = "排序值")
-    @ExcelProperty("排序值")
     private Integer sort;
 
     @Schema(description = "备注", example = "随便")
@@ -212,125 +217,80 @@ public class IotRdDailyReportRespVO {
     private String remark;
 
     @Schema(description = "状态(0启用 1禁用)", example = "2")
-    @ExcelProperty("状态(0启用 1禁用)")
     private Integer status;
 
     @Schema(description = "流程实例id", example = "16415")
-    @ExcelProperty("流程实例id")
     private String processInstanceId;
 
     @Schema(description = "审批状态 未提交、审批中、审批通过、审批不通过、已取消", example = "1")
-    @ExcelProperty("审批状态 未提交、审批中、审批通过、审批不通过、已取消")
     private Integer auditStatus;
 
     @Schema(description = "审批意见", example = "审核通过")
-    @ExcelProperty("审批意见")
     private String opinion;
 
-    @Schema(description = "创建时间")
-    @ExcelProperty("创建时间")
-    private LocalDateTime createTime;
-
     @Schema(description = "日报填写时间")
-    @ExcelProperty("日报填写时间")
     private LocalDateTime fillTime;
 
     @Schema(description = "审批时间")
-    @ExcelProperty("审批时间")
     private LocalDateTime approvalTime;
 
     /**
      * 扩展字段
      */
     @Schema(description = "时间节点区域 startTime-endTime", example = "8:00 - 8:00")
-    @ExcelProperty("时间节点区域")
     private String timeRange;
 
-    @Schema(description = "部门名称", example = "压裂二队,压裂五队")
-    @ExcelProperty("部门名称")
-    private String deptName;
-
-    @Schema(description = "合同/项目名称", example = "酸化压裂合同")
-    @ExcelProperty("合同/项目名称")
-    private String contractName;
-
-    @Schema(description = "任务名称", example = "YS45-211平台-山西兴县")
-    @ExcelProperty("任务名称")
-    private String taskName;
-
     @Schema(description = "井号", example = "YS45-211平台")
-    @ExcelProperty("井号")
     private String wellName;
 
     @Schema(description = "施工地点", example = "山西兴县")
-    @ExcelProperty("施工地点")
     private String location;
 
     @Schema(description = "客户名称", example = "YS45-211平台-山西兴县")
-    @ExcelProperty("客户名称")
     private String manufactureName;
 
     @Schema(description = "施工工艺(多个逗号分隔)", example = "压裂大包,主压裂车...")
-    @ExcelProperty("施工工艺(多个逗号分隔)")
     private String techniqueNames;
 
     @Schema(description = "设备配置", example = "黑EN9500,黑EN7958...")
-    @ExcelProperty("设备配置")
     private String deviceNames;
 
-    @Schema(description = "带班干部姓名", example = "张三,李四...")
-    @ExcelProperty("带班干部")
-    private String responsiblePersonNames;
 
-    @Schema(description = "填报人姓名", example = "张三,李四...")
-    @ExcelProperty("填报人姓名")
-    private String submitterNames;
 
     @Schema(description = "公司id", example = "125")
-    @ExcelProperty("公司id")
     private Long companyId;
 
     @Schema(description = "工作量属性", example = "累计施工-层,当日泵车台次...")
-    @ExcelProperty("工作量属性")
     private List<IotDailyReportAttrsDO> dailyReportAttrs;
 
     @Schema(description = "搬迁日期", example = "125")
-    @ExcelProperty("搬迁日期")
     private String relocationDate;
 
     @Schema(description = "开工日期", example = "125")
-    @ExcelProperty("开工日期")
     private String commencementDate;
 
     @Schema(description = "完工日期", example = "125")
-    @ExcelProperty("完工日期")
     private String completionDate;
 
     @Schema(description = "施工周期D", example = "125")
-    @ExcelProperty("施工周期D")
     private String constructionPeriod;
 
     @Schema(description = "停待时间D", example = "12")
-    @ExcelProperty("停待时间D")
     private String idleTime;
 
     /**
      * 扩展属性
      */
     @Schema(description = "附件列表", example = "https://aims.deepoil.cc/admin-api/infra/file/29/get/人力资源.png")
-    @ExcelProperty("附件列表")
     private List<IotAttachmentDO> attachments;
 
     @Schema(description = "施工设备列表", example = "https://aims.deepoil.cc/admin-api/infra/file/29/get/人力资源.png")
-    @ExcelProperty("施工设备列表")
     private List<IotDeviceSimpleRespVO> selectedDevices;
 
     @Schema(description = "平台井列表", example = "[]")
-    @ExcelProperty("平台井列表")
     private List<IotProjectTaskPlatformVO> platforms;
 
     @Schema(description = "已经施工完成的 平台井列表", example = "[]")
-    @ExcelProperty("已经施工完成的 平台井列表")
     private List<IotProjectTaskPlatformVO> finishedPlatforms;
 
     @Schema(description = "虚拟项目标识", example = "Y N")

+ 112 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportStatisticsRespExportVO.java

@@ -0,0 +1,112 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotrddailyreport.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Schema(description = "管理后台 - 瑞都日报 统计 导出 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotRdDailyReportStatisticsRespExportVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13853")
+    private Long id;
+
+    @Schema(description = "项目部id", example = "125")
+    private Long deptId;
+
+    @Schema(description = "项目部id", example = "125")
+    private Long projectDeptId;
+
+    @Schema(description = "项目部名称", example = "西南压裂项目部")
+    @ExcelProperty("项目部名称")
+    private String projectDeptName;
+
+    @Schema(description = "队伍名称", example = "压裂二队")
+    @ExcelProperty("队伍名称")
+    private String deptName;
+
+    @Schema(description = "队伍id", example = "125")
+    private Long teamId;
+
+    @Schema(description = "队伍名称", example = "HY-A1")
+    @ExcelProperty("队伍名称")
+    private String teamName;
+
+    @Schema(description = "部门类型(公司级1 项目部2 队伍3)", example = "1")
+    private String type;
+
+    @Schema(description = "任务id", example = "15678")
+    private Long taskId;
+
+    @Schema(description = "甲方")
+    private String manufactureName;
+
+    @Schema(description = "井号")
+    private String wellName;
+
+    @Schema(description = "施工周期 天")
+    private String period;
+
+    @Schema(description = "施工状态")
+    private String rdStatus;
+
+    @Schema(description = "施工状态")
+    private String rdStatusLabel;
+
+    @Schema(description = "施工工艺 多个逗号分隔")
+    private String techniques;
+
+    @Schema(description = "总工作量")
+    private BigDecimal workloadDesign;
+
+    @Schema(description = "已完成工作量")
+    private BigDecimal finishedWorkload;
+
+    @Schema(description = "任务创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "油耗L")
+    @ExcelProperty("油耗(万升)")
+    private BigDecimal totalDailyFuel;
+
+    @Schema(description = "排序", example = "1")
+    private Integer sort;
+
+    @Schema(description = "工作量明细")
+    private List<IotRdDailyReportStatisticsItemVO> items;
+
+    // 汇总统计 工作量
+    @Schema(description = "桥塞(个数)")
+    @ExcelProperty("桥塞")
+    private BigDecimal cumulativeBridgePlug;
+    @Schema(description = "趟数")
+    @ExcelProperty("趟数")
+    private BigDecimal cumulativeRunCount;
+    @Schema(description = "井数")
+    @ExcelProperty("井数")
+    private BigDecimal cumulativeWorkingWell;
+    @Schema(description = "小时H")
+    @ExcelProperty("小时H")
+    private BigDecimal cumulativeHourCount;
+    @Schema(description = "水方量(方)")
+    @ExcelProperty("水方量(方)")
+    private BigDecimal cumulativeWaterVolume;
+    @Schema(description = "段数  累计施工-层")
+    @ExcelProperty("段数")
+    private BigDecimal cumulativeWorkingLayers;
+    @Schema(description = "台次 当日仪表/混砂")
+    @ExcelProperty("仪表/混砂台次")
+    private BigDecimal cumulativeMixSand;
+    @Schema(description = "台次 当日泵车台次")
+    @ExcelProperty("泵车台次")
+    private BigDecimal cumulativePumpTrips;
+
+    @Schema(description = "台次 泵车台次 仪表/混砂")
+    private BigDecimal taici;
+}

+ 10 - 11
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportStatisticsRespVO.java

@@ -15,11 +15,9 @@ import java.util.List;
 public class IotRdDailyReportStatisticsRespVO {
 
     @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13853")
-    @ExcelProperty("主键id")
     private Long id;
 
     @Schema(description = "项目部id", example = "125")
-    @ExcelProperty("项目部id")
     private Long deptId;
 
     @Schema(description = "项目部id", example = "125")
@@ -44,7 +42,6 @@ public class IotRdDailyReportStatisticsRespVO {
     private String type;
 
     @Schema(description = "任务id", example = "15678")
-    @ExcelProperty("任务id")
     private Long taskId;
 
     @Schema(description = "甲方")
@@ -56,13 +53,16 @@ public class IotRdDailyReportStatisticsRespVO {
     private String wellName;
 
     @Schema(description = "施工周期 天")
-    @ExcelProperty("施工周期")
+    @ExcelProperty("施工周期(D)")
     private String period;
 
     @Schema(description = "施工状态")
-    @ExcelProperty("施工状态")
     private String rdStatus;
 
+    @Schema(description = "施工状态")
+    @ExcelProperty("施工状态")
+    private String rdStatusLabel;
+
     @Schema(description = "施工工艺 多个逗号分隔")
     @ExcelProperty("施工工艺")
     private String techniques;
@@ -72,11 +72,9 @@ public class IotRdDailyReportStatisticsRespVO {
     private BigDecimal workloadDesign;
 
     @Schema(description = "已完成工作量")
-    @ExcelProperty("已完成工作量")
     private BigDecimal finishedWorkload;
 
     @Schema(description = "任务创建时间")
-    @ExcelProperty("任务创建时间")
     private LocalDateTime createTime;
 
     @Schema(description = "油耗L")
@@ -87,7 +85,6 @@ public class IotRdDailyReportStatisticsRespVO {
     private Integer sort;
 
     @Schema(description = "工作量明细")
-    @ExcelProperty("工作量明细")
     private List<IotRdDailyReportStatisticsItemVO> items;
 
     // 汇总统计 工作量
@@ -107,12 +104,14 @@ public class IotRdDailyReportStatisticsRespVO {
     @ExcelProperty("水方量(方)")
     private BigDecimal cumulativeWaterVolume;
     @Schema(description = "段数  累计施工-层")
-    @ExcelProperty("段数  累计施工-层")
+    @ExcelProperty("段数")
     private BigDecimal cumulativeWorkingLayers;
     @Schema(description = "台次 当日仪表/混砂")
-    @ExcelProperty("台次 当日仪表/混砂")
     private BigDecimal cumulativeMixSand;
     @Schema(description = "台次 当日泵车台次")
-    @ExcelProperty("台次 当日泵车台次")
     private BigDecimal cumulativePumpTrips;
+
+    @Schema(description = "台次 泵车台次 仪表/混砂")
+    @ExcelProperty("台次")
+    private BigDecimal taici;
 }

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

@@ -1,6 +1,8 @@
 package cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.LocalDateTimeUtil;
 import cn.hutool.core.util.ObjUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
@@ -185,7 +187,7 @@ public class IotRhDailyReportController {
             }
         }
         PageResult<IotRhDailyReportDO> pageResult = iotRhDailyReportService.getIotRhDailyReportPage(pageReqVO);
-        return success(new PageResult<>(buildRhDailyReports(pageResult.getList(), pageReqVO), pageResult.getTotal()));
+        return success(new PageResult<>(buildRhDailyReports(pageResult.getList(), pageReqVO, "list"), pageResult.getTotal()));
     }
 
     @GetMapping("/teamReports")
@@ -520,7 +522,7 @@ public class IotRhDailyReportController {
         PageResult<IotRhDailyReportDO> pageResult = iotRhDailyReportService.dailyReportSummary(pageReqVO);
 
         // List<IotRhDailyReportRespVO> rhDailyReports = IotRhDailyReportConvert.INSTANCE.convertList(pageResult.getList(), deptMap);
-        return success(new PageResult<>(buildRhDailyReports(pageResult.getList(), pageReqVO), pageResult.getTotal()));
+        return success(new PageResult<>(buildRhDailyReports(pageResult.getList(), pageReqVO, "list"), pageResult.getTotal()));
         // return success(new PageResult<>(rhDailyReports, pageResult.getTotal()));
     }
 
@@ -536,9 +538,10 @@ public class IotRhDailyReportController {
     /**
      * 瑞恒日报分页 设置关联查询信息
      * @param reports
+     * @param type list列表展示  export导出列表数据
      * @return
      */
-    private List<IotRhDailyReportRespVO> buildRhDailyReports(List<IotRhDailyReportDO> reports, IotRhDailyReportPageReqVO pageReqVO) {
+    private List<IotRhDailyReportRespVO> buildRhDailyReports(List<IotRhDailyReportDO> reports, IotRhDailyReportPageReqVO pageReqVO, String type) {
         if (CollUtil.isEmpty(reports)) {
             return Collections.emptyList();
         }
@@ -735,6 +738,10 @@ public class IotRhDailyReportController {
                 // 赋值
                 reportVO.setTransitTimeRate(transitTimeRate);
             }
+            // 导出列表时 格式化时间为 yyyy-MM-dd
+            if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
+                reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
+            }
             // 2.1 拼接部门信息
             findAndThen(deptMap, reportVO.getDeptId(), dept -> reportVO.setDeptName(dept.getName()));
             // 队伍当年累计注气量
@@ -850,6 +857,121 @@ public class IotRhDailyReportController {
         // key小组最后1条记录id    value 小计平均运行时效
         Map<Long, BigDecimal> groupIdTransTimePair = new HashMap<>();
 
+        // key队伍id   value 队伍当年累计注气量
+        Map<Long, BigDecimal> yearGasInjectionPair = new HashMap<>();
+        // key队伍id   value 队伍当年累计注水量
+        Map<Long, BigDecimal> yearWaterInjectionPair = new HashMap<>();
+        // key队伍id   value 队伍当年累计用电量
+        Map<Long, BigDecimal> yearPowerPair = new HashMap<>();
+        // key队伍id   value 队伍当年累计油耗
+        Map<Long, BigDecimal> yearFuelPair = new HashMap<>();
+
+        // key任务井id    value 井累计注气量
+        Map<Long, BigDecimal> wellGasInjectionPair = new HashMap<>();
+        // key任务井id    value 井累计注水量
+        Map<Long, BigDecimal> wellWaterInjectionPair = new HashMap<>();
+        // key任务井id    value 井累计用电量
+        Map<Long, BigDecimal> wellPowerPair = new HashMap<>();
+        // key任务井id    value 井累计油耗
+        Map<Long, BigDecimal> wellFuelPair = new HashMap<>();
+
+        // 查询所有井日报数据
+        IotRhDailyReportPageReqVO wellTaskReqVO = new IotRhDailyReportPageReqVO();
+        wellTaskReqVO.setTaskIds(convertList(reports, IotRhDailyReportDO::getTaskId));
+        List<IotRhDailyReportDO> taskDailyReports = iotRhDailyReportMapper.dailyReports(wellTaskReqVO);
+
+        if (CollUtil.isNotEmpty(taskDailyReports)) {
+            taskDailyReports.forEach(report -> {
+                // 注气量
+                if (wellGasInjectionPair.containsKey(report.getTaskId())) {
+                    BigDecimal tempGasInjection = wellGasInjectionPair.get(report.getTaskId());
+                    BigDecimal tempResult = tempGasInjection.add(report.getDailyGasInjection());
+                    wellGasInjectionPair.put(report.getTaskId(), tempResult);
+                } else {
+                    wellGasInjectionPair.put(report.getTaskId(), report.getDailyGasInjection());
+                }
+                // 注水量
+                if (wellWaterInjectionPair.containsKey(report.getTaskId())) {
+                    BigDecimal tempWaterInjection = wellWaterInjectionPair.get(report.getTaskId());
+                    BigDecimal tempResult = tempWaterInjection.add(report.getDailyWaterInjection());
+                    wellWaterInjectionPair.put(report.getTaskId(), tempResult);
+                } else {
+                    wellWaterInjectionPair.put(report.getTaskId(), report.getDailyWaterInjection());
+                }
+                // 电量
+                if (wellPowerPair.containsKey(report.getTaskId())) {
+                    BigDecimal tempPower = wellPowerPair.get(report.getTaskId());
+                    BigDecimal tempResult = tempPower.add(report.getDailyPowerUsage());
+                    wellPowerPair.put(report.getTaskId(), tempResult);
+                } else {
+                    wellPowerPair.put(report.getTaskId(), report.getDailyPowerUsage());
+                }
+                // 油耗
+                if (wellFuelPair.containsKey(report.getTaskId())) {
+                    BigDecimal tempFuel = wellFuelPair.get(report.getTaskId());
+                    BigDecimal tempResult = tempFuel.add(report.getDailyOilUsage());
+                    wellFuelPair.put(report.getTaskId(), tempResult);
+                } else {
+                    wellFuelPair.put(report.getTaskId(), report.getDailyOilUsage());
+                }
+            });
+        }
+
+        // 根据传递的时间筛选获取要查询的 yyyy
+        // 如果没有传递时间区间 默认当年
+        LocalDateTime nowDate = LocalDateTime.now();
+        String year = StrUtil.EMPTY;
+        if (ObjUtil.isNotEmpty(pageReqVO.getCreateTime())) {
+            LocalDateTime[] createTimeAttr = pageReqVO.getCreateTime();
+            if (createTimeAttr.length > 0) {
+                LocalDateTime startTime = createTimeAttr[0];
+                year = String.valueOf(startTime.getYear());
+            }
+        } else {
+            year = String.valueOf(nowDate.getYear());
+        }
+        // 只有传递了 时间查询条件 才会查询 当年累计的工作量数据
+        IotRhDailyReportPageReqVO yearReqVO = new IotRhDailyReportPageReqVO();
+        yearReqVO.setYear(year);
+        yearReqVO.setDeptIds(convertList(reports, IotRhDailyReportDO::getDeptId));
+        List<IotRhDailyReportDO> dailyReports = iotRhDailyReportMapper.dailyReports(yearReqVO);
+        if (CollUtil.isNotEmpty(dailyReports)) {
+            dailyReports.forEach(report -> {
+                // 注气量
+                if (yearGasInjectionPair.containsKey(report.getDeptId())) {
+                    BigDecimal tempGasInjection = yearGasInjectionPair.get(report.getDeptId());
+                    BigDecimal tempResult = tempGasInjection.add(report.getDailyGasInjection());
+                    yearGasInjectionPair.put(report.getDeptId(), tempResult);
+                } else {
+                    yearGasInjectionPair.put(report.getDeptId(), report.getDailyGasInjection());
+                }
+                // 注水量
+                if (yearWaterInjectionPair.containsKey(report.getDeptId())) {
+                    BigDecimal tempWaterInjection = yearWaterInjectionPair.get(report.getDeptId());
+                    BigDecimal tempResult = tempWaterInjection.add(report.getDailyWaterInjection());
+                    yearWaterInjectionPair.put(report.getDeptId(), tempResult);
+                } else {
+                    yearWaterInjectionPair.put(report.getDeptId(), report.getDailyWaterInjection());
+                }
+                // 电量
+                if (yearPowerPair.containsKey(report.getDeptId())) {
+                    BigDecimal tempPower = yearPowerPair.get(report.getDeptId());
+                    BigDecimal tempResult = tempPower.add(report.getDailyPowerUsage());
+                    yearPowerPair.put(report.getDeptId(), tempResult);
+                } else {
+                    yearPowerPair.put(report.getDeptId(), report.getDailyPowerUsage());
+                }
+                // 油耗
+                if (yearFuelPair.containsKey(report.getDeptId())) {
+                    BigDecimal tempFuel = yearFuelPair.get(report.getDeptId());
+                    BigDecimal tempResult = tempFuel.add(report.getDailyOilUsage());
+                    yearFuelPair.put(report.getDeptId(), tempResult);
+                } else {
+                    yearFuelPair.put(report.getDeptId(), report.getDailyOilUsage());
+                }
+            });
+        }
+
         // 查询 当前分页 所有部门 任务井 日报数据 小计工作量
         IotRhDailyReportPageReqVO currentTaskReqVO = new IotRhDailyReportPageReqVO();
         currentTaskReqVO.setTaskIds(convertSet(reports, IotRhDailyReportDO::getTaskId));
@@ -1021,6 +1143,11 @@ public class IotRhDailyReportController {
                 reportVO.setTransitTimeRate(transitTimeRate);
             }
 
+            // 导出列表时 格式化时间为 yyyy-MM-dd
+            if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
+                reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
+            }
+
             // 转换用电量 单位 kWh 转换成 MWh
             // 用电量 kWh 转换单位 MWh
             if (reportVO.getDailyPowerUsage().compareTo(BigDecimal.ZERO) > 0) {
@@ -1029,6 +1156,13 @@ public class IotRhDailyReportController {
                 reportVO.setDailyPowerUsage(powerW);
             }
 
+            // 转换当日油耗 原始单位 方 转换成 万方
+            if (reportVO.getDailyGasInjection().compareTo(BigDecimal.ZERO) > 0) {
+                BigDecimal gasW = reportVO.getDailyGasInjection()
+                        .divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
+                reportVO.setDailyGasInjection(gasW);
+            }
+
             // 2.1 拼接部门信息
             findAndThen(deptMap, reportVO.getDeptId(), dept -> reportVO.setDeptName(dept.getName()));
 
@@ -1064,13 +1198,57 @@ public class IotRhDailyReportController {
             // 2.4 设计注气量
             findAndThen(taskExtPropertyPair, reportVO.getTaskId(), designInjection -> reportVO.setDesignInjection(designInjection));
             // 2.5 搬迁安装天数
-            findAndThen(relocationDaysPair, reportVO.getDeptId(), relocationDays -> reportVO.setRelocationDays(relocationDays));
+            findAndThen(relocationDaysPair, reportVO.getDeptId(), relocationDays -> {
+                if (relocationDays.compareTo(BigDecimal.ZERO) < 0) {
+                    reportVO.setRelocationDays(BigDecimal.ZERO);
+                } else {
+                    reportVO.setRelocationDays(relocationDays);
+                }
+            });
             // 2.6 产能
             findAndThen(capacityPair.get(), reportVO.getDeptId(), capacity -> reportVO.setCapacity(capacity));
             // 施工状态 数据字典
             findAndThen(constructStatusPair, reportVO.getConstructionStatus(), statusLabel -> reportVO.setConstructionStatusName(statusLabel));
             // 非生产时间原因 数据字典
             findAndThen(nptReasonPair, reportVO.getNptReason(), statusLabel -> reportVO.setNptReasonName(statusLabel));
+
+            // 井当年累计注气量
+            findAndThen(wellGasInjectionPair, reportVO.getTaskId(), gasInjection -> {
+                // 转换单位为 万方
+                BigDecimal gasInjectionWanFang = gasInjection
+                        .divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
+                reportVO.setWellTotalGasInjection(gasInjectionWanFang);
+            });
+            // 井当年累计注水量
+            findAndThen(wellWaterInjectionPair, reportVO.getTaskId(), waterInjection -> reportVO.setWellTotalWaterInjection(waterInjection));
+            // 井当年累计用电量
+            findAndThen(wellPowerPair, reportVO.getTaskId(), power -> {
+                // 换算单位为 MWh
+                BigDecimal powerW = power
+                        .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP);
+                reportVO.setWellTotalPower(powerW);
+            });
+            // 井当年累计油耗
+            findAndThen(wellFuelPair, reportVO.getTaskId(), fuel -> reportVO.setWellTotalFuel(fuel));
+
+            // 队伍当年累计注气量
+            findAndThen(yearGasInjectionPair, reportVO.getDeptId(), gasInjection -> {
+                // 转换单位为 万方
+                BigDecimal gasInjectionWanFang = gasInjection
+                        .divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
+                reportVO.setYearTotalGasInjection(gasInjectionWanFang);
+            });
+            // 队伍当年累计注水量
+            findAndThen(yearWaterInjectionPair, reportVO.getDeptId(), waterInjection -> reportVO.setYearTotalWaterInjection(waterInjection));
+            // 队伍当年累计用电量
+            findAndThen(yearPowerPair, reportVO.getDeptId(), power -> {
+                // 换算单位为 MWh
+                BigDecimal powerW = power
+                        .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP);
+                reportVO.setYearTotalPower(powerW);
+            });
+            // 队伍当年累计油耗
+            findAndThen(yearFuelPair, reportVO.getDeptId(), fuel -> reportVO.setYearTotalFuel(fuel));
         });
     }
 
@@ -1128,6 +1306,120 @@ public class IotRhDailyReportController {
         // key小组最后1条记录id    value 任务井小计平均运行时效
         Map<Long, BigDecimal> groupIdTransTimePair = new HashMap<>();
 
+        // key队伍id   value 队伍当年累计注气量
+        Map<Long, BigDecimal> yearGasInjectionPair = new HashMap<>();
+        // key队伍id   value 队伍当年累计注水量
+        Map<Long, BigDecimal> yearWaterInjectionPair = new HashMap<>();
+        // key队伍id   value 队伍当年累计用电量
+        Map<Long, BigDecimal> yearPowerPair = new HashMap<>();
+        // key队伍id   value 队伍当年累计油耗
+        Map<Long, BigDecimal> yearFuelPair = new HashMap<>();
+
+        // key任务井id    value 井累计注气量
+        Map<Long, BigDecimal> wellGasInjectionPair = new HashMap<>();
+        // key任务井id    value 井累计注水量
+        Map<Long, BigDecimal> wellWaterInjectionPair = new HashMap<>();
+        // key任务井id    value 井累计用电量
+        Map<Long, BigDecimal> wellPowerPair = new HashMap<>();
+        // key任务井id    value 井累计油耗
+        Map<Long, BigDecimal> wellFuelPair = new HashMap<>();
+
+        // 查询所有井日报数据
+        IotRhDailyReportPageReqVO teamTaskReqVO = new IotRhDailyReportPageReqVO();
+        teamTaskReqVO.setTaskIds(convertList(reports, IotRhDailyReportDO::getTaskId));
+        List<IotRhDailyReportDO> taskDailyReports = iotRhDailyReportMapper.dailyReports(teamTaskReqVO);
+        if (CollUtil.isNotEmpty(taskDailyReports)) {
+            taskDailyReports.forEach(report -> {
+                // 注气量
+                if (wellGasInjectionPair.containsKey(report.getTaskId())) {
+                    BigDecimal tempGasInjection = wellGasInjectionPair.get(report.getTaskId());
+                    BigDecimal tempResult = tempGasInjection.add(report.getDailyGasInjection());
+                    wellGasInjectionPair.put(report.getTaskId(), tempResult);
+                } else {
+                    wellGasInjectionPair.put(report.getTaskId(), report.getDailyGasInjection());
+                }
+                // 注水量
+                if (wellWaterInjectionPair.containsKey(report.getTaskId())) {
+                    BigDecimal tempWaterInjection = wellWaterInjectionPair.get(report.getTaskId());
+                    BigDecimal tempResult = tempWaterInjection.add(report.getDailyWaterInjection());
+                    wellWaterInjectionPair.put(report.getTaskId(), tempResult);
+                } else {
+                    wellWaterInjectionPair.put(report.getTaskId(), report.getDailyWaterInjection());
+                }
+                // 电量
+                if (wellPowerPair.containsKey(report.getTaskId())) {
+                    BigDecimal tempPower = wellPowerPair.get(report.getTaskId());
+                    BigDecimal tempResult = tempPower.add(report.getDailyPowerUsage());
+                    wellPowerPair.put(report.getTaskId(), tempResult);
+                } else {
+                    wellPowerPair.put(report.getTaskId(), report.getDailyPowerUsage());
+                }
+                // 油耗
+                if (wellFuelPair.containsKey(report.getTaskId())) {
+                    BigDecimal tempFuel = wellFuelPair.get(report.getTaskId());
+                    BigDecimal tempResult = tempFuel.add(report.getDailyOilUsage());
+                    wellFuelPair.put(report.getTaskId(), tempResult);
+                } else {
+                    wellFuelPair.put(report.getTaskId(), report.getDailyOilUsage());
+                }
+            });
+        }
+
+        // 根据传递的时间筛选获取要查询的 yyyy
+        // 如果没有传递时间区间 默认当年
+        LocalDateTime nowDate = LocalDateTime.now();
+        String year = StrUtil.EMPTY;
+        if (ObjUtil.isNotEmpty(pageReqVO.getCreateTime())) {
+            LocalDateTime[] createTimeAttr = pageReqVO.getCreateTime();
+            if (createTimeAttr.length > 0) {
+                LocalDateTime startTime = createTimeAttr[0];
+                year = String.valueOf(startTime.getYear());
+            }
+        } else {
+            year = String.valueOf(nowDate.getYear());
+        }
+        // 只有传递了 时间查询条件 才会查询 当年累计的工作量数据
+        IotRhDailyReportPageReqVO yearReqVO = new IotRhDailyReportPageReqVO();
+        yearReqVO.setYear(year);
+        yearReqVO.setDeptIds(convertList(reports, IotRhDailyReportDO::getDeptId));
+        List<IotRhDailyReportDO> dailyReports = iotRhDailyReportMapper.dailyReports(yearReqVO);
+        if (CollUtil.isNotEmpty(dailyReports)) {
+            dailyReports.forEach(report -> {
+                // 注气量
+                if (yearGasInjectionPair.containsKey(report.getDeptId())) {
+                    BigDecimal tempGasInjection = yearGasInjectionPair.get(report.getDeptId());
+                    BigDecimal tempResult = tempGasInjection.add(report.getDailyGasInjection());
+                    yearGasInjectionPair.put(report.getDeptId(), tempResult);
+                } else {
+                    yearGasInjectionPair.put(report.getDeptId(), report.getDailyGasInjection());
+                }
+                // 注水量
+                if (yearWaterInjectionPair.containsKey(report.getDeptId())) {
+                    BigDecimal tempWaterInjection = yearWaterInjectionPair.get(report.getDeptId());
+                    BigDecimal tempResult = tempWaterInjection.add(report.getDailyWaterInjection());
+                    yearWaterInjectionPair.put(report.getDeptId(), tempResult);
+                } else {
+                    yearWaterInjectionPair.put(report.getDeptId(), report.getDailyWaterInjection());
+                }
+                // 电量
+                if (yearPowerPair.containsKey(report.getDeptId())) {
+                    BigDecimal tempPower = yearPowerPair.get(report.getDeptId());
+                    BigDecimal tempResult = tempPower.add(report.getDailyPowerUsage());
+                    yearPowerPair.put(report.getDeptId(), tempResult);
+                } else {
+                    yearPowerPair.put(report.getDeptId(), report.getDailyPowerUsage());
+                }
+                // 油耗
+                if (yearFuelPair.containsKey(report.getDeptId())) {
+                    BigDecimal tempFuel = yearFuelPair.get(report.getDeptId());
+                    BigDecimal tempResult = tempFuel.add(report.getDailyOilUsage());
+                    yearFuelPair.put(report.getDeptId(), tempResult);
+                } else {
+                    yearFuelPair.put(report.getDeptId(), report.getDailyOilUsage());
+                }
+            });
+        }
+
         // 查询 当前分页 所有部门 任务井 日报数据 小计工作量
         IotRhDailyReportPageReqVO currentTaskReqVO = new IotRhDailyReportPageReqVO();
         currentTaskReqVO.setTaskIds(convertSet(reports, IotRhDailyReportDO::getTaskId));
@@ -1300,12 +1592,24 @@ public class IotRhDailyReportController {
                 // 赋值
                 reportVO.setTransitTimeRate(transitTimeRate);
             }
+            // 导出列表时 格式化时间为 yyyy-MM-dd
+            if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
+                reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
+            }
             // 用电量 kWh 转换单位 MWh
             if (reportVO.getDailyPowerUsage().compareTo(BigDecimal.ZERO) > 0) {
                 BigDecimal powerW = reportVO.getDailyPowerUsage()
                         .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP);
                 reportVO.setDailyPowerUsage(powerW);
             }
+
+            // 转换当日油耗 原始单位 方 转换成 万方
+            if (reportVO.getDailyGasInjection().compareTo(BigDecimal.ZERO) > 0) {
+                BigDecimal gasW = reportVO.getDailyGasInjection()
+                        .divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
+                reportVO.setDailyGasInjection(gasW);
+            }
+
             // 2.1 拼接部门信息
             findAndThen(deptMap, reportVO.getDeptId(), dept -> reportVO.setDeptName(dept.getName()));
 
@@ -1341,13 +1645,57 @@ public class IotRhDailyReportController {
             // 2.4 设计注气量
             findAndThen(taskExtPropertyPair, reportVO.getTaskId(), designInjection -> reportVO.setDesignInjection(designInjection));
             // 2.5 搬迁安装天数
-            findAndThen(relocationDaysPair, reportVO.getDeptId(), relocationDays -> reportVO.setRelocationDays(relocationDays));
+            findAndThen(relocationDaysPair, reportVO.getDeptId(), relocationDays -> {
+                if (relocationDays.compareTo(BigDecimal.ZERO) < 0) {
+                    reportVO.setRelocationDays(BigDecimal.ZERO);
+                } else {
+                    reportVO.setRelocationDays(relocationDays);
+                }
+            });
             // 2.6 产能
             findAndThen(capacityPair.get(), reportVO.getDeptId(), capacity -> reportVO.setCapacity(capacity));
             // 施工状态 数据字典
             findAndThen(constructStatusPair, reportVO.getConstructionStatus(), statusLabel -> reportVO.setConstructionStatusName(statusLabel));
             // 非生产时间原因 数据字典
             findAndThen(nptReasonPair, reportVO.getNptReason(), statusLabel -> reportVO.setNptReasonName(statusLabel));
+
+            // 队伍当年累计注气量
+            findAndThen(yearGasInjectionPair, reportVO.getDeptId(), gasInjection -> {
+                // 转换单位为 万方
+                BigDecimal gasInjectionWanFang = gasInjection
+                        .divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
+                reportVO.setYearTotalGasInjection(gasInjectionWanFang);
+            });
+            // 队伍当年累计注水量
+            findAndThen(yearWaterInjectionPair, reportVO.getDeptId(), waterInjection -> reportVO.setYearTotalWaterInjection(waterInjection));
+            // 队伍当年累计用电量
+            findAndThen(yearPowerPair, reportVO.getDeptId(), power -> {
+                // 换算单位为 MWh
+                BigDecimal powerW = power
+                        .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP);
+                reportVO.setYearTotalPower(powerW);
+            });
+            // 队伍当年累计油耗
+            findAndThen(yearFuelPair, reportVO.getDeptId(), fuel -> reportVO.setYearTotalFuel(fuel));
+
+            // 井当年累计注气量
+            findAndThen(wellGasInjectionPair, reportVO.getTaskId(), gasInjection -> {
+                // 转换单位为 万方
+                BigDecimal gasInjectionWanFang = gasInjection
+                        .divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
+                reportVO.setWellTotalGasInjection(gasInjectionWanFang);
+            });
+            // 井当年累计注水量
+            findAndThen(wellWaterInjectionPair, reportVO.getTaskId(), waterInjection -> reportVO.setWellTotalWaterInjection(waterInjection));
+            // 井当年累计用电量
+            findAndThen(wellPowerPair, reportVO.getTaskId(), power -> {
+                // 换算单位为 MWh
+                BigDecimal powerW = power
+                        .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP);
+                reportVO.setWellTotalPower(powerW);
+            });
+            // 井当年累计油耗
+            findAndThen(wellFuelPair, reportVO.getTaskId(), fuel -> reportVO.setWellTotalFuel(fuel));
         });
     }
 
@@ -1386,7 +1734,7 @@ public class IotRhDailyReportController {
         List<IotRhDailyReportDO> list = iotRhDailyReportService.getIotRhDailyReportPage(pageReqVO).getList();
         // 导出 Excel
         ExcelUtils.write(response, "瑞恒日报.xls", "数据", IotRhDailyReportRespVO.class,
-                buildRhDailyReports(list, pageReqVO));
+                buildRhDailyReports(list, pageReqVO, "export"));
     }
 
     @GetMapping("/exportStatistics")
@@ -1441,4 +1789,80 @@ public class IotRhDailyReportController {
                 IotRhDailyReportStatisticsRespVO.class, statistics);
     }
 
+    @GetMapping("/exportSingleWells")
+    @Operation(summary = "导出瑞恒日报 报表统计 单井 Excel")
+    @PreAuthorize("@ss.hasPermission('pms:iot-rh-daily-report:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportSingleWells(@Valid IotRhDailyReportPageReqVO pageReqVO,
+                                 HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 分页查询
+        Set<Long> projectIds = new HashSet<>();
+        Set<Long> taskIds = new HashSet<>();
+        if (StrUtil.isNotBlank(pageReqVO.getContractName())) {
+            IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
+            reqVO.setContractName(pageReqVO.getContractName());
+            List<IotProjectInfoDO> projects = iotProjectInfoService.getIotProjectInfos(reqVO);
+            if (CollUtil.isNotEmpty(projects)) {
+                projects.forEach(project -> {
+                    projectIds.add(project.getId());
+                });
+                pageReqVO.setProjectIds(projectIds);
+            }
+        }
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName())) {
+            IotProjectTaskPageReqVO reqVO = new IotProjectTaskPageReqVO();
+            reqVO.setSearchKey(pageReqVO.getTaskName());
+            List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(reqVO);
+            if (CollUtil.isNotEmpty(tasks)) {
+                tasks.forEach(task -> {
+                    taskIds.add(task.getId());
+                });
+                pageReqVO.setTaskIds(taskIds);
+            }
+        }
+        List<IotRhDailyReportDO> reports = iotRhDailyReportService.teamReports(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "瑞恒日报单井统计.xls", "日报单井统计",
+                IotRhDailyReportRespVO.class, buildSubtotalRhDailyReports(reports, pageReqVO));
+    }
+
+    @GetMapping("/exportSingleTeams")
+    @Operation(summary = "导出瑞恒日报 报表统计 队伍 Excel")
+    @PreAuthorize("@ss.hasPermission('pms:iot-rh-daily-report:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportSingleTeams(@Valid IotRhDailyReportPageReqVO pageReqVO,
+                                  HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 分页查询
+        Set<Long> projectIds = new HashSet<>();
+        Set<Long> taskIds = new HashSet<>();
+        if (StrUtil.isNotBlank(pageReqVO.getContractName())) {
+            IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
+            reqVO.setContractName(pageReqVO.getContractName());
+            List<IotProjectInfoDO> projects = iotProjectInfoService.getIotProjectInfos(reqVO);
+            if (CollUtil.isNotEmpty(projects)) {
+                projects.forEach(project -> {
+                    projectIds.add(project.getId());
+                });
+                pageReqVO.setProjectIds(projectIds);
+            }
+        }
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName())) {
+            IotProjectTaskPageReqVO reqVO = new IotProjectTaskPageReqVO();
+            reqVO.setSearchKey(pageReqVO.getTaskName());
+            List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(reqVO);
+            if (CollUtil.isNotEmpty(tasks)) {
+                tasks.forEach(task -> {
+                    taskIds.add(task.getId());
+                });
+                pageReqVO.setTaskIds(taskIds);
+            }
+        }
+        List<IotRhDailyReportDO> reports = iotRhDailyReportService.wellReports(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "瑞恒日报单队伍统计.xls", "日报单队伍统计",
+                IotRhDailyReportRespVO.class, buildWellRhDailyReports(reports, pageReqVO));
+    }
+
 }

+ 5 - 8
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/vo/IotRhDailyReportRespVO.java

@@ -16,9 +16,12 @@ import java.util.List;
 public class IotRhDailyReportRespVO {
 
     @Schema(description = "创建时间")
-    @ExcelProperty("日报生成日期")
     private LocalDateTime createTime;
 
+    @Schema(description = "创建时间")
+    @ExcelProperty("创建时间")
+    private String createTimeStr;
+
     @Schema(description = "部门名称")
     @ExcelProperty("施工队伍")
     private String deptName;
@@ -66,7 +69,7 @@ public class IotRhDailyReportRespVO {
     private String transitTimeRate;
 
     @Schema(description = "当日注气量(万方)")
-    @ExcelProperty("当日注气量(方)")
+    @ExcelProperty("当日注气量(方)")
     private BigDecimal dailyGasInjection;
 
     @Schema(description = "当日注水量(方)")
@@ -130,11 +133,9 @@ public class IotRhDailyReportRespVO {
 
 
     @Schema(description = "施工开始日期")
-    @ExcelProperty("施工开始日期")
     private LocalDateTime constructionStartDate;
 
     @Schema(description = "施工结束日期")
-    @ExcelProperty("施工结束日期")
     private LocalDateTime constructionEndDate;
 
     @Schema(description = "生产动态", example = "2")
@@ -148,19 +149,15 @@ public class IotRhDailyReportRespVO {
     private String constructionStatus;
 
     @Schema(description = "人员情况")
-    @ExcelProperty("人员情况")
     private String personnel;
 
     @Schema(description = "累计注气量(方)")
-    @ExcelProperty("累计注气量(方)")
     private BigDecimal totalGasInjection;
 
     @Schema(description = "累计注水量(方)")
-    @ExcelProperty("累计注水量(方)")
     private BigDecimal totalWaterInjection;
 
     @Schema(description = "累计完工井次")
-    @ExcelProperty("累计完工井次")
     private BigDecimal cumulativeCompletion;
 
     @Schema(description = "产能")

+ 118 - 8
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/IotRyDailyReportController.java

@@ -1,6 +1,8 @@
 package cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DatePattern;
+import cn.hutool.core.date.LocalDateTimeUtil;
 import cn.hutool.core.util.ObjUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
@@ -23,7 +25,9 @@ import cn.iocoder.yudao.module.pms.service.iotprojectinfo.IotProjectInfoService;
 import cn.iocoder.yudao.module.pms.service.iotprojecttask.IotProjectTaskService;
 import cn.iocoder.yudao.module.pms.service.iotrydailyreport.IotRyDailyReportService;
 import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
+import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
 import cn.iocoder.yudao.module.system.service.dept.DeptService;
+import cn.iocoder.yudao.module.system.service.dict.DictDataService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -65,6 +69,8 @@ public class IotRyDailyReportController {
     private IotProjectTaskService iotProjectTaskService;
     @Resource
     private IotRyDailyReportMapper iotRyDailyReportMapper;
+    @Resource
+    private DictDataService dictDataService;
 
     @PostMapping("/create")
     @Operation(summary = "创建瑞鹰日报")
@@ -190,7 +196,7 @@ public class IotRyDailyReportController {
 
         PageResult<IotRyDailyReportDO> pageResult = iotRyDailyReportService.getIotRyDailyReportPage(pageReqVO);
 
-        return success(new PageResult<>(buildRyDailyReports(pageResult.getList(), pageReqVO), pageResult.getTotal()));
+        return success(new PageResult<>(buildRyDailyReports(pageResult.getList(), pageReqVO, "list"), pageResult.getTotal()));
     }
 
     @GetMapping("/teamReports")
@@ -302,7 +308,7 @@ public class IotRyDailyReportController {
      * @param reports
      * @return
      */
-    private List<IotRyDailyReportRespVO> buildRyDailyReports(List<IotRyDailyReportDO> reports, IotRyDailyReportPageReqVO pageReqVO) {
+    private List<IotRyDailyReportRespVO> buildRyDailyReports(List<IotRyDailyReportDO> reports, IotRyDailyReportPageReqVO pageReqVO, String type) {
         if (CollUtil.isEmpty(reports)) {
             return Collections.emptyList();
         }
@@ -334,6 +340,36 @@ public class IotRyDailyReportController {
         Map<Long, Integer> totalTasksPair = new HashMap<>();
         // key施工队伍id    value完工井数量
         Map<Long, Integer> completedTasksPair = new HashMap<>();
+        // key非生产时间原因数据字典value   value非生产时间原因数据字典label
+        Map<String, String> nptReasonPair = new HashMap<>();
+        // key施工状态数据字典value   value施工状态数据字典label
+        Map<String, String> constructStatusPair = new HashMap<>();
+
+        // 钻井 施工状态 字典数据
+        List<DictDataDO> rigStatusDictData = dictDataService.getDictDataListByDictType("rigStatus");
+        // 修井 施工状态 字典数据
+        List<DictDataDO> repairStatusDictData = dictDataService.getDictDataListByDictType("repairStatus");
+        // 非生产时间原因 字典数据
+        List<DictDataDO> nptReasonDictData = dictDataService.getDictDataListByDictType("ryNptReason");
+
+        if (CollUtil.isNotEmpty(nptReasonDictData)) {
+            nptReasonDictData.forEach(data -> {
+                nptReasonPair.put(data.getValue(), data.getLabel());
+            });
+        }
+        // 钻井施工状态
+        if ("1".equals(pageReqVO.getProjectClassification()) && CollUtil.isNotEmpty(rigStatusDictData)) {
+            rigStatusDictData.forEach(data -> {
+                constructStatusPair.put(data.getValue(), data.getLabel());
+            });
+        }
+        // 修井施工状态
+        if ("2".equals(pageReqVO.getProjectClassification()) && CollUtil.isNotEmpty(repairStatusDictData)) {
+            repairStatusDictData.forEach(data -> {
+                constructStatusPair.put(data.getValue(), data.getLabel());
+            });
+        }
+
         DataPermissionUtils.executeIgnore(() -> {
             // 查询日报关联的项目信息
             IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
@@ -416,6 +452,14 @@ public class IotRyDailyReportController {
                         .divide(BigDecimal.valueOf(1), 2, RoundingMode.HALF_UP);
                 reportVO.setDailyFuel(fuel);
             }
+            // 日报生成日期 格式化时间为 yyyy-MM-dd
+            if (ObjUtil.isNotEmpty(reportVO.getCreateTime())) {
+                reportVO.setCreateTimeStr(LocalDateTimeUtil.format(reportVO.getCreateTime(), DatePattern.NORM_DATE_PATTERN));
+            }
+            // 上井次完井时间 格式化时间为 yyyy-MM-dd
+            if (ObjUtil.isNotEmpty(reportVO.getLatestWellDoneTime())) {
+                reportVO.setLatestWellDoneTimeStr(LocalDateTimeUtil.format(reportVO.getLatestWellDoneTime(), DatePattern.NORM_DATE_PATTERN));
+            }
             // 2.1 拼接部门信息
             findAndThen(deptMap, reportVO.getDeptId(), dept -> reportVO.setDeptName(dept.getName()));
             // 2.2 日报关联的项目信息
@@ -443,6 +487,20 @@ public class IotRyDailyReportController {
             // 2.8 总施工井数 完工井数
             findAndThen(totalTasksPair, reportVO.getDeptId(), totalTaskCount -> reportVO.setTotalConstructionWells(totalTaskCount));
             findAndThen(completedTasksPair, reportVO.getDeptId(), completedTaskCount -> reportVO.setCompletedWells(completedTaskCount));
+            // 钻井 施工状态 数据字典
+            findAndThen(constructStatusPair, reportVO.getRigStatus(), statusLabel -> {
+                if ("1".equals(pageReqVO.getProjectClassification())) {
+                    reportVO.setConstructionStatusName(statusLabel);
+                }
+            });
+            // 修井 施工状态 数据字典
+            findAndThen(constructStatusPair, reportVO.getRepairStatus(), statusLabel -> {
+                if ("2".equals(pageReqVO.getProjectClassification())) {
+                    reportVO.setConstructionStatusName(statusLabel);
+                }
+            });
+            // 非生产时间原因 数据字典
+            findAndThen(nptReasonPair, reportVO.getRyNptReason(), statusLabel -> reportVO.setRyNptReason(statusLabel));
         });
     }
 
@@ -1354,16 +1412,41 @@ public class IotRyDailyReportController {
     }
 
     @GetMapping("/export-excel")
-    @Operation(summary = "导出瑞鹰日报 Excel")
+    @Operation(summary = "导出瑞鹰 钻井 修井 日报 Excel")
     @PreAuthorize("@ss.hasPermission('pms:iot-ry-daily-report:export')")
     @ApiAccessLog(operateType = EXPORT)
     public void exportIotRyDailyReportExcel(@Valid IotRyDailyReportPageReqVO pageReqVO,
               HttpServletResponse response) throws IOException {
         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 分页查询
+        Set<Long> projectIds = new HashSet<>();
+        Set<Long> taskIds = new HashSet<>();
+        if (StrUtil.isNotBlank(pageReqVO.getContractName())) {
+            IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
+            reqVO.setContractName(pageReqVO.getContractName());
+            List<IotProjectInfoDO> projects = iotProjectInfoService.getIotProjectInfos(reqVO);
+            if (CollUtil.isNotEmpty(projects)) {
+                projects.forEach(project -> {
+                    projectIds.add(project.getId());
+                });
+                pageReqVO.setProjectIds(projectIds);
+            }
+        }
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName())) {
+            IotProjectTaskPageReqVO reqVO = new IotProjectTaskPageReqVO();
+            reqVO.setSearchKey(pageReqVO.getTaskName());
+            List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(reqVO);
+            if (CollUtil.isNotEmpty(tasks)) {
+                tasks.forEach(task -> {
+                    taskIds.add(task.getId());
+                });
+                pageReqVO.setTaskIds(taskIds);
+            }
+        }
         List<IotRyDailyReportDO> list = iotRyDailyReportService.getIotRyDailyReportPage(pageReqVO).getList();
         // 导出 Excel
         ExcelUtils.write(response, "瑞鹰日报.xls", "数据", IotRyDailyReportRespVO.class,
-                        BeanUtils.toBean(list, IotRyDailyReportRespVO.class));
+                buildRyDailyReports(list, pageReqVO, "export"));
     }
 
     @GetMapping("/exportStatistics")
@@ -1398,9 +1481,12 @@ public class IotRyDailyReportController {
                 pageReqVO.setTaskIds(taskIds);
             }
         }
+        String sheetName = StrUtil.EMPTY;
+
         List<IotRyDailyReportStatisticsRespVO> statistics = iotRyDailyReportService.statistics(pageReqVO);
         if (CollUtil.isNotEmpty(statistics)) {
             statistics.forEach(stat -> {
+                // 修井 平均时效
                 BigDecimal transitTime = stat.getTransitTime();
                 if (ObjUtil.isEmpty(transitTime) || transitTime.compareTo(BigDecimal.ZERO) == 0) {
                     stat.setTransitTimePercent("0.00%");
@@ -1410,19 +1496,43 @@ public class IotRyDailyReportController {
                             .setScale(2, RoundingMode.HALF_UP);
                     stat.setTransitTimePercent(percent + "%");
                 }
+                // 非生产时效
+                BigDecimal nonProductiveTime = stat.getNonProductiveTime();
+                if (ObjUtil.isEmpty(nonProductiveTime) || nonProductiveTime.compareTo(BigDecimal.ZERO) == 0) {
+                    stat.setNonProductiveTimeStr("0.00%");
+                } else {
+                    // 转换逻辑:乘以100 → 保留2位小数(四舍五入)→ 拼接%
+                    BigDecimal percent = nonProductiveTime.multiply(new BigDecimal("100"))
+                            .setScale(2, RoundingMode.HALF_UP);
+                    stat.setNonProductiveTimeStr(percent + "%");
+                }
+                // 累计用电量 MWh
+                BigDecimal cumulativePowerConsumption = stat.getCumulativePowerConsumption();
+                if (ObjUtil.isNotEmpty(cumulativePowerConsumption)) {
+                    BigDecimal powerWanFang = cumulativePowerConsumption
+                            .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP);
+                    stat.setCumulativePowerConsumptionExport(powerWanFang);
+                }
             });
         }
-        String sheetName = StrUtil.EMPTY;
+
         if ("1".equals(pageReqVO.getProjectClassification())) {
             // 钻井日报汇总数据
             sheetName = "钻井日报汇总数据";
+            // 修改 statistics 集合类型为 IotRyZjDailyReportStatisticsRespVO
+            List<IotRyZjDailyReportStatisticsRespVO> zjStatistics = BeanUtils.toBean(statistics, IotRyZjDailyReportStatisticsRespVO.class);
+            // 导出 Excel
+            ExcelUtils.write(response, "瑞鹰日报汇总.xls", sheetName,
+                    IotRyZjDailyReportStatisticsRespVO.class, zjStatistics);
         } else {
             // 修井日报汇总数据
             sheetName = "修井日报汇总数据";
+            // 修改 statistics 集合类型为 IotRyXjDailyReportStatisticsRespVO
+            List<IotRyXjDailyReportStatisticsRespVO> xjStatistics = BeanUtils.toBean(statistics, IotRyXjDailyReportStatisticsRespVO.class);
+            // 导出 Excel
+            ExcelUtils.write(response, "瑞鹰日报汇总.xls", sheetName,
+                    IotRyXjDailyReportStatisticsRespVO.class, xjStatistics);
         }
-        // 导出 Excel
-        ExcelUtils.write(response, "瑞鹰日报汇总.xls", sheetName,
-                IotRyDailyReportStatisticsRespVO.class, statistics);
     }
 
 }

+ 30 - 34
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportRespVO.java

@@ -13,24 +13,38 @@ import java.time.LocalDateTime;
 @ExcelIgnoreUnannotated
 public class IotRyDailyReportRespVO {
 
+    @Schema(description = "创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "创建时间")
+    @ExcelProperty("创建时间")
+    private String createTimeStr;
+
+    @Schema(description = "部门名称")
+    @ExcelProperty("施工队伍")
+    private String deptName;
+
+    @Schema(description = "项目/合同名称")
+    @ExcelProperty("项目")
+    private String contractName;
+
+    @Schema(description = "任务 井号-施工地点")
+    @ExcelProperty("任务")
+    private String taskName;
+
     @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25152")
-    @ExcelProperty("主键id")
     private Long id;
 
     @Schema(description = "施工队伍id", example = "29285")
-    @ExcelProperty("施工队伍id")
     private Long deptId;
 
     @Schema(description = "项目id", example = "23929")
-    @ExcelProperty("项目id")
     private Long projectId;
 
     @Schema(description = "任务id", example = "1515")
-    @ExcelProperty("任务id")
     private Long taskId;
 
     @Schema(description = "项目类别(钻井 修井 注氮 酸化压裂... )")
-    @ExcelProperty("项目类别(钻井 修井 注氮 酸化压裂... )")
     private String projectClassification;
 
     @Schema(description = "搬迁安装天数(D)")
@@ -38,9 +52,12 @@ public class IotRyDailyReportRespVO {
     private BigDecimal relocationDays;
 
     @Schema(description = "上井次完井时间")
-    @ExcelProperty("上井次完井时间")
     private LocalDateTime latestWellDoneTime;
 
+    @Schema(description = "上井次完井时间")
+    @ExcelProperty("上井次完井时间")
+    private String latestWellDoneTimeStr;
+
     @Schema(description = "当前井深(m)")
     @ExcelProperty("当前井深(m)")
     private BigDecimal currentDepth;
@@ -62,7 +79,6 @@ public class IotRyDailyReportRespVO {
     private BigDecimal dailyPowerUsage;
 
     @Schema(description = "当月用电量(kWh)")
-    @ExcelProperty("当月用电量(kWh)")
     private BigDecimal monthlyPowerUsage;
 
     @Schema(description = "当日油耗(吨)")
@@ -70,15 +86,12 @@ public class IotRyDailyReportRespVO {
     private BigDecimal dailyFuel;
 
     @Schema(description = "当月油耗(吨)")
-    @ExcelProperty("当月油耗(吨)")
     private BigDecimal monthlyFuel;
 
     @Schema(description = "当日上油数量(吨)")
-    @ExcelProperty("当日上油数量(吨)")
     private BigDecimal dailyOilVolume;
 
     @Schema(description = "柴油剩余数量(吨)")
-    @ExcelProperty("柴油剩余数量(吨)")
     private BigDecimal remainDieselVolume;
 
     @Schema(description = "生产时间(H)")
@@ -93,7 +106,6 @@ public class IotRyDailyReportRespVO {
     @ExcelProperty("非生产时间原因")
     private String ryNptReason;
 
-
     @Schema(description = "进尺工作时间(H)")
     @ExcelProperty("进尺工作时间(H)")
     private BigDecimal drillingWorkingTime;
@@ -147,6 +159,10 @@ public class IotRyDailyReportRespVO {
     @ExcelProperty("当日生产情况生产动态")
     private String productionStatus;
 
+    @Schema(description = "施工状态 对应的数据字典 label")
+    @ExcelProperty("施工状态")
+    private String constructionStatusName;
+
     @Schema(description = "目前工序")
     @ExcelProperty("目前工序")
     private String currentOperation;
@@ -156,11 +172,9 @@ public class IotRyDailyReportRespVO {
     private String nextPlan;
 
     @Schema(description = "施工状态(动迁 准备 施工 完工)", example = "1")
-    @ExcelProperty("施工状态(动迁 准备 施工 完工)")
     private String rigStatus;
 
     @Schema(description = "瑞鹰修井 施工状态(动迁 准备 施工 完工)", example = "1")
-    @ExcelProperty("瑞鹰修井 施工状态(动迁 准备 施工 完工)")
     private String repairStatus;
 
     @Schema(description = "人员情况")
@@ -176,15 +190,15 @@ public class IotRyDailyReportRespVO {
     private BigDecimal leaveStaffNum;
 
     @Schema(description = "泥浆性能-密度(g/cm³)")
-    @ExcelProperty("泥浆性能-密度(g/cm³)")
+    @ExcelProperty("泥浆密度(g/cm³)")
     private BigDecimal mudDensity;
 
     @Schema(description = "泥浆性能-粘度(S)")
-    @ExcelProperty("泥浆性能-粘度(S)")
+    @ExcelProperty("泥浆粘度(S)")
     private BigDecimal mudViscosity;
 
     @Schema(description = "水平段长度(m) 适用于水平井")
-    @ExcelProperty("水平段长度(m) 适用于水平井")
+    @ExcelProperty("水平段长度(m)")
     private BigDecimal lateralLength;
 
     @Schema(description = "井斜(°)")
@@ -196,11 +210,9 @@ public class IotRyDailyReportRespVO {
     private BigDecimal azimuth;
 
     @Schema(description = "不同专业公司的扩展属性值")
-    @ExcelProperty("不同专业公司的扩展属性值")
     private String extProperty;
 
     @Schema(description = "排序值")
-    @ExcelProperty("排序值")
     private Integer sort;
 
     @Schema(description = "备注", example = "随便")
@@ -208,36 +220,20 @@ public class IotRyDailyReportRespVO {
     private String remark;
 
     @Schema(description = "状态(0启用 1禁用)", example = "2")
-    @ExcelProperty("状态(0启用 1禁用)")
     private Integer status;
 
     @Schema(description = "流程实例id", example = "7723")
-    @ExcelProperty("流程实例id")
     private String processInstanceId;
 
     @Schema(description = "审批状态 未提交、审批中、审批通过、审批不通过、已取消", example = "2")
-    @ExcelProperty("审批状态 未提交、审批中、审批通过、审批不通过、已取消")
     private Integer auditStatus;
 
     @Schema(description = "审批意见", example = "同意")
     private String opinion;
 
-    @Schema(description = "创建时间")
-    @ExcelProperty("创建时间")
-    private LocalDateTime createTime;
-
     /**
      * 扩展字段
      */
-    @Schema(description = "部门名称")
-    private String deptName;
-
-    @Schema(description = "项目/合同名称")
-    private String contractName;
-
-    @Schema(description = "任务 井号-施工地点")
-    private String taskName;
-
     @Schema(description = "设计井深(m)")
     private BigDecimal designWellDepth;
 

+ 8 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportStatisticsRespVO.java

@@ -51,9 +51,12 @@ public class IotRyDailyReportStatisticsRespVO {
     private Integer cumulativeCompletedWells = 0;
 
     @Schema(description = "累计用电量(kWh)")
-    @ExcelProperty("累计用电量(kWh)")
     private BigDecimal cumulativePowerConsumption = BigDecimal.ZERO;
 
+    @Schema(description = "累计用电量(MWh)")
+    @ExcelProperty("累计用电量(MWh)")
+    private BigDecimal cumulativePowerConsumptionExport = BigDecimal.ZERO;
+
     @Schema(description = "累计油耗(升)")
     @ExcelProperty("累计油耗(升)")
     private BigDecimal cumulativeFuelConsumption = BigDecimal.ZERO;
@@ -72,4 +75,8 @@ public class IotRyDailyReportStatisticsRespVO {
     @ExcelProperty("运行时效")
     private String transitTimePercent;
 
+    @Schema(description = "非生产时效")
+    @ExcelProperty("非生产时效")
+    private String nonProductiveTimeStr;
+
 }

+ 81 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyXjDailyReportStatisticsRespVO.java

@@ -0,0 +1,81 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 瑞鹰日报 汇总统计 修井 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotRyXjDailyReportStatisticsRespVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13853")
+    private Long id;
+
+    @Schema(description = "项目部id", example = "125")
+    private Long projectDeptId;
+
+    @Schema(description = "队伍id", example = "125")
+    private Long teamId;
+
+    @Schema(description = "项目部名称", example = "新疆项目部")
+    @ExcelProperty("项目部名称")
+    private String projectDeptName;
+
+    @Schema(description = "队伍名称", example = "小修20队")
+    @ExcelProperty("队伍名称")
+    private String teamName;
+
+    @Schema(description = "任务id", example = "15678")
+    private Long taskId;
+
+    @Schema(description = "排序", example = "1")
+    private Integer sort;
+
+    @Schema(description = "部门类型(公司级1 项目部2 队伍3)", example = "1")
+    private String type;
+
+    @Schema(description = "累计进尺(m)")
+    private BigDecimal cumulativeFootage = BigDecimal.ZERO;
+
+    @Schema(description = "累计施工井数")
+    @ExcelProperty("累计施工井数")
+    private Integer cumulativeConstructWells = 0;
+
+    @Schema(description = "累计完工井数")
+    @ExcelProperty("累计完工井数")
+    private Integer cumulativeCompletedWells = 0;
+
+    @Schema(description = "累计用电量(kWh)")
+    private BigDecimal cumulativePowerConsumption = BigDecimal.ZERO;
+
+    @Schema(description = "累计用电量(MWh)")
+    @ExcelProperty("累计用电量(MWh)")
+    private BigDecimal cumulativePowerConsumptionExport = BigDecimal.ZERO;
+
+    @Schema(description = "累计油耗(升)")
+    @ExcelProperty("累计油耗(升)")
+    private BigDecimal cumulativeFuelConsumption = BigDecimal.ZERO;
+
+    @Schema(description = "平均油耗(升)")
+    @ExcelProperty("平均油耗(升)")
+    private BigDecimal averageFuelConsumption = BigDecimal.ZERO;
+
+    @Schema(description = "运行时效")
+    private BigDecimal transitTime = BigDecimal.ZERO;
+
+    @Schema(description = "非生产时效")
+    private BigDecimal nonProductiveTime = BigDecimal.ZERO;
+
+    @Schema(description = "运行时效")
+    @ExcelProperty("运行时效")
+    private String transitTimePercent;
+
+    @Schema(description = "非生产时效")
+    @ExcelProperty("非生产时效")
+    private String nonProductiveTimeStr;
+
+}

+ 80 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyZjDailyReportStatisticsRespVO.java

@@ -0,0 +1,80 @@
+package cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 瑞鹰日报 汇总统计 钻井 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IotRyZjDailyReportStatisticsRespVO {
+
+    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13853")
+    private Long id;
+
+    @Schema(description = "项目部id", example = "125")
+    private Long projectDeptId;
+
+    @Schema(description = "队伍id", example = "125")
+    private Long teamId;
+
+    @Schema(description = "项目部名称", example = "新疆项目部")
+    @ExcelProperty("项目部名称")
+    private String projectDeptName;
+
+    @Schema(description = "队伍名称", example = "小修20队")
+    @ExcelProperty("队伍名称")
+    private String teamName;
+
+    @Schema(description = "任务id", example = "15678")
+    private Long taskId;
+
+    @Schema(description = "排序", example = "1")
+    private Integer sort;
+
+    @Schema(description = "部门类型(公司级1 项目部2 队伍3)", example = "1")
+    private String type;
+
+    @Schema(description = "累计进尺(m)")
+    @ExcelProperty("累计进尺(m)")
+    private BigDecimal cumulativeFootage = BigDecimal.ZERO;
+
+    @Schema(description = "累计施工井数")
+    private Integer cumulativeConstructWells = 0;
+
+    @Schema(description = "累计完工井数")
+    private Integer cumulativeCompletedWells = 0;
+
+    @Schema(description = "累计用电量(kWh)")
+    private BigDecimal cumulativePowerConsumption = BigDecimal.ZERO;
+
+    @Schema(description = "累计用电量(MWh)")
+    @ExcelProperty("累计用电量(MWh)")
+    private BigDecimal cumulativePowerConsumptionExport = BigDecimal.ZERO;
+
+    @Schema(description = "累计油耗(升)")
+    @ExcelProperty("累计油耗(升)")
+    private BigDecimal cumulativeFuelConsumption = BigDecimal.ZERO;
+
+    @Schema(description = "平均油耗(升)")
+    @ExcelProperty("平均油耗(升)")
+    private BigDecimal averageFuelConsumption = BigDecimal.ZERO;
+
+    @Schema(description = "运行时效")
+    private BigDecimal transitTime = BigDecimal.ZERO;
+
+    @Schema(description = "非生产时效")
+    private BigDecimal nonProductiveTime = BigDecimal.ZERO;
+
+    @Schema(description = "运行时效")
+    @ExcelProperty("运行时效")
+    private String transitTimePercent;
+
+    @Schema(description = "非生产时效")
+    @ExcelProperty("非生产时效")
+    private String nonProductiveTimeStr;
+
+}

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

@@ -50,6 +50,7 @@ import org.springframework.validation.annotation.Validated;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -1306,7 +1307,13 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
             statistics.setCumulativeWorkingLayers(cumulativeWorkingLayersPair.get(deptId));
             statistics.setCumulativeMixSand(cumulativeMixSandPair.get(deptId));
             statistics.setCumulativePumpTrips(cumulativePumpTripsPair.get(deptId));
-            statistics.setTotalDailyFuel(cumulativeFuelsPair.get(deptId));
+            BigDecimal cumulativeFuel = cumulativeFuelsPair.get(deptId);
+            if (ObjUtil.isNotEmpty(cumulativeFuel)) {
+                // 油耗单位转换成 万升
+                BigDecimal FuelWan = cumulativeFuel
+                        .divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
+                statistics.setTotalDailyFuel(FuelWan);
+            }
             result.add(statistics);
         });