| | |
| | | * 组托 |
| | | * 入库站,根据条码扫描生成入库工作档,工作状态 2 |
| | | */ |
| | | @Async |
| | | public void generateStoreWrkFile() { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | |
| | | * wms入库 |
| | | * 入库站,根据条码扫描生成入库工作档,工作状态 1 ==>> 2 |
| | | */ |
| | | @Async |
| | | public void generateStoreWrkFile0() { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 当前库位组是否存在其他小车 |
| | | */ |
| | | public Integer existOtherSte(String locNo, Integer steNo) { |
| | | Integer otherSteNo = null; |
| | | for (SteSlave ste : slaveProperties.getSte()) { |
| | | if (ste.getId().equals(steNo)) { continue; } |
| | | // 获取堆垛机信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol.isEnable()) { |
| | | BasSte basSte = basSteService.selectById(ste.getId()); |
| | | if (basSte != null) { |
| | | if ((Utils.getGroupRow(locNo, true).equals(Utils.getGroupRow(basSte.getRow(), true)) |
| | | && basSte.getBay() == Utils.getBay(locNo) |
| | | && basSte.getLev() == Utils.getLev(locNo)) |
| | | || |
| | | (Utils.getGroupRow(locNo, true).equals(Utils.getGroupRow(steProtocol.getRow().intValue(), true)) |
| | | && steProtocol.getBay() == Utils.getBay(locNo) |
| | | && steProtocol.getLev() == Utils.getLev(locNo)) |
| | | ) { |
| | | otherSteNo = ste.getId(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return otherSteNo; |
| | | } |
| | | |
| | | /** |
| | | * 当前库位组是否存在空闲小车 |
| | | */ |
| | | public Integer hasCarOfIdle(String locNo) { |
| | |
| | | LocMast locMast; |
| | | // 入库搬 |
| | | if (wrkMast.getWrkSts() <= 10) { |
| | | |
| | | // 判断被移库位是否存在其他小车 |
| | | Integer otherSte = existOtherSte(wrkMast.getLocNo(), steNo); |
| | | if (otherSte != null) { |
| | | log.warn("{}号小车移入{}库位组失败,原因:存在{}号穿梭车!", steNo, wrkMast.getLocNo(), otherSte); |
| | | return; |
| | | } |
| | | |
| | | locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | // 堆垛机命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | |
| | | } |
| | | // 出库搬 |
| | | } else { |
| | | // 判断被移库位是否存在其他小车 |
| | | Integer otherSte = existOtherSte(wrkMast.getSourceLocNo(), steNo); |
| | | if (otherSte != null) { |
| | | log.warn("{}号小车移入{}库位组失败,原因:存在{}号穿梭车!", steNo, wrkMast.getSourceLocNo(), otherSte); |
| | | return; |
| | | } |
| | | |
| | | locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | // 堆垛机命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | |
| | | log.error("{}号穿梭车在数据库不存在!!!", steNo); |
| | | return; |
| | | } |
| | | |
| | | String idleLocNo = basSte.getIdleLoc(); |
| | | |
| | | // 判断被移库位是否存在其他小车 |
| | | Integer otherSte = existOtherSte(idleLocNo, steNo); |
| | | if (otherSte != null) { |
| | | log.warn("{}号小车移入{}库位组失败,原因:存在{}号穿梭车!", steNo, idleLocNo, otherSte); |
| | | return; |
| | | } |
| | | |
| | | // 堆垛机命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 堆垛机编号 |