|
|
@@ -17,11 +17,11 @@ import java.util.List;
|
|
|
* 编码规则 (符合PDF协议规范):
|
|
|
* 桩编码(pileCode): 7字节BCD码 = 14位数字
|
|
|
* 枪号(gunNo): 1字节BCD码 = 2位数字 (01-08)
|
|
|
- * 桩编码设计: 321283 + AA + BBBB + 01
|
|
|
- * 321283: 泰兴市行政区划码前6位
|
|
|
- * AA: 服务区(01=北区, 02=南区)
|
|
|
- * BBBB: 主机序号(0001, 0002)
|
|
|
- * 01: 校验位
|
|
|
+ * 桩编码与数据库adm_ems_obj_attr_value表中pileCode属性一致:
|
|
|
+ * 南区1号: 32128300070001 (8枪)
|
|
|
+ * 南区2号: 32128300070002 (7枪)
|
|
|
+ * 北区1号: 32128300060001 (8枪)
|
|
|
+ * 北区2号: 32128300060002 (7枪)
|
|
|
*
|
|
|
* @author lvwenbin
|
|
|
* @version [版本号, 2025/12/23]
|
|
|
@@ -29,12 +29,12 @@ import java.util.List;
|
|
|
public class MockPileConfig {
|
|
|
|
|
|
/**
|
|
|
- * 桩编码常量 - 与数据库保持一致
|
|
|
+ * 桩编码常量 - 与数据库adm_ems_obj_attr_value表保持一致
|
|
|
*/
|
|
|
- public static final String PILE_CODE_NORTH_HOST_01 = "32128301000101";
|
|
|
- public static final String PILE_CODE_NORTH_HOST_02 = "32128301000201";
|
|
|
- public static final String PILE_CODE_SOUTH_HOST_01 = "32128302000101";
|
|
|
- public static final String PILE_CODE_SOUTH_HOST_02 = "32128302000201";
|
|
|
+ public static final String PILE_CODE_SOUTH_HOST_01 = "32128300070001";
|
|
|
+ public static final String PILE_CODE_SOUTH_HOST_02 = "32128300070002";
|
|
|
+ public static final String PILE_CODE_NORTH_HOST_01 = "32128300060001";
|
|
|
+ public static final String PILE_CODE_NORTH_HOST_02 = "32128300060002";
|
|
|
|
|
|
/**
|
|
|
* 服务器地址
|
|
|
@@ -89,78 +89,76 @@ public class MockPileConfig {
|
|
|
/**
|
|
|
* 创建默认的高速服务区配置
|
|
|
* 南北两侧,每侧2台充电主机
|
|
|
- * 主机1: 1台600kW水冷枪 + 6台250kW风冷枪 = 7枪
|
|
|
- * 主机2: 1台600kW水冷枪 + 7台250kW风冷枪 = 8枪
|
|
|
+ * 桩编码与数据库adm_ems_obj_attr_value表保持一致
|
|
|
*
|
|
|
- * 桩编码使用14位BCD码格式,与数据库adm_ems_obj_attr_value表保持一致
|
|
|
+ * 南区1号: 32128300070001 (8枪)
|
|
|
+ * 南区2号: 32128300070002 (7枪)
|
|
|
+ * 北区1号: 32128300060001 (8枪)
|
|
|
+ * 北区2号: 32128300060002 (7枪)
|
|
|
*/
|
|
|
public static MockPileConfig createHighwayServiceAreaConfig() {
|
|
|
MockPileConfig config = new MockPileConfig();
|
|
|
|
|
|
- // 北区-主机1: 7枪 (1*600kW + 6*250kW)
|
|
|
- // 对应数据库: W2-B-CHARGING-HOST-01, pileCode=32128301000101
|
|
|
- PileHostConfig northHost1 = new PileHostConfig();
|
|
|
- northHost1.setPileCode(PILE_CODE_NORTH_HOST_01); // 32128301000101
|
|
|
- northHost1.setGunCount(7);
|
|
|
- northHost1.setDescription("北区-主机1");
|
|
|
- // 枪号使用2位格式: 01-07
|
|
|
- northHost1.addGun(new GunConfig("01", 600, GunConfig.GunType.WATER_COOLED));
|
|
|
- for (int i = 2; i <= 7; i++) {
|
|
|
- northHost1.addGun(new GunConfig(String.format("%02d", i), 250, GunConfig.GunType.AIR_COOLED));
|
|
|
- }
|
|
|
- config.getPileHosts().add(northHost1);
|
|
|
-
|
|
|
- // 北区-主机2: 8枪 (1*600kW + 7*250kW)
|
|
|
- // 对应数据库: W2-B-CHARGING-HOST-02, pileCode=32128301000201
|
|
|
- PileHostConfig northHost2 = new PileHostConfig();
|
|
|
- northHost2.setPileCode(PILE_CODE_NORTH_HOST_02); // 32128301000201
|
|
|
- northHost2.setGunCount(8);
|
|
|
- northHost2.setDescription("北区-主机2");
|
|
|
- // 枪号使用2位格式: 01-08
|
|
|
- northHost2.addGun(new GunConfig("01", 600, GunConfig.GunType.WATER_COOLED));
|
|
|
- for (int i = 2; i <= 8; i++) {
|
|
|
- northHost2.addGun(new GunConfig(String.format("%02d", i), 250, GunConfig.GunType.AIR_COOLED));
|
|
|
- }
|
|
|
- config.getPileHosts().add(northHost2);
|
|
|
-
|
|
|
- // 南区-主机1: 7枪 (1*600kW + 6*250kW)
|
|
|
- // 对应数据库: W2-N-CHARGING-HOST-01, pileCode=32128302000101
|
|
|
+ // 南区-主机1: 8枪
|
|
|
+ // 对应数据库: device_code=32128300070001, pileCode=32128300070001
|
|
|
PileHostConfig southHost1 = new PileHostConfig();
|
|
|
- southHost1.setPileCode(PILE_CODE_SOUTH_HOST_01); // 32128302000101
|
|
|
- southHost1.setGunCount(7);
|
|
|
+ southHost1.setPileCode(PILE_CODE_SOUTH_HOST_01);
|
|
|
+ southHost1.setGunCount(8);
|
|
|
southHost1.setDescription("南区-主机1");
|
|
|
- // 枪号使用2位格式: 01-07
|
|
|
southHost1.addGun(new GunConfig("01", 600, GunConfig.GunType.WATER_COOLED));
|
|
|
- for (int i = 2; i <= 7; i++) {
|
|
|
+ for (int i = 2; i <= 8; i++) {
|
|
|
southHost1.addGun(new GunConfig(String.format("%02d", i), 250, GunConfig.GunType.AIR_COOLED));
|
|
|
}
|
|
|
config.getPileHosts().add(southHost1);
|
|
|
|
|
|
- // 南区-主机2: 8枪 (1*600kW + 7*250kW)
|
|
|
- // 对应数据库: W2-N-CHARGING-HOST-02, pileCode=32128302000201
|
|
|
+ // 南区-主机2: 7枪
|
|
|
+ // 对应数据库: device_code=32128300070002, pileCode=32128300070002
|
|
|
PileHostConfig southHost2 = new PileHostConfig();
|
|
|
- southHost2.setPileCode(PILE_CODE_SOUTH_HOST_02); // 32128302000201
|
|
|
- southHost2.setGunCount(8);
|
|
|
+ southHost2.setPileCode(PILE_CODE_SOUTH_HOST_02);
|
|
|
+ southHost2.setGunCount(7);
|
|
|
southHost2.setDescription("南区-主机2");
|
|
|
- // 枪号使用2位格式: 01-08
|
|
|
southHost2.addGun(new GunConfig("01", 600, GunConfig.GunType.WATER_COOLED));
|
|
|
- for (int i = 2; i <= 8; i++) {
|
|
|
+ for (int i = 2; i <= 7; i++) {
|
|
|
southHost2.addGun(new GunConfig(String.format("%02d", i), 250, GunConfig.GunType.AIR_COOLED));
|
|
|
}
|
|
|
config.getPileHosts().add(southHost2);
|
|
|
|
|
|
+ // 北区-主机1: 8枪
|
|
|
+ // 对应数据库: device_code=32128300060001, pileCode=32128300060001
|
|
|
+ PileHostConfig northHost1 = new PileHostConfig();
|
|
|
+ northHost1.setPileCode(PILE_CODE_NORTH_HOST_01);
|
|
|
+ northHost1.setGunCount(8);
|
|
|
+ northHost1.setDescription("北区-主机1");
|
|
|
+ northHost1.addGun(new GunConfig("01", 600, GunConfig.GunType.WATER_COOLED));
|
|
|
+ for (int i = 2; i <= 8; i++) {
|
|
|
+ northHost1.addGun(new GunConfig(String.format("%02d", i), 250, GunConfig.GunType.AIR_COOLED));
|
|
|
+ }
|
|
|
+ config.getPileHosts().add(northHost1);
|
|
|
+
|
|
|
+ // 北区-主机2: 7枪
|
|
|
+ // 对应数据库: device_code=32128300060002, pileCode=32128300060002
|
|
|
+ PileHostConfig northHost2 = new PileHostConfig();
|
|
|
+ northHost2.setPileCode(PILE_CODE_NORTH_HOST_02);
|
|
|
+ northHost2.setGunCount(7);
|
|
|
+ northHost2.setDescription("北区-主机2");
|
|
|
+ northHost2.addGun(new GunConfig("01", 600, GunConfig.GunType.WATER_COOLED));
|
|
|
+ for (int i = 2; i <= 7; i++) {
|
|
|
+ northHost2.addGun(new GunConfig(String.format("%02d", i), 250, GunConfig.GunType.AIR_COOLED));
|
|
|
+ }
|
|
|
+ config.getPileHosts().add(northHost2);
|
|
|
+
|
|
|
return config;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 创建简单的测试配置(单主机单枪)
|
|
|
- * 使用北区主机1的桩编码
|
|
|
+ * 使用南区主机1的桩编码
|
|
|
*/
|
|
|
public static MockPileConfig createSimpleTestConfig() {
|
|
|
MockPileConfig config = new MockPileConfig();
|
|
|
|
|
|
PileHostConfig host = new PileHostConfig();
|
|
|
- host.setPileCode(PILE_CODE_NORTH_HOST_01); // 32128301000101
|
|
|
+ host.setPileCode(PILE_CODE_SOUTH_HOST_01);
|
|
|
host.setGunCount(1);
|
|
|
host.setDescription("测试主机");
|
|
|
host.addGun(new GunConfig("01", 120, GunConfig.GunType.AIR_COOLED));
|