修改NCC报警bug

This commit is contained in:
joylink_zhangsai 2023-05-26 15:46:17 +08:00
parent 3aed493654
commit 17d42a4d63

View File

@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
/** /**
* NCC系统报警监测通知服务 * NCC系统报警监测通知服务
@ -136,12 +137,14 @@ public class NccAlarmService {
return defaultReason; return defaultReason;
} }
AtsAlarm atsAlarm = deviceFaultAlarm.get(); AtsAlarm atsAlarm = deviceFaultAlarm.get();
MapElement element = repository.getByCode(atsAlarm.getCode()); if (StringUtils.hasText(atsAlarm.getDeviceCode())) {
return defaultReason;
}
MapElement element = repository.findByCode(atsAlarm.getDeviceCode());
if (!(element instanceof MayOutOfOrderDevice)) { if (!(element instanceof MayOutOfOrderDevice)) {
return defaultReason; return defaultReason;
} }
MayOutOfOrderDevice device = repository.getByCode(atsAlarm.getDeviceCode(), MayOutOfOrderDevice device = (MayOutOfOrderDevice) element;
MayOutOfOrderDevice.class);
DeviceFault deviceFault = device.getFault(); DeviceFault deviceFault = device.getFault();
if (deviceFault == null) { if (deviceFault == null) {
return defaultReason; return defaultReason;