Ver Fonte

pms 瑞恒 瑞都 瑞鹰 查询任务施工区域

zhangcl há 3 dias atrás
pai
commit
ca5d9f849f

+ 7 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/IotRdDailyReportController.java

@@ -2359,8 +2359,10 @@ public class IotRdDailyReportController {
         }
         // 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, String> taskResponsiblePair = new HashMap<>();
         //  key任务id     value任务关联的填报人名称
@@ -2462,6 +2464,7 @@ public class IotRdDailyReportController {
                     Set<Long> deptIds = task.getDeptIds();
                     currentPageDeptIds.addAll(Optional.ofNullable(deptIds).orElse(Collections.emptySet()));
                     taskPair.put(task.getId(), task.getWellName());
+                    taskLocationPair.put(task.getId(), task.getLocation());
                     userIds.addAll(Optional.ofNullable(personIds).orElse(Collections.emptySet()));
                     userIds.addAll(Optional.ofNullable(submitterIds).orElse(Collections.emptySet()));
                     // 获取所有任务的工作量数据
@@ -2728,8 +2731,10 @@ public class IotRdDailyReportController {
             findAndThen(taskTeamsPair, reportVO.getTaskId(), deptNames -> reportVO.setDeptName(deptNames));
             // 日报关联的项目信息
             findAndThen(projectPair, reportVO.getProjectId(), contractName -> reportVO.setContractName(contractName));
-            // 日报关联的任务信息
+            // 日报关联的任务井号
             findAndThen(taskPair, reportVO.getTaskId(), taskName -> reportVO.setTaskName(taskName));
+            // 日报关联的任务施工区域
+            findAndThen(taskLocationPair, reportVO.getTaskId(), location -> reportVO.setLocation(location));
             // 日报关联的任务信息(兼容主井完工 关联井未完工的情况)
             findAndThen(relatedPlatformPair, reportVO.getPlatformGroup(), relatedTaskName -> reportVO.setTaskName(relatedTaskName));
             // 平台井相关的非生产时间标识

+ 5 - 4
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportRespVO.java

@@ -38,10 +38,14 @@ public class IotRdDailyReportRespVO {
     @ExcelProperty("项目")
     private String contractName;
 
-    @Schema(description = "任务名称", example = "YS45-211平台-山西兴县")
+    @Schema(description = "任务 井号", example = "YS45-211平台")
     @ExcelProperty("任务")
     private String taskName;
 
+    @Schema(description = "任务 施工地点", example = "山西兴县")
+    @ExcelProperty("施工地点")
+    private String location;
+
     @Schema(description = "施工状态(动迁上井/动迁下井/施工准备/施工...)", example = "1")
     @ExcelProperty("施工状态")
     private String rdStatusLabel;
@@ -264,9 +268,6 @@ public class IotRdDailyReportRespVO {
     @Schema(description = "井号", example = "YS45-211平台")
     private String wellName;
 
-    @Schema(description = "施工地点", example = "山西兴县")
-    private String location;
-
     @Schema(description = "客户名称", example = "YS45-211平台-山西兴县")
     private String manufactureName;
 

+ 7 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/IotRhDailyReportController.java

@@ -655,8 +655,10 @@ public class IotRhDailyReportController {
 
         // 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, String> taskExtPropertyPair = new HashMap<>();
         // key施工状态数据字典value   value施工状态数据字典label
@@ -808,6 +810,7 @@ public class IotRhDailyReportController {
             if (CollUtil.isNotEmpty(tasks)) {
                 tasks.forEach(task -> {
                     taskPair.put(task.getId(), task.getWellName());
+                    taskLocationPair.put(task.getId(), task.getLocation());
                     if (CollUtil.isNotEmpty(task.getExtProperty())) {
                         List<IotTaskAttrModelProperty> taskAttrs = task.getExtProperty();
                         if (CollUtil.isNotEmpty(taskAttrs)) {
@@ -907,8 +910,10 @@ public class IotRhDailyReportController {
             findAndThen(wellFuelPair, reportVO.getTaskId(), fuel -> reportVO.setWellTotalFuel(fuel));
             // 2.2 日报关联的项目信息
             findAndThen(projectPair, reportVO.getProjectId(), contractName -> reportVO.setContractName(contractName));
-            // 2.3 日报关联的任务信息
+            // 2.3 日报关联的任务井号
             findAndThen(taskPair, reportVO.getTaskId(), taskName -> reportVO.setTaskName(taskName));
+            // 日报关联的任务施工地点
+            findAndThen(taskLocationPair, reportVO.getTaskId(), location -> reportVO.setLocation(location));
             // 2.4 设计注气量
             findAndThen(taskExtPropertyPair, reportVO.getTaskId(), designInjection -> reportVO.setDesignInjection(designInjection));
             // 2.5 搬迁安装天数

+ 5 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/vo/IotRhDailyReportRespVO.java

@@ -30,10 +30,14 @@ public class IotRhDailyReportRespVO {
     @ExcelProperty("项目")
     private String contractName;
 
-    @Schema(description = "任务 井号-施工地点")
+    @Schema(description = "任务 井号")
     @ExcelProperty("任务")
     private String taskName;
 
+    @Schema(description = "任务 施工地点")
+    @ExcelProperty("施工地点")
+    private String location;
+
     @Schema(description = "施工状态 对应的数据字典 label")
     @ExcelProperty("施工状态")
     private String constructionStatusName;

+ 41 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/IotRyDailyReportController.java

@@ -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));
             // 生产动态明细

+ 9 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportRespVO.java

@@ -9,6 +9,7 @@ import lombok.Data;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.List;
+import java.util.Map;
 
 @Schema(description = "管理后台 - 瑞鹰日报 Response VO")
 @Data
@@ -30,10 +31,14 @@ public class IotRyDailyReportRespVO {
     @ExcelProperty("项目")
     private String contractName;
 
-    @Schema(description = "任务 井号-施工地点")
+    @Schema(description = "任务 井号")
     @ExcelProperty("任务")
     private String taskName;
 
+    @Schema(description = "任务 施工地点")
+    @ExcelProperty("施工地点")
+    private String location;
+
     @Schema(description = "施工状态 对应的数据字典 label")
     @ExcelProperty("施工状态")
     private String constructionStatusName;
@@ -311,4 +316,7 @@ public class IotRyDailyReportRespVO {
 
     @Schema(description = "运行记录工单创建日期")
     private List<IotRyDailyReportDetailRespVO> reportDetails;
+
+    @Schema(description = "当前日报可以选择的任务井集合")
+    private Map<Long, String> wellNamePair;
 }

+ 8 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrddailyreport/IotRdDailyReportServiceImpl.java

@@ -2651,14 +2651,21 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
                     // 类型(公司级1 项目部2 队伍3)
                     // 如果当前部门是 队伍 查找上级 项目部
                     if ("3".equals(type)) {
+                        // 项目部
                         DeptDO projectDept = deptService.getDept(dept.getParentId());
                         if (ObjUtil.isNotEmpty(projectDept)) {
                             deptIds.add(projectDept.getId());
+                            if ("2".equals(projectDept.getType())) {
+                                // 查找 项目部 的上一级 通知 生产运营部人员
+                                DeptDO companyDept = deptService.getDept(projectDept.getParentId());
+                                if (ObjUtil.isNotEmpty(companyDept)) {
+                                    deptIds.add(companyDept.getId());
+                                }
+                            }
                         }
                     }
                     // 查找当前部门及项目部下的人员
                     List<AdminUserDO> receivedMsgUsers = adminUserService.getUserListByDeptIds(deptIds);
-                    //
                     if (CollUtil.isNotEmpty(receivedMsgUsers)) {
                         Set<Long> userIds = new HashSet<>();
                         receivedMsgUsers.forEach(user -> {