mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update
This commit is contained in:
@@ -8,6 +8,7 @@ import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.domain.ykc.*;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.RandomUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.ChargeAlgorithmRecord;
|
||||
import com.jsowell.pile.service.*;
|
||||
@@ -18,6 +19,7 @@ import com.jsowell.pile.vo.web.PileDetailVO;
|
||||
import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import com.jsowell.thirdparty.platform.domain.BatteryChargeReportData;
|
||||
import com.jsowell.thirdparty.platform.domain.BatteryReportResult;
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -216,6 +218,13 @@ public class BatteryChargeReportService {
|
||||
.map(PileConnectorInfoVO::getPileSn)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
String batteryType = String.valueOf(Integer.parseInt(chargingHandshakeData.getBmsBatteryType()));
|
||||
// 如果 batteryType != 1/2/3/4/5
|
||||
if (!StringUtils.equalsAny(batteryType, "1", "2", "3", "4", "5")) {
|
||||
// 随机生成一个1-3的数
|
||||
batteryType = String.valueOf(RandomUtils.nextInt(1, 4));
|
||||
}
|
||||
|
||||
BatteryChargeReportData data = BatteryChargeReportData.builder()
|
||||
.mfrID(mfrID)
|
||||
.siteName(stationVO.getStationName())
|
||||
@@ -233,10 +242,9 @@ public class BatteryChargeReportService {
|
||||
.gunNo(orderVO.getConnectorCode())
|
||||
.readBeforeCharge(transactionRecordsData.getAmmeterTotalStart())
|
||||
.doorStatus(Constants.zero)
|
||||
// .bmsChargeMode(Integer.parseInt(bmsDemandAndChargerOutputData.getBmsChargingModel()))
|
||||
.bmsChargeMode(1)
|
||||
.bmsChargeMode(Integer.parseInt(bmsDemandAndChargerOutputData.getBmsChargingModel()))
|
||||
.vin(transactionRecordsData.getVinCode())
|
||||
.batteryType(String.valueOf(Integer.parseInt(chargingHandshakeData.getBmsBatteryType())))
|
||||
.batteryType(batteryType)
|
||||
.nominalEnergy(new BigDecimal(parameterConfigData.getBmsSumEnergy()).toBigInteger().toString())
|
||||
.ratedCapacity(new BigDecimal(parameterConfigData.getBmsSumEnergy()).toBigInteger().toString())
|
||||
.ratedVoltage(chargingHandshakeData.getBmsBatteryVoltage())
|
||||
@@ -252,6 +260,7 @@ public class BatteryChargeReportService {
|
||||
|
||||
.build();
|
||||
|
||||
|
||||
List<BatteryChargeReportData
|
||||
.ChargeData> chargingDetailInfos = transformData(map);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user