#
lsh
2024-06-21 c147a3dc2a56ab23b1cfeafef3de2867593f4206
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4417,7 +4417,7 @@
                    continue;
                }
                BasJarMast jarMastByJarIdMax = basJarMastService.getJarMastByJarIdMax(jarSlave.getId().longValue());
                if (jarMastByJarIdMax.getJarLocDigit()==7){
                if (!Cools.isEmpty(jarMastByJarIdMax) && jarMastByJarIdMax.getJarLocDigit()==7){
                    continue;
                }
                jarGenerateWrkMastStaExecute(jarSlave);
@@ -4441,7 +4441,20 @@
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            //  状态:等待确认 并且  任务完成位 = 1
            JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
            JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
            if (jarOtherProtocol == null) {
                return false;
            }
            if (jarOtherProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            //自动、空闲、右门关闭、
            if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){
            }
        } catch (Exception e){
//            log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2);
@@ -4449,6 +4462,75 @@
        return false;
    }
    /**
     *  Jar任务创建  执行
     */
    public synchronized boolean jarGenerateWrkMastStaExecuteOne(JarSlave jarSlave) {
        try{
            // 获取堆垛机信息
            JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId());
            JarProtocol jarProtocol = jarThread.getJarProtocol();
            if (jarProtocol == null) {
                return false;
            }
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
            JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
            if (jarOtherProtocol == null) {
                return false;
            }
            if (jarOtherProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            //自动、空闲、右门关闭、
            if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){
            }
        } catch (Exception e){
//            log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2);
        }
        return false;
    }
    /**
     *  Jar任务创建  执行
     */
    public synchronized boolean jarGenerateWrkMastStaExecuteTwo(JarSlave jarSlave) {
        try{
            // 获取堆垛机信息
            JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId());
            JarProtocol jarProtocol = jarThread.getJarProtocol();
            if (jarProtocol == null) {
                return false;
            }
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
            JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
            if (jarOtherProtocol == null) {
                return false;
            }
            if (jarOtherProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            //自动、空闲、右门关闭、
            if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){
            }
        } catch (Exception e){
//            log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2);
        }
        return false;
    }
    /**
     *  Jar任务执行