|
@@ -1274,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(() -> {
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
|
// 查询日报关联的项目信息
|
|
// 查询日报关联的项目信息
|
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
@@ -1511,6 +1521,16 @@ public class IotRdDailyReportController {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
return BeanUtils.toBean(reports, IotRdDailyReportRespVO.class, (reportVO) -> {
|
|
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));
|
|
findAndThen(taskTeamsPair, reportVO.getTaskId(), deptNames -> reportVO.setDeptName(deptNames));
|
|
|
// 日报关联的项目信息
|
|
// 日报关联的项目信息
|
|
@@ -1817,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(() -> {
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
|
// 查询日报关联的项目信息
|
|
// 查询日报关联的项目信息
|
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
@@ -2054,6 +2084,16 @@ public class IotRdDailyReportController {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
return BeanUtils.toBean(reports, IotRdDailyReportRespVO.class, (reportVO) -> {
|
|
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));
|
|
findAndThen(taskTeamsPair, reportVO.getTaskId(), deptNames -> reportVO.setDeptName(deptNames));
|
|
|
// 日报关联的项目信息
|
|
// 日报关联的项目信息
|
|
@@ -2612,4 +2652,80 @@ public class IotRdDailyReportController {
|
|
|
buildDailyReportList(result));
|
|
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,
|
|
|
|
|
+ buildWellRdDailyReports(result, pageReqVO));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|