| | |
| | | @Autowired |
| | | private WrkMastMapper wrkMastMapper; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | |
| | | |
| | | // 更新工作档状态为 17.出库完成 |
| | | wrkMast.setWrkSts(17L); |
| | | wrkMast.setSteNo(0); |
| | | wrkMast.setCrnEndTime(new Date()); |
| | | if (wrkMastMapper.updateById(wrkMast) != 0) { |
| | | // 复位堆垛机 |
| | |
| | | // log.error("{}站点查询无待入库数据 工作号={}", crnStn.getStaNo(), staProtocol.getWorkNo()); |
| | | continue; |
| | | } |
| | | |
| | | // 判断是否已存在小车绑定任务 |
| | | BasSte basSte = basSteService.findByCrnNo(wrkMast.getCrnNo()); |
| | | if(basSte == null) continue; |
| | | WrkMast one1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("ste_no",basSte.getSteNo()) |
| | | .last(" and wrk_sts > 10")); |
| | | if(one1 != null){ |
| | | log.error("{}入库任务无法作业,因出库任务已绑定小车!", wrkMast.getWrkNo()); |
| | | continue; |
| | | } |
| | | |
| | | if (wrkMast.getWrkSts() < 3) { |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable() |
| | | && staDetl.getCanining()!=null && staDetl.getCanining().equals("Y")) { |
| | |
| | | } |
| | | // 没有小车 |
| | | } else { |
| | | if (wrkMast.getWrkSts() == 2L && wrkMast.getSteNo() == null) { |
| | | if (wrkMast.getWrkSts() == 2L && (wrkMast.getSteNo() == null || wrkMast.getSteNo() == 0)) { |
| | | // 寻找当前堆垛机对应的小车 |
| | | SteThread steThread = queryIdleCar(wrkMast); |
| | | if (steThread != null) { |
| | |
| | | continue; |
| | | } |
| | | |
| | | // 判断是否已存在小车绑定任务 |
| | | BasSte basSte = basSteService.findByCrnNo(wrkMast.getCrnNo()); |
| | | if(basSte == null) continue; |
| | | WrkMast one1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("ste_no",basSte.getSteNo()) |
| | | .last(" and wrk_sts < 10")); |
| | | if(one1 != null){ |
| | | log.error("{}出库任务无法作业,因入库任务已绑定小车!", wrkMast.getWrkNo()); |
| | | continue; |
| | | } |
| | | |
| | | //加强判断,确保因出库导致的移库整套任务全部结束后,才能执行下一笔出库任务。只有库位完成移库回去全部任务后,才认为当组出库任务完成 |
| | | WrkMast one = wrkMastMapper.selectLocMoveData(slave.getId()); |
| | | if(!Cools.isEmpty(one)){ |
| | | //存在移库任务,且在移出中,且移库源库位与待出库库位不在同一库位组,时跳出,确保移库/出库全套任务完成后,再执行下一笔 |
| | | if(one.getWrkSts() > 10 && (Utils.getGroupRow(wrkMast.getSourceLocNo()) != Utils.getGroupRow(one.getSourceLocNo()) |
| | | if(wrkMast.getWrkNo() ==11 && one.getWrkSts() > 10 && (Utils.getGroupRow(wrkMast.getSourceLocNo()) != Utils.getGroupRow(one.getSourceLocNo()) |
| | | || Utils.getBay(wrkMast.getSourceLocNo()) != Utils.getBay(one.getSourceLocNo()) |
| | | || Utils.getLev(wrkMast.getSourceLocNo()) != Utils.getLev(one.getSourceLocNo()))){ |
| | | continue; |
| | | } |
| | | //存在移库任务,且在移回中,且移库目标库位与待出库库位不在同一库位组,时跳出,确保移库/出库全套任务完成后,再执行下一笔 |
| | | if(one.getWrkSts() < 11 && (Utils.getGroupRow(wrkMast.getSourceLocNo()) != Utils.getGroupRow(one.getLocNo()) |
| | | if(wrkMast.getWrkNo() ==11 && one.getWrkSts() < 11 && (Utils.getGroupRow(wrkMast.getSourceLocNo()) != Utils.getGroupRow(one.getLocNo()) |
| | | || Utils.getBay(wrkMast.getSourceLocNo()) != Utils.getBay(one.getLocNo()) |
| | | || Utils.getLev(wrkMast.getSourceLocNo()) != Utils.getLev(one.getLocNo()))){ |
| | | continue; |
| | | } |
| | | log.info(""); |
| | | } |
| | | |
| | | //出库库位不是最外层库位,判断浅库位组是否都为空,或存在库位移转任务 |
| | |
| | | if (null == wrkMast) { |
| | | return; |
| | | } |
| | | // 过滤 |
| | | if (null != wrkMastMapper.selectPakin(slave.getId(), null)) { |
| | | log.error("{}出库任务无法作业,因存在入库中任务!", wrkMast.getWrkNo()); |
| | | return; |
| | | } |
| | | |
| | | // 判断是否已存在小车绑定任务 |
| | | BasSte basSte = basSteService.findByCrnNo(wrkMast.getCrnNo()); |
| | | if(basSte == null) return; |
| | | WrkMast one = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | | .eq("ste_no",basSte.getSteNo()) |
| | | .last(" and io_type != 11 and wrk_sts < 10")); |
| | | if(one != null){ |
| | | log.error("{}移库任务无法作业,因入库任务已绑定小车!", wrkMast.getWrkNo()); |
| | | return; |
| | | } |
| | | |
| | | // 获取源库位信息 |
| | | LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (null == sourceLoc) { |