| | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingGlassHome() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在等待进片的玻璃 |
| | | List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlass(); |
| | | if (waitingGlass != null) { |
| | | jsonObject.append("waitingGlass", waitingGlass); |
| | | } |
| | | |
| | | //获取整在炉中的两个版图id |
| | | List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); |
| | | //进炉中的玻璃 |
| | | if (!layoutId.isEmpty()) { |
| | | for (int i = 0; i < layoutId.size(); i++) { |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(i)); |
| | | jsonObject.append("intoGlass" + (i + 1), intoGlass); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |
| | | if (sendwServer != null) { |
| | | //正在等待进片的玻璃 |
| | | List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlass(); |
| | | if (waitingGlass != null) { |
| | | jsonObject.append("waitingGlass", waitingGlass); |
| | | } |
| | | |
| | | //获取整在炉中的两个版图id |
| | | List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId(); |
| | | //进炉中的玻璃 |
| | | if (!layoutId.isEmpty()) { |
| | | for (int i = 0; i < layoutId.size(); i++) { |
| | | List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(i)); |
| | | jsonObject.append("intoGlass" + (i + 1), intoGlass); |
| | | } |
| | | // List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0)); |
| | | // jsonObject.append("intoGlass", intoGlass); |
| | | // //进炉中的第二个版图 |
| | |
| | | // jsonObject.append("intoGlass2", intoGlass2); |
| | | // } |
| | | |
| | | } |
| | | //出炉后的玻璃 |
| | | List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass(); |
| | | if (outGlass != null) { |
| | | jsonObject.append("outGlass", outGlass); |
| | | } |
| | | } |
| | | //出炉后的玻璃 |
| | | List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass(); |
| | | if (outGlass != null) { |
| | | jsonObject.append("outGlass", outGlass); |
| | | } |
| | | |
| | | //过旋转台钢化后的玻璃 |
| | | List<TemperingGlassInfo> overGlass = temperingAgoService.selectOverGlass(); |
| | | if (outGlass != null) { |
| | | jsonObject.append("overGlass", overGlass); |
| | | } |
| | | |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass"); |
| | | if (sendwServer != null) { |
| | | //过旋转台钢化后的玻璃 |
| | | List<TemperingGlassInfo> overGlass = temperingAgoService.selectOverGlass(); |
| | | if (outGlass != null) { |
| | | jsonObject.append("overGlass", overGlass); |
| | | } |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |