| | |
| | | if (Cools.isEmpty(agvBasDevp)) { |
| | | throw new CoolException("暂无" + station + "站点"); |
| | | } |
| | | AgvBasDevp agvBasDevp2 = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("barcode", containerCode).ne("dev_no", agvBasDevp.getDevNo())); |
| | | if (!Cools.isEmpty(agvBasDevp2)) { |
| | | throw new CoolException(station + "站点绑定该货架,无法入库"); |
| | | } |
| | | int br = 0; |
| | | if (containerType == 21 && agvBasDevp.getFloor() == 2) { |
| | | containerType = 20; |
| | |
| | | if (Cools.isEmpty(agvBasDevp)) { |
| | | throw new CoolException("暂无" + station + "站点"); |
| | | } |
| | | |
| | | AgvBasDevp agvBasDevp2 = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("barcode", containerCode).ne("dev_no", agvBasDevp.getDevNo())); |
| | | if (!Cools.isEmpty(agvBasDevp2)) { |
| | | throw new CoolException(station + "站点绑定该货架,无法入库"); |
| | | } |
| | | if (Cools.isEmpty(agvBasDevp)) { |
| | | throw new CoolException("暂无" + station + "站点"); |
| | | } |
| | | |
| | | int br = 0; |
| | | if (containerType == 21 && agvBasDevp.getFloor() == 2) { |
| | | containerType = 20; |
| | |
| | | String ctnNo = null; |
| | | // 打标记,若库位不够,入库到别的楼层,那么需要跨层移库 |
| | | if (!Cools.isEmpty(code)) { |
| | | if (agvLocMast.getLev1() == 1 && !code.equals(AsrsConstants.SANCHANG)) { |
| | | ctnNo = "1"; |
| | | } else if (agvLocMast.getLev1() == 2 && !code.equals(AsrsConstants.ERCHANG)) { |
| | | if (agvLocMast.getLev1() == 1 && code.equals(AsrsConstants.ERCHANG)) { |
| | | ctnNo = "2"; |
| | | } else if (agvLocMast.getLev1() == 2 && code.equals(AsrsConstants.SANCHANG)) { |
| | | ctnNo = "1"; |
| | | } |
| | | } |
| | |
| | | AgvBasDevp agvBasDevp = agvBasDevpService.selectById(station); |
| | | if (Cools.isEmpty(agvBasDevp)) { |
| | | throw new CoolException("暂无" + station + "站点"); |
| | | } |
| | | AgvBasDevp agvBasDevp2 = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("barcode", containerCode).ne("dev_no", agvBasDevp.getDevNo())); |
| | | if (!Cools.isEmpty(agvBasDevp2)) { |
| | | throw new CoolException(station + "站点绑定该货架,无法入库"); |
| | | } |
| | | int br = 0; |
| | | if (containerType == 21 && agvBasDevp.getFloor() == 2) { |
| | |
| | | if (Cools.isEmpty(agvLocMast)) { |
| | | throw new CoolException("暂无当前出库站点类型的空货架!"); |
| | | } |
| | | if (!Cools.isEmpty(agvBasDevp.getArea())) { |
| | | if (!Cools.isEmpty(agvLocMast.getBarcode())) { |
| | | if (!agvBasDevp.getArea().contains(agvLocMast.getBarcode().substring(0, 2))) { |
| | | throw new CoolException("1当前出库站点不允许叫该类型的货架:" + agvLocMast.getBarcode()); |
| | | } |
| | | }else { |
| | | if (!agvBasDevp.getArea().contains(agvLocMast.getLocType1$().toString())) { |
| | | throw new CoolException("2当前出库站点不允许叫该类型的货架:" + agvLocMast.getBarcode()); |
| | | } |
| | | } |
| | | } |
| | | //生成工作档 |
| | | createWrkMast(110, 21L, agvLocMast.getLocNo(), agvBasDevp.getDevNo(), agvLocMast.getBarcode(), now, userId, containerType, agvLocMast.getPltType()); |
| | | |
| | |
| | | updateAgvBasDevp(agvBasDevp, "S", (short) containerType, agvLocMast.getBarcode()); |
| | | |
| | | } |
| | | |
| | | |
| | | @Transactional |
| | | public void adjustLocDetl(LocDetlAdjustParam param, Long userId) { |
| | |
| | | List<AgvLocDetl> locDetls = agvLocDetlService.selectList(new EntityWrapper<AgvLocDetl>().eq("loc_no", param.getLocNo())); |
| | | |
| | | List<LocDetlAdjustParam.LocDetlAdjust> list = param.getList(); |
| | | |
| | | String barcode = null; |
| | | // 修改数量 |
| | | Iterator<AgvLocDetl> iterator = locDetls.iterator(); |
| | | while (iterator.hasNext()) { |
| | |
| | | locDetl.setThreeCode(adjust.getThreeCode()); |
| | | locDetl.setDeadTime(adjust.getDeadTime()); |
| | | locDetl.setSuppCode(adjust.getSuppCode()); |
| | | barcode = adjust.getSuppCode(); |
| | | if (!agvLocDetlService.insert(locDetl)) { |
| | | throw new CoolException("添加" + locDetl.getLocNo() + "库位," + locDetl.getMatnr() + "商品," + locDetl.getBatch() + "序列码库存明细失败"); |
| | | } |
| | |
| | | if (locMast.getLocSts().equals("D") || locMast.getLocSts().equals("O")) { |
| | | if (count > 0) { |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(barcode); |
| | | } |
| | | } |
| | | locMast.setModiUser(userId); |
| | |
| | | String devNo = wrkMast.getSourceLocNo(); |
| | | //目标库位 |
| | | String locNo = wrkMast.getLocNo(); |
| | | if (!Cools.isEmpty(locNo)) { |
| | | agvLocDetlService.delete(new EntityWrapper<AgvLocDetl>().eq("loc_no", locNo)); |
| | | } |
| | | agvLocMastService.updateLocStsByLocNo(locNo, "O", "", null); |
| | | if (wrkMast.getIoType() == 58) { |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(devNo, "F", wrkMast.getBarcode(), wrkMast.getWhsType().shortValue()); |
| | |
| | | if (!orderDetlService.update(orderDetl, new EntityWrapper<OrderDetl>().eq("order_no", "DB" + agvLocDetl.getOrderNo()).eq("matnr", agvLocDetl.getMatnr()).eq("three_code", agvLocDetl.getThreeCode()))) { |
| | | throw new CoolException("修改订单明细失败,请联系管理员" + agvLocDetl.getOrderNo() + agvLocDetl.getMatnr()); |
| | | } |
| | | } else { |
| | | orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("matnr", agvLocDetl.getMatnr()).eq("three_code", agvLocDetl.getThreeCode()).eq("source", 33).ge("qty", agvLocDetl.getAnfme())); |
| | | if (orderDetl != null) { |
| | | orderDetl.setQty(orderDetl.getQty() - agvLocDetl.getAnfme()); |
| | | if (!orderDetlService.update(orderDetl, new EntityWrapper<OrderDetl>().eq("order_no", orderDetl.getOrderNo()).eq("matnr", agvLocDetl.getMatnr()).eq("three_code", agvLocDetl.getThreeCode()))) { |
| | | //throw new CoolException("修改订单明细失败,请联系管理员" + agvLocDetl.getOrderNo() + agvLocDetl.getMatnr()); |
| | | } |
| | | } |
| | | } |
| | | // FlowLog flowLog = new FlowLog(); |
| | | // flowLog.setFid(String.valueOf(flowId)); |
| | |
| | | throw new CoolException("删除失败,请联系管理员"); |
| | | } |
| | | |
| | | if (type == 2) { |
| | | //调用agv取消任务接口 |
| | | agvWrkMastService.callCancelTask(wrkMast.getWrkNo()); |
| | | if (type == 2 || type == 5) { |
| | | try { |
| | | //调用agv取消任务接口 |
| | | agvWrkMastService.callCancelTask(wrkMast.getWrkNo()); |
| | | } catch (Exception e) { |
| | | log.info("调用agv取消任务接口失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | OrderDetl orderDetl = orderDetlService.selectItem(orderNo, mat.getMatnr(), batch, csocode); |
| | | if (orderDetl == null) { |
| | | throw new CoolException("订单明细不存在"); |
| | | orderDetl = orderDetlService.selectItem(orderNo, mat.getMatnr(), null, csocode); |
| | | if (orderDetl == null) { |
| | | throw new CoolException("订单明细不存在"); |
| | | } |
| | | } |
| | | AgvWrkDetl wrkDetl = new AgvWrkDetl(); |
| | | wrkDetl.sync(mat); |