| | |
| | | if (matBarcode != null){ |
| | | throw new CoolException("该物料已经绑定托盘,请勿重复绑定"); |
| | | } |
| | | if (mat.getColor().equals("报废")){ |
| | | throw new CoolException("该物料已报废,请勿绑定"); |
| | | } |
| | | MatBarcode mb=new MatBarcode(); |
| | | mb.setZpallet(waitPakin.getBarcode()); |
| | | mb.setMatnr(mat.getMatnr()); |
| | |
| | | throw new CoolException("物料托盘绑定失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void addBarcodeMatnrTwo(Mat mat) { |
| | | Mat m = matService.selectById(mat); |
| | | if (m == null){ |
| | | throw new CoolException("物料不存在,请先添加物料数据"); |
| | | } |
| | | MatBarcode matBarcode = matBarcodeMapper.selectByMatnr(mat.getMatnr()); |
| | | if (matBarcode != null){ |
| | | throw new CoolException("该物料已经绑定托盘,请勿重复绑定"); |
| | | } |
| | | if (mat.getColor().equals("报废")){ |
| | | throw new CoolException("该物料已报废,请勿绑定"); |
| | | } |
| | | MatBarcode mb=new MatBarcode(); |
| | | mb.setZpallet(mat.getUnit()); |
| | | mb.setMatnr(mat.getMatnr()); |
| | | mb.setMaktx(mat.getMaktx()); |
| | | mb.setSpecs(mat.getSpecs()); |
| | | mb.setModel(mat.getModel()); |
| | | if (!matBarcodeService.insert(mb)){ |
| | | throw new CoolException("物料托盘绑定失败"); |
| | | } |
| | | } |
| | | } |