DDS监控逻辑修改
This commit is contained in:
@ -66,7 +66,7 @@ public interface EmsDevicesSettingMapper
|
|||||||
* @param parentId
|
* @param parentId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<Map<String, Object>> getDeviceInfoByParentId(String parentId);
|
public List<Map<String, Object>> getDeviceInfoByParentId(@Param("siteId")String siteId, @Param("parentId")String parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据site_id和device_category获取指定设备信息
|
* 根据site_id和device_category获取指定设备信息
|
||||||
|
|||||||
@ -299,8 +299,8 @@ public class DDSDataProcessServiceImpl implements IDDSDataProcessService {
|
|||||||
List<EmsBatteryData> dataList = new ArrayList<>(dataMap.values());
|
List<EmsBatteryData> dataList = new ArrayList<>(dataMap.values());
|
||||||
emsBatteryDataMapper.insertEmsBatteryDataList(new ArrayList<>(dataList));
|
emsBatteryDataMapper.insertEmsBatteryDataList(new ArrayList<>(dataList));
|
||||||
|
|
||||||
redisCache.deleteList(RedisKeyConstants.BATTERY + SITE_ID + "_" +deviceId);
|
redisCache.deleteList(RedisKeyConstants.BATTERY + SITE_ID + "_" + "BMSC01");
|
||||||
redisCache.setCacheList(RedisKeyConstants.BATTERY + SITE_ID + "_" +deviceId, dataList);
|
redisCache.setCacheList(RedisKeyConstants.BATTERY + SITE_ID + "_" + "BMSC01" , dataList);
|
||||||
}
|
}
|
||||||
// 批量处理每日最新数据
|
// 批量处理每日最新数据
|
||||||
if (dailyList != null && dailyList.size() > 0) {
|
if (dailyList != null && dailyList.size() > 0) {
|
||||||
@ -522,32 +522,26 @@ public class DDSDataProcessServiceImpl implements IDDSDataProcessService {
|
|||||||
Map<String, Map<String, Object>> records = processDataPrefix(JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {}));
|
Map<String, Map<String, Object>> records = processDataPrefix(JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {}));
|
||||||
List<EmsPcsBranchData> list = new ArrayList<>();
|
List<EmsPcsBranchData> list = new ArrayList<>();
|
||||||
|
|
||||||
//PCS支路
|
|
||||||
for (Map.Entry<String, Map<String, Object>> record : records.entrySet()) {
|
|
||||||
String recordId = record.getKey();
|
|
||||||
Map<String, Object> fields = record.getValue();
|
|
||||||
|
|
||||||
EmsPcsBranchData data = new EmsPcsBranchData();
|
EmsPcsBranchData data = new EmsPcsBranchData();
|
||||||
data.setDeviceId(deviceId);
|
data.setDeviceId(deviceId);
|
||||||
|
data.setSiteId(SITE_ID);
|
||||||
data.setGridStatus(GridStatus.GRID.getCode());
|
data.setGridStatus(GridStatus.GRID.getCode());
|
||||||
|
|
||||||
data.setGridUVoltage(StringUtils.getBigDecimal(fields.get("DWXDYUAB")));
|
data.setGridUVoltage(StringUtils.getBigDecimal(records.get("DWXDYUAB")));
|
||||||
data.setGridVVoltage(StringUtils.getBigDecimal(fields.get("DWXDYUBC")));
|
data.setGridVVoltage(StringUtils.getBigDecimal(records.get("DWXDYUBC")));
|
||||||
data.setGridWVoltage(StringUtils.getBigDecimal(fields.get("DWXDYUCA")));
|
data.setGridWVoltage(StringUtils.getBigDecimal(records.get("DWXDYUCA")));
|
||||||
data.setOutputUCurrent(StringUtils.getBigDecimal(fields.get("PCSJLDLIA")));
|
data.setOutputUCurrent(StringUtils.getBigDecimal(records.get("PCSJLDLIA")));
|
||||||
data.setOutputVCurrent(StringUtils.getBigDecimal(fields.get("PCSJLDLIB")));
|
data.setOutputVCurrent(StringUtils.getBigDecimal(records.get("PCSJLDLIB")));
|
||||||
data.setOutputWCurrent(StringUtils.getBigDecimal(fields.get("PCSJLDLIC")));
|
data.setOutputWCurrent(StringUtils.getBigDecimal(records.get("PCSJLDLIC")));
|
||||||
|
|
||||||
data.setBranchId(recordId);
|
data.setBranchId("DY1");
|
||||||
|
data.setCreateBy("system");
|
||||||
|
data.setCreateTime(DateUtils.getNowDate());
|
||||||
|
data.setUpdateBy("system");
|
||||||
|
data.setUpdateTime(DateUtils.getNowDate());
|
||||||
list.add(data);
|
list.add(data);
|
||||||
}
|
|
||||||
if (list.size() > 0 ) {
|
|
||||||
emsPcsBranchDataMapper.insertPcsBranchDataList(list);
|
emsPcsBranchDataMapper.insertPcsBranchDataList(list);
|
||||||
|
|
||||||
redisCache.setCacheObject(RedisKeyConstants.BRANCH + SITE_ID + "_" +deviceId, list);
|
redisCache.setCacheObject(RedisKeyConstants.BRANCH + SITE_ID + "_" +deviceId, list);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void meteGFDataProcess(String deviceId, String dataJson) {
|
private void meteGFDataProcess(String deviceId, String dataJson) {
|
||||||
|
|||||||
@ -53,7 +53,7 @@ public class EmsSiteServiceImpl implements IEmsSiteService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getAllClusterInfo(String parentId) {
|
public List<Map<String, Object>> getAllClusterInfo(String parentId) {
|
||||||
return emsDevicesMapper.getDeviceInfoByParentId(parentId);
|
return emsDevicesMapper.getDeviceInfoByParentId(null,parentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -260,7 +260,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
private void getBMSClusterListInfo(String siteId, String stackId, BMSOverViewVo bmsOverViewVo) {
|
private void getBMSClusterListInfo(String siteId, String stackId, BMSOverViewVo bmsOverViewVo) {
|
||||||
List<BMSBatteryDataList> batteryDataList = new ArrayList();
|
List<BMSBatteryDataList> batteryDataList = new ArrayList();
|
||||||
|
|
||||||
List<Map<String, Object>> clusterIds = emsDevicesSettingMapper.getDeviceInfoByParentId(stackId);
|
List<Map<String, Object>> clusterIds = emsDevicesSettingMapper.getDeviceInfoByParentId(siteId, stackId);
|
||||||
for (Map<String, Object> clusterDevice : clusterIds) {
|
for (Map<String, Object> clusterDevice : clusterIds) {
|
||||||
BMSBatteryDataList bmsBatteryDataList= new BMSBatteryDataList();
|
BMSBatteryDataList bmsBatteryDataList= new BMSBatteryDataList();
|
||||||
// 从redis取单个簇的详细数据
|
// 从redis取单个簇的详细数据
|
||||||
@ -313,21 +313,21 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
voltageData.setDataName(CLUSTER_DATA_VOLTAGE);
|
voltageData.setDataName(CLUSTER_DATA_VOLTAGE);
|
||||||
voltageData.setAvgData(clusterData.getAvgCellVoltage());
|
voltageData.setAvgData(clusterData.getAvgCellVoltage());
|
||||||
voltageData.setMaxData(clusterData.getMaxCellVoltage());
|
voltageData.setMaxData(clusterData.getMaxCellVoltage());
|
||||||
voltageData.setMaxDataID(clusterData.getMaxCellVoltageId().toString());
|
voltageData.setMaxDataID(clusterData.getMaxCellVoltageId() == null ? null : clusterData.getMaxCellVoltageId().toString());
|
||||||
voltageData.setMinData(clusterData.getMinCellVoltage());
|
voltageData.setMinData(clusterData.getMinCellVoltage());
|
||||||
voltageData.setMinDataID(clusterData.getMinCellVoltageId().toString());
|
voltageData.setMinDataID(clusterData.getMinCellVoltageId() == null ? null : clusterData.getMinCellVoltageId().toString());
|
||||||
tempData.setDataName(CLUSTER_DATA_TEP);
|
tempData.setDataName(CLUSTER_DATA_TEP);
|
||||||
tempData.setAvgData(clusterData.getAvgCellTemp());
|
tempData.setAvgData(clusterData.getAvgCellTemp());
|
||||||
tempData.setMaxData(clusterData.getMaxCellTemp());
|
tempData.setMaxData(clusterData.getMaxCellTemp());
|
||||||
tempData.setMaxDataID(clusterData.getMaxCellTempId().toString());
|
tempData.setMaxDataID(clusterData.getMaxCellTempId() == null ? null : clusterData.getMaxCellTempId().toString());
|
||||||
tempData.setMinData(clusterData.getMinCellTemp());
|
tempData.setMinData(clusterData.getMinCellTemp());
|
||||||
tempData.setMinDataID(clusterData.getMinCellTempId().toString());
|
tempData.setMinDataID(clusterData.getMinCellTempId() == null ? null : clusterData.getMinCellTempId().toString());
|
||||||
socData.setDataName(CLUSTER_DATA_SOC);
|
socData.setDataName(CLUSTER_DATA_SOC);
|
||||||
socData.setAvgData(clusterData.getCurrentSoc());
|
socData.setAvgData(clusterData.getCurrentSoc());
|
||||||
socData.setMaxData(clusterData.getMaxCellSoc());
|
socData.setMaxData(clusterData.getMaxCellSoc());
|
||||||
socData.setMaxDataID(clusterData.getMaxCellSocId().toString());
|
socData.setMaxDataID(clusterData.getMaxCellSocId() == null ? null : clusterData.getMaxCellSocId().toString());
|
||||||
socData.setMinData(clusterData.getMinCellSoc());
|
socData.setMinData(clusterData.getMinCellSoc());
|
||||||
socData.setMinDataID(clusterData.getMinCellSocId().toString());
|
socData.setMinDataID(clusterData.getMinCellSocId() == null ? null : clusterData.getMinCellSocId().toString());
|
||||||
|
|
||||||
clusterDataList.add(voltageData);
|
clusterDataList.add(voltageData);
|
||||||
clusterDataList.add(tempData);
|
clusterDataList.add(tempData);
|
||||||
|
|||||||
@ -161,7 +161,10 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDeviceInfoByParentId" parameterType="String" resultType="java.util.Map">
|
<select id="getDeviceInfoByParentId" parameterType="String" resultType="java.util.Map">
|
||||||
select distinct t.device_id as id,t.device_name as deviceName from ems_devices_setting t where t.parent_id = #{parentId}
|
select distinct t.device_id as id,t.device_name as deviceName
|
||||||
|
from ems_devices_setting t
|
||||||
|
where t.site_id = #{siteId}
|
||||||
|
and t.parent_id = #{parentId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAllBatteryDeviceBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.EmsDevicesSetting">
|
<select id="getAllBatteryDeviceBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.EmsDevicesSetting">
|
||||||
|
|||||||
Reference in New Issue
Block a user