#
lsh
2024-06-27 843adafd2eb2934e26a935e2de2b57a9e577d29a
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;
@@ -5403,7 +5514,7 @@
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkType(1);
                            wrkMastExecute.setWrkSts(1);
                            wrkMastExecute.setWrkSts(2);
                            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;
@@ -5520,7 +5631,7 @@
                                        wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkType(1);
                            wrkMastExecute.setWrkSts(1);
                            wrkMastExecute.setWrkSts(2);
                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
@@ -5641,6 +5752,7 @@
                                ,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);
@@ -5655,9 +5767,114 @@
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        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 +5924,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;
@@ -5765,7 +5982,117 @@
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        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 +6160,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;
@@ -5923,7 +6250,7 @@
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        wrkMastExecute.setWrkSts(2);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
@@ -5991,7 +6318,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;
@@ -6058,6 +6385,54 @@
    /**
     *  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());
        }
        return false;
    }
    /**
     *  JarWrkMastExecute任务==>下发 //完成
     *  10:A=>B\11:B=>A
     *  任务下发
     */
@@ -6089,7 +6464,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;
@@ -6178,7 +6553,7 @@
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(1);
                        wrkMastExecute.setWrkSts(2);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
@@ -6234,6 +6609,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;
    }
@@ -6478,7 +6873,7 @@
                        && 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();
@@ -6512,7 +6907,7 @@
                        && 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();
@@ -6555,7 +6950,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){
@@ -6605,7 +7000,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){
@@ -6631,6 +7026,12 @@
                }
                if (staProtocolRGV.getNowRow() == staProtocolRGVEnd.getNowRow()
                        && 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 false;
                    }
                    wrkMastExecute.setWrkSts(4);
                    if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        log.error("平衡车Rgv命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},平衡车Rgv数据={},sign={}",