Merge branch 'dev-new' into dev-new-rabbitmq

This commit is contained in:
Guoqs
2024-12-02 15:20:15 +08:00
6 changed files with 24 additions and 9 deletions

View File

@@ -51,12 +51,14 @@ public class ChargingHandshakeHandler extends AbstractYkcHandler {
startIndex += length;
length = 1;
byte[] pileConnectorNumByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
String connectorCode = BytesUtil.bcd2Str(pileConnectorNumByteArr);
// BMS 通信协议版本号 当前版本为 V1.1 表示为: byte3 byte2—0001Hbyte1—01H
startIndex += length;
length = 3;
byte[] BMSCommunicationProtocolVersionByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
// BMS 电池类型 01H:铅酸电池;02H:氢 电池;03H:磷酸铁锂电池;04H:锰 酸锂电池;05H:钴酸锂电池 ;06H: 三元材料电池;07H:聚合物锂离子 电池;08H:钛酸锂电池;FFH:其他
startIndex += length;
length = 1;

View File

@@ -15,7 +15,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@@ -146,7 +145,7 @@ public class ParameterConfigurationHandler extends AbstractYkcHandler {
.pileMinOutputCurrent(pileMinOutputCurrent)
.build();
String redisKey = CacheConstants.PARAMETER_CONFIGURATION_BY_TRANSACTIONCODE + transactionCode;
String redisKey = CacheConstants.PARAMETER_CONFIGURATION_BY_TRANSACTION_CODE + transactionCode;
redisCache.setCacheObject(redisKey, data, 7, TimeUnit.DAYS);
// 查询该订单下信息将起始soc传入

View File

@@ -81,7 +81,7 @@ public class ReservationChargingResponseHandler extends AbstractYkcHandler {
transactionCode, pileSn, connectorCode, resultCode, failedReason);
// 根据请求id在集合中找到与外部线程通信的SyncPromise对象
String msgId = ctx.channel().id().toString() + "_" + YKCFrameTypeCode.RESERVATION_CHARGING_SETUP_CODE.getCode();
String msgId = ctx.channel().id().toString() + "_" + YKCUtils.frameType2Str(YKCFrameTypeCode.RESERVATION_CHARGING_SETUP_CODE.getBytes());
log.info("同步获取响应数据-收到消息, msgId:{}", msgId);
SyncPromise syncPromise = RpcUtil.getSyncPromiseMap().get(msgId);
if(syncPromise != null) {

View File

@@ -33,6 +33,7 @@ import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
/**
* 交易记录确认
@@ -562,6 +563,10 @@ public class TransactionRecordsRequestHandler extends AbstractYkcHandler {
.logicCard(logicCard)
.build();
// 保存交易记录到redis (缓存时间1天)
String recordRedisKey = CacheConstants.TRANSACTION_RECORD_BY_TRANSACTION_CODE + transactionCode;
redisCache.setCacheObject(recordRedisKey, data, 1, TimeUnit.DAYS);
// 保存报文
String jsonMsg = JSON.toJSONString(data);
pileMsgRecordService.save(pileSn, pileSn + connectorCode, type, jsonMsg, ykcDataProtocol.getHEXString());