平台修改意见20251120-点位上传根据设备ID区分

This commit is contained in:
zq
2025-12-12 14:36:18 +08:00
parent c6fca8b939
commit 85b370ea4c
2 changed files with 19 additions and 17 deletions

View File

@ -169,7 +169,7 @@ public interface EmsPointMatchMapper
List<DevicePointMatchExportVo> selectEmsPointMatchExportList(EmsPointMatch emsPointMatch); List<DevicePointMatchExportVo> selectEmsPointMatchExportList(EmsPointMatch emsPointMatch);
int getDevicePointAlarmNum(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory); int getDevicePointAlarmNum(@Param("siteId") String siteId, @Param("deviceId") String deviceId, @Param("deviceCategory") String deviceCategory);
EmsPointMatch selectDeviceStatusPoint(@Param("request") DeviceUpdateRequest request); EmsPointMatch selectDeviceStatusPoint(@Param("request") DeviceUpdateRequest request);
} }

View File

@ -415,8 +415,6 @@ 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());
@ -437,6 +435,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
pcsDetailInfoVo.setPcsBranchInfoList(pcsBranchInfoList); pcsDetailInfoVo.setPcsBranchInfoList(pcsBranchInfoList);
// // 报警个数 // // 报警个数
// int alarmNum = emsAlarmRecordsMapper.getDeviceAlarmNum(siteId,pcsId); // int alarmNum = emsAlarmRecordsMapper.getDeviceAlarmNum(siteId,pcsId);
// 告警设备点位个数
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, pcsId, DeviceCategory.PCS.getCode());
pcsDetailInfoVo.setAlarmNum(alarmNum); pcsDetailInfoVo.setAlarmNum(alarmNum);
pcsDetailInfoVo.setDeviceStatus(pcsDevice.get("deviceStatus") == null ? "" : pcsDevice.get("deviceStatus").toString()); pcsDetailInfoVo.setDeviceStatus(pcsDevice.get("deviceStatus") == null ? "" : pcsDevice.get("deviceStatus").toString());
@ -464,8 +464,6 @@ 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());
@ -484,6 +482,9 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
batteryDataLists = getBMSClusterListInfo(siteId,stackId,null); batteryDataLists = getBMSClusterListInfo(siteId,stackId,null);
bmsOverViewVo.setBatteryDataList(batteryDataLists); bmsOverViewVo.setBatteryDataList(batteryDataLists);
} }
// 告警设备点位个数
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, stackId, DeviceCategory.STACK.getCode());
bmsOverViewVo.setAlarmNum(alarmNum); bmsOverViewVo.setAlarmNum(alarmNum);
bmsOverViewVoList.add(bmsOverViewVo); bmsOverViewVoList.add(bmsOverViewVo);
} }
@ -523,8 +524,6 @@ 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());
@ -543,6 +542,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
dealWithBatteryClusterData(clusterData,clusterDataList); dealWithBatteryClusterData(clusterData,clusterDataList);
bmsBatteryClusterVo.setBatteryDataList(clusterDataList); bmsBatteryClusterVo.setBatteryDataList(clusterDataList);
} }
// 告警设备点位个数
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, clusterId, DeviceCategory.CLUSTER.getCode());
bmsBatteryClusterVo.setAlarmNum(alarmNum); bmsBatteryClusterVo.setAlarmNum(alarmNum);
bmsBatteryClusterVoList.add(bmsBatteryClusterVo); bmsBatteryClusterVoList.add(bmsBatteryClusterVo);
} }
@ -585,8 +586,6 @@ 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();
@ -596,6 +595,8 @@ 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);
// 告警设备点位个数
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, coolingId, DeviceCategory.COOLING.getCode());
dataViewVo.setAlarmNum(alarmNum); dataViewVo.setAlarmNum(alarmNum);
} }
@ -678,8 +679,6 @@ 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)) {
@ -687,6 +686,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
} }
// 从redis取总表详细数据 // 从redis取总表详细数据
EmsAmmeterData ammeterData = redisCache.getCacheObject(RedisKeyConstants.AMMETER + siteId + "_" +ammeterId); EmsAmmeterData ammeterData = redisCache.getCacheObject(RedisKeyConstants.AMMETER + siteId + "_" +ammeterId);
// 告警设备点位个数
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, ammeterId, DeviceCategory.AMMETER.getCode());
AmmeterDataVo ammeterDataVo = new AmmeterDataVo(); AmmeterDataVo ammeterDataVo = new AmmeterDataVo();
ammeterDataVo.setDeviceName(ammeterDevice.get("deviceName").toString()); ammeterDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
@ -773,8 +774,6 @@ 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();
@ -785,6 +784,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
if (dhData != null) { if (dhData != null) {
BeanUtils.copyProperties(dhData, dhDataVo); BeanUtils.copyProperties(dhData, dhDataVo);
} }
// 告警设备点位个数
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, dhDeviceId, DeviceCategory.DH.getCode());
dhDataVo.setAlarmNum(alarmNum); dhDataVo.setAlarmNum(alarmNum);
emsDhDataList.add(dhDataVo); emsDhDataList.add(dhDataVo);
} }
@ -801,8 +802,6 @@ 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());
@ -812,6 +811,8 @@ 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());
// 告警设备点位个数
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, xfDeviceId, DeviceCategory.XF.getCode());
xfDataVo.setAlarmNum(alarmNum); xfDataVo.setAlarmNum(alarmNum);
} }
xfDataVo.setEmsCommunicationStatus(xfDevice.get("communicationStatus") == null ? "" : xfDevice.get("communicationStatus").toString()); xfDataVo.setEmsCommunicationStatus(xfDevice.get("communicationStatus") == null ? "" : xfDevice.get("communicationStatus").toString());
@ -825,8 +826,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
List<EmsDataVo> emsDataList = new ArrayList<>(); List<EmsDataVo> emsDataList = new ArrayList<>();
List<Map<String, Object>> xfDeviceList = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.EMS.getCode()); 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) { for (Map<String, Object> emsDevice : xfDeviceList) {
EmsDataVo emsDataVo = new EmsDataVo(); EmsDataVo emsDataVo = new EmsDataVo();
emsDataVo.setDeviceName(emsDevice.get("deviceName").toString()); emsDataVo.setDeviceName(emsDevice.get("deviceName").toString());
@ -835,6 +835,8 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
EmsEmsData emsData = redisCache.getCacheObject(RedisKeyConstants.EMS + siteId + "_" + emsDeviceId); EmsEmsData emsData = redisCache.getCacheObject(RedisKeyConstants.EMS + siteId + "_" + emsDeviceId);
if (emsData != null) { if (emsData != null) {
BeanUtils.copyProperties(emsData, emsDataVo); BeanUtils.copyProperties(emsData, emsDataVo);
// 告警设备点位个数
int alarmNum = emsPointMatchMapper.getDevicePointAlarmNum(siteId, emsDeviceId, DeviceCategory.EMS.getCode());
emsDataVo.setAlarmNum(alarmNum); emsDataVo.setAlarmNum(alarmNum);
} }
emsDataList.add(emsDataVo); emsDataList.add(emsDataVo);