skyouc
7 天以前 c828579bf44bf5b2ded4c04b16670be71cc76514
src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
@@ -75,13 +75,6 @@
    private static final String CRN_OUT_REQUIRE_STATION_OUT_ENABLE_CONFIG = "crnOutRequireStationOutEnable";
    public synchronized void crnIoExecute() {
        List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>());
        for (BasCrnp basCrnp : basCrnps) {
            crnIoExecute(basCrnp);
        }
    }
    public void crnIoExecute(BasCrnp basCrnp) {
        if (basCrnp == null || basCrnp.getCrnNo() == null) {
            return;
@@ -141,11 +134,11 @@
            return;
        }
        //执行移动任务
        boolean executed = executeCrnMoveTask(crnThread, crnProtocol);
        if (executed) {
            return;
        }
//        //执行移动任务
//        boolean executed = executeCrnMoveTask(crnThread, crnProtocol);
//        if (executed) {
//            return;
//        }
        String lastIo = resolveCrnLastIo(crnProtocol);
@@ -170,7 +163,7 @@
            if (wrkMast.getWrkSts() != null && wrkMast.getWrkSts() == WrkStsType.INBOUND_STATION_RUN_COMPLETE.sts) {
                boolean result = this.crnExecuteInPlanner(currentCrn, crnThread, wrkMast);
                if (result) {
                    crnProtocol.setLastIo("O");
                    crnProtocol.setLastIo("I");
                    return;
                }
                continue;
@@ -179,7 +172,7 @@
            if (wrkMast.getWrkSts() != null && wrkMast.getWrkSts() == WrkStsType.NEW_OUTBOUND.sts) {
                boolean result = this.crnExecuteOutPlanner(currentCrn, crnThread, wrkMast);
                if (result) {
                    crnProtocol.setLastIo("I");
                    crnProtocol.setLastIo("O");
                    return;
                }
                continue;
@@ -394,9 +387,9 @@
            return false;
        }
        if (!allowBatchOutboundExecute(wrkMast, true)) {
            return false;
        }
//        if (!allowBatchOutboundExecute(wrkMast, true)) {
//            return false;
//        }
        for (StationObjModel stationObjModel : outStationList) {
            StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, stationObjModel.getDeviceNo());
@@ -405,7 +398,15 @@
            }
            Map<Integer, StationProtocol> stationProtocolMap = stationThread.getStatusMap();
            StationProtocol stationProtocol = stationProtocolMap.get(stationObjModel.getStationId());
            //获取当前任务堆垛机任务站台
            Integer staNo = wrkMast.getSourceStaNo();
            Integer stationId = stationObjModel.getStationId();
            StationProtocol stationProtocol = stationProtocolMap.get(staNo);
           if (!staNo.equals(stationId)) {
               continue;
           }
            if (stationProtocol == null) {
                continue;
            }
@@ -668,14 +669,6 @@
        return defaultValue;
    }
    //堆垛机任务执行完成
    public synchronized void crnIoExecuteFinish() {
        List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>());
        for (BasCrnp basCrnp : basCrnps) {
            crnIoExecuteFinish(basCrnp);
        }
    }
    public void crnIoExecuteFinish(BasCrnp basCrnp) {
        if (basCrnp == null || basCrnp.getCrnNo() == null) {
            return;
@@ -735,13 +728,6 @@
            }
            redisUtil.set(RedisKeyType.CRN_IO_EXECUTE_FINISH_LIMIT.key + basCrnp.getCrnNo(), "lock",10);
        }
    }
    public synchronized void plannerExecute() {
        List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>());
        for (BasCrnp basCrnp : basCrnps) {
            plannerExecute(basCrnp);
        }
    }