|
@@ -0,0 +1,56 @@
|
|
|
+package com.fdkankan.manage.constant;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+
|
|
|
+public enum SceneButtonEnum {
|
|
|
+ del(0,"正常销售"),
|
|
|
+ STAFF_USE(1,"员工自用"),
|
|
|
+ GIFT_GIVING(2,"礼品赠送"),
|
|
|
+ OTHER(3,"其他"),
|
|
|
+ AGENT(4,"经销商");
|
|
|
+
|
|
|
+
|
|
|
+ int code;
|
|
|
+ String msg;
|
|
|
+
|
|
|
+ SceneButtonEnum(int code, String msg) {
|
|
|
+ this.code = code;
|
|
|
+ this.msg = msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getCode() {
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setCode(int code) {
|
|
|
+ this.code = code;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getMsg() {
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMsg(String msg) {
|
|
|
+ this.msg = msg;
|
|
|
+ }
|
|
|
+ public static SceneButtonEnum getByCode(int code){
|
|
|
+ SceneButtonEnum[] values = SceneButtonEnum.values();
|
|
|
+ for (SceneButtonEnum value : values) {
|
|
|
+ if(value.code == code){
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ public static SceneButtonEnum getByMsg(String msg){
|
|
|
+ if(StringUtils.isNotBlank(msg)){
|
|
|
+ SceneButtonEnum[] values = SceneButtonEnum.values();
|
|
|
+ for (SceneButtonEnum value : values) {
|
|
|
+ if(value.msg.equalsIgnoreCase(msg)){
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+}
|