package com.ruoyi.production.enums;
|
|
import lombok.Getter;
|
|
/**
|
* <br>
|
* 产品类型-科目名称
|
* </br>
|
*
|
* @author deslrey
|
* @version 1.0
|
* @since 2026/03/31
|
*/
|
@Getter
|
public enum ProductionSettlementEnum {
|
MATERIAL_COST("材料成本", true),
|
ENERGY_COST("能耗成本", false);
|
|
private final String name;
|
private final boolean requiresProduct;
|
|
ProductionSettlementEnum(String name, boolean requiresProduct) {
|
this.name = name;
|
this.requiresProduct = requiresProduct;
|
}
|
|
/**
|
* 判断是否为材料成本
|
*
|
* @param name 科目名称
|
* @return boolean
|
*/
|
public static boolean isMaterialCost(String name) {
|
for (ProductionSettlementEnum e : values()) {
|
if (e.getName().equals(name)) {
|
return e.isRequiresProduct();
|
}
|
}
|
return false;
|
}
|
|
}
|