| | |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | |
| | | @Value("${mes.min.two.secondLength}") |
| | | private String minTwoSecondLength; |
| | | |
| | | public static String engineerId=""; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | | Date startDate = new Date(); |
| | |
| | | Date endDate = new Date(); |
| | | log.info("本次任务结束时间:{},共耗时:{}ms", endDate, endDate.getTime() - startDate.getTime()); |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingIsRun(){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<TaskCache>taskCaches=taskCacheService.selectTaskCacheIsRun(); |
| | | jsonObject.append("taskCaches", taskCaches); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 进片任务 |
| | | * |
| | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void CacheGlassTasks() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //识别摆片 |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | List<Map<String, Object>> currentCutTerritorys= edgStorageCageDetailsService.selectCutTerritory(); |
| | | // List<Map<String, Object>> currentCutTerritorys=new ArrayList<>(); |
| | | // if(engineerId==null||engineerId.isEmpty()){ |
| | | // //识别摆片 当前版图数据 |
| | | // currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | // }else{ |
| | | // //识别摆片 此engineerId 工程版图数据 |
| | | // currentCutTerritorys = edgStorageCageDetailsService.selectCurrentCutTerritory(engineerId); |
| | | // } |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | | //磨边信息 |
| | | List<Map<String, Object>> EdgTasks1 = taskCacheService.selectEdgInfo("2001"); |
| | | List<Map<String, Object>> EdgTasks2 = taskCacheService.selectEdgInfo("2002"); |