package com.zzsmart.qomo.kn.cost.manage.enums;

/**
 * @Classname StandardStageEnum
 * @Description 阶段枚举
 * @Version 1.0.0
 * @Date 2024/6/18 9:51
 * @Created wangqiong
 */
public enum FeeTypeEnum {

    LaborCost("LaborCost", "人工成本"), MaterialCost("MaterialCost", "物料成本"), EquipmentFee("EquipmentFee", "设备费"), SupplyMaterialFee("SupplyMaterialFee", "辅料费"), DriverFee("DriverFee", "水电费"), OtherFee("OtherFee", "其他费用"), LogisticsFee("LogisticsFee", "物流费"), StandardCost("StandardCost", "标准成本");

    private final String code;
    private final String name;

    FeeTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据code获取text
     *
     * @param codeNo
     * @return
     */
    public static String getTextByCode(String codeNo) {
        for (FeeTypeEnum value : FeeTypeEnum.values()) {
            if (value.getCode().equals(codeNo)) {
                return value.name();
            }
        }
        return codeNo.toString();
    }

    /**
     * 根据text获取code
     *
     * @param name
     * @return
     */
    public static String getCodeByName(String name) {
        for (FeeTypeEnum value : FeeTypeEnum.values()) {
            if (value.name().equals(name)) {
                return value.name();
            }
        }
        return name;
    }
}
