gongchunyi
5 小时以前 b572e82dcafea0fd893d908c7bb0e048483a1dd3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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;
    }
 
}