|
@@ -0,0 +1,58 @@
|
|
|
|
|
+package org.jeecg.modules.business.enums;
|
|
|
|
|
+
|
|
|
|
|
+import org.jeecg.common.system.annotation.EnumDict;
|
|
|
|
|
+import org.jeecg.common.system.vo.DictModel;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+@EnumDict("couponsKeyEnum")
|
|
|
|
|
+public enum CouponsKeyEnum {
|
|
|
|
|
+
|
|
|
|
|
+ AM(1, "上午"),
|
|
|
|
|
+ MO(2, "中午"),
|
|
|
|
|
+ DE(3, "晚上");
|
|
|
|
|
+
|
|
|
|
|
+ Integer key;
|
|
|
|
|
+
|
|
|
|
|
+ String title;
|
|
|
|
|
+
|
|
|
|
|
+ CouponsKeyEnum(Integer key, String title){
|
|
|
|
|
+ this.key = key;
|
|
|
|
|
+ this.title = title;
|
|
|
|
|
+ }
|
|
|
|
|
+ public Integer getKey() {
|
|
|
|
|
+ return key;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getTitle() {
|
|
|
|
|
+ return title;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取字典数据
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public static List<DictModel> getDictList(){
|
|
|
|
|
+ List<DictModel> list = new ArrayList<>();
|
|
|
|
|
+ DictModel dictModel = null;
|
|
|
|
|
+ for(CouponsKeyEnum e: CouponsKeyEnum.values()){
|
|
|
|
|
+ dictModel = new DictModel();
|
|
|
|
|
+ dictModel.setValue(e.key.toString());
|
|
|
|
|
+ dictModel.setText(e.title);
|
|
|
|
|
+ list.add(dictModel);
|
|
|
|
|
+ }
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static CouponsKeyEnum val(Integer key){
|
|
|
|
|
+ for(CouponsKeyEnum bld: values()){
|
|
|
|
|
+ if(bld.key == key){
|
|
|
|
|
+ return bld;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|