Browse Source

项目设备信息更改01

qiangxuan 7 months ago
parent
commit
04535f4758

+ 5 - 2
jeecg-module-gather/src/main/java/org/jeecg/modules/device/controller/GatherManageController.java

@@ -13,6 +13,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.device.entity.DeviceInformation;
 import org.jeecg.modules.device.entity.GatherManageAddBatchParam;
 import org.jeecg.modules.device.entity.GatherManageAddParam;
+import org.jeecg.modules.device.service.IDeviceGatherServiceService;
 import org.jeecg.modules.device.service.IDeviceInformationService;
 import org.jeecg.modules.device.service.IGatherManageService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,12 +33,14 @@ import javax.servlet.http.HttpServletRequest;
 @Slf4j
 public class GatherManageController {
 
-    @Autowired
-    private IDeviceInformationService deviceInformationService;
+//    @Autowired
+//    private IDeviceInformationService deviceInformationService;
 
     @Autowired
     private IGatherManageService gatherManageService;
 
+    @Autowired
+    IDeviceGatherServiceService deviceGatherServiceService;
     /**
      * 分页列表查询
      *

+ 4 - 0
jeecg-module-gather/src/main/java/org/jeecg/modules/device/entity/DeviceGatherService.java

@@ -136,4 +136,8 @@ public class DeviceGatherService implements Serializable {
     @Dict(dicCode = "device_freq")
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String freq;
+    /**设备名称*/
+    @Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private String deviceTitle;
 }

+ 92 - 92
jeecg-module-gather/src/main/java/org/jeecg/modules/device/entity/DeviceInformation.java

@@ -43,112 +43,112 @@ public class DeviceInformation implements Serializable {
 	@Excel(name = "设备名称", width = 15)
     @ApiModelProperty(value = "设备名称")
     private String deviceTitle;
-	/**设备类型*/
-	@Excel(name = "设备类型", width = 15, dicCode = "equipment_model")
-    @ApiModelProperty(value = "设备类型")
-    @Dict(dicCode = "equipment_model")
-    private String s7Model;
 	/**设备编码*/
 	@Excel(name = "设备编码", width = 15)
     @ApiModelProperty(value = "设备编码")
     private String deviceCode;
-	/**ip*/
-	@Excel(name = "ip", width = 15)
-    @ApiModelProperty(value = "ip")
-    private String deviceIp;
-	/**端口*/
-	@Excel(name = "端口", width = 15)
-    @ApiModelProperty(value = "端口")
-    private String devicePort;
-	/**机架号*/
-	@Excel(name = "机架号", width = 15)
-    @ApiModelProperty(value = "机架号")
-    private Integer s7Rack;
-	/**槽号*/
-	@Excel(name = "槽号", width = 15)
-    @ApiModelProperty(value = "槽号")
-    private String s7Slot;
-	/**安装地址*/
-	@Excel(name = "安装地址", width = 15)
-    @ApiModelProperty(value = "安装地址")
-    private String deviceAddress;
-	/**最长位宽*/
-	@Excel(name = "最长位宽", width = 15)
-    @ApiModelProperty(value = "最长位宽")
-    private String s7LongestWidth;
-	/**备注*/
-	@Excel(name = "备注", width = 15)
-    @ApiModelProperty(value = "备注")
-    private String deviceRemark;
-	/**采集通道*/
-	@Excel(name = "采集通道", width = 15, dicCode = "device_information_gather")
-    @ApiModelProperty(value = "采集通道")
-    @Dict(dicCode = "device_information_gather")
-    private String deviceGather;
-	/**从站号*/
-	@Excel(name = "从站号", width = 15)
-    @ApiModelProperty(value = "从站号")
-    private Integer modbusDeviceNum;
-	/**运行状态*/
-	@Excel(name = "运行状态", width = 15, dicCode = "sfqy")
-    @ApiModelProperty(value = "运行状态")
-    @Dict(dicCode = "sfqy")
-    private String status;
-	/**所在部门*/
+    /**所在部门*/
     @ApiModelProperty(value = "所在部门")
     private String sysOrgCode;
-	/**创建人*/
+    /**创建人*/
     @ApiModelProperty(value = "创建人")
     private String createBy;
-	/**更新人*/
+    /**更新人*/
     @ApiModelProperty(value = "更新人")
     private String updateBy;
-	/**创建日期*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    /**创建日期*/
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "创建日期")
     private Date createTime;
-	/**更新日期*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    /**更新日期*/
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "更新日期")
     private Date updateTime;
-	/**clsid*/
-	@Excel(name = "clsid", width = 15)
-    @ApiModelProperty(value = "clsid")
-    private String opcClsid;
-	/**用户名*/
-	@Excel(name = "用户名", width = 15)
-    @ApiModelProperty(value = "用户名")
-    private String opcUsername;
-	/**密码*/
-	@Excel(name = "密码", width = 15)
-    @ApiModelProperty(value = "密码")
-    private String opcPassword;
-	/**注册表中的名称*/
-	@Excel(name = "注册表中的名称", width = 15)
-    @ApiModelProperty(value = "注册表中的名称")
-    private String opcRegname;
-	/**opc版本号*/
-	@Excel(name = "opc版本号", width = 15)
-    @ApiModelProperty(value = "opc版本号")
-    private String opcVersion;
-	/**opc中文名称*/
-	@Excel(name = "opc中文名称", width = 15)
-    @ApiModelProperty(value = "opc中文名称")
-    private String opcZhName;
-	/**opc英文名称*/
-	@Excel(name = "opc英文名称", width = 15)
-    @ApiModelProperty(value = "opc英文名称")
-    private String opcEnName;
-    /**opc域*/
-    @Excel(name = "opc域", width = 15)
-    @ApiModelProperty(value = "opc域")
-    private String opcDomain;
-    /**采集频率*/
-    @Excel(name = "采集频率", width = 15)
-    @ApiModelProperty(value = "采集频率")
-    @Dict(dicCode = "device_freq")
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private String freq;
+    //	/**设备类型*/
+//	@Excel(name = "设备类型", width = 15, dicCode = "equipment_model")
+//    @ApiModelProperty(value = "设备类型")
+//    @Dict(dicCode = "equipment_model")
+//    private String s7Model;
+//	/**ip*/
+//	@Excel(name = "ip", width = 15)
+//    @ApiModelProperty(value = "ip")
+//    private String deviceIp;
+//	/**端口*/
+//	@Excel(name = "端口", width = 15)
+//    @ApiModelProperty(value = "端口")
+//    private String devicePort;
+//	/**机架号*/
+//	@Excel(name = "机架号", width = 15)
+//    @ApiModelProperty(value = "机架号")
+//    private Integer s7Rack;
+//	/**槽号*/
+//	@Excel(name = "槽号", width = 15)
+//    @ApiModelProperty(value = "槽号")
+//    private String s7Slot;
+//	/**安装地址*/
+//	@Excel(name = "安装地址", width = 15)
+//    @ApiModelProperty(value = "安装地址")
+//    private String deviceAddress;
+//	/**最长位宽*/
+//	@Excel(name = "最长位宽", width = 15)
+//    @ApiModelProperty(value = "最长位宽")
+//    private String s7LongestWidth;
+//	/**备注*/
+//	@Excel(name = "备注", width = 15)
+//    @ApiModelProperty(value = "备注")
+//    private String deviceRemark;
+//	/**采集通道*/
+//	@Excel(name = "采集通道", width = 15, dicCode = "device_information_gather")
+//    @ApiModelProperty(value = "采集通道")
+//    @Dict(dicCode = "device_information_gather")
+//    private String deviceGather;
+//	/**从站号*/
+//	@Excel(name = "从站号", width = 15)
+//    @ApiModelProperty(value = "从站号")
+//    private Integer modbusDeviceNum;
+//	/**运行状态*/
+//	@Excel(name = "运行状态", width = 15, dicCode = "sfqy")
+//    @ApiModelProperty(value = "运行状态")
+//    @Dict(dicCode = "sfqy")
+//    private String status;
+//	/**clsid*/
+//	@Excel(name = "clsid", width = 15)
+//    @ApiModelProperty(value = "clsid")
+//    private String opcClsid;
+//	/**用户名*/
+//	@Excel(name = "用户名", width = 15)
+//    @ApiModelProperty(value = "用户名")
+//    private String opcUsername;
+//	/**密码*/
+//	@Excel(name = "密码", width = 15)
+//    @ApiModelProperty(value = "密码")
+//    private String opcPassword;
+//	/**注册表中的名称*/
+//	@Excel(name = "注册表中的名称", width = 15)
+//    @ApiModelProperty(value = "注册表中的名称")
+//    private String opcRegname;
+//	/**opc版本号*/
+//	@Excel(name = "opc版本号", width = 15)
+//    @ApiModelProperty(value = "opc版本号")
+//    private String opcVersion;
+//	/**opc中文名称*/
+//	@Excel(name = "opc中文名称", width = 15)
+//    @ApiModelProperty(value = "opc中文名称")
+//    private String opcZhName;
+//	/**opc英文名称*/
+//	@Excel(name = "opc英文名称", width = 15)
+//    @ApiModelProperty(value = "opc英文名称")
+//    private String opcEnName;
+//    /**opc域*/
+//    @Excel(name = "opc域", width = 15)
+//    @ApiModelProperty(value = "opc域")
+//    private String opcDomain;
+//    /**采集频率*/
+//    @Excel(name = "采集频率", width = 15)
+//    @ApiModelProperty(value = "采集频率")
+//    @Dict(dicCode = "device_freq")
+//    @TableField(updateStrategy = FieldStrategy.IGNORED)
+//    private String freq;
 }

+ 9 - 7
jeecg-module-gather/src/main/java/org/jeecg/modules/device/service/impl/GatherManageServiceImpl.java

@@ -2,7 +2,9 @@ package org.jeecg.modules.device.service.impl;
 
 import lombok.extern.slf4j.Slf4j;
 import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
+import org.jeecg.modules.device.entity.DeviceGatherService;
 import org.jeecg.modules.device.entity.DeviceInformation;
+import org.jeecg.modules.device.service.IDeviceGatherServiceService;
 import org.jeecg.modules.device.service.IDeviceInformationService;
 import org.jeecg.modules.device.service.IGatherManageService;
 import org.jeecg.modules.deviceConn.modbus.service.ModbusTcp;
@@ -16,29 +18,29 @@ import org.springframework.stereotype.Service;
 public class GatherManageServiceImpl implements IGatherManageService {
 
     @Autowired
-    private IDeviceInformationService deviceInformationService;
+    IDeviceGatherServiceService deviceGatherServiceService;
 
     @Override
     public boolean testConn(String id) {
         boolean mark = false;
-        DeviceInformation deviceInformation = deviceInformationService.getById(id);
-        if(deviceInformation.getDeviceGather().equals("s7")){
-            S7PLC s7PLC = new S7PLC(deviceInformation.getS7Model(), deviceInformation.getDeviceIp(), Integer.valueOf(deviceInformation.getDevicePort()), deviceInformation.getS7Rack(), Integer.valueOf(deviceInformation.getS7Slot()), Integer.valueOf(deviceInformation.getS7LongestWidth()));
+        DeviceGatherService deviceGatherService = deviceGatherServiceService.getById(id);
+        if(deviceGatherService.getDeviceGather().equals("s7")){
+            S7PLC s7PLC = new S7PLC(deviceGatherService.getS7Model(), deviceGatherService.getDeviceIp(), Integer.valueOf(deviceGatherService.getDevicePort()), deviceGatherService.getS7Rack(), Integer.valueOf(deviceGatherService.getS7Slot()), Integer.valueOf(deviceGatherService.getS7LongestWidth()));
             String read = "";
             read = "" + s7PLC.readInt16("DB2.1");
             s7PLC.close();
             mark = true;
-        }else if(deviceInformation.getDeviceGather().equals("opc")){
+        }else if(deviceGatherService.getDeviceGather().equals("opc")){
             OpcUaClient opcUaClient = null;
             try {
-                opcUaClient = OpcUaServerUtils.connectOpcUaServer(deviceInformation);
+                opcUaClient = OpcUaServerUtils.connectOpcUaServer(deviceGatherService);
                 mark = true;
             } catch (Exception e) {
                 log.error(e.getMessage());
             }finally {
                 if(opcUaClient!=null)opcUaClient.disconnect();
             }
-        }else if(deviceInformation.getDeviceGather().equals("modbus")){
+        }else if(deviceGatherService.getDeviceGather().equals("modbus")){
 //            ModbusTcp plc = new ModbusTcp(deviceInformation.getMobusDeviceNum(), deviceInformation.getDeviceIp(), Integer.valueOf(deviceInformation.getDevicePort()));
 //            String read = "";
 //            read = "" + plc.readInt16(100);

+ 2 - 2
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceConn/opc/utils/OpcUaServerUtils.java

@@ -21,7 +21,7 @@ import org.eclipse.milo.opcua.stack.core.types.enumerated.TimestampsToReturn;
 import org.eclipse.milo.opcua.stack.core.types.structured.MonitoredItemCreateRequest;
 import org.eclipse.milo.opcua.stack.core.types.structured.MonitoringParameters;
 import org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId;
-import org.jeecg.modules.device.entity.DeviceInformation;
+import org.jeecg.modules.device.entity.DeviceGatherService;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -38,7 +38,7 @@ public class OpcUaServerUtils {
      * @return
      * @throws Exception
      */
-    public static OpcUaClient connectOpcUaServer(DeviceInformation opcDevice) throws Exception {
+    public static OpcUaClient connectOpcUaServer(DeviceGatherService opcDevice) throws Exception {
         String endPointUrl = "opc.tcp://" + opcDevice.getDeviceIp() + ":" + opcDevice.getDevicePort() + opcDevice.getOpcDomain();
         Path securityTempDir = Paths.get(System.getProperty("java.io.tmpdir"), "security");
         Files.createDirectories(securityTempDir);

+ 13 - 18
jeecg-module-gather/src/main/java/org/jeecg/modules/deviceLog/service/impl/DeviceServiceImpl.java

@@ -1,13 +1,10 @@
 package org.jeecg.modules.deviceLog.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
 import org.jeecg.modules.common.entity.LogTopic;
-import org.jeecg.modules.device.entity.DeviceInformation;
+import org.jeecg.modules.device.entity.DeviceGatherService;
+import org.jeecg.modules.device.service.IDeviceGatherServiceService;
 import org.jeecg.modules.device.service.IDeviceInformationService;
 import org.jeecg.modules.deviceLog.entity.Device;
-import org.jeecg.modules.deviceLog.entity.DeviceLog;
-import org.jeecg.modules.deviceLog.mapper.DeviceLogMapper;
 import org.jeecg.modules.deviceLog.mapper.DeviceMapper;
 import org.jeecg.modules.deviceLog.service.IDeviceLogService;
 import org.jeecg.modules.deviceLog.service.IDeviceService;
@@ -27,12 +24,11 @@ public class DeviceServiceImpl implements IDeviceService {
     @Autowired
     DeviceMapper deviceMapper;
 
-    @Autowired
-    IDeviceInformationService deviceInformationService;
-
     @Autowired
     IDeviceLogService deviceLogService;
 
+    @Autowired
+    IDeviceGatherServiceService deviceGatherServiceService;
 
     @Override
     public List<Device> listAll() {
@@ -42,14 +38,13 @@ public class DeviceServiceImpl implements IDeviceService {
     @Override
     public Boolean updateStatus(Device device) {
         boolean update = false;
-        DeviceInformation deviceInformation = deviceInformationService.getById(device.getId());
-        deviceInformation.setStatus(device.getStatus());
-
-        update = deviceInformationService.updateById(deviceInformation);
+        DeviceGatherService deviceGatherService = deviceGatherServiceService.getById(device.getId());
+        deviceGatherService.setStatus(device.getStatus());
+        update = deviceGatherServiceService.updateById(deviceGatherService);
         if (device.getStatus().equals("1")){
-            deviceLogService.save(LogTopic.OPC.STOP,device.getName(),deviceInformation.getDeviceIp());
+            deviceLogService.save(LogTopic.OPC.STOP,device.getName(),deviceGatherService.getDeviceIp());
         }else {
-            deviceLogService.save(LogTopic.OPC.START,device.getName(),deviceInformation.getDeviceIp());
+            deviceLogService.save(LogTopic.OPC.START,device.getName(),deviceGatherService.getDeviceIp());
         }
         return update;
     }
@@ -60,10 +55,10 @@ public class DeviceServiceImpl implements IDeviceService {
         List<Device> devices = deviceMapper.listStop();
         if(!CollectionUtils.isEmpty(devices)){
             devices.forEach(device -> {
-                DeviceInformation deviceInformation = deviceInformationService.getById(device.getId());
-                deviceInformation.setStatus("0");
-                deviceInformationService.updateById(deviceInformation);
-                deviceLogService.save(LogTopic.OPC.START,device.getName(),deviceInformation.getDeviceIp());
+                DeviceGatherService deviceGatherService = deviceGatherServiceService.getById(device.getId());
+                deviceGatherService.setStatus("0");
+                deviceGatherServiceService.updateById(deviceGatherService);
+                deviceLogService.save(LogTopic.OPC.START,device.getName(),deviceGatherService.getDeviceIp());
             });
         }
         return true;

+ 12 - 4
jeecg-module-gather/src/main/java/org/jeecg/modules/watch/OpcGatherWatch.java

@@ -7,7 +7,9 @@ import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.common.entity.LogTopic;
 import org.jeecg.modules.common.enums.EDeviceInformationType;
 import org.jeecg.modules.dataRepository.entity.PointData;
+import org.jeecg.modules.device.entity.DeviceGatherService;
 import org.jeecg.modules.device.entity.DeviceInformation;
+import org.jeecg.modules.device.service.IDeviceGatherServiceService;
 import org.jeecg.modules.device.service.IDeviceInformationService;
 import org.jeecg.modules.deviceConn.opc.utils.OpcUaServerUtils;
 import org.jeecg.modules.deviceLog.service.IDeviceLogService;
@@ -40,6 +42,9 @@ public class OpcGatherWatch {
     @Autowired
     IDeviceInformationService deviceInformationService;
 
+    @Autowired
+    IDeviceGatherServiceService deviceGatherServiceService;
+
     @Autowired
     IDevicePointService devicePointService;
 
@@ -101,8 +106,8 @@ public class OpcGatherWatch {
     //opc数据采集
     public void opc(String freq){
         // 获取所有运行中设备(峰平谷)
-        LambdaQueryWrapper<DeviceInformation> opcquery = new LambdaQueryWrapper<DeviceInformation>().eq(DeviceInformation::getStatus, "0").eq(DeviceInformation::getFreq, freq);
-        List<DeviceInformation> opclist = deviceInformationService.list(opcquery);
+        LambdaQueryWrapper<DeviceGatherService> opcquery = new LambdaQueryWrapper<DeviceGatherService>().eq(DeviceGatherService::getStatus, "0").eq(DeviceGatherService::getFreq, freq);
+        List<DeviceGatherService> opclist = deviceGatherServiceService.list(opcquery);
         //获取当前时间
         Date curentDate = new Date();
         //遍历设备集合
@@ -147,7 +152,10 @@ public class OpcGatherWatch {
                         // 存入采集设备
                         FpgGatherData fpgGatherData = new FpgGatherData();
                         fpgGatherData.setDeviceInformationId(opcConn.getId()); // 设备ID
-                        fpgGatherData.setDeviceRegionId(opcConn.getDeviceRegionId()); // 区域id
+
+                        DeviceInformation deviceInformation = deviceInformationService.getById(opcPoint.getDeviceId());
+
+                        fpgGatherData.setDeviceRegionId(deviceInformation.getDeviceRegionId()); // 区域id
                         fpgGatherData.setDevicePointId(opcPoint.getId()); // 采集点ID
                         fpgGatherData.setCreateTime(curentDate); // 创建时间
                         fpgGatherDataService.addC(fpgGatherData);
@@ -158,7 +166,7 @@ public class OpcGatherWatch {
                 deviceLogService.save(LogTopic.OPC.CONNECTE_ERROR,opcConn.getDeviceTitle(),opcConn.getDeviceIp());
             } finally {
                 //更新数据库设备信息
-                deviceInformationService.updateById(opcConn);
+                deviceGatherServiceService.updateById(opcConn);
                 //关闭连接
                 if(opcUaClient != null) {
                     opcUaClient.disconnect();

+ 6 - 4
jeecg-module-gather/src/main/java/org/jeecg/modules/watch/modBusGatherWatch.java

@@ -5,7 +5,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.common.entity.LogTopic;
 import org.jeecg.modules.dataRepository.entity.PointData;
+import org.jeecg.modules.device.entity.DeviceGatherService;
 import org.jeecg.modules.device.entity.DeviceInformation;
+import org.jeecg.modules.device.service.IDeviceGatherServiceService;
 import org.jeecg.modules.device.service.IDeviceInformationService;
 import org.jeecg.modules.deviceConn.modbus.service.ModbusTcp;
 import org.jeecg.modules.deviceLog.service.IDeviceLogService;
@@ -28,7 +30,7 @@ import java.util.List;
 public class modBusGatherWatch {
 
     @Autowired
-    IDeviceInformationService deviceInformationService;
+    IDeviceGatherServiceService deviceGatherServiceService;
 
     @Autowired
     IDevicePointService devicePointService;
@@ -79,8 +81,8 @@ public class modBusGatherWatch {
     //modbus数据采集
     public void modbus(String freq){
         //获取所有运行中设备
-        LambdaQueryWrapper<DeviceInformation> modquery = new LambdaQueryWrapper<DeviceInformation>().eq(DeviceInformation::getStatus, "0").eq(DeviceInformation::getFreq, freq);
-        List<DeviceInformation> modBusList = deviceInformationService.list(modquery);
+        LambdaQueryWrapper<DeviceGatherService> modquery = new LambdaQueryWrapper<DeviceGatherService>().eq(DeviceGatherService::getStatus, "0").eq(DeviceGatherService::getFreq, freq);
+        List<DeviceGatherService> modBusList = deviceGatherServiceService.list(modquery);
         //获取当前时间
         Date curentDate = new Date();
         //遍历设备集合
@@ -132,7 +134,7 @@ public class modBusGatherWatch {
                 //关闭连接
                 plc.close();
                 //更新数据库设备信息
-                deviceInformationService.updateById(modBus);
+                deviceGatherServiceService.updateById(modBus);
             }
         });
     }

+ 7 - 2
jeecg-module-gather/src/main/java/org/jeecg/modules/watch/s7gatherWatch.java

@@ -6,7 +6,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.common.entity.LogTopic;
 import org.jeecg.modules.dataRepository.entity.PointData;
+import org.jeecg.modules.device.entity.DeviceGatherService;
 import org.jeecg.modules.device.entity.DeviceInformation;
+import org.jeecg.modules.device.service.IDeviceGatherServiceService;
 import org.jeecg.modules.device.service.IDeviceInformationService;
 import org.jeecg.modules.deviceConn.s7.service.S7PLC;
 import org.jeecg.modules.deviceLog.service.IDeviceLogService;
@@ -29,6 +31,9 @@ import java.util.List;
 
 public class s7gatherWatch {
 
+    @Autowired
+    IDeviceGatherServiceService deviceGatherServiceService;
+
     @Autowired
     IDeviceInformationService deviceInformationService;
 
@@ -84,8 +89,8 @@ public class s7gatherWatch {
         //获取当前时间
         Date curentDate = new Date();
         //获取所有运行中设备
-        LambdaQueryWrapper<DeviceInformation> s7Query = new LambdaQueryWrapper<DeviceInformation>().ne(DeviceInformation::getStatus, "1").eq(DeviceInformation::getFreq, freq);
-        List<DeviceInformation> s7List = deviceInformationService.list(s7Query);
+        LambdaQueryWrapper<DeviceGatherService> s7Query = new LambdaQueryWrapper<DeviceGatherService>().ne(DeviceGatherService::getStatus, "1").eq(DeviceGatherService::getFreq, freq);
+        List<DeviceGatherService> s7List = deviceGatherServiceService.list(s7Query);
         //遍历设备集合
         s7List.forEach(s7 -> {
             List<DevicePoint> s7Infos = null;