| | |
| | | import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; |
| | | import com.iailab.module.model.api.mcs.dto.AlarmMessageRespDTO; |
| | | import com.iailab.module.model.api.mcs.dto.PreDataJsonReqVO; |
| | | import com.iailab.module.shasteel.mq.common.RoutingConstant; |
| | | import com.iailab.module.shasteel.mq.common.constant.CommonConstant; |
| | | import com.iailab.module.shasteel.mq.common.constant.RoutingConstant; |
| | | import com.iailab.module.shasteel.mq.config.QueuePredictFinishConfig; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.core.Message; |
| | |
| | | AlarmMessageRespDTO alarmMessage = new AlarmMessageRespDTO(); |
| | | alarmMessage.setConfigId(item.getId()); |
| | | if (dataValue.compareTo(item.getLowerLimit()) < 0) { |
| | | alarmMessage.setAlarmType("1");//超下限 |
| | | alarmMessage.setAlarmType(CommonConstant.EXCEEDING_LOWER_LIMIT);//超下限 |
| | | } else if (dataValue.compareTo(item.getUpperLimit()) > 0) { |
| | | alarmMessage.setAlarmType("2");//超上限 |
| | | alarmMessage.setAlarmType(CommonConstant.EXCEEDING_UPPER_LIMIT);//超上限 |
| | | } |
| | | alarmMessage.setAlarmTime(DateUtils.parse(data[0].toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); |
| | | StringBuffer sb = new StringBuffer(); |
| | |
| | | sb.append(" "); |
| | | sb.append(item.getAlarmObj()); |
| | | if ("1".equals(alarmMessage.getAlarmType())) { |
| | | sb.append("超下限"); |
| | | sb.append(CommonConstant.EXCEEDING_LOWER_LIMIT); |
| | | } else if ("2".equals(alarmMessage.getAlarmType())) { |
| | | sb.append("超上限"); |
| | | sb.append(CommonConstant.EXCEEDING_UPPER_LIMIT); |
| | | } |
| | | sb.append(dataValue); |
| | | sb.append(item.getUnit()); |