| | |
| | | // System.out.println(message);
|
| | | // System.out.println(JSON.toJSONString(msgData));
|
| | |
|
| | | rabbitTemplate.convertAndSend("monitors_data2", "", JSON.toJSONString(msgData).getBytes());
|
| | | String new_message = JSON.toJSONString(msgData);
|
| | | rabbitTemplate.convertAndSend("monitors_data2", "", new_message.getBytes());
|
| | | // rabbitTemplate.send("monitors_data2", "", new Message(JSON.toJSONString(msgData).getBytes(), new MessageProperties()));
|
| | |
|
| | | // int state = (new Random()).nextInt(4) % 5; //TODO
|
| | |
| | | history.setSensor(sensor.getSensor());
|
| | | history.setMac_value(Double.valueOf(msgData.get(key)));
|
| | | histories.add(history);
|
| | |
|
| | | mongoTemplate.insert(JSON.toJSONString(history), "data");
|
| | | }
|
| | | }
|
| | | jobDao.batchInsertHistory(histories);
|
| | |
|
| | | //mongoTemplate.insert(JSON.toJSONString(histories), "data");
|
| | | mongoTemplate.insert(new_message, "data");
|
| | | }
|
| | |
|
| | | private Map<String, Float> getAdjustData(String mac) {
|