#
yxFwq
2024-07-21 b3a41c6e7161a3271856605a3940bc27534efbc1
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4958,6 +4958,17 @@
                                if (basJarMastList.size()!=integer){
                                    log.error("{}号硫化罐硫化完成后开门完成修改硫化档案状态结果数量不一致!!!查询资料数量={},更新返回数量={}",jarMastByWrkNo.getJarId(),basJarMastList.size(),integer);
                                }
                            } else if (wrkMastExecute.getIoType()==2 && jarMastByWrkNo.getStatus()==5){
                                List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarMastByWrkNo.getJarId(), new ArrayList<Integer>() {{
                                    add(4);//硫化完成
                                }});
                                if (basJarMastList.isEmpty()){
                                    continue;
                                }
                                Integer integer = basJarMastService.updateStatus(jarMastByWrkNo.getJarId(), 4, 5);
                                if (basJarMastList.size()!=integer){
                                    log.error("{}号硫化罐硫化完成后开门完成修改硫化档案状态结果数量不一致!!!查询资料数量={},更新返回数量={}",jarMastByWrkNo.getJarId(),basJarMastList.size(),integer);
                                }
                            } else {
                                if (!basJarMastService.updateById(jarMastByWrkNo)){
                                    log.error("硫化区域分段任务完成异常,BasJarMast={},异常信息={}",JSON.toJSONString(jarMastByWrkNo),"更新basJarMast失败");
@@ -5117,9 +5128,10 @@
                if (jarProtocol.isAutoing() && jarProtocol.jarErr==0){
                    if (jarWrkMastExecuteGenerate5(jarSlave,sign)){
                        signExecute[jarSlave.getId()-5] = true;
                        return signExecute;
                        //出硫化罐 ===》 入冷却槽
                    }
                    return signExecute;
                    continue;
                }
            } catch (Exception e){
                log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage());
@@ -5267,6 +5279,10 @@
                            return false;
                        }
                        if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJar.getRegion())!=0){
                            return false;
                        }
                        //门作业  无
                        //自动、空闲、右门关闭、   Other左门关闭
                        if (jarProtocol.isAutoing() && jarProtocol.jarErr==0
@@ -5314,12 +5330,16 @@
            List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
                add(4);
            }});
            if (basJarMastList.size() != 7){
            if (basJarMastList.size() != jarMaxLoc){
                return false;
            }
            BasJarMast basJarMastSign = basJarMastList.get(0);
            if (Cools.isEmpty(basJarMastSign)){
                return false;
            }
            if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJarMastSign.getJarRegin())!=0){
                return false;
            }
//            //判断小车状态
@@ -5353,7 +5373,7 @@
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                    return false;
                }
                if (basJar.getJarCount()!=7){
                if (!basJar.getJarCount().equals(jarMaxLoc)){
                    log.error("{}号硫化罐查询设备库存数异常!!!库存待入数:{}",jarProtocol.getJarNo(),basJar.getJarCount());
                    return false;
                }
@@ -5391,7 +5411,7 @@
            List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
                add(6);
            }});
            if (basJarMastList.size() != 7){
            if (basJarMastList.size() != jarMaxLoc){
                return false;
            }
            if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0){
@@ -5400,6 +5420,10 @@
            BasJarMast basJarMastSign = basJarMastList.get(0);
            if (Cools.isEmpty(basJarMastSign)){
                return false;
            }
            if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(basJarMastSign.getJarRegin())!=0){
                return false;
            }
//            //判断小车状态
@@ -5471,13 +5495,26 @@
            if (basJarMastList.isEmpty()){
                return false;
            }
            List<BasJarMast> basJarMastList10 = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
                add(10);
            }});
            if (basJarMastList10.size()==jarMaxLoc){
                return false;
            }
            if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0){
                return false;
            }
            BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMin(jarSlave.getId(),8,8);
            if (Cools.isEmpty(jarMastByJarIdMin)){
                return false;
            }
            if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(jarMastByJarIdMin.getJarRegin())!=0){
                return false;
            }
            int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", jarMastByJarIdMin.getJarRegin()).lt("status", 17).gt("status", 10));
            if (count>0){
                return false;
            }
//            //判断小车状态
@@ -5561,6 +5598,10 @@
            if (Cools.isEmpty(jarMastByJarIdMin)){
                return false;
            }
            if (wrkMastExecuteService.getWrkMastExecuteByjarReginCount(jarMastByJarIdMin.getJarRegin())!=0){
                return false;
            }
//
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),3,SteStatusType.IDLE)){
@@ -5587,6 +5628,26 @@
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                    return false;
                }
                // 获取硫化罐信息
                JarThread jarThreadOther = (JarThread) SlaveConnection.get(SlaveType.Jar, SteAndJarUtil.getRgvJarNo(jarProtocol.getJarNo()));
                JarProtocol jarProtocolOther = jarThreadOther.getJarProtocol();
                if (jarProtocolOther == null) {
                    return false;
                }
                if (jarProtocolOther.modeType != JarModeType.AUTO){
                    return false;
                }
                BasJar basJarOther = basJarMapper.selectById(jarProtocolOther.getJarNo());
                if (Cools.isEmpty(basJarOther)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocolOther.getJarNo());
                    return false;
                }
                if (!jarProtocolOther.isRightDoor()){
                    return false;
                }
@@ -6501,6 +6562,26 @@
                return false;
            }
            // 获取硫化罐信息
            JarThread jarThreadOther = (JarThread) SlaveConnection.get(SlaveType.Jar, SteAndJarUtil.getRgvJarNo(wrkMastExecute.getJarId()));
            JarProtocol jarProtocolOther = jarThreadOther.getJarProtocol();
            if (jarProtocolOther == null) {
                return false;
            }
            if (jarProtocolOther.modeType != JarModeType.AUTO){
                return false;
            }
            BasJar basJarOther = basJarMapper.selectById(jarProtocolOther.getJarNo());
            if (Cools.isEmpty(basJarOther)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocolOther.getJarNo());
                return false;
            }
            if (!jarProtocolOther.isRightDoor()){
                return false;
            }
            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocolRGV = devpThread.getStation().get(basJar.getEnterRgvNo());
            if (staProtocolRGV == null) {
@@ -6617,6 +6698,22 @@
                return false;
            }
            // 获取硫化罐信息
            JarThread jarThreadOther = (JarThread) SlaveConnection.get(SlaveType.Jar, SteAndJarUtil.getRgvJarNo(wrkMastExecute.getJarId()));
            JarProtocol jarProtocolOther = jarThreadOther.getJarProtocol();
            if (jarProtocolOther == null) {
                return false;
            }
            if (jarProtocolOther.modeType != JarModeType.AUTO){
                return false;
            }
            BasJar basJarOther = basJarMapper.selectById(jarProtocolOther.getJarNo());
            if (Cools.isEmpty(basJarOther)){
                log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocolOther.getJarNo());
                return false;
            }
//            //判断小车状态
//            if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),1)){
//                return false;
@@ -6659,7 +6756,7 @@
                        && 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 (SteAndJarUtil.steAndJarNowRow(staProtocolRGV.getNowRow() , jarProtocolOther.getJarNo())){
                        //判断小车状态
                        if (!jarWrkMastExecuteGenerateSteStatus(basJar.getEnterSteNo(),2,SteStatusType.WAITING2,false)){
                            return false;
@@ -6677,7 +6774,7 @@
                        }
                    } else {
                        //调车  == > endRow
                        if (!jarRgvMoveTake(wrkMastExecute,1)){
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getJarNoEndRow(basJar.getBurial()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
@@ -7709,6 +7806,8 @@
                        return true;
                    }
                    return true;
                } else {
                    log.error("{}号平衡车当前状态不满足入硫化罐条件,当前任务,平衡车从取货");
                }
            }
            return true;
@@ -8080,13 +8179,14 @@
    }
    public synchronized Integer jarGetStartStaNo(Integer staNo) {
        try {
            int[] jarNos=new int[]{1,2,3,4};//(607分配硫化罐)
            int[] jarNos=new int[]{3,1,4,2};//(607分配硫化罐)
            ArrayList<Integer> staNos = new ArrayList<Integer>() {{
                add(607);add(608);add(609);add(610);add(611);add(612);
                add(613);add(614);add(615);add(616);add(617);add(618);
                add(619);add(620);add(621);add(622);
            }};
            ArrayList<Integer> jarNoList = new ArrayList<>();
            ArrayList<Integer> jarNoList1 = new ArrayList<>();
            ArrayList<Integer> jarNoListNow = new ArrayList<>();
            for (int jarNo : jarNos) {
                List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarNo, new ArrayList<Integer>() {{
@@ -8099,14 +8199,42 @@
                if (basJarMastList.isEmpty()){
                    continue;
                }
                if (basJarMastList.size()>0 && basJarMastList.size()<7){
                if (basJarMastList.size()>0 && basJarMastList.size()<jarMaxLoc){
                    jarNoList.add(jarNo);
                }
            }
            jarNoList.add(4);
            jarNoList.add(2);
            jarNoList.add(3);
            jarNoList.add(1);
            for (int jarNo : jarNos) {
                if (!jarNoList.contains(jarNo)){
                    jarNoList1.add(jarNo);
                }
            }
            for (int jarNo : jarNoList1) {
                List<BasJarMast> jarMastByJarIdAndStatusList = basJarMastService.getJarMastByJarIdAndStatusList(8, jarNo);
                if (jarMastByJarIdAndStatusList.isEmpty()){
                    jarNoList.add(jarNo);
                }
            }
            jarNoList1 = new ArrayList<Integer>();
            for (int jarNo : jarNos) {
                if (!jarNoList.contains(jarNo)){
                    jarNoList1.add(jarNo);
                }
            }
            for (int jarNo : jarNoList1) {
                List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarNo, new ArrayList<Integer>() {{
                    add(5);
                    add(6);
                    add(7);
                    add(8);
                    add(9);
                    add(13);
                    add(14);
                    add(15);
                }});
                if (basJarMastList.isEmpty()){
                    jarNoList.add(jarNo);
                }
            }
            for (int jarNo : jarNoList) {
                if (jarNoListNow.contains(jarNo)){
                    continue;
@@ -8153,7 +8281,7 @@
                        }
                    }
                }
                if (count<7){
                if (count<jarMaxLoc){
                    return basJar.getEntStaNo$();
                }
            }