Browse Source

环境监测集成modbus/tcp

王先生 2 years ago
parent
commit
58224a737c

+ 23 - 0
eladmin-system/pom.xml

@@ -93,6 +93,29 @@
             <artifactId>oshi-core</artifactId>
             <version>5.3.6</version>
         </dependency>
+        <dependency>
+            <groupId>com.intelligt.modbus</groupId>
+            <artifactId>jlibmodbus</artifactId>
+            <version>1.2.9.7</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.digitalpetri.modbus</groupId>
+            <artifactId>modbus-master-tcp</artifactId>
+            <version>1.1.0</version>
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>com.infiniteautomation</groupId>-->
+<!--            <artifactId>modbus4j</artifactId>-->
+<!--            <version>3.0.3</version>-->
+<!--            <exclusions>-->
+<!--                <exclusion>-->
+<!--                    <groupId>com.infiniteautomation</groupId>-->
+<!--                    <artifactId>modbus4j</artifactId>-->
+<!--                </exclusion>-->
+<!--            </exclusions>-->
+<!--        </dependency>-->
     </dependencies>
 
     <!-- 打包 -->

+ 8 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dm/modbus/channel/domain/DmModbusChannel.java

@@ -15,6 +15,8 @@
 */
 package me.zhengjie.modules.dm.modbus.channel.domain;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
 import lombok.Data;
 import cn.hutool.core.bean.BeanUtil;
 import io.swagger.annotations.ApiModelProperty;
@@ -32,6 +34,7 @@ import org.hibernate.annotations.*;
 import java.sql.Timestamp;
 import java.io.Serializable;
 import java.util.List;
+import java.util.Set;
 
 /**
 * @website https://el-admin.vip
@@ -47,6 +50,7 @@ public class DmModbusChannel extends BaseEntity implements Serializable {
     @Id
     @Column(name = "channel_id")
     @ApiModelProperty(value = "信道id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long channelId;
 
     @Column(name = "channel_name",nullable = false)
@@ -62,6 +66,7 @@ public class DmModbusChannel extends BaseEntity implements Serializable {
     @Column(name = "baud_rate",nullable = false)
     @NotNull
     @ApiModelProperty(value = "波特率")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long baudRate;
 
     @Column(name = "data_bits",nullable = false)
@@ -87,17 +92,19 @@ public class DmModbusChannel extends BaseEntity implements Serializable {
     @Column(name = "timeout",nullable = false)
     @NotNull
     @ApiModelProperty(value = "超时时间")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long timeout;
 
     @Column(name = "drive_id",nullable = false)
     @NotNull
     @ApiModelProperty(value = "驱动id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long driveId;
 
     @ApiModelProperty(value = "关联的驱动channel_id")
     @OneToMany(fetch = FetchType.LAZY,cascade = {CascadeType.REFRESH})
     @JoinColumn(name = "channel_id")
-    private List<DmModbusDevice> dmModbusDevice;
+    private Set<DmModbusDevice> dmModbusDevice;
 
     public void copy(DmModbusChannel source){
         BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));

+ 2 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dm/modbus/channel/service/dto/DmModbusChannelDto.java

@@ -19,6 +19,7 @@ import lombok.Data;
 import java.sql.Timestamp;
 import java.io.Serializable;
 import java.util.List;
+import java.util.Set;
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.alibaba.fastjson.serializer.ToStringSerializer;
@@ -71,5 +72,5 @@ public class DmModbusChannelDto extends BaseDTO implements Serializable {
     private Long driveId;
 
     /** 关联设备id */
-    private List<DmModbusDevice> dmModbusDevice;
+    private Set<DmModbusDevice> dmModbusDevice;
 }

+ 6 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dm/modbus/data/domain/DmModbusData.java

@@ -15,6 +15,8 @@
 */
 package me.zhengjie.modules.dm.modbus.data.domain;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
 import lombok.Data;
 import cn.hutool.core.bean.BeanUtil;
 import io.swagger.annotations.ApiModelProperty;
@@ -42,6 +44,7 @@ public class DmModbusData extends BaseEntity implements Serializable {
     @Id
     @Column(name = "data_id")
     @ApiModelProperty(value = "数据id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long dataId;
 
     @Column(name = "call_the_roll",nullable = false)
@@ -49,7 +52,7 @@ public class DmModbusData extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "采集端(硬件)点名")
     private String callTheRoll;
 
-    @Column(name = "describe")
+    @Column(name = "data_describe")
     @ApiModelProperty(value = "采集端描述")
     private String describe;
 
@@ -74,6 +77,7 @@ public class DmModbusData extends BaseEntity implements Serializable {
 
     @Column(name = "linear_conversion_id")
     @ApiModelProperty(value = "采集端关联线性转换id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long linearConversionId;
 
     @Column(name = "software_register_type",nullable = false)
@@ -89,6 +93,7 @@ public class DmModbusData extends BaseEntity implements Serializable {
     @Column(name = "group_id",nullable = false)
     @NotNull
     @ApiModelProperty(value = "转发端(软件)寄存器地址")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long groupId;
 
     public void copy(DmModbusData source){

+ 13 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dm/modbus/device/domain/DmModbusDevice.java

@@ -15,6 +15,8 @@
 */
 package me.zhengjie.modules.dm.modbus.device.domain;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
 import lombok.Data;
 import cn.hutool.core.bean.BeanUtil;
 import io.swagger.annotations.ApiModelProperty;
@@ -32,6 +34,7 @@ import org.hibernate.annotations.*;
 import java.sql.Timestamp;
 import java.io.Serializable;
 import java.util.List;
+import java.util.Set;
 
 /**
 * @website https://el-admin.vip
@@ -47,6 +50,7 @@ public class DmModbusDevice extends BaseEntity implements Serializable {
     @Id
     @Column(name = "device_id")
     @ApiModelProperty(value = "设备id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long deviceId;
 
     @Column(name = "device_name",nullable = false)
@@ -57,21 +61,25 @@ public class DmModbusDevice extends BaseEntity implements Serializable {
     @Column(name = "salve_station_number",nullable = false)
     @NotNull
     @ApiModelProperty(value = "从站站号")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long salveStationNumber;
 
     @Column(name = "station_number",nullable = false)
     @NotNull
     @ApiModelProperty(value = "采集通讯站号")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long stationNumber;
 
     @Column(name = "Request_frame_interval",nullable = false)
     @NotNull
     @ApiModelProperty(value = "采集通讯请求帧间隔(毫秒)")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long requestFrameInterval;
 
     @Column(name = "write_value_refresh_interval",nullable = false)
     @NotNull
     @ApiModelProperty(value = "采集通讯写值刷新间隔(毫秒)")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long writeValueRefreshInterval;
 
     @Column(name = "two_byte_int_order",nullable = false)
@@ -97,27 +105,31 @@ public class DmModbusDevice extends BaseEntity implements Serializable {
     @Column(name = "analog_quantity_group_packet_max_length",nullable = false)
     @NotNull
     @ApiModelProperty(value = "批量传输模拟量组包最大长度")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long analogQuantityGroupPacketMaxlength;
 
     @Column(name = "digital_quantity_group_packet_interval",nullable = false)
     @NotNull
     @ApiModelProperty(value = "批量传输数字量组包间隔")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long digitalQuantityGroupPacketInterval;
 
     @Column(name = "digital_quantity_group_packet_max_length",nullable = false)
     @NotNull
     @ApiModelProperty(value = "批量传输数字量组包最大长度")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long digitalQuantityGroupPacketMaxlength;
 
     @Column(name = "channel_id",nullable = false)
     @NotNull
     @ApiModelProperty(value = "信道id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long channelId;
 
     @ApiModelProperty(value = "关联的分组")
     @OneToMany(fetch = FetchType.LAZY,cascade = {CascadeType.REFRESH})
     @JoinColumn(name = "device_id")
-    private List<DmModbusGroup> dmModbusGroup;
+    private Set<DmModbusGroup> dmModbusGroup;
 
     public void copy(DmModbusDevice source){
         BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));

+ 2 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dm/modbus/device/service/dto/DmModbusDeviceDto.java

@@ -19,6 +19,7 @@ import lombok.Data;
 import java.sql.Timestamp;
 import java.io.Serializable;
 import java.util.List;
+import java.util.Set;
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.alibaba.fastjson.serializer.ToStringSerializer;
@@ -88,5 +89,5 @@ public class DmModbusDeviceDto extends BaseDTO implements Serializable {
     private Long channelId;
 
     /** 关联的分组 */
-    private List<DmModbusGroup> dmModbusGroup;
+    private Set<DmModbusGroup> dmModbusGroup;
 }

+ 8 - 2
eladmin-system/src/main/java/me/zhengjie/modules/dm/modbus/drive/domain/DmModbusDrive.java

@@ -15,11 +15,14 @@
 */
 package me.zhengjie.modules.dm.modbus.drive.domain;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
 import lombok.Data;
 import cn.hutool.core.bean.BeanUtil;
 import io.swagger.annotations.ApiModelProperty;
 import cn.hutool.core.bean.copier.CopyOptions;
 import javax.persistence.*;
+import javax.persistence.CascadeType;
 import javax.validation.constraints.*;
 import javax.persistence.Entity;
 import javax.persistence.Table;
@@ -30,6 +33,7 @@ import org.hibernate.annotations.*;
 import java.sql.Timestamp;
 import java.io.Serializable;
 import java.util.List;
+import java.util.Set;
 
 /**
 * @website https://el-admin.vip
@@ -45,6 +49,7 @@ public class DmModbusDrive extends BaseEntity implements Serializable {
     @Id
     @Column(name = "drive_id")
     @ApiModelProperty(value = "驱动id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long driveId;
 
     @Column(name = "drive_name",nullable = false)
@@ -60,11 +65,12 @@ public class DmModbusDrive extends BaseEntity implements Serializable {
     @Column(name = "poll_time",nullable = false)
     @NotNull
     @ApiModelProperty(value = "轮询时间(毫秒)")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long pollTime;
 
-    @OneToMany(fetch = FetchType.LAZY)
+    @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH})
     @JoinColumn(name = "drive_id")
-    private List<DmModbusChannel> channels;
+    private Set<DmModbusChannel> channels;
 
     public void copy(DmModbusDrive source){
         BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));

+ 3 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dm/modbus/drive/service/dto/DmModbusDriveDto.java

@@ -19,6 +19,7 @@ import lombok.Data;
 import java.sql.Timestamp;
 import java.io.Serializable;
 import java.util.List;
+import java.util.Set;
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.alibaba.fastjson.serializer.ToStringSerializer;
@@ -46,7 +47,8 @@ public class DmModbusDriveDto extends BaseDTO implements Serializable {
     private String name;
 
     /** 轮询时间(毫秒) */
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long pollTime;
     /** 关联的信道  */
-    private List<DmModbusChannel> channels;
+    private Set<DmModbusChannel> channels;
 }

+ 5 - 1
eladmin-system/src/main/java/me/zhengjie/modules/dm/modbus/group/domain/DmModbusGroup.java

@@ -15,6 +15,8 @@
 */
 package me.zhengjie.modules.dm.modbus.group.domain;
 
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
 import lombok.Data;
 import cn.hutool.core.bean.BeanUtil;
 import io.swagger.annotations.ApiModelProperty;
@@ -47,6 +49,7 @@ public class DmModbusGroup extends BaseEntity implements Serializable {
     @Id
     @Column(name = "group_id")
     @ApiModelProperty(value = "组id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long groupId;
 
     @Column(name = "group_name",nullable = false)
@@ -57,10 +60,11 @@ public class DmModbusGroup extends BaseEntity implements Serializable {
     @Column(name = "device_id",nullable = false)
     @NotNull
     @ApiModelProperty(value = "设备关联id")
+    @JSONField(serializeUsing = ToStringSerializer.class)
     private Long deviceId;
 
     @ApiModelProperty(value = "通过分组id关联数据")
-    @OneToMany(fetch = FetchType.LAZY,cascade = {CascadeType.REFRESH})
+    @OneToMany(fetch = FetchType.EAGER,cascade = {CascadeType.REFRESH})
     @JoinColumn(name = "group_id")
     private List<DmModbusData> dmModbusData;
 

+ 264 - 0
eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ModbusTask.java

@@ -0,0 +1,264 @@
+/**
+ * Copyright (C), 2022-05-23
+ * FileName: ModbusTaxk
+ * Author:   wanglongda
+ * Date:     2022/5/23 17:14
+ * Description: modbus定时任务
+ */
+package me.zhengjie.modules.quartz.task;/**
+ * Created Name: wanglongda
+ * Created Time: 2022/5/23 17:14
+ * Description: iot-ykt
+ */
+
+import com.digitalpetri.modbus.codec.Modbus;
+import com.digitalpetri.modbus.master.ModbusTcpMaster;
+import com.digitalpetri.modbus.master.ModbusTcpMasterConfig;
+import com.digitalpetri.modbus.requests.ReadCoilsRequest;
+import com.digitalpetri.modbus.requests.ReadDiscreteInputsRequest;
+import com.digitalpetri.modbus.requests.ReadHoldingRegistersRequest;
+import com.digitalpetri.modbus.requests.ReadInputRegistersRequest;
+import com.digitalpetri.modbus.responses.ReadCoilsResponse;
+import com.digitalpetri.modbus.responses.ReadDiscreteInputsResponse;
+import com.digitalpetri.modbus.responses.ReadHoldingRegistersResponse;
+import com.digitalpetri.modbus.responses.ReadInputRegistersResponse;
+import io.netty.buffer.ByteBuf;
+import io.netty.util.ReferenceCountUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.zhengjie.modules.dm.modbus.channel.domain.DmModbusChannel;
+import me.zhengjie.modules.dm.modbus.data.domain.DmModbusData;
+import me.zhengjie.modules.dm.modbus.device.domain.DmModbusDevice;
+import me.zhengjie.modules.dm.modbus.drive.domain.DmModbusDrive;
+import me.zhengjie.modules.dm.modbus.drive.service.DmModbusDriveService;
+import me.zhengjie.modules.dm.modbus.drive.service.dto.DmModbusDriveDto;
+import me.zhengjie.modules.dm.modbus.group.domain.DmModbusGroup;
+import me.zhengjie.modules.system.repository.UserRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.InitBinder;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+
+/**
+ * <功能简要> <br>
+ * <modbus定时任务>
+ *
+ * @Author wanglongda
+ * @createTime 2022/5/23 17:14
+ * @Version 1.0.0
+ */
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class ModbusTask {
+
+    private final DmModbusDriveService dmModbusDriveService;
+    @Value("${modbusUrl}")
+    private String modbusUrl; // modbus默认地址
+    private final int modbusPort = 502; // modbus默认端口号
+    private final int modbusSalveId = 1;  //modbus默认从机地址
+    private static ModbusTcpMaster master;
+
+    /**
+     * 获取TCP协议的Master
+     *
+     * @return
+     */
+    @PostConstruct
+    public void init() {
+        if (master == null) {
+            // 创建配置
+            ModbusTcpMasterConfig config = new ModbusTcpMasterConfig.Builder(modbusUrl).setPort(modbusPort).build();
+            master = new ModbusTcpMaster(config);
+        }
+    }
+
+    public void  gainModbusData(){
+
+        try {
+            /**
+             * 根据sql查询所有总集合
+             */
+            List<DmModbusDriveDto> dmModbusDriveDtos = dmModbusDriveService.queryAll(null);
+           //进行遍历
+            dmModbusDriveDtos.forEach(drive->{
+                /**
+                 * 获取所有的信道集合  channels.size>0 进行遍历
+                 */
+                 Set<DmModbusChannel> channels = drive.getChannels();
+                if (!channels.isEmpty()){
+                    channels.forEach(channel->{
+                        /**
+                         * 获取信道下的所有设备集合  dmModbusDevice.size>0 进行遍历
+                         */
+                        Set<DmModbusDevice> dmModbusDevice = channel.getDmModbusDevice();
+                        if (!dmModbusDevice.isEmpty()){
+                            dmModbusDevice.forEach(device->{
+                                /**
+                                 * 获取设备下的所有分组 dmModbusGroup.size>0 进行遍历
+                                 */
+                                 Set<DmModbusGroup> dmModbusGroup = device.getDmModbusGroup();
+                                 if (!dmModbusGroup.isEmpty()){
+                                     dmModbusGroup.forEach(group->{
+                                         /**
+                                          * 获取分组下的所有所有数据  dmModbusData.size>0 进行遍历
+                                          */
+                                          List<DmModbusData> dmModbusData = group.getDmModbusData();
+                                          if (!dmModbusData.isEmpty()){
+
+                                          }
+                                     });
+                                 }
+                            });
+                        }
+                    });
+                }
+            });
+
+            log.info(dmModbusDriveDtos.toString());
+        }catch (Exception e){
+            log.error("modbus获取失败,失败原因:{}",e.getMessage());
+        }
+
+
+    }
+
+
+
+    /***
+     * 释放资源
+     */
+    @PreDestroy
+    public  void release() {
+        if (master != null) {
+            master.disconnect();
+        }
+        Modbus.releaseSharedResources();
+    }
+
+    /**
+     * 读取Coils开关量
+     *
+     * @param address
+     *            寄存器开始地址
+     * @param quantity
+     *            数量
+     * @param unitId
+     *            ID
+     * @return 读取值
+     * @throws InterruptedException
+     *             异常
+     * @throws ExecutionException
+     *             异常
+     */
+    public  Boolean readCoils(int address, int quantity, int unitId)
+            throws InterruptedException, ExecutionException {
+        Boolean result = null;
+        CompletableFuture<ReadCoilsResponse> future = master.sendRequest(new ReadCoilsRequest(address, quantity),
+                unitId);
+        ReadCoilsResponse readCoilsResponse = future.get();// 工具类做的同步返回.实际使用推荐结合业务进行异步处理
+        if (readCoilsResponse != null) {
+            ByteBuf buf = readCoilsResponse.getCoilStatus();
+            result = buf.readBoolean();
+            ReferenceCountUtil.release(readCoilsResponse);
+        }
+        return result;
+    }
+
+    /**
+     * 读取readDiscreteInputs开关量
+     *
+     * @param address
+     *            寄存器开始地址
+     * @param quantity
+     *            数量
+     * @param unitId
+     *            ID
+     * @return 读取值
+     * @throws InterruptedException
+     *             异常
+     * @throws ExecutionException
+     *             异常
+     */
+    public  Boolean readDiscreteInputs(int address, int quantity, int unitId)
+            throws InterruptedException, ExecutionException {
+        Boolean result = null;
+        CompletableFuture<ReadDiscreteInputsResponse> future = master
+                .sendRequest(new ReadDiscreteInputsRequest(address, quantity), unitId);
+        ReadDiscreteInputsResponse discreteInputsResponse = future.get();// 工具类做的同步返回.实际使用推荐结合业务进行异步处理
+        if (discreteInputsResponse != null) {
+            ByteBuf buf = discreteInputsResponse.getInputStatus();
+            result = buf.readBoolean();
+            ReferenceCountUtil.release(discreteInputsResponse);
+        }
+        return result;
+    }
+
+    /**
+     * 读取HoldingRegister数据
+     *
+     * @param address
+     *            寄存器地址
+     * @param quantity
+     *            寄存器数量
+     * @param unitId
+     *            id
+     * @return 读取结果
+     * @throws InterruptedException
+     *             异常
+     * @throws ExecutionException
+     *             异常
+     */
+    public static Number readHoldingRegisters(int address, int quantity, int unitId)
+            throws InterruptedException, ExecutionException {
+        Number result = null;
+        CompletableFuture<ReadHoldingRegistersResponse> future = master
+                .sendRequest(new ReadHoldingRegistersRequest(address, quantity), unitId);
+        ReadHoldingRegistersResponse readHoldingRegistersResponse = future.get();// 工具类做的同步返回.实际使用推荐结合业务进行异步处理
+        if (readHoldingRegistersResponse != null) {
+            ByteBuf buf = readHoldingRegistersResponse.getRegisters();
+            result = buf.readFloat();
+            ReferenceCountUtil.release(readHoldingRegistersResponse);
+        }
+        return result;
+    }
+
+    /**
+     * 读取InputRegisters模拟量数据
+     *
+     * @param address
+     *            寄存器开始地址
+     * @param quantity
+     *            数量
+     * @param unitId
+     *            ID
+     * @return 读取值
+     * @throws InterruptedException
+     *             异常
+     * @throws ExecutionException
+     *             异常
+     */
+    public static Number readInputRegisters(int address, int quantity, int unitId)
+            throws InterruptedException, ExecutionException {
+        Number result = null;
+        CompletableFuture<ReadInputRegistersResponse> future = master
+                .sendRequest(new ReadInputRegistersRequest(address, quantity), unitId);
+        ReadInputRegistersResponse readInputRegistersResponse = future.get();// 工具类做的同步返回.实际使用推荐结合业务进行异步处理
+        if (readInputRegistersResponse != null) {
+            ByteBuf buf = readInputRegistersResponse.getRegisters();
+            result = buf.readDouble();
+            ReferenceCountUtil.release(readInputRegistersResponse);
+        }
+        return result;
+    }
+
+
+}

+ 2 - 30
eladmin-system/src/main/resources/application.properties

@@ -1,36 +1,8 @@
-#CardRecordTask
-expenseUrl=https://smartpark.caih.com/dxapi/dxtop/dish/page
-rechargeUrl=https://smartpark.caih.com/dxapi/dxtop/charge/page
 #ZkDataSyncTask
 zkApiUrl=https://smartpark.caih.com/zkxt
 key=DMERPYT!@#$QWER2021+{:>
 headerKey=XYTACCESSTOKEN
 deptApi=/api/thirdparty/v1/user/getzkdeps
 userApi=/api/thirdparty/v1/user/getZkSysUsers
-#AccessDataTask
-accessUrl=http://47.103.9.22:8069/openapi/getHistoryRecord
-#LaneDataTask
-laneUrl=http://10.208.128.14:9999/api/park/getlane
-#PlateTrafficTask || DmVisitorsApplyServiceImpl || DmPlateNumberServiceImpl
-yueUrl=http://10.208.128.14:9999/api/park/addmonthlycar
-deleteYueUrl=http://10.208.128.14:9999/api/park/deletecar
-mfUrl=http://10.208.128.14:9999/api/park/addfreecar
-#PlateTrafficTask
-plateUrl=http://10.208.128.14:9999/api/park/getparkrecord
-#DmVisitorsApplyServiceImpl
-erCodeUrl=http://10.208.128.14:8069/viscustom/yongTianDongXin/add
-#RoomDeviceTask
-deviceUrl=http://10.208.128.14:8069/openapi/getDoorList
-#DmPlateNumberServiceImpl
-messageUrl=https://smartpark.caih.com/zkxt/api/thirdparty/v1/message/sendChatMessage
-#DmCardServiceImpl
-zkUpdateUrl=https://smartpark.caih.com/zkxt/api/thirdparty/v1/user/updateZkUsers
-personOperate=http://10.208.128.14:8069/openapi/personOperate
-#OpenApiController
-AccessTraffic=http://10.208.128.14:8069/openapi/SetPushRecCallBack?callbackURL=https://smartpark.caih.com/ykt/api/thirdparty/v1/openInterface/callbackAccessTraffic
-#同步设备权限
-synchronizationDeviceUrl=http://10.208.128.14:8069/openapi/devicePermissionOperate
-#同步设备权限
-getDeviceUrl=http://10.208.128.14:8069/openapi/getDoorPermission
-#员工离职时删除的设备
-deviceInfo=5L18X090516,5L18X090270,5L18X090270,5L18X090446,5L07X130045,5L18X090209,5L18X090118,5L18X090196
+# modbus地址
+modbusUrl = 10.208.0.37