| | |
| | | |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void send() { |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("mainMes"); |
| | | if (sendwServer != null) { |
| | | //推送服务器当前时间 |
| | | JSONObject jsonObject = new JSONObject(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | jsonObject.append("globalDate", sdf.format(DateUtil.getEndDate())); |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("mainMes is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // @Scheduled(fixedDelay = 5000) |
| | | public void loadGlassStatus() { |
| | | JSONObject jsonObject = new JSONObject(); |