mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 电池算法应用Service
This commit is contained in:
@@ -20,6 +20,7 @@ import com.jsowell.thirdparty.platform.domain.ChargeAlgorithmData;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -36,6 +37,12 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class ChargeAlgorithmService {
|
||||
|
||||
@Value("${chargeAlgorithm.url}")
|
||||
private String url;
|
||||
|
||||
@Value("${chargeAlgorithm.clientId}")
|
||||
private String clientId;
|
||||
|
||||
@Autowired
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@@ -108,7 +115,7 @@ public class ChargeAlgorithmService {
|
||||
|
||||
ChargeAlgorithmData data = ChargeAlgorithmData.builder()
|
||||
.vin(chargingHandshakeData.getVinCode())
|
||||
.orderCode(orderCode)
|
||||
.orderCode(orderCode + "c")
|
||||
.beginTime(orderVO.getStartTime())
|
||||
.initSoc(new BigDecimal(orderVO.getStartSoc()).intValue())
|
||||
.alarmCode(Constants.ZERO)
|
||||
@@ -121,8 +128,8 @@ public class ChargeAlgorithmService {
|
||||
.bmsVersion("V1.1") // BMS版本
|
||||
.batteryType(chargingHandshakeData.getBmsBatteryType()) // 电池类型
|
||||
.maxAllowTemp(parameterConfigData.getBmsMaxTemperature())
|
||||
.ratedCapacity(parameterConfigData.getBmsSumEnergy()) // 电池额定容量
|
||||
.nominalEnergy(parameterConfigData.getBmsSumEnergy())
|
||||
.ratedCapacity(new BigDecimal(parameterConfigData.getBmsSumEnergy()).toBigInteger().toString()) // 电池额定容量
|
||||
.nominalEnergy(new BigDecimal(parameterConfigData.getBmsSumEnergy()).toBigInteger().toString())
|
||||
.ratedVoltage(chargingHandshakeData.getBmsBatteryVoltage()) // 电池额定总电压
|
||||
|
||||
.bmsChargeMode(Integer.parseInt(bmsDemandAndChargerOutputData.getBmsChargingModel())) // BMS充电模式
|
||||
@@ -158,8 +165,6 @@ public class ChargeAlgorithmService {
|
||||
|
||||
log.info("发送请求前封装数据 data:{}", JSON.toJSONString(jsonObject));
|
||||
|
||||
String url = "http://150.158.199.92:58910/gateway/api/user/battery/algorithm/json";
|
||||
String clientId = "e488bac5f70b496fa2d82065089e5f81";
|
||||
// 发送请求
|
||||
String response = HttpRequest.post(url).header("clientId", clientId).body(JSON.toJSONString(jsonObject)).execute().body();
|
||||
|
||||
@@ -208,11 +213,11 @@ public class ChargeAlgorithmService {
|
||||
// 获取0x13数据
|
||||
detailInfo.setReadCurrentCharge(transactionRecordsData.getAmmeterTotalEnd());
|
||||
detailInfo.setCurrentSoc(new BigDecimal(realTimeData_0x23.getSoc()).intValue());
|
||||
detailInfo.setReportTime(realTimeData_0x23.getDateTime());
|
||||
detailInfo.setMaxAllowElectricity(parameterConfigData.getBmsMaxCurrent());
|
||||
detailInfo.setReportTime(realTimeData_0x23.getDateTime().replaceAll("[^0-9]", ""));
|
||||
detailInfo.setMaxAllowElectricity(new BigDecimal(parameterConfigData.getBmsMaxCurrent()).toBigInteger().toString());
|
||||
detailInfo.setSingleMaxAllowVoltage(parameterConfigData.getBmsMaxVoltage());
|
||||
detailInfo.setDcv(realTimeData_0x23.getPileVoltageOutput());
|
||||
detailInfo.setDca(realTimeData_0x23.getPileCurrentOutput());
|
||||
detailInfo.setDca(new BigDecimal(realTimeData_0x23.getPileCurrentOutput()).toBigInteger().toString());
|
||||
detailInfo.setBmsDemandVoltage(realTimeData_0x23.getBmsVoltageDemand());
|
||||
detailInfo.setBmsDemandElectricity(realTimeData_0x23.getBmsCurrentDemand());
|
||||
detailInfo.setChargePower(realTimeData_0x23.getOutputPower());
|
||||
@@ -220,11 +225,11 @@ public class ChargeAlgorithmService {
|
||||
detailInfo.setSingleMinVoltage(parameterConfigData.getPileMinOutputVoltage());
|
||||
|
||||
detailInfo.setMeasuringChargeVoltage(realTimeData_0x23.getBmsChargingVoltage());
|
||||
detailInfo.setMeasuringChargeElectricity(realTimeData_0x23.getBmsChargingCurrent());
|
||||
detailInfo.setMeasuringChargeElectricity(new BigDecimal(realTimeData_0x23.getBmsChargingCurrent()).toBigInteger().toString());
|
||||
detailInfo.setMaxSingleVoltageGroupNum(new BigDecimal(realTimeData_0x23.getBmsMaxVoltageAndGroup()).intValue());
|
||||
|
||||
detailInfo.setMaxAllowTotalVoltage(parameterConfigData.getBmsMaxChargingVoltage());
|
||||
detailInfo.setBeforeChargeTotalVoltage(parameterConfigData.getBmsRealTimeVoltage());
|
||||
detailInfo.setBeforeChargeTotalVoltage(new BigDecimal(parameterConfigData.getBmsRealTimeVoltage()).toBigInteger().toString());
|
||||
|
||||
detailInfo.setVentTemp("0");
|
||||
detailInfo.setEnvironmentTemp("0");
|
||||
|
||||
Reference in New Issue
Block a user