From 6e8ccb131dff0e28c06da85dc2c2bb215266faed Mon Sep 17 00:00:00 2001 From: Lemon Date: Mon, 21 Apr 2025 10:07:42 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=E7=94=B5=E6=B1=A0=E7=AE=97?= =?UTF-8?q?=E6=B3=95=E5=BA=94=E7=94=A8Service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/domain/ChargeAlgorithmRecord.java | 7 ++ .../ChargeAlgorithmRecordServiceImpl.java | 9 +- .../customer/ChargeAlgorithmRecordVO.java | 97 ++++++++++++++++++- .../pile/ChargeAlgorithmRecordMapper.xml | 9 +- .../service/impl/ChargeAlgorithmService.java | 9 +- 5 files changed, 124 insertions(+), 7 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/ChargeAlgorithmRecord.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/ChargeAlgorithmRecord.java index 342ff9571..9d9ab57de 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/ChargeAlgorithmRecord.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/ChargeAlgorithmRecord.java @@ -143,6 +143,12 @@ public class ChargeAlgorithmRecord extends BaseEntity { @Excel(name = "故障体系指标") private String failureMetrics; + /** + * 性能体系指标 + */ + @Excel(name = "性能体系指标") + private String performanceMetrics; + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.JSON_STYLE) @@ -167,6 +173,7 @@ public class ChargeAlgorithmRecord extends BaseEntity { .append("maxAllowableElectricityAlarm", getMaxAllowableElectricityAlarm()) .append("securitySystemLevel", getSecuritySystemLevel()) .append("failureMetrics", getFailureMetrics()) + .append("performanceMetrics", getPerformanceMetrics()) .append("createTime", getCreateTime()) .toString(); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ChargeAlgorithmRecordServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ChargeAlgorithmRecordServiceImpl.java index ece88e892..461d0904c 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ChargeAlgorithmRecordServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ChargeAlgorithmRecordServiceImpl.java @@ -108,6 +108,12 @@ public class ChargeAlgorithmRecordServiceImpl implements ChargeAlgorithmRecordSe String securitySystemLevel = record.getSecuritySystemLevel(); ChargeAlgorithmRecordVO.SecuritySystem securitySystem = JSON.parseObject(securitySystemLevel, ChargeAlgorithmRecordVO.SecuritySystem.class); + String failureMetricsStr = record.getFailureMetrics(); + ChargeAlgorithmRecordVO.FailureMetrics failureMetrics = JSON.parseObject(failureMetricsStr, ChargeAlgorithmRecordVO.FailureMetrics.class); + + String performanceMetricsStr = record.getPerformanceMetrics(); + ChargeAlgorithmRecordVO.PerformanceMetrics performanceMetrics = JSON.parseObject(performanceMetricsStr, ChargeAlgorithmRecordVO.PerformanceMetrics.class); + ChargeAlgorithmRecordVO vo = ChargeAlgorithmRecordVO.builder() .orderCode(record.getOrderCode()) .score(record.getScore()) @@ -128,7 +134,8 @@ public class ChargeAlgorithmRecordServiceImpl implements ChargeAlgorithmRecordSe .maxAllowableVoltageAlarm(record.getMaxAllowableVoltageAlarm()) .maxAllowableElectricityAlarm(record.getMaxAllowableElectricityAlarm()) .securitySystemLevel(securitySystem) - .failureMetrics(record.getFailureMetrics()) + .failureMetrics(failureMetrics) + .performanceMetrics(performanceMetrics) .build(); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/ChargeAlgorithmRecordVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/ChargeAlgorithmRecordVO.java index 16d19a78b..8974bf8eb 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/ChargeAlgorithmRecordVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/ChargeAlgorithmRecordVO.java @@ -1,5 +1,6 @@ package com.jsowell.pile.vo.uniapp.customer; +import com.alibaba.fastjson2.annotation.JSONField; import com.jsowell.common.annotation.Excel; import lombok.AllArgsConstructor; import lombok.Builder; @@ -7,6 +8,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.math.BigDecimal; +import java.util.List; /** * 电池充电订单报告VO @@ -138,7 +140,9 @@ public class ChargeAlgorithmRecordVO { * 故障体系指标 */ @Excel(name = "故障体系指标") - private String failureMetrics; + private FailureMetrics failureMetrics; + + private PerformanceMetrics performanceMetrics; @Data public static class SecuritySystem{ @@ -155,4 +159,95 @@ public class ChargeAlgorithmRecordVO { } } + + @Data + public static class FailureMetrics{ + // @JSONField(name = "volt_rise_alarm") + private VoltRiseAlarm voltRiseAlarm; + + private VoltRiseAlarm voltDecayAlarm; + + private VoltRiseAlarm tempDiffAlarm; + + private VoltRiseAlarm tempRiseAlarm; + + private VoltRiseAlarm socAlarm; + + @Data + public static class VoltRiseAlarm{ + private List threshold; + + private String result; + + private String value; + } + + @Data + public static class voltDecayAlarm{ + private List threshold; + + private String result; + + private String value; + } + + @Data + public static class tempDiffAlarm{ + private List threshold; + + private String result; + + private String value; + } + + @Data + public static class tempRiseAlarm{ + private List threshold; + + private String result; + + private String value; + } + + @Data + public static class socAlarm{ + private List threshold; + + private String result; + + private String value; + } + } + + public static class PerformanceMetrics{ + private ChargingLoss chargingLoss; + private BMSAccuracy bmsAccuracy; + private DCInternalResistance dcInternalResistance; + + public static class ChargingLoss{ + private List threshold; + + private String result; + + private String value; + } + + public static class BMSAccuracy{ + private List threshold; + + private String result; + + private String value; + } + + public static class DCInternalResistance{ + private List threshold; + + private String result; + + private String value; + } + } + + } diff --git a/jsowell-pile/src/main/resources/mapper/pile/ChargeAlgorithmRecordMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ChargeAlgorithmRecordMapper.xml index e2f808a82..8720cfbb5 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/ChargeAlgorithmRecordMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/ChargeAlgorithmRecordMapper.xml @@ -26,11 +26,14 @@ + - select id, order_code, score, capacity_metrics, energy_indicator, consistency, temp_consistency, volt_consistency, capacity_consistency, sot, thermal_runaway, cooling, seal, current_soc, soc_alarm, temp_diff_alarm, temp_rise_alarm, max_allowable_voltage_alarm, max_allowable_electricity_alarm, security_system_level, failure_metrics, create_time from charge_algorithm_record + select id, order_code, score, capacity_metrics, energy_indicator, consistency, temp_consistency, volt_consistency, + capacity_consistency, sot, thermal_runaway, cooling, seal, current_soc, soc_alarm, temp_diff_alarm, temp_rise_alarm, + max_allowable_voltage_alarm, max_allowable_electricity_alarm, security_system_level, failure_metrics, performance_metrics, create_time from charge_algorithm_record @@ -87,6 +91,7 @@ max_allowable_electricity_alarm, security_system_level, failure_metrics, + performance_metrics, create_time, @@ -110,6 +115,7 @@ #{maxAllowableElectricityAlarm}, #{securitySystemLevel}, #{failureMetrics}, + #{performanceMetrics}, #{createTime}, @@ -137,6 +143,7 @@ max_allowable_electricity_alarm = #{maxAllowableElectricityAlarm}, security_system_level = #{securitySystemLevel}, failure_metrics = #{failureMetrics}, + performance_metrics = #{performanceMetrics}, create_time = #{createTime}, where id = #{id} 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 0cfdb0766..2fc616276 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 @@ -28,6 +28,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.*; import java.util.stream.Collectors; @@ -240,20 +241,20 @@ public class ChargeAlgorithmService { 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(parameterConfigData.getBmsMaxVoltage()); + detailInfo.setSingleMaxAllowVoltage(new BigDecimal(parameterConfigData.getBmsMaxVoltage()).setScale(1, RoundingMode.HALF_DOWN).toString()); detailInfo.setDcv(new BigDecimal(realTimeData_0x23.getPileVoltageOutput()).toBigInteger().toString()); detailInfo.setDca(new BigDecimal(realTimeData_0x23.getPileCurrentOutput()).toBigInteger().toString()); detailInfo.setBmsDemandVoltage(new BigDecimal(realTimeData_0x23.getBmsVoltageDemand()).toBigInteger().toString()); detailInfo.setBmsDemandElectricity(new BigDecimal(realTimeData_0x23.getBmsCurrentDemand()).toBigInteger().toString()); detailInfo.setChargePower(realTimeData_0x23.getOutputPower()); - detailInfo.setSingleMaxVoltage(parameterConfigData.getPileMaxOutputVoltage()); - detailInfo.setSingleMinVoltage(parameterConfigData.getPileMinOutputVoltage()); + detailInfo.setSingleMaxVoltage(new BigDecimal(parameterConfigData.getPileMaxOutputVoltage()).setScale(1, RoundingMode.HALF_DOWN).toString()); + detailInfo.setSingleMinVoltage(new BigDecimal(parameterConfigData.getPileMinOutputVoltage()).setScale(1, RoundingMode.HALF_DOWN).toString()); detailInfo.setMeasuringChargeVoltage(new BigDecimal(realTimeData_0x23.getBmsChargingVoltage()).toBigInteger().toString()); detailInfo.setMeasuringChargeElectricity(new BigDecimal(realTimeData_0x23.getBmsChargingCurrent()).toBigInteger().toString()); detailInfo.setMaxSingleVoltageGroupNum(new BigDecimal(realTimeData_0x23.getBmsMaxVoltageAndGroup()).intValue()); - detailInfo.setMaxAllowTotalVoltage(parameterConfigData.getBmsMaxChargingVoltage()); + detailInfo.setMaxAllowTotalVoltage(new BigDecimal(parameterConfigData.getBmsMaxChargingVoltage()).toBigInteger().toString()); detailInfo.setBeforeChargeTotalVoltage(new BigDecimal(parameterConfigData.getBmsRealTimeVoltage()).toBigInteger().toString()); detailInfo.setVentTemp("0");