|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.hnac.hzims.operational.alert.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.hnac.hzims.fdp.feign.IFdpMonitorClient; |
|
|
|
|
import com.hnac.hzims.fdp.vo.UpdateFaultStateVo; |
|
|
|
|
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant; |
|
|
|
|
import com.hnac.hzims.operational.alert.entity.AlarmHandleDetailEntity; |
|
|
|
|
import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity; |
|
|
|
@ -10,23 +12,26 @@ import com.hnac.hzims.operational.alert.service.AlarmHandleService;
|
|
|
|
|
import com.hnac.hzims.operational.alert.vo.AlarmHandleVo; |
|
|
|
|
import com.hnac.hzims.operational.alert.vo.HandleQueryVo; |
|
|
|
|
import com.hnac.hzims.operational.alert.wrapper.HandleWrapper; |
|
|
|
|
import com.hnac.hzims.operational.fill.wrapper.StorageWrapper; |
|
|
|
|
import com.hnac.hzims.operational.main.constant.HomePageConstant; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.jsoup.helper.DataUtil; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.system.entity.Dept; |
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -42,9 +47,11 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
|
|
|
|
|
|
|
|
|
|
private final AlarmHandleDetailService detailService; |
|
|
|
|
|
|
|
|
|
private final ISysClient sysClient; |
|
|
|
|
|
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
|
|
|
|
|
private final ISysClient sysClient; |
|
|
|
|
private final IFdpMonitorClient fdpMonitorClient; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 告警处理 |
|
|
|
@ -58,6 +65,11 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
|
|
|
|
|
if (!AbnormalAlarmConstant.HANDLE_WAY.contains(way)) { |
|
|
|
|
throw new ServiceException("无效处理!"); |
|
|
|
|
} |
|
|
|
|
// 预警
|
|
|
|
|
if(AbnormalAlarmConstant.EARLY_WARNING.equals(param.getAlarmType())){ |
|
|
|
|
this.updateFalultState(param); |
|
|
|
|
} |
|
|
|
|
// 详情
|
|
|
|
|
AlarmHandleDetailEntity detail = new AlarmHandleDetailEntity(); |
|
|
|
|
detail.setAccessId(param.getAccessId()); |
|
|
|
|
detail.setPhenomenonId(param.getPhenomenonId()); |
|
|
|
@ -67,6 +79,7 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
|
|
|
|
|
detail.setFalseAlarmDesc(param.getFalseAlarmDesc()); |
|
|
|
|
detail.setFilePath(param.getFilePath()); |
|
|
|
|
detailService.save(detail); |
|
|
|
|
// 处理记录
|
|
|
|
|
AlarmHandleEntity entity = new AlarmHandleEntity(); |
|
|
|
|
entity.setAlarmId(param.getAlarmId()); |
|
|
|
|
entity.setDetailId(detail.getId()); |
|
|
|
@ -79,6 +92,31 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 预警处理推送智能诊断服务 |
|
|
|
|
* @param param |
|
|
|
|
*/ |
|
|
|
|
private void updateFalultState(AlarmHandleVo param) { |
|
|
|
|
try{ |
|
|
|
|
UpdateFaultStateVo state = new UpdateFaultStateVo(); |
|
|
|
|
state.setStationId(param.getStationCode()); |
|
|
|
|
state.setFaultId(param.getAlarmId()); |
|
|
|
|
if(AbnormalAlarmConstant.HANDLE.contains(param.getHandleWay())){ |
|
|
|
|
state.setConfidence(1f); |
|
|
|
|
}else{ |
|
|
|
|
state.setConfidence(0f); |
|
|
|
|
} |
|
|
|
|
state.setCreateTime(DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME)); |
|
|
|
|
state.setCreateUser(String.valueOf(AuthUtil.getUserId())); |
|
|
|
|
state.setLifeTime(1); |
|
|
|
|
state.setPriority(1); |
|
|
|
|
state.setInfo(param.getFalseAlarmDesc()); |
|
|
|
|
String result = fdpMonitorClient.updateFaultState(state); |
|
|
|
|
}catch (Exception exception){ |
|
|
|
|
log.error("update_falult_state: {}",exception.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页 |
|
|
|
|
* @param query |
|
|
|
|
* @param param |
|
|
|
|