| | |
| | | } |
| | | |
| | | //退回 |
| | | @Transactional |
| | | public void returned(List<PlaQty> plaQties, User user) { |
| | | plaQties.forEach(plaQty -> { |
| | | PlaQty plaQtyOut = plaQtyService.selectById(plaQty.getId()); |
| | | if(Cools.isEmpty(plaQtyOut.getReturned())){ |
| | | if(Cools.isEmpty(plaQtyOut.getReturned()) || plaQtyOut.getReturned() == 0){ |
| | | plaQtyOut.setReturned(plaQty.getOrderWeight()); |
| | | }else { |
| | | plaQtyOut.setReturned(plaQty.getOrderWeight()+plaQtyOut.getReturned()); |
| | | throw new CoolException("该包物料已退回"); |
| | | //plaQtyOut.setReturned(plaQty.getOrderWeight()+plaQtyOut.getReturned()); |
| | | } |
| | | plaQtyService.updateById(plaQtyOut); |
| | | |
| | |
| | | plaQtyReturned.setLocNo(plaQtyOut.getLocNo()); |
| | | plaQtyReturned.setOrderNo(plaQtyOut.getOrderNo()); |
| | | plaQtyReturned.setPakoutTime(Utils.getDateStr(new Date())); |
| | | plaQtyReturned.setBrand(plaQty.getBrand()); |
| | | plaQtyReturned.setOrderWeight(plaQty.getOrderWeight()); |
| | | plaQtyReturned.setTransfer("退回入库"); |
| | | plaQtyReturned.setHandlerBy(user.getUsername()); |
| | |
| | | this.updateById(pla); |
| | | |
| | | SaasUtils.insertLog(0,pla.getLocNo(),pla.getBrand(),plaQty.getOrderWeight(),user.getUsername(), |
| | | null,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop()); |
| | | null,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop(),null); |
| | | |
| | | }); |
| | | } |