| | |
| | | * @throws IOException |
| | | */ |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void execute() throws IOException { |
| | | List<TaskWrk> taskWrks=taskWrkService.selectList(new EntityWrapper<TaskWrk>().eq("status",1).in("wrk_sts",12,3)); |
| | | public synchronized void execute() throws IOException { |
| | | List<TaskWrk> taskWrks=taskWrkService.selectList(new EntityWrapper<TaskWrk>().eq("status",1).in("wrk_sts",12,13,3,4)); |
| | | if(taskWrks.size()>0){ |
| | | for(TaskWrk taskWrk:taskWrks){ |
| | | if(Cools.isEmpty(taskWrk.getMarkStart())||taskWrk.getMarkStart()==0){ |
| | |
| | | /** |
| | | * 写入数据 |
| | | */ |
| | | private boolean write5(CrnCommand command) throws InterruptedException { |
| | | private synchronized boolean write5(CrnCommand command) throws InterruptedException { |
| | | String methodName = Thread.currentThread().getStackTrace()[1].getMethodName(); |
| | | |
| | | if (null == command) { |
| | |
| | | int i=0; |
| | | do{ |
| | | //堆垛机任务写入后,回读一次,看是否成功 |
| | | Thread.sleep(200); |
| | | Thread.sleep(300); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 20); |
| | | if (resultRead.IsSuccess) { |
| | | CrnCommand one = new CrnCommand(); |