数据20250904优化-PCS曲线和电池堆曲线返回修改
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单数据统计-pcs曲线-返回对象
|
||||
*
|
||||
*/
|
||||
public class PCSCurveResponse {
|
||||
/** pcs设备id */
|
||||
private String deviceId;
|
||||
/** 数据对象 */
|
||||
private List<PcsStatisListVo> dataList;
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public List<PcsStatisListVo> getDataList() {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public void setDataList(List<PcsStatisListVo> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@ package com.xzzn.ems.domain.vo;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 数据统计-pcs曲线-通用对象
|
||||
* 数据统计-pcs曲线-数据list对象
|
||||
*/
|
||||
public class PcsStatisListVo {
|
||||
/**
|
||||
@ -36,6 +36,9 @@ public class PcsStatisListVo {
|
||||
*/
|
||||
private BigDecimal wCurrent;
|
||||
|
||||
/** pcs设备id */
|
||||
private String deviceId;
|
||||
|
||||
public String getStatisDate() {
|
||||
return statisDate;
|
||||
}
|
||||
@ -83,4 +86,12 @@ public class PcsStatisListVo {
|
||||
public void setwCurrent(BigDecimal wCurrent) {
|
||||
this.wCurrent = wCurrent;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据统计-堆曲线-返回对象
|
||||
*
|
||||
*/
|
||||
public class StackCurveResponse {
|
||||
/** pcs设备id */
|
||||
private String deviceId;
|
||||
/** 数据对象 */
|
||||
private List<StackStatisListVo> dataList;
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public List<StackStatisListVo> getDataList() {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public void setDataList(List<StackStatisListVo> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@ package com.xzzn.ems.domain.vo;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 数据统计-堆曲线-通用对象
|
||||
* 数据统计-堆曲线-数据list对象
|
||||
*/
|
||||
public class StackStatisListVo {
|
||||
/**
|
||||
@ -31,6 +31,9 @@ public class StackStatisListVo {
|
||||
*/
|
||||
private BigDecimal soc;
|
||||
|
||||
/** pcs设备id */
|
||||
private String deviceId;
|
||||
|
||||
public String getStatisDate() {
|
||||
return statisDate;
|
||||
}
|
||||
@ -70,4 +73,12 @@ public class StackStatisListVo {
|
||||
public void setSoc(BigDecimal soc) {
|
||||
this.soc = soc;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,9 +16,9 @@ public interface IEmsStatsReportService
|
||||
|
||||
public ElectricDataInfoVo getElectricDataResult(DateSearchRequest requestVo);
|
||||
|
||||
public List<PcsStatisListVo> getPCSDataResult(DateSearchRequest requestVo);
|
||||
public List<PCSCurveResponse> getPCSDataResult(DateSearchRequest requestVo);
|
||||
|
||||
public List<StackStatisListVo> getStackDataResult(DateSearchRequest requestVo);
|
||||
public List<StackCurveResponse> getStackDataResult(DateSearchRequest requestVo);
|
||||
|
||||
public List<ClusterStatisListVo> getClusterDataResult(StatisClusterDateRequest requestVo);
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 统计报表数据Service业务层处理
|
||||
@ -139,7 +140,8 @@ public class EmsStatsReportServiceImpl implements IEmsStatsReportService
|
||||
|
||||
// pcs曲线数据
|
||||
@Override
|
||||
public List<PcsStatisListVo> getPCSDataResult(DateSearchRequest requestVo) {
|
||||
public List<PCSCurveResponse> getPCSDataResult(DateSearchRequest requestVo) {
|
||||
List<PCSCurveResponse> responseList = new ArrayList<>();
|
||||
List<PcsStatisListVo> dataList = new ArrayList();
|
||||
|
||||
// 默认时间-7天
|
||||
@ -164,12 +166,30 @@ public class EmsStatsReportServiceImpl implements IEmsStatsReportService
|
||||
// 开始日期-结束日期大于 1 个月,按月展示数据
|
||||
dataList = emsPcsDataMapper.getPcsActivePowerByMonth(requestVo);
|
||||
}
|
||||
return dataList;
|
||||
|
||||
// 数据格式转换 按deviceId分组
|
||||
if (dataList != null && dataList.size()>0){
|
||||
responseList = dataList.stream()
|
||||
.collect(Collectors.groupingBy(PcsStatisListVo::getDeviceId))
|
||||
// 将Map转换为Set<Entry>后流转
|
||||
.entrySet().stream()
|
||||
// 映射为PCSCurveResponse对象
|
||||
.map(entry -> {
|
||||
PCSCurveResponse response = new PCSCurveResponse();
|
||||
response.setDeviceId(entry.getKey());
|
||||
response.setDataList(entry.getValue());
|
||||
return response;
|
||||
})
|
||||
// 收集为List
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return responseList;
|
||||
}
|
||||
|
||||
// 电池堆曲线
|
||||
@Override
|
||||
public List<StackStatisListVo> getStackDataResult(DateSearchRequest requestVo) {
|
||||
public List<StackCurveResponse> getStackDataResult(DateSearchRequest requestVo) {
|
||||
List<StackCurveResponse> responseList = new ArrayList<>();
|
||||
List<StackStatisListVo> dataList = new ArrayList();
|
||||
// 默认时间-7天
|
||||
dealRequestTime(requestVo);
|
||||
@ -193,7 +213,24 @@ public class EmsStatsReportServiceImpl implements IEmsStatsReportService
|
||||
// 开始日期-结束日期大于 1 个月,按月展示数据
|
||||
dataList = emsBatteryStackMapper.getStackDataByMonth(requestVo);
|
||||
}
|
||||
return dataList;
|
||||
|
||||
// 数据格式转换 按deviceId分组
|
||||
if (dataList != null && dataList.size()>0){
|
||||
responseList = dataList.stream()
|
||||
.collect(Collectors.groupingBy(StackStatisListVo::getDeviceId))
|
||||
// 将Map转换为Set<Entry>后流转
|
||||
.entrySet().stream()
|
||||
// 映射为PCSCurveResponse对象
|
||||
.map(entry -> {
|
||||
StackCurveResponse response = new StackCurveResponse();
|
||||
response.setDeviceId(entry.getKey());
|
||||
response.setDataList(entry.getValue());
|
||||
return response;
|
||||
})
|
||||
// 收集为List
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return responseList;
|
||||
}
|
||||
|
||||
// 电池温度
|
||||
|
||||
Reference in New Issue
Block a user