| | |
| | | alarmMessage.setAlarmType("2");//超上限 |
| | | } |
| | | alarmMessage.setAlarmTime(DateUtils.parse(data[0].toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); |
| | | JSONObject content = new JSONObject(); |
| | | content.put("alarmObj", item.getAlarmObj()); |
| | | content.put("alarmType", alarmMessage.getAlarmType()); |
| | | content.put("unit", item.getUnit()); |
| | | content.put("overLimitTime", data[0]); |
| | | content.put("overLimitValue", dataValue); |
| | | alarmMessage.setContent(JSONObject.toJSONString(content)); |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append(data[0]); |
| | | sb.append(item.getAlarmObj()); |
| | | sb.append(alarmMessage.getAlarmType()); |
| | | sb.append(dataValue); |
| | | sb.append(item.getUnit()); |
| | | alarmMessage.setContent(sb.toString()); |
| | | System.out.println("预警消息=" + alarmMessage); |
| | | rabbitTemplate.convertAndSend(RoutingConstant.EXCHANGE, RoutingConstant.Iailab_Model_Alarm, alarmMessage); |
| | | break; |