|
|
@@ -133,7 +133,8 @@ public class CreateRdDailyReportOrderJob implements JobHandler {
|
|
|
report.setProjectId(task.getProjectId());
|
|
|
report.setTaskId(task.getId());
|
|
|
report.setPlatformWell(task.getPlatformWell());
|
|
|
- report.setPlatformGroup(task.getPlatformGroup());
|
|
|
+ report.setPlatformGroup(StrUtil.EMPTY);
|
|
|
+ report.setTaskPlatform(task.getPlatformGroup());
|
|
|
report.setDeviceIds(task.getDeviceIds());
|
|
|
report.setStartTime(LocalTime.of(8, 0, 0));
|
|
|
report.setEndTime(LocalTime.of(8, 0, 0));
|
|
|
@@ -145,6 +146,29 @@ public class CreateRdDailyReportOrderJob implements JobHandler {
|
|
|
});
|
|
|
}
|
|
|
if (CollUtil.isNotEmpty(reports)) {
|
|
|
+ Map<String, List<IotRdDailyReportDO>> platformPair = new HashMap<>();
|
|
|
+ // 替换 日报的 platformGroup 以区分不同的任务
|
|
|
+ reports.forEach(report -> {
|
|
|
+ String taskPlatform = report.getTaskPlatform();
|
|
|
+ if (platformPair.containsKey(taskPlatform)) {
|
|
|
+ List<IotRdDailyReportDO> tempReports = platformPair.get(taskPlatform);
|
|
|
+ tempReports.add(report);
|
|
|
+ platformPair.put(taskPlatform, tempReports);
|
|
|
+ } else {
|
|
|
+ List<IotRdDailyReportDO> tempReports = new ArrayList<>();
|
|
|
+ tempReports.add(report);
|
|
|
+ platformPair.put(taskPlatform, tempReports);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (CollUtil.isNotEmpty(platformPair)) {
|
|
|
+ platformPair.forEach((taskPlatform, platformReports) -> {
|
|
|
+ // 相同的任务 如果是平台井 则重新生成 uuid 不利用项目任务的uuid
|
|
|
+ String tempUuid = StrUtil.uuid();
|
|
|
+ platformReports.forEach(report -> {
|
|
|
+ report.setPlatformGroup(tempUuid);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
iotRdDailyReportService.batchAddDailyReports(reports);
|
|
|
}
|
|
|
|