From 2d8c6152104584fb3a7538f8d4f51f163ff5d70c Mon Sep 17 00:00:00 2001 From: litao Date: Tue, 23 Aug 2022 13:31:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/springblade/iot/entry/Sensor.java | 20 ++++++ .../springblade/iot/entry/SensorAlert.java | 70 +++++++++++++++++++ .../springblade/iot/entry/SensorHistory.java | 69 ++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/SensorAlert.java create mode 100644 lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/SensorHistory.java diff --git a/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/Sensor.java b/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/Sensor.java index 6854844..71ccb25 100644 --- a/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/Sensor.java +++ b/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/Sensor.java @@ -17,6 +17,7 @@ package org.springblade.iot.entry; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; @@ -24,6 +25,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import org.springframework.data.annotation.Id; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; @@ -40,21 +42,39 @@ import java.time.LocalDateTime; @ApiModel(value = "Sensor对象", description = "数采配置") public class Sensor extends BaseEntity { + @TableId + private Long id; + @ApiModelProperty(value = "传感器名称") private String name; @ApiModelProperty(value = "plc设备的ip") private String ip; + @ApiModelProperty(value = "房间号") + private String roomNumber; + + @ApiModelProperty(value = "预警值") + private String warningValue; + @ApiModelProperty(value = "信息名称(如:302更衣室压差)") private String signalName; + private String type; + @ApiModelProperty(value = "数据类型(REAL->float)") private String dataType; @ApiModelProperty(value = "寄存器地址") private String registerAddress; + @ApiModelProperty(value = "开始索引") + private Integer startIndex; + + @ApiModelProperty(value = "数据长度") + private Integer dataLength; + + @TableField(exist = false) @ApiModelProperty(value = "单前的实时数据") private String currData; diff --git a/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/SensorAlert.java b/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/SensorAlert.java new file mode 100644 index 0000000..b40be86 --- /dev/null +++ b/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/SensorAlert.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.iot.entry; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +/** + * 数采配置实报警体类 + * + * @author swj + * @since 2022年8月17日16:29:15 + */ +@Data +@TableName("t_sensor_alert") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "Sensor报警对象", description = "数采配置") +public class SensorAlert extends BaseEntity { + + @ApiModelProperty(value = "传感器名称") + private String name; + + @ApiModelProperty(value = "plc设备的ip") + private String ip; + + @ApiModelProperty(value = "房间号") + private String roomNumber; + + @ApiModelProperty(value = "信息名称(如:302更衣室压差)") + private String signalName; + + @ApiModelProperty(value = "报警类型") + private String type; + + @ApiModelProperty(value = "数据类型(REAL->float)") + private String dataType; + + @ApiModelProperty(value = "寄存器地址") + private String registerAddress; + + @ApiModelProperty(value = "开始索引") + private Integer startIndex; + + @ApiModelProperty(value = "数据长度") + private Integer dataLength; + + @ApiModelProperty(value = "是否已读") + private Integer isRead; + + private static final long serialVersionUID = 1L; +} diff --git a/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/SensorHistory.java b/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/SensorHistory.java new file mode 100644 index 0000000..cf88879 --- /dev/null +++ b/lab-service-api/lab-iot-api/src/main/java/org/springblade/iot/entry/SensorHistory.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.iot.entry; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +/** + * 数采配置实体类 + * + * @author swj + * @since 2022年8月17日16:29:15 + */ +@Data +@TableName("t_sensor_history") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "Sensor历史对象", description = "数采配置历史") +public class SensorHistory extends BaseEntity { + + @ApiModelProperty(value = "传感器名称") + private String name; + + @ApiModelProperty(value = "plc设备的ip") + private String ip; + + @ApiModelProperty(value = "房间号") + private String roomNumber; + + @ApiModelProperty(value = "信息名称(如:302更衣室压差)") + private String signalName; + + private String type; + + @ApiModelProperty(value = "数据类型(REAL->float)") + private String dataType; + + @ApiModelProperty(value = "寄存器地址") + private String registerAddress; + + @ApiModelProperty(value = "开始索引") + private Integer startIndex; + + @ApiModelProperty(value = "数据长度") + private Integer dataLength; + + @ApiModelProperty(value = "单前的实时数据") + private String currData; + + private static final long serialVersionUID = 1L; +}