|
|
@@ -191,6 +191,7 @@ public class IotRdDailyReportController {
|
|
|
private IotRdDailyReportRespVO buildDailyReport(IotRdDailyReportDO dailyReport) {
|
|
|
IotRdDailyReportRespVO dailyReportVO = BeanUtils.toBean(dailyReport, IotRdDailyReportRespVO.class);
|
|
|
// 查询日报生产动态明细
|
|
|
+ // 当前井及平台井的 taskId 依次查询有无 生产动态明细 哪个井有明细 用哪个任务井
|
|
|
IotRdDailyReportDetailPageReqVO detailReqVO = new IotRdDailyReportDetailPageReqVO();
|
|
|
detailReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
detailReqVO.setReportId(dailyReport.getId());
|
|
|
@@ -224,11 +225,6 @@ public class IotRdDailyReportController {
|
|
|
// 查询当前日报是否已经绑定了油耗信息
|
|
|
// 兼容主井完工 关联井 没有完工的情况 查询关联井的油耗信息
|
|
|
boolean hasFuels = false;
|
|
|
- /* IotDailyReportFuelPageReqVO fuelPageReqVO = new IotDailyReportFuelPageReqVO();
|
|
|
- fuelPageReqVO.setType("RD");
|
|
|
- fuelPageReqVO.setReportId(dailyReport.getId());
|
|
|
- List<IotDailyReportFuelDO> reportFuels = iotDailyReportFuelService.getIotDailyReportFuels(fuelPageReqVO); */
|
|
|
-
|
|
|
// 查询所有主井 关联井 油耗
|
|
|
Map<Long, List<IotDailyReportFuelDO>> reportedFuelsPair = new HashMap<>();
|
|
|
if (1 == dailyReport.getPlatformWell()) {
|
|
|
@@ -562,6 +558,8 @@ public class IotRdDailyReportController {
|
|
|
List<IotRdDailyReportDO> reports = iotRdDailyReportService.dailyReports(reportReqVO);
|
|
|
// 查询所有主井 关联井 附件
|
|
|
Map<Long, List<IotAttachmentDO>> reportAttachmentsPair = new HashMap<>();
|
|
|
+ // 查询所有主井 关联井 生产动态明细
|
|
|
+ Map<Long, List<IotRdDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
|
|
|
|
|
|
if (CollUtil.isNotEmpty(reports)) {
|
|
|
List<Long> reportIds = convertList(reports, IotRdDailyReportDO::getId);
|
|
|
@@ -584,6 +582,29 @@ public class IotRdDailyReportController {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ // 查询多个日报对应的生产动态明细
|
|
|
+ // 查询日报生产动态明细
|
|
|
+ // 当前井及平台井的 taskId 依次查询有无 生产动态明细 哪个井有明细 用哪个任务井
|
|
|
+ IotRdDailyReportDetailPageReqVO relatedDetailReqVO = new IotRdDailyReportDetailPageReqVO();
|
|
|
+ relatedDetailReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ relatedDetailReqVO.setReportIds(reportIds);
|
|
|
+ PageResult<IotRdDailyReportDetailDO> relatedReportDetailPage = iotRdDailyReportDetailMapper.selectPage(relatedDetailReqVO);
|
|
|
+ List<IotRdDailyReportDetailDO> relatedReportDetails = relatedReportDetailPage.getList();
|
|
|
+ if (CollUtil.isNotEmpty(relatedReportDetails)) {
|
|
|
+ relatedReportDetails.forEach(detail -> {
|
|
|
+ IotRdDailyReportDetailRespVO dailyReportDetail = BeanUtils.toBean(detail, IotRdDailyReportDetailRespVO.class);
|
|
|
+ if (reportDetailsPair.containsKey(detail.getReportId())) {
|
|
|
+ List<IotRdDailyReportDetailRespVO> tempDetails = reportDetailsPair.get(detail.getReportId());
|
|
|
+ tempDetails.add(dailyReportDetail);
|
|
|
+ reportDetailsPair.put(detail.getReportId(), tempDetails);
|
|
|
+ } else {
|
|
|
+ List<IotRdDailyReportDetailRespVO> tempDetails = new ArrayList<>();
|
|
|
+ tempDetails.add(dailyReportDetail);
|
|
|
+ reportDetailsPair.put(detail.getReportId(), tempDetails);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
// key任务id value日报id
|
|
|
Map<Long, Long> reportPair = new HashMap<>();
|
|
|
@@ -640,6 +661,9 @@ public class IotRdDailyReportController {
|
|
|
if (reportAttachmentsPair.containsKey(report.getId())) {
|
|
|
platformVO.setAttachments(reportAttachmentsPair.get(report.getId()));
|
|
|
}
|
|
|
+ if (reportDetailsPair.containsKey(report.getId())) {
|
|
|
+ platformVO.setReportDetails(reportDetailsPair.get(report.getId()));
|
|
|
+ }
|
|
|
platformPair.put(report.getTaskId(), platformVO);
|
|
|
});
|
|
|
}
|
|
|
@@ -662,8 +686,8 @@ public class IotRdDailyReportController {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- // 如果主井已经 完工 则显示 首个关联井 的 生产动态 下步计划 ...
|
|
|
|
|
|
+ // 如果主井已经 完工 则显示 首个关联井 的 生产动态 下步计划 ...
|
|
|
List<IotProjectTaskPlatformVO> platforms = new ArrayList<>();
|
|
|
if (CollUtil.isNotEmpty(tasks)) {
|
|
|
tasks.forEach(task -> {
|
|
|
@@ -688,6 +712,7 @@ public class IotRdDailyReportController {
|
|
|
platform.setMalfunction(tempPlatform.getMalfunction());
|
|
|
platform.setFaultDowntime(tempPlatform.getFaultDowntime());
|
|
|
platform.setAttachments(tempPlatform.getAttachments());
|
|
|
+ platform.setReportDetails(tempPlatform.getReportDetails());
|
|
|
// 非生产时间
|
|
|
platform.setAccidentTime(tempPlatform.getAccidentTime());
|
|
|
platform.setRepairTime(tempPlatform.getRepairTime());
|
|
|
@@ -711,7 +736,6 @@ public class IotRdDailyReportController {
|
|
|
}
|
|
|
|
|
|
// 如果当前井id不存在集合 platforms 中 说明 主井已完工 关联井 未完工
|
|
|
-
|
|
|
if (CollUtil.isEmpty(platforms)) {
|
|
|
List<IotProjectTaskPlatformVO> finishedPlatforms = new ArrayList<>();
|
|
|
// key任务井id value任务井名称
|
|
|
@@ -790,6 +814,7 @@ public class IotRdDailyReportController {
|
|
|
dailyReportVO.setMalfunction(platform.getMalfunction());
|
|
|
dailyReportVO.setFaultDowntime(platform.getFaultDowntime());
|
|
|
dailyReportVO.setAttachments(platform.getAttachments());
|
|
|
+ dailyReportVO.setReportDetails(platform.getReportDetails());
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -2395,6 +2420,8 @@ public class IotRdDailyReportController {
|
|
|
Set<Long> finishedMainPlatformIds = new HashSet<>();
|
|
|
// 施工状态为空的主井任务 id
|
|
|
Set<Long> nullStatusPlatformIds = new HashSet<>();
|
|
|
+ // 施工完成的任务id集合
|
|
|
+ Set<Long> finishedTaskIds = new HashSet<>();
|
|
|
// 查询主井的关联井列表 当主井已经施工完成时,显示 关联井的井号 施工状态
|
|
|
// 如果主井已经施工完成,并且主井日报 ‘施工状态’ 字段为空值,则显示关联井的井号、施工状态
|
|
|
IotRdDailyReportPageReqVO relatedWellReqVO = new IotRdDailyReportPageReqVO();
|
|
|
@@ -2427,6 +2454,10 @@ public class IotRdDailyReportController {
|
|
|
finishedPlatformGroups.add(task.getPlatformGroup());
|
|
|
finishedMainPlatformIds.add(task.getId());
|
|
|
}
|
|
|
+ // 收集施工完成的任务id集合
|
|
|
+ if ("wg".equals(task.getStatus())) {
|
|
|
+ finishedTaskIds.add(task.getId());
|
|
|
+ }
|
|
|
});
|
|
|
// 查询 finishedPlatformGroups 相关的未施工完成的关联井任务井
|
|
|
if (CollUtil.isNotEmpty(finishedPlatformGroups)) {
|
|
|
@@ -2641,7 +2672,10 @@ public class IotRdDailyReportController {
|
|
|
tempTotalMixSand = tempTotalMixSand.add(actualValue);
|
|
|
}
|
|
|
}
|
|
|
- report.setCumulativeWorkingWell(tempTotalCumulativeWorkingWell);
|
|
|
+ // 关联的任务完工 井数 +1
|
|
|
+ if (finishedTaskIds.contains(report.getTaskId())) {
|
|
|
+ report.setCumulativeWorkingWell(new BigDecimal(1));
|
|
|
+ }
|
|
|
report.setCumulativeWorkingLayers(tempTotalCumulativeWorkingLayers);
|
|
|
report.setDailyPumpTrips(tempTotalPumpTrips);
|
|
|
report.setDailyToolsSand(tempTotalMixSand);
|