自动化立体仓库 - WCS系统
#
lsh
2022-10-12 f6decf71aa936d019a7732970744c6c33f5e6175
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -103,7 +103,7 @@
        for (DevpSlave devp : slaveProperties.getDevp()) {
            // 遍历入库口
            for (DevpSlave.Sta inSta : devp.getInSta()) {
//                inSta.setStaNo(102);
                inSta.setStaNo(102);
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                if (barcodeThread == null) {
@@ -167,7 +167,7 @@
                    try {
                        LocTypeDto locTypeDto = new LocTypeDto(staProtocol);
//                        locTypeDto.setLocType1((short)1);
                        locTypeDto.setLocType1((short)1);
                        SearchLocParam param = new SearchLocParam();
                        param.setBarcode(barcode);
                        param.setIoType(1);
@@ -2017,7 +2017,17 @@
                            case 8://解除暂停
                                olsStatus = 99;
                                newStatus = 0;
                                newSingle = 0;//测试复核,寄存器地址,6===>>0
                                newSingle = 0;//测试复核,寄存器地址,8===>>0
                                break;
                            case 11://入库前判断充电线是否放好
                                olsStatus = 99;
                                newStatus = 0;
                                newSingle = 11;//
                                break;
                            case 12://充电线放好
                                olsStatus = 99;
                                newStatus = 0;
                                newSingle = 0;//测试复核,寄存器地址,12===>>0
                                break;
                        }
@@ -2042,8 +2052,9 @@
                            } else {
                                devpThread.startSignal[i] = newSingle;
                            }
                        }else if (testMast == null && devpThread.startSignal[i] == 5){
                        }else if (devpThread.startSignal[i] == 5){
                            SearchLocParam param = new SearchLocParam();
                            param.setBarcode(i+1+"");
                            String response = new HttpHandler.Builder()
                                    .setUri(wmsUrl)
                                    .setPath("/mobile/test/suspend/auth")
@@ -2058,7 +2069,7 @@
                                staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,5==>6
                                boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
                                if(!result){
                                    log.error("更新测试信号失败===>>[channel:{},locNo:{},barcode:{}]", i+1, testMast.getLocNo(), testMast.getBarcode());
                                    log.error("暂停测试失败===>>["+i+1+"]号通道");
//                                throw new CoolException("更新测试信号失败===>>" + i);
                                } else {
                                    devpThread.startSignal[i] = newSingle;
@@ -2066,7 +2077,7 @@
                            } else {
                                log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl+"/mobile/test/suspend/auth", JSON.toJSONString(param), response);
                            }
                        }else if (testMast == null && devpThread.startSignal[i] == 7){
                        }else if (devpThread.startSignal[i] == 7){
                            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                                    .eq("channel",(i+1)));
                            if (locMast.getLocSts().equals("F")){
@@ -2085,10 +2096,46 @@
                            } else {
                                devpThread.startSignal[i] = newSingle;
                            }
                        }else if (testMast == null && devpThread.startSignal[i] == 8){
                        }
                        }else if (devpThread.startSignal[i] == 8){
                            //复位PLC信号,借用输送站点实体类
                            StaProtocol staProtocol = new StaProtocol();
                            staProtocol.setSiteId(i*2);//寄存器地址
                            staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,8==>0
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
                            if(!result){
//                                log.error("更新库位紧急出库信号失败===>>[channel:{},locNo:{},barcode:{}]", i+1, locMast.getLocNo(), locMast.getBarcode());
//                                throw new CoolException("更新测试信号失败===>>" + i);
                            } else {
                                devpThread.startSignal[i] = newSingle;
                            }
                        }else if (devpThread.startSignal[i] == 11){
                            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                                    .eq("channel",(i+1)));
                            if (locMast.getLocSts().equals("O")){
                                locMast.setLocSts("X");
                                locMastService.update(locMast,new EntityWrapper<LocMast>()
                                        .eq("channel",(i+1)));
                            }
                        }else if (devpThread.startSignal[i] == 12){
                            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                                    .eq("channel",(i+1)));
                            if (locMast.getLocSts().equals("X")){
                                locMast.setLocSts("O");
                                locMastService.update(locMast,new EntityWrapper<LocMast>()
                                        .eq("channel",(i+1)));
                            }
                            //复位PLC信号,借用输送站点实体类
                            StaProtocol staProtocol = new StaProtocol();
                            staProtocol.setSiteId(i*2);//寄存器地址
                            staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,12==>0
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol));
                            if(!result){
//                                log.error("更新库位紧急出库信号失败===>>[channel:{},locNo:{},barcode:{}]", i+1, locMast.getLocNo(), locMast.getBarcode());
//                                throw new CoolException("更新测试信号失败===>>" + i);
                            } else {
                                devpThread.startSignal[i] = newSingle;
                            }
                        }else { }
                    }
                }