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 {
|
Map<String, String> vtNames = new HashMap<String, String>();
|
vtNames.put("01", "普通货车");
|
vtNames.put("02", "平板货车");
|
vtNames.put("03", "仓栅式货车");
|
vtNames.put("04", "厢式货车");
|
vtNames.put("06", "罐式货车");
|
vtNames.put("07", "特殊结构货车");
|
vtNames.put("08", "自卸货车");
|
vtNames.put("09", "车辆运输车");
|
vtNames.put("11", "重型半挂牵引车");
|
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("06", set("罐式货车"));
|
vtAllowed.put("07", set("特殊结构货车", "车辆运输车"));
|
vtAllowed.put("08", set("自卸货车", "栏板货车"));
|
vtAllowed.put("09", set("车辆运输车", "中置轴车辆运输车"));
|
vtAllowed.put("11", 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());
|
}
|
}
|