Merge remote-tracking branch 'origin/test'

This commit is contained in:
tiger_zhou 2023-05-26 16:39:21 +08:00
commit cf6e117549

View File

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