Junjie
2023-10-10 0d04e9440d19f30a8220f498ebdde5a8bfcc48a8
#机械臂任务下发
1个文件已修改
53 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -2021,30 +2021,39 @@
            StaProtocol staProtocol317 = devpThread.getStation().get(317);
            if (staProtocol303.isAutoing() && staProtocol303.isLoading() && staProtocol303.getWorkNo() != 0) {
                //调度机械臂
//                //查询是否有工作档
//                WrkMast wrkMast = wrkMastMapper.selectByWorkNo(staProtocol303.getWorkNo().intValue());
//                if (wrkMast == null) {
//                    continue;
//                }
//                WrkDetl wrkDetl = wrkDetlService.selectById(wrkMast.getWrkNo());
//                if (wrkDetl == null) {
//                    continue;
//                }
//                RobotUtils.sendTask(staProtocol303.getWorkNo().toString(), wrkDetl.getAnfme().intValue(), "303");
                RobotUtils.sendTask(staProtocol303.getWorkNo().toString(), -1, "303");
                //查询是否有工作档
                WrkMast wrkMast = wrkMastMapper.selectByWorkNo(staProtocol303.getWorkNo().intValue());
                if (wrkMast == null) {
                    continue;
                }
                WrkDetl wrkDetl = wrkDetlService.selectById(wrkMast.getWrkNo());
                if (wrkDetl == null) {
                    continue;
                }
                if (wrkMast.getInvWh() == null) {
                    wrkMast.setInvWh("Y");//标记已经下发机械臂任务
                    if (wrkMastMapper.updateById(wrkMast) > 0) {
                        RobotUtils.sendTask(staProtocol303.getWorkNo().toString(), wrkDetl.getAnfme().intValue(), "303");
                    }
                }
            }else if (staProtocol317.isAutoing() && staProtocol317.isLoading() && staProtocol317.getWorkNo() != 0) {
                //调度机械臂
//                //查询是否有工作档
//                WrkMast wrkMast = wrkMastMapper.selectByWorkNo(staProtocol317.getWorkNo().intValue());
//                if (wrkMast == null) {
//                    continue;
//                }
//                WrkDetl wrkDetl = wrkDetlService.selectById(wrkMast.getWrkNo());
//                if (wrkDetl == null) {
//                    continue;
//                }
//                RobotUtils.sendTask(staProtocol303.getWorkNo().toString(), wrkDetl.getAnfme().intValue(), "317");
                RobotUtils.sendTask(staProtocol303.getWorkNo().toString(), -1, "317");
                //查询是否有工作档
                WrkMast wrkMast = wrkMastMapper.selectByWorkNo(staProtocol317.getWorkNo().intValue());
                if (wrkMast == null) {
                    continue;
                }
                WrkDetl wrkDetl = wrkDetlService.selectById(wrkMast.getWrkNo());
                if (wrkDetl == null) {
                    continue;
                }
                if (wrkMast.getInvWh() == null) {
                    wrkMast.setInvWh("Y");//标记已经下发机械臂任务
                    if (wrkMastMapper.updateById(wrkMast) > 0) {
                        RobotUtils.sendTask(staProtocol303.getWorkNo().toString(), wrkDetl.getAnfme().intValue(), "317");
                    }
                }
            }
        }
    }