#
yxFwq
2024-07-10 8bec7ee843170eb04f0da49ffc8c5c5d889a87fd
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -23,6 +23,7 @@
import com.zy.common.utils.RgvUtils;
import com.zy.core.CrnThread;
import com.zy.core.DevpThread;
import com.zy.core.Slave;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.*;
@@ -54,6 +55,8 @@
public class MainServiceImpl {
    public static final long COMMAND_TIMEOUT = 5 * 1000;
//    private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}};
    private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}};
    @Autowired
    private CommonService commonService;
@@ -1672,7 +1675,7 @@
            crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 目标库位列
            crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层
            if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
            } else {
//                long startTime = System.currentTimeMillis();
@@ -1844,7 +1847,7 @@
            crnCommand.setDestinationPosY((short)0);     // 目标库位列
            crnCommand.setDestinationPosZ((short)0);     // 目标库位层
            if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
            } else {
                // 修改工作档状态 2.设备上走 => 3.吊车入库中
                Date now = new Date();
@@ -1985,7 +1988,7 @@
            crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 目标库位列
            crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层
            if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
            } else {
                // 修改工作档状态 2.设备上走 => 3.吊车入库中
                Date now = new Date();
@@ -2142,7 +2145,7 @@
            crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 目标库位列
            crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层
            if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
            } else {
                // 修改工作档状态 2.设备上走 => 3.吊车入库中
                Date now = new Date();
@@ -2277,7 +2280,7 @@
                    crnCommand.setDestinationPosY(crnStn.getBay().shortValue());     // 目标库位列
                    crnCommand.setDestinationPosZ(crnStn.getLev().shortValue());     // 目标库位层
                    if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
                    } else {
                        // 修改工作档状态 11.生成出库ID => 12.吊车出库中
                        Date now = new Date();
@@ -2443,7 +2446,7 @@
                crnCommand.setDestinationPosY(crnStn.getBay().shortValue());     // 目标库位列
                crnCommand.setDestinationPosZ(crnStn.getLev().shortValue());     // 目标库位层
                if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
                    log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                    log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
                } else {
                    // 修改工作档状态 11.生成出库ID => 12.吊车出库中
                    Date now = new Date();
@@ -2563,7 +2566,7 @@
                    crnCommand.setDestinationPosY(crnStn.getBay().shortValue());     // 目标库位列
                    crnCommand.setDestinationPosZ(crnStn.getLev().shortValue());     // 目标库位层
                    if (!MessageQueue.offer(SlaveType.Crn, wrkMastCrn.getCrnNo(), new Task(2, crnCommand))) {
                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMastCrn.getCrnNo(), JSON.toJSON(crnCommand));
                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMastCrn.getCrnNo(), JSON.toJSONString(crnCommand));
                    } else {
                        // 修改工作档状态 11.生成出库ID => 12.吊车出库中
                        Date now = new Date();
@@ -2764,7 +2767,7 @@
                    crnCommand.setDestinationPosY((short)0);     // 目标库位列
                    crnCommand.setDestinationPosZ((short)0);     // 目标库位层
                    if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
                    } else {
                        // 修改工作档状态 11.生成出库ID => 12.吊车出库中
                        Date now = new Date();
@@ -2808,7 +2811,7 @@
//                    crnCommand.setDestinationPosY((short)0);     // 目标库位列
//                    crnCommand.setDestinationPosZ((short)0);     // 目标库位层
//                    if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
//                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
//                        log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
//                    } else {
//                        // 修改工作档状态 11.生成出库ID => 12.吊车出库中
//                        Date now = new Date();
@@ -2896,7 +2899,7 @@
        crnCommand.setDestinationPosY(sta.getBay1().shortValue());     // 目标库位列
        crnCommand.setDestinationPosZ(sta.getLev1().shortValue());     // 目标库位层
        if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
            log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand));
            log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand));
        } else {
            // 修改工作档状态 11.生成出库ID => 12.吊车出库中
            Date now = new Date();
@@ -4374,7 +4377,7 @@
            crnCommand.setDestinationPosY((short)0);     // 目标库位列
            crnCommand.setDestinationPosZ((short)0);     // 目标库位层
            if (!MessageQueue.offer(SlaveType.Crn, wrkMastSplitTwin.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMastSplitTwin.getCrnNo(), JSON.toJSON(crnCommand));
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMastSplitTwin.getCrnNo(), JSON.toJSONString(crnCommand));
                return false;
            } else {
                return true;
@@ -4403,7 +4406,7 @@
            crnCommand.setDestinationPosY(wrkMastSplitTwin.getEndBay().shortValue());     // 目标库位列
            crnCommand.setDestinationPosZ(wrkMastSplitTwin.getEndLev().shortValue());     // 目标库位层
            if (!MessageQueue.offer(SlaveType.Crn, wrkMastSplitTwin.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) {
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMastSplitTwin.getCrnNo(), JSON.toJSON(crnCommand));
                log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMastSplitTwin.getCrnNo(), JSON.toJSONString(crnCommand));
                return false;
            } else {
                return true;
@@ -4418,6 +4421,9 @@
     */
    public synchronized void jarMastGenerate() {
        for (JarSlave jarSlave : slaveProperties.getJar()) {
            if (jarSlave.getId()>4){
                continue;
            }
            try{
                if (wrkMastExecuteService.getWrkMastExecuteByJarIdCount(jarSlave.getId())!=0){
                    continue;
@@ -4478,11 +4484,12 @@
                            if (!Cools.isEmpty(wrkMastExecute)){
                                continue;
                            }
                            log.error("Jar任务创建  初始===>行={}",4484);
                            if (jarMastGenerateExecute(jarSlave,wrkMast,jarLocDigit,staStn.getStaNo())){
                                return;
                            }
                        }catch (Exception e){
                            log.error(jarSlave.getId()+"号小车复位线程报错!"+e);
                            log.error(jarSlave.getId()+"号硫化罐Jar任务创建异常!"+e);
                        }
                        break;
                    }
@@ -4507,6 +4514,14 @@
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            if (jarProtocol.statusType .equals(JarStatusType.SOS)){
                log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                return false;
            }
            JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
            JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
@@ -4529,7 +4544,8 @@
            //自动、空闲、右门关闭、   Other左门关闭
            if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
                    && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                if (jarProtocol.statusType == JarStatusType.IDLE || jarProtocol.statusType == JarStatusType.MOVING){
                if (jarProtocol.statusType != JarStatusType.SOS){
                    log.error("Jar任务创建===》执行===>行={}",4537);
                    BasJarMast basJarMast = new BasJarMast(basJar, wrkMast, jarLocDigit);
                    basJarMast.setJarEnterStaNo(staNo);//入硫化罐站点
                    basJarMastService.insert(basJarMast);
@@ -4544,35 +4560,36 @@
    }
    /**
     *  Jar任务完成   //未完成
     *  Jar任务完成   //完成
     */
    public synchronized boolean jarMastGenerateComplete(JarSlave jarSlave) {
    public synchronized boolean jarMastGenerateComplete() {
        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){
            for (int[] ex : execute){
                try{
                    WrkMastExecute wrkMastExecuteSou = new WrkMastExecute();
                    wrkMastExecuteSou.setIoType(ex[0]);
                    wrkMastExecuteSou.setWrkSts(ex[1]);
                    wrkMastExecuteSou.setWrkType(1);
                    List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou);
                    for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
                        log.error("Jar任务完成===>行={}",4564);
                        BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo());
                        jarMastByWrkNo.setStatus(jarMastByWrkNo.getStatusComplete());
                        if (!basJarMastService.updateById(jarMastByWrkNo)){
                            log.error("硫化区域分段任务完成异常,BasJarMast={},异常信息={}",JSON.toJSONString(jarMastByWrkNo),"更新basJarMast失败");
                        }
                        wrkMastExecute.setWrkSts(wrkMastExecute.getWrkStsComplete());
                        wrkMastExecute.setWrkType(2);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化区域分段任务完成异常,wrkMastExecute={},异常信息={}",JSON.toJSONString(wrkMastExecute),"更新wrkMastExecute失败");
                        }
                    }
                }catch (Exception e){
                    log.error("硫化区域分段任务完成异常,execute={},异常信息={}",JSON.toJSONString(ex),e.getMessage());
                }
            }
        } catch (Exception e){
//            log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2);
            log.error("硫化区域分段任务完成异常,异常信息={}",e.getMessage());
        }
        return false;
    }
@@ -4594,10 +4611,13 @@
                default:
                    jarWrkMastExecuteGenerateSte(signExecute,sign);//小车移动
            }
            if (!signExecute[0] && !signExecute[1]){
                //Ste移动
                jarMastMove();
            }
        } catch (Exception e){
            log.error("硫化区域分段任务创建异常,异常信息={}",e.getMessage());
        }
    }
    public synchronized boolean[] jarWrkMastExecuteGenerateJar(boolean[] signExecute,Integer sign) {
@@ -4615,6 +4635,10 @@
                    continue;
                }
                if (jarProtocol.modeType != JarModeType.AUTO){
                    continue;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    continue;
                }
@@ -4692,6 +4716,10 @@
                    signExecute[jarSlave.getId()-5] = true;
                    continue;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    continue;
                }
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
@@ -4701,13 +4729,11 @@
                //门作业  无
                //自动、空闲、右门关闭、   Other左门关闭
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0){
                    switch (sign){
                        case 5:
                            if (jarWrkMastExecuteGenerate5(jarSlave,sign)){
                                signExecute[jarSlave.getId()-5] = true;
                                break;//出硫化罐 ===》 入冷却槽
                            }
                    if (jarWrkMastExecuteGenerate5(jarSlave,sign)){
                        signExecute[jarSlave.getId()-5] = true;
                        //出硫化罐 ===》 入冷却槽
                    }
                    return signExecute;
                }
            } catch (Exception e){
                log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage());
@@ -4736,6 +4762,10 @@
                    continue;
                }
                if (jarProtocol.modeType != JarModeType.AUTO){
                    continue;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    continue;
                }
@@ -4787,10 +4817,10 @@
                add(2);
            }});
            //判断小车状态
            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1,SteStatusType.IDLE)){
                return false;
            }
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1,SteStatusType.IDLE)){
//                return false;
//            }
            for (BasJarMast basJarMast : basJarMastList){
                JarSlave.StaStn staStn = null;
@@ -4829,7 +4859,13 @@
                        if (jarProtocol.modeType != JarModeType.AUTO){
                            return false;
                        }
                        if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){
                            return false;
                        }
                        if (jarProtocol.getJarTemperature()>50){
                            log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                            continue;
                        }
                        JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
                        JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
                        if (jarOtherProtocol == null) {
@@ -4855,15 +4891,16 @@
                                    log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast));
                                }
                                return true;
                            } else if ((jarProtocol.statusType == JarStatusType.WAITING3 || jarProtocol.statusType == JarStatusType.MOVING) && jarProtocol.isLeftDoor()){
                            } else if (jarProtocol.isLeftDoor()){
                                //生成入硫化罐任务
                                if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMast,basJar.getJarNo(),new int[]{basJar.getEnterSteNo(),basJar.getEnterRgvNo(),5,1})){
                                    log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast));
                                }
                                return true;
                            } else if (jarProtocol.statusType == JarStatusType.IDLE && jarProtocol.isLeftDoor()){
                                log.error("JarWrkMastExecute任务创建===>执行异常===》硫化罐空闲但是门未关===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast));
                            }
//                            else if (jarProtocol.statusType == JarStatusType.IDLE && jarProtocol.isLeftDoor()){
//                                log.error("JarWrkMastExecute任务创建===>执行异常===》硫化罐空闲但是门未关===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast));
//                            }
                        }
                        return false;
                    } else {
@@ -4899,10 +4936,10 @@
            if (Cools.isEmpty(basJarMastSign)){
                return false;
            }
            //判断小车状态
            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1,SteStatusType.IDLE)){
                return false;
            }
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1,SteStatusType.IDLE)){
//                return false;
//            }
            JarSlave.RgvStn rgvStn = jarSlave.getJarInRgv().get(0);
@@ -4917,6 +4954,14 @@
                    return false;
                }
                if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){
                    log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                    return false;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    return false;
                }
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -4971,10 +5016,10 @@
            if (Cools.isEmpty(basJarMastSign)){
                return false;
            }
            //判断小车状态
            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),2,SteStatusType.IDLE)){
                return false;
            }
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),2,SteStatusType.IDLE)){
//                return false;
//            }
            //判断RGV状态
            JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0);
@@ -4990,6 +5035,14 @@
                    return false;
                }
                if (jarProtocol.statusType .equals(JarStatusType.SOS)){
                    log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                    return false;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    return false;
                }
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -5037,14 +5090,14 @@
                return false;
            }
            BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMax(jarSlave.getId(),8,8);
            BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMin(jarSlave.getId(),8,8);
            if (Cools.isEmpty(jarMastByJarIdMin)){
                return false;
            }
            //判断小车状态
            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2,SteStatusType.IDLE)){
                return false;
            }
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2,SteStatusType.IDLE)){
//                return false;
//            }
            //判断RGV状态
            JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0);
@@ -5060,6 +5113,11 @@
                    return false;
                }
                if (jarProtocol.statusType .equals(JarStatusType.SOS)){
                    log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                    return false;
                }
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -5067,12 +5125,18 @@
                }
                //门作业  无
                if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING4 && jarProtocol.jarErr==0
                        && !jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
//                if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING4 && jarProtocol.jarErr==0
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
                        && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    //关进料门
                    if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByJarIdMin,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),3,1})){
                    //入冷却槽
                    if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByJarIdMin,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),6,1})){
                        log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByJarIdMin));
                    }
                    jarMastByJarIdMin.setStatus(jarMastByJarIdMin.getStatusComplete());
                    if (!basJarMastService.updateById(jarMastByJarIdMin)){
                        log.error("JarWrkMastExecute任务创建===>jarMastByJarIdMin更新失败===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByJarIdMin));
                    }
                    return true;
                }
@@ -5096,26 +5160,26 @@
            if (wrkMastExecuteService.getWrkMastExecuteByJarIdCount(jarSlave.getId())!=0){
                return false;
            }
            List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
                add(14);//冷却完成
            List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusListB(jarSlave.getId(), new ArrayList<Integer>() {{
                add(12);//冷却完成
            }});
            if (basJarMastList.isEmpty()){
                return false;
            }
            if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),7)!=0){
            if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),6)!=0){
                return false;
            }
            BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMin(jarSlave.getId(),14,14);
            BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMinB(jarSlave.getId(),12,12);
            if (Cools.isEmpty(jarMastByJarIdMin)){
                return false;
            }
            //判断小车状态
            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2,SteStatusType.IDLE)){
                return false;
            }
//
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),3,SteStatusType.IDLE)){
//                return false;
//            }
            //判断RGV状态
            JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0);
@@ -5130,7 +5194,10 @@
                if (jarProtocol.modeType != JarModeType.AUTO){
                    return false;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    return false;
                }
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -5139,8 +5206,8 @@
                //门作业  无
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0){
                    //关进料门
                    if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByJarIdMin,basJar.getBurial(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),3,1})){
                    //冷却完成上输送线
                    if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByJarIdMin,basJar.getBurial(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),9,1})){
                        log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByJarIdMin));
                    }
                    return true;
@@ -5263,6 +5330,25 @@
        return false;
    }
    /**
     *  JarWrkMastExecute任务创建===>执行   //完成
     */
    public synchronized boolean jarWrkMastExecuteGenerateExecuteMove(BasJar basJar,BasJarMast basJarMast,Integer id,int[] digit) {
        try {
            WrkMastExecute wrkMastExecute = new WrkMastExecute(basJarMast);
            wrkMastExecute.setJarId(id);
            wrkMastExecute.setSteId(digit[0]);//穿梭板ID
            wrkMastExecute.setRgvId(basJar.getEnterRgvNo());//RGV ID  enter
            wrkMastExecute.setRgvEndId(basJar.getOutRgvNo());//RGV ID  out
            wrkMastExecute.setIoType(digit[2]);//任务类型 0: 未知  1: 开进料门  2: 关进料门  3: 开出料门  4: 关出料门  5: 入硫化罐  6: 入冷却槽  7: 穿梭车进冷却槽  8: 穿梭车离开冷却槽  9: 出冷却槽 10:A=>B 11:B=>A
            wrkMastExecute.setType(digit[3]);//设备  0: 未知  1: 硫化罐  2: 冷却槽  3: 硫化罐==>冷却槽
            return wrkMastExecuteService.insert(wrkMastExecute);
        } catch (Exception e) {
            log.error("JarWrkMastExecute任务创建===>执行异常===》异常原因:"+e.getMessage());
        }
        return false;
    }
    /*
    * JarWrkMastExecute任务创建==>下发
    * Action
@@ -5280,6 +5366,9 @@
        try{
            List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, null,0);
            for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){
                if (wrkMastExecute.getWrkSts()!=0){
                    continue;
                }
                /*
                * 任务类型 0: 未知
                * 1: 开进料门  2: 关进料门  3: 开出料门  4: 关出料门
@@ -5289,46 +5378,47 @@
                * 9: 出冷却槽
                * 10:A=>B 11:B=>A
                * */
                log.error("JarWrkMastExecute任务创建==>下发===>行={}",5326);
                switch (wrkMastExecute.getIoType()){
                    case 1://1: 开进料门
                    case 3://3: 开出料门
                        if (jarWrkMastExecuteActionExecute1(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                        continue;
                    case 2:
                    case 4:
                        if (jarWrkMastExecuteActionExecute2(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                        continue;
                    case 5:
                        if (jarWrkMastExecuteActionExecute5(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                        continue;
                    case 6:
                        if (jarWrkMastExecuteActionExecute6(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                        continue;
                    case 7:
                    case 8:
                        if (jarWrkMastExecuteActionExecute7(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                        continue;
                    case 9:
                        if (jarWrkMastExecuteActionExecute9(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                        continue;
                    case 10:
                    case 11:
                        if (jarWrkMastExecuteActionExecute10(wrkMastExecute,sign)){
                            break;
                        }
                        return;
                        continue;
                }
            }
        } catch (Exception e){
@@ -5447,10 +5537,12 @@
    public synchronized boolean jarWrkMastExecuteActionExecute1(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
            if (wrkMastExecuteByJarNo.size()!=1
                    || !wrkMastExecuteByJarNo.get(0).getIoType().equals(wrkMastExecute.getIoType())
                    || !wrkMastExecuteByJarNo.get(0).getWrkSts().equals(wrkMastExecute.getWrkSts())
                    || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo()) ){
                return false;
            }
            // 获取硫化罐信息
            JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, wrkMastExecute.getJarId());
            JarProtocol jarProtocol = jarThread.getJarProtocol();
@@ -5460,7 +5552,14 @@
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            if (jarProtocol.statusType .equals(JarStatusType.SOS)){
                log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                return false;
            }
            BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
            if (Cools.isEmpty(basJar)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -5496,9 +5595,9 @@
            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);
                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                    }
                    return true;
                }
@@ -5506,40 +5605,41 @@
                //自动、空闲、  进料们关闭需打开
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    log.error("1、3开进料门==>任务下发===>行={}",5546);
                    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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkType(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);
                                        wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                        wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                            }
                        }
                    }else if (jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()){
                        //直接完成
                        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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                    }
@@ -5564,7 +5664,10 @@
    public synchronized boolean jarWrkMastExecuteActionExecute2(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
            if (wrkMastExecuteByJarNo.size()!=1
                    || !wrkMastExecuteByJarNo.get(0).getIoType().equals(wrkMastExecute.getIoType())
                    || !wrkMastExecuteByJarNo.get(0).getWrkSts().equals(wrkMastExecute.getWrkSts())
                    || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo()) ){
                return false;
            }
@@ -5577,7 +5680,14 @@
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){
                log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                return false;
            }
            BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
            if (Cools.isEmpty(basJar)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -5613,9 +5723,9 @@
            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);
                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                    }
                    return true;
                }
@@ -5623,41 +5733,42 @@
                //自动、空闲、  进料们打开需关闭
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    log.error("2、4:关门==>任务下发===>行={}",5667);
                    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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                            }
                            wrkMastExecute.setWrkType(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);
                                        wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                        wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                            }
                        }
                    } else if (!jarProtocol.isLeftDoor() && !jarProtocol.isRightDoor()){
                        //直接完成
                        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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                    }
                    return true;
@@ -5681,7 +5792,10 @@
    public synchronized boolean jarWrkMastExecuteActionExecute5(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
            if (wrkMastExecuteByJarNo.size()!=1
                    || !wrkMastExecuteByJarNo.get(0).getIoType().equals(wrkMastExecute.getIoType())
                    || !wrkMastExecuteByJarNo.get(0).getWrkSts().equals(wrkMastExecute.getWrkSts())
                    || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo()) ){
                return false;
            }
@@ -5694,17 +5808,19 @@
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){
                log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                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());
@@ -5726,13 +5842,12 @@
            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);
                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                    }
                    return true;
                }
@@ -5740,37 +5855,38 @@
                //自动、空闲、  进料们打开需关闭
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    log.error("5:入硫化罐==>任务下发===>行={}",5667);
                    //判断小车状态  //入硫化罐小车可临时屏蔽
                    if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                        return false;
                    }
                    if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                        //判断小车状态
                        if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                            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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                    }
                    return true;
@@ -5794,7 +5910,7 @@
     */
    public synchronized boolean jarWrkMastExecuteActionExecute5Three(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecute);
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
                return false;
            }
@@ -5808,7 +5924,14 @@
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){
                log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                return false;
            }
            BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
            if (Cools.isEmpty(basJar)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -5841,12 +5964,13 @@
                return false;
            }
            if (staProtocolRGV.rgvBoolean(2) && staProtocolRGVOther.rgvBoolean(1)){
            if (staProtocolRGV.rgvBoolean(2) && staProtocolRGVOther.rgvBoolean(1)){//临时
//            if (staProtocolRGV.rgvBoolean(2)){
                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);
                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                    }
                    return true;
                }
@@ -5854,6 +5978,7 @@
                //自动、空闲、  进料们打开需关闭
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    log.error("io_type==>5:入硫化罐  :  wrkSts  ==>4:rgv取货完成==>任务下发===>行={}",5898);
                    if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                        //判断小车状态
@@ -5861,21 +5986,21 @@
                            return false;
                        }
                        //调车  == > 取货
                        if (jarSteTake(wrkMastExecute,SteLocaType.POINT20.id,SteLocaType.POINT22.id,SteTaskModeType.STE_WFFH_13,false)){
                        if (!jarSteTake(wrkMastExecute,SteLocaType.POINT20.id,SteLocaType.POINT22.id,SteTaskModeType.STE_WFFH_13,false,wrkMastExecute.getJarId())){
                            log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(5);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                    }
                    return true;
@@ -5899,7 +6024,10 @@
    public synchronized boolean jarWrkMastExecuteActionExecute6(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
            if (wrkMastExecuteByJarNo.size()!=1
                    || !wrkMastExecuteByJarNo.get(0).getIoType().equals(wrkMastExecute.getIoType())
                    || !wrkMastExecuteByJarNo.get(0).getWrkSts().equals(wrkMastExecute.getWrkSts())
                    || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo()) ){
                return false;
            }
@@ -5912,17 +6040,19 @@
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            if (jarProtocol.statusType .equals(JarStatusType.SOS)){
                log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                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());
@@ -5945,12 +6075,13 @@
                return false;
            }
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){ //临时
//            if ( 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);
                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                    }
                    return true;
                }
@@ -5958,34 +6089,36 @@
                //自动、空闲、
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    log.error("6:入冷却槽==>任务下发===>行={}",6002);
                    //判断小车状态
                    if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                        return false;
                    }
                    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)){
                        if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT21.id,SteTaskModeType.STE_WFQH_12,false,wrkMastExecute.getJarId())){
                            log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                    }
                    return true;
@@ -6008,7 +6141,7 @@
     */
    public synchronized boolean jarWrkMastExecuteActionExecute6Three(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecute);
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
                return false;
            }
@@ -6023,6 +6156,14 @@
                return false;
            }
            if (jarProtocol.statusType .equals(JarStatusType.SOS)){
                log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                return false;
            }
            BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
            if (Cools.isEmpty(basJar)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -6055,12 +6196,13 @@
                return false;
            }
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){ //临时
//            if (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);
                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                    }
                    return true;
                }
@@ -6068,35 +6210,36 @@
                //自动、空闲、
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0){
                    log.error("6:入冷却槽 Three==>任务下发===>行={}",6115);
                    if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                        //判断小车状态
                        if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                        if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.WAITING2)){
                            return false;
                        }
                        //调车  == > 取货
                        if (jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT21.id,SteTaskModeType.STE_WFQH_12,false)){
                        if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT25.id,SteTaskModeType.STE_WFFH_13,false,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                            log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(1);
                        wrkMastExecute.setWrkSts(3);
                        if (wrkMastExecuteService.updateById(wrkMastExecute)){
                        wrkMastExecute.setWrkSts(5);
                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                    } else {
                        //调车  == > endRow
                        if (jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                        if (!jarRgvMoveTake(wrkMastExecute,1)){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                        }
//                        wrkMastExecute.setWrkType(1);
//                        wrkMastExecute.setWrkSts(2);
//                        if (!wrkMastExecuteService.updateById(wrkMastExecute)){
//                            log.error("硫化罐Jar命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}",
//                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
//                        }
                    }
                    return true;
                }
@@ -6113,12 +6256,13 @@
    /**
     *  JarWrkMastExecute任务==>下发 //完成
     *  7:穿梭车进冷却槽\8:穿梭车离开冷却槽
     *  7:穿梭车进冷却槽   7  B=>C
     *  8:穿梭车离开冷却槽  8 C=>B
     *  任务下发
     */
    public synchronized boolean jarWrkMastExecuteActionExecute7(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecute);
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
                return false;
            }
@@ -6132,7 +6276,10 @@
            if (jarProtocol.modeType != JarModeType.AUTO){
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                return false;
            }
            BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
            if (Cools.isEmpty(basJar)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -6184,9 +6331,9 @@
            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);
                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                    }
                    return true;
                }
@@ -6196,64 +6343,64 @@
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0
                        && jarProtocolOther.isLeftDoor() && jarProtocolOther.isRightDoor()
                ){
                    log.error("7:穿梭车进冷却槽   7  B=>C//8:穿梭车离开冷却槽  8 C=>B Three==>任务下发===>行={}",6245);
                    if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocolOther.getJarNo())){
                        //判断小车状态
                        if (wrkMastExecute.getIoType()==7){
                            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                        if (wrkMastExecute.getIoType()==7){  //7  B=>C
                            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_MOVE_14,false,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                                    log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                                }
                            } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){
                            } 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);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                                }
                            }
                        } else {
                            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){
                        } else { //8 C=>B
                            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_MOVE_14,false,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                                    log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                                }
                            } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                            } 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);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                    }
                    return true;
@@ -6277,7 +6424,10 @@
    public synchronized boolean jarWrkMastExecuteActionExecute9(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
            if (wrkMastExecuteByJarNo.size()!=1
                    || !wrkMastExecuteByJarNo.get(0).getIoType().equals(wrkMastExecute.getIoType())
                    || !wrkMastExecuteByJarNo.get(0).getWrkSts().equals(wrkMastExecute.getWrkSts())
                    || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo()) ){
                return false;
            }
@@ -6290,7 +6440,10 @@
//            if (jarProtocol.modeType != JarModeType.AUTO){
//                return false;
//            }
//            if (jarProtocol.getJarTemperature()>50){
//                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
//                return false;
//            }
            BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId());
            if (Cools.isEmpty(basJar)){
                log.error("{}号冷却槽查询设备档案无信息!!!",wrkMastExecute.getJarId());
@@ -6347,7 +6500,7 @@
//                    //移走  == > 2
//                    if (jarRgvTake(wrkMastExecute,2)){
//                        log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
//                                wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
//                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
//                    }
//                    return true;
//                }
@@ -6358,16 +6511,18 @@
//                ){
                    //判断小车状态
                    if (jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),3,SteStatusType.IDLE)){
                        log.error("9:出冷却槽==>任务下发===>行={}",6410);
                        //调车  == > 取货
                        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,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                            log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},冷却槽数据={},sign={}",
                                    wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(basJar),sign);
                                    wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                    wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(basJar),sign);
                        }
                    }
                    return true;
@@ -6391,7 +6546,10 @@
    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())){
            if (wrkMastExecuteByJarNo.size()!=1
                    || !wrkMastExecuteByJarNo.get(0).getIoType().equals(wrkMastExecute.getIoType())
                    || !wrkMastExecuteByJarNo.get(0).getWrkSts().equals(wrkMastExecute.getWrkSts())
                    || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo()) ){
                return false;
            }
@@ -6411,17 +6569,18 @@
            //判断STE小车状态
            if (jarWrkMastExecuteGenerateSteStatus(wrkMastExecute.getSteId(),3,SteStatusType.IDLE)){
                log.error("9:出冷却槽Two==>任务下发===>行={}",6468);
                // 下发站点信息
                staProtocol.setWorkNo(wrkMastExecute.getWrkNo().intValue());
                staProtocol.setStaNo(staProtocol.getStaNo());
                staProtocol.setStaNo(wrkMastExecute.getOutStaNo());
                if (!MessageQueue.offer(SlaveType.Devp, 2, new Task(2, staProtocol))) {
                    return false;
                }
                wrkMastExecute.setWrkType(1);
                wrkMastExecute.setWrkSts(3);
                if (wrkMastExecuteService.updateById(wrkMastExecute)){
                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                    log.error("输送线出库目标站命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},放货站点数据={},sign={}",
                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocol),sign);
                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(staProtocol),sign);
                }
            }
            return true;
@@ -6438,7 +6597,7 @@
     */
    public synchronized boolean jarWrkMastExecuteActionExecute10(WrkMastExecute wrkMastExecute,Integer sign) {
        try{
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.getWrkMastExecuteByJarNo(wrkMastExecute.getJarId());
            List<WrkMastExecute> wrkMastExecuteByJarNo = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecute);
            if (wrkMastExecuteByJarNo.size()!=1 || !wrkMastExecuteByJarNo.get(0).getWrkNo().equals(wrkMastExecute.getWrkNo())){
                return false;
            }
@@ -6453,6 +6612,14 @@
                return false;
            }
            if (jarProtocol.statusType .equals(JarStatusType.SOS)){
                log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                return false;
            }
            if (jarProtocol.getJarTemperature()>50){
                log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                return false;
            }
            BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
            if (Cools.isEmpty(basJar)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
@@ -6485,12 +6652,13 @@
                return false;
            }
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){
            if (staProtocolRGV.rgvBoolean(1) && staProtocolRGVOther.rgvBoolean(1)){ //临时
//            if ( 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);
                                wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                    }
                    return true;
                }
@@ -6499,64 +6667,64 @@
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor()
                        && jarProtocol.leftDoorOpen==0  && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0  && jarProtocol.rightDoorClose==0
                ){
                    log.error("10:A=>B\\11:B=>A==>任务下发===>行={}",6558);
                    if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                        //判断小车状态
                        if (wrkMastExecute.getIoType()==10){
                            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                        if (wrkMastExecute.getIoType()==10){//10:A=>B
                            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_MOVE_14,false,wrkMastExecute.getJarId())){
                                    log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                                }
                            } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                            } 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);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                                }
                            }
                        } else {
                            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                        } else {//11:B=>A
                            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_MOVE_14,false,wrkMastExecute.getJarId())){
                                    log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                                }
                            } else if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1,SteStatusType.IDLE)){
                            } 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);
                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(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.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                        wrkMastExecute.setWrkType(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);
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
                    }
                    return true;
@@ -6636,15 +6804,19 @@
    /*
     * Ste  动作
     * */
    public synchronized boolean jarSteTake(WrkMastExecute wrkMastExecute,Integer startLoad,Integer endLoad,SteTaskModeType steTaskModeType,boolean complete){
    public synchronized boolean jarSteTake(WrkMastExecute wrkMastExecute,Integer startLoad,Integer endLoad,SteTaskModeType steTaskModeType,boolean complete,Integer siteId){
        try {
            SteCommand steCommand = new SteCommand();
            steCommand.setTaskNo(wrkMastExecute.getWrkNo().intValue());
            steCommand.setSteNo(wrkMastExecute.getSteId());
            steCommand.setStartLoad(startLoad);
            steCommand.setEndLoad(endLoad);
            steCommand.setTaskModeType(steTaskModeType);
            steCommand.setComplete(complete);
            steCommand.setJarNo(wrkMastExecute.getJarId().shortValue());
            if (!complete){
                steCommand.setTaskMode(steTaskModeType.id.shortValue());
            }
            steCommand.setJarNo(siteId.shortValue());
            if (!MessageQueue.offer(SlaveType.Ste, steCommand.getSteNo(), new Task(2, steCommand))) {
                log.error("穿梭车Ste命令下发失败,堆垛机号={},任务数据={},下发数据={},complete={}", steCommand.getSteNo(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steCommand),complete);
                return false;
@@ -6676,7 +6848,7 @@
    }
    /**
     *  JarWrkMastExecute任务完成   //未完成
     *  JarWrkMastExecute任务完成   //完成
     */
    public synchronized void jarWrkMastExecuteGenerateComplete(Integer sign) {
        try{
@@ -6709,7 +6881,7 @@
                    return;
            }
        }catch (Exception e){
            log.error("小车复位线程报错!"+e);
            log.error("JarWrkMastExecute任务完成报错!"+e);
        }
    }
@@ -6728,102 +6900,104 @@
                    continue;
                }
                if (steProtocol.getMode()==(short)1 && steProtocol.taskNo!=0 && steProtocol.getChargeStatus()==0){
                    if (steProtocol.statusType.equals(SteStatusType.WAITING)){
                    }
                    WrkMastExecute wrkMastExecute = wrkMastExecuteService.getWrkMastExecuteByWrkNo(steProtocol.getTaskNo().longValue());
                    if (!Cools.isEmpty(wrkMastExecute)){
                        switch (wrkMastExecute.getIoType()){
                            case 6:
                                if (wrkMastExecute.getWrkSts()==3){//==>4
                                    //1:RGV小车移动、2:RGV小车到位、3:Ste穿梭版取货、4:取货完成等待下一步、5:Ste穿梭版放货至冷却池、6:放货完成、7:更新完成   //io_type = 6
                                    //ste任务等待完成
                                    if (steProtocol.statusType.equals(SteStatusType.WAITING2)){
                                        //ste任务完成
                                        if (jarSteTake(wrkMastExecute,null,null,null,true)){
                                            wrkMastExecute.setWrkSts(4);
                                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                                log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                        wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                            }
                                        }
                                    }
                                    log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                    return true;
                                }
                            case 5:
                                if (wrkMastExecute.getWrkSts()==5){
                                    //1:RGV小车移动、2:RGV小车到位、3:rgv取货、4:rgv取货完成、5:Ste穿梭版入硫化罐、6:入罐完成、7:更新完成   //io_type = 5
                                    //ste任务完成
//                    if (steProtocol.statusType.equals(SteStatusType.WAITING)){
//
//                    }
                    List<WrkMastExecute> wrkMastExecuteByWrkNoList = wrkMastExecuteService.getWrkMastExecuteByWrkNoList(steProtocol.getTaskNo().longValue());
                    for (WrkMastExecute wrkMastExecute : wrkMastExecuteByWrkNoList){
                        if (!Cools.isEmpty(wrkMastExecute)){
                            switch (wrkMastExecute.getIoType()){
                                case 6:
                                    if (wrkMastExecute.getWrkSts()==3){//==>4
                                        //1:RGV小车移动、2:RGV小车到位、3:Ste穿梭版取货、4:取货完成等待下一步、5:Ste穿梭版放货至冷却池、6:放货完成、7:更新完成   //io_type = 6
                                        //ste任务等待完成
                                        if (steProtocol.statusType.equals(SteStatusType.WAITING)){
                                            //ste任务完成
                                            if (jarSteTake(wrkMastExecute,null,null,null,true)){
                                            if (jarSteTake(wrkMastExecute,null,null,null,true,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                                                wrkMastExecute.setWrkSts(4);
                                                if (!wrkMastExecuteService.updateById(wrkMastExecute)){
                                                    log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                            wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                                }
                                                return true;
                                            }
                                        }
                                        log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(steProtocol),sign);
                                        return true;
                                    }
                                case 5:
                                    if (wrkMastExecute.getWrkSts()==5){
                                        //1:RGV小车移动、2:RGV小车到位、3:rgv取货、4:rgv取货完成、5:Ste穿梭版入硫化罐、6:入罐完成、7:更新完成   //io_type = 5
                                        //ste任务完成
                                        if (steProtocol.statusType.equals(SteStatusType.WAITING)){
                                            //ste任务完成
                                            if (jarSteTake(wrkMastExecute,null,null,null,true,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                                                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={}",
                                                wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                        return true;
                                    }
                                    return true;
                                }
                                return false;
                            case 7:
                            case 8:
                            case 10:
                            case 11:
                                //1:RGV小车移动、2:RGV小车到位、3:Ste穿梭版移动中、4:移动完成、5:更新完成
                                if (wrkMastExecute.getWrkSts()==3){
                                    //ste任务完成
                                    if (steProtocol.statusType.equals(SteStatusType.WAITING)){
                                    continue;
                                case 7:
                                case 8:
                                case 10:
                                case 11:
                                    //1:RGV小车移动、2:RGV小车到位、3:Ste穿梭版移动中、4:移动完成、5:更新完成
                                    if (wrkMastExecute.getWrkSts()==3){
                                        //ste任务完成
                                        if (jarSteTake(wrkMastExecute,null,null,null,true)){
                                            wrkMastExecute.setWrkSts(4);
                                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                                log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                        wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                        if (steProtocol.statusType.equals(SteStatusType.WAITING)){
                                            //ste任务完成
                                            if (jarSteTake(wrkMastExecute,null,null,null,true,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                                                wrkMastExecute.setWrkSts(4);
                                                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={}",
                                                wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                        return true;
                                    }
                                    log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                    return true;
                                }
                                return false;
                            case 9:
                                if (wrkMastExecute.getWrkSts()==1){
                                    //1:Ste穿梭版取放货中、2:放货完成等待下一步、3:输送线任务下发完成、4:更新完成   //io_type = 9
                                    //ste任务完成
                                    if (steProtocol.statusType.equals(SteStatusType.WAITING)){
                                    continue;
                                case 9:
                                    if (wrkMastExecute.getWrkSts()==1){
                                        //1:Ste穿梭版取放货中、2:放货完成等待下一步、3:输送线任务下发完成、4:更新完成   //io_type = 9
                                        //ste任务完成
                                        if (jarSteTake(wrkMastExecute,null,null,null,true)){
                                            wrkMastExecute.setWrkSts(2);
                                            if (wrkMastExecuteService.updateById(wrkMastExecute)){
                                                log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}",
                                                        wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                        if (steProtocol.statusType.equals(SteStatusType.WAITING)){
                                            //ste任务完成
                                            if (jarSteTake(wrkMastExecute,null,null,null,true,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                                                wrkMastExecute.setWrkSts(2);
                                                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={}",
                                                wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                        continue;
                                    }
                                    log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}",
                                            wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign);
                                    return true;
                                }
                            default: return false;
                                default: continue;
                            }
                        }
                    }
                }
            }
            return true;
        }catch (Exception e){
            log.error("小车复位线程报错!"+e);
            log.error("JarWrkMastExecute任务完成 ===>Ste报错!"+e);
        }
        return false;
    }
@@ -6846,6 +7020,10 @@
                }
                if (jarProtocol.modeType != JarModeType.AUTO){
                    continue;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    return false;
                }
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
@@ -6879,7 +7057,7 @@
                        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);
                        }
@@ -6888,12 +7066,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;
@@ -6913,7 +7091,7 @@
                        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);
                        }
@@ -6922,12 +7100,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;
@@ -6939,7 +7117,7 @@
            }
            return true;
        }catch (Exception e){
            log.error("小车复位线程报错!"+e);
            log.error("//硫化完成 修改任务状态  报错!"+e);
        }
        return false;
    }
@@ -6979,7 +7157,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;
@@ -6989,7 +7167,7 @@
            }
            return true;
        }catch (Exception e){
            log.error("小车复位线程报错!"+e);
            log.error("JarWrkMastExecute任务完成 ===>RGV移动!异常"+e);
        }
        return false;
    }
@@ -7015,35 +7193,142 @@
                    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 false;
                        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;
                }
            }
            return true;
        }catch (Exception e){
            log.error("小车复位线程报错!"+e);
            log.error(" JarWrkMastExecute任务完成 ===>RGV取货  异常!"+e);
        }
        return false;
    }
    /**
     *  Jar任务  穿梭车移动任务   //完成
     */
    public synchronized boolean jarMastMove() {
        try{
            for (SteSlave steSlave : slaveProperties.getSte()){
                SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steSlave.getId());
                if (steThread == null) {
                    continue;
                }
                SteProtocol steProtocol = steThread.getSteProtocol();
                if (steProtocol == null) {
                    continue;
                }
                if (wrkMastExecuteService.selectNoStart(steSlave.getId())!=0){
                    continue;
                }
                if (wrkMastExecuteService.selectMoveStart(steSlave.getId())!=0){
                    continue;
                }
                try{
                    if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),1,SteStatusType.IDLE)){
                        List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null);
                        if (wrkMastExecutes.isEmpty()){
                            List<WrkMastExecute> wrkMastExecutesB = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null);
                            List<WrkMastExecute> wrkMastExecutesC = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null);
                            if (!wrkMastExecutesB.isEmpty() || !wrkMastExecutesC.isEmpty()){
                                WrkMastExecute wrkMastExecute = !wrkMastExecutesB.isEmpty() ? wrkMastExecutesB.get(0) : wrkMastExecutesC.get(0);
                                BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId());
                                if (Cools.isEmpty(basJar)){
                                    log.error("{}号硫化罐查询设备档案无信息!!!",wrkMastExecute.getJarId());
                                    return false;
                                }
                                BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo());
                                //A==>B
                                if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByWrkNo,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),10,1})){
                                    log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByWrkNo));
                                }
                                continue;
                            }
                        }
                    } else if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),2,SteStatusType.IDLE)){
                        List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null);
                        if (wrkMastExecutes.isEmpty()){
                            List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null);
                            List<WrkMastExecute> wrkMastExecutesC = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null);
                            if (!wrkMastExecutesA.isEmpty()){
                                WrkMastExecute wrkMastExecute = wrkMastExecutesA.get(0);
                                BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId());
                                if (Cools.isEmpty(basJar)){
                                    log.error("{}号硫化罐查询设备档案无信息!!!",wrkMastExecute.getJarId());
                                    return false;
                                }
                                BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo());
                                //B==>A
                                if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByWrkNo,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),11,1})){
                                    log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByWrkNo));
                                }
                                continue;
                            }
                            if (!wrkMastExecutesC.isEmpty()){
                                WrkMastExecute wrkMastExecute = wrkMastExecutesC.get(0);
                                BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId());
                                if (Cools.isEmpty(basJar)){
                                    log.error("{}号硫化罐查询设备档案无信息!!!",wrkMastExecute.getJarId());
                                    return false;
                                }
                                BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo());
                                //B==>C
                                if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByWrkNo,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),7,1})){
                                    log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByWrkNo));
                                }
                                continue;
                            }
                        }
                    } else if (jarWrkMastExecuteGenerateSteStatus(steSlave.getId(),3,SteStatusType.IDLE)){
                        List<WrkMastExecute> wrkMastExecutes = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 9, null);
                        if (wrkMastExecutes.isEmpty()){
                            List<WrkMastExecute> wrkMastExecutesB = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null);
                            List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 5, null);
                            if (!wrkMastExecutesB.isEmpty() || !wrkMastExecutesA.isEmpty()){
                                WrkMastExecute wrkMastExecute = !wrkMastExecutesB.isEmpty() ? wrkMastExecutesB.get(0) : wrkMastExecutesA.get(0);
                                BasJar basJar = basJarMapper.selectById(wrkMastExecute.getJarId());
                                if (Cools.isEmpty(basJar)){
                                    log.error("{}号硫化罐查询设备档案无信息!!!",wrkMastExecute.getJarId());
                                    return false;
                                }
                                BasJarMast jarMastByWrkNo = basJarMastService.getJarMastByWrkNo(wrkMastExecute.getWrkNo());
                                //C==>B
                                if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByWrkNo,basJar.getJarNo(),new int[]{basJar.getOutSteNo(),basJar.getOutRgvNo(),8,1})){
                                    log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByWrkNo));
                                }
                                continue;
                            }
                        }
                    }
                }catch (Exception e){
                    log.error("硫化区域分段任务完成异常,steProtocol={},异常信息={}",JSON.toJSONString(steProtocol),e.getMessage());
                }
                WrkMastExecute wrkMastExecute = wrkMastExecuteService.selectStart(steSlave.getId());
            }
        } catch (Exception e){
            log.error("硫化区域分段任务完成异常,异常信息={}",e.getMessage());
        }
        return false;
    }