package com.xisc.pm.infra.enums;

/**
 * 材料状态枚举
 * @author jun.zeng
 *
 */
public enum PdMatStatus {
    NOT_ASSEMBLED("00", "材料未组板"), CANNOT_ASSEMBLE("09", "材料无法组板"), ASSEMBLING("11", "材料处于组板中"),
    ASSEMBLED("12", "材料组板完成"), FURNACE_START("15", "材料组炉开始"), FURNACE_COMPLETED("16", "材料组炉完成"),
    COMMAND_GENERATED("18", "材料命令已生成"), QUALITY_SAMPLE_ADDED("20", "质量试样添加已完成"),
    SECONDARY_DESIGN_FAILED("21", "材料二次设计条件核验未通过"), SECONDARY_SUB_DESIGN_COMPLETED("22", "材料二次设计子材料设计完成"),
    SECONDARY_DESIGN_COMPLETED("23", "材料二次设计完成"), COMMAND_CREATED("24", "材料命令作成完成"),
    MANUFACTURING_COMMAND_DETERMINED("25", "材料制造命令已确定"), COMMAND_SUBMITTED("26", "命令提交"),
    DESTINATION_FILE_GENERATED("27", "材料目的文件已生成"), MATERIAL_PRODUCED("28", "实物材料已产出"),
    SLAB_NOT_ACQUIRED("29", "命令板坯未采到"), AUTO_ASSEMBLING("51", "自动组板中"), AUTO_ASSEMBLED("52", "自动组板完成");

    private final String code;
    private final String desc;

    private PdMatStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    // 可以根据需要添加更多方法，例如根据code查找枚举值
    public static PdMatStatus getByCode(String code) {
        for (PdMatStatus status : PdMatStatus.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown code: " + code);
    }
}