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