|
@@ -1076,6 +1076,8 @@ public class IotRyDailyReportController {
|
|
|
Map<Long, BigDecimal> groupIdZjNoProductTimePair = new HashMap<>();
|
|
Map<Long, BigDecimal> groupIdZjNoProductTimePair = new HashMap<>();
|
|
|
// key小组最后1条记录id value 小计平均运行时效
|
|
// key小组最后1条记录id value 小计平均运行时效
|
|
|
Map<Long, BigDecimal> groupIdTransTimePair = new HashMap<>();
|
|
Map<Long, BigDecimal> groupIdTransTimePair = new HashMap<>();
|
|
|
|
|
+ // key日报id value生产动态明细
|
|
|
|
|
+ Map<Long, List<IotRyDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
|
|
|
|
|
|
|
|
// 查询 当前分页 所有部门 任务井 日报数据 小计工作量
|
|
// 查询 当前分页 所有部门 任务井 日报数据 小计工作量
|
|
|
IotRyDailyReportPageReqVO currentTaskReqVO = new IotRyDailyReportPageReqVO();
|
|
IotRyDailyReportPageReqVO currentTaskReqVO = new IotRyDailyReportPageReqVO();
|
|
@@ -1244,6 +1246,27 @@ public class IotRyDailyReportController {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 查询每个日报的生产动态明细
|
|
|
|
|
+ IotRyDailyReportDetailPageReqVO detailReqVO = new IotRyDailyReportDetailPageReqVO();
|
|
|
|
|
+ detailReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
+ detailReqVO.setReportIds(convertList(reports, IotRyDailyReportDO::getId));
|
|
|
|
|
+ PageResult<IotRyDailyReportDetailDO> reportDetailsPage = iotRyDailyReportDetailMapper.selectPage(detailReqVO);
|
|
|
|
|
+ List<IotRyDailyReportDetailDO> reportDetails = reportDetailsPage.getList();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(reportDetails)) {
|
|
|
|
|
+ // 设置每个日报的生产动态明细
|
|
|
|
|
+ reportDetails.forEach(detail -> {
|
|
|
|
|
+ if (reportDetailsPair.containsKey(detail.getReportId())) {
|
|
|
|
|
+ List<IotRyDailyReportDetailRespVO> tempDetails = reportDetailsPair.get(detail.getReportId());
|
|
|
|
|
+ tempDetails.add(BeanUtils.toBean(detail, IotRyDailyReportDetailRespVO.class));
|
|
|
|
|
+ reportDetailsPair.put(detail.getReportId(), tempDetails);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ List<IotRyDailyReportDetailRespVO> tempDetails = new ArrayList<>();
|
|
|
|
|
+ tempDetails.add(BeanUtils.toBean(detail, IotRyDailyReportDetailRespVO.class));
|
|
|
|
|
+ reportDetailsPair.put(detail.getReportId(), tempDetails);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
|
// 查询日报关联的项目信息
|
|
// 查询日报关联的项目信息
|
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
@@ -1360,6 +1383,29 @@ public class IotRyDailyReportController {
|
|
|
reportVO.setDailyFuel(fuel);
|
|
reportVO.setDailyFuel(fuel);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 生产动态明细
|
|
|
|
|
+ findAndThen(reportDetailsPair, reportVO.getId(), details -> {
|
|
|
|
|
+ // 每个日报的明细 根据 reportDate+startTime 正序排列
|
|
|
|
|
+ details.sort(Comparator.comparing(
|
|
|
|
|
+ // 处理 reportDate 为空的情况
|
|
|
|
|
+ (IotRyDailyReportDetailRespVO detail) -> {
|
|
|
|
|
+ if (detail.getReportDate() == null) {
|
|
|
|
|
+ return null; // null 值会排在前面
|
|
|
|
|
+ }
|
|
|
|
|
+ return detail.getReportDate().toLocalDate();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 自定义 null 值比较器:null 排在非 null 前面
|
|
|
|
|
+ Comparator.nullsFirst(Comparator.naturalOrder())
|
|
|
|
|
+ )
|
|
|
|
|
+ .thenComparing(
|
|
|
|
|
+ // 处理 startTime 为空的情况
|
|
|
|
|
+ IotRyDailyReportDetailRespVO::getStartTime,
|
|
|
|
|
+ // 自定义 null 值比较器:null 排在非 null 前面
|
|
|
|
|
+ Comparator.nullsFirst(Comparator.naturalOrder())
|
|
|
|
|
+ ));
|
|
|
|
|
+ reportVO.setReportDetails(details);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// 小组内最后1条记录标识
|
|
// 小组内最后1条记录标识
|
|
|
findAndThen(groupIdFootagePair, reportVO.getId(), footage -> reportVO.setLastGroupIdFlag(true));
|
|
findAndThen(groupIdFootagePair, reportVO.getId(), footage -> reportVO.setLastGroupIdFlag(true));
|
|
|
// 小组内累计进尺
|
|
// 小组内累计进尺
|
|
@@ -1490,6 +1536,8 @@ public class IotRyDailyReportController {
|
|
|
Map<Long, BigDecimal> groupIdZjNoProductTimePair = new HashMap<>();
|
|
Map<Long, BigDecimal> groupIdZjNoProductTimePair = new HashMap<>();
|
|
|
// key小组最后1条记录id value 小计平均运行时效
|
|
// key小组最后1条记录id value 小计平均运行时效
|
|
|
Map<Long, BigDecimal> groupIdTransTimePair = new HashMap<>();
|
|
Map<Long, BigDecimal> groupIdTransTimePair = new HashMap<>();
|
|
|
|
|
+ // key日报id value生产动态明细
|
|
|
|
|
+ Map<Long, List<IotRyDailyReportDetailRespVO>> reportDetailsPair = new HashMap<>();
|
|
|
|
|
|
|
|
// 查询 当前分页 所有部门 任务井 日报数据 小计工作量
|
|
// 查询 当前分页 所有部门 任务井 日报数据 小计工作量
|
|
|
IotRyDailyReportPageReqVO currentTaskReqVO = new IotRyDailyReportPageReqVO();
|
|
IotRyDailyReportPageReqVO currentTaskReqVO = new IotRyDailyReportPageReqVO();
|
|
@@ -1658,6 +1706,27 @@ public class IotRyDailyReportController {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 查询每个日报的生产动态明细
|
|
|
|
|
+ IotRyDailyReportDetailPageReqVO detailReqVO = new IotRyDailyReportDetailPageReqVO();
|
|
|
|
|
+ detailReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
+ detailReqVO.setReportIds(convertList(reports, IotRyDailyReportDO::getId));
|
|
|
|
|
+ PageResult<IotRyDailyReportDetailDO> reportDetailsPage = iotRyDailyReportDetailMapper.selectPage(detailReqVO);
|
|
|
|
|
+ List<IotRyDailyReportDetailDO> reportDetails = reportDetailsPage.getList();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(reportDetails)) {
|
|
|
|
|
+ // 设置每个日报的生产动态明细
|
|
|
|
|
+ reportDetails.forEach(detail -> {
|
|
|
|
|
+ if (reportDetailsPair.containsKey(detail.getReportId())) {
|
|
|
|
|
+ List<IotRyDailyReportDetailRespVO> tempDetails = reportDetailsPair.get(detail.getReportId());
|
|
|
|
|
+ tempDetails.add(BeanUtils.toBean(detail, IotRyDailyReportDetailRespVO.class));
|
|
|
|
|
+ reportDetailsPair.put(detail.getReportId(), tempDetails);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ List<IotRyDailyReportDetailRespVO> tempDetails = new ArrayList<>();
|
|
|
|
|
+ tempDetails.add(BeanUtils.toBean(detail, IotRyDailyReportDetailRespVO.class));
|
|
|
|
|
+ reportDetailsPair.put(detail.getReportId(), tempDetails);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
|
// 查询日报关联的项目信息
|
|
// 查询日报关联的项目信息
|
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
@@ -1760,6 +1829,29 @@ public class IotRyDailyReportController {
|
|
|
reportVO.setDailyFuel(fuel);
|
|
reportVO.setDailyFuel(fuel);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 生产动态明细
|
|
|
|
|
+ findAndThen(reportDetailsPair, reportVO.getId(), details -> {
|
|
|
|
|
+ // 每个日报的明细 根据 reportDate+startTime 正序排列
|
|
|
|
|
+ details.sort(Comparator.comparing(
|
|
|
|
|
+ // 处理 reportDate 为空的情况
|
|
|
|
|
+ (IotRyDailyReportDetailRespVO detail) -> {
|
|
|
|
|
+ if (detail.getReportDate() == null) {
|
|
|
|
|
+ return null; // null 值会排在前面
|
|
|
|
|
+ }
|
|
|
|
|
+ return detail.getReportDate().toLocalDate();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 自定义 null 值比较器:null 排在非 null 前面
|
|
|
|
|
+ Comparator.nullsFirst(Comparator.naturalOrder())
|
|
|
|
|
+ )
|
|
|
|
|
+ .thenComparing(
|
|
|
|
|
+ // 处理 startTime 为空的情况
|
|
|
|
|
+ IotRyDailyReportDetailRespVO::getStartTime,
|
|
|
|
|
+ // 自定义 null 值比较器:null 排在非 null 前面
|
|
|
|
|
+ Comparator.nullsFirst(Comparator.naturalOrder())
|
|
|
|
|
+ ));
|
|
|
|
|
+ reportVO.setReportDetails(details);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// 小组内最后1条记录标识
|
|
// 小组内最后1条记录标识
|
|
|
findAndThen(groupIdFootagePair, reportVO.getId(), footage -> reportVO.setLastGroupIdFlag(true));
|
|
findAndThen(groupIdFootagePair, reportVO.getId(), footage -> reportVO.setLastGroupIdFlag(true));
|
|
|
// 小组内累计进尺
|
|
// 小组内累计进尺
|