Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

Zimo 4 jam lalu
induk
melakukan
c85e44c4be
12 mengubah file dengan 194 tambahan dan 18 penghapusan
  1. 15 9
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/devicegroup/IotDeviceGroupController.java
  2. 9 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmainworkorder/IotMainWorkOrderController.java
  3. 4 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrddailyreport/vo/IotRdDailyReportStatisticsRespVO.java
  4. 2 2
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/IotRhDailyReportController.java
  5. 5 2
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDeviceExportRespVO.java
  6. 3 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/vo/IotDeviceRespVO.java
  7. 14 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdeviceallotlog/IotDeviceAllotLogMapper.java
  8. 17 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdevicepersonlog/IotDevicePersonLogMapper.java
  9. 15 1
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdevicestatuslog/IotDeviceStatusLogMapper.java
  10. 71 0
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceServiceImpl.java
  11. 21 2
      yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrddailyreport/IotRdDailyReportServiceImpl.java
  12. 18 0
      yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotDeviceMapper.xml

+ 15 - 9
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/devicegroup/IotDeviceGroupController.java

@@ -202,6 +202,8 @@ public class IotDeviceGroupController {
                                     monitors.add(monitor);
                                 }
                             });
+                            // 增压机参数 列表 逆序
+                            Collections.reverse(monitors);
                         }
                         resultMap.put("增压机", monitors);
                     }
@@ -257,10 +259,14 @@ public class IotDeviceGroupController {
                         List<IotDeviceGroupMonitorVO> monitors = new ArrayList<>();
                         if (CollUtil.isNotEmpty(rows)) {
                             rows.forEach(row -> {
-                                if (row.getModelName().contains("进口温度") || row.getModelName().contains("出口温度") || row.getModelName().contains("出口压力") ||
-                                        row.getModelName().contains("冷干机运行状态") || row.getModelName().contains("风机运行状态")) {
+                                if (row.getModelName().contains("进口温度") || "出口温度".equals(row.getModelName()) || row.getModelName().contains("出口压力")
+                                        || row.getModelName().contains("风机运行状态")) {
                                     IotDeviceGroupMonitorVO monitor = new IotDeviceGroupMonitorVO();
-                                    monitor.setModelName(row.getModelName());
+                                    if (row.getModelName().contains("出口压力")) {
+                                        monitor.setModelName("出口压力");
+                                    } else {
+                                        monitor.setModelName(row.getModelName());
+                                    }
                                     monitor.setValue(row.getValue());
                                     monitors.add(monitor);
                                 }
@@ -276,13 +282,13 @@ public class IotDeviceGroupController {
                             outTemp.setValue("");
                             monitors.add(outTemp);
                             IotDeviceGroupMonitorVO outPress = new IotDeviceGroupMonitorVO();
-                            outPress.setModelName("空气处理撬出口压力");
+                            outPress.setModelName("出口压力");
                             outPress.setValue("");
                             monitors.add(outPress);
-                            IotDeviceGroupMonitorVO status = new IotDeviceGroupMonitorVO();
+                            /* IotDeviceGroupMonitorVO status = new IotDeviceGroupMonitorVO();
                             status.setModelName("冷干机运行状态");
                             status.setValue("");
-                            monitors.add(status);
+                            monitors.add(status); */
                             IotDeviceGroupMonitorVO windStatus = new IotDeviceGroupMonitorVO();
                             windStatus.setModelName("风机运行状态");
                             windStatus.setValue("");
@@ -357,7 +363,7 @@ public class IotDeviceGroupController {
                                 if (row.getModelName().contains("累计运行时间") || row.getModelName().contains("累计加载时间") || row.getModelName().contains("排气压力") ||
                                         row.getModelName().contains("排气温度") || row.getModelName().contains("环境温度") || row.getModelName().contains("系统压力")
                                         || row.getModelName().contains("喷油温度") || row.getModelName().contains("喷油压力") ||
-                                        row.getModelName().contains("运行状态") || row.getModelName().contains("加载状态")) {
+                                        row.getModelName().contains("运行状态")) {
                                     IotDeviceGroupMonitorVO monitor = new IotDeviceGroupMonitorVO();
                                     // 属性名称去掉 空压x
                                     // 获取"空压x"前缀部分
@@ -505,10 +511,10 @@ public class IotDeviceGroupController {
                     outPress.setModelName("空气处理撬出口压力");
                     outPress.setValue("");
                     monitors.add(outPress);
-                    IotDeviceGroupMonitorVO status = new IotDeviceGroupMonitorVO();
+                    /* IotDeviceGroupMonitorVO status = new IotDeviceGroupMonitorVO();
                     status.setModelName("冷干机运行状态");
                     status.setValue("");
-                    monitors.add(status);
+                    monitors.add(status); */
                     IotDeviceGroupMonitorVO windStatus = new IotDeviceGroupMonitorVO();
                     windStatus.setModelName("风机运行状态");
                     windStatus.setValue("");

+ 9 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotmainworkorder/IotMainWorkOrderController.java

@@ -392,7 +392,15 @@ public class IotMainWorkOrderController {
             deviceDistancesResult.forEach(distance -> {
                 // 设置施工状态 label
                 if (deviceStatusPair.containsKey(distance.getDeviceStatus())) {
-                    distance.setDeviceStatusLabel(deviceStatusPair.get(distance.getDeviceStatus()));
+                    String statusLabel = deviceStatusPair.get(distance.getDeviceStatus());
+                    // 转换成默认语言 中文
+                    if (StrUtil.isNotBlank(statusLabel) && statusLabel.contains("~~")) {
+                        // 截取首次~~之前的部分
+                        String processedName = statusLabel.substring(0, statusLabel.indexOf("~~"));
+                        distance.setDeviceStatusLabel(processedName);
+                    } else {
+                        distance.setDeviceStatusLabel(statusLabel);
+                    }
                 }
                 // 设置工单状态 未生成工单;已生成工单未执行
                 if (distance.isShouldWorkOrder() && distance.isRunningWorkOrder()) {

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

@@ -56,6 +56,10 @@ public class IotRdDailyReportStatisticsRespVO {
     @ExcelProperty("施工周期(D)")
     private String period;
 
+    @Schema(description = "任务开始日期")
+    @ExcelProperty("任务开始日期")
+    private String taskStartDate;
+
     @Schema(description = "施工状态")
     private String rdStatus;
 

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

@@ -769,11 +769,11 @@ public class IotRhDailyReportController {
                 BigDecimal power = reportVO.getDailyPowerUsage();
                 BigDecimal gas = reportVO.getDailyGasInjection();
                 if (power.compareTo(BigDecimal.ZERO) > 0) {
-                    BigDecimal tempResult = gas.divide(power, 4, RoundingMode.HALF_UP);
+                    BigDecimal tempResult = gas.divide(power, 2, RoundingMode.HALF_UP);
                     if (deptName.contains("塔里木") || deptName.contains("吐哈")) {
                         reportVO.setGasElectricityRatio(tempResult);
                     } else {
-                        reportVO.setGasElectricityRatio(tempResult.divide(BigDecimal.valueOf(1.07), 4, RoundingMode.HALF_UP));
+                        reportVO.setGasElectricityRatio(tempResult.divide(BigDecimal.valueOf(1.07), 2, RoundingMode.HALF_UP));
                     }
                 }
             }

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

@@ -32,6 +32,10 @@ public class IotDeviceExportRespVO {
     @ExcelProperty("距离保养")
     private String mainDistance;
 
+    @Schema(description = "设备累计运行时间")
+    @ExcelProperty("累计运行时长H")
+    private BigDecimal totalRunTime;
+
     @Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
     private Long brand;
 
@@ -157,8 +161,7 @@ public class IotDeviceExportRespVO {
      */
     @Schema(description = "设备累计运行里程")
     private BigDecimal totalMileage;
-    @Schema(description = "设备累计运行时间")
-    private BigDecimal totalRunTime;
+
     @Schema(description = "是否在线")
     private Integer ifInline;
 

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

@@ -176,8 +176,11 @@ public class IotDeviceRespVO {
      */
     @Schema(description = "设备累计运行里程")
     private BigDecimal totalMileage;
+
     @Schema(description = "设备累计运行时间")
+    @ExcelProperty("累计运行时长H")
     private BigDecimal totalRunTime;
+
     @Schema(description = "是否在线")
     private Integer ifInline;
 

+ 14 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdeviceallotlog/IotDeviceAllotLogMapper.java

@@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.pms.controller.admin.iotdeviceallotlog.vo.IotDevi
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotdeviceallotlog.IotDeviceAllotLogDO;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
  * 设备调拨日志 Mapper
  *
@@ -17,6 +19,18 @@ public interface IotDeviceAllotLogMapper extends BaseMapperX<IotDeviceAllotLogDO
 
     default PageResult<IotDeviceAllotLogDO> selectPage(IotDeviceAllotLogPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<IotDeviceAllotLogDO>()
+                .eqIfPresent(IotDeviceAllotLogDO::getDeviceId, reqVO.getDeviceId())
+                .inIfPresent(IotDeviceAllotLogDO::getDeviceId, reqVO.getDeviceIds())
+                .eqIfPresent(IotDeviceAllotLogDO::getOldDeptId, reqVO.getOldDeptId())
+                .eqIfPresent(IotDeviceAllotLogDO::getNewDeptId, reqVO.getNewDeptId())
+                .eqIfPresent(IotDeviceAllotLogDO::getReason, reqVO.getReason())
+                .eqIfPresent(IotDeviceAllotLogDO::getRemark, reqVO.getRemark())
+                .betweenIfPresent(IotDeviceAllotLogDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotDeviceAllotLogDO::getId));
+    }
+
+    default List<IotDeviceAllotLogDO> selectList(IotDeviceAllotLogPageReqVO reqVO) {
+        return selectList(new LambdaQueryWrapperX<IotDeviceAllotLogDO>()
                 .eqIfPresent(IotDeviceAllotLogDO::getDeviceId, reqVO.getDeviceId())
                 .inIfPresent(IotDeviceAllotLogDO::getDeviceId, reqVO.getDeviceIds())
                 .eqIfPresent(IotDeviceAllotLogDO::getOldDeptId, reqVO.getOldDeptId())

+ 17 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdevicepersonlog/IotDevicePersonLogMapper.java

@@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.pms.controller.admin.iotdevicepersonlog.vo.IotDev
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicepersonlog.IotDevicePersonLogDO;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
  * 设备责任人日志 Mapper
  *
@@ -26,7 +28,21 @@ public interface IotDevicePersonLogMapper extends BaseMapperX<IotDevicePersonLog
                 .eqIfPresent(IotDevicePersonLogDO::getReason, reqVO.getReason())
                 .eqIfPresent(IotDevicePersonLogDO::getRemark, reqVO.getRemark())
                 .betweenIfPresent(IotDevicePersonLogDO::getCreateTime, reqVO.getCreateTime())
-                .orderByDesc(IotDevicePersonLogDO::getDeviceId));
+                .orderByDesc(IotDevicePersonLogDO::getId));
+    }
+
+    default List<IotDevicePersonLogDO> selectList(IotDevicePersonLogPageReqVO reqVO) {
+        return selectList(new LambdaQueryWrapperX<IotDevicePersonLogDO>()
+                .eqIfPresent(IotDevicePersonLogDO::getDeviceId, reqVO.getDeviceId())
+                .inIfPresent(IotDevicePersonLogDO::getDeviceId, reqVO.getDeviceIds())
+                .eqIfPresent(IotDevicePersonLogDO::getOldPersonId, reqVO.getOldPersonId())
+                .eqIfPresent(IotDevicePersonLogDO::getOldPersonIds, reqVO.getOldPersonIds())
+                .eqIfPresent(IotDevicePersonLogDO::getNewPersonId, reqVO.getNewPersonId())
+                .eqIfPresent(IotDevicePersonLogDO::getNewPersonIds, reqVO.getNewPersonIds())
+                .eqIfPresent(IotDevicePersonLogDO::getReason, reqVO.getReason())
+                .eqIfPresent(IotDevicePersonLogDO::getRemark, reqVO.getRemark())
+                .betweenIfPresent(IotDevicePersonLogDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotDevicePersonLogDO::getId));
     }
 
 }

+ 15 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotdevicestatuslog/IotDeviceStatusLogMapper.java

@@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.pms.controller.admin.iotdevicestatuslog.vo.IotDev
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicestatuslog.IotDeviceStatusLogDO;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
  * 设备状态调整日志 Mapper
  *
@@ -24,7 +26,19 @@ public interface IotDeviceStatusLogMapper extends BaseMapperX<IotDeviceStatusLog
                 .eqIfPresent(IotDeviceStatusLogDO::getReason, reqVO.getReason())
                 .eqIfPresent(IotDeviceStatusLogDO::getRemark, reqVO.getRemark())
                 .betweenIfPresent(IotDeviceStatusLogDO::getCreateTime, reqVO.getCreateTime())
-                .orderByDesc(IotDeviceStatusLogDO::getDeviceId));
+                .orderByDesc(IotDeviceStatusLogDO::getId));
+    }
+
+    default List<IotDeviceStatusLogDO> selectList(IotDeviceStatusLogPageReqVO reqVO) {
+        return selectList(new LambdaQueryWrapperX<IotDeviceStatusLogDO>()
+                .eqIfPresent(IotDeviceStatusLogDO::getDeviceId, reqVO.getDeviceId())
+                .inIfPresent(IotDeviceStatusLogDO::getDeviceId, reqVO.getDeviceIds())
+                .eqIfPresent(IotDeviceStatusLogDO::getOldStatus, reqVO.getOldStatus())
+                .eqIfPresent(IotDeviceStatusLogDO::getNewStatus, reqVO.getNewStatus())
+                .eqIfPresent(IotDeviceStatusLogDO::getReason, reqVO.getReason())
+                .eqIfPresent(IotDeviceStatusLogDO::getRemark, reqVO.getRemark())
+                .betweenIfPresent(IotDeviceStatusLogDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IotDeviceStatusLogDO::getId));
     }
 
 }

+ 71 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceServiceImpl.java

@@ -13,10 +13,13 @@ import cn.iocoder.yudao.framework.common.util.object.PageUtils;
 import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
 import cn.iocoder.yudao.module.pms.ThingsModelDTO;
 import cn.iocoder.yudao.module.pms.controller.admin.TableDataInfo;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdeviceallotlog.vo.IotDeviceAllotLogPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotdevicecategorytemplateattrs.vo.IotDeviceProperty;
 import cn.iocoder.yudao.module.pms.controller.admin.iotdevicematerial.vo.IotDeviceMaterialRespVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotdeviceperson.vo.IotDevicePersonPageReqVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicepersonlog.vo.IotDevicePersonLogPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotdevicerunlog.vo.IotDeviceRunLogRespVO;
+import cn.iocoder.yudao.module.pms.controller.admin.iotdevicestatuslog.vo.IotDeviceStatusLogPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.iotmodeltemplateattrs.vo.IotModelTemplateAttrsPageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDevicePageReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO;
@@ -26,7 +29,10 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.IotInfoClassifyDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.IotTreeDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotZHBD.DeviceZHBDDO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdeviceallotlog.IotDeviceAllotLogDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotdeviceperson.IotDevicePersonDO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicepersonlog.IotDevicePersonLogDO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicestatuslog.IotDeviceStatusLogDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodel.IotModelDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.iotmodeltemplateattrs.IotModelTemplateAttrsDO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.tdparams.IotTdParamsDO;
@@ -34,7 +40,10 @@ import cn.iocoder.yudao.module.pms.dal.mysql.IotDeviceMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.IotInfoClassifyMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.IotTreeMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.TDDeviceMapper;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotdeviceallotlog.IotDeviceAllotLogMapper;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotdevicepersonlog.IotDevicePersonLogMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.iotdevicerunlog.IotDeviceRunLogMapper;
+import cn.iocoder.yudao.module.pms.dal.mysql.iotdevicestatuslog.IotDeviceStatusLogMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.iotmodel.IotModelMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.iotopeationfill.IotOpeationFillMapper;
 import cn.iocoder.yudao.module.pms.dal.mysql.tdparams.IotTdParamsMapper;
@@ -74,6 +83,7 @@ import org.springframework.web.client.RestTemplate;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.atomic.AtomicReference;
@@ -143,6 +153,13 @@ public class IotDeviceServiceImpl implements IotDeviceService {
     @Autowired
     private IotTdParamsMapper iotTdParamsMapper;
 
+    @Autowired
+    private IotDeviceAllotLogMapper iotDeviceAllotLogMapper;
+    @Autowired
+    private IotDevicePersonLogMapper iotDevicePersonLogMapper;
+    @Autowired
+    private IotDeviceStatusLogMapper iotDeviceStatusLogMapper;
+
 
     @Override
     public String getDeviceCompany(Long id) {
@@ -782,6 +799,24 @@ public class IotDeviceServiceImpl implements IotDeviceService {
             ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
             ids.add(pageReqVO.getDeptId());
         }
+        // 调拨时间区间搜索 查询在指定时间区间内调拨过的设备
+        LocalDateTime[] allotDateTime = pageReqVO.getCreateTime();
+        Set<Long> timeDeviceIds = new HashSet<>();
+        if (ObjUtil.isNotEmpty(allotDateTime)) {
+            IotDevicePersonLogPageReqVO reqVO = new IotDevicePersonLogPageReqVO();
+            reqVO.setCreateTime(allotDateTime);
+            List<IotDevicePersonLogDO> deviceAllots = iotDevicePersonLogMapper.selectList(reqVO);
+            if (CollUtil.isNotEmpty(deviceAllots)) {
+                deviceAllots.forEach(allot -> {
+                    timeDeviceIds.add(allot.getDeviceId());
+                });
+                if (CollUtil.isNotEmpty(timeDeviceIds)) {
+                    pageReqVO.setDeviceIds(new ArrayList<>(timeDeviceIds));
+                }
+            } else {
+                return PageResult.empty();
+            }
+        }
         // 根据用户昵称模糊搜索 已经设置过此人作为责任人的设备列表
         Set<Long> deviceIds = new HashSet<>();
         if (StrUtil.isNotBlank(pageReqVO.getNickname())) {
@@ -833,6 +868,24 @@ public class IotDeviceServiceImpl implements IotDeviceService {
             ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
             ids.add(pageReqVO.getDeptId());
         }
+        // 调拨时间区间搜索 查询在指定时间区间内调拨过的设备
+        LocalDateTime[] allotDateTime = pageReqVO.getCreateTime();
+        Set<Long> deviceIds = new HashSet<>();
+        if (ObjUtil.isNotEmpty(allotDateTime)) {
+            IotDeviceStatusLogPageReqVO reqVO = new IotDeviceStatusLogPageReqVO();
+            reqVO.setCreateTime(allotDateTime);
+            List<IotDeviceStatusLogDO> deviceAllots = iotDeviceStatusLogMapper.selectList(reqVO);
+            if (CollUtil.isNotEmpty(deviceAllots)) {
+                deviceAllots.forEach(allot -> {
+                    deviceIds.add(allot.getDeviceId());
+                });
+                if (CollUtil.isNotEmpty(deviceIds)) {
+                    pageReqVO.setDeviceIds(new ArrayList<>(deviceIds));
+                }
+            } else {
+                return PageResult.empty();
+            }
+        }
         try {
             IPage<IotDeviceRespVO> page = iotDeviceMapper.deviceStatuses(
                     new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO, ids);
@@ -852,6 +905,24 @@ public class IotDeviceServiceImpl implements IotDeviceService {
             ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
             ids.add(pageReqVO.getDeptId());
         }
+        // 调拨时间区间搜索 查询在指定时间区间内调拨过的设备
+        LocalDateTime[] allotDateTime = pageReqVO.getCreateTime();
+        Set<Long> deviceIds = new HashSet<>();
+        if (ObjUtil.isNotEmpty(allotDateTime)) {
+            IotDeviceAllotLogPageReqVO reqVO = new IotDeviceAllotLogPageReqVO();
+            reqVO.setCreateTime(allotDateTime);
+            List<IotDeviceAllotLogDO> deviceAllots = iotDeviceAllotLogMapper.selectList(reqVO);
+            if (CollUtil.isNotEmpty(deviceAllots)) {
+                deviceAllots.forEach(allot -> {
+                    deviceIds.add(allot.getDeviceId());
+                });
+                if (CollUtil.isNotEmpty(deviceIds)) {
+                    pageReqVO.setDeviceIds(new ArrayList<>(deviceIds));
+                }
+            } else {
+                return PageResult.empty();
+            }
+        }
         try {
             IPage<IotDeviceRespVO> page = iotDeviceMapper.deviceAllots(
                     new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO, ids);

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

@@ -402,7 +402,8 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
         Map<Long, String> taskTechniquePair = new HashMap<>();
         // key任务id   value任务的施工周期天数
         Map<Long, String> taskPeriodPair = new HashMap<>();
-
+        // key任务id  value每个任务的施工开始日期
+        Map<Long, LocalDateTime> taskStartDatePair = new HashMap<>();
         if (CollUtil.isNotEmpty(dailyReports)) {
             // 遍历日报 找到每个日报关联的任务的 施工队伍
             List<Long> taskIds = convertList(dailyReports, IotRdDailyReportDO::getTaskId);
@@ -534,6 +535,19 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
             Map<Long, BigDecimal> mixSandPair = new HashMap<>();
 
             dailyReports.forEach(report -> {
+                // 筛选每个日报关联任务的施工开始日期
+                Long taskId = report.getTaskId();
+                LocalDateTime createTime = report.getCreateTime();
+                if (taskStartDatePair.containsKey(taskId)) {
+                    LocalDateTime tempStartDate = taskStartDatePair.get(taskId);
+                    // 找出当前日报关联任务的最早日报日期
+                    if (createTime.isBefore(tempStartDate)) {
+                        taskStartDatePair.put(taskId, createTime);
+                    }
+                } else {
+                    taskStartDatePair.put(taskId, createTime);
+                }
+
                 BigDecimal dailyFuel = report.getDailyFuel();
                 dailyFuel = ObjUtil.isEmpty(dailyFuel) ? BigDecimal.ZERO : dailyFuel;
                 if (taskFuelPair.containsKey(report.getTaskId())) {
@@ -558,7 +572,6 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
 
                 // 设置每个任务的工作量数据  单位相同的工作量值作合并处理
                 List<IotTaskAttrModelProperty> taskAttrs = report.getExtProperty();
-                Long taskId = report.getTaskId();
                 // 暂存不同单位的工作量属性值
                 BigDecimal tempTotalBridgePlug = BigDecimal.ZERO;               // 桥塞(个数)
                 BigDecimal tempTotalRunCount = BigDecimal.ZERO;                 // 趟数
@@ -731,9 +744,15 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
                     if (taskPair.containsKey(taskId)) {
                         uniqueReport.setWellName(taskPair.get(taskId));
                     }
+                    // 施工周期
                     if (taskPeriodPair.containsKey(taskId)) {
                         uniqueReport.setPeriod(taskPeriodPair.get(taskId));
                     }
+                    // 任务开始日期
+                    if (taskStartDatePair.containsKey(taskId)) {
+                        LocalDateTime startDate = taskStartDatePair.get(taskId);
+                        uniqueReport.setTaskStartDate(LocalDateTimeUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
+                    }
                     if (taskStatusPair.containsKey(taskId)) {
                         uniqueReport.setRdStatus(taskStatusPair.get(taskId));
                     }

+ 18 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotDeviceMapper.xml

@@ -314,6 +314,12 @@
                 #{key}
             </foreach>
         </if>
+        <if test="reqVO.deviceIds != null and reqVO.deviceIds.size &gt; 0">
+            AND t.id IN
+            <foreach collection="reqVO.deviceIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
         <if test="reqVO.deviceName!=null and reqVO.deviceName!=''">
             AND t.device_name LIKE concat(concat("%",#{reqVO.deviceName}),"%")
         </if>
@@ -358,6 +364,12 @@
                 #{key}
             </foreach>
         </if>
+        <if test="reqVO.deviceIds != null and reqVO.deviceIds.size &gt; 0">
+            AND t.id IN
+            <foreach collection="reqVO.deviceIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
         <if test="reqVO.deviceName!=null and reqVO.deviceName!=''">
             AND t.device_name LIKE concat(concat("%",#{reqVO.deviceName}),"%")
         </if>
@@ -402,6 +414,12 @@
                 #{key}
             </foreach>
         </if>
+        <if test="reqVO.deviceIds != null and reqVO.deviceIds.size &gt; 0">
+            AND t.id IN
+            <foreach collection="reqVO.deviceIds" index="index" item="key" open="(" separator="," close=")">
+                #{key}
+            </foreach>
+        </if>
         <if test="reqVO.deviceName!=null and reqVO.deviceName!=''">
             AND t.device_name LIKE concat(concat("%",#{reqVO.deviceName}),"%")
         </if>