hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java
@@ -105,10 +105,10 @@
        //获取第二条线路的卧式理片笼状态
        ReadWriteEntity twoInkageEntity = miloService.readFromOpcUa("WL2.WL2.deviceState");
        //默认只跑一台卧式理片,两条线路都可以走
        int cellFlag = 2;
        int cellFlag = 1;
        //如果两条线都启动则只能跑一条线
        if (twoInkageEntity != null && Boolean.parseBoolean(twoInkageEntity.getValue() + "")) {
            cellFlag = 1;
        if (twoInkageEntity != null && !Boolean.parseBoolean(twoInkageEntity.getValue() + "")) {
            cellFlag = 2;
        }
        startOneOpcTaskChild(EDG_STORAGE_DEVICE_ONE_TASK, 1, cellFlag);
    }
@@ -116,9 +116,9 @@
    @Scheduled(fixedDelay = 1000)
    public void startTwoOpcTask() throws Exception {
        ReadWriteEntity oneInkageEntity = miloService.readFromOpcUa("WL1.WL1.deviceState");
        int cellFlag = 2;
        if (oneInkageEntity != null && Boolean.parseBoolean(oneInkageEntity.getValue() + "")) {
            cellFlag = 1;
        int cellFlag = 1;
        if (oneInkageEntity != null && !Boolean.parseBoolean(oneInkageEntity.getValue() + "")) {
            cellFlag = 2;
        }
        startOneOpcTaskChild(EDG_STORAGE_DEVICE_TWO_TASK, 2, cellFlag);
    }
@@ -299,7 +299,7 @@
            twoOutState = twoOutStateEntity.getValue().toString();
        }
        if ((Const.OUT_BUSY.equals(oneOutState) && Const.OUT_BUSY.equals(twoOutState)) || (Const.OUT_DISABLE.equals(oneOutState) && Const.OUT_DISABLE.equals(twoOutState))) {
        if ((cellFlag == 2 && Const.OUT_BUSY.equals(oneOutState) && Const.OUT_BUSY.equals(twoOutState)) || (Const.OUT_DISABLE.equals(oneOutState) && Const.OUT_DISABLE.equals(twoOutState))) {
            log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState);
            return Boolean.FALSE;
        }
@@ -310,17 +310,21 @@
        if (cellFlag == 1) {
            cell = deviceId;
        } else {
            if (Const.OUT_FREE.equals(oneOutState)) {
                cell = Const.ONE_OUT_TARGET_POSITION;
            } else if (Const.OUT_FREE.equals(twoOutState)) {
            if (Const.OUT_FREE.equals(twoOutState)) {
                cell = Const.TWO_OUT_TARGET_POSITION;
            } else if (Const.OUT_FREE.equals(oneOutState)) {
                cell = Const.ONE_OUT_TARGET_POSITION;
            } else {
                return Boolean.FALSE;
            }
        }
        if (Const.OUT_FREE.equals(oneOutState) && Const.OUT_FREE.equals(twoOutState)) {
            if (!outChildTask(task, tableName, deviceId, cell, startDate)) {
                cell = cell == Const.ONE_OUT_TARGET_POSITION ? Const.TWO_OUT_TARGET_POSITION : Const.ONE_OUT_TARGET_POSITION;
            if (cellFlag == 2) {
                if (!outChildTask(task, tableName, deviceId, cell, startDate)) {
                    cell = cell == Const.ONE_OUT_TARGET_POSITION ? Const.TWO_OUT_TARGET_POSITION : Const.ONE_OUT_TARGET_POSITION;
                    return outChildTask(task, tableName, deviceId, cell, startDate);
                }
            } else {
                return outChildTask(task, tableName, deviceId, cell, startDate);
            }
        } else {