From 9fd640a0efbeaa9f8161b3db858ad99596ed3015 Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期三, 11 十二月 2024 14:53:53 +0800 Subject: [PATCH] content内容 --- shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java index 0bee1be..2957989 100644 --- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java @@ -85,13 +85,13 @@ 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; -- Gitblit v1.9.3