update 算法应用Service

This commit is contained in:
Lemon
2024-12-02 10:08:32 +08:00
parent 9abaf38542
commit ecdecbaf74
5 changed files with 23 additions and 8 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

@@ -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());