mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update 算法应用平台Service
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.jsowell.netty.handler.yunkuaichong;
|
||||
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.core.domain.ykc.ChargingHandshakeData;
|
||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
@@ -11,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 充电握手
|
||||
*
|
||||
@@ -135,8 +139,30 @@ public class ChargingHandshakeHandler extends AbstractYkcHandler {
|
||||
length = 8;
|
||||
byte[] BMSSoftwareVersionByteArr = BytesUtil.copyBytes(msgBody, startIndex, length);
|
||||
|
||||
// 保存数据到redis
|
||||
// redisCache.setCacheObject();
|
||||
// 保存数据到redis(缓存3天)
|
||||
ChargingHandshakeData data = ChargingHandshakeData.builder()
|
||||
.transactionCode(transactionCode)
|
||||
.pileSn(pileSn)
|
||||
.connectorCode(connectorCode)
|
||||
.bmsCommunicationVersion(bmsCommunicationVersion)
|
||||
.bmsBatteryType(bmsBatteryType)
|
||||
.bmsBatteryCapacity(bmsBatteryCapacity)
|
||||
.bmsBatteryVoltage(bmsBatteryVoltage)
|
||||
.bmsBatteryFactory(bmsBatteryFactory)
|
||||
.bmsBatteryNum(bmsBatteryNum)
|
||||
.bmsProductionDateYear(bmsProductionDateYear)
|
||||
.bmsProductionDateMonth(bmsProductionDateMonth)
|
||||
.bmsProductionDateDay(bmsProductionDateDay)
|
||||
.bmsChargingTimes(bmsChargingTimes)
|
||||
// .BMSPropertyIdentificationByteArr(BMSPropertyIdentificationByteArr)
|
||||
// .BMSReservePosition(BMSReservePosition)
|
||||
.vinCode(vinCode)
|
||||
// .BMSSoftwareVersionByteArr(BMSSoftwareVersionByteArr)
|
||||
|
||||
.build();
|
||||
|
||||
String redisKey = CacheConstants.CHARGING_HANDSHAKE_DATA_BY_TRANSACTION_CODE + transactionCode;
|
||||
redisCache.setCacheObject(redisKey, data, 3, TimeUnit.DAYS);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user