| | |
| | | |
| | | } |
| | | |
| | | double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |
| | | Double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |
| | | |
| | | if (!waitPakinItemService.saveBatch(items)) { |
| | | throw new CoolException("组托明细保存失败!!"); |
| | |
| | | if (Objects.isNull(one)) { |
| | | throw new CoolException("收货区数据错误!!"); |
| | | } |
| | | // one.setAnfme(one.getAnfme() - pakinItem.getAnfme()) |
| | | one.setWorkQty(one.getWorkQty() + pakinItem.getAnfme() + one.getQty()); |
| | | if (one.getWorkQty() > one.getAnfme()) { |
| | | Double workQty = Math.round((one.getWorkQty() + pakinItem.getAnfme()) * 10000) / 10000.0; |
| | | Double qty = Math.round((workQty + one.getQty()) * 10000) / 10000.0; |
| | | one.setWorkQty(workQty); |
| | | if (qty.compareTo(one.getAnfme()) > 0) { |
| | | throw new CoolException("组托数量不能大于收货数量!!"); |
| | | } |
| | | if (!warehouseAreasItemService.saveOrUpdate(one)) { |
| | |
| | | if (!this.updateById(waitPakin1)) { |
| | | throw new CoolException("组托数量修改失败!!"); |
| | | } |
| | | |
| | | //TODO 组托完成后,扣减收货区库存 |
| | | |
| | | return pakin; |
| | | } |
| | | |