From 7134bc03f8bb18e63aa67d5d5b8687e01d780f83 Mon Sep 17 00:00:00 2001 From: mashili Date: Tue, 24 Jun 2025 01:18:07 +0800 Subject: [PATCH] =?UTF-8?q?PCS+BMS=E6=80=BB=E8=A7=88+BMS=E7=94=B5=E6=B1=A0?= =?UTF-8?q?=E7=B0=87-=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ems/EmsSiteMonitorController.java | 27 ++ .../xzzn/ems/domain/EmsBatteryCluster.java | 269 ++++++++++++++++++ .../com/xzzn/ems/domain/EmsBatteryStack.java | 269 ++++++++++++++++++ .../java/com/xzzn/ems/domain/EmsPcsData.java | 2 +- .../domain/vo/BMSBatteryClusterDataList.java | 76 +++++ .../ems/domain/vo/BMSBatteryClusterVo.java | 175 ++++++++++++ .../ems/domain/vo/BMSBatteryDataList.java | 98 +++++++ .../com/xzzn/ems/domain/vo/BMSOverViewVo.java | 175 ++++++++++++ .../ems/mapper/EmsBatteryClusterMapper.java | 68 +++++ .../ems/mapper/EmsBatteryStackMapper.java | 68 +++++ .../com/xzzn/ems/mapper/EmsPcsDataMapper.java | 7 + .../xzzn/ems/service/ISingleSiteService.java | 11 +- .../service/impl/SingleSiteServiceImpl.java | 37 ++- .../mapper/ems/EmsBatteryClusterMapper.xml | 151 ++++++++++ .../mapper/ems/EmsBatteryStackMapper.xml | 151 ++++++++++ .../resources/mapper/ems/EmsPcsDataMapper.xml | 6 + 16 files changed, 1582 insertions(+), 8 deletions(-) create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/EmsBatteryCluster.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/EmsBatteryStack.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryClusterDataList.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryClusterVo.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryDataList.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSOverViewVo.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/mapper/EmsBatteryClusterMapper.java create mode 100644 ems-system/src/main/java/com/xzzn/ems/mapper/EmsBatteryStackMapper.java create mode 100644 ems-system/src/main/resources/mapper/ems/EmsBatteryClusterMapper.xml create mode 100644 ems-system/src/main/resources/mapper/ems/EmsBatteryStackMapper.xml diff --git a/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteMonitorController.java b/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteMonitorController.java index 53543df..cf3597c 100644 --- a/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteMonitorController.java +++ b/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteMonitorController.java @@ -44,4 +44,31 @@ public class EmsSiteMonitorController extends BaseController{ { return success(iSingleSiteService.getRunningGraph(siteId)); } + + /** + * 单站监控-设备监控-PCS + */ + @GetMapping("/getPcsDetailInfo") + public AjaxResult getPcsDetailInfo(@RequestParam Long siteId) + { + return success(iSingleSiteService.getPcsDetailInfo(siteId)); + } + + /** + * 单站监控-设备监控-BMS总览 + */ + @GetMapping("/getBMSOverView") + public AjaxResult getBMSOverView(@RequestParam Long siteId) + { + return success(iSingleSiteService.getBMSOverView(siteId)); + } + + /** + * 单站监控-设备监控-BMS电池簇 + */ + @GetMapping("/getBMSBatteryCluster") + public AjaxResult getBMSBatteryCluster(@RequestParam Long siteId) + { + return success(iSingleSiteService.getBMSBatteryCluster(siteId)); + } } diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/EmsBatteryCluster.java b/ems-system/src/main/java/com/xzzn/ems/domain/EmsBatteryCluster.java new file mode 100644 index 0000000..e19045d --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/EmsBatteryCluster.java @@ -0,0 +1,269 @@ +package com.xzzn.ems.domain; + +import java.math.BigDecimal; + +import com.xzzn.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.xzzn.common.annotation.Excel; + +/** + * 电池簇数据对象 ems_battery_cluster + * + * @author xzzn + * @date 2025-06-22 + */ +public class EmsBatteryCluster extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Long id; + + /** 工作状态 */ + @Excel(name = "工作状态") + private String workStatus; + + /** 与PCS通信状态 */ + @Excel(name = "与PCS通信状态") + private String pcsCommunicationStatus; + + /** 与EMS通信状态 */ + @Excel(name = "与EMS通信状态") + private String emsCommunicationStatus; + + /** 簇电压 (V) */ + @Excel(name = "簇电压 (V)") + private BigDecimal clusterVoltage; + + /** 可充电量 (kWh) */ + @Excel(name = "可充电量 (kWh)") + private BigDecimal chargeableCapacity; + + /** 累计充电量 (kWh) */ + @Excel(name = "累计充电量 (kWh)") + private BigDecimal totalChargedCapacity; + + /** 簇电流 (A) */ + @Excel(name = "簇电流 (A)") + private BigDecimal clusterCurrent; + + /** 可放电量 (kWh) */ + @Excel(name = "可放电量 (kWh)") + private BigDecimal dischargeableCapacity; + + /** 累计放电量 (kWh) */ + @Excel(name = "累计放电量 (kWh)") + private BigDecimal totalDischargedCapacity; + + /** SOH (%) */ + @Excel(name = "SOH (%)") + private BigDecimal soh; + + /** 平均温度 (℃) */ + @Excel(name = "平均温度 (℃)") + private BigDecimal averageTemperature; + + /** 绝缘电阻 (Ω) */ + @Excel(name = "绝缘电阻 (Ω)") + private BigDecimal insulationResistance; + + /** 当前SOC (%) */ + @Excel(name = "当前SOC (%)") + private BigDecimal currentSoc; + + /** 站点id */ + @Excel(name = "站点id") + private Long siteId; + + /** 设备唯一标识符 */ + @Excel(name = "设备唯一标识符") + private Long deviceId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setWorkStatus(String workStatus) + { + this.workStatus = workStatus; + } + + public String getWorkStatus() + { + return workStatus; + } + + public void setPcsCommunicationStatus(String pcsCommunicationStatus) + { + this.pcsCommunicationStatus = pcsCommunicationStatus; + } + + public String getPcsCommunicationStatus() + { + return pcsCommunicationStatus; + } + + public void setEmsCommunicationStatus(String emsCommunicationStatus) + { + this.emsCommunicationStatus = emsCommunicationStatus; + } + + public String getEmsCommunicationStatus() + { + return emsCommunicationStatus; + } + + public void setClusterVoltage(BigDecimal clusterVoltage) + { + this.clusterVoltage = clusterVoltage; + } + + public BigDecimal getClusterVoltage() + { + return clusterVoltage; + } + + public void setChargeableCapacity(BigDecimal chargeableCapacity) + { + this.chargeableCapacity = chargeableCapacity; + } + + public BigDecimal getChargeableCapacity() + { + return chargeableCapacity; + } + + public void setTotalChargedCapacity(BigDecimal totalChargedCapacity) + { + this.totalChargedCapacity = totalChargedCapacity; + } + + public BigDecimal getTotalChargedCapacity() + { + return totalChargedCapacity; + } + + public void setClusterCurrent(BigDecimal clusterCurrent) + { + this.clusterCurrent = clusterCurrent; + } + + public BigDecimal getClusterCurrent() + { + return clusterCurrent; + } + + public void setDischargeableCapacity(BigDecimal dischargeableCapacity) + { + this.dischargeableCapacity = dischargeableCapacity; + } + + public BigDecimal getDischargeableCapacity() + { + return dischargeableCapacity; + } + + public void setTotalDischargedCapacity(BigDecimal totalDischargedCapacity) + { + this.totalDischargedCapacity = totalDischargedCapacity; + } + + public BigDecimal getTotalDischargedCapacity() + { + return totalDischargedCapacity; + } + + public void setSoh(BigDecimal soh) + { + this.soh = soh; + } + + public BigDecimal getSoh() + { + return soh; + } + + public void setAverageTemperature(BigDecimal averageTemperature) + { + this.averageTemperature = averageTemperature; + } + + public BigDecimal getAverageTemperature() + { + return averageTemperature; + } + + public void setInsulationResistance(BigDecimal insulationResistance) + { + this.insulationResistance = insulationResistance; + } + + public BigDecimal getInsulationResistance() + { + return insulationResistance; + } + + public void setCurrentSoc(BigDecimal currentSoc) + { + this.currentSoc = currentSoc; + } + + public BigDecimal getCurrentSoc() + { + return currentSoc; + } + + public void setSiteId(Long siteId) + { + this.siteId = siteId; + } + + public Long getSiteId() + { + return siteId; + } + + public void setDeviceId(Long deviceId) + { + this.deviceId = deviceId; + } + + public Long getDeviceId() + { + return deviceId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("workStatus", getWorkStatus()) + .append("pcsCommunicationStatus", getPcsCommunicationStatus()) + .append("emsCommunicationStatus", getEmsCommunicationStatus()) + .append("clusterVoltage", getClusterVoltage()) + .append("chargeableCapacity", getChargeableCapacity()) + .append("totalChargedCapacity", getTotalChargedCapacity()) + .append("clusterCurrent", getClusterCurrent()) + .append("dischargeableCapacity", getDischargeableCapacity()) + .append("totalDischargedCapacity", getTotalDischargedCapacity()) + .append("soh", getSoh()) + .append("averageTemperature", getAverageTemperature()) + .append("insulationResistance", getInsulationResistance()) + .append("currentSoc", getCurrentSoc()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("siteId", getSiteId()) + .append("deviceId", getDeviceId()) + .toString(); + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/EmsBatteryStack.java b/ems-system/src/main/java/com/xzzn/ems/domain/EmsBatteryStack.java new file mode 100644 index 0000000..30bc120 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/EmsBatteryStack.java @@ -0,0 +1,269 @@ +package com.xzzn.ems.domain; + +import java.math.BigDecimal; + +import com.xzzn.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.xzzn.common.annotation.Excel; + +/** + * 电池堆数据对象 ems_battery_stack + * + * @author xzzn + * @date 2025-06-22 + */ +public class EmsBatteryStack extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Long id; + + /** 工作状态 */ + @Excel(name = "工作状态") + private String workStatus; + + /** 与PCS通信状态 */ + @Excel(name = "与PCS通信状态") + private String pcsCommunicationStatus; + + /** 与EMS通信状态 */ + @Excel(name = "与EMS通信状态") + private String emsCommunicationStatus; + + /** 电池堆总电压 (V) */ + @Excel(name = "电池堆总电压 (V)") + private BigDecimal totalVoltage; + + /** 可充电量 (kWh) */ + @Excel(name = "可充电量 (kWh)") + private BigDecimal chargeableCapacity; + + /** 累计充电量 (kWh) */ + @Excel(name = "累计充电量 (kWh)") + private BigDecimal totalChargedCapacity; + + /** 电池堆总电流 (A) */ + @Excel(name = "电池堆总电流 (A)") + private BigDecimal totalCurrent; + + /** 可放电量 (kWh) */ + @Excel(name = "可放电量 (kWh)") + private BigDecimal dischargeableCapacity; + + /** 累计放电量 (kWh) */ + @Excel(name = "累计放电量 (kWh)") + private BigDecimal totalDischargedCapacity; + + /** SOH (%) */ + @Excel(name = "SOH (%)") + private BigDecimal soh; + + /** 平均温度 (℃) */ + @Excel(name = "平均温度 (℃)") + private BigDecimal averageTemperature; + + /** 绝缘电阻 (Ω) */ + @Excel(name = "绝缘电阻 (Ω)") + private BigDecimal insulationResistance; + + /** 当前SOC (%) */ + @Excel(name = "当前SOC (%)") + private BigDecimal currentSoc; + + /** 站点id */ + @Excel(name = "站点id") + private Long siteId; + + /** 设备唯一标识符 */ + @Excel(name = "设备唯一标识符") + private Long deviceId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setWorkStatus(String workStatus) + { + this.workStatus = workStatus; + } + + public String getWorkStatus() + { + return workStatus; + } + + public void setPcsCommunicationStatus(String pcsCommunicationStatus) + { + this.pcsCommunicationStatus = pcsCommunicationStatus; + } + + public String getPcsCommunicationStatus() + { + return pcsCommunicationStatus; + } + + public void setEmsCommunicationStatus(String emsCommunicationStatus) + { + this.emsCommunicationStatus = emsCommunicationStatus; + } + + public String getEmsCommunicationStatus() + { + return emsCommunicationStatus; + } + + public void setTotalVoltage(BigDecimal totalVoltage) + { + this.totalVoltage = totalVoltage; + } + + public BigDecimal getTotalVoltage() + { + return totalVoltage; + } + + public void setChargeableCapacity(BigDecimal chargeableCapacity) + { + this.chargeableCapacity = chargeableCapacity; + } + + public BigDecimal getChargeableCapacity() + { + return chargeableCapacity; + } + + public void setTotalChargedCapacity(BigDecimal totalChargedCapacity) + { + this.totalChargedCapacity = totalChargedCapacity; + } + + public BigDecimal getTotalChargedCapacity() + { + return totalChargedCapacity; + } + + public void setTotalCurrent(BigDecimal totalCurrent) + { + this.totalCurrent = totalCurrent; + } + + public BigDecimal getTotalCurrent() + { + return totalCurrent; + } + + public void setDischargeableCapacity(BigDecimal dischargeableCapacity) + { + this.dischargeableCapacity = dischargeableCapacity; + } + + public BigDecimal getDischargeableCapacity() + { + return dischargeableCapacity; + } + + public void setTotalDischargedCapacity(BigDecimal totalDischargedCapacity) + { + this.totalDischargedCapacity = totalDischargedCapacity; + } + + public BigDecimal getTotalDischargedCapacity() + { + return totalDischargedCapacity; + } + + public void setSoh(BigDecimal soh) + { + this.soh = soh; + } + + public BigDecimal getSoh() + { + return soh; + } + + public void setAverageTemperature(BigDecimal averageTemperature) + { + this.averageTemperature = averageTemperature; + } + + public BigDecimal getAverageTemperature() + { + return averageTemperature; + } + + public void setInsulationResistance(BigDecimal insulationResistance) + { + this.insulationResistance = insulationResistance; + } + + public BigDecimal getInsulationResistance() + { + return insulationResistance; + } + + public void setCurrentSoc(BigDecimal currentSoc) + { + this.currentSoc = currentSoc; + } + + public BigDecimal getCurrentSoc() + { + return currentSoc; + } + + public void setSiteId(Long siteId) + { + this.siteId = siteId; + } + + public Long getSiteId() + { + return siteId; + } + + public void setDeviceId(Long deviceId) + { + this.deviceId = deviceId; + } + + public Long getDeviceId() + { + return deviceId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("workStatus", getWorkStatus()) + .append("pcsCommunicationStatus", getPcsCommunicationStatus()) + .append("emsCommunicationStatus", getEmsCommunicationStatus()) + .append("totalVoltage", getTotalVoltage()) + .append("chargeableCapacity", getChargeableCapacity()) + .append("totalChargedCapacity", getTotalChargedCapacity()) + .append("totalCurrent", getTotalCurrent()) + .append("dischargeableCapacity", getDischargeableCapacity()) + .append("totalDischargedCapacity", getTotalDischargedCapacity()) + .append("soh", getSoh()) + .append("averageTemperature", getAverageTemperature()) + .append("insulationResistance", getInsulationResistance()) + .append("currentSoc", getCurrentSoc()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("siteId", getSiteId()) + .append("deviceId", getDeviceId()) + .toString(); + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsData.java b/ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsData.java index 21b92ec..1275da3 100644 --- a/ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsData.java +++ b/ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsData.java @@ -22,7 +22,7 @@ public class EmsPcsData extends BaseEntity private Long id; /** 数据更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd") private Date dataUpdateTime; diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryClusterDataList.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryClusterDataList.java new file mode 100644 index 0000000..0561fc8 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryClusterDataList.java @@ -0,0 +1,76 @@ +package com.xzzn.ems.domain.vo; + +import java.math.BigDecimal; + +/** + * BMS电池簇-电池单体数据 + */ +public class BMSBatteryClusterDataList { + /** + * 名称 + */ + private String dataName; + + /** 单体平均值 */ + private BigDecimal avgData; + + /** 单体最小值 */ + private BigDecimal minData; + + /** 单体最小值ID */ + private BigDecimal minDataID; + + /** 单体最大值 */ + private BigDecimal maxData; + + /** 单体最大值ID */ + private BigDecimal maxDataID; + + public String getDataName() { + return dataName; + } + + public void setDataName(String dataName) { + this.dataName = dataName; + } + + public BigDecimal getAvgData() { + return avgData; + } + + public void setAvgData(BigDecimal avgData) { + this.avgData = avgData; + } + + public BigDecimal getMinData() { + return minData; + } + + public void setMinData(BigDecimal minData) { + this.minData = minData; + } + + public BigDecimal getMinDataID() { + return minDataID; + } + + public void setMinDataID(BigDecimal minDataID) { + this.minDataID = minDataID; + } + + public BigDecimal getMaxData() { + return maxData; + } + + public void setMaxData(BigDecimal maxData) { + this.maxData = maxData; + } + + public BigDecimal getMaxDataID() { + return maxDataID; + } + + public void setMaxDataID(BigDecimal maxDataID) { + this.maxDataID = maxDataID; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryClusterVo.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryClusterVo.java new file mode 100644 index 0000000..ecd2dcc --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryClusterVo.java @@ -0,0 +1,175 @@ +package com.xzzn.ems.domain.vo; + +import java.math.BigDecimal; +import java.util.List; + +/** + * BMS电池簇数据 + * + */ +public class BMSBatteryClusterVo { + + + private Long id; + + /** 工作状态 */ + private String workStatus; + + /** 与PCS通信状态 */ + private String pcsCommunicationStatus; + + /** 与EMS通信状态 */ + private String emsCommunicationStatus; + + /** 簇电压 (V) */ + private BigDecimal clusterVoltage; + + /** 可充电量 (kWh) */ + private BigDecimal chargeableCapacity; + + /** 累计充电量 (kWh) */ + private BigDecimal totalChargedCapacity; + + /** 簇电流 (A) */ + private BigDecimal clusterCurrent; + + /** 可放电量 (kWh) */ + private BigDecimal dischargeableCapacity; + + /** 累计放电量 (kWh) */ + private BigDecimal totalDischargedCapacity; + + /** SOH (%) */ + private BigDecimal soh; + + /** 平均温度 (℃) */ + private BigDecimal averageTemperature; + + /** 绝缘电阻 (Ω) */ + private BigDecimal insulationResistance; + + /** 当前SOC (%) */ + private BigDecimal currentSoc; + + private List batteryDataList; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getWorkStatus() { + return workStatus; + } + + public void setWorkStatus(String workStatus) { + this.workStatus = workStatus; + } + + public String getPcsCommunicationStatus() { + return pcsCommunicationStatus; + } + + public void setPcsCommunicationStatus(String pcsCommunicationStatus) { + this.pcsCommunicationStatus = pcsCommunicationStatus; + } + + public String getEmsCommunicationStatus() { + return emsCommunicationStatus; + } + + public void setEmsCommunicationStatus(String emsCommunicationStatus) { + this.emsCommunicationStatus = emsCommunicationStatus; + } + + public BigDecimal getClusterVoltage() { + return clusterVoltage; + } + + public void setClusterVoltage(BigDecimal clusterVoltage) { + this.clusterVoltage = clusterVoltage; + } + + public BigDecimal getChargeableCapacity() { + return chargeableCapacity; + } + + public void setChargeableCapacity(BigDecimal chargeableCapacity) { + this.chargeableCapacity = chargeableCapacity; + } + + public BigDecimal getTotalChargedCapacity() { + return totalChargedCapacity; + } + + public void setTotalChargedCapacity(BigDecimal totalChargedCapacity) { + this.totalChargedCapacity = totalChargedCapacity; + } + + public BigDecimal getClusterCurrent() { + return clusterCurrent; + } + + public void setClusterCurrent(BigDecimal clusterCurrent) { + this.clusterCurrent = clusterCurrent; + } + + public BigDecimal getDischargeableCapacity() { + return dischargeableCapacity; + } + + public void setDischargeableCapacity(BigDecimal dischargeableCapacity) { + this.dischargeableCapacity = dischargeableCapacity; + } + + public BigDecimal getTotalDischargedCapacity() { + return totalDischargedCapacity; + } + + public void setTotalDischargedCapacity(BigDecimal totalDischargedCapacity) { + this.totalDischargedCapacity = totalDischargedCapacity; + } + + public BigDecimal getSoh() { + return soh; + } + + public void setSoh(BigDecimal soh) { + this.soh = soh; + } + + public BigDecimal getAverageTemperature() { + return averageTemperature; + } + + public void setAverageTemperature(BigDecimal averageTemperature) { + this.averageTemperature = averageTemperature; + } + + public BigDecimal getInsulationResistance() { + return insulationResistance; + } + + public void setInsulationResistance(BigDecimal insulationResistance) { + this.insulationResistance = insulationResistance; + } + + public BigDecimal getCurrentSoc() { + return currentSoc; + } + + public void setCurrentSoc(BigDecimal currentSoc) { + this.currentSoc = currentSoc; + } + + public List getBatteryDataList() { + return batteryDataList; + } + + public void setBatteryDataList(List batteryDataList) { + this.batteryDataList = batteryDataList; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryDataList.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryDataList.java new file mode 100644 index 0000000..7a926b0 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSBatteryDataList.java @@ -0,0 +1,98 @@ +package com.xzzn.ems.domain.vo; + +import java.math.BigDecimal; + +/** + * BMS总览-电池堆电池簇单体数据 + */ +public class BMSBatteryDataList { + /** + * 簇号 + */ + private Long clusterId; + + /** 簇电压 (V) */ + private BigDecimal clusterVoltage; + + /** 簇电流 (A) */ + private BigDecimal clusterCurrent; + + /** 簇SOC (%) */ + private BigDecimal currentSoc; + + /** 单体最高电压 (V) */ + private BigDecimal maxVoltage; + + /** 单体最低电压 (V) */ + private BigDecimal minVoltage; + + /** 单体最高温度 (℃) */ + private BigDecimal maxTemperature; + + /** 单体最低温度 (℃) */ + private BigDecimal minTemperature; + + public Long getClusterId() { + return clusterId; + } + + public void setClusterId(Long clusterId) { + this.clusterId = clusterId; + } + + public BigDecimal getMinTemperature() { + return minTemperature; + } + + public void setMinTemperature(BigDecimal minTemperature) { + this.minTemperature = minTemperature; + } + + public BigDecimal getMaxTemperature() { + return maxTemperature; + } + + public void setMaxTemperature(BigDecimal maxTemperature) { + this.maxTemperature = maxTemperature; + } + + public BigDecimal getMinVoltage() { + return minVoltage; + } + + public void setMinVoltage(BigDecimal minVoltage) { + this.minVoltage = minVoltage; + } + + public BigDecimal getMaxVoltage() { + return maxVoltage; + } + + public void setMaxVoltage(BigDecimal maxVoltage) { + this.maxVoltage = maxVoltage; + } + + public BigDecimal getCurrentSoc() { + return currentSoc; + } + + public void setCurrentSoc(BigDecimal currentSoc) { + this.currentSoc = currentSoc; + } + + public BigDecimal getClusterCurrent() { + return clusterCurrent; + } + + public void setClusterCurrent(BigDecimal clusterCurrent) { + this.clusterCurrent = clusterCurrent; + } + + public BigDecimal getClusterVoltage() { + return clusterVoltage; + } + + public void setClusterVoltage(BigDecimal clusterVoltage) { + this.clusterVoltage = clusterVoltage; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSOverViewVo.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSOverViewVo.java new file mode 100644 index 0000000..1426d43 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/BMSOverViewVo.java @@ -0,0 +1,175 @@ +package com.xzzn.ems.domain.vo; + +import java.math.BigDecimal; +import java.util.List; + +/** + * BMS总览数据 + * + */ +public class BMSOverViewVo { + + + private Long id; + + /** 工作状态 */ + private String workStatus; + + /** 与PCS通信状态 */ + private String pcsCommunicationStatus; + + /** 与EMS通信状态 */ + private String emsCommunicationStatus; + + /** 电池堆总电压 (V) */ + private BigDecimal totalVoltage; + + /** 可充电量 (kWh) */ + private BigDecimal chargeableCapacity; + + /** 累计充电量 (kWh) */ + private BigDecimal totalChargedCapacity; + + /** 电池堆总电流 (A) */ + private BigDecimal totalCurrent; + + /** 可放电量 (kWh) */ + private BigDecimal dischargeableCapacity; + + /** 累计放电量 (kWh) */ + private BigDecimal totalDischargedCapacity; + + /** SOH (%) */ + private BigDecimal soh; + + /** 平均温度 (℃) */ + private BigDecimal averageTemperature; + + /** 绝缘电阻 (Ω) */ + private BigDecimal insulationResistance; + + /** 当前SOC (%) */ + private BigDecimal currentSoc; + + private List batteryDataList; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getWorkStatus() { + return workStatus; + } + + public void setWorkStatus(String workStatus) { + this.workStatus = workStatus; + } + + public String getPcsCommunicationStatus() { + return pcsCommunicationStatus; + } + + public void setPcsCommunicationStatus(String pcsCommunicationStatus) { + this.pcsCommunicationStatus = pcsCommunicationStatus; + } + + public String getEmsCommunicationStatus() { + return emsCommunicationStatus; + } + + public void setEmsCommunicationStatus(String emsCommunicationStatus) { + this.emsCommunicationStatus = emsCommunicationStatus; + } + + public BigDecimal getTotalVoltage() { + return totalVoltage; + } + + public void setTotalVoltage(BigDecimal totalVoltage) { + this.totalVoltage = totalVoltage; + } + + public BigDecimal getChargeableCapacity() { + return chargeableCapacity; + } + + public void setChargeableCapacity(BigDecimal chargeableCapacity) { + this.chargeableCapacity = chargeableCapacity; + } + + public BigDecimal getTotalChargedCapacity() { + return totalChargedCapacity; + } + + public void setTotalChargedCapacity(BigDecimal totalChargedCapacity) { + this.totalChargedCapacity = totalChargedCapacity; + } + + public BigDecimal getTotalCurrent() { + return totalCurrent; + } + + public void setTotalCurrent(BigDecimal totalCurrent) { + this.totalCurrent = totalCurrent; + } + + public BigDecimal getDischargeableCapacity() { + return dischargeableCapacity; + } + + public void setDischargeableCapacity(BigDecimal dischargeableCapacity) { + this.dischargeableCapacity = dischargeableCapacity; + } + + public BigDecimal getTotalDischargedCapacity() { + return totalDischargedCapacity; + } + + public void setTotalDischargedCapacity(BigDecimal totalDischargedCapacity) { + this.totalDischargedCapacity = totalDischargedCapacity; + } + + public BigDecimal getSoh() { + return soh; + } + + public void setSoh(BigDecimal soh) { + this.soh = soh; + } + + public BigDecimal getAverageTemperature() { + return averageTemperature; + } + + public void setAverageTemperature(BigDecimal averageTemperature) { + this.averageTemperature = averageTemperature; + } + + public BigDecimal getInsulationResistance() { + return insulationResistance; + } + + public void setInsulationResistance(BigDecimal insulationResistance) { + this.insulationResistance = insulationResistance; + } + + public BigDecimal getCurrentSoc() { + return currentSoc; + } + + public void setCurrentSoc(BigDecimal currentSoc) { + this.currentSoc = currentSoc; + } + + public List getBatteryDataList() { + return batteryDataList; + } + + public void setBatteryDataList(List batteryDataList) { + this.batteryDataList = batteryDataList; + } +} diff --git a/ems-system/src/main/java/com/xzzn/ems/mapper/EmsBatteryClusterMapper.java b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsBatteryClusterMapper.java new file mode 100644 index 0000000..a761ee4 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsBatteryClusterMapper.java @@ -0,0 +1,68 @@ +package com.xzzn.ems.mapper; + +import java.util.List; +import com.xzzn.ems.domain.EmsBatteryCluster; + +/** + * 电池簇数据Mapper接口 + * + * @author xzzn + * @date 2025-06-22 + */ +public interface EmsBatteryClusterMapper +{ + /** + * 查询电池簇数据 + * + * @param id 电池簇数据主键 + * @return 电池簇数据 + */ + public EmsBatteryCluster selectEmsBatteryClusterById(Long id); + + /** + * 查询电池簇数据列表 + * + * @param emsBatteryCluster 电池簇数据 + * @return 电池簇数据集合 + */ + public List selectEmsBatteryClusterList(EmsBatteryCluster emsBatteryCluster); + + /** + * 新增电池簇数据 + * + * @param emsBatteryCluster 电池簇数据 + * @return 结果 + */ + public int insertEmsBatteryCluster(EmsBatteryCluster emsBatteryCluster); + + /** + * 修改电池簇数据 + * + * @param emsBatteryCluster 电池簇数据 + * @return 结果 + */ + public int updateEmsBatteryCluster(EmsBatteryCluster emsBatteryCluster); + + /** + * 删除电池簇数据 + * + * @param id 电池簇数据主键 + * @return 结果 + */ + public int deleteEmsBatteryClusterById(Long id); + + /** + * 批量删除电池簇数据 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEmsBatteryClusterByIds(Long[] ids); + + /** + * 根据site_id获取电池簇数据 + * @param siteId + * @return + */ + public EmsBatteryCluster getBMSBatteryCluster(Long siteId); +} diff --git a/ems-system/src/main/java/com/xzzn/ems/mapper/EmsBatteryStackMapper.java b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsBatteryStackMapper.java new file mode 100644 index 0000000..a095dc8 --- /dev/null +++ b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsBatteryStackMapper.java @@ -0,0 +1,68 @@ +package com.xzzn.ems.mapper; + +import java.util.List; +import com.xzzn.ems.domain.EmsBatteryStack; + +/** + * 电池堆数据Mapper接口 + * + * @author xzzn + * @date 2025-06-23 + */ +public interface EmsBatteryStackMapper +{ + /** + * 查询电池堆数据 + * + * @param id 电池堆数据主键 + * @return 电池堆数据 + */ + public EmsBatteryStack selectEmsBatteryStackById(Long id); + + /** + * 查询电池堆数据列表 + * + * @param emsBatteryStack 电池堆数据 + * @return 电池堆数据集合 + */ + public List selectEmsBatteryStackList(EmsBatteryStack emsBatteryStack); + + /** + * 新增电池堆数据 + * + * @param emsBatteryStack 电池堆数据 + * @return 结果 + */ + public int insertEmsBatteryStack(EmsBatteryStack emsBatteryStack); + + /** + * 修改电池堆数据 + * + * @param emsBatteryStack 电池堆数据 + * @return 结果 + */ + public int updateEmsBatteryStack(EmsBatteryStack emsBatteryStack); + + /** + * 删除电池堆数据 + * + * @param id 电池堆数据主键 + * @return 结果 + */ + public int deleteEmsBatteryStackById(Long id); + + /** + * 批量删除电池堆数据 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEmsBatteryStackByIds(Long[] ids); + + /** + * 获取电池堆信息 + * @param siteId + * @return + */ + public EmsBatteryStack selectEmsBatteryStackBySiteId(Long siteId); +} diff --git a/ems-system/src/main/java/com/xzzn/ems/mapper/EmsPcsDataMapper.java b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsPcsDataMapper.java index ea769e7..16efb63 100644 --- a/ems-system/src/main/java/com/xzzn/ems/mapper/EmsPcsDataMapper.java +++ b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsPcsDataMapper.java @@ -90,4 +90,11 @@ public interface EmsPcsDataMapper * @return */ public List getElectDataList(); + + /** + * 根据site_id获取pcs最新update的数据 + * @param siteId + * @return + */ + public EmsPcsData getPcsDetailInfoBySiteId(Long siteId); } diff --git a/ems-system/src/main/java/com/xzzn/ems/service/ISingleSiteService.java b/ems-system/src/main/java/com/xzzn/ems/service/ISingleSiteService.java index 9516395..67dc9fc 100644 --- a/ems-system/src/main/java/com/xzzn/ems/service/ISingleSiteService.java +++ b/ems-system/src/main/java/com/xzzn/ems/service/ISingleSiteService.java @@ -1,8 +1,7 @@ package com.xzzn.ems.service; -import com.xzzn.ems.domain.vo.SiteMonitorHomeVo; -import com.xzzn.ems.domain.vo.SiteMonitorRuningHeadInfoVo; -import com.xzzn.ems.domain.vo.SiteMonitorRuningInfoVo; +import com.xzzn.ems.domain.EmsPcsData; +import com.xzzn.ems.domain.vo.*; /** * 单点监控 服务层 @@ -17,4 +16,10 @@ public interface ISingleSiteService public SiteMonitorRuningHeadInfoVo getSiteRunningHeadInfo(Long siteId); public SiteMonitorRuningInfoVo getRunningGraph(Long siteId); + + public EmsPcsData getPcsDetailInfo(Long siteId); + + public BMSOverViewVo getBMSOverView(Long siteId); + + public BMSBatteryClusterVo getBMSBatteryCluster(Long siteId); } diff --git a/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java b/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java index a1cfb4b..a6435c3 100644 --- a/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java +++ b/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java @@ -1,11 +1,13 @@ package com.xzzn.ems.service.impl; import com.xzzn.common.utils.StringUtils; +import com.xzzn.common.utils.bean.BeanUtils; +import com.xzzn.ems.domain.EmsBatteryCluster; import com.xzzn.ems.domain.EmsBatteryData; +import com.xzzn.ems.domain.EmsBatteryStack; +import com.xzzn.ems.domain.EmsPcsData; import com.xzzn.ems.domain.vo.*; -import com.xzzn.ems.mapper.EmsAlarmRecordsMapper; -import com.xzzn.ems.mapper.EmsBatteryDataMapper; -import com.xzzn.ems.mapper.EmsPcsDataMapper; +import com.xzzn.ems.mapper.*; import com.xzzn.ems.service.ISingleSiteService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -26,6 +28,10 @@ public class SingleSiteServiceImpl implements ISingleSiteService { private EmsAlarmRecordsMapper emsAlarmRecordsMapper; @Autowired private EmsBatteryDataMapper emsBatteryDataMapper; + @Autowired + private EmsBatteryStackMapper emsBatteryStackMapper; + @Autowired + private EmsBatteryClusterMapper emsBatteryClusterMapper; @Override public SiteMonitorHomeVo getSiteMonitorDataVo(Long siteId) { @@ -115,9 +121,32 @@ public class SingleSiteServiceImpl implements ISingleSiteService { //pcs平均温度list //电池平均soclist //电池平均温度list - } return siteMonitorRuningInfoVo; } + // 根据site_id获取pcs详细数据 + @Override + public EmsPcsData getPcsDetailInfo(Long siteId) { + return emsPcsDataMapper.getPcsDetailInfoBySiteId(siteId); + } + + // 获取BMS总览数据 + @Override + public BMSOverViewVo getBMSOverView(Long siteId) { + BMSOverViewVo bmsOverViewVo = new BMSOverViewVo(); + EmsBatteryStack emsBatteryStack = emsBatteryStackMapper.selectEmsBatteryStackBySiteId(siteId); + BeanUtils.copyProperties(emsBatteryStack, bmsOverViewVo); + return bmsOverViewVo; + } + + // 获取BMS电池簇数据 + @Override + public BMSBatteryClusterVo getBMSBatteryCluster(Long siteId) { + BMSBatteryClusterVo bmsBatteryClusterVo = new BMSBatteryClusterVo(); + EmsBatteryCluster emsBatteryCluster = emsBatteryClusterMapper.getBMSBatteryCluster(siteId); + BeanUtils.copyProperties(emsBatteryCluster, bmsBatteryClusterVo); + return bmsBatteryClusterVo; + } + } diff --git a/ems-system/src/main/resources/mapper/ems/EmsBatteryClusterMapper.xml b/ems-system/src/main/resources/mapper/ems/EmsBatteryClusterMapper.xml new file mode 100644 index 0000000..e8005fb --- /dev/null +++ b/ems-system/src/main/resources/mapper/ems/EmsBatteryClusterMapper.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, work_status, pcs_communication_status, ems_communication_status, cluster_voltage, chargeable_capacity, total_charged_capacity, cluster_current, dischargeable_capacity, total_discharged_capacity, soh, average_temperature, insulation_resistance, current_soc, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_battery_cluster + + + + + + + + insert into ems_battery_cluster + + work_status, + pcs_communication_status, + ems_communication_status, + cluster_voltage, + chargeable_capacity, + total_charged_capacity, + cluster_current, + dischargeable_capacity, + total_discharged_capacity, + soh, + average_temperature, + insulation_resistance, + current_soc, + create_by, + create_time, + update_by, + update_time, + remark, + site_id, + device_id, + + + #{workStatus}, + #{pcsCommunicationStatus}, + #{emsCommunicationStatus}, + #{clusterVoltage}, + #{chargeableCapacity}, + #{totalChargedCapacity}, + #{clusterCurrent}, + #{dischargeableCapacity}, + #{totalDischargedCapacity}, + #{soh}, + #{averageTemperature}, + #{insulationResistance}, + #{currentSoc}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{siteId}, + #{deviceId}, + + + + + update ems_battery_cluster + + work_status = #{workStatus}, + pcs_communication_status = #{pcsCommunicationStatus}, + ems_communication_status = #{emsCommunicationStatus}, + cluster_voltage = #{clusterVoltage}, + chargeable_capacity = #{chargeableCapacity}, + total_charged_capacity = #{totalChargedCapacity}, + cluster_current = #{clusterCurrent}, + dischargeable_capacity = #{dischargeableCapacity}, + total_discharged_capacity = #{totalDischargedCapacity}, + soh = #{soh}, + average_temperature = #{averageTemperature}, + insulation_resistance = #{insulationResistance}, + current_soc = #{currentSoc}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + site_id = #{siteId}, + device_id = #{deviceId}, + + where id = #{id} + + + + delete from ems_battery_cluster where id = #{id} + + + + delete from ems_battery_cluster where id in + + #{id} + + + + + \ No newline at end of file diff --git a/ems-system/src/main/resources/mapper/ems/EmsBatteryStackMapper.xml b/ems-system/src/main/resources/mapper/ems/EmsBatteryStackMapper.xml new file mode 100644 index 0000000..47e74dd --- /dev/null +++ b/ems-system/src/main/resources/mapper/ems/EmsBatteryStackMapper.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, work_status, pcs_communication_status, ems_communication_status, total_voltage, chargeable_capacity, total_charged_capacity, total_current, dischargeable_capacity, total_discharged_capacity, soh, average_temperature, insulation_resistance, current_soc, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_battery_stack + + + + + + + + insert into ems_battery_stack + + work_status, + pcs_communication_status, + ems_communication_status, + total_voltage, + chargeable_capacity, + total_charged_capacity, + total_current, + dischargeable_capacity, + total_discharged_capacity, + soh, + average_temperature, + insulation_resistance, + current_soc, + create_by, + create_time, + update_by, + update_time, + remark, + site_id, + device_id, + + + #{workStatus}, + #{pcsCommunicationStatus}, + #{emsCommunicationStatus}, + #{totalVoltage}, + #{chargeableCapacity}, + #{totalChargedCapacity}, + #{totalCurrent}, + #{dischargeableCapacity}, + #{totalDischargedCapacity}, + #{soh}, + #{averageTemperature}, + #{insulationResistance}, + #{currentSoc}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{siteId}, + #{deviceId}, + + + + + update ems_battery_stack + + work_status = #{workStatus}, + pcs_communication_status = #{pcsCommunicationStatus}, + ems_communication_status = #{emsCommunicationStatus}, + total_voltage = #{totalVoltage}, + chargeable_capacity = #{chargeableCapacity}, + total_charged_capacity = #{totalChargedCapacity}, + total_current = #{totalCurrent}, + dischargeable_capacity = #{dischargeableCapacity}, + total_discharged_capacity = #{totalDischargedCapacity}, + soh = #{soh}, + average_temperature = #{averageTemperature}, + insulation_resistance = #{insulationResistance}, + current_soc = #{currentSoc}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + site_id = #{siteId}, + device_id = #{deviceId}, + + where id = #{id} + + + + delete from ems_battery_stack where id = #{id} + + + + delete from ems_battery_stack where id in + + #{id} + + + + + \ No newline at end of file diff --git a/ems-system/src/main/resources/mapper/ems/EmsPcsDataMapper.xml b/ems-system/src/main/resources/mapper/ems/EmsPcsDataMapper.xml index a6e6c1c..eb1522e 100644 --- a/ems-system/src/main/resources/mapper/ems/EmsPcsDataMapper.xml +++ b/ems-system/src/main/resources/mapper/ems/EmsPcsDataMapper.xml @@ -254,4 +254,10 @@ ) as tmp group by dateMonth + + \ No newline at end of file