| | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void CacheGlassOneTasks() { |
| | | CacheGlassTasksChild(EDG_STORAGE_DEVICE_ONE_TASK, "cacheGlassOne", 1, 5); |
| | | CacheGlassTasksChild("cacheGlassOne", 1); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void CacheGlassTwoTasks() { |
| | | CacheGlassTasksChild(EDG_STORAGE_DEVICE_TWO_TASK, "cacheGlassTwo", 2, 6); |
| | | CacheGlassTasksChild("cacheGlassTwo", 2); |
| | | } |
| | | |
| | | private void CacheGlassTasksChild(String tableName, String webSocketName, int deviceId, int stationCell) { |
| | | private void CacheGlassTasksChild(String webSocketName, int deviceId) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<CutDrawingVO> currentCutDrawings = edgStorageCageDetailsService.queryCurrentCutDrawing(deviceId, stationCell); |
| | | jsonObject.append("currentCutTerritory", currentCutDrawings); |
| | | //卧室缓存笼内信息 |
| | | List<EdgStorageCageVO> edgStorageCageVOS = edgStorageCageService.selectEdgStorageCagesByDeviceId(deviceId); |
| | | jsonObject.append("EdgStorageCageinfos", edgStorageCageVOS); |
| | | |
| | | //获取正在整形中的任务 |
| | | EdgStorageDeviceTaskHistory taskHistory = edgStorageDeviceTaskHistoryService.getOne(new LambdaQueryWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId,deviceId) |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, deviceId) |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | | .orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime).last("limit 1")); |
| | | jsonObject.append("taskMessage", taskHistory); |
| | |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void currentCutDrawingOneTask() { |
| | | currentCutDrawingTaskChild("currentCutDrawingOne", 1, 5); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void currentCutDrawingTwoTask() { |
| | | currentCutDrawingTaskChild("currentCutDrawingTwo", 2, 6); |
| | | } |
| | | |
| | | public void currentCutDrawingTaskChild(String webSocketName, int deviceId, int stationCell) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<CutDrawingVO> currentCutDrawings = edgStorageCageDetailsService.queryCurrentCutDrawing(deviceId, stationCell); |
| | | jsonObject.append("currentCutTerritory", currentCutDrawings); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get(webSocketName); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void CacheGlassTaskss() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //磨边信息 |