Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

xucaiqin 2 лет назад
Родитель
Сommit
7b1803f0d4

+ 40 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java

@@ -0,0 +1,40 @@
+package com.sckw.core.common.enums.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author lfdc
+ * @description 枚举字典
+ * @date 2023-07-07 14:07:23
+ */
+@Getter
+@AllArgsConstructor
+public enum DictEnum {
+    PRICE_TYPE_0("price_type", "0", "元/吨"),
+    PRICE_TYPE_1("price_type", "1", "元/车"),
+    TRADE_TYPE_0("trade_type", "0", "预付款"),
+    TRADE_TYPE_1("trade_type", "1", "货到付款"),
+    TRADE_TYPE_2("trade_type", "2", "线下付款"),
+    ADDRESS_TYPE_0("address_type", "0", "矿山"),
+    INDUSTRY_TYPE_0("industry_type", "0", "砂石"),
+    CLASSIFICATION_TYPE_0("classification_type", "0", "石料"),
+    CATEGORY_TYPE_0("category_type", "0", "山砂"),
+    PRODUCT_NAME_TYPE_0("product_name_type", "0", "毛石"),
+    GOODS_STATUS_0("goods_status", "0", "已保存"),
+    GOODS_STATUS_1("goods_status", "1", "已上架"),
+    GOODS_STATUS_2("goods_status", "2", "已下架");
+    private final String type;
+    private final String value;
+    private final String label;
+
+    public static String getLabel(String type, String value) {
+        for (DictEnum dict : DictEnum.values()) {
+            if (dict.getType().equals(type) && dict.getValue().equals(value)) {
+                return dict.getLabel();
+            }
+        }
+        return null;
+    }
+
+}

+ 14 - 11
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java

@@ -4,21 +4,24 @@ import lombok.AllArgsConstructor;
 import lombok.Getter;
 
 /**
- * @author lfdc
- * @description 枚举字典
- * @date 2023-07-07 14:07:23
+ * @desc: 字典类型枚举
+ * @author: yzc
+ * @date: 2023-07-10 16:46
  */
 @Getter
 @AllArgsConstructor
 public enum DictTypeEnum {
-    PRICE_TYPE_0("price_type", "0", "元/吨"),
-    PRICE_TYPE_1("price_type", "1", "元/车"),
-    UNIT_TYPE_0("unit", "0", "吨"),
-    UNIT_TYPE_1("unit", "1", "方"),
-    UNIT_TYPE_2("unit", "2", "箱"),
-    UNIT_TYPE_3("unit", "3", "件");
+    INTEGRAL_TYPE("integral_type", "积分类型"),
+    PRICE_TYPE("price_type", "运价方式"),
+    TRADE_TYPE("trade_type", "交易方式"),
+    ADDRESS_TYPE("address_type", "地址类型"),
+    INDUSTRY_TYPE("industry_type", "行业类型"),
+    CLASSIFICATION_TYPE("classification_type", "分类类型"),
+    CATEGORY_TYPE("category_type", "类别类型"),
+    PRODUCT_NAME_TYPE("product_name_type", "品名类型"),
+    GOODS_STATUS("goods_status", "商品状态");
     private final String type;
-    private final String value;
-    private final String label;
+    private final String name;
+
 
 }