| | |
| | | } |
| | | LocMast locMast = null; |
| | | // 修改源库位状态 O.空库位 |
| | | // locMast = locMastService.selectById(sourceLocNo); |
| | | // locMast.setLocSts("O"); |
| | | // locMast.setModiTime(new Date()); |
| | | // if (!locMastService.updateById(locMast)) { |
| | | // throw new CoolException(wrkMast.getWrkNo() + "修改源库位状态 O.空库位"); |
| | | // } |
| | | locMast = locMastService.selectById(sourceLocNo); |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(new Date()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException(wrkMast.getWrkNo() + "修改源库位状态 O.空库位"); |
| | | } |
| | | // 修改目标库位状态 Q.拣料/盘点/并板再入库 |
| | | locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | locMast.setLocSts("Q"); |
| | |
| | | /** |
| | | * 盘点货物抵达盘点目标站 wrkMast.sourceLoc P ===>> O |
| | | */ |
| | | public void pickWrkCompleteStaNo() { |
| | | public void pickWrkCompleteStaNo0() { |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历拣料入库口 |
| | | for (DevpSlave.Sta pickSta : devp.getPickOutSta()) { |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.getWorkNo() > 0) { |
| | | WrkMast wrkMast = wrkMastMapper.selectPick17(pickSta.getStaNo(), staProtocol.getWorkNo().intValue()); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | log.error("{}站拣料、并板、盘点检索任务失败!任务号:{}", pickSta.getStaNo(), staProtocol.getWorkNo()); |
| | | } else { |
| | | // 修改源库位状态 O.空库位 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (locMast.getLocSts().equals("P")) { |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(new Date()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException(wrkMast.getWrkNo() + "修改源库位状态 O.空库位"); |
| | | } |
| | | } |
| | | // 修改工作档 |
| | | wrkMast.setIoPri(13D); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("更新工作档的优先级失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | // WrkMast wrkMast = wrkMastMapper.selectPick17(pickSta.getStaNo(), staProtocol.getWorkNo().intValue()); |
| | | // if (Cools.isEmpty(wrkMast)) { |
| | | // log.error("{}站拣料、并板、盘点检索任务失败!任务号:{}", pickSta.getStaNo(), staProtocol.getWorkNo()); |
| | | // } else { |
| | | // // 修改源库位状态 O.空库位 |
| | | // LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | // if (locMast.getLocSts().equals("P")) { |
| | | // locMast.setLocSts("O"); |
| | | // locMast.setModiTime(new Date()); |
| | | // if (!locMastService.updateById(locMast)) { |
| | | // throw new CoolException(wrkMast.getWrkNo() + "修改源库位状态 O.空库位"); |
| | | // } |
| | | // } |
| | | // // 修改工作档 |
| | | // wrkMast.setIoPri(13D); |
| | | // if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | // log.error("更新工作档的优先级失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 盘点货物抵达盘点目标站 wrkMast.sourceLoc P ===>> O |
| | | */ |
| | | public void pickWrkCompleteStaNo() { |
| | | List<WrkMast> wrkMasts = wrkMastMapper.selectPick17(null, null); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | // 修改源库位状态 O.空库位 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (locMast.getLocSts().equals("P")) { |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(new Date()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException(wrkMast.getWrkNo() + "修改源库位状态 O.空库位"); |
| | | } |
| | | } |
| | | // 修改工作档 |
| | | wrkMast.setIoPri(13D); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("更新工作档的优先级失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | // todo |
| | | } |
| | | // 不是最外层库位,需要使用穿梭车搬运后,再堆垛机移库 |
| | | } else { |
| | |
| | | SteThread steThread = queryIdleCar(wrkMast); |
| | | if (steThread != null) { |
| | | if (null == wrkMastMapper.selectPakout(slave.getId(), steNo)) { |
| | | // 标记移库当前流程 |
| | | wrkMast.setMk("O"); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("标记移库当前流程 I 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | // 让小车等待搬运待续 |
| | | this.letCarBeReady(wrkMast, steThread.getSlave().getId(), wrkMast.getSourceLocNo()); |
| | | } |
| | |
| | | } |
| | | } |
| | | LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if(sourceLoc.getLocSts().equals("F")){ |
| | | // if(sourceLoc.getLocSts().equals("F")){ |
| | | sourceLoc.setLocSts("R"); // R.出库预约 |
| | | sourceLoc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | | throw new CoolException("更新移库回库目标库位状态失败"); |
| | | } |
| | | } |
| | | // } |
| | | break; |
| | | } |
| | | } |
| | |
| | | if (steThread != null) { |
| | | // 没有其他任务 |
| | | if (null == wrkMastMapper.selectPakin(slave.getId(), steNo)) { |
| | | // 标记移库当前流程 |
| | | wrkMast.setMk("I"); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("标记移库当前流程 I 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | // 让小车等待搬运待续 |
| | | this.letCarBeReady(wrkMast, steThread.getSlave().getId(), wrkMast.getLocNo()); |
| | | } |
| | |
| | | // } |
| | | if (locMastService.isOutMost(wrkMast.getLocNo())) { |
| | | wrkMast.setWrkSts(17L); |
| | | // LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | // locMast.setLocSts("F"); |
| | | // locMast.setModiTime(new Date()); |
| | | // if (!locMastService.updateById(locMast)) { |
| | | // log.error(""); |
| | | // } |
| | | } |
| | | wrkMast.setModiTime(now); |
| | | // 修改成功后复位堆垛机 |
| | |
| | | // 修改工作档状态 11.生成出库ID => 12.小车待搬 |
| | | wrkMast.setWrkSts(12L); |
| | | } else { |
| | | // if (Cools.isEmpty(wrkMast.getMk())) { |
| | | // log.error("移库工作档没有流程标记!!,工作号={}", wrkMast.getWrkNo()); |
| | | // } else { |
| | | // if (wrkMast.getMk().equals("I")) { |
| | | // String locNo = wrkMast.getLocNo(); |
| | | // if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) { |
| | | // // 修改工作档状态 11.生成出库ID => 6.小车待入 |
| | | // wrkMast.setWrkSts(6L); |
| | | // } else { |
| | | // // 修改工作档状态 11.生成出库ID => 3.小车待搬 |
| | | // wrkMast.setWrkSts(3L); |
| | | // } |
| | | // } else if (wrkMast.getMk().equals("O")) { |
| | | // // 修改工作档状态 11.生成出库ID => 12.小车待搬 |
| | | // wrkMast.setWrkSts(12L); |
| | | // } |
| | | // } |
| | | if (Cools.isEmpty(wrkMast.getMk())) { |
| | | log.error("移库工作档没有流程标记!!,工作号={}", wrkMast.getWrkNo()); |
| | | } else { |
| | | if (wrkMast.getMk().equals("I")) { |
| | | String locNo = wrkMast.getLocNo(); |
| | | if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) { |
| | | // 修改工作档状态 11.生成出库ID => 6.小车待入 |
| | | wrkMast.setWrkSts(6L); |
| | | } else { |
| | | // 修改工作档状态 11.生成出库ID => 3.小车待搬 |
| | | wrkMast.setWrkSts(3L); |
| | | } |
| | | } else if (wrkMast.getMk().equals("O")) { |
| | | // 修改工作档状态 11.生成出库ID => 12.小车待搬 |
| | | wrkMast.setWrkSts(12L); |
| | | } |
| | | } |
| | | } |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |