Explorar o código

Merge remote-tracking branch 'origin/master'

Zimo hai 4 días
pai
achega
b911af52c9

+ 70 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotprojecttask/IotProjectTaskController.java

@@ -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.iotprojecttask.IotProjectTaskService;
 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.dict.DictDataService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -60,6 +62,8 @@ public class IotProjectTaskController {
     private IotRdDailyReportMapper iotRdDailyReportMapper;
     @Resource
     private IotProjectInfoMapper iotProjectInfoMapper;
+    @Resource
+    private DictDataService dictDataService;
 
     @PostMapping("/create")
     @Operation(summary = "创建项目信息任务拆分")
@@ -398,14 +402,78 @@ public class IotProjectTaskController {
         if (CollUtil.isEmpty(tasks)) {
             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);
         // 查询当前分页任务的关联 施工队伍信息
         Set<Long> deptIds = new HashSet<>();
+        // key任务id  value任务施工状态标签值
+        Map<Long, String> taskStatusPair = new HashMap<>();
         tasks.forEach(task -> {
             if (CollUtil.isNotEmpty(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);
@@ -428,6 +496,8 @@ public class IotProjectTaskController {
             if (projectDeptPair.containsKey(taskVO.getProjectId())) {
                 taskVO.setProjectDeptId(projectDeptPair.get(taskVO.getProjectId()));
             }
+            // 任务施工状态
+            findAndThen(taskStatusPair, taskVO.getId(), statusLabel -> taskVO.setStatusLabel(statusLabel));
             // 设置施工队伍名称
             if (CollUtil.isNotEmpty(taskVO.getDeptIds())) {
                 Set<String> deptNames = new HashSet<>();

+ 13 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotprojecttask/vo/IotProjectTaskRespVO.java

@@ -72,9 +72,21 @@ public class IotProjectTaskRespVO {
     @Schema(description = "工作量单位(段/层/方/井深/进尺)")
     private String workloadUnit;
 
-    @Schema(description = "状态", example = "dq sg")
+    @Schema(description = "(瑞恒)施工状态", example = "dq sg")
     private String status;
 
+    @Schema(description = "瑞都施工状态", example = "dq sg")
+    private String rdStatus;
+
+    @Schema(description = "瑞鹰钻井施工状态", example = "dq sg")
+    private String rigStatus;
+
+    @Schema(description = "瑞鹰修井施工状态", example = "dq sg")
+    private String repairStatus;
+
+    @Schema(description = "施工状态 聚合label", example = "dq sg")
+    private String statusLabel;
+
     @Schema(description = "创建时间")
     @ExcelProperty(" 创建时间 ")
     private LocalDateTime createTime;

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

@@ -74,4 +74,7 @@ public class IotRyDailyReportDetailPageReqVO extends PageParam {
      */
     @Schema(description = "日报id", example = "7685")
     private Collection<Long> reportIds;
+
+    @Schema(description = "日报日期", example = "2323217685")
+    private LocalDateTime fillOrderReportDate;
 }

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotprojecttask/IotProjectTaskDO.java

@@ -88,7 +88,7 @@ public class IotProjectTaskDO extends BaseDO {
      */
     private String workloadUnit;
     /**
-     * 状态 瑞恒施工状态
+     * 状态 (瑞恒)施工状态
      */
     private String status;
     /**

+ 34 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotrydailyreportdetail/IotRyDailyReportDetailMapper.java

@@ -1,5 +1,7 @@
 package cn.iocoder.yudao.module.pms.dal.mysql.iotrydailyreportdetail;
 
+import cn.hutool.core.util.ObjUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
@@ -7,6 +9,8 @@ import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreportdetail.vo.Io
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotrydailyreportdetail.IotRyDailyReportDetailDO;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.time.format.DateTimeFormatter;
+
 /**
  * 瑞鹰日报明细(生产动态拆分) Mapper
  *
@@ -36,4 +40,34 @@ public interface IotRyDailyReportDetailMapper extends BaseMapperX<IotRyDailyRepo
                 .orderByDesc(IotRyDailyReportDetailDO::getId));
     }
 
+    default PageResult<IotRyDailyReportDetailDO> selectPages(IotRyDailyReportDetailPageReqVO reqVO) {
+        LambdaQueryWrapperX<IotRyDailyReportDetailDO> queryWrapper = new LambdaQueryWrapperX<IotRyDailyReportDetailDO>();
+        String dateStr = ObjUtil.isNotEmpty(reqVO.getFillOrderReportDate()) ? reqVO.getFillOrderReportDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) : StrUtil.EMPTY;
+
+        queryWrapper
+                .eqIfPresent(IotRyDailyReportDetailDO::getDeptId, reqVO.getDeptId())
+                .eqIfPresent(IotRyDailyReportDetailDO::getProjectId, reqVO.getProjectId())
+                .eqIfPresent(IotRyDailyReportDetailDO::getTaskId, reqVO.getTaskId())
+                .eqIfPresent(IotRyDailyReportDetailDO::getReportId, reqVO.getReportId())
+                .inIfPresent(IotRyDailyReportDetailDO::getReportId, reqVO.getReportIds())
+                .betweenIfPresent(IotRyDailyReportDetailDO::getReportDate, reqVO.getReportDate())
+                .betweenIfPresent(IotRyDailyReportDetailDO::getStartTime, reqVO.getStartTime())
+                .betweenIfPresent(IotRyDailyReportDetailDO::getEndTime, reqVO.getEndTime())
+                .eqIfPresent(IotRyDailyReportDetailDO::getDuration, reqVO.getDuration())
+                .eqIfPresent(IotRyDailyReportDetailDO::getCurrentDepth, reqVO.getCurrentDepth())
+                .eqIfPresent(IotRyDailyReportDetailDO::getConstructionDetail, reqVO.getConstructionDetail())
+                .eqIfPresent(IotRyDailyReportDetailDO::getCurrentOperation, reqVO.getCurrentOperation())
+                .eqIfPresent(IotRyDailyReportDetailDO::getSort, reqVO.getSort())
+                .eqIfPresent(IotRyDailyReportDetailDO::getRemark, reqVO.getRemark())
+                .eqIfPresent(IotRyDailyReportDetailDO::getStatus, reqVO.getStatus())
+                .betweenIfPresent(IotRyDailyReportDetailDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotRyDailyReportDetailDO::getId);
+
+        if (ObjUtil.isNotEmpty(reqVO.getFillOrderReportDate())) {
+            queryWrapper.apply("DATE(report_date) = {0}", dateStr);
+        }
+
+        return selectPage(reqVO, queryWrapper);
+    }
+
 }

+ 10 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrydailyreport/IotRyDailyReportService.java

@@ -1,12 +1,12 @@
 package cn.iocoder.yudao.module.pms.service.iotrydailyreport;
 
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.IotRhDailyReportPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport.vo.*;
-import cn.iocoder.yudao.module.pms.dal.dataobject.iotrhdailyreport.IotRhDailyReportDO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreportdetail.vo.IotRyDailyReportDetailRespVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotrydailyreport.IotRyDailyReportDO;
 
 import javax.validation.Valid;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
 
@@ -47,6 +47,14 @@ public interface IotRyDailyReportService {
      */
     IotRyDailyReportDO getIotRyDailyReport(Long id);
 
+    /**
+     * 删除瑞鹰日报
+     *
+     * @param currentDate 当日日期
+     * @param deptId 部门id
+     */
+    List<IotRyDailyReportDetailRespVO> ryDailyReportDetails(LocalDateTime currentDate, Long deptId);
+
     /**
      * 获得瑞鹰日报分页
      *

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

@@ -15,6 +15,8 @@ import cn.iocoder.yudao.module.pms.controller.admin.iotdevicecategorytemplateatt
 import cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreport.vo.*;
+import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreportdetail.vo.IotRyDailyReportDetailPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreportdetail.vo.IotRyDailyReportDetailRespVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotrydailyreportdetail.vo.IotRyDailyReportDetailSaveReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDevicePageReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
@@ -22,7 +24,6 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.depttype.IotDeptTypeDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO;
 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.iotrddailyreportdetail.IotRdDailyReportDetailDO;
 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.IotDeviceMapper;
@@ -414,6 +415,24 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
         return iotRyDailyReportMapper.selectById(id);
     }
 
+    @Override
+    public List<IotRyDailyReportDetailRespVO> ryDailyReportDetails(LocalDateTime currentDate, Long deptId) {
+        List<IotRyDailyReportDetailRespVO> result = new ArrayList<>();
+        // 运行记录中查询生产动态详情使用 日期只匹配 yyyy-MM-dd 的值
+        // 查询日报的生产动态详情
+        IotRyDailyReportDetailPageReqVO detailReqVO = new IotRyDailyReportDetailPageReqVO();
+        detailReqVO.setDeptId(deptId);
+        detailReqVO.setFillOrderReportDate(currentDate);
+        detailReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        PageResult<IotRyDailyReportDetailDO> reportDetailsPage = iotRyDailyReportDetailMapper.selectPages(detailReqVO);
+        List<IotRyDailyReportDetailDO> reportDetails = reportDetailsPage.getList();
+        if (CollUtil.isNotEmpty(reportDetails)) {
+            List<IotRyDailyReportDetailRespVO> reportDetailsResp = BeanUtils.toBean(reportDetails, IotRyDailyReportDetailRespVO.class);
+            return reportDetailsResp;
+        }
+        return result;
+    }
+
     @Override
     public PageResult<IotRyDailyReportDO> getIotRyDailyReportPage(IotRyDailyReportPageReqVO pageReqVO) {
         // 查询选择部门下面所有子部门

+ 10 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojecttask/IotProjectTaskMapper.xml

@@ -12,6 +12,12 @@
         <result column="workload_design" property="workloadDesign" />
         <result column="create_time" property="createTime" />
         <result column="dept_ids" property="deptIds" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
+        <!-- 施工状态 -->
+        <result column="status" property="status" />
+        <result column="rd_status" property="rdStatus" />
+        <result column="rig_status" property="rigStatus" />
+        <result column="repair_status" property="repairStatus" />
+
         <result column="remark" property="remark" />
         <result column="manufacture_name" property="manufactureName" />
         <result column="contract_name" property="contractName" />
@@ -29,6 +35,10 @@
         a.workload_design,
         a.create_time,
         a.dept_ids,
+        a.status,
+        a.rd_status,
+        a.rig_status,
+        a.repair_status,
         a.remark,
         b.manufacture_name,
         b.contract_name,