|
@@ -220,8 +220,27 @@ public class IotRdDailyReportController {
|
|
|
DeptDO dept = deptService.getDept(dailyReport.getDeptId());
|
|
DeptDO dept = deptService.getDept(dailyReport.getDeptId());
|
|
|
dailyReportVO.setDeptName(dept.getName());
|
|
dailyReportVO.setDeptName(dept.getName());
|
|
|
}
|
|
}
|
|
|
|
|
+ // 查询施工工艺字典数据
|
|
|
|
|
+ List<DictDataDO> rdStatusDicts = dictDataService.getDictDataListByDictType("rdStatus");
|
|
|
|
|
+ // 查询施工工艺字典数据
|
|
|
|
|
+ List<DictDataDO> rdTechniquesDicts = dictDataService.getDictDataListByDictType("rq_iot_project_technology_rd");
|
|
|
|
|
+ // 施工状态 key字典键值 value字典标签
|
|
|
|
|
+ Map<String, String> statusDictPair = new HashMap<>();
|
|
|
|
|
+ // 施工工艺 key字典键值 value字典标签
|
|
|
|
|
+ Map<String, String> techniqueDictPair = new HashMap<>();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(rdStatusDicts)) {
|
|
|
|
|
+ rdStatusDicts.forEach(tech -> {
|
|
|
|
|
+ statusDictPair.put(tech.getValue(), tech.getLabel());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CollUtil.isNotEmpty(rdTechniquesDicts)) {
|
|
|
|
|
+ rdTechniquesDicts.forEach(tech -> {
|
|
|
|
|
+ techniqueDictPair.put(tech.getValue(), tech.getLabel());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
// 日报任务对应的平台井列表
|
|
// 日报任务对应的平台井列表
|
|
|
if (1 == dailyReport.getPlatformWell()) {
|
|
if (1 == dailyReport.getPlatformWell()) {
|
|
|
|
|
+ // 查询未施工完成的平台井 关联井列表
|
|
|
IotProjectTaskPageReqVO pageReqVO = new IotProjectTaskPageReqVO();
|
|
IotProjectTaskPageReqVO pageReqVO = new IotProjectTaskPageReqVO();
|
|
|
pageReqVO.setPlatformGroup(dailyReport.getTaskPlatform());
|
|
pageReqVO.setPlatformGroup(dailyReport.getTaskPlatform());
|
|
|
pageReqVO.setJobFlag("Y");
|
|
pageReqVO.setJobFlag("Y");
|
|
@@ -234,25 +253,7 @@ public class IotRdDailyReportController {
|
|
|
Map<Long, Long> reportPair = new HashMap<>();
|
|
Map<Long, Long> reportPair = new HashMap<>();
|
|
|
// key任务id value平台井日报已经设置的多种属性
|
|
// key任务id value平台井日报已经设置的多种属性
|
|
|
Map<Long, IotProjectTaskPlatformVO> platformPair = new HashMap<>();
|
|
Map<Long, IotProjectTaskPlatformVO> platformPair = new HashMap<>();
|
|
|
- // 施工状态 key字典键值 value字典标签
|
|
|
|
|
- Map<String, String> statusDictPair = new HashMap<>();
|
|
|
|
|
- // 施工工艺 key字典键值 value字典标签
|
|
|
|
|
- Map<String, String> techniqueDictPair = new HashMap<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(reports)) {
|
|
if (CollUtil.isNotEmpty(reports)) {
|
|
|
- // 查询施工工艺字典数据
|
|
|
|
|
- List<DictDataDO> rdStatusDicts = dictDataService.getDictDataListByDictType("rdStatus");
|
|
|
|
|
- // 查询施工工艺字典数据
|
|
|
|
|
- List<DictDataDO> rdTechniquesDicts = dictDataService.getDictDataListByDictType("rq_iot_project_technology_rd");
|
|
|
|
|
- if (CollUtil.isNotEmpty(rdStatusDicts)) {
|
|
|
|
|
- rdStatusDicts.forEach(tech -> {
|
|
|
|
|
- statusDictPair.put(tech.getValue(), tech.getLabel());
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- if (CollUtil.isNotEmpty(rdTechniquesDicts)) {
|
|
|
|
|
- rdTechniquesDicts.forEach(tech -> {
|
|
|
|
|
- techniqueDictPair.put(tech.getValue(), tech.getLabel());
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
reports.forEach(report -> {
|
|
reports.forEach(report -> {
|
|
|
// 保养平台井关联的多个日报使用
|
|
// 保养平台井关联的多个日报使用
|
|
|
reportPair.put(report.getTaskId(), report.getId());
|
|
reportPair.put(report.getTaskId(), report.getId());
|
|
@@ -301,6 +302,61 @@ public class IotRdDailyReportController {
|
|
|
});
|
|
});
|
|
|
dailyReportVO.setPlatforms(platforms);
|
|
dailyReportVO.setPlatforms(platforms);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (CollUtil.isEmpty(platforms)) {
|
|
|
|
|
+ List<IotProjectTaskPlatformVO> finishedPlatforms = new ArrayList<>();
|
|
|
|
|
+ // key任务井id value任务井名称
|
|
|
|
|
+ Map<Long, String> wellNamePair = new HashMap<>();
|
|
|
|
|
+ // 查询当前任务关联的平台井任务列表
|
|
|
|
|
+ IotProjectTaskPageReqVO currentPlatformTaskReqVO = new IotProjectTaskPageReqVO();
|
|
|
|
|
+ currentPlatformTaskReqVO.setPlatformGroup(dailyReport.getTaskPlatform());
|
|
|
|
|
+ List<IotProjectTaskDO> currentPlatformTasks = iotProjectTaskService.projectTasks(currentPlatformTaskReqVO);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(currentPlatformTasks)) {
|
|
|
|
|
+ currentPlatformTasks.forEach(task -> {
|
|
|
|
|
+ wellNamePair.put(task.getId(), task.getWellName());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ // 已经施工完成的主井/关联井 查询主井关联的日报列表 组装 finishedPlatforms
|
|
|
|
|
+ IotRdDailyReportPageReqVO currentReportReqVO = new IotRdDailyReportPageReqVO();
|
|
|
|
|
+ currentReportReqVO.setPlatformGroup(dailyReport.getPlatformGroup());
|
|
|
|
|
+ List<IotRdDailyReportDO> currentRelatedReports = iotRdDailyReportService.dailyReports(currentReportReqVO);
|
|
|
|
|
+ // 按照日报创建时间倒序排列
|
|
|
|
|
+ if (CollUtil.isNotEmpty(currentRelatedReports)) {
|
|
|
|
|
+ currentRelatedReports = currentRelatedReports.stream()
|
|
|
|
|
+ .sorted(Comparator.comparing(IotRdDailyReportDO::getCreateTime).reversed())
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CollUtil.isNotEmpty(currentRelatedReports)) {
|
|
|
|
|
+ currentRelatedReports.forEach(report -> {
|
|
|
|
|
+ if (StrUtil.isNotBlank(report.getRdStatus())) {
|
|
|
|
|
+ IotProjectTaskPlatformVO platform = new IotProjectTaskPlatformVO();
|
|
|
|
|
+ platform.setId(report.getTaskId());
|
|
|
|
|
+ if (wellNamePair.containsKey(report.getTaskId())) {
|
|
|
|
|
+ platform.setWellName(wellNamePair.get(report.getTaskId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ platform.setReportId(report.getId());
|
|
|
|
|
+ platform.setRdStatus(report.getRdStatus());
|
|
|
|
|
+ if (statusDictPair.containsKey(report.getRdStatus())) {
|
|
|
|
|
+ platform.setRdStatusLabel(statusDictPair.get(report.getRdStatus()));
|
|
|
|
|
+ }
|
|
|
|
|
+ platform.setTechniqueIds(report.getTechniqueIds());
|
|
|
|
|
+ if (CollUtil.isNotEmpty(report.getTechniqueIds())) {
|
|
|
|
|
+ String techniqueNames = report.getTechniqueIds().stream()
|
|
|
|
|
+ // 将Long转为String,匹配techniqueDictPair的key类型
|
|
|
|
|
+ .map(lg -> ObjUtil.isNotEmpty(lg) ? lg.toString() : StrUtil.EMPTY)
|
|
|
|
|
+ // 取label,无则用原key
|
|
|
|
|
+ .map(key -> techniqueDictPair.getOrDefault(key, key))
|
|
|
|
|
+ .collect(Collectors.joining(",")); // 逗号拼接
|
|
|
|
|
+ platform.setTechniqueNames(techniqueNames);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ platform.setTechniqueNames(""); // 空集合时设为空字符串(或null,根据业务需求)
|
|
|
|
|
+ }
|
|
|
|
|
+ platform.setExtProperty(report.getExtProperty());
|
|
|
|
|
+ finishedPlatforms.add(platform);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ dailyReportVO.setFinishedPlatforms(finishedPlatforms);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return dailyReportVO;
|
|
return dailyReportVO;
|
|
|
}
|
|
}
|
|
@@ -400,6 +456,10 @@ public class IotRdDailyReportController {
|
|
|
Set<Long> currentPageDeptIds = new HashSet<>();
|
|
Set<Long> currentPageDeptIds = new HashSet<>();
|
|
|
// key主井任务platformGroup/taskPlatform value关联井号名称
|
|
// key主井任务platformGroup/taskPlatform value关联井号名称
|
|
|
Map<String, String> relatedPlatformPair = new HashMap<>();
|
|
Map<String, String> relatedPlatformPair = new HashMap<>();
|
|
|
|
|
+ // key主井任务id value关联井任务施工状态
|
|
|
|
|
+ Map<String, String> relatedWellStatusPair = new HashMap<>();
|
|
|
|
|
+ // key关联井任务id value关联井号
|
|
|
|
|
+ Map<Long, String> relatedPlatformsPair = new HashMap<>();
|
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
DataPermissionUtils.executeIgnore(() -> {
|
|
|
// 查询日报关联的项目信息
|
|
// 查询日报关联的项目信息
|
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
IotProjectInfoPageReqVO reqVO = new IotProjectInfoPageReqVO();
|
|
@@ -416,6 +476,24 @@ public class IotRdDailyReportController {
|
|
|
List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(taskReqVO);
|
|
List<IotProjectTaskDO> tasks = iotProjectTaskService.projectTasks(taskReqVO);
|
|
|
// 已经施工完成的主井任务 platformGroup
|
|
// 已经施工完成的主井任务 platformGroup
|
|
|
Set<String> finishedPlatformGroups = new HashSet<>();
|
|
Set<String> finishedPlatformGroups = new HashSet<>();
|
|
|
|
|
+ // 已经施工完成的主井任务 id
|
|
|
|
|
+ Set<Long> finishedMainPlatformIds = new HashSet<>();
|
|
|
|
|
+ // 施工状态为空的主井任务 id
|
|
|
|
|
+ Set<Long> nullStatusPlatformIds = new HashSet<>();
|
|
|
|
|
+ // 查询主井的关联井列表 当主井已经施工完成时,显示 关联井的井号 施工状态
|
|
|
|
|
+ // 如果主井已经施工完成,并且主井日报 ‘施工状态’ 字段为空值,则显示关联井的井号、施工状态
|
|
|
|
|
+ IotRdDailyReportPageReqVO relatedWellReqVO = new IotRdDailyReportPageReqVO();
|
|
|
|
|
+ relatedWellReqVO.setPlatformGroups(convertList(reports, IotRdDailyReportDO::getPlatformGroup));
|
|
|
|
|
+ // relatedWellReqVO.setPlatformWell(2);
|
|
|
|
|
+ List<IotRdDailyReportDO> relatedWellReports = iotRdDailyReportService.dailyReports(relatedWellReqVO);
|
|
|
|
|
+
|
|
|
|
|
+ // 按照日报创建时间倒序排列
|
|
|
|
|
+ if (CollUtil.isNotEmpty(relatedWellReports)) {
|
|
|
|
|
+ relatedWellReports = relatedWellReports.stream()
|
|
|
|
|
+ .sorted(Comparator.comparing(IotRdDailyReportDO::getCreateTime).reversed())
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (CollUtil.isNotEmpty(tasks)) {
|
|
if (CollUtil.isNotEmpty(tasks)) {
|
|
|
tasks.forEach(task -> {
|
|
tasks.forEach(task -> {
|
|
|
Set<Long> personIds = task.getResponsiblePerson();
|
|
Set<Long> personIds = task.getResponsiblePerson();
|
|
@@ -432,6 +510,7 @@ public class IotRdDailyReportController {
|
|
|
// 找到已经施工完成的主井任务 查询对应的关联井任务 用关联井号作为日报任务井号
|
|
// 找到已经施工完成的主井任务 查询对应的关联井任务 用关联井号作为日报任务井号
|
|
|
if (1 == task.getPlatformWell() && "wg".equals(task.getStatus())) {
|
|
if (1 == task.getPlatformWell() && "wg".equals(task.getStatus())) {
|
|
|
finishedPlatformGroups.add(task.getPlatformGroup());
|
|
finishedPlatformGroups.add(task.getPlatformGroup());
|
|
|
|
|
+ finishedMainPlatformIds.add(task.getId());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
// 查询 finishedPlatformGroups 相关的未施工完成的关联井任务井
|
|
// 查询 finishedPlatformGroups 相关的未施工完成的关联井任务井
|
|
@@ -439,15 +518,48 @@ public class IotRdDailyReportController {
|
|
|
IotProjectTaskPageReqVO unfinishedTaskReqVO = new IotProjectTaskPageReqVO();
|
|
IotProjectTaskPageReqVO unfinishedTaskReqVO = new IotProjectTaskPageReqVO();
|
|
|
unfinishedTaskReqVO.setPlatformGroups(new ArrayList<>(finishedPlatformGroups));
|
|
unfinishedTaskReqVO.setPlatformGroups(new ArrayList<>(finishedPlatformGroups));
|
|
|
unfinishedTaskReqVO.setPlatformWell(2);
|
|
unfinishedTaskReqVO.setPlatformWell(2);
|
|
|
- unfinishedTaskReqVO.setJobFlag("Y");
|
|
|
|
|
|
|
+ // unfinishedTaskReqVO.setJobFlag("Y");
|
|
|
List<IotProjectTaskDO> unfinishedRelatedTasks = iotProjectTaskService.projectTasks(unfinishedTaskReqVO);
|
|
List<IotProjectTaskDO> unfinishedRelatedTasks = iotProjectTaskService.projectTasks(unfinishedTaskReqVO);
|
|
|
if (CollUtil.isNotEmpty(unfinishedRelatedTasks)) {
|
|
if (CollUtil.isNotEmpty(unfinishedRelatedTasks)) {
|
|
|
unfinishedRelatedTasks.forEach(task -> {
|
|
unfinishedRelatedTasks.forEach(task -> {
|
|
|
- relatedPlatformPair.put(task.getPlatformGroup(), task.getWellName());
|
|
|
|
|
|
|
+ // relatedPlatformPair.put(task.getPlatformGroup(), task.getWellName());
|
|
|
|
|
+ relatedPlatformsPair.put(task.getId(), task.getWellName());
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // 平台井 主井施工完成 需要显示 关联井的施工状态 井号
|
|
|
|
|
+ if (CollUtil.isNotEmpty(relatedWellReports)) {
|
|
|
|
|
+ Map<String, IotRdDailyReportDO> relatedPlatformGroupPair = new HashMap<>();
|
|
|
|
|
+ relatedWellReports.forEach(report -> {
|
|
|
|
|
+ if (2 == report.getPlatformWell()) {
|
|
|
|
|
+ // 找到当前页所有的关联井 如果有多个关联井 取排列在最前面的关联井
|
|
|
|
|
+ if (!relatedPlatformGroupPair.containsKey(report.getPlatformGroup())) {
|
|
|
|
|
+ relatedPlatformGroupPair.put(report.getPlatformGroup(), report);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ relatedWellReports.forEach(report -> {
|
|
|
|
|
+ // 找到施工状态为空的主井
|
|
|
|
|
+ if (1 == report.getPlatformWell() && StrUtil.isBlank(report.getRdStatus())
|
|
|
|
|
+ && finishedMainPlatformIds.contains(report.getTaskId())) {
|
|
|
|
|
+ nullStatusPlatformIds.add(report.getTaskId());
|
|
|
|
|
+ // 找到当前主井对应的关联井
|
|
|
|
|
+ if (relatedPlatformGroupPair.containsKey(report.getPlatformGroup())) {
|
|
|
|
|
+ IotRdDailyReportDO tempReport = relatedPlatformGroupPair.get(report.getPlatformGroup());
|
|
|
|
|
+ tempReport.getRdStatus();
|
|
|
|
|
+ tempReport.getTaskId();
|
|
|
|
|
+ if (relatedPlatformsPair.containsKey(tempReport.getTaskId())) {
|
|
|
|
|
+ String wellName = relatedPlatformsPair.get(tempReport.getTaskId());
|
|
|
|
|
+ relatedPlatformPair.put(tempReport.getPlatformGroup(), wellName);
|
|
|
|
|
+ relatedWellStatusPair.put(tempReport.getPlatformGroup(), tempReport.getRdStatus());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 查询当前页所有日报关联的任务的施工队伍名称
|
|
// 查询当前页所有日报关联的任务的施工队伍名称
|
|
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(currentPageDeptIds);
|
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(currentPageDeptIds);
|
|
|
// 查询所有 带班干部 填报人 的姓名
|
|
// 查询所有 带班干部 填报人 的姓名
|
|
@@ -592,7 +704,9 @@ public class IotRdDailyReportController {
|
|
|
// 日报关联的任务信息
|
|
// 日报关联的任务信息
|
|
|
findAndThen(taskPair, reportVO.getTaskId(), taskName -> reportVO.setTaskName(taskName));
|
|
findAndThen(taskPair, reportVO.getTaskId(), taskName -> reportVO.setTaskName(taskName));
|
|
|
// 日报关联的任务信息(兼容主井完工 关联井未完工的情况)
|
|
// 日报关联的任务信息(兼容主井完工 关联井未完工的情况)
|
|
|
- findAndThen(relatedPlatformPair, reportVO.getTaskPlatform(), relatedTaskName -> reportVO.setTaskName(relatedTaskName));
|
|
|
|
|
|
|
+ findAndThen(relatedPlatformPair, reportVO.getPlatformGroup(), relatedTaskName -> reportVO.setTaskName(relatedTaskName));
|
|
|
|
|
+ // 日报关联的任务施工状态(兼容主井完工 关联井未完工的情况)
|
|
|
|
|
+ findAndThen(relatedWellStatusPair, reportVO.getPlatformGroup(), rdStatus -> reportVO.setRdStatus(rdStatus));
|
|
|
// 日报关联的责任人
|
|
// 日报关联的责任人
|
|
|
findAndThen(taskResponsiblePair, reportVO.getTaskId(), responsibleNames -> reportVO.setResponsiblePersonNames(responsibleNames));
|
|
findAndThen(taskResponsiblePair, reportVO.getTaskId(), responsibleNames -> reportVO.setResponsiblePersonNames(responsibleNames));
|
|
|
// 日报关联的填报人
|
|
// 日报关联的填报人
|