Ver Fonte

pms 瑞鹰 日报 发送消息逻辑优化

zhangcl há 1 semana atrás
pai
commit
7be05d62ee

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

@@ -12,12 +12,12 @@ import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
 import cn.iocoder.yudao.module.pms.controller.admin.iotprojectinfo.vo.IotProjectInfoPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO;
-import cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.IotRhDailyReportRespVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport.vo.*;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojectinfo.IotProjectInfoDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttask.IotProjectTaskDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotprojecttaskattrs.IotTaskAttrModelProperty;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotrydailyreport.IotRyDailyReportDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotrydailyreport.IotRyDailyReportMapper;
 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.iotrydailyreport.IotRyDailyReportService;
@@ -59,6 +59,8 @@ public class IotRyDailyReportController {
     private IotProjectInfoService iotProjectInfoService;
     @Resource
     private IotProjectTaskService iotProjectTaskService;
+    @Resource
+    private IotRyDailyReportMapper iotRyDailyReportMapper;
 
     @PostMapping("/create")
     @Operation(summary = "创建瑞鹰日报")
@@ -105,6 +107,7 @@ public class IotRyDailyReportController {
         // 查询日报对应的 项目 任务
         Long projectId = iotRyDailyReport.getProjectId();
         Long taskId = iotRyDailyReport.getTaskId();
+        Long deptId = iotRyDailyReport.getDeptId();
         if (ObjUtil.isNotEmpty(projectId)) {
             IotProjectInfoDO project = iotProjectInfoService.getIotProjectInfo(projectId);
             result.setContractName(project.getContractName());
@@ -113,6 +116,19 @@ public class IotRyDailyReportController {
             IotProjectTaskDO task = iotProjectTaskService.getIotProjectTask(taskId);
             result.setTaskName(task.getWellName());
         }
+        // 查询日报(deptId-taskId)上次填报的 当前井深
+        IotRyDailyReportPageReqVO reqVO = new IotRyDailyReportPageReqVO();
+        reqVO.setProjectClassification("1");
+        reqVO.setDeptId(deptId);
+        reqVO.setTaskId(taskId);
+        List<IotRyDailyReportDO> currentTaskReports = iotRyDailyReportMapper.dailyReports(reqVO);
+        // 按照创建时间倒序排列 取第2条记录对应的 当前井深
+        if (CollUtil.isNotEmpty(currentTaskReports)) {
+            currentTaskReports.sort(Comparator.comparing(IotRyDailyReportDO::getCreateTime).reversed());
+            currentTaskReports.forEach(report -> {
+
+            });
+        }
         return success(result);
     }
 

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

@@ -264,4 +264,7 @@ public class IotRyDailyReportRespVO {
 
     @Schema(description = "在岗人数 = 全员数量-休假人员数量", example = "80")
     private BigDecimal onDutyStaffNum;
+
+    @Schema(description = "上次日报的 当前井深(m)")
+    private BigDecimal lastCurrentDepth;
 }

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrydailyreport/IotRyDailyReportServiceImpl.java

@@ -219,8 +219,8 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
         DeptDO dept = deptService.getDept(deptId);
         Long parentId = dept.getParentId();
         if (ObjUtil.isNotEmpty(parentId)) {
-            DeptDO projectDept = deptService.getDept(parentId);
             DataPermissionUtils.executeIgnore(() -> {
+                DeptDO projectDept = deptService.getDept(parentId);
                 // 查找队伍上级项目部 拥有‘项目部日报审批RY’角色 的审批人 如果查找不到 则使用 瑞鹰国际 下拥有‘项目部日报审批RY’角色的审批人
                 if (ObjUtil.isNotEmpty(projectDept) && "2".equals(projectDept.getType())) {
                     // 查询项目部下具有 项目部日报审批RH 角色的人员 如果查找不到 查询 瑞鹰国际下 拥有‘项目部日报审批RH’角色的审批人