|
@@ -22,7 +22,9 @@ import cn.iocoder.yudao.module.pms.dal.mysql.iotrddailyreport.IotRdDailyReportMa
|
|
|
import cn.iocoder.yudao.module.pms.service.iotprojectinfo.IotProjectInfoService;
|
|
import cn.iocoder.yudao.module.pms.service.iotprojectinfo.IotProjectInfoService;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotprojecttask.IotProjectTaskService;
|
|
import cn.iocoder.yudao.module.pms.service.iotprojecttask.IotProjectTaskService;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
|
|
|
|
+import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
|
|
+import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
@@ -60,6 +62,8 @@ public class IotProjectTaskController {
|
|
|
private IotRdDailyReportMapper iotRdDailyReportMapper;
|
|
private IotRdDailyReportMapper iotRdDailyReportMapper;
|
|
|
@Resource
|
|
@Resource
|
|
|
private IotProjectInfoMapper iotProjectInfoMapper;
|
|
private IotProjectInfoMapper iotProjectInfoMapper;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private DictDataService dictDataService;
|
|
|
|
|
|
|
|
@PostMapping("/create")
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建项目信息任务拆分")
|
|
@Operation(summary = "创建项目信息任务拆分")
|
|
@@ -398,14 +402,78 @@ public class IotProjectTaskController {
|
|
|
if (CollUtil.isEmpty(tasks)) {
|
|
if (CollUtil.isEmpty(tasks)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
|
|
+ // 设置任务状态(区分 瑞恒 瑞都 瑞鹰)
|
|
|
|
|
+ // 施工状态 字典数据
|
|
|
|
|
+ List<DictDataDO> rdStatusData = dictDataService.getDictDataListByDictType("rdStatus");
|
|
|
|
|
+ List<DictDataDO> repairStatusData = dictDataService.getDictDataListByDictType("repairStatus");
|
|
|
|
|
+ List<DictDataDO> rigStatus = dictDataService.getDictDataListByDictType("rigStatus");
|
|
|
|
|
+ List<DictDataDO> constructionStatus = dictDataService.getDictDataListByDictType("constructionStatus");
|
|
|
|
|
+ // key施工状态数据字典value value施工状态数据字典label 瑞恒
|
|
|
|
|
+ Map<String, String> constructStatusPair = new HashMap<>();
|
|
|
|
|
+ // key施工状态数据字典value value施工状态数据字典label 瑞都
|
|
|
|
|
+ Map<String, String> rdStatusPair = new HashMap<>();
|
|
|
|
|
+ // key施工状态数据字典value value施工状态数据字典label 瑞鹰钻井
|
|
|
|
|
+ Map<String, String> rigStatusPair = new HashMap<>();
|
|
|
|
|
+ // key施工状态数据字典value value施工状态数据字典label 瑞鹰修井
|
|
|
|
|
+ Map<String, String> repairStatusPair = new HashMap<>();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(rdStatusData)) {
|
|
|
|
|
+ rdStatusData.forEach(data -> {
|
|
|
|
|
+ rdStatusPair.put(data.getValue(), data.getLabel());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CollUtil.isNotEmpty(repairStatusData)) {
|
|
|
|
|
+ repairStatusData.forEach(data -> {
|
|
|
|
|
+ repairStatusPair.put(data.getValue(), data.getLabel());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CollUtil.isNotEmpty(rigStatus)) {
|
|
|
|
|
+ rigStatus.forEach(data -> {
|
|
|
|
|
+ rigStatusPair.put(data.getValue(), data.getLabel());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CollUtil.isNotEmpty(constructionStatus)) {
|
|
|
|
|
+ constructionStatus.forEach(data -> {
|
|
|
|
|
+ constructStatusPair.put(data.getValue(), data.getLabel());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 设备部门信息
|
|
// 设备部门信息
|
|
|
List<Long> projectIds = convertList(tasks, IotProjectTaskDO::getProjectId);
|
|
List<Long> projectIds = convertList(tasks, IotProjectTaskDO::getProjectId);
|
|
|
// 查询当前分页任务的关联 施工队伍信息
|
|
// 查询当前分页任务的关联 施工队伍信息
|
|
|
Set<Long> deptIds = new HashSet<>();
|
|
Set<Long> deptIds = new HashSet<>();
|
|
|
|
|
+ // key任务id value任务施工状态标签值
|
|
|
|
|
+ Map<Long, String> taskStatusPair = new HashMap<>();
|
|
|
tasks.forEach(task -> {
|
|
tasks.forEach(task -> {
|
|
|
if (CollUtil.isNotEmpty(task.getDeptIds())) {
|
|
if (CollUtil.isNotEmpty(task.getDeptIds())) {
|
|
|
deptIds.addAll(task.getDeptIds());
|
|
deptIds.addAll(task.getDeptIds());
|
|
|
}
|
|
}
|
|
|
|
|
+ if (StrUtil.isNotBlank(task.getStatus())) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ // 瑞都施工状态
|
|
|
|
|
+ if (StrUtil.isNotBlank(task.getRdStatus())) {
|
|
|
|
|
+ if (rdStatusPair.containsKey(task.getRdStatus())) {
|
|
|
|
|
+ taskStatusPair.put(task.getId(), rdStatusPair.get(task.getRdStatus()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 瑞鹰钻井施工状态
|
|
|
|
|
+ if (StrUtil.isNotBlank(task.getRigStatus())) {
|
|
|
|
|
+ if (rigStatusPair.containsKey(task.getRigStatus())) {
|
|
|
|
|
+ taskStatusPair.put(task.getId(), rigStatusPair.get(task.getRigStatus()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 瑞鹰修井施工状态
|
|
|
|
|
+ if (StrUtil.isNotBlank(task.getRepairStatus())) {
|
|
|
|
|
+ if (repairStatusPair.containsKey(task.getRepairStatus())) {
|
|
|
|
|
+ taskStatusPair.put(task.getId(), repairStatusPair.get(task.getRepairStatus()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 瑞恒施工状态
|
|
|
|
|
+ if (StrUtil.isNotBlank(task.getStatus()) && StrUtil.isBlank(task.getRdStatus()) && StrUtil.isBlank(task.getRigStatus()) && StrUtil.isBlank(task.getRepairStatus())) {
|
|
|
|
|
+ if (constructStatusPair.containsKey(task.getStatus())) {
|
|
|
|
|
+ taskStatusPair.put(task.getId(), constructStatusPair.get(task.getStatus()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
// 查询当前分布任务关联的施工队伍信息
|
|
// 查询当前分布任务关联的施工队伍信息
|
|
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(deptIds);
|
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(deptIds);
|
|
@@ -428,6 +496,8 @@ public class IotProjectTaskController {
|
|
|
if (projectDeptPair.containsKey(taskVO.getProjectId())) {
|
|
if (projectDeptPair.containsKey(taskVO.getProjectId())) {
|
|
|
taskVO.setProjectDeptId(projectDeptPair.get(taskVO.getProjectId()));
|
|
taskVO.setProjectDeptId(projectDeptPair.get(taskVO.getProjectId()));
|
|
|
}
|
|
}
|
|
|
|
|
+ // 任务施工状态
|
|
|
|
|
+ findAndThen(taskStatusPair, taskVO.getId(), statusLabel -> taskVO.setStatusLabel(statusLabel));
|
|
|
// 设置施工队伍名称
|
|
// 设置施工队伍名称
|
|
|
if (CollUtil.isNotEmpty(taskVO.getDeptIds())) {
|
|
if (CollUtil.isNotEmpty(taskVO.getDeptIds())) {
|
|
|
Set<String> deptNames = new HashSet<>();
|
|
Set<String> deptNames = new HashSet<>();
|