问题调整
This commit is contained in:
parent
a289854910
commit
20ceabc862
@ -18,7 +18,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Order(2)
|
||||
@Order(33)
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AlertEmitJob implements ApplicationRunner {
|
||||
|
@ -8,10 +8,14 @@ import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/** 线路发布数据内存管理 */
|
||||
/**
|
||||
* 线路发布数据内存管理
|
||||
*/
|
||||
@Component
|
||||
@Order(2)
|
||||
@RequiredArgsConstructor
|
||||
public class LineGraphicDataManage implements ApplicationRunner {
|
||||
|
||||
|
@ -12,6 +12,7 @@ import club.joylink.xiannccda.dto.protos.DeviceStatusProto.Rtu;
|
||||
import club.joylink.xiannccda.dto.protos.DeviceStatusProto.Rtu.Builder;
|
||||
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Station;
|
||||
import club.joylink.xiannccda.service.AlertInfoService;
|
||||
import club.joylink.xiannccda.vo.AreaConfigVO;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.google.common.base.Strings;
|
||||
import java.util.ArrayList;
|
||||
@ -61,9 +62,11 @@ public class BlueAlertListener implements AlertSourceEventListener<BlueDisplayAl
|
||||
log.info("线路[{}] 车站[{}] rtu[{}] 通信中断", rtu.getLineId(), station.getName(), rtu.getId());
|
||||
//保存蓝显联锁id
|
||||
if (alertManager.putAlterDevice(rtu.getLineId(), BLUE_DISPLAY_NAME, rtu.getId())) {
|
||||
Optional<AreaConfigVO> alertInfoMostOptional = this.alertInfoService.findAreaDevice(AlertType.BLUE_DISPLAY, AlertDeviceType.DEVICE_TYPE_RTU, station.getCommon().getId(), rtu.getLineId());
|
||||
String alertInfoMostName = alertInfoMostOptional.map(AreaConfigVO::getAreaName).orElse(String.format("%s 集中站中断连接 ", station.getName()));
|
||||
int allControlStationSize = CONTROL_STATION_MAPER.get(rtu.getLineId()).size();
|
||||
String alertMsg = String.format("%s 集中站中断连接 `", station.getName());
|
||||
NccAlertInfo alertInfo = this.alertInfoService.createAlert2(Optional.empty(), AlertType.BLUE_DISPLAY, rtu, alertMsg, station.getCommon().getId(), AlertDeviceType.DEVICE_TYPE_RTU, false);
|
||||
NccAlertInfo alertInfo = this.alertInfoService.createAlert2(Optional.empty(), AlertType.BLUE_DISPLAY, rtu, alertInfoMostName, station.getCommon().getId(), AlertDeviceType.DEVICE_TYPE_RTU,
|
||||
false);
|
||||
alertManager.emit(alertInfo);
|
||||
alertManager.emit(new AllLineBlueDisplayAlertEvent(rtu, station, allControlStationSize));
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Station;
|
||||
import club.joylink.xiannccda.dto.protos.LayoutGraphicsProto.Turnout;
|
||||
import club.joylink.xiannccda.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.xiannccda.mock.message.occ.MockOccServer;
|
||||
import club.joylink.xiannccda.vo.AreaConfigVO;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.google.protobuf.GeneratedMessageV3;
|
||||
import com.google.protobuf.MessageOrBuilder;
|
||||
@ -120,7 +121,17 @@ public class AlertMockService {
|
||||
bb.setTimestamp(System.currentTimeMillis() / 1000);
|
||||
bb.setId(dto.getFrist());
|
||||
bb.setIpRtuStusDown(true);
|
||||
return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_RTU, station.getCommon().getId(), bb, station.getName(), AlertDeviceType.DEVICE_TYPE_RTU, true);
|
||||
Optional<AreaConfigVO> alertInfoMostOptional = this.alertInfoService.findAreaDevice(AlertType.BLUE_DISPLAY, AlertDeviceType.DEVICE_TYPE_RTU, station.getCommon().getId(), lineId);
|
||||
String alertInfoMostName = alertInfoMostOptional.map(AreaConfigVO::getAreaName).orElse(null);
|
||||
return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_RTU, station.getCommon().getId(), bb, alertInfoMostName, AlertDeviceType.DEVICE_TYPE_RTU, true);
|
||||
}
|
||||
case ALL_LINE_BLUE_DISPLAY -> {
|
||||
Rtu.Builder bb = Rtu.newBuilder();
|
||||
bb.setLineId(dto.getLineId());
|
||||
bb.setTimestamp(System.currentTimeMillis() / 1000);
|
||||
// bb.setId(dto.getFrist());
|
||||
bb.setIpRtuStusDown(true);
|
||||
return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_RTU, null, bb, "全线蓝显", AlertDeviceType.DEVICE_TYPE_RTU, true);
|
||||
}
|
||||
case PLATFORM_DOOR_CANNOT_OPEN -> {
|
||||
Optional<Platform> pfOptional = LineGraphicDataRepository.getDevices(lineId, Platform.class).filter(d -> dto.getDeviceCodes().contains(d.getCode())).findAny();
|
||||
|
@ -47,5 +47,5 @@ occ-not-handle-rtu: '{3: "81,82"}'
|
||||
#长时间没有接收occ数据超时,重新获取基础数据时间(小时)
|
||||
receive-msg-timeout: 1
|
||||
#延时加载告警处理
|
||||
loadAlertTaskDelayMin: 5
|
||||
loadAlertTaskDelayMin: 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user