| | |
| | | dto.setScheduleTime(scheduleTime); |
| | | dto.setScheduleCode(scheme.getCode()); |
| | | MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); |
| | | if (CommonConstant.MDK_STATUS_100.equals(mdkScheduleRespDTO.getStatusCode())) { |
| | | if (!CommonConstant.MDK_STATUS_100.equals(mdkScheduleRespDTO.getStatusCode())) { |
| | | logger.info("调度结果异常,STATUS=" + mdkScheduleRespDTO.getStatusCode()); |
| | | return; |
| | | } |
| | | |
| | | // 保存预警信息 |
| | | String pressureLWarning = mdkScheduleRespDTO.getResult().get("pressureLWarning").toString(); |
| | | if (StringUtils.isNotBlank(pressureLWarning)) { |
| | | if (mdkScheduleRespDTO.getResult().get("pressureLWarning") != null && |
| | | StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("pressureLWarning").toString())) { |
| | | String pressureLWarning = mdkScheduleRespDTO.getResult().get("pressureLWarning").toString(); |
| | | AlarmMessageRespDTO alarm = new AlarmMessageRespDTO(); |
| | | alarm.setTitle("压力低于下限预警"); |
| | | alarm.setContent(pressureLWarning); |
| | |
| | | mcsApi.createAlarmMessage(alarm); |
| | | } |
| | | |
| | | String pressureHWarning = mdkScheduleRespDTO.getResult().get("pressureHWarning").toString(); |
| | | if (StringUtils.isNotBlank(pressureHWarning)) { |
| | | |
| | | if (mdkScheduleRespDTO.getResult().get("pressureHWarning") != null && |
| | | StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("pressureHWarning").toString())) { |
| | | String pressureHWarning = mdkScheduleRespDTO.getResult().get("pressureHWarning").toString(); |
| | | AlarmMessageRespDTO alarm = new AlarmMessageRespDTO(); |
| | | alarm.setTitle("压力高于上限预警"); |
| | | alarm.setContent(pressureHWarning); |
| | |
| | | } |
| | | |
| | | // 保存调度建议 |
| | | String dispatchStart = mdkScheduleRespDTO.getResult().get("dispatchStart").toString(); |
| | | if (StringUtils.isNotBlank(pressureHWarning)) { |
| | | if (mdkScheduleRespDTO.getResult().get("dispatchStart") != null && |
| | | StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("dispatchStart").toString())) { |
| | | String dispatchStart = mdkScheduleRespDTO.getResult().get("dispatchStart").toString(); |
| | | ScheduleSuggestRespDTO suggest = new ScheduleSuggestRespDTO(); |
| | | suggest.setTitle("空压机启动调度建议"); |
| | | suggest.setContent(dispatchStart); |
| | |
| | | mcsApi.createScheduleSuggest(suggest); |
| | | } |
| | | |
| | | String dispatchClose = mdkScheduleRespDTO.getResult().get("dispatchClose").toString(); |
| | | if (StringUtils.isNotBlank(dispatchClose)) { |
| | | if (mdkScheduleRespDTO.getResult().get("dispatchClose") != null && |
| | | StringUtils.isNotEmpty(mdkScheduleRespDTO.getResult().get("dispatchClose").toString())) { |
| | | String dispatchClose = mdkScheduleRespDTO.getResult().get("dispatchClose").toString(); |
| | | ScheduleSuggestRespDTO suggest = new ScheduleSuggestRespDTO(); |
| | | suggest.setTitle("空压机关停调度建议"); |
| | | suggest.setContent(dispatchClose); |