xyc
2026-11-11 841847dbbab3c6fd532dcb747ca290ba6a9e12d0
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package com.trafficaudit.common.constant;
 
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
 
/**
 * H204 道路货运车辆能源消耗 码表(车辆类型 / 燃料类型 / 燃料计量单位)。
 *
 * <p>车辆类型码为按实数据反推得到——官方《交企统H204表》指标解释只给车型名称、不给数字编号,
 * 故未收录的码(如 12)按“未知码”处理:审核比对跳过并记录,不再当成不一致误报。</p>
 *
 * <p>燃料类型码 01~08 与官方口径一致(汽油/柴油/压缩天然气/液化天然气/双燃料/混合动力/纯电动/燃料电池)。</p>
 */
public final class EnergyCodes {
 
    private EnergyCodes() {
    }
 
    /** 单耗公式表燃料分组:汽油车 */
    public static final String GROUP_GASOLINE = "GASOLINE";
    /** 单耗公式表燃料分组:柴油车 / LNG(液化天然气) */
    public static final String GROUP_DIESEL_LNG = "DIESEL_LNG";
    /** 单耗公式表燃料分组:CNG 压缩天然气 */
    public static final String GROUP_CNG = "CNG";
    /** 单耗公式表燃料分组:双燃料 / 混动、氢能源 */
    public static final String GROUP_DUAL = "DUAL";
    /** 单耗公式表燃料分组:纯电动 */
    public static final String GROUP_EV = "EV";
 
    /** 车辆类型码 -> 中文名称(导入落库用) */
    public static final Map<String, String> VEHICLE_TYPE_NAMES;
    /** 车辆类型码 -> 允许的运政车辆类型(比对前已去掉 重/中/轻型 前缀) */
    public static final Map<String, Set<String>> VEHICLE_TYPE_ALLOWED;
    /** 燃料类型码 -> 中文名称 */
    public static final Map<String, String> FUEL_TYPE_NAMES;
    /** 燃料类型码 -> 允许的运政燃料类型 */
    public static final Map<String, Set<String>> FUEL_TYPE_ALLOWED;
    /** 燃料计量单位码 -> 中文单位 */
    public static final Map<String, String> FUEL_UNIT_NAMES;
    /** 燃料类型码 -> 单耗阈值的燃料分组 */
    public static final Map<String, String> FUEL_GROUP_BY_CODE;
    /** 单耗阈值燃料分组 -> 中文名称 */
    public static final Map<String, String> FUEL_GROUP_NAMES;
 
    static {
        // 车辆类型码:官方《车类型编码》(docs/能耗/单耗审核公式及车辆类型.xlsx)
        Map<String, String> vtNames = new HashMap<String, String>();
        vtNames.put("01", "普通货车");
        vtNames.put("02", "平板货车");
        vtNames.put("03", "仓栅式货车");
        vtNames.put("04", "厢式货车");
        vtNames.put("05", "封闭货车");
        vtNames.put("06", "罐式货车");
        vtNames.put("07", "特殊结构货车");
        vtNames.put("08", "自卸式货车");
        vtNames.put("09", "车辆运输车");
        vtNames.put("10", "集装箱车");
        vtNames.put("11", "牵引车");
        vtNames.put("12", "冷藏保温车");
        VEHICLE_TYPE_NAMES = Collections.unmodifiableMap(vtNames);
 
        Map<String, Set<String>> vtAllowed = new HashMap<String, Set<String>>();
        vtAllowed.put("01", set("普通货车", "栏板货车", "自卸货车"));
        vtAllowed.put("02", set("平板货车", "栏板货车"));
        vtAllowed.put("03", set("仓栅式货车"));
        vtAllowed.put("04", set("厢式货车"));
        vtAllowed.put("05", set("封闭货车"));
        vtAllowed.put("06", set("罐式货车"));
        vtAllowed.put("07", set("特殊结构货车", "车辆运输车"));
        vtAllowed.put("08", set("自卸货车", "栏板货车"));
        vtAllowed.put("09", set("车辆运输车", "中置轴车辆运输车"));
        vtAllowed.put("10", set("集装箱车"));
        vtAllowed.put("11", set("半挂牵引车"));
        vtAllowed.put("12", set("冷藏保温车", "冷藏车", "保温车"));
        VEHICLE_TYPE_ALLOWED = Collections.unmodifiableMap(vtAllowed);
 
        Map<String, String> ftNames = new HashMap<String, String>();
        ftNames.put("01", "汽油车");
        ftNames.put("02", "柴油车");
        ftNames.put("03", "压缩天然气");
        ftNames.put("04", "液化天然气");
        ftNames.put("05", "双燃料车");
        ftNames.put("06", "混合动力车");
        ftNames.put("07", "纯电动车");
        ftNames.put("08", "燃料电池车");
        FUEL_TYPE_NAMES = Collections.unmodifiableMap(ftNames);
 
        Map<String, Set<String>> ftAllowed = new HashMap<String, Set<String>>();
        ftAllowed.put("01", set("汽油"));
        ftAllowed.put("02", set("柴油"));
        ftAllowed.put("03", set("压缩天然气"));
        // 双燃料按官方码表归到 05,不再默认合法挂在 04,避免掩盖填报口径不一致
        ftAllowed.put("04", set("液态天然气", "液化天然气"));
        ftAllowed.put("05", set("双燃料"));
        ftAllowed.put("06", set("混合动力"));
        ftAllowed.put("07", set("电动"));
        ftAllowed.put("08", set("氢气"));
        FUEL_TYPE_ALLOWED = Collections.unmodifiableMap(ftAllowed);
 
        Map<String, String> units = new HashMap<String, String>();
        units.put("1", "升");
        units.put("2", "升");
        units.put("4", "千克");
        units.put("5", "千克");
        units.put("7", "千瓦时");
        FUEL_UNIT_NAMES = Collections.unmodifiableMap(units);
 
        Map<String, String> groups = new HashMap<String, String>();
        groups.put("01", GROUP_GASOLINE);
        groups.put("02", GROUP_DIESEL_LNG);
        groups.put("03", GROUP_CNG);
        groups.put("04", GROUP_DIESEL_LNG);
        groups.put("05", GROUP_DUAL);
        groups.put("06", GROUP_DUAL);
        groups.put("07", GROUP_EV);
        groups.put("08", GROUP_DUAL);
        FUEL_GROUP_BY_CODE = Collections.unmodifiableMap(groups);
 
        Map<String, String> groupNames = new HashMap<String, String>();
        groupNames.put(GROUP_GASOLINE, "汽油车");
        groupNames.put(GROUP_DIESEL_LNG, "柴油车/LNG");
        groupNames.put(GROUP_CNG, "CNG 压缩天然气");
        groupNames.put(GROUP_DUAL, "双燃料/混动、氢能源");
        groupNames.put(GROUP_EV, "纯电动车");
        FUEL_GROUP_NAMES = Collections.unmodifiableMap(groupNames);
    }
 
    private static Set<String> set(String... values) {
        return Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(values)));
    }
 
    /** 燃料码对应的单耗分组;未知码返回 null */
    public static String fuelGroup(String fuelTypeCode) {
        if (fuelTypeCode == null) {
            return null;
        }
        return FUEL_GROUP_BY_CODE.get(fuelTypeCode.trim());
    }
}