diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/pilemsg/ChargingConfigData.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/pilemsg/ChargingConfigData.java new file mode 100644 index 00000000..ddb3bd84 --- /dev/null +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/pilemsg/ChargingConfigData.java @@ -0,0 +1,160 @@ +package com.xhpc.common.pilemsg; + +public class ChargingConfigData extends BaseData { + + private String orderNo; //交易流水号 + private String pileNo; //桩号 + private String gunId; //枪号 + private String bmsBatteryMonoMaximumVoltage; //BMS单体电池最高允许充电电压V + private String bmsBatteryMaximumCurrent; //BMS最高允许充电电流A + private String bmsBatteryNominalEnergy; //BMS动力蓄电池标称总能量kWh + private String bmsBatteryMaximumTotalVoltage; //BMS最高允许充电总电压V + private String bmsBatteryMaximumTemperature; //BMS最高允许温度° + private String soc; //SOC + private String bmsBatteryViechleVoltage; //BMS整车动力蓄电池当前电池电压V + private String pileMaximumVoltage; //电桩最高输出电压 + private String pileMinimumVoltage; //电桩最低输出电压 + private String pileMaximumCurrent; //电桩最大输出电流 + private String pileMinimumCurrent; //电桩最小输出电流 + + public String getOrderNo() { + + return orderNo; + } + + public void setOrderNo(String orderNo) { + + this.orderNo = orderNo; + } + + public String getPileNo() { + + return pileNo; + } + + public void setPileNo(String pileNo) { + + this.pileNo = pileNo; + } + + public String getGunId() { + + return gunId; + } + + public void setGunId(String gunId) { + + this.gunId = gunId; + } + + public String getBmsBatteryMonoMaximumVoltage() { + + return bmsBatteryMonoMaximumVoltage; + } + + public void setBmsBatteryMonoMaximumVoltage(String bmsBatteryMonoMaximumVoltage) { + + this.bmsBatteryMonoMaximumVoltage = bmsBatteryMonoMaximumVoltage; + } + + public String getBmsBatteryMaximumCurrent() { + + return bmsBatteryMaximumCurrent; + } + + public void setBmsBatteryMaximumCurrent(String bmsBatteryMaximumCurrent) { + + this.bmsBatteryMaximumCurrent = bmsBatteryMaximumCurrent; + } + + public String getBmsBatteryNominalEnergy() { + + return bmsBatteryNominalEnergy; + } + + public void setBmsBatteryNominalEnergy(String bmsBatteryNominalEnergy) { + + this.bmsBatteryNominalEnergy = bmsBatteryNominalEnergy; + } + + public String getBmsBatteryMaximumTotalVoltage() { + + return bmsBatteryMaximumTotalVoltage; + } + + public void setBmsBatteryMaximumTotalVoltage(String bmsBatteryMaximumTotalVoltage) { + + this.bmsBatteryMaximumTotalVoltage = bmsBatteryMaximumTotalVoltage; + } + + public String getBmsBatteryMaximumTemperature() { + + return bmsBatteryMaximumTemperature; + } + + public void setBmsBatteryMaximumTemperature(String bmsBatteryMaximumTemperature) { + + this.bmsBatteryMaximumTemperature = bmsBatteryMaximumTemperature; + } + + public String getSoc() { + + return soc; + } + + public void setSoc(String soc) { + + this.soc = soc; + } + + public String getBmsBatteryViechleVoltage() { + + return bmsBatteryViechleVoltage; + } + + public void setBmsBatteryViechleVoltage(String bmsBatteryViechleVoltage) { + + this.bmsBatteryViechleVoltage = bmsBatteryViechleVoltage; + } + + public String getPileMaximumVoltage() { + + return pileMaximumVoltage; + } + + public void setPileMaximumVoltage(String pileMaximumVoltage) { + + this.pileMaximumVoltage = pileMaximumVoltage; + } + + public String getPileMinimumVoltage() { + + return pileMinimumVoltage; + } + + public void setPileMinimumVoltage(String pileMinimumVoltage) { + + this.pileMinimumVoltage = pileMinimumVoltage; + } + + public String getPileMaximumCurrent() { + + return pileMaximumCurrent; + } + + public void setPileMaximumCurrent(String pileMaximumCurrent) { + + this.pileMaximumCurrent = pileMaximumCurrent; + } + + public String getPileMinimumCurrent() { + + return pileMinimumCurrent; + } + + public void setPileMinimumCurrent(String pileMinimumCurrent) { + + this.pileMinimumCurrent = pileMinimumCurrent; + } + +} diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/ChargingConfigDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/ChargingConfigDataLogic.java new file mode 100644 index 00000000..8538c7aa --- /dev/null +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/ChargingConfigDataLogic.java @@ -0,0 +1,36 @@ +package com.xhpc.pp.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.xhpc.common.pilemsg.ChargingConfigData; +import com.xhpc.pp.tx.ServiceParameter; +import com.xhpc.pp.tx.ServiceResult; +import com.xhpc.pp.tx.logic.ServiceLogic; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; + +import java.util.Map; + +import static com.xhpc.pp.server.ChargingPileServer.REDIS; + +@Lazy +@Component("ChargingConfigDataLogic") +public class ChargingConfigDataLogic implements ServiceLogic { + + private static Logger log = LoggerFactory.getLogger(ChargingConfigDataLogic.class); + + @Override + public ServiceResult service(ServiceParameter sp) throws Exception { + + Map req = sp.getParameters(); + ObjectMapper objectMapper = new ObjectMapper(); + ChargingConfigData chargingConfigData = objectMapper.convertValue(req, ChargingConfigData.class); + String orderNo = chargingConfigData.getOrderNo(); + Map cacheOrder = REDIS.getCacheMap(orderNo); + cacheOrder.put("config", chargingConfigData); + REDIS.setCacheMap(orderNo, cacheOrder); + return new ServiceResult(false); + } + +} diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RealtimeDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RealtimeDataLogic.java index 9dd89083..0a6bd574 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RealtimeDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RealtimeDataLogic.java @@ -37,6 +37,7 @@ public class RealtimeDataLogic implements ServiceLogic { String pileGun = pileNo.concat(gunId); Map cacheGun = REDIS.getCacheMap(pileGun); cacheGun.put("status", status); + cacheGun.put("soc", realtimeData.getSoc()); REDIS.setCacheMap(pileGun, cacheGun); String orderNo = realtimeData.getOrderNo(); Map order = REDIS.getCacheMap(orderNo); diff --git a/xhpc-modules/xhpc-power-pile/src/main/resources/svcmainlogic.xml b/xhpc-modules/xhpc-power-pile/src/main/resources/svcmainlogic.xml index 5912c1ce..55ea5d3a 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/resources/svcmainlogic.xml +++ b/xhpc-modules/xhpc-power-pile/src/main/resources/svcmainlogic.xml @@ -14,5 +14,6 @@ +