新增模块数据展示
This commit is contained in:
@@ -243,14 +243,17 @@ public class DataServiceImpl implements IDataService {
|
||||
EachModuleVO moduleVO = new EachModuleVO();
|
||||
moduleVO.setModuleName("模块"+i);
|
||||
|
||||
List<EachModuleVO.harmonicVo> list1 = new ArrayList<>();
|
||||
List<EachModuleVO.HarmonicVo> list1 = new ArrayList<>();
|
||||
commonQueryParam.setClDid(Integer.toString(i));
|
||||
|
||||
//获取模块数据
|
||||
List<EachModuleVO.DataVo> list2 = new ArrayList<>();
|
||||
List<EachModuleVO.DataVo> list3 = new ArrayList<>();
|
||||
|
||||
//获取模块状态数据
|
||||
List<StatisticalDataDTO> dto = commonService.getEachModule(commonQueryParam);
|
||||
if (CollectionUtil.isNotEmpty(dto)) {
|
||||
dto.forEach(item->{
|
||||
EachModuleVO.harmonicVo vo = new EachModuleVO.harmonicVo();
|
||||
EachModuleVO.HarmonicVo vo = new EachModuleVO.HarmonicVo();
|
||||
vo.setTime(LocalDateTime.ofInstant(item.getTime().minus(8, ChronoUnit.HOURS), ZoneId.systemDefault()));
|
||||
vo.setStateDesc(channelState(item.getValue()));
|
||||
vo.setDataType(0);
|
||||
@@ -260,6 +263,26 @@ public class DataServiceImpl implements IDataService {
|
||||
moduleVO.setModuleState("离线");
|
||||
}
|
||||
|
||||
//获取模块电流数据
|
||||
List<StatisticalDataDTO> dto2 = commonService.getModuleData(commonQueryParam);
|
||||
if (CollectionUtil.isNotEmpty(dto2)) {
|
||||
dto2.forEach(item->{
|
||||
|
||||
EachModuleVO.DataVo vo1 = new EachModuleVO.DataVo();
|
||||
vo1.setTime(LocalDateTime.ofInstant(item.getTime().minus(8, ChronoUnit.HOURS), ZoneId.systemDefault()));
|
||||
vo1.setPhasicType(item.getPhaseType());
|
||||
vo1.setData(item.getValue());
|
||||
|
||||
EachModuleVO.DataVo vo2 = new EachModuleVO.DataVo();
|
||||
vo2.setTime(LocalDateTime.ofInstant(item.getTime().minus(8, ChronoUnit.HOURS), ZoneId.systemDefault()));
|
||||
vo2.setPhasicType(item.getPhaseType());
|
||||
vo2.setData(item.getAvgValue());
|
||||
|
||||
list2.add(vo1);
|
||||
list3.add(vo2);
|
||||
});
|
||||
}
|
||||
|
||||
//获取模块事件
|
||||
LambdaQueryWrapper<CsEventPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEventPO::getLineId, param.getLineId())
|
||||
@@ -271,7 +294,7 @@ public class DataServiceImpl implements IDataService {
|
||||
if (CollectionUtil.isNotEmpty(eventList)) {
|
||||
eventList.forEach(item->{
|
||||
EleEpdPqd epdPqd = epdFeignClient.findByName(item.getTag()).getData();
|
||||
EachModuleVO.harmonicVo vo = new EachModuleVO.harmonicVo();
|
||||
EachModuleVO.HarmonicVo vo = new EachModuleVO.HarmonicVo();
|
||||
vo.setTime(item.getStartTime());
|
||||
vo.setStateDesc(channelState2(item.getTag()));
|
||||
vo.setEventCode(item.getTag());
|
||||
@@ -285,17 +308,19 @@ public class DataServiceImpl implements IDataService {
|
||||
});
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(list1)) {
|
||||
List<EachModuleVO.harmonicVo> dataList = list1.stream()
|
||||
.sorted(Comparator.comparing(EachModuleVO.harmonicVo::getTime))
|
||||
List<EachModuleVO.HarmonicVo> dataList = list1.stream()
|
||||
.sorted(Comparator.comparing(EachModuleVO.HarmonicVo::getTime))
|
||||
.collect(Collectors.toList());
|
||||
moduleVO.setDataList(dataList);
|
||||
EachModuleVO.harmonicVo last = dataList.get(dataList.size() - 1);
|
||||
EachModuleVO.HarmonicVo last = dataList.get(dataList.size() - 1);
|
||||
if (Objects.equals(last.getDataType(),0)) {
|
||||
moduleVO.setModuleState(last.getStateDesc());
|
||||
} else if (Objects.equals(last.getDataType(),1)) {
|
||||
moduleVO.setModuleState(Objects.equals(last.getStateDesc(),"Alm_Apf_ModDisConnect") ? "离线" : "运行");
|
||||
}
|
||||
}
|
||||
moduleVO.setModOutList(list2);
|
||||
moduleVO.setLoadList(list3);
|
||||
result.add(moduleVO);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user