From ce55dda3678e2029a0e3ffe23656f8791e3be580 Mon Sep 17 00:00:00 2001 From: "yihang.lv" Date: Fri, 19 Apr 2019 19:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/SwebEnumUtil.java | 54 +++++++++++++++----- .../cn/estsh/i3plus/pojo/sweb/bean/SwebConfig.java | 59 ++++++++++++++++++++++ .../pojo/sweb/repository/SwebConfigRepository.java | 14 +++++ 3 files changed, 114 insertions(+), 13 deletions(-) create mode 100644 modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/bean/SwebConfig.java create mode 100644 modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/repository/SwebConfigRepository.java diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/SwebEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/SwebEnumUtil.java index 47aba3c..933ccd0 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/SwebEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/SwebEnumUtil.java @@ -16,17 +16,19 @@ public class SwebEnumUtil { */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum ORDER_MASTER_STATUS { - CREATE(10, "新建"), - RECEIPT(20, "已发布"), - SURE(30, "已确认"), - CLOSED(40, "已打印"), - DELIVERY(50, "已发货"); + CREATE(10, "CREATE","新建"), + RECEIPT(20, "RECEIPT","已发布"), + SURE(30, "SURE","已确认"), + PRINTED(40, "PRINTED","已打印"), + DELIVERY(50, "DELIVERY","已发货"); private int value; + private String code; private String description; - ORDER_MASTER_STATUS(int value, String description) { + ORDER_MASTER_STATUS(int value, String code, String description) { this.value = value; + this.code = code; this.description = description; } @@ -57,6 +59,16 @@ public class SwebEnumUtil { } return tmp; } + + public static int codeOf(String code) { + int tmp = 1; + for (int i = 0; i < values().length; i++) { + if (values()[i].code.equals(code)) { + tmp = values()[i].value; + } + } + return tmp; + } } /** @@ -64,17 +76,19 @@ public class SwebEnumUtil { */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum ORDER_DETAILS_STATUS { - CREATE(10, "新建"), - RECEIPT(20, "已发布"), - SURE(30, "已确认"), - CLOSED(40, "已打印"), - DELIVERY(50, "已发货"); + CREATE(10, "CREATE","新建"), + RECEIPT(20, "RECEIPT","已发布"), + SURE(30, "SURE","已确认"), + PRINTED(40, "PRINTED","已打印"), + DELIVERY(50, "DELIVERY","已发货"); private int value; + private String code; private String description; - ORDER_DETAILS_STATUS(int value, String description) { + ORDER_DETAILS_STATUS(int value, String code, String description) { this.value = value; + this.code = code; this.description = description; } @@ -82,6 +96,10 @@ public class SwebEnumUtil { return value; } + public String getCode() { + return code; + } + public String getDescription() { return description; } @@ -105,6 +123,16 @@ public class SwebEnumUtil { } return tmp; } + + public static int codeOf(String code) { + int tmp = 1; + for (int i = 0; i < values().length; i++) { + if (values()[i].code.equals(code)) { + tmp = values()[i].value; + } + } + return tmp; + } } /** @@ -146,7 +174,7 @@ public class SwebEnumUtil { @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum ORDER_TYPE { STANDARD(10, "标准包装"), - NON_STANDARD(20, "非标包装"); + NON_STANDARD(20, "非标准包装"); private int value; private String description; diff --git a/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/bean/SwebConfig.java b/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/bean/SwebConfig.java new file mode 100644 index 0000000..ccfef29 --- /dev/null +++ b/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/bean/SwebConfig.java @@ -0,0 +1,59 @@ +package cn.estsh.i3plus.pojo.sweb.bean; + +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +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 : sweb系统配置 + * @Reference : + * @Author : jack.lv + * @CreateDate : 2019-04-19 11:06 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@Table(name = "SWEB_CONFIG") +@Api(value = "系统配置", description = "SWEB系统配置") +public class SwebConfig extends BaseBean { + + @Column(name = "NAME") + @ApiParam(value = "名称") + private String name; + + @Column(name = "CONFIG_TYPE") + @ApiParam(value = "参数类型ID(枚举:1.系统配置...)", example = "-1") + private Integer configType; + + @Column(name = "CONFIG_CODE") + @ApiParam(value = "参数代码") + private String configCode; + + // 枚举 ImppEnumUtil.SYS_CONFIG_GROUP + @Column(name = "CONFIG_GROUP") + @ApiParam(value = "参数组") + private Integer configGroup; + + // 枚举 ImppEnumUtil.SYS_VALUE_TYPE + @Column(name = "CONFIG_VALUE_TYPE") + @ApiParam(value = "参数值类型") + private String configValueType; + + @Column(name = "CONFIG_VALUE") + @ApiParam(value = "参数值") + private String configValue; + + @Column(name = "CONFIG_DESCRIPTION") + @ApiParam(value = "参数描述") + private String configDescription; +} diff --git a/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/repository/SwebConfigRepository.java b/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/repository/SwebConfigRepository.java new file mode 100644 index 0000000..1d9a699 --- /dev/null +++ b/modules/i3plus-pojo-sweb/src/main/java/cn/estsh/i3plus/pojo/sweb/repository/SwebConfigRepository.java @@ -0,0 +1,14 @@ +package cn.estsh.i3plus.pojo.sweb.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.sweb.bean.SwebConfig; + +/** + * @Description :系统配置 dao + * @Reference : + * @Author : jack.lv + * @CreateDate : 2019-04-19 14:51 + * @Modify: + **/ +public interface SwebConfigRepository extends BaseRepository { +}