| | |
| | | if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | if (param.getCombMats().size() > 1) { |
| | | throw new CoolException("请提取一个商品,或者刷新重新组托!"); |
| | | } |
| | | // if (param.getCombMats().size() > 1) { |
| | | // throw new CoolException("请提取一个商品,或者刷新重新组托!"); |
| | | // } |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) { |
| | |
| | | if (param.getBarcode().length() != 8) { |
| | | throw new CoolException("条码长度不是8位===>>" + param.getBarcode()); |
| | | } |
| | | if (param.getCombMats().size() > 1) { |
| | | throw new CoolException("不允许混料===>>" + param.getBarcode()); |
| | | } |
| | | // if (param.getCombMats().size() > 1) { |
| | | // throw new CoolException("不允许混料===>>" + param.getBarcode()); |
| | | // } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | |
| | | param.getCombMats().forEach(elem -> { |
| | | // TODO 不考虑代码效率,因为旧代码bug少 |
| | | if (!Cools.isEmpty(elem.getVbarcode())) { |
| | | NccJcQilibcBarcodeflowWms vbarcode1 = barcodeflowWmsService.selectOne(new EntityWrapper<NccJcQilibcBarcodeflowWms>().eq("vbarcode", elem.getVbarcode())); |
| | | elem.setBatch(vbarcode1.getVbatchcode()); |
| | | elem.setMatnr(vbarcode1.getWlbm()); |
| | | elem.setAnfme(vbarcode1.getNastnum().doubleValue()); |
| | | } |
| | | |
| | | |
| | | // 订单明细数量校验 |
| | | // OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); |
| | | OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3()); |
| | | if (elem.getAnfme() > orderDetl.getEnableQty()) { |
| | | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); |
| | | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法,已经超过单据入库数量"); |
| | | } |
| | | // 修改订单作业数量 |
| | | // if (!orderDetlService.increaseWorkQty(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme())) { |