自动化立体仓库 - WCS系统
#
lsh
2024-06-28 0b522af315780054b37f78460191b49f88e0598a
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4421,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;
@@ -4509,6 +4512,14 @@
                return false;
            }
            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;
            }
@@ -4626,6 +4637,10 @@
                if (jarProtocol.modeType != JarModeType.AUTO){
                    continue;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    continue;
                }
                JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
                JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
@@ -4701,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)){
@@ -4743,6 +4762,10 @@
                    continue;
                }
                if (jarProtocol.modeType != JarModeType.AUTO){
                    continue;
                }
                if (jarProtocol.getJarTemperature()>50){
                    log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo());
                    continue;
                }
@@ -4836,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) {
@@ -4862,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 {
@@ -4924,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());
@@ -4997,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());
@@ -5064,6 +5110,11 @@
                    return false;
                }
                if (jarProtocol.modeType != JarModeType.AUTO){
                    return false;
                }
                if (jarProtocol.statusType .equals(JarStatusType.SOS)){
                    log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo());
                    return false;
                }
@@ -5143,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());
@@ -5498,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());
@@ -5619,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());
@@ -5740,7 +5808,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());
@@ -5849,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());
@@ -5958,7 +6040,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());
@@ -6067,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());
@@ -6117,7 +6214,7 @@
                    if (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocol.getJarNo())){
                        //判断小车状态
                        if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.IDLE)){
                        if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.WAITING2)){
                            return false;
                        }
                        //调车  == > 取货
@@ -6179,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());
@@ -6340,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());
@@ -6509,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());
@@ -6800,7 +6911,7 @@
                                    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)){
                                        if (steProtocol.statusType.equals(SteStatusType.WAITING)){
                                            //ste任务完成
                                            if (jarSteTake(wrkMastExecute,null,null,null,true,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){
                                                wrkMastExecute.setWrkSts(4);
@@ -6909,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)){
@@ -7186,8 +7301,8 @@
                    } 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, 9, null);
                            List<WrkMastExecute> wrkMastExecutesA = wrkMastExecuteService.selectWrkMastExecuteByTypeAndIoTyperAndWrkType(null, 6, null);
                            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());