模板解析功能提交

This commit is contained in:
2023-05-18 16:30:13 +08:00
parent 5c49f0b198
commit a16f49c888
47 changed files with 923 additions and 181 deletions

View File

@@ -26,28 +26,6 @@
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>common-swagger</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -20,11 +20,14 @@ public enum AccessResponseEnum {
MODEL_NO_FIND("A0302", "模板不存在,请先录入模板数据!"),
MESSAGE_TYPE_ERROR("A0303","报文消息类型Type错误!"),
DEV_TYPE_ERROR("A0303","装置类型错误!"),
RESPONSE_ERROR("A0304","装置请求响应错误!"),
DEV_TYPE_NOT_FIND("A0305","装置类型未找到,需要录入!"),
NO_RECEIVE_FROM_DEV("A0306","未收到装置注册响应,请核查!"),
;

View File

@@ -24,7 +24,7 @@ public class AlmDto implements Serializable {
@NotNull(message = "告警事件名称,不为空")
private String name;
@SerializedName("Idx")
@SerializedName("IDX")
@NotNull(message = "告警事件编号,不为空")
private Integer idx;

View File

@@ -26,7 +26,7 @@ public class BmdDto implements Serializable {
@NotNull(message = "数据名称,不为空")
private String name;
@SerializedName("Idx")
@SerializedName("IDX")
@NotNull(message = "数据编号,不为空")
private Integer idx;

View File

@@ -26,7 +26,7 @@ public class CtrlDto implements Serializable {
@NotNull(message = "控制名称,不为空")
private String name;
@SerializedName("Idx")
@SerializedName("IDX")
@NotNull(message = "控制编号,不为空")
private Integer idx;
@@ -52,7 +52,7 @@ public class CtrlDto implements Serializable {
@SerializedName("Ctlvalue")
@ApiModelProperty("参数为enum时可设置的所有值序列")
private Integer ctlValue;
private List<String> ctlValue;
@SerializedName("Strlen")
@ApiModelProperty("参数string可设置字符串的长度上限")

View File

@@ -24,7 +24,7 @@ public class DoDto implements Serializable {
@NotNull(message = "开出信号名称,不为空")
private String name;
@SerializedName("Idx")
@SerializedName("IDX")
@NotNull(message = "DO编号,不为空")
private Integer idx;

View File

@@ -26,7 +26,7 @@ public class EpdPqdDto implements Serializable {
@NotNull(message = "数据名称,不为空")
private String name;
@SerializedName("Idx")
@SerializedName("IDX")
@NotNull(message = "数据编号,不为空")
private Integer idx;

View File

@@ -25,7 +25,7 @@ public class EvtDto implements Serializable {
@NotNull(message = "事件信息名称,不为空")
private String name;
@SerializedName("Idx")
@SerializedName("IDX")
@NotNull(message = "事件编号,不为空")
private Integer idx;

View File

@@ -26,7 +26,7 @@ public class ParmDto implements Serializable {
@NotNull(message = "参数名称,不为空")
private String name;
@SerializedName("Idx")
@SerializedName("IDX")
@NotNull(message = "参数编号,不为空")
private Integer idx;

View File

@@ -25,7 +25,7 @@ public class SetDto implements Serializable {
@NotNull(message = "参数名称,不为空")
private String name;
@SerializedName("Idx")
@SerializedName("IDX")
@NotNull(message = "参数编号,不为空")
private Integer idx;

View File

@@ -28,7 +28,7 @@ public class ClDevDto implements Serializable {
@SerializedName("DataList")
@NotEmpty(message = "数据模型列表,不可为空")
private List<DataArrayDto> dataList;
private List<DevModDataListDto> dataList;
@SerializedName("DataSet")
@NotEmpty(message = "数据集序列,不可为空")

View File

@@ -0,0 +1,77 @@
package com.njcn.access.pojo.dto.devModel;
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
import com.njcn.access.pojo.dto.data.*;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2023/5/16 15:27
*/
@Data
public class DevModDataListDto implements Serializable {
@SerializedName("SoftInfo")
@NotEmpty(message = "软件信息,不可为空")
private SoftInfoDto softInfoDto;
@SerializedName("LdevInfo")
@NotEmpty(message = "设备信息,不可为空")
private List<LDevInfoDto> lDevInfoDto;
@SerializedName("Epd")
@NotEmpty(message = "电能数据,不可为空")
private List<EpdPqdDto> epdDto;
@SerializedName("Pqd")
@NotEmpty(message = "电能质量数据,不可为空")
private List<EpdPqdDto> pqdDto;
@SerializedName("Bmd")
@NotEmpty(message = "基础测量数据,不可为空")
private List<BmdDto> bmdDto;
@SerializedName("Evt")
@NotEmpty(message = "事件,不可为空")
private List<EvtDto> evtDto;
@SerializedName("Alm")
@NotEmpty(message = "告警,不可为空")
private List<AlmDto> almDto;
@SerializedName("Sts")
@NotEmpty(message = "状态,不可为空")
private List<StsDto> stsDto;
@SerializedName("Di")
@NotEmpty(message = "开入,不可为空")
private List<DiDto> diDto;
@SerializedName("Do")
@NotEmpty(message = "开出,不可为空")
private List<DoDto> doDto;
@SerializedName("Parm")
@NotEmpty(message = "参数,不可为空")
private List<ParmDto> parmDto;
@SerializedName("Set")
@NotEmpty(message = "定值,不可为空")
private List<SetDto> setDto;
@SerializedName("InSet")
@NotEmpty(message = "内部定值,不可为空")
private List<InSetDto> inSetDto;
@SerializedName("Ctrl")
@NotEmpty(message = "控制,不可为空")
private List<CtrlDto> ctrlDto;
}

View File

@@ -32,7 +32,7 @@ public class DevModDto implements Serializable {
@SerializedName("DataList")
@NotEmpty(message = "数据模型列表,不可为空")
private List<Object> dataList;
private List<DevModDataListDto> dataList;
@SerializedName("DataSet")
@NotEmpty(message = "数据集,不可为空")

View File

@@ -15,7 +15,7 @@ import java.io.Serializable;
* @createTime 2023/5/4 10:04
*/
@Data
public class LdevInfoDto implements Serializable {
public class LDevInfoDto implements Serializable {
@SerializedName("OpAttr")
@NotEmpty(message = "读写操作属性,不可为空")

View File

@@ -0,0 +1,27 @@
package com.njcn.access.pojo.dto.devModel;
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2023/5/16 15:27
*/
@Data
public class NetDevModDataListDto implements Serializable {
@SerializedName("SoftInfo")
@NotEmpty(message = "软件信息,不可为空")
private SoftInfoDto softInfoDto;
@SerializedName("PrjInfo")
@NotEmpty(message = "工程信息,不可为空")
private PrjInfoDto prjInfoDto;
}

View File

@@ -31,5 +31,5 @@ public class NetDevModDto implements Serializable {
@SerializedName("DataList")
@NotEmpty(message = "数据模型列表,不可为空")
private List<Object> dataList;
private List<NetDevModDataListDto> dataList;
}

View File

@@ -0,0 +1,43 @@
package com.njcn.access.pojo.dto.devModel;
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2023/5/16 15:30
*/
@Data
public class PrjInfoDto implements Serializable {
@SerializedName("OpAttr")
@NotEmpty(message = "读写操作属性不可为空")
private String opAttr;
@SerializedName("Province")
@NotEmpty(message = "安装区域省,不可为空")
private String province;
@SerializedName("City")
@NotEmpty(message = "安装区域市,不可为空")
private String city;
@SerializedName("County")
@NotEmpty(message = "安装区域县或区,不可为空")
private String county;
@SerializedName("Address")
@NotEmpty(message = "安装地址(厂区或变电站),不可为空")
private String address;
@SerializedName("Position")
@NotEmpty(message = "安装位置,不可为空")
private String position;
}

View File

@@ -1,6 +1,7 @@
package com.njcn.access.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.Data;
/**
@@ -19,6 +20,7 @@ public class CsBmdPO {
private String id;
@MppMultiId(value = "name")
private String name;
private String anotherName;
@@ -29,6 +31,7 @@ public class CsBmdPO {
private String unit;
@MppMultiId(value = "phase")
private String phase;
private String classId;
@@ -37,4 +40,6 @@ public class CsBmdPO {
private String tranRule;
private String opAttr;
}

View File

@@ -1,6 +1,10 @@
package com.njcn.access.pojo.po;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
import lombok.Data;
/**
@@ -17,26 +21,40 @@ public class CsEpdPqdPO {
private static final long serialVersionUID = 1L;
private String id;
@MppMultiId(value = "name")
private String name;
private String anotherName;
private Integer idx;
private String type;
@MppMultiId(value = "phase")
private String phase;
@TableField(value = "id")
private String id;
@TableField(value = "another_name")
private String anotherName;
@TableField(value = "idx")
private Integer idx;
@TableField(value = "type")
private String type;
@TableField(value = "unit")
private String unit;
@TableField(value = "harm_start")
private Integer harmStart;
@TableField(value = "harm_end")
private Integer harmEnd;
@TableField(value = "class_id")
private String classId;
@TableField(value = "stat_method")
private String statMethod;
@TableField(value = "op_attr")
private String opAttr;
}

View File

@@ -0,0 +1,60 @@
package com.njcn.access.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDate;
/**
* <p>
* 联网设备表
* </p>
*
* @author xuyang
* @since 2023-05-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("cs_net_dev")
public class CsNetDevPO extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 装置型号
*/
private String devType;
private LocalDate time;
/**
* 版本号
*/
private String version;
/**
* 系统软件表Id
*/
private String softInfoId;
/**
* 工程配置表Id
*/
private String prjInfoId;
/**
* 状态
*/
private Integer status;
}

View File

@@ -0,0 +1,57 @@
package com.njcn.access.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 工程信息表
* </p>
*
* @author xuyang
* @since 2023-05-17
*/
@Getter
@Setter
@TableName("cs_prj_info")
public class CsPrjInfoPO extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
/**
* 读写操作属性“r”
*/
private String opAttr;
/**
* 安装区域省
*/
private String province;
/**
* 安装区域省
*/
private String city;
/**
* 安装区域县或区
*/
private String county;
/**
* 安装地址(厂区或变电站)
*/
private String address;
/**
* 安装位置
*/
private String position;
}

View File

@@ -0,0 +1,62 @@
package com.njcn.access.pojo.po;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* <p>
* 系统软件表
* </p>
*
* @author xuyang
* @since 2023-05-17
*/
@Data
@TableName("cs_soft_info")
public class CsSoftInfoPO extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
/**
* 读写操作属性“r”
*/
private String opAttr;
/**
* 操作系统名称裸机系统填Null
*/
private String osName;
/**
* 操作系统版本裸机系统填Null
*/
private String osVersion;
/**
* 应用程序版本号
*/
private String appVersion;
/**
* 应用程序发布日期
*/
private LocalDateTime appDate;
/**
* 应用程序校验码
*/
private String appCheck;
/**
* 是否支持远程升级程序
*/
private String softUpdate;
}