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

@@ -2,9 +2,9 @@ package com.jsowell.thirdparty.platform.service.impl;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.service.OrderBasicInfoService;
import com.jsowell.pile.thirdparty.ParameterConfigData;
import com.jsowell.pile.vo.uniapp.customer.OrderVO;
@@ -37,12 +37,16 @@ public class ChargeAlgorithmService {
if (orderVO == null) {
return;
}
String transactionCode = orderVO.getTransactionCode();
// 获取0x17缓存中的信息
String redisKey = CacheConstants.PARAMETER_CONFIGURATION_BY_TRANSACTIONCODE + orderVO.getTransactionCode();
String redisKey = CacheConstants.PARAMETER_CONFIGURATION_BY_TRANSACTION_CODE + transactionCode;
ParameterConfigData parameterConfigData = redisCache.getCacheObject(redisKey);
if (parameterConfigData == null) {
return;
}
// 获取0x3b缓存信息
String transactionDataKey = CacheConstants.TRANSACTION_RECORD_BY_TRANSACTION_CODE + transactionCode;
TransactionRecordsData transactionRecordsData = redisCache.getCacheObject(transactionDataKey);
ChargeAlgorithmData data = ChargeAlgorithmData.builder()
.orderCode(orderCode)
@@ -61,13 +65,13 @@ public class ChargeAlgorithmService {
// .bmsDemandVoltage(parameterConfigData.get)
// .bmsDemandElectricity()
// .bmsChargeMode()
// .readBeforeCharge()
// .readCurrentCharge()
.readBeforeCharge(transactionRecordsData.getAmmeterTotalStart())
.readCurrentCharge(transactionRecordsData.getAmmeterTotalEnd())
.beginTime(orderVO.getStartTime())
.maxAllowTemp(parameterConfigData.getBmsMaxTemperature())
// .chargePower()
// .ratedCapacity()
// .nominalEnergy()
.nominalEnergy(parameterConfigData.getBmsSumEnergy())
// .ratedVoltage()
.singleMaxVoltage(parameterConfigData.getPileMaxOutputVoltage())
.singleMinVoltage(parameterConfigData.getPileMinOutputVoltage())