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