| | |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && (workNo >= 0) |
| | | && staProtocol.isPakMk() |
| | | // && staProtocol.isPakMk() |
| | | ) { |
| | | |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>() |
| | |
| | | } |
| | | |
| | | for (Task task : tasks) { |
| | | BasConveyorSta originStaObj = basConveyorStaService.selectBySiteNo(task.getOriginSite());//获取源站 |
| | | if (originStaObj == null) { |
| | | BasConveyorSta destStaObj = basConveyorStaService.selectBySiteNo(task.getDestSite());//获取目标站 |
| | | if (destStaObj == null) { |
| | | continue; |
| | | } |
| | | |
| | | BasConveyor basConveyor = basConveyorService.getById(originStaObj.getConveyorId()); |
| | | BasConveyor basConveyor = basConveyorService.getById(destStaObj.getConveyorId()); |
| | | if(basConveyor == null) { |
| | | continue; |
| | | } |
| | | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, basConveyor.getDeviceId().intValue()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(Integer.parseInt(task.getOriginSite()));//源站 |
| | | // StaProtocol staProtocol1 = devpThread.getStation().get(Integer.parseInt(task.getDestSite()));//目标站 |
| | | StaProtocol staProtocol = devpThread.getStation().get(Integer.parseInt(task.getDestSite()));//目标站 |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | // staProtocol1 = staProtocol1.clone(); |
| | | } |
| | | |
| | | // 判断出库站状态 |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | // if (!(staProtocol1.isAutoing() && !staProtocol1.isLoading() && staProtocol1.getWorkNo() == 0 && staProtocol1.isOutEnable())) { |
| | | // continue; |
| | | // } |
| | | |
| | | // //同库位组校验 |
| | | // List<String> outerLoc = Utils.getGroupOuterLoc(wrkMast.getSourceLocNo()); |
| | | // List<LocMast> outerLocMasts = locMastService.selectNotEmptyLocNos(outerLoc); |
| | | // if (!outerLocMasts.isEmpty()) { |
| | | // News.info("{}任务,浅库位存在货物,系统等待中", wrkMast.getWrkNo()); |
| | | // continue;//浅库位存在未执行任务 |
| | | // } |
| | | |
| | | if (Cools.isEmpty(task.getShuttleNo())) { |
| | | //分配小车 |
| | | //搜索空闲车 |
| | |
| | | // generate motion list |
| | | List<Motion> motionList = analyzeService.generateMotion(task); |
| | | if (Cools.isEmpty(motionList)) { |
| | | log.error("出库 ===>> 暂时没有空闲小车, 任务号={}", task.getTaskNo()); |
| | | log.error("出库 ===>> 任务解析失败, 任务号={}", task.getTaskNo()); |
| | | continue; |
| | | } |
| | | motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()), task.getHostId()); |