|
|
@ -6,14 +6,18 @@ import com.hnac.hzims.alarm.config.entity.AlarmEntity; |
|
|
|
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService; |
|
|
|
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService; |
|
|
|
import com.hnac.hzims.alarm.show.service.AlarmService; |
|
|
|
import com.hnac.hzims.alarm.show.service.AlarmService; |
|
|
|
import com.hnac.hzims.alarm.config.vo.AlarmHandleMarkVo; |
|
|
|
import com.hnac.hzims.alarm.config.vo.AlarmHandleMarkVo; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
import com.hnac.hzims.operational.station.feign.IStationClient; |
|
|
|
import com.hnac.hzims.operational.station.feign.IStationClient; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate; |
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author ysj |
|
|
|
* @author ysj |
|
|
@ -38,13 +42,12 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean save(List<AlarmEntity> alarms) { |
|
|
|
public Boolean save(List<AlarmEntity> alarms) { |
|
|
|
|
|
|
|
// 步骤1.查询告警数据对应站点
|
|
|
|
/*// 步骤1.查询告警数据对应站点
|
|
|
|
|
|
|
|
R<List<StationEntity>> result = stationClient.querySatationByCodes(alarms.stream().map(AlarmEntity::getStationId).collect(Collectors.toList())); |
|
|
|
R<List<StationEntity>> result = stationClient.querySatationByCodes(alarms.stream().map(AlarmEntity::getStationId).collect(Collectors.toList())); |
|
|
|
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ |
|
|
|
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ |
|
|
|
log.error("alarm query station is null : {}",alarms.stream().map(AlarmEntity::getAlarmId).collect(Collectors.toList())); |
|
|
|
log.error("alarm query station is null : {}",alarms.stream().map(AlarmEntity::getAlarmId).collect(Collectors.toList())); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
}*/ |
|
|
|
} |
|
|
|
// 步骤2.遍历保存告警数据
|
|
|
|
// 步骤2.遍历保存告警数据
|
|
|
|
alarms.forEach(alarm->{ |
|
|
|
alarms.forEach(alarm->{ |
|
|
|
|
|
|
|
|
|
|
|