平台修改意见20251120-新增EMS设备类型查询列表接口;综合查询-按天查询点位数据箱线图展示;处理EMS设备topic消息;设备类型接口新增告警数量
This commit is contained in:
@ -205,6 +205,15 @@ public class EmsSiteMonitorController extends BaseController{
|
|||||||
return success(iSingleSiteService.getXfDataList(siteId));
|
return success(iSingleSiteService.getXfDataList(siteId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EMS数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/getEmsDataList")
|
||||||
|
public AjaxResult getEmsDataList(@RequestParam String siteId)
|
||||||
|
{
|
||||||
|
return success(iSingleSiteService.getEmsDataList(siteId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单站监控-首页-点位展示
|
* 单站监控-首页-点位展示
|
||||||
* 储能功率、电网功率、负荷功率、光伏功率
|
* 储能功率、电网功率、负荷功率、光伏功率
|
||||||
|
|||||||
@ -62,6 +62,11 @@ public class RedisKeyConstants
|
|||||||
*/
|
*/
|
||||||
public static final String COOLING = "COOLING_";
|
public static final String COOLING = "COOLING_";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EMS数据 redis key
|
||||||
|
*/
|
||||||
|
public static final String EMS = "EMS_";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点位匹配数据 redis key
|
* 点位匹配数据 redis key
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -21,7 +21,8 @@ public enum DeviceCategory
|
|||||||
COOLING("COOLING", "冷却", null),
|
COOLING("COOLING", "冷却", null),
|
||||||
DH("DH", "动环", null),
|
DH("DH", "动环", null),
|
||||||
XF("XF", "消防", null),
|
XF("XF", "消防", null),
|
||||||
BATTERY_GROUP("BATTERY_GROUP", "电池组", null);
|
BATTERY_GROUP("BATTERY_GROUP", "电池组", null),
|
||||||
|
EMS("EMS", "EMS设备", null),;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String info;
|
private final String info;
|
||||||
|
|||||||
@ -53,5 +53,10 @@ public enum SiteDevice
|
|||||||
/**
|
/**
|
||||||
* 中水冷却
|
* 中水冷却
|
||||||
*/
|
*/
|
||||||
ZSLQ
|
ZSLQ,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EMS
|
||||||
|
*/
|
||||||
|
EMS
|
||||||
}
|
}
|
||||||
|
|||||||
241
ems-system/src/main/java/com/xzzn/ems/domain/EmsEmsData.java
Normal file
241
ems-system/src/main/java/com/xzzn/ems/domain/EmsEmsData.java
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
package com.xzzn.ems.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.xzzn.common.annotation.Excel;
|
||||||
|
import com.xzzn.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据对象 ems_ems_data
|
||||||
|
*
|
||||||
|
* @author xzzn
|
||||||
|
* @date 2025-12-09
|
||||||
|
*/
|
||||||
|
public class EmsEmsData extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 数据采集时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "数据采集时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date dataUpdateTime;
|
||||||
|
|
||||||
|
/** EMS控制模式 */
|
||||||
|
@Excel(name = "EMS控制模式")
|
||||||
|
private BigDecimal emsStatus;
|
||||||
|
|
||||||
|
/** BMS1SOC */
|
||||||
|
@Excel(name = "BMS1SOC")
|
||||||
|
private BigDecimal bms1Soc;
|
||||||
|
|
||||||
|
/** BMS2SOC */
|
||||||
|
@Excel(name = "BMS2SOC")
|
||||||
|
private BigDecimal bms2Soc;
|
||||||
|
|
||||||
|
/** BMS3SOC */
|
||||||
|
@Excel(name = "BMS3SOC")
|
||||||
|
private BigDecimal bms3Soc;
|
||||||
|
|
||||||
|
/** BMS4SOC */
|
||||||
|
@Excel(name = "BMS4SOC")
|
||||||
|
private BigDecimal bms4Soc;
|
||||||
|
|
||||||
|
/** PCS-1有功功率 */
|
||||||
|
@Excel(name = "PCS-1有功功率")
|
||||||
|
private BigDecimal pcs1Yggl;
|
||||||
|
|
||||||
|
/** PCS-2有功功率 */
|
||||||
|
@Excel(name = "PCS-2有功功率")
|
||||||
|
private BigDecimal pcs2Yggl;
|
||||||
|
|
||||||
|
/** PCS-3有功功率 */
|
||||||
|
@Excel(name = "PCS-3有功功率")
|
||||||
|
private BigDecimal pcs3Yggl;
|
||||||
|
|
||||||
|
/** PCS-4有功功率 */
|
||||||
|
@Excel(name = "PCS-4有功功率")
|
||||||
|
private BigDecimal pcs4Yggl;
|
||||||
|
|
||||||
|
/** EMS有功功率 */
|
||||||
|
@Excel(name = "EMS有功功率")
|
||||||
|
private BigDecimal emsYggl;
|
||||||
|
|
||||||
|
/** 站点id */
|
||||||
|
@Excel(name = "站点id")
|
||||||
|
private String siteId;
|
||||||
|
|
||||||
|
/** 设备唯一标识符 */
|
||||||
|
@Excel(name = "设备唯一标识符")
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataUpdateTime(Date dataUpdateTime)
|
||||||
|
{
|
||||||
|
this.dataUpdateTime = dataUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataUpdateTime()
|
||||||
|
{
|
||||||
|
return dataUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmsStatus(BigDecimal emsStatus)
|
||||||
|
{
|
||||||
|
this.emsStatus = emsStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getEmsStatus()
|
||||||
|
{
|
||||||
|
return emsStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBms1Soc(BigDecimal bms1Soc)
|
||||||
|
{
|
||||||
|
this.bms1Soc = bms1Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBms1Soc()
|
||||||
|
{
|
||||||
|
return bms1Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBms2Soc(BigDecimal bms2Soc)
|
||||||
|
{
|
||||||
|
this.bms2Soc = bms2Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBms2Soc()
|
||||||
|
{
|
||||||
|
return bms2Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBms3Soc(BigDecimal bms3Soc)
|
||||||
|
{
|
||||||
|
this.bms3Soc = bms3Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBms3Soc()
|
||||||
|
{
|
||||||
|
return bms3Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBms4Soc(BigDecimal bms4Soc)
|
||||||
|
{
|
||||||
|
this.bms4Soc = bms4Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBms4Soc()
|
||||||
|
{
|
||||||
|
return bms4Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPcs1Yggl(BigDecimal pcs1Yggl)
|
||||||
|
{
|
||||||
|
this.pcs1Yggl = pcs1Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPcs1Yggl()
|
||||||
|
{
|
||||||
|
return pcs1Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPcs2Yggl(BigDecimal pcs2Yggl)
|
||||||
|
{
|
||||||
|
this.pcs2Yggl = pcs2Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPcs2Yggl()
|
||||||
|
{
|
||||||
|
return pcs2Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPcs3Yggl(BigDecimal pcs3Yggl)
|
||||||
|
{
|
||||||
|
this.pcs3Yggl = pcs3Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPcs3Yggl()
|
||||||
|
{
|
||||||
|
return pcs3Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPcs4Yggl(BigDecimal pcs4Yggl)
|
||||||
|
{
|
||||||
|
this.pcs4Yggl = pcs4Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPcs4Yggl()
|
||||||
|
{
|
||||||
|
return pcs4Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmsYggl(BigDecimal emsYggl)
|
||||||
|
{
|
||||||
|
this.emsYggl = emsYggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getEmsYggl()
|
||||||
|
{
|
||||||
|
return emsYggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteId(String siteId)
|
||||||
|
{
|
||||||
|
this.siteId = siteId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteId()
|
||||||
|
{
|
||||||
|
return siteId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceId(String deviceId)
|
||||||
|
{
|
||||||
|
this.deviceId = deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceId()
|
||||||
|
{
|
||||||
|
return deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("dataUpdateTime", getDataUpdateTime())
|
||||||
|
.append("emsStatus", getEmsStatus())
|
||||||
|
.append("bms1Soc", getBms1Soc())
|
||||||
|
.append("bms2Soc", getBms2Soc())
|
||||||
|
.append("bms3Soc", getBms3Soc())
|
||||||
|
.append("bms4Soc", getBms4Soc())
|
||||||
|
.append("pcs1Yggl", getPcs1Yggl())
|
||||||
|
.append("pcs2Yggl", getPcs2Yggl())
|
||||||
|
.append("pcs3Yggl", getPcs3Yggl())
|
||||||
|
.append("pcs4Yggl", getPcs4Yggl())
|
||||||
|
.append("emsYggl", getEmsYggl())
|
||||||
|
.append("siteId", getSiteId())
|
||||||
|
.append("deviceId", getDeviceId())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -44,6 +44,9 @@ public class AmmeterDataVo {
|
|||||||
// 无功电能
|
// 无功电能
|
||||||
private BigDecimal reactiveEnergy;
|
private BigDecimal reactiveEnergy;
|
||||||
|
|
||||||
|
/** 报警个数 */
|
||||||
|
private int alarmNum;
|
||||||
|
|
||||||
public BigDecimal getActiveEnergy() {
|
public BigDecimal getActiveEnergy() {
|
||||||
return activeEnergy;
|
return activeEnergy;
|
||||||
}
|
}
|
||||||
@ -147,4 +150,12 @@ public class AmmeterDataVo {
|
|||||||
public void setDeviceId(String deviceId) {
|
public void setDeviceId(String deviceId) {
|
||||||
this.deviceId = deviceId;
|
this.deviceId = deviceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getAlarmNum() {
|
||||||
|
return alarmNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmNum(int alarmNum) {
|
||||||
|
this.alarmNum = alarmNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,6 +67,9 @@ public class BMSBatteryClusterVo {
|
|||||||
/** 父类设备名称 */
|
/** 父类设备名称 */
|
||||||
private String parentDeviceName;
|
private String parentDeviceName;
|
||||||
|
|
||||||
|
/** 报警个数 */
|
||||||
|
private int alarmNum;
|
||||||
|
|
||||||
private List<BMSBatteryClusterDataList> batteryDataList;
|
private List<BMSBatteryClusterDataList> batteryDataList;
|
||||||
|
|
||||||
public String getDeviceName() {
|
public String getDeviceName() {
|
||||||
@ -220,4 +223,12 @@ public class BMSBatteryClusterVo {
|
|||||||
public void setParentDeviceName(String parentDeviceName) {
|
public void setParentDeviceName(String parentDeviceName) {
|
||||||
this.parentDeviceName = parentDeviceName;
|
this.parentDeviceName = parentDeviceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getAlarmNum() {
|
||||||
|
return alarmNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmNum(int alarmNum) {
|
||||||
|
this.alarmNum = alarmNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,9 @@ public class BMSOverViewVo {
|
|||||||
/** 设备唯一标识符 */
|
/** 设备唯一标识符 */
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
|
|
||||||
|
/** 报警个数 */
|
||||||
|
private int alarmNum;
|
||||||
|
|
||||||
private List<BMSBatteryDataList> batteryDataList;
|
private List<BMSBatteryDataList> batteryDataList;
|
||||||
|
|
||||||
public String getDeviceName() {
|
public String getDeviceName() {
|
||||||
@ -202,6 +205,14 @@ public class BMSOverViewVo {
|
|||||||
this.deviceId = deviceId;
|
this.deviceId = deviceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getAlarmNum() {
|
||||||
|
return alarmNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmNum(int alarmNum) {
|
||||||
|
this.alarmNum = alarmNum;
|
||||||
|
}
|
||||||
|
|
||||||
public List<BMSBatteryDataList> getBatteryDataList() {
|
public List<BMSBatteryDataList> getBatteryDataList() {
|
||||||
return batteryDataList;
|
return batteryDataList;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,6 +50,9 @@ public class CoolingDataViewVo {
|
|||||||
/** 设备唯一标识符 */
|
/** 设备唯一标识符 */
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
|
|
||||||
|
/** 报警个数 */
|
||||||
|
private int alarmNum;
|
||||||
|
|
||||||
public String getDeviceName() {
|
public String getDeviceName() {
|
||||||
return deviceName;
|
return deviceName;
|
||||||
}
|
}
|
||||||
@ -129,4 +132,12 @@ public class CoolingDataViewVo {
|
|||||||
public void setDeviceId(String deviceId) {
|
public void setDeviceId(String deviceId) {
|
||||||
this.deviceId = deviceId;
|
this.deviceId = deviceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getAlarmNum() {
|
||||||
|
return alarmNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmNum(int alarmNum) {
|
||||||
|
this.alarmNum = alarmNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,9 @@ public class DhDataVo {
|
|||||||
/** 温度 */
|
/** 温度 */
|
||||||
private BigDecimal temperature;
|
private BigDecimal temperature;
|
||||||
|
|
||||||
|
/** 报警个数 */
|
||||||
|
private int alarmNum;
|
||||||
|
|
||||||
public String getDeviceId() {
|
public String getDeviceId() {
|
||||||
return deviceId;
|
return deviceId;
|
||||||
}
|
}
|
||||||
@ -66,4 +69,12 @@ public class DhDataVo {
|
|||||||
public void setTemperature(BigDecimal temperature) {
|
public void setTemperature(BigDecimal temperature) {
|
||||||
this.temperature = temperature;
|
this.temperature = temperature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getAlarmNum() {
|
||||||
|
return alarmNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmNum(int alarmNum) {
|
||||||
|
this.alarmNum = alarmNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
168
ems-system/src/main/java/com/xzzn/ems/domain/vo/EmsDataVo.java
Normal file
168
ems-system/src/main/java/com/xzzn/ems/domain/vo/EmsDataVo.java
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
package com.xzzn.ems.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.xzzn.common.annotation.Excel;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EMS数据
|
||||||
|
*/
|
||||||
|
public class EmsDataVo {
|
||||||
|
|
||||||
|
/** 设备唯一标识符 */
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
/** 设备名称 */
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
/** EMS控制模式 */
|
||||||
|
private BigDecimal emsStatus;
|
||||||
|
|
||||||
|
/** 数据更新时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date dataUpdateTime;
|
||||||
|
|
||||||
|
/** BMS1SOC */
|
||||||
|
private BigDecimal bms1Soc;
|
||||||
|
|
||||||
|
/** BMS2SOC */
|
||||||
|
private BigDecimal bms2Soc;
|
||||||
|
|
||||||
|
/** BMS3SOC */
|
||||||
|
private BigDecimal bms3Soc;
|
||||||
|
|
||||||
|
/** BMS4SOC */
|
||||||
|
private BigDecimal bms4Soc;
|
||||||
|
|
||||||
|
/** PCS-1有功功率 */
|
||||||
|
private BigDecimal pcs1Yggl;
|
||||||
|
|
||||||
|
/** PCS-2有功功率 */
|
||||||
|
private BigDecimal pcs2Yggl;
|
||||||
|
|
||||||
|
/** PCS-3有功功率 */
|
||||||
|
private BigDecimal pcs3Yggl;
|
||||||
|
|
||||||
|
/** PCS-4有功功率 */
|
||||||
|
private BigDecimal pcs4Yggl;
|
||||||
|
|
||||||
|
/** EMS有功功率 */
|
||||||
|
private BigDecimal emsYggl;
|
||||||
|
|
||||||
|
/** 报警个数 */
|
||||||
|
private int alarmNum;
|
||||||
|
|
||||||
|
public String getDeviceId() {
|
||||||
|
return deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceId(String deviceId) {
|
||||||
|
this.deviceId = deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceName() {
|
||||||
|
return deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceName(String deviceName) {
|
||||||
|
this.deviceName = deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getEmsStatus() {
|
||||||
|
return emsStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmsStatus(BigDecimal emsStatus) {
|
||||||
|
this.emsStatus = emsStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataUpdateTime() {
|
||||||
|
return dataUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||||
|
this.dataUpdateTime = dataUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBms1Soc() {
|
||||||
|
return bms1Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBms1Soc(BigDecimal bms1Soc) {
|
||||||
|
this.bms1Soc = bms1Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBms2Soc() {
|
||||||
|
return bms2Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBms2Soc(BigDecimal bms2Soc) {
|
||||||
|
this.bms2Soc = bms2Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBms3Soc() {
|
||||||
|
return bms3Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBms3Soc(BigDecimal bms3Soc) {
|
||||||
|
this.bms3Soc = bms3Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBms4Soc() {
|
||||||
|
return bms4Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBms4Soc(BigDecimal bms4Soc) {
|
||||||
|
this.bms4Soc = bms4Soc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPcs1Yggl() {
|
||||||
|
return pcs1Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPcs1Yggl(BigDecimal pcs1Yggl) {
|
||||||
|
this.pcs1Yggl = pcs1Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPcs2Yggl() {
|
||||||
|
return pcs2Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPcs2Yggl(BigDecimal pcs2Yggl) {
|
||||||
|
this.pcs2Yggl = pcs2Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPcs3Yggl() {
|
||||||
|
return pcs3Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPcs3Yggl(BigDecimal pcs3Yggl) {
|
||||||
|
this.pcs3Yggl = pcs3Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPcs4Yggl() {
|
||||||
|
return pcs4Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPcs4Yggl(BigDecimal pcs4Yggl) {
|
||||||
|
this.pcs4Yggl = pcs4Yggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getEmsYggl() {
|
||||||
|
return emsYggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmsYggl(BigDecimal emsYggl) {
|
||||||
|
this.emsYggl = emsYggl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAlarmNum() {
|
||||||
|
return alarmNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmNum(int alarmNum) {
|
||||||
|
this.alarmNum = alarmNum;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -36,6 +36,9 @@ public class XfDataVo {
|
|||||||
/** 压力开关状态电磁阀状态 */
|
/** 压力开关状态电磁阀状态 */
|
||||||
private BigDecimal dcfzt;
|
private BigDecimal dcfzt;
|
||||||
|
|
||||||
|
/** 报警个数 */
|
||||||
|
private int alarmNum;
|
||||||
|
|
||||||
public String getDeviceId() {
|
public String getDeviceId() {
|
||||||
return deviceId;
|
return deviceId;
|
||||||
}
|
}
|
||||||
@ -100,4 +103,11 @@ public class XfDataVo {
|
|||||||
this.dcfzt = dcfzt;
|
this.dcfzt = dcfzt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getAlarmNum() {
|
||||||
|
return alarmNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmNum(int alarmNum) {
|
||||||
|
this.alarmNum = alarmNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import com.xzzn.ems.domain.EmsClusterAlarmData;
|
|||||||
import com.xzzn.ems.domain.EmsCoolingAlarmData;
|
import com.xzzn.ems.domain.EmsCoolingAlarmData;
|
||||||
import com.xzzn.ems.domain.EmsCoolingData;
|
import com.xzzn.ems.domain.EmsCoolingData;
|
||||||
import com.xzzn.ems.domain.EmsDhData;
|
import com.xzzn.ems.domain.EmsDhData;
|
||||||
|
import com.xzzn.ems.domain.EmsEmsData;
|
||||||
import com.xzzn.ems.domain.EmsPcsAlarmData;
|
import com.xzzn.ems.domain.EmsPcsAlarmData;
|
||||||
import com.xzzn.ems.domain.EmsPcsBranchData;
|
import com.xzzn.ems.domain.EmsPcsBranchData;
|
||||||
import com.xzzn.ems.domain.EmsPcsData;
|
import com.xzzn.ems.domain.EmsPcsData;
|
||||||
@ -33,6 +34,7 @@ public enum DeviceMatchTable
|
|||||||
DH("DH", "ems_dh_data", EmsDhData.class),
|
DH("DH", "ems_dh_data", EmsDhData.class),
|
||||||
XF("XF", "ems_xf_data", EmsXfData.class),
|
XF("XF", "ems_xf_data", EmsXfData.class),
|
||||||
BATTERY_GROUP("BATTERY_GROUP", "ems_battery_group", EmsBatteryGroup.class),
|
BATTERY_GROUP("BATTERY_GROUP", "ems_battery_group", EmsBatteryGroup.class),
|
||||||
|
EMS("EMS", "ems_ems_data", EmsEmsData.class),
|
||||||
|
|
||||||
/** 告警点位 */
|
/** 告警点位 */
|
||||||
COOLING_ALARM("COOLING_ALARM", "ems_cooling_alarm_data", EmsCoolingAlarmData.class),
|
COOLING_ALARM("COOLING_ALARM", "ems_cooling_alarm_data", EmsCoolingAlarmData.class),
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.xzzn.ems.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.xzzn.ems.domain.EmsEmsData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据Mapper接口
|
||||||
|
*
|
||||||
|
* @author xzzn
|
||||||
|
* @date 2025-12-09
|
||||||
|
*/
|
||||||
|
public interface EmsEmsDataMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询数据
|
||||||
|
*
|
||||||
|
* @param id 数据主键
|
||||||
|
* @return 数据
|
||||||
|
*/
|
||||||
|
public EmsEmsData selectEmsEmsDataById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据列表
|
||||||
|
*
|
||||||
|
* @param emsEmsData 数据
|
||||||
|
* @return 数据集合
|
||||||
|
*/
|
||||||
|
public List<EmsEmsData> selectEmsEmsDataList(EmsEmsData emsEmsData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*
|
||||||
|
* @param emsEmsData 数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsEmsData(EmsEmsData emsEmsData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
*
|
||||||
|
* @param emsEmsData 数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsEmsData(EmsEmsData emsEmsData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据
|
||||||
|
*
|
||||||
|
* @param id 数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsEmsDataById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除数据
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsEmsDataByIds(Long[] ids);
|
||||||
|
}
|
||||||
@ -166,4 +166,6 @@ public interface EmsPointMatchMapper
|
|||||||
List<EmsPointMatch> getDevicePointMatchList(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory);
|
List<EmsPointMatch> getDevicePointMatchList(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory);
|
||||||
|
|
||||||
List<DevicePointMatchExportVo> selectEmsPointMatchExportList(EmsPointMatch emsPointMatch);
|
List<DevicePointMatchExportVo> selectEmsPointMatchExportList(EmsPointMatch emsPointMatch);
|
||||||
|
|
||||||
|
int getDevicePointAlarmNum(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,9 +31,11 @@ public interface ISingleSiteService
|
|||||||
|
|
||||||
public List<AmmeterDataVo> getAmmeterDataList(String siteId);
|
public List<AmmeterDataVo> getAmmeterDataList(String siteId);
|
||||||
|
|
||||||
List<DhDataVo> getDhDataList(String siteId);
|
public List<DhDataVo> getDhDataList(String siteId);
|
||||||
|
|
||||||
List<XfDataVo> getXfDataList(String siteId);
|
public List<XfDataVo> getXfDataList(String siteId);
|
||||||
|
|
||||||
|
public List<EmsDataVo> getEmsDataList(String siteId);
|
||||||
|
|
||||||
public SiteMonitorRuningInfoVo getRunningGraphPcsMaxTemp(RunningGraphRequest request);
|
public SiteMonitorRuningInfoVo getRunningGraphPcsMaxTemp(RunningGraphRequest request);
|
||||||
|
|
||||||
|
|||||||
@ -31,25 +31,7 @@ import com.xzzn.ems.domain.*;
|
|||||||
import com.xzzn.ems.domain.vo.EnergyPriceTimeRange;
|
import com.xzzn.ems.domain.vo.EnergyPriceTimeRange;
|
||||||
import com.xzzn.ems.domain.vo.EnergyPriceVo;
|
import com.xzzn.ems.domain.vo.EnergyPriceVo;
|
||||||
import com.xzzn.ems.enums.DeviceMatchTable;
|
import com.xzzn.ems.enums.DeviceMatchTable;
|
||||||
import com.xzzn.ems.mapper.EmsAmmeterDataMapper;
|
import com.xzzn.ems.mapper.*;
|
||||||
import com.xzzn.ems.mapper.EmsBatteryClusterMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsBatteryDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsBatteryDataMinutesMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsBatteryGroupMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsBatteryStackMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsClusterAlarmDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsCoolingAlarmDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsCoolingDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsDailyChargeDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsDailyEnergyDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsDevicesSettingMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsDhDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsEnergyPriceConfigMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsPcsAlarmDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsPcsBranchDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsPcsDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsStackAlarmDataMapper;
|
|
||||||
import com.xzzn.ems.mapper.EmsXfDataMapper;
|
|
||||||
import com.xzzn.ems.service.IDeviceDataProcessService;
|
import com.xzzn.ems.service.IDeviceDataProcessService;
|
||||||
import com.xzzn.ems.service.IEmsAlarmRecordsService;
|
import com.xzzn.ems.service.IEmsAlarmRecordsService;
|
||||||
import com.xzzn.ems.service.IEmsDeviceSettingService;
|
import com.xzzn.ems.service.IEmsDeviceSettingService;
|
||||||
@ -122,6 +104,8 @@ public class DeviceDataProcessServiceImpl extends AbstractBatteryDataProcessor i
|
|||||||
private EmsDailyEnergyDataMapper emsDailyEnergyDataMapper;
|
private EmsDailyEnergyDataMapper emsDailyEnergyDataMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmsBatteryGroupMapper emsBatteryGroupMapper;
|
private EmsBatteryGroupMapper emsBatteryGroupMapper;
|
||||||
|
@Autowired
|
||||||
|
private EmsEmsDataMapper emsEmsDataMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmsCoolingAlarmDataMapper emsCoolingAlarmDataMapper;
|
private EmsCoolingAlarmDataMapper emsCoolingAlarmDataMapper;
|
||||||
@ -201,10 +185,41 @@ public class DeviceDataProcessServiceImpl extends AbstractBatteryDataProcessor i
|
|||||||
dhDataProcess(siteId, deviceId, jsonData, dataUpdateTime);
|
dhDataProcess(siteId, deviceId, jsonData, dataUpdateTime);
|
||||||
} else if (deviceId.contains(SiteDevice.ZSLQ.name())) {
|
} else if (deviceId.contains(SiteDevice.ZSLQ.name())) {
|
||||||
coolingDataProcess(siteId, deviceId, jsonData, dataUpdateTime);
|
coolingDataProcess(siteId, deviceId, jsonData, dataUpdateTime);
|
||||||
|
} else if (deviceId.contains(SiteDevice.EMS.name())) {
|
||||||
|
emsDataProcess(siteId, deviceId, jsonData, dataUpdateTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void emsDataProcess(String siteId, String deviceId, String jsonData, Date dataUpdateTime) {
|
||||||
|
//EMS
|
||||||
|
Map<String, Object> obj = JSON.parseObject(jsonData, new TypeReference<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
// 点位匹配数据
|
||||||
|
List<EmsPointMatch> pointMatchList = devicePointMatchDataProcessor.getDevicePointMatch(siteId, deviceId, DeviceMatchTable.EMS.getCode());
|
||||||
|
if (CollectionUtils.isEmpty(pointMatchList)) {
|
||||||
|
log.info("未找到匹配的点位数据,无法处理EMS数据,siteId: " + siteId + ",deviceId: " + deviceId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Map<String, List<EmsPointEnumMatch>> pointEnumMatchMap = devicePointMatchDataProcessor.getPointEnumMatchMap(siteId, DeviceMatchTable.EMS.getCode());
|
||||||
|
|
||||||
|
EmsEmsData emsData = new EmsEmsData();
|
||||||
|
|
||||||
|
saveDeviceData(pointMatchList, obj, emsData, pointEnumMatchMap);
|
||||||
|
|
||||||
|
emsData.setDataUpdateTime(dataUpdateTime);
|
||||||
|
emsData.setCreateBy("system");
|
||||||
|
emsData.setCreateTime(DateUtils.getNowDate());
|
||||||
|
emsData.setUpdateBy("system");
|
||||||
|
emsData.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
emsData.setSiteId(siteId);
|
||||||
|
emsData.setDeviceId(deviceId);
|
||||||
|
|
||||||
|
emsEmsDataMapper.insertEmsEmsData(emsData);
|
||||||
|
|
||||||
|
redisCache.setCacheObject(RedisKeyConstants.EMS + siteId + "_" + deviceId, emsData);
|
||||||
|
}
|
||||||
|
|
||||||
private void coolingDataProcess(String siteId, String deviceId, String jsonData, Date dataUpdateTime) {
|
private void coolingDataProcess(String siteId, String deviceId, String jsonData, Date dataUpdateTime) {
|
||||||
//中水冷却
|
//中水冷却
|
||||||
Map<String, Object> obj = JSON.parseObject(jsonData, new TypeReference<Map<String, Object>>() {
|
Map<String, Object> obj = JSON.parseObject(jsonData, new TypeReference<Map<String, Object>>() {
|
||||||
|
|||||||
@ -53,6 +53,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
private EmsAmmeterDataMapper emsAmmeterDataMapper;
|
private EmsAmmeterDataMapper emsAmmeterDataMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmsDevicesSettingMapper emsDevicesSettingMapper;
|
private EmsDevicesSettingMapper emsDevicesSettingMapper;
|
||||||
|
@Autowired
|
||||||
|
private EmsPointMatchMapper emsPointMatchMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisCache redisCache;
|
private RedisCache redisCache;
|
||||||
@ -413,6 +415,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
List<PcsDetailInfoVo> pcsDetailInfoVoList = new ArrayList<>();
|
List<PcsDetailInfoVo> pcsDetailInfoVoList = new ArrayList<>();
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(siteId)) {
|
if (!StringUtils.isEmpty(siteId)) {
|
||||||
|
// 告警设备个数
|
||||||
|
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, DeviceCategory.PCS.getCode());
|
||||||
// 获取该设备下所有pcs的id
|
// 获取该设备下所有pcs的id
|
||||||
List<Map<String, Object>> pcsIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.PCS.getCode());
|
List<Map<String, Object>> pcsIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.PCS.getCode());
|
||||||
|
|
||||||
@ -431,8 +435,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
List<PcsBranchInfo> pcsBranchInfoList = new ArrayList<>();
|
List<PcsBranchInfo> pcsBranchInfoList = new ArrayList<>();
|
||||||
processBranchDataInfo(siteId,pcsId,pcsBranchInfoList);
|
processBranchDataInfo(siteId,pcsId,pcsBranchInfoList);
|
||||||
pcsDetailInfoVo.setPcsBranchInfoList(pcsBranchInfoList);
|
pcsDetailInfoVo.setPcsBranchInfoList(pcsBranchInfoList);
|
||||||
// 报警个数
|
// // 报警个数
|
||||||
int alarmNum = emsAlarmRecordsMapper.getDeviceAlarmNum(siteId,pcsId);
|
// int alarmNum = emsAlarmRecordsMapper.getDeviceAlarmNum(siteId,pcsId);
|
||||||
pcsDetailInfoVo.setAlarmNum(alarmNum);
|
pcsDetailInfoVo.setAlarmNum(alarmNum);
|
||||||
|
|
||||||
pcsDetailInfoVoList.add(pcsDetailInfoVo);
|
pcsDetailInfoVoList.add(pcsDetailInfoVo);
|
||||||
@ -459,6 +463,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
public List<BMSOverViewVo> getBMSOverView(String siteId) {
|
public List<BMSOverViewVo> getBMSOverView(String siteId) {
|
||||||
List<BMSOverViewVo> bmsOverViewVoList = new ArrayList<>();
|
List<BMSOverViewVo> bmsOverViewVoList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 告警设备个数
|
||||||
|
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, DeviceCategory.STACK.getCode());
|
||||||
// 获取所有电池堆
|
// 获取所有电池堆
|
||||||
if (!StringUtils.isEmpty(siteId)) {
|
if (!StringUtils.isEmpty(siteId)) {
|
||||||
List<Map<String, Object>> stackIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.STACK.getCode());
|
List<Map<String, Object>> stackIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.STACK.getCode());
|
||||||
@ -477,6 +483,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
batteryDataLists = getBMSClusterListInfo(siteId,stackId,null);
|
batteryDataLists = getBMSClusterListInfo(siteId,stackId,null);
|
||||||
bmsOverViewVo.setBatteryDataList(batteryDataLists);
|
bmsOverViewVo.setBatteryDataList(batteryDataLists);
|
||||||
}
|
}
|
||||||
|
bmsOverViewVo.setAlarmNum(alarmNum);
|
||||||
bmsOverViewVoList.add(bmsOverViewVo);
|
bmsOverViewVoList.add(bmsOverViewVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -515,6 +522,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
public List<BMSBatteryClusterVo> getBMSBatteryCluster(String siteId) {
|
public List<BMSBatteryClusterVo> getBMSBatteryCluster(String siteId) {
|
||||||
List<BMSBatteryClusterVo> bmsBatteryClusterVoList = new ArrayList<>();
|
List<BMSBatteryClusterVo> bmsBatteryClusterVoList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 告警设备个数
|
||||||
|
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, DeviceCategory.CLUSTER.getCode());
|
||||||
if (!StringUtils.isEmpty(siteId)) {
|
if (!StringUtils.isEmpty(siteId)) {
|
||||||
// 获取所有设备下的电池簇id
|
// 获取所有设备下的电池簇id
|
||||||
List<Map<String, Object>> clusterIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.CLUSTER.getCode());
|
List<Map<String, Object>> clusterIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.CLUSTER.getCode());
|
||||||
@ -533,6 +542,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
dealWithBatteryClusterData(clusterData,clusterDataList);
|
dealWithBatteryClusterData(clusterData,clusterDataList);
|
||||||
bmsBatteryClusterVo.setBatteryDataList(clusterDataList);
|
bmsBatteryClusterVo.setBatteryDataList(clusterDataList);
|
||||||
}
|
}
|
||||||
|
bmsBatteryClusterVo.setAlarmNum(alarmNum);
|
||||||
bmsBatteryClusterVoList.add(bmsBatteryClusterVo);
|
bmsBatteryClusterVoList.add(bmsBatteryClusterVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -574,6 +584,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
public List<CoolingDataViewVo> getCoolingDataList(String siteId) {
|
public List<CoolingDataViewVo> getCoolingDataList(String siteId) {
|
||||||
List<CoolingDataViewVo> emsCoolingDataList = new ArrayList<>();
|
List<CoolingDataViewVo> emsCoolingDataList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 告警设备个数
|
||||||
|
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, DeviceCategory.COOLING.getCode());
|
||||||
List<Map<String, Object>> deviceIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.COOLING.getCode());
|
List<Map<String, Object>> deviceIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.COOLING.getCode());
|
||||||
for (Map<String, Object> deviceId : deviceIds) {
|
for (Map<String, Object> deviceId : deviceIds) {
|
||||||
CoolingDataViewVo dataViewVo = new CoolingDataViewVo();
|
CoolingDataViewVo dataViewVo = new CoolingDataViewVo();
|
||||||
@ -583,6 +595,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
EmsCoolingData coolingData = redisCache.getCacheObject(RedisKeyConstants.COOLING + siteId + "_" + coolingId);
|
EmsCoolingData coolingData = redisCache.getCacheObject(RedisKeyConstants.COOLING + siteId + "_" + coolingId);
|
||||||
if (coolingData != null) {
|
if (coolingData != null) {
|
||||||
BeanUtils.copyProperties(coolingData, dataViewVo);
|
BeanUtils.copyProperties(coolingData, dataViewVo);
|
||||||
|
dataViewVo.setAlarmNum(alarmNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
emsCoolingDataList.add(dataViewVo);
|
emsCoolingDataList.add(dataViewVo);
|
||||||
@ -664,7 +677,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
if (ammeterIdList == null || ammeterIdList.isEmpty()) {
|
if (ammeterIdList == null || ammeterIdList.isEmpty()) {
|
||||||
return ammeterResponse;
|
return ammeterResponse;
|
||||||
}
|
}
|
||||||
|
// 告警设备个数
|
||||||
|
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, DeviceCategory.AMMETER.getCode());
|
||||||
for (Map<String, Object> ammeterDevice : ammeterIdList) {
|
for (Map<String, Object> ammeterDevice : ammeterIdList) {
|
||||||
String ammeterId = ammeterDevice.get("id").toString();
|
String ammeterId = ammeterDevice.get("id").toString();
|
||||||
if (!ammeterDeviceIds.contains(ammeterId)) {
|
if (!ammeterDeviceIds.contains(ammeterId)) {
|
||||||
@ -678,6 +692,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
ammeterDataVo.setDeviceId(ammeterDevice.get("id").toString());
|
ammeterDataVo.setDeviceId(ammeterDevice.get("id").toString());
|
||||||
ammeterDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" :
|
ammeterDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" :
|
||||||
ammeterDevice.get("communicationStatus").toString());
|
ammeterDevice.get("communicationStatus").toString());
|
||||||
|
ammeterDataVo.setAlarmNum(alarmNum);
|
||||||
// 设置表数据
|
// 设置表数据
|
||||||
dealAmmeterData(ammeterData,ammeterDataVo);
|
dealAmmeterData(ammeterData,ammeterDataVo);
|
||||||
ammeterResponse.add(ammeterDataVo);
|
ammeterResponse.add(ammeterDataVo);
|
||||||
@ -757,6 +772,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
public List<DhDataVo> getDhDataList(String siteId) {
|
public List<DhDataVo> getDhDataList(String siteId) {
|
||||||
List<DhDataVo> emsDhDataList = new ArrayList<>();
|
List<DhDataVo> emsDhDataList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 告警设备个数
|
||||||
|
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, DeviceCategory.DH.getCode());
|
||||||
List<Map<String, Object>> dhDeviceList = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.DH.getCode());
|
List<Map<String, Object>> dhDeviceList = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.DH.getCode());
|
||||||
for (Map<String, Object> dhDevice : dhDeviceList) {
|
for (Map<String, Object> dhDevice : dhDeviceList) {
|
||||||
DhDataVo dhDataVo = new DhDataVo();
|
DhDataVo dhDataVo = new DhDataVo();
|
||||||
@ -767,7 +784,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
if (dhData != null) {
|
if (dhData != null) {
|
||||||
BeanUtils.copyProperties(dhData, dhDataVo);
|
BeanUtils.copyProperties(dhData, dhDataVo);
|
||||||
}
|
}
|
||||||
|
dhDataVo.setAlarmNum(alarmNum);
|
||||||
emsDhDataList.add(dhDataVo);
|
emsDhDataList.add(dhDataVo);
|
||||||
}
|
}
|
||||||
return emsDhDataList;
|
return emsDhDataList;
|
||||||
@ -783,6 +800,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
List<XfDataVo> emsXfDataList = new ArrayList<>();
|
List<XfDataVo> emsXfDataList = new ArrayList<>();
|
||||||
|
|
||||||
List<Map<String, Object>> xfDeviceList = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.XF.getCode());
|
List<Map<String, Object>> xfDeviceList = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.XF.getCode());
|
||||||
|
// 告警设备个数
|
||||||
|
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, DeviceCategory.XF.getCode());
|
||||||
for (Map<String, Object> xfDevice : xfDeviceList) {
|
for (Map<String, Object> xfDevice : xfDeviceList) {
|
||||||
XfDataVo xfDataVo = new XfDataVo();
|
XfDataVo xfDataVo = new XfDataVo();
|
||||||
xfDataVo.setDeviceName(xfDevice.get("deviceName").toString());
|
xfDataVo.setDeviceName(xfDevice.get("deviceName").toString());
|
||||||
@ -792,6 +811,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
if (xfData != null) {
|
if (xfData != null) {
|
||||||
BeanUtils.copyProperties(xfData, xfDataVo);
|
BeanUtils.copyProperties(xfData, xfDataVo);
|
||||||
xfDataVo.setDataUpdateTime(xfData.getDataTimestamp());
|
xfDataVo.setDataUpdateTime(xfData.getDataTimestamp());
|
||||||
|
xfDataVo.setAlarmNum(alarmNum);
|
||||||
}
|
}
|
||||||
xfDataVo.setEmsCommunicationStatus(xfDevice.get("communicationStatus") == null ? "" : xfDevice.get("communicationStatus").toString());
|
xfDataVo.setEmsCommunicationStatus(xfDevice.get("communicationStatus") == null ? "" : xfDevice.get("communicationStatus").toString());
|
||||||
emsXfDataList.add(xfDataVo);
|
emsXfDataList.add(xfDataVo);
|
||||||
@ -799,6 +819,28 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
return emsXfDataList;
|
return emsXfDataList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmsDataVo> getEmsDataList(String siteId) {
|
||||||
|
List<EmsDataVo> emsDataList = new ArrayList<>();
|
||||||
|
|
||||||
|
List<Map<String, Object>> xfDeviceList = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.EMS.getCode());
|
||||||
|
// 告警设备个数
|
||||||
|
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, DeviceCategory.EMS.getCode());
|
||||||
|
for (Map<String, Object> emsDevice : xfDeviceList) {
|
||||||
|
EmsDataVo emsDataVo = new EmsDataVo();
|
||||||
|
emsDataVo.setDeviceName(emsDevice.get("deviceName").toString());
|
||||||
|
// 从redis取堆单个详细数据
|
||||||
|
String emsDeviceId = emsDevice.get("id").toString();
|
||||||
|
EmsEmsData emsData = redisCache.getCacheObject(RedisKeyConstants.EMS + siteId + "_" + emsDeviceId);
|
||||||
|
if (emsData != null) {
|
||||||
|
BeanUtils.copyProperties(emsData, emsDataVo);
|
||||||
|
emsDataVo.setAlarmNum(alarmNum);
|
||||||
|
}
|
||||||
|
emsDataList.add(emsDataVo);
|
||||||
|
}
|
||||||
|
return emsDataList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单站监控-首页-获取重点数据
|
* 单站监控-首页-获取重点数据
|
||||||
* @param requestVo
|
* @param requestVo
|
||||||
|
|||||||
136
ems-system/src/main/resources/mapper/ems/EmsEmsDataMapper.xml
Normal file
136
ems-system/src/main/resources/mapper/ems/EmsEmsDataMapper.xml
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.xzzn.ems.mapper.EmsEmsDataMapper">
|
||||||
|
|
||||||
|
<resultMap type="EmsEmsData" id="EmsEmsDataResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="dataUpdateTime" column="data_update_time" />
|
||||||
|
<result property="emsStatus" column="ems_status" />
|
||||||
|
<result property="bms1Soc" column="bms1_soc" />
|
||||||
|
<result property="bms2Soc" column="bms2_soc" />
|
||||||
|
<result property="bms3Soc" column="bms3_soc" />
|
||||||
|
<result property="bms4Soc" column="bms4_soc" />
|
||||||
|
<result property="pcs1Yggl" column="pcs1_yggl" />
|
||||||
|
<result property="pcs2Yggl" column="pcs2_yggl" />
|
||||||
|
<result property="pcs3Yggl" column="pcs3_yggl" />
|
||||||
|
<result property="pcs4Yggl" column="pcs4_yggl" />
|
||||||
|
<result property="emsYggl" column="ems_yggl" />
|
||||||
|
<result property="siteId" column="site_id" />
|
||||||
|
<result property="deviceId" column="device_id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectEmsEmsDataVo">
|
||||||
|
select id, data_update_time, ems_status, bms1_soc, bms2_soc, bms3_soc, bms4_soc, pcs1_yggl, pcs2_yggl, pcs3_yggl, pcs4_yggl, ems_yggl, site_id, device_id, create_by, create_time, update_by, update_time, remark from ems_ems_data
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectEmsEmsDataList" parameterType="EmsEmsData" resultMap="EmsEmsDataResult">
|
||||||
|
<include refid="selectEmsEmsDataVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="dataUpdateTime != null "> and data_update_time = #{dataUpdateTime}</if>
|
||||||
|
<if test="emsStatus != null and emsStatus != ''"> and ems_status = #{emsStatus}</if>
|
||||||
|
<if test="bms1Soc != null "> and bms1_soc = #{bms1Soc}</if>
|
||||||
|
<if test="bms2Soc != null "> and bms2_soc = #{bms2Soc}</if>
|
||||||
|
<if test="bms3Soc != null "> and bms3_soc = #{bms3Soc}</if>
|
||||||
|
<if test="bms4Soc != null "> and bms4_soc = #{bms4Soc}</if>
|
||||||
|
<if test="pcs1Yggl != null "> and pcs1_yggl = #{pcs1Yggl}</if>
|
||||||
|
<if test="pcs2Yggl != null "> and pcs2_yggl = #{pcs2Yggl}</if>
|
||||||
|
<if test="pcs3Yggl != null "> and pcs3_yggl = #{pcs3Yggl}</if>
|
||||||
|
<if test="pcs4Yggl != null "> and pcs4_yggl = #{pcs4Yggl}</if>
|
||||||
|
<if test="emsYggl != null "> and ems_yggl = #{emsYggl}</if>
|
||||||
|
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||||
|
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEmsEmsDataById" parameterType="Long" resultMap="EmsEmsDataResult">
|
||||||
|
<include refid="selectEmsEmsDataVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertEmsEmsData" parameterType="EmsEmsData" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into ems_ems_data
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataUpdateTime != null">data_update_time,</if>
|
||||||
|
<if test="emsStatus != null">ems_status,</if>
|
||||||
|
<if test="bms1Soc != null">bms1_soc,</if>
|
||||||
|
<if test="bms2Soc != null">bms2_soc,</if>
|
||||||
|
<if test="bms3Soc != null">bms3_soc,</if>
|
||||||
|
<if test="bms4Soc != null">bms4_soc,</if>
|
||||||
|
<if test="pcs1Yggl != null">pcs1_yggl,</if>
|
||||||
|
<if test="pcs2Yggl != null">pcs2_yggl,</if>
|
||||||
|
<if test="pcs3Yggl != null">pcs3_yggl,</if>
|
||||||
|
<if test="pcs4Yggl != null">pcs4_yggl,</if>
|
||||||
|
<if test="emsYggl != null">ems_yggl,</if>
|
||||||
|
<if test="siteId != null">site_id,</if>
|
||||||
|
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="dataUpdateTime != null">#{dataUpdateTime},</if>
|
||||||
|
<if test="emsStatus != null">#{emsStatus},</if>
|
||||||
|
<if test="bms1Soc != null">#{bms1Soc},</if>
|
||||||
|
<if test="bms2Soc != null">#{bms2Soc},</if>
|
||||||
|
<if test="bms3Soc != null">#{bms3Soc},</if>
|
||||||
|
<if test="bms4Soc != null">#{bms4Soc},</if>
|
||||||
|
<if test="pcs1Yggl != null">#{pcs1Yggl},</if>
|
||||||
|
<if test="pcs2Yggl != null">#{pcs2Yggl},</if>
|
||||||
|
<if test="pcs3Yggl != null">#{pcs3Yggl},</if>
|
||||||
|
<if test="pcs4Yggl != null">#{pcs4Yggl},</if>
|
||||||
|
<if test="emsYggl != null">#{emsYggl},</if>
|
||||||
|
<if test="siteId != null">#{siteId},</if>
|
||||||
|
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateEmsEmsData" parameterType="EmsEmsData">
|
||||||
|
update ems_ems_data
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="dataUpdateTime != null">data_update_time = #{dataUpdateTime},</if>
|
||||||
|
<if test="emsStatus != null">ems_status = #{emsStatus},</if>
|
||||||
|
<if test="bms1Soc != null">bms1_soc = #{bms1Soc},</if>
|
||||||
|
<if test="bms2Soc != null">bms2_soc = #{bms2Soc},</if>
|
||||||
|
<if test="bms3Soc != null">bms3_soc = #{bms3Soc},</if>
|
||||||
|
<if test="bms4Soc != null">bms4_soc = #{bms4Soc},</if>
|
||||||
|
<if test="pcs1Yggl != null">pcs1_yggl = #{pcs1Yggl},</if>
|
||||||
|
<if test="pcs2Yggl != null">pcs2_yggl = #{pcs2Yggl},</if>
|
||||||
|
<if test="pcs3Yggl != null">pcs3_yggl = #{pcs3Yggl},</if>
|
||||||
|
<if test="pcs4Yggl != null">pcs4_yggl = #{pcs4Yggl},</if>
|
||||||
|
<if test="emsYggl != null">ems_yggl = #{emsYggl},</if>
|
||||||
|
<if test="siteId != null">site_id = #{siteId},</if>
|
||||||
|
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteEmsEmsDataById" parameterType="Long">
|
||||||
|
delete from ems_ems_data where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteEmsEmsDataByIds" parameterType="String">
|
||||||
|
delete from ems_ems_data where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
@ -518,5 +518,14 @@
|
|||||||
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getDevicePointAlarmNum" resultType="java.lang.Integer">
|
||||||
|
select
|
||||||
|
count(1) as alarmNum
|
||||||
|
from
|
||||||
|
ems_point_match
|
||||||
|
where is_alarm = 1
|
||||||
|
and site_id = #{siteId}
|
||||||
|
and device_category = #{deviceCategory}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user