| | |
| | | // return R.error("当前库位不为在库,或者空货架,不支持移库"); |
| | | |
| | | // 校验楼层 |
| | | if (agvLocMast.getLocType1() != 3) { // 不为箱壳区域 |
| | | if (agvLocMast.getLocType1() != 3 && agvLocMast.getLocType1() != 6) { // 不为箱壳区域 |
| | | if (agvLocMast.getFloor() != floor) { |
| | | throw new CoolException("当前库位不支持跨楼层转移"); |
| | | } else { |
| | |
| | | throw new CoolException("当前库位请选择调拨单调拨!"); |
| | | } else if ((agvLocMast.getFloor() == 2 || agvLocMast.getFloor() == 3) && (floor == 1 || floor == 4)) { |
| | | throw new CoolException("当前库位请选择调拨回流单回退!"); |
| | | } else if (agvLocMast.getFloor() == 1 && agvLocMast.getLev1() == 2 && floor == 4) { |
| | | ioType = 11; |
| | | } else { |
| | | ioType = 12; |
| | | } |
| | | } else { |
| | | if (agvLocMast.getFloor() == 1) { |
| | | if (agvLocMast.getLev1() == 1 && floor == 1) { |
| | | ioType = 11; |
| | | } else if (agvLocMast.getLev1() == 2 && floor == 4) { |
| | | ioType = 11; |
| | | } else { |
| | | ioType = 12; |
| | |
| | | //货架编码 |
| | | mast.setBarcode(agvLocMast.getBarcode()); |
| | | //货架类型 |
| | | mast.setWhsType(30); |
| | | mast.setWhsType(Integer.parseInt(agvLocMast.getBarcode().substring(0, 2))); |
| | | |
| | | mast.setAppeUser(userId); |
| | | mast.setAppeTime(now); |
| | |
| | | throw new CoolException("非手动调拨任务,不支持次功能"); |
| | | } |
| | | if (!Cools.isEmpty(agvWrkMast.getSourceLocNo())) { |
| | | throw new CoolException("当前货架码任有源库位,请确认"); |
| | | throw new CoolException("当前货架码有源库位,请确认"); |
| | | } |
| | | AgvBasDevp agvBasDevp = agvBasDevpService.selectByDevNo(param.getDevNo()); |
| | | if (Cools.isEmpty(agvWrkMast)) { |
| | |
| | | // TODO: 四期 |
| | | List<AgvWrkDetl> agvWrkDetls = agvWrkDetlService.selectList(new EntityWrapper<AgvWrkDetl>().eq("supp_code", param.getBarcode())); |
| | | String factory = param.getFactory(); |
| | | AgvLocMast newLocMast = agvCommonService.getLocByLocRule(3, 1, factory); |
| | | AgvLocMast newLocMast = agvCommonService.getLocByLocRule20(3, 1, factory, false); |
| | | if (newLocMast == null) { |
| | | throw new CoolException("无可用库位"); |
| | | } |
| | |
| | | agvWrkMast.setModiTime(now); |
| | | agvWrkMast.setIoTime(now); |
| | | // 打标记,若库位不够,入库到别的楼层,那么需要跨层移库 |
| | | if (!Cools.isEmpty(factory)){ |
| | | if (newLocMast.getLev1() == 1 && factory.equals(AsrsConstants.SANCHANG)) { |
| | | agvWrkMast.setPacked("1"); |
| | | } else if (newLocMast.getLev1() == 2 && factory.equals(AsrsConstants.ERCHANG)) { |
| | | agvWrkMast.setPacked("1"); |
| | | if (!Cools.isEmpty(factory)) { |
| | | if (newLocMast.getLev1() == 1 && !factory.equals(AsrsConstants.SANCHANG)) { |
| | | agvWrkMast.setCtnNo("1"); |
| | | } else if (newLocMast.getLev1() == 2 && !factory.equals(AsrsConstants.ERCHANG)) { |
| | | agvWrkMast.setCtnNo("2"); |
| | | } |
| | | } |
| | | if (!agvWrkMastService.update(agvWrkMast, new EntityWrapper<AgvWrkMast>().eq("wrk_no", agvWrkMast.getWrkNo()))) { |
| | |
| | | } else { |
| | | orderDetl = orderDetls.get(0); |
| | | } |
| | | orderDetl.setQty(orderDetl.getQty() - agvWrkDetl.getAnfme()); |
| | | double v = orderDetl.getQty() - agvWrkDetl.getAnfme(); |
| | | orderDetl.setQty(v < 0 ? 0 : v); |
| | | if (!orderDetlService.updateById(orderDetl)) { |
| | | throw new CoolException("修改订单明细失败,请联系管理员" + orderDetl.getOrderNo() + orderDetl.getMatnr()); |
| | | } |