package com.ningdatech.pmapi.performance.enumration;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * AppraisalTypeEnum
 * @return
 * @author CMM
 * @since 2023/07/26 16:44
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum AppraisalTypeEnum {
    /**
     * 评价类型
     */
    SELF_APPRAISAL(1, "单位自评"),
    RE_APPRAISAL(2, "人工复评"),
    EXPERT_VERIFY(3, "专家核查");

    private Integer code;
    private String desc;

    public static String getDesc(Integer code) {
        if (Objects.isNull(code)) {
            return StringUtils.EMPTY;
        }
        for (AppraisalTypeEnum t : AppraisalTypeEnum.values()) {
            if (code.equals(t.getCode())) {
                return t.desc;
            }
        }
        return StringUtils.EMPTY;
    }
}
