|
@@ -2428,6 +2428,8 @@ public class IotRdDailyReportController {
|
|
|
if (CollUtil.isEmpty(reports)) {
|
|
if (CollUtil.isEmpty(reports)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
|
|
+ // 设备部门信息
|
|
|
|
|
+ Map<Long, DeptDO> tempDeptMap = deptService.getDeptMap(convertList(reports, IotRdDailyReportDO::getDeptId));
|
|
|
// key项目id value项目合同号
|
|
// key项目id value项目合同号
|
|
|
Map<Long, String> projectPair = new HashMap<>();
|
|
Map<Long, String> projectPair = new HashMap<>();
|
|
|
// key任务id value任务井号
|
|
// key任务id value任务井号
|
|
@@ -2436,12 +2438,17 @@ public class IotRdDailyReportController {
|
|
|
Map<Long, String> taskLocationPair = new HashMap<>();
|
|
Map<Long, String> taskLocationPair = new HashMap<>();
|
|
|
// key任务id value任务关联的带班干部名称
|
|
// key任务id value任务关联的带班干部名称
|
|
|
Map<Long, String> taskResponsiblePair = new HashMap<>();
|
|
Map<Long, String> taskResponsiblePair = new HashMap<>();
|
|
|
|
|
+ // key任务id value临时新建日报的带班干部名称 多个逗号分隔
|
|
|
|
|
+ Map<Long, String> tempReportResponsiblePair = new HashMap<>();
|
|
|
// key任务id value任务关联的填报人名称
|
|
// key任务id value任务关联的填报人名称
|
|
|
Map<Long, String> taskSubmitterPair = new HashMap<>();
|
|
Map<Long, String> taskSubmitterPair = new HashMap<>();
|
|
|
|
|
+ // key任务id value临时新建的日报的填报人名称
|
|
|
|
|
+ Map<Long, String> tempSubmitterPair = new HashMap<>();
|
|
|
// key任务id value工作量数据集合
|
|
// key任务id value工作量数据集合
|
|
|
Map<Long, List<IotTaskAttrModelProperty>> taskWorkloadPair = new HashMap<>();
|
|
Map<Long, List<IotTaskAttrModelProperty>> taskWorkloadPair = new HashMap<>();
|
|
|
// key任务id value任务关联的施工队伍名称 多个逗号分隔
|
|
// key任务id value任务关联的施工队伍名称 多个逗号分隔
|
|
|
Map<Long, String> taskTeamsPair = new HashMap<>();
|
|
Map<Long, String> taskTeamsPair = new HashMap<>();
|
|
|
|
|
+
|
|
|
Set<Long> userIds = new HashSet<>();
|
|
Set<Long> userIds = new HashSet<>();
|
|
|
// 当前页所有日报关联任务的 施工队伍id 集合
|
|
// 当前页所有日报关联任务的 施工队伍id 集合
|
|
|
Set<Long> currentPageDeptIds = new HashSet<>();
|
|
Set<Long> currentPageDeptIds = new HashSet<>();
|
|
@@ -2620,6 +2627,16 @@ public class IotRdDailyReportController {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 添加临时创建的日报相关的 带班干部 创建人 id
|
|
|
|
|
+ reports.forEach(report -> {
|
|
|
|
|
+ if (CollUtil.isNotEmpty(report.getResponsiblePerson())) {
|
|
|
|
|
+ userIds.addAll(report.getResponsiblePerson());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StrUtil.isNotBlank(report.getCreator())) {
|
|
|
|
|
+ userIds.add(Long.valueOf(report.getCreator()));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// 查询当前页所有日报关联的任务的施工队伍名称
|
|
// 查询当前页所有日报关联的任务的施工队伍名称
|
|
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(currentPageDeptIds);
|
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(currentPageDeptIds);
|
|
|
// 查询所有 带班干部 填报人 的姓名
|
|
// 查询所有 带班干部 填报人 的姓名
|
|
@@ -2677,6 +2694,8 @@ public class IotRdDailyReportController {
|
|
|
// 存入映射关系
|
|
// 存入映射关系
|
|
|
taskSubmitterPair.put(task.getId(), submitterNames);
|
|
taskSubmitterPair.put(task.getId(), submitterNames);
|
|
|
});
|
|
});
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 临时新建的日报 没有关联项目 任务
|
|
|
}
|
|
}
|
|
|
// 统计计算出平台井中每个井的 非生产时效
|
|
// 统计计算出平台井中每个井的 非生产时效
|
|
|
if (CollUtil.isNotEmpty(platformNonProductPair)) {
|
|
if (CollUtil.isNotEmpty(platformNonProductPair)) {
|
|
@@ -2699,6 +2718,38 @@ public class IotRdDailyReportController {
|
|
|
}
|
|
}
|
|
|
// 查询所有任务的工作量数据 单位相同的工作量属性值合并处理
|
|
// 查询所有任务的工作量数据 单位相同的工作量属性值合并处理
|
|
|
for (IotRdDailyReportDO report : reports) {
|
|
for (IotRdDailyReportDO report : reports) {
|
|
|
|
|
+ // 处理临时创建的日报 带班干部 填报人 有单独的逻辑规则
|
|
|
|
|
+ Set<Long> personIds = report.getResponsiblePerson();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(personIds)) {
|
|
|
|
|
+ // tempRespPersonIds.addAll(personIds);
|
|
|
|
|
+ // 转换ID集合为姓名字符串(用逗号分隔)
|
|
|
|
|
+ String respNames = personIds.stream()
|
|
|
|
|
+ // 映射ID到姓名(用户不存在时用空字符串)
|
|
|
|
|
+ .map(userId -> Optional.ofNullable(userMap.get(userId))
|
|
|
|
|
+ .map(AdminUserRespDTO::getNickname)
|
|
|
|
|
+ .orElse(""))
|
|
|
|
|
+ // 过滤空字符串(避免多余逗号)
|
|
|
|
|
+ .filter(name -> !name.isEmpty())
|
|
|
|
|
+ // 拼接姓名
|
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
|
+ tempReportResponsiblePair.put(report.getId(), respNames);
|
|
|
|
|
+ }
|
|
|
|
|
+ String creator = report.getCreator();
|
|
|
|
|
+ if (StrUtil.isNotBlank(creator)) {
|
|
|
|
|
+ Long creatorId = Long.valueOf(creator);
|
|
|
|
|
+ Set<Long> creatorIds = new HashSet<>();
|
|
|
|
|
+ creatorIds.add(creatorId);
|
|
|
|
|
+ String creatorNames = creatorIds.stream()
|
|
|
|
|
+ // 映射ID到姓名(用户不存在时用空字符串)
|
|
|
|
|
+ .map(userId -> Optional.ofNullable(userMap.get(userId))
|
|
|
|
|
+ .map(AdminUserRespDTO::getNickname)
|
|
|
|
|
+ .orElse(""))
|
|
|
|
|
+ // 过滤空字符串(避免多余逗号)
|
|
|
|
|
+ .filter(name -> !name.isEmpty())
|
|
|
|
|
+ // 拼接姓名
|
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
|
+ tempSubmitterPair.put(report.getId(), creatorNames);
|
|
|
|
|
+ }
|
|
|
// 设置每个任务的工作量数据 单位相同的工作量值作合并处理
|
|
// 设置每个任务的工作量数据 单位相同的工作量值作合并处理
|
|
|
List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
|
|
List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
|
|
|
// 这里暂时使用枚举 统计每个单位下的 工作量
|
|
// 这里暂时使用枚举 统计每个单位下的 工作量
|
|
@@ -2800,6 +2851,8 @@ public class IotRdDailyReportController {
|
|
|
findAndThen(platformNptPair, reportVO.getPlatformGroup(), npt -> reportVO.setNonProductionRate(npt));
|
|
findAndThen(platformNptPair, reportVO.getPlatformGroup(), npt -> reportVO.setNonProductionRate(npt));
|
|
|
// 部门信息 任务中关联的施工队伍
|
|
// 部门信息 任务中关联的施工队伍
|
|
|
findAndThen(taskTeamsPair, reportVO.getTaskId(), deptNames -> reportVO.setDeptName(deptNames));
|
|
findAndThen(taskTeamsPair, reportVO.getTaskId(), deptNames -> reportVO.setDeptName(deptNames));
|
|
|
|
|
+ // 临时新建的日报的 施工队伍
|
|
|
|
|
+ findAndThen(tempDeptMap, reportVO.getDeptId(), dept -> reportVO.setDeptName(dept.getName()));
|
|
|
// 日报关联的项目信息
|
|
// 日报关联的项目信息
|
|
|
findAndThen(projectPair, reportVO.getProjectId(), contractName -> reportVO.setContractName(contractName));
|
|
findAndThen(projectPair, reportVO.getProjectId(), contractName -> reportVO.setContractName(contractName));
|
|
|
// 日报关联的任务井号
|
|
// 日报关联的任务井号
|
|
@@ -2814,8 +2867,12 @@ public class IotRdDailyReportController {
|
|
|
findAndThen(relatedWellStatusPair, reportVO.getPlatformGroup(), rdStatus -> reportVO.setRdStatus(rdStatus));
|
|
findAndThen(relatedWellStatusPair, reportVO.getPlatformGroup(), rdStatus -> reportVO.setRdStatus(rdStatus));
|
|
|
// 日报关联的责任人
|
|
// 日报关联的责任人
|
|
|
findAndThen(taskResponsiblePair, reportVO.getTaskId(), responsibleNames -> reportVO.setResponsiblePersonNames(responsibleNames));
|
|
findAndThen(taskResponsiblePair, reportVO.getTaskId(), responsibleNames -> reportVO.setResponsiblePersonNames(responsibleNames));
|
|
|
|
|
+ // 临时新增日报关联的带班干部
|
|
|
|
|
+ findAndThen(tempReportResponsiblePair, reportVO.getId(), responsibleNames -> reportVO.setResponsiblePersonNames(responsibleNames));
|
|
|
// 日报关联的填报人
|
|
// 日报关联的填报人
|
|
|
findAndThen(taskSubmitterPair, reportVO.getTaskId(), submitterNames -> reportVO.setSubmitterNames(submitterNames));
|
|
findAndThen(taskSubmitterPair, reportVO.getTaskId(), submitterNames -> reportVO.setSubmitterNames(submitterNames));
|
|
|
|
|
+ // 临时新建的日报关联的填报人
|
|
|
|
|
+ findAndThen(tempSubmitterPair, reportVO.getId(), submitterNames -> reportVO.setSubmitterNames(submitterNames));
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|