package com.ltgk.common.enums;

/**
 * @Author: w1826
 * @Description: 工程阶段type
 * @Date: 2025/1/15 19:54
 * @Version: 1.0
 */
public enum StageDurationType {
    // 1、需求分析 2、制定计划 3、施工图设计 4、项目实施 5、项目验收
    REQUIREMENT_ANALYSIS(1, "需求分析"),
    PLAN_DESIGN(2, "制定计划"),
    CONSTRUCTION_DESIGN(3, "施工图设计"),
    IMPLEMENTATION(4, "项目实施"),
    ACCEPTANCE(5, "项目验收");
    private final int code;
    private final String desc;

    StageDurationType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static StageDurationType getStageDurationType(int code) {
        for (StageDurationType stageDurationType : StageDurationType.values()) {
            if (stageDurationType.getCode() == code) {
                return stageDurationType;
            }
        }
        return null;
    }
}
