From dda76a358c72730ed9b4f5c1c907edcf9f7a9440 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Tue, 6 Jun 2023 17:25:13 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=8A=BD?= =?UTF-8?q?=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StAlamRecordServiceImpl.java | 32 ++++++---------------- 1 file changed, 9 insertions(+), 23 deletions(-) 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()); }