| | |
| | | @Scheduled(cron = "0/2 * * * * ? ") |
| | | private void TaskOrErrorSend(){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | |
| | | map.put("to","1002"); |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 1002)); |
| | | if (basDevp == null || Cools.isEmpty(basDevp.getDecDesc()) || basDevp.getWrkNo() == 0){ |
| | | if (basDevp == null ){ |
| | | return; |
| | | } |
| | | if (Cools.isEmpty(basDevp.getDecDesc()) && basDevp.getWrkNo() == 0){ |
| | | map.put("message",Cools.add("type", "NoData")); |
| | | } |
| | | if (!Cools.isEmpty(basDevp.getDecDesc())){ |
| | | map.put("to","1002"); |
| | | map.put("message",Cools.add("type", "error").add("errMsg",basDevp.getDecDesc())); |
| | | webSocketServer.onMessage(JSONObject.toJSONString(map),null,"1002"); |
| | | |
| | | }else if (basDevp.getWrkNo() != 0){ |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", basDevp.getWrkNo())); |
| | | if (null == wrkMast){ |
| | | return; |
| | | } |
| | | |
| | | List<LedCommand> commandList = getCommandList(basDevp.getWrkNo().toString()); |
| | | map.put("to","1002"); |
| | | map.put("message",Cools.add("type", "task").add("taskList",commandList)); |
| | | webSocketServer.onMessage(JSONObject.toJSONString(map),null,"1002"); |
| | | } |
| | | |
| | | webSocketServer.onMessage(JSONObject.toJSONString(map),null,"1002"); |
| | | } |
| | | |
| | | public List<LedCommand> getCommandList(String taskNo){ |