20250808优化-单体电池优化
This commit is contained in:
@ -0,0 +1,36 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单站监控-单体电池返回数据
|
||||
*
|
||||
*/
|
||||
public class SiteBatteryDataList {
|
||||
|
||||
// 簇相关单体最大最小值list
|
||||
@Excel(name = "簇单体最大最小值list")
|
||||
List<BMSBatteryDataList> clusterList;
|
||||
|
||||
// 单体电池list
|
||||
@Excel(name = "单体电池list")
|
||||
List<BatteryDataStatsListVo> batteryList;
|
||||
|
||||
public List<BMSBatteryDataList> getClusterList() {
|
||||
return clusterList;
|
||||
}
|
||||
|
||||
public void setClusterList(List<BMSBatteryDataList> clusterList) {
|
||||
this.clusterList = clusterList;
|
||||
}
|
||||
|
||||
public List<BatteryDataStatsListVo> getBatteryList() {
|
||||
return batteryList;
|
||||
}
|
||||
|
||||
public void setBatteryList(List<BatteryDataStatsListVo> batteryList) {
|
||||
this.batteryList = batteryList;
|
||||
}
|
||||
}
|
||||
@ -84,4 +84,7 @@ public interface EmsDevicesSettingMapper
|
||||
public List<Map<String, Object>> getLoadNameList(String siteId);
|
||||
|
||||
public EmsDevicesSetting getDeviceBySiteAndDeviceId(@Param("deviceId")String deviceId, @Param("siteId")String siteId);
|
||||
|
||||
public List<Map<String, Object>> getClusterIdsByFuzzyQuery(@Param("siteId")String siteId, @Param("deviceCategory")String deviceCategory,
|
||||
@Param("parentId")String parentId);
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ public interface ISingleSiteService
|
||||
|
||||
public List<EmsCoolingData> getCoolingDataList(String siteId);
|
||||
|
||||
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId,String siteId);
|
||||
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId,String siteId,String stackDeviceId);
|
||||
|
||||
public AmmeterDataResponse getAmmeterDataList(String siteId);
|
||||
|
||||
@ -36,4 +36,6 @@ public interface ISingleSiteService
|
||||
public SiteMonitorRuningInfoVo getRunningGraphBatterySoc(String siteId);
|
||||
|
||||
public SiteMonitorRuningInfoVo getRunningGraphBatteryTemp(String siteId);
|
||||
|
||||
public List<BMSBatteryDataList> getClusterBatteryList(String siteId, String stackDeviceId, String clusterDeviceId);
|
||||
}
|
||||
|
||||
@ -270,8 +270,10 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
BeanUtils.copyProperties(stackData, bmsOverViewVo);
|
||||
}
|
||||
// 下面簇列表数据
|
||||
List<BMSBatteryDataList> batteryDataLists = new ArrayList<>();
|
||||
if (!StringUtils.isEmpty(stackId)) {
|
||||
getBMSClusterListInfo(siteId,stackId,bmsOverViewVo);
|
||||
batteryDataLists = getBMSClusterListInfo(siteId,stackId,null);
|
||||
bmsOverViewVo.setBatteryDataList(batteryDataLists);
|
||||
}
|
||||
bmsOverViewVoList.add(bmsOverViewVo);
|
||||
}
|
||||
@ -279,10 +281,18 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return bmsOverViewVoList;
|
||||
}
|
||||
|
||||
private void getBMSClusterListInfo(String siteId, String stackId, BMSOverViewVo bmsOverViewVo) {
|
||||
private List<BMSBatteryDataList> getBMSClusterListInfo(String siteId, String stackId, String clusterDeviceId) {
|
||||
List<BMSBatteryDataList> batteryDataList = new ArrayList();
|
||||
|
||||
List<Map<String, Object>> clusterIds = emsDevicesSettingMapper.getDeviceInfoByParentId(siteId, stackId);
|
||||
List<Map<String, Object>> clusterIds = new ArrayList<>();
|
||||
if (StringUtils.isEmpty(clusterDeviceId)) {
|
||||
clusterIds = emsDevicesSettingMapper.getClusterIdsByFuzzyQuery(siteId, DeviceCategory.CLUSTER.getCode(),stackId);
|
||||
} else {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", clusterDeviceId);
|
||||
clusterIds.add(map);
|
||||
}
|
||||
|
||||
for (Map<String, Object> clusterDevice : clusterIds) {
|
||||
BMSBatteryDataList bmsBatteryDataList= new BMSBatteryDataList();
|
||||
// 从redis取单个簇的详细数据
|
||||
@ -295,7 +305,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
batteryDataList.add(bmsBatteryDataList);
|
||||
}
|
||||
|
||||
bmsOverViewVo.setBatteryDataList(batteryDataList);
|
||||
return batteryDataList;
|
||||
}
|
||||
|
||||
// 获取BMS电池簇数据
|
||||
@ -373,11 +383,11 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId,String siteId) {
|
||||
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId,String siteId,String stackDeviceId) {
|
||||
List<BatteryDataStatsListVo> batteryDataStatsListVo = new ArrayList<>();
|
||||
List<Map<String, Object>> clusterIds = new ArrayList<>();
|
||||
if (StringUtils.isEmpty(clusterDeviceId)) {
|
||||
clusterIds = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.CLUSTER.getCode());
|
||||
clusterIds = emsDevicesSettingMapper.getClusterIdsByFuzzyQuery(siteId, DeviceCategory.CLUSTER.getCode(),stackDeviceId);
|
||||
} else {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", clusterDeviceId);
|
||||
@ -402,6 +412,12 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return sortedList;
|
||||
}
|
||||
|
||||
// 获取单站的最大最小温度和电压单体数据id
|
||||
@Override
|
||||
public List<BMSBatteryDataList> getClusterBatteryList(String siteId, String stackDeviceId, String clusterDeviceId) {
|
||||
return getBMSClusterListInfo(siteId, stackDeviceId,clusterDeviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 电表数据信息
|
||||
* @param siteId
|
||||
|
||||
@ -198,4 +198,16 @@
|
||||
<select id="getLoadNameList" parameterType="String" resultType="java.util.Map">
|
||||
select distinct device_id as id,device_name as deviceName from ems_devices_setting where site_id = #{siteId} and device_id like '%LOAD%'
|
||||
</select>
|
||||
|
||||
<select id="getClusterIdsByFuzzyQuery" resultType="java.util.Map">
|
||||
select DISTINCT device_id as id,
|
||||
device_name as deviceName,
|
||||
communication_status as communicationStatus
|
||||
from ems_devices_setting
|
||||
where site_id = #{siteId}
|
||||
<if test="parentId !=null and parentId !=''">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
and device_category = #{deviceCategory}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user