1
luxiaotao1123
3 天以前 3a6155c8c3464152e0bc6267059a045c0d102c49
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/PathQueueConsumer.java
@@ -37,23 +37,20 @@
        this.consumerExecutor.execute(() -> {
            while (!Thread.currentThread().isInterrupted()) {
                try {
                    Thread.sleep(10);
                    List<UnlockPathTask> tasks = new ArrayList<>();
                    // if unlockTaskQueue was empty, then block
//                    tasks.add(unlockTaskQueue.take());
                    tasks.add(unlockTaskQueue.take());
                    unlockTaskQueue.drainTo(tasks);
                    if (tasks.isEmpty()) {
                        Thread.sleep(30);
                    } else {
                    if (!Cools.isEmpty(tasks)) {
                        long startTime = System.currentTimeMillis();
                        List<int[]> resetCodeIdxList = null;
                        if (tasks.size() == 1) {
                            resetCodeIdxList = this.getResetCodeList(lev, tasks.get(0));
                        } else if (tasks.size() > 1) {
                            log.info("consumer task count:{}", tasks.size());
//                            log.info("consumer task count:{}", tasks.size());
                            resetCodeIdxList = this.getResetCodeList(lev,tasks);
                        }
@@ -61,7 +58,7 @@
                            this.dealResetCodeList(lev, resetCodeIdxList);
                        }
                        log.info("consumer unlock path spend time:{}", System.currentTimeMillis() - startTime);
//                        log.info("consumer unlock path spend time:{}", System.currentTimeMillis() - startTime);
                    }
                } catch (InterruptedException e) {
@@ -158,7 +155,9 @@
        String agvNo = task.getAgvNo();
        int[] codeMatrixIdx = mapDataDispatcher.getCodeMatrixIdx(lev, task.getCodeData());
        if(codeMatrixIdx==null){
            return new ArrayList<>();
        }
        DynamicNode dynamicNode = dynamicMatrix[codeMatrixIdx[0]][codeMatrixIdx[1]];
        int serial = dynamicNode.getSerial();