From 144526338d975ba3fab76843cb432c02b62b933a Mon Sep 17 00:00:00 2001 From: Lemon Date: Tue, 22 Apr 2025 13:41:47 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=20=E5=85=85=E7=94=B5=E7=AE=97?= =?UTF-8?q?=E6=B3=95=E4=B8=ADsoc=E4=B8=8D=E5=87=86=E7=A1=AE=EF=BC=8C?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E9=87=87=E7=94=A80x13=E4=B8=AD=E7=9A=84soc?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=E8=BF=87=E7=A8=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ChargeAlgorithmService.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ChargeAlgorithmService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ChargeAlgorithmService.java index 2fc616276..7f25d94ed 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ChargeAlgorithmService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ChargeAlgorithmService.java @@ -236,9 +236,18 @@ public class ChargeAlgorithmService { detailInfo = new ChargeAlgorithmData.ChargingDetailInfo(); String dateStr = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:00", DateUtils.parseDate(realTimeData_0x23.getDateTime())); - // 获取0x13数据 + // 获取该时间的0x13数据 + List RealTimeDataList = collect_0x13.get(dateStr); + if (RealTimeDataList != null) { + RealTimeMonitorData realTimeData_0x13 = RealTimeDataList.get(0); + + detailInfo.setGunTemp(realTimeData_0x13.getGunLineTemperature()); + detailInfo.setCurrentSoc(new BigDecimal(realTimeData_0x13.getSOC()).intValue()); + }else { + detailInfo.setGunTemp("0"); + detailInfo.setCurrentSoc(new BigDecimal(realTimeData_0x23.getSoc()).intValue()); + } detailInfo.setReadCurrentCharge(transactionRecordsData.getAmmeterTotalEnd()); - detailInfo.setCurrentSoc(new BigDecimal(realTimeData_0x23.getSoc()).intValue()); detailInfo.setReportTime(realTimeData_0x23.getDateTime().replaceAll("[^0-9]", "")); detailInfo.setMaxAllowElectricity(new BigDecimal(parameterConfigData.getBmsMaxCurrent()).toBigInteger().toString()); detailInfo.setSingleMaxAllowVoltage(new BigDecimal(parameterConfigData.getBmsMaxVoltage()).setScale(1, RoundingMode.HALF_DOWN).toString()); @@ -276,15 +285,7 @@ public class ChargeAlgorithmService { // detailInfo.setVentTemp(); // detailInfo.setEnvironmentTemp(); } - // 获取该时间的0x13数据 - List RealTimeDataList = collect_0x13.get(dateStr); - if (RealTimeDataList != null) { - RealTimeMonitorData realTimeData_0x13 = RealTimeDataList.get(0); - detailInfo.setGunTemp(realTimeData_0x13.getGunLineTemperature()); - }else { - detailInfo.setGunTemp("0"); - } resultList.add(detailInfo); }