update 电池算法应用Service

This commit is contained in:
Lemon
2025-04-16 10:17:48 +08:00
parent 91c08e4b0a
commit 1b2d17fae8
4 changed files with 206 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.ChargeAlgorithmRecord;
import com.jsowell.pile.vo.uniapp.customer.ChargeAlgorithmRecordVO;
/**
* 电池充电算法记录Service接口
@@ -64,5 +65,8 @@ public interface ChargeAlgorithmRecordService {
* @param orderCode
* @return
*/
ChargeAlgorithmRecordVO queryVOByOrderCode(String orderCode);
ChargeAlgorithmRecord queryRecordByOrderCode(String orderCode);
}

View File

@@ -2,8 +2,10 @@ package com.jsowell.pile.service.impl;
import java.util.List;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.service.ChargeAlgorithmRecordService;
import com.jsowell.pile.vo.uniapp.customer.ChargeAlgorithmRecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jsowell.pile.mapper.ChargeAlgorithmRecordMapper;
@@ -87,13 +89,50 @@ public class ChargeAlgorithmRecordServiceImpl implements ChargeAlgorithmRecordSe
return chargeAlgorithmRecordMapper.deleteChargeAlgorithmRecordById(id);
}
@Override
public ChargeAlgorithmRecord queryRecordByOrderCode(String orderCode) {
return chargeAlgorithmRecordMapper.queryRecordByOrderCode(orderCode);
}
/**
* 通过订单号查询充电电池算法报告
* @param orderCode
* @return
*/
@Override
public ChargeAlgorithmRecord queryRecordByOrderCode(String orderCode) {
return chargeAlgorithmRecordMapper.queryRecordByOrderCode(orderCode);
public ChargeAlgorithmRecordVO queryVOByOrderCode(String orderCode) {
ChargeAlgorithmRecord record = chargeAlgorithmRecordMapper.queryRecordByOrderCode(orderCode);
if (record == null) {
return new ChargeAlgorithmRecordVO();
}
String securitySystemLevel = record.getSecuritySystemLevel();
ChargeAlgorithmRecordVO.SecuritySystem securitySystem = JSON.parseObject(securitySystemLevel, ChargeAlgorithmRecordVO.SecuritySystem.class);
ChargeAlgorithmRecordVO vo = ChargeAlgorithmRecordVO.builder()
.orderCode(record.getOrderCode())
.score(record.getScore())
.capacityMetrics(record.getCapacityMetrics())
.energyIndicator(record.getEnergyIndicator())
.consistency(record.getConsistency())
.tempConsistency(record.getTempConsistency())
.voltConsistency(record.getVoltConsistency())
.capacityConsistency(record.getCapacityConsistency())
.sot(record.getSot())
.thermalRunaway(record.getThermalRunaway())
.cooling(record.getCooling())
.seal(record.getSeal())
.currentSoc(record.getCurrentSoc())
.socAlarm(record.getSocAlarm())
.tempDiffAlarm(record.getTempDiffAlarm())
.tempRiseAlarm(record.getTempRiseAlarm())
.maxAllowableVoltageAlarm(record.getMaxAllowableVoltageAlarm())
.maxAllowableElectricityAlarm(record.getMaxAllowableElectricityAlarm())
.securitySystemLevel(securitySystem)
.failureMetrics(record.getFailureMetrics())
.build();
return vo;
}
}

View File

@@ -0,0 +1,158 @@
package com.jsowell.pile.vo.uniapp.customer;
import com.jsowell.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* 电池充电订单报告VO
*
* @author Lemon
* @Date 2025/4/16 9:51:37
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ChargeAlgorithmRecordVO {
/**
* 订单编号
*/
@Excel(name = "订单编号")
private String orderCode;
/**
* 总体得分
*/
@Excel(name = "总体得分")
private String score;
/**
* 健康指标-soh
*/
@Excel(name = "健康指标-soh")
private BigDecimal capacityMetrics;
/**
* 健康指标-soe
*/
@Excel(name = "健康指标-soe")
private BigDecimal energyIndicator;
/**
* 健康指标-一致性
*/
@Excel(name = "健康指标-一致性")
private String consistency;
/**
* 温度一致性
*/
@Excel(name = "温度一致性")
private String tempConsistency;
/**
* 电压一致性
*/
@Excel(name = "电压一致性")
private String voltConsistency;
/**
* 容量一致性
*/
@Excel(name = "容量一致性")
private String capacityConsistency;
/**
* 健康指标-sot
*/
@Excel(name = "健康指标-sot")
private BigDecimal sot;
/**
* 安全指标-热失控
*/
@Excel(name = "安全指标-热失控")
private String thermalRunaway;
/**
* 安全指标-冷却系统
*/
@Excel(name = "安全指标-冷却系统")
private String cooling;
/**
* 安全指标-气密性
*/
@Excel(name = "安全指标-气密性")
private String seal;
/**
* 充电后 soc 值
*/
@Excel(name = "充电后 soc 值")
private String currentSoc;
/**
* 故障指标-Soc 跳变异常value:结果值result:结果为0正常其他异常 threshold:异常阈值)
*/
@Excel(name = "故障指标-Soc 跳变异常", readConverterExp = "v=alue:结果值result:结果为0正常其他异常,t=hreshold:异常阈值")
private String socAlarm;
/**
* 故障指标-温差异常
*/
@Excel(name = "故障指标-温差异常")
private String tempDiffAlarm;
/**
* 故障指标-温升异常value:结果值result:结果为0正常其他异常 threshold:异常阈值)
*/
@Excel(name = "故障指标-温升异常", readConverterExp = "v=alue:结果值result:结果为0正常其他异常,t=hreshold:异常阈值")
private String tempRiseAlarm;
/**
* $column.columnComment
*/
@Excel(name = "最大允许电压告警", readConverterExp = "最大允许电压告警")
private String maxAllowableVoltageAlarm;
/**
* $column.columnComment
*/
@Excel(name = "最大允许电流告警", readConverterExp = "最大允许电流告警")
private String maxAllowableElectricityAlarm;
/**
* 安全体系指标
*/
@Excel(name = "安全体系指标")
private SecuritySystem securitySystemLevel;
/**
* 故障体系指标
*/
@Excel(name = "故障体系指标")
private String failureMetrics;
@Data
public static class SecuritySystem{
private SubSystem subSystem;
@Data
public static class SubSystem{
private String chargeAlarm;
private String tri;
private String soh;
private String consistence;
private String cooling;
private String securitySystemLevel;
}
}
}