mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
Merge branch 'dev-new' into dev-new-rabbitmq
# Conflicts: # jsowell-admin/src/test/java/PaymentTestController.java
This commit is contained in:
@@ -175,6 +175,21 @@ public class CacheConstants {
|
||||
*/
|
||||
public static final String TRANSACTION_RECORD_BY_TRANSACTION_CODE = "transaction_record_by_transaction_code:";
|
||||
|
||||
/**
|
||||
* 0x23缓存key
|
||||
*/
|
||||
public static final String BMS_DEMAND_AND_CHARGER_OUTPUT_BY_TRANSACTION_CODE = "bms_demand_and_charger_output_by_transaction_code:";
|
||||
|
||||
/**
|
||||
* 0x25缓存key
|
||||
*/
|
||||
public static final String BMS_CHARGE_INFO_BY_TRANSACTION_CODE = "bms_charge_info_by_transaction_code:";
|
||||
|
||||
/**
|
||||
* 0x15缓存key
|
||||
*/
|
||||
public static final String CHARGING_HANDSHAKE_DATA_BY_TRANSACTION_CODE = "charging_handshake_data_by_transaction_code:";
|
||||
|
||||
/**
|
||||
* 充电桩状态前缀
|
||||
*/
|
||||
|
||||
@@ -95,6 +95,7 @@ public class Constants {
|
||||
|
||||
public static final String OPERATORID_LIANLIAN = "MA1JLFUU8";
|
||||
public static final String OPERATORID_JIANG_SU = "MA1X78KH5";
|
||||
public static final String OPERATORID_GUI_ZHOU = "MAC9K4RRX";
|
||||
|
||||
public static final String MANUFACTURER_NAME = "举视(江苏)新能源设备制造有限公司";
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.jsowell.common.core.domain.ykc;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 0x25数据信息
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2024/12/10 15:45:14
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class BMSChargeInfoData {
|
||||
|
||||
/**
|
||||
* 交易流水号
|
||||
*/
|
||||
private String transactionCode;
|
||||
|
||||
/**
|
||||
* 桩编码
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 枪号
|
||||
*/
|
||||
private String connectorCode;
|
||||
|
||||
/**
|
||||
* BMS 最高单体动力蓄电池电压所在编号
|
||||
* 1/位, 1 偏移量;
|
||||
* 数据范围: 1~256
|
||||
*/
|
||||
private String bmsMaxVoltageNum;
|
||||
|
||||
/**
|
||||
* BMS 最高动力蓄电池温度
|
||||
* 1ºC/位, -50 ºC 偏移量;
|
||||
* 数据范围: -50 ºC ~+200 ºC
|
||||
*/
|
||||
private String bmsMaxBatteryTemperature;
|
||||
|
||||
/**
|
||||
* 最高温度检测点编号
|
||||
* 1/位, 1 偏移量;
|
||||
* 数据范围: 1~128
|
||||
*/
|
||||
private String maxTemperatureDetectionNum;
|
||||
|
||||
/**
|
||||
* 最低动力蓄电池温度
|
||||
* 1ºC/位, -50 ºC 偏移量;
|
||||
* 数据范围: -50 ºC ~+200 ºC
|
||||
*/
|
||||
private String minBatteryTemperature;
|
||||
|
||||
/**
|
||||
* 最低动力蓄电池温度检测点编号
|
||||
* 1/位, 1 偏移量;
|
||||
* 数据范围: 1~128
|
||||
*/
|
||||
private String minTemperatureDetectionNum;
|
||||
|
||||
/**
|
||||
* BMS 单体动力蓄电池电压过高 /过低
|
||||
* (<00> :=正常 ; <01> :=过高 ; <10>: =过低)
|
||||
*/
|
||||
private String singleBMSVoltageStatus;
|
||||
|
||||
/**
|
||||
* BMS 整车动力蓄电池荷电状态 SOC 过高/过低
|
||||
* (<00> :=正常 ; <01> :=过高 ; <10>: =过低)
|
||||
*/
|
||||
private String carBMSSocStatus;
|
||||
|
||||
/**
|
||||
* BMS 动力蓄电池充电过电流
|
||||
* (<00> :=正常 ; <01> :=过流 ; <10>: =不可信状态)
|
||||
*/
|
||||
private String bmsBatteryChargeCurrentStatus;
|
||||
|
||||
/**
|
||||
* BMS 动力蓄电池温度过高
|
||||
* (<00> :=正常 ; <01> :=过流 ; <10>: =不可信状态)
|
||||
*/
|
||||
private String bmsBatteryTemperature;
|
||||
|
||||
/**
|
||||
* BMS 动力蓄电池绝缘状态
|
||||
* (<00> :=正常 ; <01> :=过流 ; <10>: =不可信状态)
|
||||
*/
|
||||
private String bmsBatteryInsulationStatus;
|
||||
|
||||
/**
|
||||
* BMS 动力蓄电池组输出连接器连接状态
|
||||
* (<00> :=正常 ; <01> :=过流 ; <10>: =不可信状态)
|
||||
*/
|
||||
private String bmsBatteryOutputStatus;
|
||||
|
||||
/**
|
||||
* 充电禁止
|
||||
* (<00>: =禁止; <01>: =允许)
|
||||
*/
|
||||
private String chargeProhibit;
|
||||
|
||||
/**
|
||||
* 预留位
|
||||
*/
|
||||
private String noMeanPositionByteArr;
|
||||
|
||||
|
||||
private String dateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.jsowell.common.core.domain.ykc;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 0x23信息数据
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2024/12/9 14:33:35
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class BMSDemandAndChargerOutputData {
|
||||
|
||||
private String transactionCode; // 交易流水号
|
||||
private String pileSn; // 桩编号
|
||||
private String connectorCode; // 枪口号
|
||||
private String bmsVoltageDemand; // BMS 电压需求 0.1 V/位, 0 V 偏移量
|
||||
private String bmsCurrentDemand; // BMS 电流需求 0.1 A/位, -400 A 偏移量
|
||||
private String bmsChargingModel; // BMS 充电模式 0x01:恒压充电; 0x02:恒流充电
|
||||
private String bmsChargingVoltage; // BMS 充电电压测量值 0.1 V/位, 0 V 偏移量
|
||||
private String bmsChargingCurrent; // BMS 充电电流测量值 0.1 A/位, -400 A 偏移量
|
||||
private String bmsMaxVoltageAndGroup; // BMS 最高单体动力蓄电池电压及组号 1-12 位:最高单体动力蓄电池电压, 数据分辨率: 0.01 V/位, 0 V 偏移量;数据范围: 0~24 V; 13-16 位: 最高单体动力蓄电池电 压所在组号,数据分辨率: 1/位, 0 偏移量;数据范围: 0~15
|
||||
private String soc; // BMS 当前荷电状态 SOC( %) 1%/位, 0%偏移量; 数据范围: 0~100%
|
||||
private String bmsTheRestChargingTime; // BMS 估算剩余充电时间 1 min/位, 0 min 偏移量; 数据范围: 0~600 min
|
||||
private String pileVoltageOutput; // 电桩电压输出值 0.1 V/位, 0 V 偏移量
|
||||
private String pileCurrentOutput; // 电桩电流输出值 0.1 A/位, -400 A 偏移量
|
||||
private String chargingTime; // 累计充电时间 1 min/位, 0 min 偏移量; 数据范围: 0~600 min
|
||||
|
||||
private String dateTime;
|
||||
private String outputPower;
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.jsowell.common.core.domain.ykc;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 0x15充电握手Data
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2024/12/11 10:34:53
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ChargingHandshakeData {
|
||||
/**
|
||||
* 交易流水号
|
||||
*/
|
||||
private String transactionCode;
|
||||
|
||||
/**
|
||||
* 桩编码
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 枪号
|
||||
*/
|
||||
private String connectorCode;
|
||||
|
||||
/**
|
||||
* BMS 通信协议版本号 当前版本为 V1.1, 表示为: byte3, byte2—0001H;byte1—01H
|
||||
*/
|
||||
private String bmsCommunicationVersion;
|
||||
|
||||
/**
|
||||
* BMS 电池类型
|
||||
*
|
||||
* 01H:铅酸电池;
|
||||
* 02H:氢电池;
|
||||
* 03H:磷酸铁锂电池;
|
||||
* 04H:锰酸锂电池;
|
||||
* 05H:钴酸锂电池;
|
||||
* 06H:三元材料电池;
|
||||
* 07H:聚合物锂离子电池;
|
||||
* 08H:钛酸锂电池;
|
||||
* FFH:其他
|
||||
*/
|
||||
private String bmsBatteryType;
|
||||
|
||||
/**
|
||||
* BMS 整车动力蓄电池系统额定容量
|
||||
* 0.1 Ah /位, 0 Ah 偏移量
|
||||
*/
|
||||
private String bmsBatteryCapacity;
|
||||
|
||||
/**
|
||||
* BMS 整车动力蓄电池系统额定总电压
|
||||
* 0.1V/位, 0V 偏移量
|
||||
*/
|
||||
private String bmsBatteryVoltage;
|
||||
|
||||
/**
|
||||
* BMS 电池生产厂商名称
|
||||
*/
|
||||
private String bmsBatteryFactory;
|
||||
|
||||
/**
|
||||
* BMS 电池组序号
|
||||
*/
|
||||
private String bmsBatteryNum;
|
||||
|
||||
/**
|
||||
* BMS 电池组生产日期年
|
||||
* 1985 年偏移量,
|
||||
* 数据范围: 1985~ 2235 年
|
||||
*/
|
||||
private String bmsProductionDateYear;
|
||||
|
||||
/**
|
||||
* BMS 电池组生产日期月
|
||||
* 0 月偏移量,
|
||||
* 数据范围: 1~12 月
|
||||
*/
|
||||
private String bmsProductionDateMonth;
|
||||
|
||||
/**
|
||||
* BMS 电池组生产日期日
|
||||
* 0 日偏移量,
|
||||
* 数据范围: 1~31 日
|
||||
*/
|
||||
private String bmsProductionDateDay;
|
||||
|
||||
/**
|
||||
* BMS 电池组充电次数
|
||||
* 1 次/位, 0 次偏移量,
|
||||
* 以 BMS 统 计为准
|
||||
*/
|
||||
private String bmsChargingTimes;
|
||||
|
||||
/**
|
||||
* BMS 电池组产权标识 (<0>: =租赁; <1>: =车自有)
|
||||
*/
|
||||
private String BMSPropertyIdentificationByteArr;
|
||||
|
||||
/**
|
||||
* BMS 预留位
|
||||
*/
|
||||
private String BMSReservePosition;
|
||||
|
||||
/**
|
||||
* BMS 车辆识别码
|
||||
*/
|
||||
private String vinCode;
|
||||
|
||||
/**
|
||||
* BMS 软件版本号
|
||||
*/
|
||||
private String BMSSoftwareVersionByteArr;
|
||||
}
|
||||
@@ -115,6 +115,9 @@ public class TransactionRecordsData {
|
||||
// 交易时间 CP56Time2a 格式
|
||||
private String transactionTime;
|
||||
|
||||
// 停止原因码(16进制)
|
||||
private String stopReasonCode;
|
||||
|
||||
// 停止原因
|
||||
private String stopReasonMsg;
|
||||
|
||||
|
||||
@@ -1,14 +1,221 @@
|
||||
package com.jsowell.common.core.domain.ykc.device2platform;
|
||||
|
||||
import com.jsowell.common.core.domain.ykc.YKCBaseMessage;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 计费模板验证请求数据
|
||||
* 充电握手
|
||||
*/
|
||||
@Data
|
||||
public class Data0x15 extends YKCBaseMessage {
|
||||
|
||||
/**
|
||||
* 交易流水号
|
||||
*/
|
||||
private String transactionCode;
|
||||
|
||||
/**
|
||||
* 桩编码
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 枪号
|
||||
*/
|
||||
private String connectorCode;
|
||||
|
||||
/**
|
||||
* BMS 通信协议版本号 当前版本为 V1.1, 表示为: byte3, byte2—0001H;byte1—01H
|
||||
*/
|
||||
private String bmsCommunicationVersion;
|
||||
|
||||
/**
|
||||
* BMS 电池类型
|
||||
*
|
||||
* 01H:铅酸电池;
|
||||
* 02H:氢电池;
|
||||
* 03H:磷酸铁锂电池;
|
||||
* 04H:锰酸锂电池;
|
||||
* 05H:钴酸锂电池;
|
||||
* 06H:三元材料电池;
|
||||
* 07H:聚合物锂离子电池;
|
||||
* 08H:钛酸锂电池;
|
||||
* FFH:其他
|
||||
*/
|
||||
private String bmsBatteryType;
|
||||
|
||||
/**
|
||||
* BMS 整车动力蓄电池系统额定容量
|
||||
* 0.1 Ah /位, 0 Ah 偏移量
|
||||
*/
|
||||
private String bmsBatteryCapacity;
|
||||
|
||||
/**
|
||||
* BMS 整车动力蓄电池系统额定总电压
|
||||
* 0.1V/位, 0V 偏移量
|
||||
*/
|
||||
private String bmsBatteryVoltage;
|
||||
|
||||
/**
|
||||
* BMS 电池生产厂商名称
|
||||
*/
|
||||
private String bmsBatteryFactory;
|
||||
|
||||
/**
|
||||
* BMS 电池组序号
|
||||
*/
|
||||
private String bmsBatteryNum;
|
||||
|
||||
/**
|
||||
* BMS 电池组生产日期年
|
||||
* 1985 年偏移量,
|
||||
* 数据范围: 1985~ 2235 年
|
||||
*/
|
||||
private String bmsProductionDateYear;
|
||||
|
||||
/**
|
||||
* BMS 电池组生产日期月
|
||||
* 0 月偏移量,
|
||||
* 数据范围: 1~12 月
|
||||
*/
|
||||
private String bmsProductionDateMonth;
|
||||
|
||||
/**
|
||||
* BMS 电池组生产日期日
|
||||
* 0 日偏移量,
|
||||
* 数据范围: 1~31 日
|
||||
*/
|
||||
private String bmsProductionDateDay;
|
||||
|
||||
/**
|
||||
* BMS 电池组充电次数
|
||||
* 1 次/位, 0 次偏移量,
|
||||
* 以 BMS 统 计为准
|
||||
*/
|
||||
private String bmsChargingTimes;
|
||||
|
||||
/**
|
||||
* BMS 电池组产权标识 (<0>: =租赁; <1>: =车自有)
|
||||
*/
|
||||
private String bmsPropertyIdentification;
|
||||
|
||||
/**
|
||||
* BMS 预留位
|
||||
*/
|
||||
private String bmsReservePosition;
|
||||
|
||||
/**
|
||||
* BMS 车辆识别码
|
||||
*/
|
||||
private String vinCode;
|
||||
|
||||
/**
|
||||
* BMS 软件版本号
|
||||
*/
|
||||
private String bmsSoftwareVersion;
|
||||
|
||||
public Data0x15(byte[] messageBytes) {
|
||||
super(messageBytes);
|
||||
|
||||
// 初始startIndex为6, 跳过消息头等6个字节
|
||||
int startIndex = 6;
|
||||
|
||||
// 交易流水号
|
||||
int length = 16;
|
||||
byte[] serialNumByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.transactionCode = BytesUtil.bcd2Str(serialNumByteArr);
|
||||
|
||||
// 桩编码
|
||||
startIndex += length;
|
||||
length = 7;
|
||||
byte[] pileSnByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.pileSn = BytesUtil.bcd2Str(pileSnByteArr);
|
||||
|
||||
// 枪号
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] pileConnectorNumByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.connectorCode = BytesUtil.bcd2Str(pileConnectorNumByteArr);
|
||||
|
||||
// BMS 通信协议版本号 当前版本为 V1.1, 表示为: byte3, byte2—0001H;byte1—01H
|
||||
startIndex += length;
|
||||
length = 3;
|
||||
byte[] BMSCommunicationProtocolVersionByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsCommunicationVersion = "V1.1";
|
||||
|
||||
// BMS 电池类型 01H:铅酸电池;02H:氢 电池;03H:磷酸铁锂电池;04H:锰 酸锂电池;05H:钴酸锂电池 ;06H: 三元材料电池;07H:聚合物锂离子 电池;08H:钛酸锂电池;FFH:其他
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] BMSBatteryTypeByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryType = BytesUtil.bcd2Str(BMSBatteryTypeByteArr); // 03
|
||||
|
||||
// BMS 整车动力蓄电池系统额定容量 0.1 Ah /位, 0 Ah 偏移量
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] BMSBatteryCapacityByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryCapacity = String.valueOf(BytesUtil.bytesToIntLittle(BMSBatteryCapacityByteArr) * 0.1); // 171.0
|
||||
|
||||
// BMS 整车动力蓄电池系统额定总电压 0.1V/位, 0V 偏移量
|
||||
startIndex += length;
|
||||
byte[] BMSBatteryVoltageByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryVoltage = String.valueOf(BytesUtil.bytesToIntLittle(BMSBatteryVoltageByteArr) * 0.1); // 347.8
|
||||
|
||||
// BMS 电池生产厂商名称
|
||||
startIndex += length;
|
||||
length = 4;
|
||||
byte[] BMSBatteryFactoryByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryFactory = BytesUtil.ascii2Str(BMSBatteryFactoryByteArr); // CATL
|
||||
|
||||
// BMS 电池组序号
|
||||
startIndex += length;
|
||||
byte[] BMSBatteryNumByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryNum = BytesUtil.bin2HexStr(BMSBatteryNumByteArr);
|
||||
|
||||
// BMS 电池组生产日期年 1985 年偏移量, 数据范围: 1985~ 2235 年
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] BMSProductionDateYearByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsProductionDateYear = BytesUtil.bin2HexStr(BMSProductionDateYearByteArr);
|
||||
|
||||
// BMS 电池组生产日期月 0 月偏移量, 数据范围: 1~12 月
|
||||
startIndex += length;
|
||||
byte[] BMSProductionDateMonthByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsProductionDateMonth = BytesUtil.bin2HexStr(BMSProductionDateMonthByteArr);
|
||||
|
||||
// BMS 电池组生产日期日 0 日偏移量, 数据范围: 1~31 日
|
||||
startIndex += length;
|
||||
byte[] BMSProductionDateDayByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsProductionDateDay = BytesUtil.bin2HexStr(BMSProductionDateDayByteArr);
|
||||
|
||||
// BMS 电池组充电次数 1 次/位, 0 次偏移量, 以 BMS 统 计为准
|
||||
startIndex += length;
|
||||
length = 3;
|
||||
byte[] BMSChargingTimesByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsChargingTimes = BytesUtil.bin2HexStr(BMSChargingTimesByteArr);
|
||||
|
||||
// BMS 电池组产权标识 (<0>: =租赁; <1>: =车自有)
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] bmsPropertyIdentificationByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsPropertyIdentification = BytesUtil.bin2HexStr(bmsPropertyIdentificationByteArr);
|
||||
|
||||
// BMS 预留位
|
||||
startIndex += length;
|
||||
byte[] BMSReservePosition = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsReservePosition = BytesUtil.bin2HexStr(BMSReservePosition);
|
||||
|
||||
// BMS 车辆识别码
|
||||
startIndex += length;
|
||||
length = 17;
|
||||
byte[] vinByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.vinCode = YKCUtils.parseVin(vinByteArr);
|
||||
|
||||
// BMS 软件版本号
|
||||
startIndex += length;
|
||||
length = 8;
|
||||
byte[] BMSSoftwareVersionByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsSoftwareVersion = BytesUtil.bcd2Str(BMSSoftwareVersionByteArr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,198 @@
|
||||
package com.jsowell.common.core.domain.ykc.device2platform;
|
||||
|
||||
import com.jsowell.common.core.domain.ykc.YKCBaseMessage;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 计费模板验证请求数据
|
||||
* 充电过程 BMS 信息
|
||||
*/
|
||||
@Data
|
||||
public class Data0x25 extends YKCBaseMessage {
|
||||
|
||||
/**
|
||||
* 交易流水号 BCD 码 16 见名词解释
|
||||
*/
|
||||
private String transactionCode;
|
||||
|
||||
/**
|
||||
* 桩编号 BCD 码 7 不足 7 位补 0
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 枪号 BCD 码 1
|
||||
*/
|
||||
private String connectorCode;
|
||||
|
||||
/**
|
||||
* BMS 最高单体动力蓄电池电压所在编号 1/位, 1 偏移量; 数据范围: 1~256
|
||||
*/
|
||||
private String bmsMaxVoltageNum;
|
||||
|
||||
/**
|
||||
* BMS 最高动力蓄电池温度 1ºC/位, -50 ºC 偏移量;数据范 围: -50 ºC ~+200 ºC
|
||||
*/
|
||||
private String bmsMaxBatteryTemperature;
|
||||
|
||||
/**
|
||||
* 最高温度检测点编号 1/位, 1 偏移量; 数据范围: 1~128
|
||||
*/
|
||||
private String maxTemperatureDetectionNum;
|
||||
|
||||
/**
|
||||
* 最低动力蓄电池温度
|
||||
*/
|
||||
private String minBatteryTemperature;
|
||||
|
||||
/**
|
||||
* 最低动力蓄电池温度检测点编号
|
||||
*/
|
||||
private String minTemperatureDetectionNum;
|
||||
|
||||
/**
|
||||
* BMS 单体动力蓄电池电压过高 /过低
|
||||
* @param messageBytes
|
||||
*/
|
||||
private String singleBMSVoltageStatus;
|
||||
|
||||
/**
|
||||
* BMS 整车动力蓄电池荷电状态 SOC 过高/过低 (<00> :=正常 ; <01> :=过高 ; <10>: =过低)
|
||||
*/
|
||||
private String carBMSSocStatus;
|
||||
|
||||
/**
|
||||
* BMS 动力蓄电池充电过电流 (<00> :=正常 ; <01> :=过流 ; <10>: =不可信状态)
|
||||
*/
|
||||
private String bmsBatteryChargeCurrentStatus;
|
||||
|
||||
/**
|
||||
* BMS 动力蓄电池温度过高 (<00> :=正常 ; <01> :=过流 ; <10>: =不可信状态)
|
||||
*/
|
||||
private String bmsBatteryTemperature;
|
||||
|
||||
/**
|
||||
* BMS 动力蓄电池绝缘状态 (<00> :=正常 ; <01> :=过流 ; <10>: =不可信状态)
|
||||
*/
|
||||
private String bmsBatteryInsulationStatus;
|
||||
|
||||
/**
|
||||
* BMS 动力蓄电池组输出连接器连接状态 (<00> :=正常 ; <01> :=过流 ; <10>: =不可信状态)
|
||||
*/
|
||||
private String bmsBatteryOutputStatus;
|
||||
|
||||
/**
|
||||
* 充电禁止 (<00>: =禁止; <01>: =允许)
|
||||
*/
|
||||
private String chargeProhibit;
|
||||
|
||||
/**
|
||||
* 预留位
|
||||
*/
|
||||
private String reservedBit;
|
||||
|
||||
public Data0x25(byte[] messageBytes) {
|
||||
super(messageBytes);
|
||||
|
||||
// 初始startIndex为6, 跳过消息头等6个字节
|
||||
int startIndex = 6;
|
||||
|
||||
// 交易流水号
|
||||
int length = 16;
|
||||
byte[] orderCodeByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.transactionCode = BytesUtil.bcd2Str(orderCodeByteArr);
|
||||
|
||||
// 桩编码
|
||||
startIndex += length;
|
||||
length = 7;
|
||||
byte[] pileSnByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.pileSn = BytesUtil.bcd2Str(pileSnByteArr);
|
||||
|
||||
// 枪号
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] connectorCodeByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.connectorCode = BytesUtil.bcd2Str(connectorCodeByteArr);
|
||||
|
||||
// BMS 最高单体动力蓄电池电压 所在编号
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] bmsMaxVoltageNumByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsMaxVoltageNum = String.valueOf(BytesUtil.bytesToIntLittle(bmsMaxVoltageNumByteArr));
|
||||
|
||||
// BMS 最高动力蓄电池温度
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] BMSMaxBatteryTemperatureByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsMaxBatteryTemperature = String.valueOf(BytesUtil.bytesToIntLittle(BMSMaxBatteryTemperatureByteArr) - 50);
|
||||
|
||||
// 最高温度检测点编号
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] maxTemperatureDetectionNumByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.maxTemperatureDetectionNum = String.valueOf(BytesUtil.bytesToIntLittle(maxTemperatureDetectionNumByteArr) + 1);
|
||||
|
||||
|
||||
// 最低动力蓄电池温度
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] minBatteryTemperatureByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.minBatteryTemperature = String.valueOf(BytesUtil.bytesToIntLittle(minBatteryTemperatureByteArr) - 50);
|
||||
|
||||
|
||||
// 最低动力蓄电池温度检测点 编号
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
byte[] minTemperatureDetectionNumByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.minTemperatureDetectionNum = String.valueOf(BytesUtil.bytesToIntLittle(minTemperatureDetectionNumByteArr) + 1);
|
||||
|
||||
|
||||
// BMS 单体动力蓄电池电压过高 /过低
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] singleBMSVoltageStatusByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.singleBMSVoltageStatus = BytesUtil.bcd2Str(singleBMSVoltageStatusByteArr);
|
||||
|
||||
// BMS 整车动力蓄电池荷电状态 SOC 过高/过低
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] carBMSSocStatusByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.carBMSSocStatus = BytesUtil.bcd2Str(carBMSSocStatusByteArr);
|
||||
|
||||
// BMS 动力蓄电池充电过电流
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] BMSBatteryChargeCurrentStatusByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryChargeCurrentStatus = BytesUtil.bcd2Str(BMSBatteryChargeCurrentStatusByteArr);
|
||||
|
||||
// BMS 动力蓄电池温度过高
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] BMSBatteryTemperatureByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryTemperature = BytesUtil.bcd2Str(BMSBatteryTemperatureByteArr);
|
||||
|
||||
// BMS 动力蓄电池绝缘状态
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] BMSBatteryInsulationStatusByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryInsulationStatus = BytesUtil.bcd2Str(BMSBatteryInsulationStatusByteArr);
|
||||
|
||||
// BMS 动力蓄电池组输出连接器 连接状态
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] BMSBatteryOutputStatusByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.bmsBatteryOutputStatus = BytesUtil.bcd2Str(BMSBatteryOutputStatusByteArr);
|
||||
|
||||
// 充电禁止
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] chargeProhibitByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.chargeProhibit = BytesUtil.bcd2Str(chargeProhibitByteArr);
|
||||
|
||||
// 预留位
|
||||
startIndex += length;
|
||||
length = 2;
|
||||
byte[] reservedBitByteArr = BytesUtil.copyBytes(messageBytes, startIndex, length);
|
||||
this.reservedBit = BytesUtil.bcd2Str(reservedBitByteArr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,6 +187,14 @@ public enum ReturnCodeEnum {
|
||||
|
||||
CODE_START_PERSONAL_PILE_CHARGING_ERROR("00400020", "个人桩启动充电异常"),
|
||||
|
||||
CODE_PILE_MEMBER_RELATION_IS_EMPTY("00400021", "个人桩绑定列表为空"),
|
||||
|
||||
CODE_NO_ADMIN_FOR_PILE("00400022", "充电桩未设置管理员"),
|
||||
|
||||
CODE_ALREADY_AN_ADMIN("00400023", "您已经是此充电桩管理员, 无需再次绑定"),
|
||||
|
||||
CODE_ALREADY_AN_USER("00400024", "您已经是此充电桩用户, 无需再次绑定"),
|
||||
|
||||
/* 个人桩 end */
|
||||
|
||||
CODE_THIS_CARNO_HAS_BEEN_BINDING("00500001", "当前车牌号已经绑定,请检查!"),
|
||||
|
||||
@@ -394,6 +394,7 @@ public class YKCUtils {
|
||||
|
||||
/**
|
||||
* 保存soc
|
||||
* 默认保存7天
|
||||
* @param transactionCode
|
||||
* @param soc
|
||||
*/
|
||||
@@ -429,16 +430,27 @@ public class YKCUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据交易流水号获取redis保存的soc信息
|
||||
*/
|
||||
public static Map<String, String> getSOCMap(String transactionCode) {
|
||||
String hashKey = CacheConstants.GET_THE_SOC + transactionCode;
|
||||
RedisCache staticRedisCache = StaticRedisCache.staticRedisCache;
|
||||
return staticRedisCache.getCacheMap(hashKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据的交易码获取当前soc
|
||||
* @param transactionCode
|
||||
*/
|
||||
public static String getCurrentSOC(String transactionCode) {
|
||||
String hashKey = CacheConstants.GET_THE_SOC + transactionCode;
|
||||
RedisCache staticRedisCache = StaticRedisCache.staticRedisCache;
|
||||
Map<String, Object> cacheMap = staticRedisCache.getCacheMap(hashKey);
|
||||
// String hashKey = CacheConstants.GET_THE_SOC + transactionCode;
|
||||
// RedisCache staticRedisCache = StaticRedisCache.staticRedisCache;
|
||||
// Map<String, Object> cacheMap = staticRedisCache.getCacheMap(hashKey);
|
||||
|
||||
Map<String, String> socMap = getSOCMap(transactionCode);
|
||||
// 获取最小值和最大值, 两个值中最大的为当前soc
|
||||
return (String) cacheMap.get("max");
|
||||
return (String) socMap.get("max");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user