|
@@ -486,7 +486,6 @@ public class IotRdDailyReportController {
|
|
|
dailyReportVO.setDeptName(dept.getName());
|
|
dailyReportVO.setDeptName(dept.getName());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 日报任务对应的平台井列表
|
|
// 日报任务对应的平台井列表
|
|
|
if (1 == dailyReport.getPlatformWell()) {
|
|
if (1 == dailyReport.getPlatformWell()) {
|
|
|
// 查询未施工完成的平台井 关联井列表
|
|
// 查询未施工完成的平台井 关联井列表
|
|
@@ -500,15 +499,19 @@ public class IotRdDailyReportController {
|
|
|
List<IotRdDailyReportDO> reports = iotRdDailyReportService.dailyReports(reportReqVO);
|
|
List<IotRdDailyReportDO> reports = iotRdDailyReportService.dailyReports(reportReqVO);
|
|
|
// key任务id value日报id
|
|
// key任务id value日报id
|
|
|
Map<Long, Long> reportPair = new HashMap<>();
|
|
Map<Long, Long> reportPair = new HashMap<>();
|
|
|
|
|
+ // key任务id value任务井对应日报当日油耗
|
|
|
|
|
+ Map<Long, BigDecimal> reportFuelPair = new HashMap<>();
|
|
|
// key任务id value平台井日报已经设置的多种属性
|
|
// key任务id value平台井日报已经设置的多种属性
|
|
|
Map<Long, IotProjectTaskPlatformVO> platformPair = new HashMap<>();
|
|
Map<Long, IotProjectTaskPlatformVO> platformPair = new HashMap<>();
|
|
|
|
|
+ Set<Long> reportIds = new HashSet<>();
|
|
|
if (CollUtil.isNotEmpty(reports)) {
|
|
if (CollUtil.isNotEmpty(reports)) {
|
|
|
reports.forEach(report -> {
|
|
reports.forEach(report -> {
|
|
|
|
|
+ reportIds.add(report.getId());
|
|
|
// 保养平台井关联的多个日报使用
|
|
// 保养平台井关联的多个日报使用
|
|
|
reportPair.put(report.getTaskId(), report.getId());
|
|
reportPair.put(report.getTaskId(), report.getId());
|
|
|
// 设置 平台关联井 已经设置的 属性 施工状态 施工工艺 工作量属性
|
|
// 设置 平台关联井 已经设置的 属性 施工状态 施工工艺 工作量属性
|
|
|
// 查询 平台关联井详情使用
|
|
// 查询 平台关联井详情使用
|
|
|
-
|
|
|
|
|
|
|
+ reportFuelPair.put(report.getTaskId(), report.getDailyFuel());
|
|
|
IotProjectTaskPlatformVO platformVO = new IotProjectTaskPlatformVO();
|
|
IotProjectTaskPlatformVO platformVO = new IotProjectTaskPlatformVO();
|
|
|
platformVO.setRdStatus(report.getRdStatus());
|
|
platformVO.setRdStatus(report.getRdStatus());
|
|
|
if (StrUtil.isNotBlank(report.getRdStatus()) && statusDictPair.containsKey(report.getRdStatus())) {
|
|
if (StrUtil.isNotBlank(report.getRdStatus()) && statusDictPair.containsKey(report.getRdStatus())) {
|
|
@@ -528,6 +531,27 @@ public class IotRdDailyReportController {
|
|
|
platformPair.put(report.getTaskId(), platformVO);
|
|
platformPair.put(report.getTaskId(), platformVO);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ // 查询多个日报id 对应的 已经保存的油耗记录
|
|
|
|
|
+ IotDailyReportFuelPageReqVO fuelReqVO = new IotDailyReportFuelPageReqVO();
|
|
|
|
|
+ fuelReqVO.setType("RD");
|
|
|
|
|
+ fuelReqVO.setReportIds(reportIds);
|
|
|
|
|
+ List<IotDailyReportFuelDO> relatedReportFuels = iotDailyReportFuelService.getIotDailyReportFuels(fuelReqVO);
|
|
|
|
|
+ Map<Long, List<IotDailyReportFuelDO>> reportFuelsPair = new HashMap<>();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(relatedReportFuels)) {
|
|
|
|
|
+ relatedReportFuels.forEach(fuel -> {
|
|
|
|
|
+ if (reportFuelsPair.containsKey(fuel.getReportId())) {
|
|
|
|
|
+ List<IotDailyReportFuelDO> tempFuels = reportFuelsPair.get(fuel.getReportId());
|
|
|
|
|
+ tempFuels.add(fuel);
|
|
|
|
|
+ reportFuelsPair.put(fuel.getReportId(), tempFuels);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ List<IotDailyReportFuelDO> tempFuels = new ArrayList<>();
|
|
|
|
|
+ tempFuels.add(fuel);
|
|
|
|
|
+ reportFuelsPair.put(fuel.getReportId(), tempFuels);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ // 返回已经填报的油耗记录
|
|
|
|
|
+
|
|
|
List<IotProjectTaskPlatformVO> platforms = new ArrayList<>();
|
|
List<IotProjectTaskPlatformVO> platforms = new ArrayList<>();
|
|
|
if (CollUtil.isNotEmpty(tasks)) {
|
|
if (CollUtil.isNotEmpty(tasks)) {
|
|
|
tasks.forEach(task -> {
|
|
tasks.forEach(task -> {
|
|
@@ -538,6 +562,7 @@ public class IotRdDailyReportController {
|
|
|
platform.setWellName(task.getWellName());
|
|
platform.setWellName(task.getWellName());
|
|
|
platform.setWorkloadDesign(task.getWorkloadDesign());
|
|
platform.setWorkloadDesign(task.getWorkloadDesign());
|
|
|
platform.setReportId(reportPair.get(task.getId()));
|
|
platform.setReportId(reportPair.get(task.getId()));
|
|
|
|
|
+ platform.setDailyFuel(reportFuelPair.get(task.getId()));
|
|
|
if (platformPair.containsKey(task.getId())) {
|
|
if (platformPair.containsKey(task.getId())) {
|
|
|
IotProjectTaskPlatformVO tempPlatform = platformPair.get(task.getId());
|
|
IotProjectTaskPlatformVO tempPlatform = platformPair.get(task.getId());
|
|
|
platform.setRdStatus(tempPlatform.getRdStatus());
|
|
platform.setRdStatus(tempPlatform.getRdStatus());
|
|
@@ -555,6 +580,8 @@ public class IotRdDailyReportController {
|
|
|
List<IotProjectTaskPlatformVO> finishedPlatforms = new ArrayList<>();
|
|
List<IotProjectTaskPlatformVO> finishedPlatforms = new ArrayList<>();
|
|
|
// key任务井id value任务井名称
|
|
// key任务井id value任务井名称
|
|
|
Map<Long, String> wellNamePair = new HashMap<>();
|
|
Map<Long, String> wellNamePair = new HashMap<>();
|
|
|
|
|
+ // key任务id value任务井对应日报当日油耗
|
|
|
|
|
+ Map<Long, BigDecimal> finishedReportFuelPair = new HashMap<>();
|
|
|
// 查询当前任务关联的平台井任务列表
|
|
// 查询当前任务关联的平台井任务列表
|
|
|
IotProjectTaskPageReqVO currentPlatformTaskReqVO = new IotProjectTaskPageReqVO();
|
|
IotProjectTaskPageReqVO currentPlatformTaskReqVO = new IotProjectTaskPageReqVO();
|
|
|
currentPlatformTaskReqVO.setPlatformGroup(dailyReport.getTaskPlatform());
|
|
currentPlatformTaskReqVO.setPlatformGroup(dailyReport.getTaskPlatform());
|
|
@@ -576,9 +603,14 @@ public class IotRdDailyReportController {
|
|
|
}
|
|
}
|
|
|
if (CollUtil.isNotEmpty(currentRelatedReports)) {
|
|
if (CollUtil.isNotEmpty(currentRelatedReports)) {
|
|
|
currentRelatedReports.forEach(report -> {
|
|
currentRelatedReports.forEach(report -> {
|
|
|
|
|
+ if (reportFuelsPair.containsKey(report.getId())) {
|
|
|
|
|
+ List<IotDailyReportFuelDO> finishedReportFuels = reportFuelsPair.get(report.getId());
|
|
|
|
|
+ dailyReportVO.setReportedFuels(finishedReportFuels);
|
|
|
|
|
+ }
|
|
|
if (StrUtil.isNotBlank(report.getRdStatus())) {
|
|
if (StrUtil.isNotBlank(report.getRdStatus())) {
|
|
|
IotProjectTaskPlatformVO platform = new IotProjectTaskPlatformVO();
|
|
IotProjectTaskPlatformVO platform = new IotProjectTaskPlatformVO();
|
|
|
platform.setId(report.getTaskId());
|
|
platform.setId(report.getTaskId());
|
|
|
|
|
+ platform.setDailyFuel(report.getDailyFuel());
|
|
|
if (wellNamePair.containsKey(report.getTaskId())) {
|
|
if (wellNamePair.containsKey(report.getTaskId())) {
|
|
|
platform.setWellName(wellNamePair.get(report.getTaskId()));
|
|
platform.setWellName(wellNamePair.get(report.getTaskId()));
|
|
|
}
|
|
}
|