单站监控-电表
This commit is contained in:
166
ems-system/src/main/java/com/xzzn/ems/domain/EmsAmmeterData.java
Normal file
166
ems-system/src/main/java/com/xzzn/ems/domain/EmsAmmeterData.java
Normal file
@ -0,0 +1,166 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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_ammeter_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
public class EmsAmmeterData 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;
|
||||
|
||||
/** 类别 */
|
||||
@Excel(name = "类别")
|
||||
private String category;
|
||||
|
||||
/** 总 (kWh) */
|
||||
@Excel(name = "总 (kWh)")
|
||||
private BigDecimal totalKwh;
|
||||
|
||||
/** 峰 (kWh) */
|
||||
@Excel(name = "峰 (kWh)")
|
||||
private BigDecimal peakKwh;
|
||||
|
||||
/** 平 (kWh) */
|
||||
@Excel(name = "平 (kWh)")
|
||||
private BigDecimal flatKwh;
|
||||
|
||||
/** 谷 (kWh) */
|
||||
@Excel(name = "谷 (kWh)")
|
||||
private BigDecimal valleyKwh;
|
||||
|
||||
/** 站点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 setDataUpdateTime(Date dataUpdateTime)
|
||||
{
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime()
|
||||
{
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setCategory(String category)
|
||||
{
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getCategory()
|
||||
{
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setTotalKwh(BigDecimal totalKwh)
|
||||
{
|
||||
this.totalKwh = totalKwh;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalKwh()
|
||||
{
|
||||
return totalKwh;
|
||||
}
|
||||
|
||||
public void setPeakKwh(BigDecimal peakKwh)
|
||||
{
|
||||
this.peakKwh = peakKwh;
|
||||
}
|
||||
|
||||
public BigDecimal getPeakKwh()
|
||||
{
|
||||
return peakKwh;
|
||||
}
|
||||
|
||||
public void setFlatKwh(BigDecimal flatKwh)
|
||||
{
|
||||
this.flatKwh = flatKwh;
|
||||
}
|
||||
|
||||
public BigDecimal getFlatKwh()
|
||||
{
|
||||
return flatKwh;
|
||||
}
|
||||
|
||||
public void setValleyKwh(BigDecimal valleyKwh)
|
||||
{
|
||||
this.valleyKwh = valleyKwh;
|
||||
}
|
||||
|
||||
public BigDecimal getValleyKwh()
|
||||
{
|
||||
return valleyKwh;
|
||||
}
|
||||
|
||||
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("dataUpdateTime", getDataUpdateTime())
|
||||
.append("category", getCategory())
|
||||
.append("totalKwh", getTotalKwh())
|
||||
.append("peakKwh", getPeakKwh())
|
||||
.append("flatKwh", getFlatKwh())
|
||||
.append("valleyKwh", getValleyKwh())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("siteId", getSiteId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 总表详细数据
|
||||
*/
|
||||
public class AmmeterDataDetailInfo
|
||||
{
|
||||
/** 类别 */
|
||||
private String category;
|
||||
|
||||
/** 总 (kWh) */
|
||||
private BigDecimal totalKwh;
|
||||
|
||||
/** 尖 (kWh) */
|
||||
private BigDecimal sharpKwh;
|
||||
|
||||
/** 峰 (kWh) */
|
||||
private BigDecimal peakKwh;
|
||||
|
||||
/** 平 (kWh) */
|
||||
private BigDecimal flatKwh;
|
||||
|
||||
/** 谷 (kWh) */
|
||||
private BigDecimal valleyKwh;
|
||||
|
||||
/** 总表设备Id */
|
||||
private Long deviceId;
|
||||
|
||||
/** 数据更新时间 */
|
||||
private Date updateTime;
|
||||
|
||||
public BigDecimal getValleyKwh() {
|
||||
return valleyKwh;
|
||||
}
|
||||
|
||||
public void setValleyKwh(BigDecimal valleyKwh) {
|
||||
this.valleyKwh = valleyKwh;
|
||||
}
|
||||
|
||||
public BigDecimal getFlatKwh() {
|
||||
return flatKwh;
|
||||
}
|
||||
|
||||
public void setFlatKwh(BigDecimal flatKwh) {
|
||||
this.flatKwh = flatKwh;
|
||||
}
|
||||
|
||||
public BigDecimal getPeakKwh() {
|
||||
return peakKwh;
|
||||
}
|
||||
|
||||
public void setPeakKwh(BigDecimal peakKwh) {
|
||||
this.peakKwh = peakKwh;
|
||||
}
|
||||
|
||||
public BigDecimal getSharpKwh() {
|
||||
return sharpKwh;
|
||||
}
|
||||
|
||||
public void setSharpKwh(BigDecimal sharpKwh) {
|
||||
this.sharpKwh = sharpKwh;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalKwh() {
|
||||
return totalKwh;
|
||||
}
|
||||
|
||||
public void setTotalKwh(BigDecimal totalKwh) {
|
||||
this.totalKwh = totalKwh;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public Long getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(Long deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电表数据
|
||||
*/
|
||||
public class AmmeterDataVo {
|
||||
|
||||
/** 通信状态 */
|
||||
private String emsCommunicationStatus;
|
||||
|
||||
/** 数据更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dataUpdateTime;
|
||||
|
||||
private List<AmmeterDataDetailInfo> ammeterDataDetailInfos;
|
||||
|
||||
public String getEmsCommunicationStatus() {
|
||||
return emsCommunicationStatus;
|
||||
}
|
||||
|
||||
public void setEmsCommunicationStatus(String emsCommunicationStatus) {
|
||||
this.emsCommunicationStatus = emsCommunicationStatus;
|
||||
}
|
||||
|
||||
public Date getDataUpdateTime() {
|
||||
return dataUpdateTime;
|
||||
}
|
||||
|
||||
public void setDataUpdateTime(Date dataUpdateTime) {
|
||||
this.dataUpdateTime = dataUpdateTime;
|
||||
}
|
||||
|
||||
public List<AmmeterDataDetailInfo> getAmmeterDataDetailInfos() {
|
||||
return ammeterDataDetailInfos;
|
||||
}
|
||||
|
||||
public void setAmmeterDataDetailInfos(List<AmmeterDataDetailInfo> ammeterDataDetailInfos) {
|
||||
this.ammeterDataDetailInfos = ammeterDataDetailInfos;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.xzzn.ems.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsAmmeterData;
|
||||
import com.xzzn.ems.domain.vo.AmmeterDataDetailInfo;
|
||||
|
||||
/**
|
||||
* 总数据Mapper接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-06-27
|
||||
*/
|
||||
public interface EmsAmmeterDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询总数据
|
||||
*
|
||||
* @param id 总数据主键
|
||||
* @return 总数据
|
||||
*/
|
||||
public EmsAmmeterData selectEmsAmmeterDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询总数据列表
|
||||
*
|
||||
* @param emsAmmeterData 总数据
|
||||
* @return 总数据集合
|
||||
*/
|
||||
public List<EmsAmmeterData> selectEmsAmmeterDataList(EmsAmmeterData emsAmmeterData);
|
||||
|
||||
/**
|
||||
* 新增总数据
|
||||
*
|
||||
* @param emsAmmeterData 总数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsAmmeterData(EmsAmmeterData emsAmmeterData);
|
||||
|
||||
/**
|
||||
* 修改总数据
|
||||
*
|
||||
* @param emsAmmeterData 总数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsAmmeterData(EmsAmmeterData emsAmmeterData);
|
||||
|
||||
/**
|
||||
* 删除总数据
|
||||
*
|
||||
* @param id 总数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsAmmeterDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除总数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsAmmeterDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取总表详细数据
|
||||
* @param siteId
|
||||
* @return
|
||||
*/
|
||||
public List<AmmeterDataDetailInfo> getAmmeterDetailInfo(Long siteId);
|
||||
}
|
@ -74,4 +74,11 @@ public interface EmsDevicesSettingMapper
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> getAllClusterInfoByStackId(Long stackDeviceId);
|
||||
|
||||
/**
|
||||
* 获取设备通信状态
|
||||
* @param deviceId
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getDeviceStatus(Long deviceId);
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||
import com.xzzn.ems.domain.vo.BatteryDataStatsListVo;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
@ -23,5 +22,5 @@ public interface IEmsSiteService
|
||||
|
||||
public List<Map<String,Object>> getAllClusterInfo(Long stackDeviceId);
|
||||
|
||||
public BatteryDataStatsListVo getClusterDataInfoList(Long clusterDeviceId);
|
||||
|
||||
}
|
||||
|
@ -26,4 +26,8 @@ public interface ISingleSiteService
|
||||
public List<BMSBatteryClusterVo> getBMSBatteryCluster(Long siteId);
|
||||
|
||||
public List<EmsCoolingData> getCoolingDataList(Long siteId);
|
||||
|
||||
public BatteryDataStatsListVo getClusterDataInfoList(Long clusterDeviceId);
|
||||
|
||||
public List<AmmeterDataVo> getAmmeterDataList(Long siteId);
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||
import com.xzzn.ems.domain.vo.BatteryDataStatsListVo;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
import com.xzzn.ems.mapper.EmsDevicesSettingMapper;
|
||||
import com.xzzn.ems.mapper.EmsSiteSettingMapper;
|
||||
@ -45,18 +44,14 @@ public class EmsSiteServiceImpl implements IEmsSiteService
|
||||
return emsDevicesMapper.getAllStackInfoBySiteId(siteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据电池堆Id获取电池簇
|
||||
* @param stackDeviceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getAllClusterInfo(Long stackDeviceId) {
|
||||
return emsDevicesMapper.getAllClusterInfoByStackId(stackDeviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据电池堆获取单体柱状数据
|
||||
* @param clusterDeviceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public BatteryDataStatsListVo getClusterDataInfoList(Long clusterDeviceId) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -41,6 +40,10 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
private EmsPcsBranchDataMapper emsPcsBranchDataMapper;
|
||||
@Autowired
|
||||
private EmsCoolingDataMapper emsCoolingDataMapper;
|
||||
@Autowired
|
||||
private EmsAmmeterDataMapper emsAmmeterDataMapper;
|
||||
@Autowired
|
||||
private EmsDevicesSettingMapper emsDevicesSettingMapper;
|
||||
|
||||
@Override
|
||||
public SiteMonitorHomeVo getSiteMonitorDataVo(Long siteId) {
|
||||
@ -258,4 +261,40 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return emsCoolingDataList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据电池堆获取单体柱状数据
|
||||
* @param clusterDeviceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public BatteryDataStatsListVo getClusterDataInfoList(Long clusterDeviceId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电表数据信息
|
||||
* @param siteId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<AmmeterDataVo> getAmmeterDataList(Long siteId) {
|
||||
List<AmmeterDataVo> ammeterDataVos = new ArrayList<>();
|
||||
AmmeterDataVo ammeterDataVo = new AmmeterDataVo();
|
||||
if (siteId != null) {
|
||||
List<AmmeterDataDetailInfo> ammeterDataDetailInfos = emsAmmeterDataMapper.getAmmeterDetailInfo(siteId);
|
||||
ammeterDataVo.setAmmeterDataDetailInfos(ammeterDataDetailInfos);
|
||||
if (!CollectionUtils.isEmpty(ammeterDataDetailInfos)) {
|
||||
// 获取通信状态
|
||||
Long deviceId = ammeterDataDetailInfos.get(0).getDeviceId();
|
||||
Map<String,Object> map = emsDevicesSettingMapper.getDeviceStatus(deviceId);
|
||||
ammeterDataVo.setEmsCommunicationStatus(map.get("communication_status").toString());
|
||||
// 数据更新时间
|
||||
ammeterDataVo.setDataUpdateTime(ammeterDataDetailInfos.get(0).getUpdateTime());
|
||||
}
|
||||
}
|
||||
ammeterDataVos.add(ammeterDataVo);
|
||||
return ammeterDataVos;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user