Jelajahi Sumber

pms 瑞鹰日报列表 生产动态明细按照日期时间段正序排列

zhangcl 21 jam lalu
induk
melakukan
7cd7b16132

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

@@ -167,6 +167,9 @@ public class IotRyDailyReportController {
         List<IotRyDailyReportDetailDO> reportDetails = reportDetailsPage.getList();
         if (CollUtil.isNotEmpty(reportDetails)) {
             List<IotRyDailyReportDetailRespVO> reportDetailsResp = BeanUtils.toBean(reportDetails, IotRyDailyReportDetailRespVO.class);
+            // 按照生产动态明细 的 日期 时间段 正序排列
+            reportDetailsResp.sort(Comparator.comparing((IotRyDailyReportDetailRespVO detail) -> detail.getReportDate().toLocalDate())
+                    .thenComparing(IotRyDailyReportDetailRespVO::getStartTime));
             result.setReportDetails(reportDetailsResp);
         }
         // 按照创建时间倒序排列 取第2条记录对应的 当前井深 即 上次日报的当前井深
@@ -568,7 +571,12 @@ public class IotRyDailyReportController {
             // 2.4 设计井深
             findAndThen(taskExtPropertyPair, reportVO.getTaskId(), wellDepth -> reportVO.setDesignWellDepth(wellDepth));
             // 生产动态明细
-            findAndThen(reportDetailsPair, reportVO.getId(), details -> reportVO.setReportDetails(details));
+            findAndThen(reportDetailsPair, reportVO.getId(), details -> {
+                // 每个日报的明细 根据 reportDate+startTime 正序排列
+                details.sort(Comparator.comparing((IotRyDailyReportDetailRespVO detail) -> detail.getReportDate().toLocalDate())
+                        .thenComparing(IotRyDailyReportDetailRespVO::getStartTime));
+                reportVO.setReportDetails(details);
+            });
             // 施工工艺
             findAndThen(taskTechniquePair, reportVO.getTaskId(), technique -> reportVO.setTechnique(technique));
             // 井别