|  |  |  | @ -12,6 +12,9 @@ import com.hnac.hzims.equipment.feign.IEmInfoClient; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.fdp.feign.IFdpMonitorClient; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.fdp.vo.FdpFaultStatusVo; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.operational.alert.service.AlarmHandleService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.operational.config.entity.DataSet; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.hnac.hzims.operational.config.entity.StFocusPropertiesEntity; | 
			
		
	
	
		
			
				
					|  |  |  | @ -67,6 +70,8 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl<StAlarmRecordMapper | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	private final IStationService stationService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	private final AlarmHandleService handleService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	private final ISoeClient soeClient; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 	private final RedisTemplate redisTemplate; | 
			
		
	
	
		
			
				
					|  |  |  | @ -188,7 +193,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl<StAlarmRecordMapper | 
			
		
	
		
			
				
					|  |  |  |  | 									} | 
			
		
	
		
			
				
					|  |  |  |  | 									if ("1".equals(data.getValue()) && 0 == data.getQ()) { | 
			
		
	
		
			
				
					|  |  |  |  | 										dataSet.setStatus(ConfigStatus.ConfigStatusEnum.RED.getStatus()); | 
			
		
	
		
			
				
					|  |  |  |  | 										/*if (alarmList.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                                         /*if (alarmList.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  | 											StAlarmRecordEntity stAlarmRecordEntity = alarmList.get(0); | 
			
		
	
		
			
				
					|  |  |  |  | 											if (null != stAlarmRecordEntity.getProcessTime()) { | 
			
		
	
		
			
				
					|  |  |  |  | 												time = new Date().getTime() - stAlarmRecordEntity.getProcessTime().getTime(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -290,7 +295,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl<StAlarmRecordMapper | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
		
			
				
					|  |  |  |  | 			//结果排序
 | 
			
		
	
		
			
				
					|  |  |  |  | 			List<Map.Entry<String, Map<String, Object>>> mapList1 = | 
			
		
	
		
			
				
					|  |  |  |  | 				new ArrayList<Map.Entry<String, Map<String, Object>>>(map.entrySet()); | 
			
		
	
		
			
				
					|  |  |  |  | 					new ArrayList<Map.Entry<String, Map<String, Object>>>(map.entrySet()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 			Collections.sort(mapList1, new Comparator<Map.Entry<String, Map<String, Object>>>() { | 
			
		
	
		
			
				
					|  |  |  |  | 				@Override | 
			
		
	
	
		
			
				
					|  |  |  | @ -451,7 +456,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl<StAlarmRecordMapper | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 		R<List<String>> fdpRealIds = fdpMonitorClient.getRealIds(); | 
			
		
	
		
			
				
					|  |  |  |  | 		SoeQueryConditionByStation soeQueryConditionByStation = new SoeQueryConditionByStation(); | 
			
		
	
		
			
				
					|  |  |  |  | 		/*if (Func.isNotBlank(date)) { | 
			
		
	
		
			
				
					|  |  |  |  |         /*if (Func.isNotBlank(date)) { | 
			
		
	
		
			
				
					|  |  |  |  | 			soeQueryConditionByStation.setBeginTime(LocalDateTime.parse(date, df)); | 
			
		
	
		
			
				
					|  |  |  |  | 		} else { | 
			
		
	
		
			
				
					|  |  |  |  | 			soeQueryConditionByStation.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00", df)); | 
			
		
	
	
		
			
				
					|  |  |  | @ -662,7 +667,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl<StAlarmRecordMapper | 
			
		
	
		
			
				
					|  |  |  |  | 				if("1".equals(em.getRunStatus())){ | 
			
		
	
		
			
				
					|  |  |  |  | 					shutdown.add(device.getDeviceCode()); | 
			
		
	
		
			
				
					|  |  |  |  | 				}; | 
			
		
	
		
			
				
					|  |  |  |  | 			//开机
 | 
			
		
	
		
			
				
					|  |  |  |  | 				//开机
 | 
			
		
	
		
			
				
					|  |  |  |  | 			}else if ("1".equals(value)) { | 
			
		
	
		
			
				
					|  |  |  |  | 				if(CollectionUtil.isEmpty(emList)){ | 
			
		
	
		
			
				
					|  |  |  |  | 					boot.add(device.getDeviceCode()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -707,7 +712,7 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl<StAlarmRecordMapper | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		if (CollectionUtil.isNotEmpty(list)) { | 
			
		
	
		
			
				
					|  |  |  |  | 			R<List<AnalyzeCodeBySignagesVO>> analyzeCodeBySignages = | 
			
		
	
		
			
				
					|  |  |  |  | 				analyseDataSearchClient.getAnalyzeCodeBySignages(list); | 
			
		
	
		
			
				
					|  |  |  |  | 					analyseDataSearchClient.getAnalyzeCodeBySignages(list); | 
			
		
	
		
			
				
					|  |  |  |  | 			if (analyzeCodeBySignages.isSuccess() && CollectionUtil.isNotEmpty(analyzeCodeBySignages.getData())) { | 
			
		
	
		
			
				
					|  |  |  |  | 				return analyzeCodeBySignages.getData(); | 
			
		
	
		
			
				
					|  |  |  |  | 			} | 
			
		
	
	
		
			
				
					|  |  |  | @ -732,24 +737,15 @@ public class StAlamRecordServiceImpl extends BaseServiceImpl<StAlarmRecordMapper | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		List<FaultVo> list = JSONArray.parseArray(result,FaultVo.class); | 
			
		
	
		
			
				
					|  |  |  |  | 		if(CollectionUtil.isEmpty(list)){ | 
			
		
	
		
			
				
					|  |  |  |  | 			FaultVo faultVo = new FaultVo(); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setCreateTime("2023-04-06 15:19:09"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setFaultId("902100000026|1#机组|bd32990711354cb89f1fc4f76abc77c0"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setFinfo("1#机组断路器未分闸"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setFtype("智能预警"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setInfo("正常状态为0,当前状态为1"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setName("断路器未分闸"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setOrd("1#机组"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setStation("902100000026"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setStationName("海南三亚大隆一级电站"); | 
			
		
	
		
			
				
					|  |  |  |  | 			faultVo.setStatus("1.0"); | 
			
		
	
		
			
				
					|  |  |  |  | 			return Collections.singletonList(faultVo); | 
			
		
	
		
			
				
					|  |  |  |  | 			return new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |  | 		} | 
			
		
	
		
			
				
					|  |  |  |  | 		Map<String,String> 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()); | 
			
		
	
		
			
				
					|  |  |  |  | 		// 查询已处理预警数据
 | 
			
		
	
		
			
				
					|  |  |  |  | 		List<AlarmHandleEntity> handles = handleService.handles(Collections.singletonList(AbnormalAlarmConstant.EARLY_WARNING)); | 
			
		
	
		
			
				
					|  |  |  |  | 		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 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()); | 
			
		
	
		
			
				
					|  |  |  |  | 	} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |