package com.ningdatech.pmapi.projectlib.enumeration;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

/**
 * <p>
 * ProjectRenewalApprovalStatusEnum
 * </p>
 *
 * @author Poffy
 * @since 16:54 2023/2/11
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ProjectRenewalApprovalStatusEnum {
    /**
     * 续建项目 审核状态
     * 审核中
     * 通过
     * 不通过
     */
    PENDING(1,"审核中"),
    PASS(2,"通过"),
    NOT_PASS(3,"不通过");

    private Integer code;
    private String desc;

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

}
