#
lsh
2024-06-27 efad59da8921d93537fca47d6ec2512e312bc1c3
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -5267,7 +5267,16 @@
    * JarWrkMastExecute任务创建==>下发
    * Action
    * */
    public synchronized void jarWrkMastExecuteAction(Integer sign) {
    public synchronized void jarWrkMastExecuteAction(Integer sign,Integer sign2) {
        if (sign2==0){
            jarWrkMastExecuteActionOne(sign);
        } else if (sign2 == 1){
            jarWrkMastExecuteActionTwo(sign);
        } else if (sign2 == 2){
            jarWrkMastExecuteActionThree(sign);
        }
    }
    public synchronized void jarWrkMastExecuteActionOne(Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, null,0);
            for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
@@ -5328,6 +5337,108 @@
    }
    /*
     * JarWrkMastExecute任务创建==>下发
     * Action
     * */
    public synchronized void jarWrkMastExecuteActionTwo(Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, null,2);
            for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
                /*
                 * 任务类型 0: 未知
                 * 1: 开进料门  2: 关进料门  3: 开出料门  4: 关出料门
                 * 5: 入硫化罐
                 * 6: 入冷却槽
                 * 7: 穿梭车进冷却槽  8: 穿梭车离开冷却槽
                 * 9: 出冷却槽
                 * 10:A=>B 11:B=>A
                 * */
                switch (wrkMastExecute.getIoType()){
                    case 1://1: 开进料门
                    case 3://3: 开出料门
                        if (jarWrkMastExecuteActionExecute1(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                    case 2:
                    case 4:
                        if (jarWrkMastExecuteActionExecute2(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                    case 5:
                        if (jarWrkMastExecuteActionExecute5(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                    case 6:
                        if (jarWrkMastExecuteActionExecute6(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                    case 7:
                    case 8:
                        if (jarWrkMastExecuteActionExecute7(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                    case 9:
                        if (jarWrkMastExecuteActionExecute9Two(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                    case 10:
                    case 11:
                        if (jarWrkMastExecuteActionExecute10(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                }
            }
        } catch (Exception e){
            log.error("JarWrkMastExecute任务创建===>Action==>下发"+e.getMessage());
        }
    }
    /*
     * JarWrkMastExecute任务创建==>下发
     * Action
     * */
    public synchronized void jarWrkMastExecuteActionThree(Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, null,4);
            for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
                /*
                 * 任务类型 0: 未知
                 * 1: 开进料门  2: 关进料门  3: 开出料门  4: 关出料门
                 * 5: 入硫化罐
                 * 6: 入冷却槽
                 * 7: 穿梭车进冷却槽  8: 穿梭车离开冷却槽
                 * 9: 出冷却槽
                 * 10:A=>B 11:B=>A
                 * */
                switch (wrkMastExecute.getIoType()){
                    case 5:
                        if (jarWrkMastExecuteActionExecute5Three(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                    case 6:
                        if (jarWrkMastExecuteActionExecute6Three(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                }
            }
        } catch (Exception e){
            log.error("JarWrkMastExecute任务创建===>Action==>下发"+e.getMessage());
        }
    }
    /**
     *  JarWrkMastExecute任务==>下发 //完成
     *  1、3开进料门
@@ -5360,7 +5471,7 @@
//            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1)){
//                return false;
//            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
            if (staProtocolRGV == null) {
                return false;
@@ -5385,7 +5496,7 @@
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
                if (staProtocolRGV.getNowRow() != staProtocolRGVOther.getNowRow()){
                    //移走  == > 2
                    if (jarRgvMoveTake(wrkMastExecute,2)){
                    if (!jarRgvMoveTake(wrkMastExecute,2)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                    }
@@ -5398,26 +5509,26 @@
                    if (!jarProtocol.isLeftDoor() && !jarProtocol.isRightDoor()){
                        if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                            //移走  == > 2
                            if (jarRgvMoveTake(wrkMastExecute,2)){
                            if (!jarRgvMoveTake(wrkMastExecute,2)){
                                log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkType(1);
                            wrkMastExecute.setWrkSts(1);
                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                            wrkMastExecute.setWrkSts(2);
                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                        } else {
                            //直接开门/关门
                            if (jarDoorTake(wrkMastExecute,JarTaskModeType.OPEN_THE_DOOR)){
                            if (!jarDoorTake(wrkMastExecute,JarTaskModeType.OPEN_THE_DOOR)){
                                log.error("硫化罐Jar命令下发失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkType(1);
                            wrkMastExecute.setWrkSts(3);
                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
@@ -5426,7 +5537,7 @@
                        //直接完成
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(4);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
@@ -5478,7 +5589,7 @@
//                return false;
//            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
            if (staProtocolRGV == null) {
                return false;
@@ -5502,7 +5613,7 @@
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
                if (staProtocolRGV.getNowRow() != staProtocolRGVOther.getNowRow()){
                    //移走  == > 2
                    if (jarRgvMoveTake(wrkMastExecute,2)){
                    if (!jarRgvMoveTake(wrkMastExecute,2)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                    }
@@ -5515,27 +5626,27 @@
                    if (jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()){
                        if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                            //移走  == > 2
                            if (jarRgvMoveTake(wrkMastExecute,2)){
                            if (!jarRgvMoveTake(wrkMastExecute,2)){
                                log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkType(1);
                            wrkMastExecute.setWrkSts(1);
                            wrkMastExecute.setWrkSts(2);
                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                        } else {
                            //直接关门
                            if (jarDoorTake(wrkMastExecute,JarTaskModeType.CLOSE_THE_DOOR)){
                            if (!jarDoorTake(wrkMastExecute,JarTaskModeType.CLOSE_THE_DOOR)){
                                log.error("硫化罐Jar命令下发失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkType(1);
                            wrkMastExecute.setWrkSts(3);
                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
@@ -5544,7 +5655,7 @@
                        //直接完成
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(4);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
@@ -5615,11 +5726,10 @@
            if (staProtocolRGVOther == null) {
                return false;
            }
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
                if (staProtocolRGV.getNowRow() != staProtocolRGVOther.getNowRow()){
                    //移走  == > 2
                    if (jarRgvMoveTake(wrkMastExecute,2)){
                    if (!jarRgvMoveTake(wrkMastExecute,2)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                    }
@@ -5636,28 +5746,134 @@
                            return false;
                        }
                        //调车  == > 取货
                        if (jarRgvGetTake(wrkMastExecute
                        if (!jarRgvGetTake(wrkMastExecute
                                ,SteAndJarUtil.getRgvStaRow(wrkMastExecute.getJarEnterStaNo())==1
                                ,SteAndJarUtil.getRgvStaRow(wrkMastExecute.getJarEnterStaNo())==3)){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            return true;
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(3);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                    } else {
                        //调车  == > endRow
                        if (jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        wrkMastExecute.setWrkSts(2);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                    }
                    return true;
                }
                return false;
            } else {
                log.error("jarWrkMastExecuteActionExecute1===>执行异常===》RGV不满足条件,等待===》异常数据:BasJar:"+ JSON.toJSONString(basJar.getEnterRgvNo())+";WrkMastExecute:"+JSON.toJSONString(wrkMastExecute));
                return false;
            }
        } catch (Exception e){
            log.error("jarWrkMastExecuteActionExecute1任务执行下发异常==》wrkMastExecute={},异常原因={}",wrkMastExecute,e.getMessage());
        }
        return false;
    }
    /**
     *  JarWrkMastExecute任务==>下发 //完成
     *  io_type==>5:入硫化罐  :  wrkSts  ==>4:rgv取货完成
     *  =====>wrkSts ==>5:Ste穿梭版入硫化罐(清楚RGV资料)
     *  任务下发
     */
    public synchronized boolean jarWrkMastExecuteActionExecute5Three(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
                return false;
            }
            // 获取硫化罐信息
            JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, wrkMastExecute.getJarId());
            JarProtocol jarProtocol = jarThread.getJarProtocol();
            if (jarProtocol == null) {
                return false;
            }
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
            if (Cools.isEmpty(basJar)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                return false;
            }
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1)){
//                return false;
//            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
            if (staProtocolRGV == null) {
                return false;
            } else {
                staProtocolRGV = staProtocolRGV.clone();
            }
            if (staProtocolRGV == null) {
                return false;
            }
            StaProtocol staProtocolRGVOther = devpThread.getStation().get(basJar.getOutRgvNo());
            if (staProtocolRGVOther == null) {
                return false;
            } else {
                staProtocolRGVOther = staProtocolRGVOther.clone();
            }
            if (staProtocolRGVOther == null) {
                return false;
            }
            if (staProtocolRGV.rgvBoolean(2) && staProtocolRGVOther.rgvBoolean(1)){
                if (staProtocolRGV.getNowRow() != staProtocolRGVOther.getNowRow()){
                    //移走  == > 2
                    if (!jarRgvMoveTake(wrkMastExecute,2)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                    }
                    return true;
                }
                //门作业  无
                //自动、空闲、  进料们打开需关闭
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                        //判断小车状态
                        if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                            return false;
                        }
                        //调车  == > 取货
                        if (!jarSteTake(wrkMastExecute,SteLocaType.POINT20.id,SteLocaType.POINT22.id,SteTaskModeType.STE_WFFH_13,false)){
                            log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(5);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                    } else {
                        //调车  == > endRow
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                    }
@@ -5707,7 +5923,7 @@
//                return false;
//            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
            if (staProtocolRGV == null) {
                return false;
@@ -5731,7 +5947,7 @@
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
                if (staProtocolRGV.getNowRow() != staProtocolRGVOther.getNowRow()){
                    //移走  == > 2
                    if (jarRgvMoveTake(wrkMastExecute,2)){
                    if (!jarRgvMoveTake(wrkMastExecute,2)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                    }
@@ -5748,25 +5964,135 @@
                            return false;
                        }
                        //调车  == > 取货
                        if (jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT21.id,SteTaskModeType.STE_WFQH_12,false)){
                        if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT21.id,SteTaskModeType.STE_WFQH_12,false)){
                            log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(3);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                    } else {
                        //调车  == > endRow
                        if (jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        wrkMastExecute.setWrkSts(2);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                    }
                    return true;
                }
                return false;
            } else {
                log.error("jarWrkMastExecuteActionExecute1===>执行异常===》RGV不满足条件,等待===》异常数据:BasJar:"+ JSON.toJSONString(basJar.getEnterRgvNo())+";WrkMastExecute:"+JSON.toJSONString(wrkMastExecute));
                return false;
            }
        } catch (Exception e){
            log.error("jarWrkMastExecuteActionExecute1任务执行下发异常==》wrkMastExecute={},异常原因={}",wrkMastExecute,e.getMessage());
        }
        return false;
    }
    /**
     *  JarWrkMastExecute任务==>下发 //完成
     *  6:入冷却槽
     *  任务下发
     */
    public synchronized boolean jarWrkMastExecuteActionExecute6Three(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
                return false;
            }
            // 获取硫化罐信息
            JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, wrkMastExecute.getJarId());
            JarProtocol jarProtocol = jarThread.getJarProtocol();
            if (jarProtocol == null) {
                return false;
            }
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
            if (Cools.isEmpty(basJar)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                return false;
            }
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1)){
//                return false;
//            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
            if (staProtocolRGV == null) {
                return false;
            } else {
                staProtocolRGV = staProtocolRGV.clone();
            }
            if (staProtocolRGV == null) {
                return false;
            }
            StaProtocol staProtocolRGVOther = devpThread.getStation().get(basJar.getOutRgvNo());
            if (staProtocolRGVOther == null) {
                return false;
            } else {
                staProtocolRGVOther = staProtocolRGVOther.clone();
            }
            if (staProtocolRGVOther == null) {
                return false;
            }
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
                if (staProtocolRGV.getNowRow() != staProtocolRGVOther.getNowRow()){
                    //移走  == > 2
                    if (!jarRgvMoveTake(wrkMastExecute,2)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                    }
                    return true;
                }
                //门作业  无
                //自动、空闲、
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                        //判断小车状态
                        if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                            return false;
                        }
                        //调车  == > 取货
                        if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT21.id,SteTaskModeType.STE_WFQH_12,false)){
                            log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(3);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                    } else {
                        //调车  == > endRow
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(2);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
@@ -5833,7 +6159,7 @@
//                return false;
//            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
            if (staProtocolRGV == null) {
                return false;
@@ -5857,7 +6183,7 @@
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
                if (staProtocolRGV.getNowRow() != staProtocolRGVOther.getNowRow()){
                    //移走  == > 2
                    if (jarRgvMoveTake(wrkMastExecute,2)){
                    if (!jarRgvMoveTake(wrkMastExecute,2)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                    }
@@ -5875,20 +6201,20 @@
                        if (wrkMastExecute.getIoType()==7){
                            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                                //调车  == > 移动
                                if (jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT26.id,SteTaskModeType.STE_WFQH_12,false)){
                                if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT26.id,SteTaskModeType.STE_WFQH_12,false)){
                                    log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
                                wrkMastExecute.setWrkType(1);
                                wrkMastExecute.setWrkSts(3);
                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                    log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
                            } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){
                                wrkMastExecute.setWrkType(1);
                                wrkMastExecute.setWrkSts(4);
                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                    log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
@@ -5896,20 +6222,20 @@
                        } else {
                            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){
                                //调车  == > 移动
                                if (jarSteTake(wrkMastExecute,SteLocaType.POINT26.id,SteLocaType.POINT23.id,SteTaskModeType.STE_WFQH_12,false)){
                                if (!jarSteTake(wrkMastExecute,SteLocaType.POINT26.id,SteLocaType.POINT23.id,SteTaskModeType.STE_WFQH_12,false)){
                                    log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
                                wrkMastExecute.setWrkType(1);
                                wrkMastExecute.setWrkSts(3);
                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                    log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
                            } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                                wrkMastExecute.setWrkType(1);
                                wrkMastExecute.setWrkSts(4);
                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                    log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
@@ -5918,13 +6244,13 @@
                    } else {
                        //调车  == > endRow
                        if (jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        wrkMastExecute.setWrkSts(2);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
@@ -5991,7 +6317,7 @@
//                return false;
//            }
//
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocol = devpThread.getStation().get(basJar.getStaNo());
            if (staProtocol == null) {
                return false;
@@ -6032,13 +6358,13 @@
                    //判断小车状态
                    if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){
                        //调车  == > 取货
                        if (jarSteTake(wrkMastExecute,SteLocaType.POINT26.id,SteLocaType.POINT24.id,SteTaskModeType.STE_WFQH_12,false)){
                        if (!jarSteTake(wrkMastExecute,SteLocaType.POINT26.id,SteLocaType.POINT24.id,SteTaskModeType.STE_WFQH_12,false)){
                            log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},冷却槽数据={},sign={}",
                                    wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(basJar),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},冷却槽数据={},sign={}",
                                    wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(basJar),sign);
                        }
@@ -6050,6 +6376,54 @@
//                log.error("jarWrkMastExecuteActionExecute1===>执行异常===》RGV不满足条件,等待===》异常数据:BasJar:"+ JSON.toJSONString(basJar.getEnterRgvNo())+";WrkMastExecute:"+JSON.toJSONString(wrkMastExecute));
//                return false;
//            }
        } catch (Exception e){
            log.error("jarWrkMastExecuteActionExecute1任务执行下发异常==》wrkMastExecute={},异常原因={}",wrkMastExecute,e.getMessage());
        }
        return false;
    }
    /**
     *  JarWrkMastExecute任务==>下发 //完成
     *  9:出冷却槽
     *  任务下发
     */
    public synchronized boolean jarWrkMastExecuteActionExecute9Two(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
                return false;
            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocol = devpThread.getStation().get(wrkMastExecute.getJarOutStaNo());
            if (staProtocol == null) {
                return false;
            } else {
                staProtocol = staProtocol.clone();
            }
            if (staProtocol == null) {
                return false;
            }
            if (staProtocol.getWorkNo()!=0 || !staProtocol.isAutoing() || !staProtocol.isLoading()){
                return false;
            }
            //判断STE小车状态
            if (jarWrkMastExecuteGenerateSteStatus(wrkMastExecute.getSteId(),3,SteStatusType.IDLE)){
                // 下发站点信息
                staProtocol.setWorkNo(wrkMastExecute.getWrkNo().intValue());
                staProtocol.setStaNo(staProtocol.getStaNo());
                if (!MessageQueue.offer(SlaveType.Devp, 2, new Task(2, staProtocol))) {
                    return false;
                }
                wrkMastExecute.setWrkType(1);
                wrkMastExecute.setWrkSts(3);
                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                    log.error("输送线出库目标站命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},放货站点数据={},sign={}",
                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocol),sign);
                }
            }
            return true;
        } catch (Exception e){
            log.error("jarWrkMastExecuteActionExecute1任务执行下发异常==》wrkMastExecute={},异常原因={}",wrkMastExecute,e.getMessage());
        }
@@ -6089,7 +6463,7 @@
//                return false;
//            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1);
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
            if (staProtocolRGV == null) {
                return false;
@@ -6113,7 +6487,7 @@
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
                if (staProtocolRGV.getNowRow() != staProtocolRGVOther.getNowRow()){
                    //移走  == > 2
                    if (jarRgvMoveTake(wrkMastExecute,2)){
                    if (!jarRgvMoveTake(wrkMastExecute,2)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                    }
@@ -6130,20 +6504,20 @@
                        if (wrkMastExecute.getIoType()==10){
                            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                                //调车  == > 移动
                                if (jarSteTake(wrkMastExecute,SteLocaType.POINT20.id,SteLocaType.POINT23.id,SteTaskModeType.STE_WFQH_12,false)){
                                if (!jarSteTake(wrkMastExecute,SteLocaType.POINT20.id,SteLocaType.POINT23.id,SteTaskModeType.STE_WFQH_12,false)){
                                    log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
                                wrkMastExecute.setWrkType(1);
                                wrkMastExecute.setWrkSts(3);
                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                    log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
                            } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                                wrkMastExecute.setWrkType(1);
                                wrkMastExecute.setWrkSts(4);
                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                    log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
@@ -6151,20 +6525,20 @@
                        } else {
                            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                                //调车  == > 移动
                                if (jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT20.id,SteTaskModeType.STE_WFQH_12,false)){
                                if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT20.id,SteTaskModeType.STE_WFQH_12,false)){
                                    log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
                                wrkMastExecute.setWrkType(1);
                                wrkMastExecute.setWrkSts(3);
                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                    log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
                            } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                                wrkMastExecute.setWrkType(1);
                                wrkMastExecute.setWrkSts(4);
                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                    log.error("穿梭板Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                }
@@ -6173,13 +6547,13 @@
                    } else {
                        //调车  == > endRow
                        if (jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        wrkMastExecute.setWrkSts(2);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
@@ -6234,6 +6608,26 @@
            return true;
        }catch (Exception e){
            log.error("平衡车Rgv命令下发失败,Rgv号={},任务数据={},RGV4={},RGV5={}", wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(RGV4), JSON.toJSON(RGV5));
        }
        return false;
    }
    /*
     * Rgv  动作  取货完成复位
     * */
    public synchronized boolean jarRgvGetFuTake(WrkMastExecute wrkMastExecute,boolean RGV6){
        try {
            StaProtocol staProtocol = new StaProtocol();
            staProtocol.setSiteId(wrkMastExecute.getRgvId());
            staProtocol.setRGV6(RGV6);
            // 下发站点信息
            if (!MessageQueue.offer(SlaveType.Devp, 2, new Task(11, staProtocol))) {
                log.error("平衡车Rgv命令下发失败,堆垛机号={},任务数据={},下发数据={}", wrkMastExecute.getRgvId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocol));
                return false;
            }
            return true;
        }catch (Exception e){
            log.error("平衡车Rgv命令下发失败,Rgv号={},任务数据={},RGV6={}", wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(RGV6));
        }
        return false;
    }
@@ -6347,10 +6741,11 @@
                                        //ste任务完成
                                        if (jarSteTake(wrkMastExecute,null,null,null,true)){
                                            wrkMastExecute.setWrkSts(4);
                                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                                log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                        wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                            }
                                            return true;
                                        }
                                    }
                                    log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}",
@@ -6368,10 +6763,11 @@
                                            //ste任务完成
                                            if (jarSteTake(wrkMastExecute,null,null,null,true)){
                                                wrkMastExecute.setWrkSts(6);
                                                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                                    log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                                }
                                                return true;
                                            }
                                        }
                                        log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}",
@@ -6392,10 +6788,11 @@
                                        //ste任务完成
                                        if (jarSteTake(wrkMastExecute,null,null,null,true)){
                                            wrkMastExecute.setWrkSts(4);
                                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                                log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                        wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                            }
                                            return true;
                                        }
                                    }
                                    log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}",
@@ -6411,10 +6808,11 @@
                                        //ste任务完成
                                        if (jarSteTake(wrkMastExecute,null,null,null,true)){
                                            wrkMastExecute.setWrkSts(2);
                                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                                log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                        wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                            }
                                            return true;
                                        }
                                    }
                                    log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}",
@@ -6478,13 +6876,13 @@
                        && jarProtocol.rightDoorOpen!=1 && jarProtocol.rightDoorOpen!=3
                        && (jarProtocol.leftDoorOpen==2  || jarProtocol.rightDoorOpen==2)){
                    WrkMastExecute wrkMastExecuteSou = new WrkMastExecute();
                    wrkMastExecuteSou.setWrkType(3);
                    wrkMastExecuteSou.setWrkSts(3);
                    List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou);
                    if (wrkMastExecuteList.isEmpty()){
                        WrkMastExecute execute = new WrkMastExecute();
                        execute.setJarId(jarProtocol.getJarNo());
                        //直接关门
                        if (jarDoorTake(execute,JarTaskModeType.OPEN_THE_DOOR_COMPLETE)){
                        if (!jarDoorTake(execute,JarTaskModeType.OPEN_THE_DOOR_COMPLETE)){
                            log.error("硫化罐Jar命令下发失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    execute.getJarId(), JSON.toJSON(execute), JSON.toJSON(jarProtocol),sign);
                        }
@@ -6493,12 +6891,12 @@
                    for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
                        if (wrkMastExecute.getIoType() == 1 || wrkMastExecute.getIoType() == 3){
                            //直接关门
                            if (jarDoorTake(wrkMastExecute,JarTaskModeType.OPEN_THE_DOOR_COMPLETE)){
                            if (!jarDoorTake(wrkMastExecute,JarTaskModeType.OPEN_THE_DOOR_COMPLETE)){
                                log.error("硫化罐Jar命令下发失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkSts(4);
                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                log.error("平衡车Rgv命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                return false;
@@ -6512,13 +6910,13 @@
                        && jarProtocol.rightDoorClose!=1 && jarProtocol.rightDoorClose!=3
                        && (jarProtocol.leftDoorClose==2  || jarProtocol.rightDoorClose==2)){
                    WrkMastExecute wrkMastExecuteSou = new WrkMastExecute();
                    wrkMastExecuteSou.setWrkType(3);
                    wrkMastExecuteSou.setWrkSts(3);
                    List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou);
                    if (wrkMastExecuteList.isEmpty()){
                        WrkMastExecute execute = new WrkMastExecute();
                        execute.setJarId(jarProtocol.getJarNo());
                        //直接关门
                        if (jarDoorTake(execute,JarTaskModeType.CLOSE_THE_DOOR_COMPLETE)){
                        if (!jarDoorTake(execute,JarTaskModeType.CLOSE_THE_DOOR_COMPLETE)){
                            log.error("硫化罐Jar命令下发失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    execute.getJarId(), JSON.toJSON(execute), JSON.toJSON(jarProtocol),sign);
                        }
@@ -6527,12 +6925,12 @@
                    for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
                        if (wrkMastExecute.getIoType() == 2 || wrkMastExecute.getIoType() == 4){
                            //直接关门
                            if (jarDoorTake(wrkMastExecute,JarTaskModeType.CLOSE_THE_DOOR_COMPLETE)){
                            if (!jarDoorTake(wrkMastExecute,JarTaskModeType.CLOSE_THE_DOOR_COMPLETE)){
                                log.error("硫化罐Jar命令下发失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkSts(4);
                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                            if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                log.error("平衡车Rgv命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                        wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                return false;
@@ -6555,7 +6953,7 @@
    public synchronized boolean jarWrkMastExecuteGenerateRgvComplete1(Integer sign) {
        try{
            WrkMastExecute wrkMastExecuteSou = new WrkMastExecute();
            wrkMastExecuteSou.setWrkType(1);
            wrkMastExecuteSou.setWrkSts(1);
            List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou);
            for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
                if (wrkMastExecute.getIoType() == 9){
@@ -6584,7 +6982,7 @@
                if (staProtocolRGV.getNowRow() == staProtocolRGVEnd.getNowRow()
                        && staProtocolRGV.getNowRow() == SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId())){
                    wrkMastExecute.setWrkSts(2);
                    if (wrkMastExecuteService.updateById(wrkMastExecute)){
                    if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                        log.error("平衡车Rgv命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},平衡车Rgv数据={},sign={}",
                                wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocolRGV),sign);
                        return false;
@@ -6605,7 +7003,7 @@
    public synchronized boolean jarWrkMastExecuteGenerateRgvComplete2(Integer sign) {
        try{
            WrkMastExecute wrkMastExecuteSou = new WrkMastExecute();
            wrkMastExecuteSou.setWrkType(3);
            wrkMastExecuteSou.setWrkSts(3);
            wrkMastExecuteSou.setIoType(5);
            List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou);
            for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
@@ -6620,22 +7018,20 @@
                    continue;
                }
                StaProtocol staProtocolRGVEnd = devpThread.getStation().get(wrkMastExecute.getRgvEndId());
                if (staProtocolRGVEnd == null) {
                    continue;
                } else {
                    staProtocolRGVEnd = staProtocolRGVEnd.clone();
                }
                if (staProtocolRGVEnd == null) {
                    continue;
                }
                if (staProtocolRGV.getNowRow() == staProtocolRGVEnd.getNowRow()
                if ( staProtocolRGV.rgvBoolean(2)
                        && staProtocolRGV.getNowRow() == SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId())){
                    //调车  == > 取货完成复位
                    if (!jarRgvGetFuTake(wrkMastExecute,true)){
                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocolRGV),sign);
                        return true;
                    }
                    wrkMastExecute.setWrkSts(4);
                    if (wrkMastExecuteService.updateById(wrkMastExecute)){
                    if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                        log.error("平衡车Rgv命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},平衡车Rgv数据={},sign={}",
                                wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocolRGV),sign);
                        return false;
                        return true;
                    }
                    return true;
                }