#
lsh
2024-07-19 bee7056daa44a1b0a33c98a29bf9d4886ca7643f
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;
@@ -5313,7 +5314,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 +5353,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 +5391,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){
@@ -6838,7 +6839,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 +8006,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 +8072,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 +8080,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 +8099,7 @@
                if (basJarMastList.isEmpty()){
                    continue;
                }
                if (basJarMastList.size()>0 && basJarMastList.size()<7){
                if (basJarMastList.size()>0 && basJarMastList.size()<jarMaxLoc){
                    jarNoList.add(jarNo);
                }
            }
@@ -8145,7 +8153,7 @@
                        }
                    }
                }
                if (count<7){
                if (count<jarMaxLoc){
                    return basJar.getEntStaNo$();
                }
            }