#
yxFwq
2024-07-20 a36b5b1833290b01822d80f2e31a88f9197bf6dc
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -59,6 +59,7 @@
//    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}};
    private static final Integer jarMaxLoc = 6;
    @Autowired
    private CommonService commonService;
    @Autowired
@@ -3737,7 +3738,7 @@
                } else {
                    staProtocol = staProtocol.clone();
                }
                if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==607 && staProtocol.getWorkNo()>20000){
                if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==607 && staProtocol.getWorkNo()>20000 && staProtocol.isLoading() && staProtocol.isAutoing()){
                    try {
                        BasDevp basDevp = basDevpService.selectById(staProtocol.getStaNo());
                        if (basDevp.getReportSign()==0){
@@ -4815,10 +4816,10 @@
                            if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){
                                break;
                            }
                            if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>=14){
                            if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>=jarMaxLoc*2){
                                break;
                            }
                            if (basJarMastService.selectJarMastOperation(jarSlave.getId(),0,9)>=7){
                            if (basJarMastService.selectJarMastOperation(jarSlave.getId(),0,9)>=jarMaxLoc){
                                break;
                            }
                            if (!Objects.equals
@@ -4837,7 +4838,7 @@
                                    break;
                                }
                                jarLocDigit = 1;
                            } else if (jarMastByJarIdMax.getJarLocDigit()<7){
                            } else if (jarMastByJarIdMax.getJarLocDigit()<jarMaxLoc){
                                jarLocDigit = jarMastByJarIdMax.getJarLocDigit()+1;
                            } else {
                                continue;
@@ -4954,6 +4955,17 @@
                                    continue;
                                }
                                Integer integer = basJarMastService.updateStatus(jarMastByWrkNo.getJarId(), 6, 8);
                                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);
                                }
@@ -5313,7 +5325,7 @@
            List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
                add(4);
            }});
            if (basJarMastList.size() != 7){
            if (basJarMastList.size() != jarMaxLoc){
                return false;
            }
@@ -5352,7 +5364,7 @@
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                    return false;
                }
                if (basJar.getJarCount()!=7){
                if (!basJar.getJarCount().equals(jarMaxLoc)){
                    log.error("{}号硫化罐查询设备库存数异常!!!库存待入数:{}",jarProtocol.getJarNo(),basJar.getJarCount());
                    return false;
                }
@@ -5390,7 +5402,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){
@@ -6616,6 +6628,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;
@@ -6658,7 +6686,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;
@@ -6676,7 +6704,7 @@
                        }
                    } else {
                        //调车  == > endRow
                        if (!jarRgvMoveTake(wrkMastExecute,1)){
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getJarNoEndRow(jarProtocolOther.getJarNo()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
@@ -6838,7 +6866,7 @@
                    } else {
                        //调车  == > endRow
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(wrkMastExecute.getJarId()))){
                        if (!jarRgvMoveTake(wrkMastExecute,SteAndJarUtil.getRgvJarNowRow(jarProtocolOther.getJarNo()))){
                            log.error("平衡车RGV命令下发失败,rgv号={},任务数据={},硫化罐数据={},sign={}",
                                    wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign);
                        }
@@ -8005,9 +8033,16 @@
                if (steProtocol.getCharge()>95.0F || steProtocol.getFullCharge()){
                } else if (steProtocol.getCharge()>50.0F){
                    if (wrkMastExecuteService.selectNoStartCharge(steSlave.getId())==0){
                        if (wrkMastExecuteService.selectMoveStart(steSlave.getId())==0){
                            continue;
                    List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusListCharge(steSlave.getId(), new ArrayList<Integer>() {{
                        add(5);
                        add(11);
                        add(17);
                    }});
                    if(basJarMastList.isEmpty()){
                        if (wrkMastExecuteService.selectNoStartCharge(steSlave.getId())==0){
                            if (wrkMastExecuteService.selectMoveStart(steSlave.getId())==0){
                                continue;
                            }
                        }
                    }
                } else {
@@ -8064,7 +8099,7 @@
        if (staNo1!=0){
            SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2);
            StaProtocol staProtocol607 = devpThread.getStation().get(607);
            if (staProtocol607.getWorkNo()<9001 && staProtocol607.getWorkNo()!=0 && staProtocol607.isLoading() && staProtocol607.isAutoing()){
            if (staProtocol607.getWorkNo()<9001 && staProtocol607.getWorkNo()!=0 && staProtocol607.isLoading() && staProtocol607.isAutoing() && staProtocol607.getStaNo() == 607){
                staProtocol607.setStaNo(staNo1);
                boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(5, staProtocol607));
            }
@@ -8072,7 +8107,7 @@
    }
    public synchronized Integer jarGetStartStaNo(Integer staNo) {
        try {
            int[] jarNos=new int[]{1,2,3,4};//(607分配硫化罐)
            int[] jarNos=new int[]{4,2,3,1};//(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);
@@ -8091,7 +8126,7 @@
                if (basJarMastList.isEmpty()){
                    continue;
                }
                if (basJarMastList.size()>0 && basJarMastList.size()<7){
                if (basJarMastList.size()>0 && basJarMastList.size()<jarMaxLoc){
                    jarNoList.add(jarNo);
                }
            }
@@ -8145,7 +8180,7 @@
                        }
                    }
                }
                if (count<7){
                if (count<jarMaxLoc){
                    return basJar.getEntStaNo$();
                }
            }