Junjie
2023-10-25 d1cff38b67687ef4b5d7dfddc4f7d070c879f2f5
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -108,6 +108,8 @@
    private BasLiftOptService basLiftOptService;
    @Autowired
    private ConfigService configService;
    @Autowired
    private NavigateMapUtils navigateMapUtils;
    /**
@@ -2067,6 +2069,7 @@
                                //覆盖工作档目标站
                                wrkMast.setStaNo(targetSta.intValue());
                                wrkMast.setShuttleNo(null);//释放小车
                                wrkMast.setLiftNo(null);//释放提升机
                                if (wrkMastMapper.updateById(wrkMast) > 0) {
                                    //向300站写入目标站
                                    staProtocol = staProtocol.clone();
@@ -2088,6 +2091,7 @@
//                        //覆盖工作档目标站
//                        wrkMast.setStaNo(targetSta.intValue());
//                        wrkMast.setShuttleNo(null);//释放小车
//                        wrkMast.setLiftNo(null);//释放提升机
//                        if (wrkMastMapper.updateById(wrkMast) > 0) {
//                            //向300站写入目标站
//                            staProtocol = staProtocol.clone();
@@ -2159,9 +2163,9 @@
                continue;
            }
            if (staProtocol309.isAutoing() && staProtocol309.isLoading()) {
            if (staProtocol309.isAutoing() && staProtocol309.isLoading() && staProtocol309.isInEnable()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 11);//308站条码器
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 9);//308站条码器
                if (barcodeThread == null) {
                    continue;
                }
@@ -2169,10 +2173,13 @@
                if(!Cools.isEmpty(barcode)) {
                    //通知AGV取货
                    agvRestockCall("CS-301-001-01@3", barcode);
                    log.info("通知AGV取货,条码号:" + barcode);
                }
            } else if (staProtocol312.isAutoing() && staProtocol312.isLoading()) {
            }
            if (staProtocol312.isAutoing() && staProtocol312.isLoading() && staProtocol312.isInEnable()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 12);//311站条码器
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 10);//311站条码器
                if (barcodeThread == null) {
                    continue;
                }
@@ -2180,6 +2187,7 @@
                if(!Cools.isEmpty(barcode)) {
                    //通知AGV取货
                    agvRestockCall("CS-302-001-01@3", barcode);
                    log.info("通知AGV取货,条码号:" + barcode);
                }
            }
        }
@@ -2686,6 +2694,22 @@
                return false;
            }
            //*************尝试锁定目标站路径***************
            List<NavigateNode> targetNodes = NyLiftUtils.getLiftStaNodes(wrkMast.getStaNo());
            if (targetNodes == null) {
                return false;//未获取到节点
            }
            boolean checkPathIsAvailable = NavigateUtils.checkPathIsAvailable(targetNodes, shuttleProtocol.getShuttleNo().intValue(), Utils.getLev(wrkMast.getLocNo()), null);
            if (!checkPathIsAvailable) {
                return false;//检测目标站点路径是否未被占用
            }
            //尝试锁定目标站路径
            boolean result2 = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(wrkMast.getLocNo()), targetNodes, true);//所使用的路径进行锁定禁用
            if (!result2) {
                return false;//路径锁定失败
            }
            //*************尝试锁定目标站路径***************
            //获取源输送站
            LiftStaProtocol liftSta = NyLiftUtils.getLiftStaByStaNo(wrkMast.getSourceStaNo());
            if (liftSta == null) {
@@ -3053,6 +3077,7 @@
            if (basLift.getPoint() == null) {
                return false;//没有设置提升机点位坐标
            }
            NavigateNode liftNode = new NavigateNode(basLift.getPoint$().getX(), basLift.getPoint$().getY());
            liftNode.setZ(liftSta.getLev());
@@ -3117,6 +3142,27 @@
                return false;
            }
            //跨楼层移动任务
            if (Utils.getLev(wrkMast.getSourceLocNo()) != Utils.getLev(wrkMast.getLocNo())) {
                //获取目标站
                LiftStaProtocol liftSta = NyLiftUtils.getLiftStaByStaNo(wrkMast.getStaNo());
                if (liftSta == null) {
                    return false;//找不到站点
                }
                //*************尝试解锁目标站路径***************
                List<NavigateNode> targetNodes = NyLiftUtils.getLiftStaNodes(liftSta.getStaNo());
                if (targetNodes == null) {
                    return false;//未获取到节点
                }
                //尝试解锁目标站路径
                boolean result = navigateMapUtils.writeNavigateNodeToRedisMap(Utils.getLev(wrkMast.getLocNo()), targetNodes, false);//所使用的路径进行解锁
                if (!result) {
                    return false;//路径解锁失败
                }
                //*************尝试解锁目标站路径***************
            }
//            //获取目标站对应的输送站点
//            BasDevp targetBasDevp = basDevpService.selectByLevAndLiftNo(Utils.getLev(wrkMast.getLocNo()), wrkMast.getLiftNo());
//            if (targetBasDevp == null) {