diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java index 95e30cd..e43b935 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java @@ -728,7 +728,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl getFaultList(String code) { List stations = this.getStationByUserAuth(code);; - /*if(CollectionUtil.isEmpty(stations)){ + if(CollectionUtil.isEmpty(stations)){ return null; } String result = fdpMonitorClient.getFaultList(); @@ -737,29 +737,15 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl list = JSONArray.parseArray(result,FaultVo.class); if(CollectionUtil.isEmpty(list)){ - return new ArrayList<>(); - }*/ - List list = new ArrayList<>(); - FaultVo test =new FaultVo(); - test.setInfo("可是我不会忘"); - test.setFtype("1"); - test.setFaultId("114233824210698186"); - test.setName("爱来爱去空一场"); - test.setStationName("海南三亚大隆一级电站"); - test.setStation("902100000026"); - test.setStatus("0"); - test.setCreateTime("2023-06-01 09:55:33"); - test.setOrd("1"); - test.setFtype("1"); - test.setFinfo("你说人这东西可信不可信,骗子脸上又不会写字"); - list.add(test); - Map map = stations.stream().collect(Collectors.toMap(StationEntity::getCode,StationEntity::getName)); - // 查询已处理预警数据 - List handles = handleService.handles(Collections.singletonList(AbnormalAlarmConstant.EARLY_WARNING),null); - if(CollectionUtil.isEmpty(handles)){ - return list.stream().filter(fault -> map.containsKey(fault.getStation())).peek(o-> o.setStationName(map.get(o.getStation()))).collect(Collectors.toList()); + return null; } - return list.stream().filter(fault -> !handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList()).contains(fault.getFaultId()) && map.containsKey(fault.getStation())).peek(o-> o.setStationName(map.get(o.getStation()))).collect(Collectors.toList()); + log.error("fault_list_stations: {}",stations); + log.error("fault_list_list: {}",list); + Map map = stations.stream().collect(Collectors.toMap(StationEntity::getCode,StationEntity::getName)); + return list.stream().filter(fault -> map.containsKey(fault.getStation())).map(o->{ + o.setStationName(map.get(o.getStation())); + return o; + }).collect(Collectors.toList()); }