#
Junjie
2023-09-19 9f6bae6e952b0b6836b539703f3418b0acc725d3
#
1个文件已修改
53 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -971,6 +971,11 @@
                continue;
            }
            //判断提升机令牌是否被占用
            if (liftProtocol.getToken() != 0) {
                continue;
            }
            //搜索是否有待处理的任务
            List<WrkMast> wrkMasts = wrkMastMapper.selectLiftStep223103();
            if (wrkMasts.isEmpty()) {
@@ -1032,15 +1037,25 @@
            //获取源站对应的输送站点
            BasDevp sourceBasDevp = basDevpService.selectById(wrkMast.getSourceStaNo());
            //获取目标站对应的输送站点
            BasDevp targetBasDevp = basDevpService.selectById(wrkMast.getStaNo());
            if (sourceBasDevp == null || targetBasDevp == null) {
                return false;//缺少站点信息
            if (sourceBasDevp == null) {
                return false;//站点不存在
            }
            //获取源站对应的牛眼提升机站点编号(起点编号)
            Integer startSta = Integer.parseInt(sourceBasDevp.getQrCodeValue());
            Integer targetSta = null;
            //获取牛眼提升机站点编号(目标编号)
            for (LiftStaProtocol liftStaProtocol : liftThread.getLiftStaProtocols()) {
                if (liftStaProtocol.getLev() == Utils.getLev(wrkMast.getLocNo())) {
                    targetSta = liftStaProtocol.getStaNo();
                }
            }
            if (targetSta == null) {
                return false;//站点编号不存在
            }
            //获取提升机命令
            NyLiftCommand liftCommand = NyLiftUtils.getLiftCommand(liftProtocol.getLiftNo().intValue(), NyLiftTaskModelType.MOVE_TRAY.id, sourceBasDevp.getDevNo(), targetBasDevp.getDevNo(), wrkMast.getWrkNo());
            NyLiftCommand liftCommand = NyLiftUtils.getLiftCommand(liftProtocol.getLiftNo().intValue(), NyLiftTaskModelType.MOVE_TRAY.id, startSta, targetSta, wrkMast.getWrkNo());
            ArrayList<NyLiftCommand> commands = new ArrayList<>();
            commands.add(liftCommand);
@@ -1097,16 +1112,28 @@
                return false;//当前提升机存在未完成任务,等待下一次轮询
            }
            //获取源站对应的输送站点
            BasDevp sourceBasDevp = basDevpService.selectByLevAndLiftNo(Utils.getLev(wrkMast.getSourceLocNo()), liftProtocol.getLiftNo().intValue());
            //获取目标站对应的输送站点
            BasDevp targetBasDevp = basDevpService.selectById(wrkMast.getSourceStaNo());
            if (sourceBasDevp == null || targetBasDevp == null) {
                return false;//缺少站点信息
            //获取源站对应的牛眼提升机站点编号(起点编号)
            Integer startSta = null;
            for (LiftStaProtocol liftStaProtocol : liftThread.getLiftStaProtocols()) {
                if (liftStaProtocol.getLev() == Utils.getLev(wrkMast.getLocNo())) {
                    startSta = liftStaProtocol.getStaNo();
                }
            }
            if (startSta == null) {
                return false;//站点编号不存在
            }
            //获目标站源站对应的输送站点
            BasDevp targetBasDevp = basDevpService.selectById(wrkMast.getStaNo());
            if (targetBasDevp == null) {
                return false;//站点不存在
            }
            //获取牛眼提升机站点编号(目标编号)
            Integer targetSta = Integer.parseInt(targetBasDevp.getQrCodeValue());
            //获取提升机命令
            NyLiftCommand liftCommand = NyLiftUtils.getLiftCommand(liftProtocol.getLiftNo().intValue(), NyLiftTaskModelType.MOVE_TRAY.id, sourceBasDevp.getDevNo(), targetBasDevp.getDevNo(), wrkMast.getWrkNo());
            NyLiftCommand liftCommand = NyLiftUtils.getLiftCommand(liftProtocol.getLiftNo().intValue(), NyLiftTaskModelType.MOVE_TRAY.id, startSta, targetSta, wrkMast.getWrkNo());
            ArrayList<NyLiftCommand> commands = new ArrayList<>();
            commands.add(liftCommand);