mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-11 10:49:52 +08:00
update 解析0x17参数配置帧
This commit is contained in:
@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,23 +66,28 @@ public class ParameterConfigurationHandler extends AbstractYkcHandler {
|
|||||||
startIndex += length;
|
startIndex += length;
|
||||||
length = 2;
|
length = 2;
|
||||||
byte[] BMSMaxVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] BMSMaxVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String BMSMaxVoltage = String.valueOf(BytesUtil.bytesToIntLittle(BMSMaxVoltageByteArr) * 0.01);
|
||||||
|
|
||||||
// BMS 最高允许充电电流 0.1 A/位, -400A 偏移量
|
// BMS 最高允许充电电流 0.1 A/位, -400A 偏移量
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] BMSMaxCurrentByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] BMSMaxCurrentByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String BMSMaxCurrent = String.valueOf(BytesUtil.bytesToIntLittle(BMSMaxCurrentByteArr) * 0.1 - 400);
|
||||||
|
|
||||||
// BMS 动力蓄电池标称总能量 0.1 kWh/位, 0 kWh 偏移量; 数据范围: 0~1000 kWh
|
// BMS 动力蓄电池标称总能量 0.1 kWh/位, 0 kWh 偏移量; 数据范围: 0~1000 kWh
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] BMSSumEnergyByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] BMSSumEnergyByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String BMSSumEnergy = String.valueOf(BytesUtil.bytesToIntLittle(BMSSumEnergyByteArr) * 0.1);
|
||||||
|
|
||||||
// BMS 最高允许充电总电压 0.1 V/位, 0 V 偏移量
|
// BMS 最高允许充电总电压 0.1 V/位, 0 V 偏移量
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] BMSMaxChargingVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] BMSMaxChargingVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String BMSMaxChargingVoltage = String.valueOf(BytesUtil.bytesToIntLittle(BMSMaxChargingVoltageByteArr) * 0.1);
|
||||||
|
|
||||||
// BMS 最高允许温度 1ºC/位, -50 ºC 偏移量;数据范 围: -50 ºC ~+200 ºC
|
// BMS 最高允许温度 1ºC/位, -50 ºC 偏移量;数据范 围: -50 ºC ~+200 ºC
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
length = 1;
|
length = 1;
|
||||||
byte[] BMSMaxTemperatureByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] BMSMaxTemperatureByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String BMSMaxTemperature = String.valueOf(BytesUtil.bytesToIntLittle(BMSMaxTemperatureByteArr) - 50);
|
||||||
|
|
||||||
// BMS 整车动力 蓄电池荷电状态(soc) 0.1%/位, 0%偏移量;数据范围: 0~100%
|
// BMS 整车动力 蓄电池荷电状态(soc) 0.1%/位, 0%偏移量;数据范围: 0~100%
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
@@ -89,26 +95,30 @@ public class ParameterConfigurationHandler extends AbstractYkcHandler {
|
|||||||
byte[] BMSSocByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] BMSSocByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
String soc = YKCUtils.convertVoltageCurrent(BMSSocByteArr);
|
String soc = YKCUtils.convertVoltageCurrent(BMSSocByteArr);
|
||||||
|
|
||||||
|
|
||||||
// BMS 整车动力蓄电池当前电池电压 整车动力蓄电池总电压
|
// BMS 整车动力蓄电池当前电池电压 整车动力蓄电池总电压
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] BMSRealTimeVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] BMSRealTimeVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String BMSRealTimeVoltage = String.valueOf(BytesUtil.bytesToIntLittle(BMSRealTimeVoltageByteArr) * 0.1);
|
||||||
|
|
||||||
// 电桩最高输出电压 0.1 V /位, 0 V 偏移量
|
// 电桩最高输出电压 0.1 V /位, 0 V 偏移量
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] pileMaxOutputVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] pileMaxOutputVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String pileMaxOutputVoltage = String.valueOf(BytesUtil.bytesToIntLittle(pileMaxOutputVoltageByteArr) * 0.1);
|
||||||
|
|
||||||
// 电桩最低输出电压 0.1 V /位, 0 V 偏移量
|
// 电桩最低输出电压 0.1 V /位, 0 V 偏移量
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] pileMinOutputVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] pileMinOutputVoltageByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String pileMinOutputVoltage = String.valueOf(BytesUtil.bytesToIntLittle(pileMinOutputVoltageByteArr) * 0.1);
|
||||||
|
|
||||||
// 电桩最大输出电流 0.1 A/位, -400 A 偏移量
|
// 电桩最大输出电流 0.1 A/位, -400 A 偏移量
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] pileMaxOutputCurrentByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] pileMaxOutputCurrentByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String pileMaxOutputCurrent = String.valueOf(BytesUtil.bytesToIntLittle(pileMaxOutputCurrentByteArr) * 0.1 - 400);
|
||||||
|
|
||||||
// 电桩最小输出电流 0.1 A/位, -400 A 偏移量
|
// 电桩最小输出电流 0.1 A/位, -400 A 偏移量
|
||||||
startIndex += length;
|
startIndex += length;
|
||||||
byte[] pileMinOutputCurrentByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
byte[] pileMinOutputCurrentByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||||
|
String pileMinOutputCurrent = String.valueOf(BytesUtil.bytesToIntLittle(pileMinOutputCurrentByteArr) * 0.1 - 400);
|
||||||
|
|
||||||
// 查询该订单下信息,将起始soc传入
|
// 查询该订单下信息,将起始soc传入
|
||||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
||||||
|
|||||||
234
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/domain/ChargeAlgorithmData.java
vendored
Normal file
234
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/domain/ChargeAlgorithmData.java
vendored
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
package com.jsowell.thirdparty.platform.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电订单算法Data
|
||||||
|
*
|
||||||
|
* @author Lemon
|
||||||
|
* @Date 2024/11/19 14:02:40
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ChargeAlgorithmData {
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
private String orderCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始SOC
|
||||||
|
*/
|
||||||
|
private Integer initSoc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前soc
|
||||||
|
*/
|
||||||
|
private Integer currentSoc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警编码
|
||||||
|
*/
|
||||||
|
private String alarmCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计服务费
|
||||||
|
*/
|
||||||
|
private String currentServiceFee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总费用
|
||||||
|
*/
|
||||||
|
private String currentTotalFee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计充电量
|
||||||
|
*/
|
||||||
|
private String totalCharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电时长
|
||||||
|
*/
|
||||||
|
private Integer totalChargeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 剩余充电时间
|
||||||
|
*/
|
||||||
|
private Integer remainChargeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最高允许电流
|
||||||
|
*/
|
||||||
|
private String maxAllowElectricity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体最高允许电压
|
||||||
|
*/
|
||||||
|
private String singleMaxAllowVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直流充电电压
|
||||||
|
*/
|
||||||
|
private String dcv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直流充电电流
|
||||||
|
*/
|
||||||
|
private String dca;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BMS需求电压
|
||||||
|
*/
|
||||||
|
private String bmsDemandVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BMS需求电流
|
||||||
|
*/
|
||||||
|
private String bmsDemandElectricity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BMS充电模式
|
||||||
|
*/
|
||||||
|
private Integer bmsChargeMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电前电表读数
|
||||||
|
*/
|
||||||
|
private String readBeforeCharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前电表读数
|
||||||
|
*/
|
||||||
|
private String readCurrentCharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始充电时间
|
||||||
|
*/
|
||||||
|
private String beginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最高允许温度
|
||||||
|
*/
|
||||||
|
private String maxAllowTemp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电功率
|
||||||
|
*/
|
||||||
|
private String chargePower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池额定容量
|
||||||
|
*/
|
||||||
|
private String ratedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池标称总能量
|
||||||
|
*/
|
||||||
|
private String nominalEnergy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池额定总电压
|
||||||
|
*/
|
||||||
|
private String ratedVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体最高电压
|
||||||
|
*/
|
||||||
|
private String singleMaxVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体最低电压
|
||||||
|
*/
|
||||||
|
private String singleMinVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体最高温度
|
||||||
|
*/
|
||||||
|
private String singleMaxTemp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体最低温度
|
||||||
|
*/
|
||||||
|
private String singleMinTemp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出风口温度
|
||||||
|
*/
|
||||||
|
private String ventTemp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环境温度
|
||||||
|
*/
|
||||||
|
private String environmentTemp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电枪温度
|
||||||
|
*/
|
||||||
|
private String gunTemp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 舱门状态
|
||||||
|
*/
|
||||||
|
private Integer doorStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BMS版本
|
||||||
|
*/
|
||||||
|
private String bmsVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆测量充电电压
|
||||||
|
*/
|
||||||
|
private String measuringChargeVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆测量充电电流
|
||||||
|
*/
|
||||||
|
private String measuringChargeElectricity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最高单体电压组号
|
||||||
|
*/
|
||||||
|
private Integer maxSingleVoltageGroupNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最高单体电压编号
|
||||||
|
*/
|
||||||
|
private Integer maxSingleVoltageNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最高温度点编号
|
||||||
|
*/
|
||||||
|
private Integer maxTempPointNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最低温度点编号
|
||||||
|
*/
|
||||||
|
private Integer minTempPointNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池类型
|
||||||
|
*/
|
||||||
|
private String batteryType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池绝缘状态
|
||||||
|
*/
|
||||||
|
private Integer batteryInsulation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最高允许充电总电压
|
||||||
|
*/
|
||||||
|
private String maxAllowTotalVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电前总电压
|
||||||
|
*/
|
||||||
|
private String beforeChargeTotalVoltage;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user