Bladeren bron

Merge remote-tracking branch 'origin/master'

zhangcl 4 dagen geleden
bovenliggende
commit
64aaf4fee4
21 gewijzigde bestanden met toevoegingen van 451 en 96 verwijderingen
  1. 3 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotopeationfill/IotOpeationFillController.java
  2. 33 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/IotRyDailyReportController.java
  3. 5 2
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportPageReqVO.java
  4. 29 2
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportRespVO.java
  5. 8 2
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportSaveReqVO.java
  6. 10 2
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotrydailyreport/IotRyDailyReportDO.java
  7. 7 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotopeationfill/IotOpeationFillMapper.java
  8. 13 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotrhdailyreport/IotRhDailyReportMapper.java
  9. 62 3
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotrydailyreport/IotRyDailyReportMapper.java
  10. 119 45
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/job/IotOperationPlanJob.java
  11. 16 3
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotopeationfill/IotOpeationFillServiceImpl.java
  12. 15 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrhdailyreport/IotRhDailyReportServiceImpl.java
  13. 40 29
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrydailyreport/IotRyDailyReportServiceImpl.java
  14. 1 1
      yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotModelTemplateMapper.xml
  15. 12 0
      yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotOpeationFillMapper.xml
  16. 0 3
      yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotOperationPlanMapper.xml
  17. 1 1
      yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojectinfo/IotProjectInfoMapper.xml
  18. 2 2
      yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojecttask/IotProjectTaskMapper.xml
  19. 57 0
      yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojecttask/IotRhDailyReportMapper.xml
  20. 15 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java
  21. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java

+ 3 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotopeationfill/IotOpeationFillController.java

@@ -269,6 +269,9 @@ public class IotOpeationFillController {
                 IotRyDailyReportSaveReqVO saveReqVO1 = BeanUtil.mapToBean(stringRyObjectMap, IotRyDailyReportSaveReqVO.class,false);
                 saveReqVO1.setDeptId(fillDO1.getDeptId());
                 saveReqVO1.setFillOrderCreateTime(fillList.get(0).getCreateTime().atStartOfDay());
+                if(fillDO1.getDeviceCategoryId()==228){
+                    saveReqVO1.setProjectClassification("2");
+                }
                 iotRyDailyReportService.createIotRyDailyReport(saveReqVO1);
             }
 

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

@@ -122,6 +122,16 @@ public class IotRyDailyReportController {
         Map<Long, String> taskPair = new HashMap<>();
         // key任务id   value设计井深
         Map<Long, BigDecimal> taskExtPropertyPair = new HashMap<>();
+        // key任务id   value额定生产时间
+        Map<Long, BigDecimal> taskRatedProductionTimePair = new HashMap<>();
+        // key任务id   value套生段产管尺寸
+        Map<Long, String> taskCasingPipeSizePair = new HashMap<>();
+        // key任务id   value井控级别
+        Map<Long, String> taskWellControlLevelPair = new HashMap<>();
+        // key任务id   value施工工艺
+        Map<Long, String> taskTechniquePair = new HashMap<>();
+        // key任务id   value井别
+        Map<Long, String> taskWellCategoryPair = new HashMap<>();
         // key任务id   value设计井身结构
         Map<Long, String> taskWellStructPair = new HashMap<>();
         // key部门id  value设备型号编号
@@ -149,6 +159,7 @@ public class IotRyDailyReportController {
             if (CollUtil.isNotEmpty(tasks)) {
                 tasks.forEach(task -> {
                     taskPair.put(task.getId(), StrUtil.join(" - ", task.getWellName(), task.getLocation()));
+                    taskTechniquePair.put(task.getId(), task.getTechnique());
                     if (CollUtil.isNotEmpty(task.getExtProperty())) {
                         List<IotTaskAttrModelProperty> taskAttrs = task.getExtProperty();
                         if (CollUtil.isNotEmpty(taskAttrs)) {
@@ -160,6 +171,18 @@ public class IotRyDailyReportController {
                                 if ("设计井身结构".equals(attr.getName()) && StrUtil.isNotBlank(attr.getActualValue())) {
                                     taskWellStructPair.put(task.getId(), attr.getActualValue());
                                 }
+                                if ("额定生产时间".equals(attr.getName()) && StrUtil.isNotBlank(attr.getActualValue())) {
+                                    taskRatedProductionTimePair.put(task.getId(), new BigDecimal(attr.getActualValue()));
+                                }
+                                if ("套生段产管尺寸".equals(attr.getName()) && StrUtil.isNotBlank(attr.getActualValue())) {
+                                    taskCasingPipeSizePair.put(task.getId(), attr.getActualValue());
+                                }
+                                if ("井控级别".equals(attr.getName()) && StrUtil.isNotBlank(attr.getActualValue())) {
+                                    taskWellControlLevelPair.put(task.getId(), attr.getActualValue());
+                                }
+                                if ("井别".equals(attr.getName()) && StrUtil.isNotBlank(attr.getActualValue())) {
+                                    taskWellCategoryPair.put(task.getId(), attr.getActualValue());
+                                }
                             });
                         }
                     }
@@ -193,6 +216,16 @@ public class IotRyDailyReportController {
             findAndThen(taskPair, reportVO.getTaskId(), taskName -> reportVO.setTaskName(taskName));
             // 2.4 设计井深
             findAndThen(taskExtPropertyPair, reportVO.getTaskId(), wellDepth -> reportVO.setDesignWellDepth(wellDepth));
+            // 施工工艺
+            findAndThen(taskTechniquePair, reportVO.getTaskId(), technique -> reportVO.setTechnique(technique));
+            // 井别
+            findAndThen(taskWellCategoryPair, reportVO.getTaskId(), wellCategory -> reportVO.setWellCategory(wellCategory));
+            // 额定生产时间
+            findAndThen(taskRatedProductionTimePair, reportVO.getTaskId(), ratedProductionTime -> reportVO.setRatedProductionTime(ratedProductionTime));
+            // 套生段产管尺寸
+            findAndThen(taskCasingPipeSizePair, reportVO.getTaskId(), casingPipeSize -> reportVO.setCasingPipeSize(casingPipeSize));
+            // 井控级别
+            findAndThen(taskWellControlLevelPair, reportVO.getTaskId(), wellControlLevel -> reportVO.setWellControlLevel(wellControlLevel));
             // 2.5 设计井身结构
             findAndThen(taskWellStructPair, reportVO.getTaskId(), wellStruct -> reportVO.setDesignWellStruct(wellStruct));
             // 2.6 设备型号

+ 5 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportPageReqVO.java

@@ -66,7 +66,7 @@ public class IotRyDailyReportPageReqVO extends PageParam {
     private BigDecimal[] nonProductionTime;
 
     @Schema(description = "非生产时间原因", example = "不香")
-    private String nptReason;
+    private String ryNptReason;
 
     @Schema(description = "施工开始日期")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@@ -79,7 +79,10 @@ public class IotRyDailyReportPageReqVO extends PageParam {
     @Schema(description = "当日生产情况生产动态", example = "1")
     private String productionStatus;
 
-    @Schema(description = "下步工作计划")
+    @Schema(description = "目前工序")
+    private String currentOperation;
+
+    @Schema(description = "下步工作计划 currentOperation")
     private String nextPlan;
 
     @Schema(description = "施工状态(动迁 准备 施工 完工)", example = "1")

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

@@ -73,13 +73,17 @@ public class IotRyDailyReportRespVO {
     @ExcelProperty("当月油耗(吨)")
     private BigDecimal monthlyFuel;
 
+    @Schema(description = "生产时间(H)")
+    @ExcelProperty("生产时间(H)")
+    private BigDecimal productionTime;
+
     @Schema(description = "非生产时间(H)")
     @ExcelProperty("非生产时间(H)")
     private BigDecimal nonProductionTime;
 
     @Schema(description = "非生产时间原因", example = "不香")
     @ExcelProperty("非生产时间原因")
-    private String nptReason;
+    private String ryNptReason;
 
 
     @Schema(description = "进尺工作时间(H)")
@@ -126,7 +130,11 @@ public class IotRyDailyReportRespVO {
     @ExcelProperty("当日生产情况生产动态")
     private String productionStatus;
 
-    @Schema(description = "下步工作计划")
+    @Schema(description = "目前工序")
+    @ExcelProperty("目前工序")
+    private String currentOperation;
+
+    @Schema(description = "下步工作计划 currentOperation")
     @ExcelProperty("下步工作计划")
     private String nextPlan;
 
@@ -212,4 +220,23 @@ public class IotRyDailyReportRespVO {
 
     @Schema(description = "设备型号/编号", example = "70D")
     private String equipmentType;
+
+    @Schema(description = "运行时效", example = "80%")
+    private BigDecimal transitTime;
+
+    @Schema(description = "额定生产时间(H)", example = "12")
+    private BigDecimal ratedProductionTime = BigDecimal.ZERO;
+
+    @Schema(description = "套生段产管尺寸(mm)", example = "12.88")
+    private String casingPipeSize;
+
+    @Schema(description = "井控级别", example = "一级井控")
+    private String wellControlLevel;
+
+    @Schema(description = "施工工艺", example = "检泵")
+    private String technique;
+
+    @Schema(description = "井别", example = "气井")
+    private String wellCategory;
+
 }

+ 8 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportSaveReqVO.java

@@ -55,11 +55,14 @@ public class IotRyDailyReportSaveReqVO {
     @Schema(description = "当月油耗(吨)")
     private BigDecimal monthlyFuel;
 
+    @Schema(description = "生产时间(H)")
+    private BigDecimal productionTime;
+
     @Schema(description = "非生产时间(H)")
     private BigDecimal nonProductionTime;
 
     @Schema(description = "非生产时间原因", example = "不香")
-    private String nptReason;
+    private String ryNptReason;
 
 
     @Schema(description = "进尺工作时间(H)")
@@ -93,7 +96,10 @@ public class IotRyDailyReportSaveReqVO {
     @Schema(description = "当日生产情况生产动态", example = "1")
     private String productionStatus;
 
-    @Schema(description = "下步工作计划")
+    @Schema(description = "目前工序")
+    private String currentOperation;
+
+    @Schema(description = "下步工作计划 下部工序")
     private String nextPlan;
 
     @Schema(description = "施工状态(动迁 准备 施工 完工)", example = "1")

+ 10 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/iotrydailyreport/IotRyDailyReportDO.java

@@ -85,6 +85,10 @@ public class IotRyDailyReportDO extends BaseDO {
      * 当月油耗(吨)
      */
     private BigDecimal monthlyFuel;
+    /**
+     * 生产时间(H)
+     */
+    private BigDecimal productionTime;
     /**
      * 非生产时间(H)
      */
@@ -92,7 +96,7 @@ public class IotRyDailyReportDO extends BaseDO {
     /**
      * 非生产时间原因
      */
-    private String nptReason;
+    private String ryNptReason;
 
     /**
      * 进尺工作时间(H)
@@ -148,7 +152,11 @@ public class IotRyDailyReportDO extends BaseDO {
      */
     private String productionStatus;
     /**
-     * 下步工作计划
+     * 目前工序
+     */
+    private String currentOperation;
+    /**
+     * 下步工作计划 下部工序
      */
     private String nextPlan;
     /**

+ 7 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotopeationfill/IotOpeationFillMapper.java

@@ -17,6 +17,7 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLo
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodeltemplateattrs.IotModelTemplateAttrsDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO;
+import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -248,4 +249,10 @@ public interface IotOpeationFillMapper extends BaseMapperX<IotOpeationFillDO> {
     @TenantIgnore
     IotDeviceRunLogDO getDesc(IotDeviceRunLogDO runLogDO);
 
+    @TenantIgnore
+    IotDeviceRunLogDO getTeamType(IotDeviceRunLogDO runLogDO);
+
+    @TenantIgnore
+    AdminUserDO getUserInfo(IotDeviceRunLogDO runLogDO);
+
 }

+ 13 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotrhdailyreport/IotRhDailyReportMapper.java

@@ -8,11 +8,13 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.IotRhDailyReportPageReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotrhdailyreport.IotRhDailyReportDO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
@@ -60,6 +62,17 @@ public interface IotRhDailyReportMapper extends BaseMapperX<IotRhDailyReportDO>
                 .orderByAsc(IotRhDailyReportDO::getDeptId));
     } */
 
+    /**
+     * 查询 瑞恒日报列表
+     * @param page
+     * @param reqVO
+     * @param projectIds
+     * @return
+     */
+    IPage<IotRhDailyReportDO> rhDailyReports(IPage<IotRhDailyReportDO> page, @Param("reqVO") IotRhDailyReportPageReqVO reqVO,
+                                             @Param("taskIds") Collection<Long> taskIds,
+                                             @Param("projectIds") Collection<Long> projectIds, @Param("deptIds") Collection<Long> deptIds);
+
     default PageResult<IotRhDailyReportDO> selectPage(IotRhDailyReportPageReqVO reqVO) {
         // 检查contractName不为空但projectIds为空的情况
         if (StrUtil.isNotBlank(reqVO.getContractName()) && (CollUtil.isEmpty(reqVO.getProjectIds()))) {

+ 62 - 3
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotrydailyreport/IotRyDailyReportMapper.java

@@ -26,12 +26,14 @@ import java.util.Objects;
 @Mapper
 public interface IotRyDailyReportMapper extends BaseMapperX<IotRyDailyReportDO> {
 
-    default PageResult<IotRyDailyReportDO> selectPage(IotRyDailyReportPageReqVO reqVO) {
+    /* default PageResult<IotRyDailyReportDO> selectPage(IotRyDailyReportPageReqVO reqVO) {
+        // 获取查询参数中的projectClassification值
+        String projectClassification = reqVO.getProjectClassification();
         return selectPage(reqVO, new LambdaQueryWrapperX<IotRyDailyReportDO>()
                 .eqIfPresent(IotRyDailyReportDO::getDeptId, reqVO.getDeptId())
                 .eqIfPresent(IotRyDailyReportDO::getProjectId, reqVO.getProjectId())
                 .eqIfPresent(IotRyDailyReportDO::getTaskId, reqVO.getTaskId())
-                .eqIfPresent(IotRyDailyReportDO::getProjectClassification, reqVO.getProjectClassification())
+                // .eqIfPresent(IotRyDailyReportDO::getProjectClassification, reqVO.getProjectClassification())
                 .eqIfPresent(IotRyDailyReportDO::getRelocationDays, reqVO.getRelocationDays())
                 .betweenIfPresent(IotRyDailyReportDO::getLatestWellDoneTime, reqVO.getLatestWellDoneTime())
                 .eqIfPresent(IotRyDailyReportDO::getCurrentDepth, reqVO.getCurrentDepth())
@@ -43,7 +45,7 @@ public interface IotRyDailyReportMapper extends BaseMapperX<IotRyDailyReportDO>
                 .eqIfPresent(IotRyDailyReportDO::getDailyFuel, reqVO.getDailyFuel())
                 .eqIfPresent(IotRyDailyReportDO::getMonthlyFuel, reqVO.getMonthlyFuel())
                 .betweenIfPresent(IotRyDailyReportDO::getNonProductionTime, reqVO.getNonProductionTime())
-                .eqIfPresent(IotRyDailyReportDO::getNptReason, reqVO.getNptReason())
+                .eqIfPresent(IotRyDailyReportDO::getRyNptReason, reqVO.getRyNptReason())
                 .betweenIfPresent(IotRyDailyReportDO::getConstructionStartDate, reqVO.getConstructionStartDate())
                 .betweenIfPresent(IotRyDailyReportDO::getConstructionEndDate, reqVO.getConstructionEndDate())
                 .eqIfPresent(IotRyDailyReportDO::getProductionStatus, reqVO.getProductionStatus())
@@ -64,6 +66,63 @@ public interface IotRyDailyReportMapper extends BaseMapperX<IotRyDailyReportDO>
                 .betweenIfPresent(IotRyDailyReportDO::getCreateTime, reqVO.getCreateTime())
                 .orderByDesc(IotRyDailyReportDO::getCreateTime)
                 .orderByAsc(IotRyDailyReportDO::getId));
+    } */
+
+    default PageResult<IotRyDailyReportDO> selectPage(IotRyDailyReportPageReqVO reqVO) {
+        // 获取查询参数中的 projectClassification 值
+        String projectClassification = reqVO.getProjectClassification();
+        LambdaQueryWrapperX<IotRyDailyReportDO> queryWrapper = new LambdaQueryWrapperX<IotRyDailyReportDO>();
+        // 创建查询包装器
+        queryWrapper
+                .eqIfPresent(IotRyDailyReportDO::getDeptId, reqVO.getDeptId())
+                .eqIfPresent(IotRyDailyReportDO::getProjectId, reqVO.getProjectId())
+                .eqIfPresent(IotRyDailyReportDO::getTaskId, reqVO.getTaskId())
+                .eqIfPresent(IotRyDailyReportDO::getRelocationDays, reqVO.getRelocationDays())
+                .betweenIfPresent(IotRyDailyReportDO::getLatestWellDoneTime, reqVO.getLatestWellDoneTime())
+                .eqIfPresent(IotRyDailyReportDO::getCurrentDepth, reqVO.getCurrentDepth())
+                .eqIfPresent(IotRyDailyReportDO::getDailyFootage, reqVO.getDailyFootage())
+                .eqIfPresent(IotRyDailyReportDO::getMonthlyFootage, reqVO.getMonthlyFootage())
+                .eqIfPresent(IotRyDailyReportDO::getAnnualFootage, reqVO.getAnnualFootage())
+                .eqIfPresent(IotRyDailyReportDO::getDailyPowerUsage, reqVO.getDailyPowerUsage())
+                .eqIfPresent(IotRyDailyReportDO::getMonthlyPowerUsage, reqVO.getMonthlyPowerUsage())
+                .eqIfPresent(IotRyDailyReportDO::getDailyFuel, reqVO.getDailyFuel())
+                .eqIfPresent(IotRyDailyReportDO::getMonthlyFuel, reqVO.getMonthlyFuel())
+                .betweenIfPresent(IotRyDailyReportDO::getNonProductionTime, reqVO.getNonProductionTime())
+                .eqIfPresent(IotRyDailyReportDO::getRyNptReason, reqVO.getRyNptReason())
+                .betweenIfPresent(IotRyDailyReportDO::getConstructionStartDate, reqVO.getConstructionStartDate())
+                .betweenIfPresent(IotRyDailyReportDO::getConstructionEndDate, reqVO.getConstructionEndDate())
+                .eqIfPresent(IotRyDailyReportDO::getProductionStatus, reqVO.getProductionStatus())
+                .eqIfPresent(IotRyDailyReportDO::getNextPlan, reqVO.getNextPlan())
+                .eqIfPresent(IotRyDailyReportDO::getRigStatus, reqVO.getRigStatus())
+                .eqIfPresent(IotRyDailyReportDO::getPersonnel, reqVO.getPersonnel())
+                .eqIfPresent(IotRyDailyReportDO::getMudDensity, reqVO.getMudDensity())
+                .eqIfPresent(IotRyDailyReportDO::getMudViscosity, reqVO.getMudViscosity())
+                .eqIfPresent(IotRyDailyReportDO::getLateralLength, reqVO.getLateralLength())
+                .eqIfPresent(IotRyDailyReportDO::getWellInclination, reqVO.getWellInclination())
+                .eqIfPresent(IotRyDailyReportDO::getAzimuth, reqVO.getAzimuth())
+                .eqIfPresent(IotRyDailyReportDO::getExtProperty, reqVO.getExtProperty())
+                .eqIfPresent(IotRyDailyReportDO::getSort, reqVO.getSort())
+                .eqIfPresent(IotRyDailyReportDO::getRemark, reqVO.getRemark())
+                .eqIfPresent(IotRyDailyReportDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(IotRyDailyReportDO::getProcessInstanceId, reqVO.getProcessInstanceId())
+                .eqIfPresent(IotRyDailyReportDO::getAuditStatus, reqVO.getAuditStatus())
+                .betweenIfPresent(IotRyDailyReportDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotRyDailyReportDO::getCreateTime)
+                .orderByAsc(IotRyDailyReportDO::getId);
+
+        // 单独处理 projectClassification 条件
+        if ("1".equals(projectClassification)) {
+            // 当值为 "1" 时,查询 project_classification 为 "1" 或空字符串的记录
+            queryWrapper.and(wrapper -> wrapper
+                    .eq(IotRyDailyReportDO::getProjectClassification, "1")
+                    .or().eq(IotRyDailyReportDO::getProjectClassification, "")
+            );
+        } else {
+            // 其他情况:有值则精确匹配,无值则不添加条件(保持原逻辑)
+            queryWrapper.eqIfPresent(IotRyDailyReportDO::getProjectClassification, projectClassification);
+        }
+
+        return selectPage(reqVO, queryWrapper);
     }
 
     /**

+ 119 - 45
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/job/IotOperationPlanJob.java

@@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.IotRhDai
 import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectPlanDO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillOrderDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotoperationplan.IotOperationPlanDO;
@@ -21,6 +22,7 @@ import cn.iocoder.yudao.module.pms.dal.mysql.iotoperationplandev.IotOperationPla
 import cn.iocoder.yudao.module.pms.message.PmsMessage;
 import cn.iocoder.yudao.module.pms.service.iotopeationfill.IotOpeationFillService;
 import cn.iocoder.yudao.module.pms.service.iotrhdailyreport.IotRhDailyReportService;
+import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
 import cn.iocoder.yudao.module.system.service.dept.DeptService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -33,6 +35,7 @@ import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -162,9 +165,31 @@ public class IotOperationPlanJob implements JobHandler {
 
 
     private void extracted(List<Long> devIdList, List<IotOpeationFillOrderDO> orderList,IotOperationPlanDO plan) {
-        LocalDateTime localDateTime = DateUtils.contactTime(plan.getBeginCreateTime());
-        plan.setLastCreateTime(localDateTime);
+        //瑞鹰日报计划为12小时执行一次
+        //判断计划周期是否为小时,如果是,则保存上次执行时间为当前时间最近的整点
+        if ("hour".equals(plan.getPlanUnit())) {
+            // 获取当前时间
+            LocalDateTime now = LocalDateTime.now();
+            // 获取当前分钟数
+            int minute = now.getMinute();
+
+            LocalDateTime localDateTime;
+            if (minute <= 30) {
+                // 如果分钟数小于等于30,取当前小时的整点
+                localDateTime = now.truncatedTo(ChronoUnit.HOURS);
+            } else {
+                // 如果分钟数大于30,取下一小时的整点
+                localDateTime = now.truncatedTo(ChronoUnit.HOURS).plusHours(1);
+            }
+            plan.setLastCreateTime(localDateTime);
+        } else {
+            LocalDateTime localDateTime = DateUtils.contactTime(plan.getBeginCreateTime());
+            plan.setLastCreateTime(localDateTime);
+        }
         planMapper.updateById(plan);
+
+
+
         //4、根据设备ID生成子表数据
         List<IotOpeationFillDO> deviceList = iotOpeationFillMapper.getFillDevices(devIdList);
         List<Integer> idList = deviceList.stream().map(IotOpeationFillDO::getUserId).collect(Collectors.toList());
@@ -173,54 +198,93 @@ public class IotOperationPlanJob implements JobHandler {
                 .collect(Collectors.toList());
         //插入工单主表
         iotOpeationFillOrderMapper.insertBatch(orderList1);
-        Set<Long> rdIdList = new HashSet<>();
-        rdIdList =  deptService.getChildDeptIdListFromCache(163L);
-        rdIdList.add(163L);
-        Set<Long> rhIdList = new HashSet<>();
-        rhIdList =  deptService.getChildDeptIdListFromCache(157L);
-        rhIdList.add(157L);
-        boolean exist = rdIdList.contains(plan.getDeptId());
-        if(!exist){
-            //瑞鹰SCP项目部50010队伍临时创建
-            if(plan.getDeptId()==292){
-                //筛选日报工单
-                List<IotOpeationFillOrderDO> virOrderList = new ArrayList<>();
-                IotOpeationFillOrderDO fillDO = new IotOpeationFillOrderDO();
-                fillDO.setOrderName("40006队"+"/"+LocalDate.now()+"运行记录填报");
-                fillDO.setDeptId(322L);
-                fillDO.setOrderStatus(0);
-                fillDO.setCreateTime(LocalDateTime.now());
-                fillDO.setUserName("李小虎");
-                fillDO.setUserId(486);
-                fillDO.setMobile(String.valueOf(17723897643L));
-                virOrderList.add(fillDO);
-                orderList1.addAll(virOrderList);
-                iotOpeationFillOrderMapper.insertBatch(virOrderList);
-                //创建日报设备
-                List <IotOpeationFillDO> devList = opeationFillService.reportMethod(virOrderList);
-                //插入日报设备
-                iotOpeationFillMapper.insertFill(devList);
+
+
+        Set<Long> ryIdList = new HashSet<>();
+        if(plan.getIsReport()==1){
+
+            ryIdList =  deptService.getChildDeptIdListFromCache(158L);
+            ryIdList.add(158L);
+
+            List<IotOpeationFillOrderDO> zxjOrderList = new ArrayList<>();
+
+            for (IotOpeationFillOrderDO orderDO:orderList1) {
+                IotDeviceRunLogDO runLogDO = new IotDeviceRunLogDO();
+                runLogDO.setDeptId(orderDO.getDeptId());
+                //获取队伍类型
+                IotDeviceRunLogDO teamType = iotOpeationFillMapper.getTeamType(runLogDO);
+
+                //如果是钻井队伍,则日报工单责任人更新为技术员
+                //修井队伍不变
+                if(teamType!=null&&teamType.getPointCode().equals("zj")){
+                    //获取技术员信息
+                    AdminUserDO userInfo = iotOpeationFillMapper.getUserInfo(runLogDO);
+                    if(userInfo!=null){
+                        orderDO.setUserName(userInfo.getUsername());
+                        orderDO.setUserId(new BigDecimal(userInfo.getId()).intValue());
+                        orderDO.setMobile(userInfo.getMobile());
+                    }
+                    zxjOrderList.add(orderDO);
+                }else if(teamType!=null&&teamType.getPointCode().equals("xj")){
+                    zxjOrderList.add(orderDO);
+                }
             }
 
-            boolean rhContain = rhIdList.contains(plan.getDeptId());
-            //瑞恒日报插入
-            rhReportInsert(plan, orderList1, rhContain);
-        }
-        //发送钉钉消息
-        sendDingMessage(orderList1);
-        //正常工单设备
-        for (IotOpeationFillDO device:deviceList) {
-            for (IotOpeationFillOrderDO order:orderList1) {
-                if(device.getUserId().intValue()==order.getUserId().intValue()){
-                    device.setOrderId(order.getId());
+
+            // 按dept_id去重,保留第一个出现的元素
+            List<IotOpeationFillOrderDO> distinctOrderList = zxjOrderList.stream()
+                    .collect(Collectors.toMap(
+                            IotOpeationFillOrderDO::getDeptId,
+                            order -> {
+                                order.setId(null); // 关键:重置ID,避免与已有数据冲突
+                                return order;
+                            },
+                            (existing, replacement) -> existing
+                    ))
+                    .values()
+                    .stream()
+                    .collect(Collectors.toList());
+            //插入工单主表
+            iotOpeationFillOrderMapper.insertBatch(distinctOrderList);
+            //发送钉钉消息
+            sendDingMessage(distinctOrderList);
+
+            boolean ryContain = ryIdList.contains(plan.getDeptId());
+            //瑞鹰日报插入
+            ryReportInsert(plan,distinctOrderList,ryContain);
+
+        }else{
+            ryIdList =  deptService.getChildDeptIdListFromCache(163L);
+            ryIdList.add(163L);
+            Set<Long> rhIdList = new HashSet<>();
+            rhIdList =  deptService.getChildDeptIdListFromCache(157L);
+            rhIdList.add(157L);
+            boolean exist = ryIdList.contains(plan.getDeptId());
+            if(!exist){
+                boolean rhContain = rhIdList.contains(plan.getDeptId());
+                //瑞恒日报插入
+                rhReportInsert(plan, orderList1, rhContain);
+            }
+            //发送钉钉消息
+            sendDingMessage(orderList1);
+            //正常工单设备
+            for (IotOpeationFillDO device:deviceList) {
+                for (IotOpeationFillOrderDO order:orderList1) {
+                    if(device.getUserId().intValue()==order.getUserId().intValue()){
+                        device.setOrderId(order.getId());
+                    }
                 }
             }
+            //插入子表
+            for (IotOpeationFillDO re:deviceList) {
+                re.setDeviceId(re.getId());
+            }
+            iotOpeationFillMapper.insertFill(deviceList);
         }
-        //插入子表
-        for (IotOpeationFillDO re:deviceList) {
-            re.setDeviceId(re.getId());
-        }
-        iotOpeationFillMapper.insertFill(deviceList);
+
+
+
+
 
     }
 
@@ -276,6 +340,16 @@ public class IotOperationPlanJob implements JobHandler {
         }
     }
 
+
+    private void ryReportInsert(IotOperationPlanDO plan, List<IotOpeationFillOrderDO> orderList1, boolean ryContain) {
+        if(ryContain){
+            //创建日报设备
+            List <IotOpeationFillDO> devList = opeationFillService.reportMethod(orderList1);
+            //插入日报设备
+            iotOpeationFillMapper.insertFill(devList);
+        }
+    }
+
     private void rhReportInsert(IotOperationPlanDO plan, List<IotOpeationFillOrderDO> orderList1, boolean rhContain) {
         if(rhContain){
 

+ 16 - 3
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotopeationfill/IotOpeationFillServiceImpl.java

@@ -56,7 +56,9 @@ public class IotOpeationFillServiceImpl implements IotOpeationFillService {
 
     private static Long RH_CLASS_ID = 226L;
 
-    private static Long RY_CLASS_ID = 227L;
+    private static Long RY_ZJ_CLASS_ID = 227L;
+
+    private static Long RY_XJ_CLASS_ID = 228L;
 
     @Override
     public Long createIotOpeationFill(IotOpeationFillSaveReqVO createReqVO) {
@@ -342,6 +344,12 @@ public class IotOpeationFillServiceImpl implements IotOpeationFillService {
         if(orderList.size()>0){
             //遍历工单主数据,根据dept_id查询是否为根节点
             for (IotOpeationFillOrderDO orderDO:orderList) {
+
+                IotDeviceRunLogDO runLogDO = new IotDeviceRunLogDO();
+                runLogDO.setDeptId(orderDO.getDeptId());
+                //获取队伍类型
+                IotDeviceRunLogDO teamType = iotOpeationFillMapper.getTeamType(runLogDO);
+
                 List<IotOpeationFillOrderDO> childList = iotOpeationFillMapper.childList(orderDO);
 
                 int randomNum = generateUniqueNumber();
@@ -354,8 +362,13 @@ public class IotOpeationFillServiceImpl implements IotOpeationFillService {
 
                     if(rhIdList.contains(orderDO.getDeptId())){
                         devOrder.setDeviceCategoryId(RH_CLASS_ID);
-                    }else if(ryIdList.contains(orderDO.getDeptId())){
-                        devOrder.setDeviceCategoryId(RY_CLASS_ID);
+                    }else if(ryIdList.contains(orderDO.getDeptId())&&teamType!=null){
+                        //队伍类型为zj则日报设备分类为钻井,否则为修井
+                        if(teamType.getPointCode().equals("zj")){
+                            devOrder.setDeviceCategoryId(RY_ZJ_CLASS_ID);
+                        }else{
+                            devOrder.setDeviceCategoryId(RY_XJ_CLASS_ID);
+                        }
                     }
 
                     devOrder.setDeptId(orderDO.getDeptId());

+ 15 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrhdailyreport/IotRhDailyReportServiceImpl.java

@@ -25,6 +25,8 @@ import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO;
 import cn.iocoder.yudao.module.system.service.dept.DeptService;
 import cn.iocoder.yudao.module.system.service.dict.DictDataService;
 import cn.iocoder.yudao.module.system.service.dict.DictTypeService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
 import org.springframework.stereotype.Service;
@@ -344,7 +346,19 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
             ids.add(pageReqVO.getDeptId());
             pageReqVO.setDeptIds(ids);
         }
-        return iotRhDailyReportMapper.selectPage(pageReqVO);
+        // 检查contractName不为空但projectIds为空的情况
+        if (StrUtil.isNotBlank(pageReqVO.getContractName()) && (CollUtil.isEmpty(pageReqVO.getProjectIds()))) {
+            return new PageResult<>(Collections.emptyList(), 0L);
+        }
+        // 检查taskName不为空但taskIds为空的情况
+        if (StrUtil.isNotBlank(pageReqVO.getTaskName()) && (CollUtil.isEmpty(pageReqVO.getTaskIds()))) {
+            return new PageResult<>(Collections.emptyList(), 0L);
+        }
+        IPage<IotRhDailyReportDO> page = iotRhDailyReportMapper.rhDailyReports(
+                new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO,
+                pageReqVO.getTaskIds(), pageReqVO.getProjectIds(), ids);
+
+        return new PageResult<>(page.getRecords(), page.getTotal());
     }
 
     @Override

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

@@ -64,7 +64,9 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
         if (ObjUtil.isEmpty(createReqVO.getDeptId())) {
             throw exception(IOT_RH_DAILY_REPORT_NO_DEPT);
         }
-        if (ObjUtil.isEmpty(createReqVO.getCurrentDepth())) {
+        if ((StrUtil.isBlank(createReqVO.getProjectClassification())||"1".equals(createReqVO.getProjectClassification()))
+                && ObjUtil.isEmpty(createReqVO.getCurrentDepth())) {
+            // 钻井类型日报必须 填写当前井深
             throw exception(IOT_RY_DAILY_REPORT_CURRENT_DEPTH_NOT_EXISTS);
         }
 
@@ -96,34 +98,43 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
             // throw exception(IOT_PROJECT_TASK_NOT_RELATED);
         }
 
-        // 计算月进尺 年累计进尺 reportDate对应的前一天的 年-月份 对应的日报记录日进尺的累加值
-        // 查询指定部门、指定时间段 填写的日报记录的 ’月进尺数据‘(逻辑细则:reportDate 所在的月份与数据表的字段 construction_start_date
-        // 所在的月份相匹配 且 create_time < reportDate 的记录的 ’daily_footage‘ 字段值累加计算得出
-        BigDecimal historyMonthlyFootage = iotRyDailyReportMapper.monthlyFootages(createReqVO.getDeptId(), reportDate);
-
-        // 查询指定部门、指定时间段 填写的日报记录的 ’年进尺数据‘(逻辑细则:reportDate 所在的年份与数据表的字段 construction_start_date
-        // 所在的年份相匹配 且 create_time < reportDate 的记录的 ’daily_footage‘ 字段值累加计算得出
-        BigDecimal historyAnnualFootage = iotRyDailyReportMapper.annualFootages(createReqVO.getDeptId(), reportDate);
-
-        // 当前井深 计算 日进尺 月进尺 年累计进尺
-        // (当前井深 - 前一天日报中填写的 ‘当前井深’)= 日进尺
-        // 将 reportDate 减去1天 得到日期 date(yyyy-MM-dd) 查询date对应的日报记录
-        IotRyDailyReportDO lastReport = iotRyDailyReportMapper.selectLatestReportBeforeDate(
-                createReqVO.getDeptId(), null, reportDate);
-        if (ObjUtil.isNotEmpty(lastReport) && ObjUtil.isNotEmpty(lastReport.getCurrentDepth())) {
-            // 当前井深-前一天日报的当前井深 = 日进尺
-            BigDecimal dailyFootage = createReqVO.getCurrentDepth().subtract(lastReport.getCurrentDepth());
-            iotRyDailyReport.setDailyFootage(dailyFootage);
-            // 日进尺+历史的当前月进尺 = 总的月进尺
-            iotRyDailyReport.setMonthlyFootage(dailyFootage.add(historyMonthlyFootage));
-            // 日进尺+历史的当前年进尺 = 总的年进尺
-            iotRyDailyReport.setAnnualFootage(dailyFootage.add(historyAnnualFootage));
-        } else {
-            // 如果没有查询到数据 则当前井深 就是日进尺
-            iotRyDailyReport.setDailyFootage(createReqVO.getCurrentDepth());
-            iotRyDailyReport.setMonthlyFootage(createReqVO.getCurrentDepth().add(historyMonthlyFootage));
-            // 日进尺+历史的当前年进尺 = 总的年进尺
-            iotRyDailyReport.setAnnualFootage(createReqVO.getCurrentDepth().add(historyAnnualFootage));
+        if (StrUtil.isBlank(createReqVO.getProjectClassification()) || "1".equals(createReqVO.getProjectClassification())) {
+            // 钻井类型日报 需要根据当前井深 计算 日进尺 月进尺 年累计进尺
+
+            // 计算月进尺 年累计进尺 reportDate对应的前一天的 年-月份 对应的日报记录日进尺的累加值
+            // 查询指定部门、指定时间段 填写的日报记录的 ’月进尺数据‘(逻辑细则:reportDate 所在的月份与数据表的字段 construction_start_date
+            // 所在的月份相匹配 且 create_time < reportDate 的记录的 ’daily_footage‘ 字段值累加计算得出
+            BigDecimal historyMonthlyFootage = iotRyDailyReportMapper.monthlyFootages(createReqVO.getDeptId(), reportDate);
+
+            // 查询指定部门、指定时间段 填写的日报记录的 ’年进尺数据‘(逻辑细则:reportDate 所在的年份与数据表的字段 construction_start_date
+            // 所在的年份相匹配 且 create_time < reportDate 的记录的 ’daily_footage‘ 字段值累加计算得出
+            BigDecimal historyAnnualFootage = iotRyDailyReportMapper.annualFootages(createReqVO.getDeptId(), reportDate);
+
+            // 当前井深 计算 日进尺 月进尺 年累计进尺
+            // (当前井深 - 前一天日报中填写的 ‘当前井深’)= 日进尺
+            // 将 reportDate 减去1天 得到日期 date(yyyy-MM-dd) 查询date对应的日报记录
+            IotRyDailyReportDO lastReport = iotRyDailyReportMapper.selectLatestReportBeforeDate(
+                    createReqVO.getDeptId(), null, reportDate);
+            if (ObjUtil.isNotEmpty(lastReport) && ObjUtil.isNotEmpty(lastReport.getCurrentDepth())) {
+                // 当前井深-前一天日报的当前井深 = 日进尺
+                BigDecimal dailyFootage = createReqVO.getCurrentDepth().subtract(lastReport.getCurrentDepth());
+                iotRyDailyReport.setDailyFootage(dailyFootage);
+                // 日进尺+历史的当前月进尺 = 总的月进尺
+                iotRyDailyReport.setMonthlyFootage(dailyFootage.add(historyMonthlyFootage));
+                // 日进尺+历史的当前年进尺 = 总的年进尺
+                iotRyDailyReport.setAnnualFootage(dailyFootage.add(historyAnnualFootage));
+            } else {
+                // 如果没有查询到数据 则当前井深 就是日进尺
+                iotRyDailyReport.setDailyFootage(createReqVO.getCurrentDepth());
+                iotRyDailyReport.setMonthlyFootage(createReqVO.getCurrentDepth().add(historyMonthlyFootage));
+                // 日进尺+历史的当前年进尺 = 总的年进尺
+                iotRyDailyReport.setAnnualFootage(createReqVO.getCurrentDepth().add(historyAnnualFootage));
+            }
+        }
+
+        // 设置瑞鹰日报类型 钻井 修井
+        if (StrUtil.isBlank(createReqVO.getProjectClassification())) {
+            iotRyDailyReport.setProjectClassification("1");
         }
 
         // 当天如果已经有此小队的记录 新增 当天如果没有此小队的日报记录 修改

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotModelTemplateMapper.xml

@@ -11,7 +11,7 @@
 
     <select id="isRelated" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotmodeltemplate.vo.IotModelTemplatePageReqVO"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotmodeltemplate.IotModelTemplateDO">
-        select distinct a.* from rqiot.rq_iot_opeation_fill_order a,
+        select distinct a.* from rq_iot_opeation_fill_order a,
                                  rq_iot_opeation_fill b,
                                  rq_iot_model_template c
         where a.id =b.order_id

+ 12 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotOpeationFillMapper.xml

@@ -1177,5 +1177,17 @@
     </select>
 
 
+    <select id="getTeamType" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO"
+            resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
+        select type as point_code from system_dept_type where dept_id = #{deptId}
+    </select>
+
+
+    <select id="getUserInfo" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO"
+            resultType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO">
+        select * from system_users where dept_id = #{deptId} and nickname = '技术员'
+    </select>
+
+
 
 </mapper>

+ 0 - 3
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotOperationPlanMapper.xml

@@ -17,9 +17,6 @@
             status = 0
         and
             deleted = 0
-        and
-            is_report is null
-        or  is_report != 1
     </select>
 
     <select id="getReportPlan" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotoperationplan.IotOperationPlanDO">

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojectinfo/IotProjectInfoMapper.xml

@@ -11,6 +11,6 @@
 
     <select id="projectList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotprojectinfo.vo.IotProjectInfoSaveReqVO"
     resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotprojectinfo.IotProjectInfoDO">
-        select * from rqiot.rq_iot_project_info where deleted = 0
+        select * from rq_iot_project_info where deleted = 0
     </select>
 </mapper>

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

@@ -35,8 +35,8 @@
         b.contract_name,
         b.contract_code
         from
-        rqiot.rq_iot_project_task a,
-        rqiot.rq_iot_project_info b
+        rq_iot_project_task a,
+        rq_iot_project_info b
         where 1=1
         and a.project_id = b.id
         and a.deleted = 0

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

@@ -15,6 +15,29 @@
         <result column="construction_end_date" property="constructionEndDate" />
         <result column="relocation_days" property="relocationDays" />
         <!-- 其他字段映射 -->
+        <result column="project_classification" property="projectClassification" />
+        <result column="transit_time" property="transitTime" />
+        <result column="daily_gas_injection" property="dailyGasInjection" />
+        <result column="daily_water_injection" property="dailyWaterInjection" />
+        <result column="daily_inject_gas_time" property="dailyInjectGasTime" />
+        <result column="daily_inject_water_time" property="dailyInjectWaterTime" />
+        <result column="daily_power_usage" property="dailyPowerUsage" />
+        <!-- 其他字段映射 -->
+        <result column="non_production_time" property="nonProductionTime" />
+        <result column="npt_reason" property="nptReason" />
+        <result column="production_status" property="productionStatus" />
+        <result column="next_plan" property="nextPlan" />
+        <result column="total_water_injection" property="totalWaterInjection" />
+        <result column="personnel" property="personnel" />
+        <result column="total_gas_injection" property="totalGasInjection" />
+        <!-- 其他字段映射 -->
+        <result column="cumulative_completion" property="cumulativeCompletion" />
+        <result column="remark" property="remark" />
+        <result column="status" property="status" />
+        <result column="creator" property="creator" />
+        <result column="create_time" property="createTime" />
+        <result column="updater" property="updater" />
+        <result column="update_time" property="updateTime" />
     </resultMap>
 
     <!-- 使用窗口函数实现分组查询 -->
@@ -112,4 +135,38 @@
         GROUP BY dept_id;
     </select>
 
+    <select id="rhDailyReports" resultMap="BaseResultMap"
+            parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotrhdailyreport.vo.IotRhDailyReportPageReqVO">
+        SELECT
+            *
+        FROM
+            rq_iot_rh_daily_report rdr
+        INNER JOIN system_dept d ON d.id = rdr.dept_id
+        WHERE
+            rdr.deleted = 0
+        AND rdr.dept_id IS NOT NULL
+        <if test="deptIds != null and deptIds.size &gt; 0">
+            AND rdr.dept_id IN
+            <foreach collection="deptIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
+        <if test="projectIds != null and projectIds.size &gt; 0">
+            AND rdr.project_id IN
+            <foreach collection="projectIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
+        <if test="taskIds != null and taskIds.size &gt; 0">
+            AND rdr.task_id IN
+            <foreach collection="taskIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
+        ORDER BY
+            rdr.create_time DESC,
+            REGEXP_REPLACE ( d.`name`, '[0-9]+', '' ) ASC,
+            CAST( REGEXP_REPLACE ( d.`name`, '[^0-9]+', '' ) AS UNSIGNED ) ASC;
+    </select>
+
 </mapper>

+ 15 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java

@@ -92,6 +92,21 @@ public class DeptController {
         return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
     }
 
+    @GetMapping("/specifiedSimpleDepts")
+    @Operation(summary = "获取指定部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
+    @PermitAll
+    @Parameter(name = "deptId", description = "部门id", required = true, example = "1024")
+    public CommonResult<List<DeptSimpleRespVO>> specifiedSimpleDepts(@RequestParam("deptId") Long deptId) {
+        DeptListReqVO reqVO = new DeptListReqVO();
+        reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
+        reqVO.setDeptId(deptId);
+        List<DeptDO> list = deptService.getChildDeptList(deptId);
+        // 查询 deptId 对应的部门 加入 最终返回的集合
+        DeptDO currentDept = deptService.getDept(deptId);
+        list.add(currentDept);
+        return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
+    }
+
     @GetMapping("/get")
     @Operation(summary = "获得部门信息")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java

@@ -18,4 +18,7 @@ public class DeptListReqVO {
     @Schema(description = "部门id集合", example = "[12,14]")
     private Collection<Long> deptIds;
 
+    @Schema(description = "指定的部门id", example = "123")
+    private Long deptId;
+
 }