From 7b727e5e6eafc41307f3265a784ee3347d817ba4 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Wed, 13 Sep 2023 09:38:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=85=A4=E6=BA=90=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coal/coalInfo/dto/CoalInfoDto.java | 2 ++ .../coal/coalInfo/dto/CreateCoalInfoDto.java | 2 +- .../coal/coalInfo/dto/UpdateCoalInfoDto.java | 2 +- .../coal/coalInfo/entity/CoalInfoEntity.java | 18 +++++++++++++++ src/main/resources/config/dictionary.json | 23 +++++++++++++++---- 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java b/src/main/java/cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java index e9ef597b..567c0eee 100644 --- a/src/main/java/cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java +++ b/src/main/java/cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java @@ -12,6 +12,8 @@ public class CoalInfoDto extends OrgCommonDto { private String supplierName; + private String coalTypeName; + private String coalType; @Comment("初始报价") private Double initPrice; } diff --git a/src/main/java/cn/lihongjie/coal/coalInfo/dto/CreateCoalInfoDto.java b/src/main/java/cn/lihongjie/coal/coalInfo/dto/CreateCoalInfoDto.java index 7bf33024..cee5e23f 100644 --- a/src/main/java/cn/lihongjie/coal/coalInfo/dto/CreateCoalInfoDto.java +++ b/src/main/java/cn/lihongjie/coal/coalInfo/dto/CreateCoalInfoDto.java @@ -10,7 +10,7 @@ public class CreateCoalInfoDto extends OrgCommonDto { @Comment("供应商") private String supplier; - + private String coalType; @Comment("初始报价") private Double initPrice; diff --git a/src/main/java/cn/lihongjie/coal/coalInfo/dto/UpdateCoalInfoDto.java b/src/main/java/cn/lihongjie/coal/coalInfo/dto/UpdateCoalInfoDto.java index 8a5fbbb4..c6fbecbe 100644 --- a/src/main/java/cn/lihongjie/coal/coalInfo/dto/UpdateCoalInfoDto.java +++ b/src/main/java/cn/lihongjie/coal/coalInfo/dto/UpdateCoalInfoDto.java @@ -10,7 +10,7 @@ public class UpdateCoalInfoDto extends OrgCommonDto { private String supplier; - + private String coalType; @Comment("初始报价") private Double initPrice; } diff --git a/src/main/java/cn/lihongjie/coal/coalInfo/entity/CoalInfoEntity.java b/src/main/java/cn/lihongjie/coal/coalInfo/entity/CoalInfoEntity.java index d489b644..663e508f 100644 --- a/src/main/java/cn/lihongjie/coal/coalInfo/entity/CoalInfoEntity.java +++ b/src/main/java/cn/lihongjie/coal/coalInfo/entity/CoalInfoEntity.java @@ -6,6 +6,7 @@ import jakarta.persistence.Entity; import jakarta.persistence.ManyToOne; import lombok.Data; import org.hibernate.annotations.Comment; +import org.hibernate.annotations.Formula; @Data @Entity @@ -16,6 +17,23 @@ public class CoalInfoEntity extends OrgCommonEntity { private SupplierEntity supplier; + @Comment("煤源类型") + private String coalType; + + + @Formula("(select i.name\n" + + "from t_dictionary d,\n" + + " t_dictionary_item i\n" + + "where d.id = i.dictionary_id\n" + + " and d.code = 'coal.type'\n" + + " and i.code = coal_type)") + private String coalTypeName; + + + + + + @Comment("初始报价") diff --git a/src/main/resources/config/dictionary.json b/src/main/resources/config/dictionary.json index 4a8b6065..45baa1a8 100644 --- a/src/main/resources/config/dictionary.json +++ b/src/main/resources/config/dictionary.json @@ -31,7 +31,6 @@ } ] }, - { "code": "dict.type", "name": "字典类型", @@ -44,7 +43,6 @@ "code": "2", "name": "动态字典" } - ] }, { @@ -59,7 +57,6 @@ "code": "2", "name": "树" } - ] }, { @@ -74,8 +71,24 @@ "code": "1", "name": "失败" } - + ] + }, + { + "code": "coal.type", + "name": "煤源类型", + "item": [ + { + "code": "0", + "name": "精煤" + }, + { + "code": "1", + "name": "中煤" + }, + { + "code": "2", + "name": "原煤" + } ] } - ] \ No newline at end of file