package com.ningdatech.pmapi.common.enumeration;

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

import java.util.Objects;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ProjectProcessStageEnum {
    /**
     * 项目流程配置 阶段枚举
     */
    ORG_INTERNAL_APPROVAL_PROCESS(1,"单位内部审批流程"),
    PROJECT_PREQUALIFICATION_APPROVAL_PROCESS(2,"项目预审审批流程"),
    DEPARTMENT_JOINT_APPROVAL_PROCESS(3,"部门联合审批流程"),
    CONSTRUCTION_PROJECT_APPROVAL_PROCESS(4,"建设方案审批流程"),
    ACCEPTANCE_DECLARATION_APPROVAL_PROCESS(5,"验收申报审批流程");

    private Integer code;
    private String desc;

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