FollowTypeEnum.java 1.91 KB
package cn.fw.shirasawa.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @author : kurisu
 * @className : FollowTypeEnum
 * @description : 跟进类型
 * @date: 2020-08-11 17:37
 */
public enum FollowTypeEnum implements IEnum<Integer> {
    /**
     * 跟进类型
     */
    FM(1, "首保跟进"),
    RM(2, "流失预警跟进"),
    AC(3, "事故车跟进"),
    IR(4, "续保跟进"),
    AF(5, "活动邀约"),
    CF(6, "集客跟进"),
    PF(7, "潜客跟进"),
    FA(8, "急救跟进"),
    RV(9, "回访跟进"),
    PL(10, "公共池跟进"),
    SF(11, "补贴跟进"),
    /**
     * 其他
     * 目前只用于设置,并不参与具体跟进业务
     */
    OT(99, "其他"),
    ;

    /**
     * 值
     */
    private final Integer value;
    /**
     * 名称
     */
    @Getter
    private final String name;

    FollowTypeEnum(final Integer value, final String name) {
        this.value = value;
        this.name = name;
    }

    /**
     * 根据枚举值获取枚举对象
     */
    @JsonCreator
    public static FollowTypeEnum ofValue(final Integer value) {
        for (final FollowTypeEnum typeEnum : FollowTypeEnum.values()) {
            if (typeEnum.value.equals(value)) {
                return typeEnum;
            }
        }
        return null;
    }

    /**
     * 获取描述
     *
     * @return 值
     */
    @JsonCreator
    public static String getNameByVale(final Integer value) {
        for (final FollowTypeEnum typeEnum : FollowTypeEnum.values()) {
            if (typeEnum.value.equals(value)) {
                return typeEnum.getName();
            }
        }
        return "";
    }

    /**
     * 获取值
     *
     * @return 值
     */
    @JsonValue
    @Override
    public Integer getValue() {
        return value;
    }
}