|
|
@@ -26,6 +26,7 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttaskattrs.IotTaskAtt
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotrydailyreport.IotRyDailyReportDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotrydailyreportdetail.IotRyDailyReportDetailDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.depttype.IotDeptTypeMapper;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.iotprojecttask.IotProjectTaskMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotrydailyreport.IotRyDailyReportMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotrydailyreportdetail.IotRyDailyReportDetailMapper;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotprojectinfo.IotProjectInfoService;
|
|
|
@@ -83,6 +84,8 @@ public class IotRyDailyReportController {
|
|
|
private DictDataService dictDataService;
|
|
|
@Resource
|
|
|
private IotDeptTypeMapper iotDeptTypeMapper;
|
|
|
+ @Resource
|
|
|
+ private IotProjectTaskMapper iotProjectTaskMapper;
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建瑞鹰日报")
|
|
|
@@ -175,6 +178,38 @@ public class IotRyDailyReportController {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ // 查询当前日报对应部门 未完工的任务列表 以方便 日报管理员 或 填报人员在审批拒绝后修改 任务井
|
|
|
+ IotProjectTaskPageReqVO taskReqVO = new IotProjectTaskPageReqVO();
|
|
|
+ taskReqVO.setDeptId(iotRyDailyReport.getDeptId());
|
|
|
+ taskReqVO.setJobFlag("Y");
|
|
|
+ List<IotProjectTaskDO> tasks = iotProjectTaskMapper.selectList(taskReqVO);
|
|
|
+ Map<Long, String> wellNamePair = new HashMap<>();
|
|
|
+ // 没有关联任务井时返回空集合
|
|
|
+ result.setWellNamePair(wellNamePair);
|
|
|
+ if (CollUtil.isNotEmpty(tasks)) {
|
|
|
+ tasks.forEach(task -> {
|
|
|
+ wellNamePair.put(task.getId(), task.getWellName());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (ObjUtil.isNotEmpty(iotRyDailyReport.getTaskId())) {
|
|
|
+ // 将当前日报已经关联的任务井也添加到返回的集合
|
|
|
+ IotProjectTaskDO task = iotProjectTaskMapper.selectById(iotRyDailyReport.getTaskId());
|
|
|
+ if (ObjUtil.isNotEmpty(task)) {
|
|
|
+ wellNamePair.put(task.getId(), task.getWellName());
|
|
|
+ if (CollUtil.isNotEmpty(task.getExtProperty())) {
|
|
|
+ List<IotTaskAttrModelProperty> taskAttrs = task.getExtProperty();
|
|
|
+ if (CollUtil.isNotEmpty(taskAttrs)) {
|
|
|
+ taskAttrs.forEach(attr -> {
|
|
|
+ if ("额定生产时间".equals(attr.getName()) && StrUtil.isNotBlank(attr.getActualValue())) {
|
|
|
+ result.setRatedProductionTime(new BigDecimal(attr.getActualValue()));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 返回当前日报可以设置的任务井集合
|
|
|
+ result.setWellNamePair(wellNamePair);
|
|
|
return success(result);
|
|
|
}
|
|
|
|
|
|
@@ -346,8 +381,10 @@ public class IotRyDailyReportController {
|
|
|
Map<Long, DeptDO> deptMap = deptService.getDeptMap(convertList(reports, IotRyDailyReportDO::getDeptId));
|
|
|
// key项目id value项目合同号
|
|
|
Map<Long, String> projectPair = new HashMap<>();
|
|
|
- // key任务id value任务井号-施工区域
|
|
|
+ // key任务id value任务井号
|
|
|
Map<Long, String> taskPair = new HashMap<>();
|
|
|
+ // key任务id value任务施工区域
|
|
|
+ Map<Long, String> taskLocationPair = new HashMap<>();
|
|
|
// key任务id value设计井深
|
|
|
Map<Long, BigDecimal> taskExtPropertyPair = new HashMap<>();
|
|
|
// key任务id value额定生产时间
|
|
|
@@ -438,6 +475,7 @@ public class IotRyDailyReportController {
|
|
|
if (CollUtil.isNotEmpty(tasks)) {
|
|
|
tasks.forEach(task -> {
|
|
|
taskPair.put(task.getId(), task.getWellName());
|
|
|
+ taskLocationPair.put(task.getId(), task.getLocation());
|
|
|
taskTechniquePair.put(task.getId(), task.getTechnique());
|
|
|
if (CollUtil.isNotEmpty(task.getExtProperty())) {
|
|
|
List<IotTaskAttrModelProperty> taskAttrs = task.getExtProperty();
|
|
|
@@ -525,6 +563,8 @@ public class IotRyDailyReportController {
|
|
|
findAndThen(projectPair, reportVO.getProjectId(), contractName -> reportVO.setContractName(contractName));
|
|
|
// 2.3 日报关联的任务信息
|
|
|
findAndThen(taskPair, reportVO.getTaskId(), taskName -> reportVO.setTaskName(taskName));
|
|
|
+ // 日报关联的任务施工地点
|
|
|
+ findAndThen(taskLocationPair, reportVO.getTaskId(), location -> reportVO.setLocation(location));
|
|
|
// 2.4 设计井深
|
|
|
findAndThen(taskExtPropertyPair, reportVO.getTaskId(), wellDepth -> reportVO.setDesignWellDepth(wellDepth));
|
|
|
// 生产动态明细
|