| | |
| | | private ManLocDetlService manLocDetlService; |
| | | @Autowired |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | |
| | | |
| | | @Override |
| | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),elem.getProType(),elem.getTemp2()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),elem.getProType(),elem.getTemp2(),elem.getOutOrderNo()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | | assert one != null; |
| | |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | //校验当前物料与托盘绑定信息是否正确 |
| | | MatBarcode matBarcode = new MatBarcode(); |
| | | MatBarcode mb=matBarcodeService.selectbyMatnr(detlDto.getMatnr()); |
| | | if (mb != null && !mb.getZpallet().equals(param.getBarcode())){ |
| | | throw new CoolException(detlDto.getMatnr()+"该物料与其他托盘绑定,请先解绑"); |
| | | }else{ |
| | | matBarcode.setZpallet(param.getBarcode());//托盘码 |
| | | matBarcode.setMatnr(mat.getMatnr());//物料号 |
| | | matBarcode.setMaktx(mat.getMaktx());//物料名称 |
| | | matBarcode.setSpecs(mat.getSpecs());//规格 |
| | | matBarcode.setModel(mat.getModel());//型号 |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.sync(mat); |
| | | waitPakin.setProType(detlDto.getProType()); |
| | | waitPakin.setTemp2(detlDto.getTemp2()); |
| | | waitPakin.setOutOrderNo(detlDto.getOutOrderNo()); |
| | | waitPakin.setBatch(detlDto.getBatch()); |
| | | waitPakin.setZpallet(param.getBarcode()); // 托盘码 |
| | | waitPakin.setIoStatus("N"); // 入出状态 |
| | |
| | | waitPakin.setModiTime(now); |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | if (!matBarcodeService.insert(matBarcode)){ |
| | | throw new CoolException("物料与托盘绑定失败"); |
| | | } |
| | | } |
| | | // 关联组托 |
| | |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(orderDetl.getMatnr() + "商品档案不存在"); |
| | | } |
| | | //校验当前物料与托盘绑定信息是否正确 |
| | | MatBarcode matBarcode = new MatBarcode(); |
| | | MatBarcode mb=matBarcodeService.selectbyMatnr(orderDetl.getMatnr()); |
| | | if (mb != null && !mb.getZpallet().equals(param.getBarcode())){ |
| | | throw new CoolException(orderDetl.getMatnr()+"该物料与其他托盘绑定,请先解绑"); |
| | | }else{ |
| | | matBarcode.setZpallet(param.getBarcode());//托盘码 |
| | | matBarcode.setMatnr(mat.getMatnr());//物料号 |
| | | matBarcode.setMaktx(mat.getMaktx());//物料名称 |
| | | matBarcode.setSpecs(mat.getSpecs());//规格 |
| | | matBarcode.setModel(mat.getModel());//型号 |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.sync(mat); |
| | | waitPakin.setOrderNo(order.getOrderNo()); // 单据编号 |
| | |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | if (!matBarcodeService.insert(matBarcode)){ |
| | | throw new CoolException("物料与托盘绑定失败"); |
| | | } |
| | | }); |
| | | |
| | | orderService.updateSettle(order.getId(), 2L, userId); |