0918优化-单站监控-实时运行曲线图pcs分开显示
This commit is contained in:
@ -12,7 +12,7 @@ import com.xzzn.common.annotation.Excel;
|
||||
* PCS数据对象 ems_pcs_data
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-07-07
|
||||
* @date 2025-09-25
|
||||
*/
|
||||
public class EmsPcsData extends BaseEntity
|
||||
{
|
||||
@ -206,6 +206,34 @@ public class EmsPcsData extends BaseEntity
|
||||
@Excel(name = "电网频率")
|
||||
private BigDecimal dwFrequency;
|
||||
|
||||
/** 单元1U相IGBT温度 */
|
||||
@Excel(name = "单元1U相IGBT温度")
|
||||
private BigDecimal uTemperature;
|
||||
|
||||
/** 单元1V相IGBT温度 */
|
||||
@Excel(name = "单元1V相IGBT温度")
|
||||
private BigDecimal vTemperature;
|
||||
|
||||
/** 单元1W相IGBT温度 */
|
||||
@Excel(name = "单元1W相IGBT温度")
|
||||
private BigDecimal wTemperature;
|
||||
|
||||
/** 1#模块IGBT最高温 */
|
||||
@Excel(name = "1#模块IGBT最高温")
|
||||
private BigDecimal module1Temp;
|
||||
|
||||
/** 2#模块IGBT最高温 */
|
||||
@Excel(name = "2#模块IGBT最高温")
|
||||
private BigDecimal module2Temp;
|
||||
|
||||
/** 3#模块IGBT最高温 */
|
||||
@Excel(name = "3#模块IGBT最高温")
|
||||
private BigDecimal module3Temp;
|
||||
|
||||
/** 4#模块IGBT最高温 */
|
||||
@Excel(name = "4#模块IGBT最高温")
|
||||
private BigDecimal module4Temp;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -676,6 +704,76 @@ public class EmsPcsData extends BaseEntity
|
||||
return dwFrequency;
|
||||
}
|
||||
|
||||
public void setuTemperature(BigDecimal uTemperature)
|
||||
{
|
||||
this.uTemperature = uTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getuTemperature()
|
||||
{
|
||||
return uTemperature;
|
||||
}
|
||||
|
||||
public void setvTemperature(BigDecimal vTemperature)
|
||||
{
|
||||
this.vTemperature = vTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getvTemperature()
|
||||
{
|
||||
return vTemperature;
|
||||
}
|
||||
|
||||
public void setwTemperature(BigDecimal wTemperature)
|
||||
{
|
||||
this.wTemperature = wTemperature;
|
||||
}
|
||||
|
||||
public BigDecimal getwTemperature()
|
||||
{
|
||||
return wTemperature;
|
||||
}
|
||||
|
||||
public void setModule1Temp(BigDecimal module1Temp)
|
||||
{
|
||||
this.module1Temp = module1Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule1Temp()
|
||||
{
|
||||
return module1Temp;
|
||||
}
|
||||
|
||||
public void setModule2Temp(BigDecimal module2Temp)
|
||||
{
|
||||
this.module2Temp = module2Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule2Temp()
|
||||
{
|
||||
return module2Temp;
|
||||
}
|
||||
|
||||
public void setModule3Temp(BigDecimal module3Temp)
|
||||
{
|
||||
this.module3Temp = module3Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule3Temp()
|
||||
{
|
||||
return module3Temp;
|
||||
}
|
||||
|
||||
public void setModule4Temp(BigDecimal module4Temp)
|
||||
{
|
||||
this.module4Temp = module4Temp;
|
||||
}
|
||||
|
||||
public BigDecimal getModule4Temp()
|
||||
{
|
||||
return module4Temp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -731,6 +829,13 @@ public class EmsPcsData extends BaseEntity
|
||||
.append("sysVCurrent", getSysVCurrent())
|
||||
.append("sysWCurrent", getSysWCurrent())
|
||||
.append("dwFrequency", getDwFrequency())
|
||||
.append("uTemperature", getuTemperature())
|
||||
.append("vTemperature", getvTemperature())
|
||||
.append("wTemperature", getwTemperature())
|
||||
.append("module1Temp", getModule1Temp())
|
||||
.append("module2Temp", getModule2Temp())
|
||||
.append("module3Temp", getModule3Temp())
|
||||
.append("module4Temp", getModule4Temp())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实时运行-PCS最高温度list
|
||||
*
|
||||
*/
|
||||
public class PcsMaxTempList {
|
||||
|
||||
private String deviceId;
|
||||
// 最高温度数据
|
||||
private List<PcsMaxTempVo> maxTempVoList;
|
||||
|
||||
public List<PcsMaxTempVo> getMaxTempVoList() {
|
||||
return maxTempVoList;
|
||||
}
|
||||
|
||||
public void setMaxTempVoList(List<PcsMaxTempVo> maxTempVoList) {
|
||||
this.maxTempVoList = maxTempVoList;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
}
|
||||
@ -1,29 +1,37 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实时运行-堆平均温度数据
|
||||
* 实时运行-PCS最高温度
|
||||
*
|
||||
*/
|
||||
public class StackAveTempVo {
|
||||
public class PcsMaxTempVo {
|
||||
/**
|
||||
* 数据时间
|
||||
*/
|
||||
private Date createDate;
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 实时温度
|
||||
*/
|
||||
private BigDecimal temp;
|
||||
|
||||
private String deviceId;
|
||||
|
||||
public Date getCreateDate() {
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
public void setCreateDate(String createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ public class SiteMonitorRuningInfoVo {
|
||||
/**
|
||||
* PCS最高温度
|
||||
*/
|
||||
private List<StackAveTempVo> stackAveTempList;
|
||||
private List<PcsMaxTempList> pcsMaxTempList;
|
||||
|
||||
/**
|
||||
* 平均soclist
|
||||
@ -35,12 +35,12 @@ public class SiteMonitorRuningInfoVo {
|
||||
this.pcsPowerList = pcsPowerList;
|
||||
}
|
||||
|
||||
public List<StackAveTempVo> getStackAveTempList() {
|
||||
return stackAveTempList;
|
||||
public List<PcsMaxTempList> getPcsMaxTempList() {
|
||||
return pcsMaxTempList;
|
||||
}
|
||||
|
||||
public void setStackAveTempList(List<StackAveTempVo> stackAveTempList) {
|
||||
this.stackAveTempList = stackAveTempList;
|
||||
public void setPcsMaxTempList(List<PcsMaxTempList> pcsMaxTempList) {
|
||||
this.pcsMaxTempList = pcsMaxTempList;
|
||||
}
|
||||
|
||||
public List<BatteryAveSOCVo> getBatteryAveSOCList() {
|
||||
|
||||
@ -62,15 +62,6 @@ public interface EmsBatteryStackMapper
|
||||
*/
|
||||
public int deleteEmsBatteryStackByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取实时运行-堆平均温度
|
||||
* @param siteId
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
public List<StackAveTempVo> getStackAveTempList(@Param("siteId")String siteId, @Param("startDate") Date startDate, @Param("endDate")Date endDate);
|
||||
|
||||
/**
|
||||
* 堆曲线数据-按小时区分
|
||||
* @param requestVo
|
||||
|
||||
@ -127,4 +127,9 @@ public interface EmsPcsDataMapper
|
||||
public List<PcsStatisListVo> getPcsActivePowerByHour(DateSearchRequest requestVo);
|
||||
|
||||
public List<PcsStatisListVo> getPcsActivePowerByMonth(DateSearchRequest requestVo);
|
||||
|
||||
// 实时运行-fx-pcs最高温度
|
||||
public List<PcsMaxTempVo> getFXMaxTemp(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
|
||||
// 实时运行-dds-pcs最高温度
|
||||
public List<PcsMaxTempVo> getDDSMaxTemp(@Param("siteId")String siteId, @Param("startDate")Date startDate, @Param("endDate")Date endDate);
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ public interface ISingleSiteService
|
||||
|
||||
public List<AmmeterDataVo> getAmmeterDataList(String siteId);
|
||||
|
||||
public SiteMonitorRuningInfoVo getRunningGraphStackTemp(String siteId);
|
||||
public SiteMonitorRuningInfoVo getRunningGraphPcsMaxTemp(String siteId);
|
||||
|
||||
public SiteMonitorRuningInfoVo getRunningGraphBatterySoc(String siteId);
|
||||
|
||||
|
||||
@ -598,6 +598,12 @@ public class DDSDataProcessServiceImpl extends AbstractBatteryDataProcessor impl
|
||||
pcsData.setTotalApparentPower(StringUtils.getBigDecimal(obj.get("ZLZGL")));
|
||||
pcsData.setTotalPowerFactor(new BigDecimal(0));
|
||||
|
||||
// 模块温度
|
||||
pcsData.setModule1Temp(StringUtils.getBigDecimal(obj.get("IGBYZGWD1")));
|
||||
pcsData.setModule2Temp(StringUtils.getBigDecimal(obj.get("IGBYZGWD2")));
|
||||
pcsData.setModule3Temp(StringUtils.getBigDecimal(obj.get("IGBYZGWD3")));
|
||||
pcsData.setModule4Temp(StringUtils.getBigDecimal(obj.get("IGBYZGWD4")));
|
||||
|
||||
// 系统管理字段
|
||||
pcsData.setCreateBy("system");
|
||||
pcsData.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
@ -439,6 +439,11 @@ public class FXXDataProcessServiceImpl extends AbstractBatteryDataProcessor impl
|
||||
// pcsData.setDcVoltage(StringUtils.getBigDecimal(obj.get("ChargeableCapacity")));
|
||||
// pcsData.setDcCurrent(StringUtils.getBigDecimal(obj.get("ChargeableCapacity")));
|
||||
|
||||
// 三相温度
|
||||
pcsData.setuTemperature(StringUtils.getBigDecimal(obj.get("DY1UXIGBTWD")));
|
||||
pcsData.setvTemperature(StringUtils.getBigDecimal(obj.get("DY1VXIGBTWD")));
|
||||
pcsData.setwTemperature(StringUtils.getBigDecimal(obj.get("DY1WXIGBTWD")));
|
||||
|
||||
// 系统管理字段
|
||||
pcsData.setCreateBy("system");
|
||||
pcsData.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
@ -167,17 +167,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
List<PcsPowerList> pcsPowerList = new ArrayList<>();
|
||||
List<EnergyStoragePowVo> energyStoragePowList = emsPcsDataMapper.getStoragePowerList(siteId, yesterday, today);
|
||||
|
||||
// 生成时间列表(每分钟一个)
|
||||
List<LocalDateTime> targetMinutes = new ArrayList<>(60);
|
||||
LocalDateTime startDate = DateUtils.toLocalDateTime(yesterday).truncatedTo(ChronoUnit.DAYS);
|
||||
LocalDateTime endDate = DateUtils.toLocalDateTime(today);
|
||||
while (startDate.isBefore(endDate)) {
|
||||
targetMinutes.add(startDate);
|
||||
startDate = startDate.plusMinutes(1); // 递增1分钟
|
||||
}
|
||||
|
||||
// 数据格式转换
|
||||
if (!CollectionUtils.isEmpty(energyStoragePowList) && !CollectionUtils.isEmpty(targetMinutes)) {
|
||||
// List<EnergyStoragePowVo> -> 按pcs的deviceId分组转成List<PcsPowerList>
|
||||
if (!CollectionUtils.isEmpty(energyStoragePowList)) {
|
||||
Map<String, List<EnergyStoragePowVo>> dataMap = energyStoragePowList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
EnergyStoragePowVo::getDeviceId,
|
||||
@ -191,6 +182,14 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return pcdData;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 生成时间列表(每分钟一个)
|
||||
List<LocalDateTime> targetMinutes = new ArrayList<>(60);
|
||||
LocalDateTime startDate = DateUtils.toLocalDateTime(yesterday).truncatedTo(ChronoUnit.DAYS);
|
||||
LocalDateTime endDate = DateUtils.toLocalDateTime(today);
|
||||
while (startDate.isBefore(endDate)) {
|
||||
targetMinutes.add(startDate);
|
||||
startDate = startDate.plusMinutes(1); // 递增1分钟
|
||||
}
|
||||
// 根据时间列表填充数据
|
||||
pcsPowerList = fullFillData(pcsPowerList,targetMinutes);
|
||||
}
|
||||
@ -249,21 +248,102 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
// 获取单站监控实时运行-stack平均温度
|
||||
// 20250811 按小时
|
||||
// 获取单站监控实时运行-pcs最高温度
|
||||
@Override
|
||||
public SiteMonitorRuningInfoVo getRunningGraphStackTemp(String siteId) {
|
||||
public SiteMonitorRuningInfoVo getRunningGraphPcsMaxTemp(String siteId) {
|
||||
SiteMonitorRuningInfoVo siteMonitorRuningInfoVo = new SiteMonitorRuningInfoVo();
|
||||
if (!StringUtils.isEmpty(siteId)) {
|
||||
// 时间暂定今日+昨日
|
||||
Date today = new Date();
|
||||
Date yesterday = DateUtils.addDays(today, -1);
|
||||
//pcs平均温度list
|
||||
List<StackAveTempVo> stackAveTempVos = emsBatteryStackMapper.getStackAveTempList(siteId, yesterday, today);
|
||||
siteMonitorRuningInfoVo.setStackAveTempList(stackAveTempVos);
|
||||
List<PcsMaxTempList> pcsMaxTempList = new ArrayList<>();
|
||||
// 时间暂定今日+昨日
|
||||
Date today = new Date();
|
||||
Date yesterday = DateUtils.addDays(today, -1);
|
||||
//PCS最高温度list
|
||||
List<PcsMaxTempVo> pcsMaxTempVos = new ArrayList<>();
|
||||
if (SiteEnum.FX.getCode().equals(siteId)) {
|
||||
pcsMaxTempVos = emsPcsDataMapper.getFXMaxTemp(siteId, yesterday, today);
|
||||
} else if (SiteEnum.DDS.getCode().equals(siteId)) {
|
||||
pcsMaxTempVos = emsPcsDataMapper.getDDSMaxTemp(siteId, yesterday, today);
|
||||
}
|
||||
|
||||
// List<PcsMaxTempVo> -> 按pcs的deviceId分组转成List<PcsMaxTempList>
|
||||
if (!CollectionUtils.isEmpty(pcsMaxTempVos)) {
|
||||
Map<String, List<PcsMaxTempVo>> dataMap = pcsMaxTempVos.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
PcsMaxTempVo::getDeviceId,
|
||||
Collectors.toList()));
|
||||
|
||||
pcsMaxTempList = dataMap.entrySet().stream()
|
||||
.map(entry -> {
|
||||
PcsMaxTempList pcdData = new PcsMaxTempList();
|
||||
pcdData.setDeviceId(entry.getKey());
|
||||
pcdData.setMaxTempVoList(entry.getValue());
|
||||
return pcdData;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 生成时间列表(每小时一个)
|
||||
List<LocalDateTime> targetHours = new ArrayList<>(60);
|
||||
LocalDateTime startDate = DateUtils.toLocalDateTime(yesterday).truncatedTo(ChronoUnit.DAYS);
|
||||
LocalDateTime endDate = DateUtils.toLocalDateTime(today);
|
||||
while (startDate.isBefore(endDate)) {
|
||||
targetHours.add(startDate);
|
||||
startDate = startDate.plusHours(1); // 递增1小时
|
||||
}
|
||||
// 根据时间列表填充数据
|
||||
pcsMaxTempList = fullFillMaxTempData(pcsMaxTempList,targetHours);
|
||||
}
|
||||
|
||||
siteMonitorRuningInfoVo.setPcsMaxTempList(pcsMaxTempList);
|
||||
return siteMonitorRuningInfoVo;
|
||||
}
|
||||
private List<PcsMaxTempList> fullFillMaxTempData(List<PcsMaxTempList> pcsMaxTempList, List<LocalDateTime> targetHours) {
|
||||
List<PcsMaxTempList> resultList = new ArrayList<>();
|
||||
|
||||
for (PcsMaxTempList pcsMaxTemp : pcsMaxTempList) {
|
||||
PcsMaxTempList pcsTemp = new PcsMaxTempList();
|
||||
List<PcsMaxTempVo> resultVos = new ArrayList<>();
|
||||
Map<String, PcsMaxTempVo> dataMap = new HashMap<>();
|
||||
|
||||
String deviceId = pcsMaxTemp.getDeviceId();
|
||||
List<PcsMaxTempVo> pcsMaxTempVos = pcsMaxTemp.getMaxTempVoList();
|
||||
if (CollectionUtils.isEmpty(pcsMaxTempVos)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 将数据转Map便于后续根据时间获取
|
||||
dataMap = pcsMaxTempVos.stream().collect(
|
||||
Collectors.toMap(
|
||||
data -> data.getCreateDate(),
|
||||
data -> data,
|
||||
(existing, replacement) -> replacement
|
||||
));
|
||||
|
||||
PcsMaxTempVo lastData = null;
|
||||
List<PcsMaxTempVo> resultTempList = new ArrayList<>();
|
||||
// 遍历时间填充数据
|
||||
for (LocalDateTime targetHour : targetHours) {
|
||||
String currentDate = DateUtils.convertToString(targetHour);
|
||||
PcsMaxTempVo currentData = dataMap.get(currentDate);
|
||||
if (currentData == null && lastData != null) {
|
||||
BigDecimal temp = lastData.getTemp();
|
||||
currentData = new PcsMaxTempVo();
|
||||
currentData.setTemp(temp);
|
||||
currentData.setDeviceId(deviceId);
|
||||
} else if (currentData == null && lastData == null){
|
||||
// 开头无数据,所有字段设为null
|
||||
currentData = new PcsMaxTempVo();
|
||||
currentData.setDeviceId(deviceId);
|
||||
}
|
||||
lastData = currentData;
|
||||
currentData.setCreateDate(currentDate.substring(11));
|
||||
resultTempList.add(currentData);
|
||||
|
||||
}
|
||||
pcsTemp.setDeviceId(deviceId);
|
||||
pcsTemp.setMaxTempVoList(resultTempList);
|
||||
resultList.add(pcsTemp);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
// 获取单站监控实时运行-平均soc
|
||||
@Override
|
||||
public SiteMonitorRuningInfoVo getRunningGraphBatterySoc(String siteId) {
|
||||
|
||||
Reference in New Issue
Block a user