From 5487c165ff9ec0abebba8e04d31e8a8682ae4349 Mon Sep 17 00:00:00 2001 From: "jimmy.zeng" Date: Thu, 29 Oct 2020 13:22:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=9011883=2020021--=E5=8C=97=E7=BE=8E?= =?UTF-8?q?=E9=A2=86=E6=96=99=E9=9C=80=E6=B1=82=E5=8F=98=E6=9B=B4--1023?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/WmsEnumUtil.java | 49 ++++++++++ .../java/cn/estsh/i3plus/pojo/wms/bean/WmsPlc.java | 100 +++++++++++++++++++++ .../pojo/wms/repository/WmsPlcRepository.java | 16 ++++ 3 files changed, 165 insertions(+) create mode 100644 modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPlc.java create mode 100644 modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsPlcRepository.java diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/WmsEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/WmsEnumUtil.java index cdd8873..c6deb39 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/WmsEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/WmsEnumUtil.java @@ -9243,4 +9243,53 @@ public class WmsEnumUtil { return valueOf(val); } } + + /** + * PLC业务类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PLC_BUSI_TYPE { + DR(10, "DR", "DR"), + DF(20, "DF", "DF"), + IP(30, "IP", "IP"); + + private int value; + private String code; + private String description; + + PLC_BUSI_TYPE(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public String getCode() { + return code; + } + + public static String valueOf(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static String valueOfDescription(int val) { + return valueOf(val); + } + } } + + + diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPlc.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPlc.java new file mode 100644 index 0000000..b2d9ee2 --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPlc.java @@ -0,0 +1,100 @@ +package cn.estsh.i3plus.pojo.wms.bean; + +import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn; +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiParam; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * @Description : + * @Reference : + * @Author : jimmy.zeng + * @CreateDate : 2020-10-28 9:54 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name = "WMS_PLC") +@Api("WMSPLC配置表") +public class WmsPlc extends BaseBean { + + @Column(name = "PLC_CODE") + @ApiParam("PLC代码") + private String plcCode; + + @Column(name = "PLC_NAME") + @ApiParam("PLC名称") + private String plcName; + + @Column(name = "BUSI_TYPE") + @ApiParam("业务类型") + @AnnoOutputColumn(refClass = WmsEnumUtil.PLC_BUSI_TYPE.class) + private Integer busiType; + + @Column(name = "OPC_URL") + @ApiParam("OPC路径") + private String opcUrl; + + @Column(name = "CHANNEL") + @ApiParam("通道") + private String channel; + + @Column(name = "DEVICE") + @ApiParam("终端") + private String device; + + @Column(name = "TAG_NAME") + @ApiParam("标签名称") + private String tagName; + + @Column(name = "TAG_ADDRESS") + @ApiParam("标签地址") + private String tagAddress; + + @Column(name = "DATA_TYPE") + @ApiParam("标签数据类型") + private String dataType; + + /*@Column(name = "DATA_TYPE") + @ApiParam("标签类别") + private Integer dataType;*/ + + @Column(name = "USER_NAME") + @ApiParam("用户名") + private String userName; + + @Column(name = "PASSWORD") + @ApiParam("密码") + private String password; + + @Column(name = "START_VALUE") + @ApiParam("开始节点") + private Integer startValue; + + @Column(name = "end_VALUE") + @ApiParam("结束节点") + private Integer endValue; + + @Column(name = "NAME_SPACE_INDEX") + @ApiParam("空间索引") + private Integer nameSpaceIndex = 2; + + @Column(name = "REQUEST_INTERVAL") + @ApiParam("请求间隔") + private Double requestInterval = 500.0; + + + +} diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsPlcRepository.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsPlcRepository.java new file mode 100644 index 0000000..da8fa53 --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsPlcRepository.java @@ -0,0 +1,16 @@ +package cn.estsh.i3plus.pojo.wms.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.wms.bean.WmsPlc; +import org.springframework.stereotype.Repository; + +/** + * @Description : + * @Reference : + * @Author : jimmy.zeng + * @CreateDate : 2020-10-28 10:47 + * @Modify: + **/ +@Repository +public interface WmsPlcRepository extends BaseRepository { +}