| | |
| | | } |
| | | if (!items.isEmpty()) { |
| | | double purQty = items.stream().mapToDouble(WkOrderItem::getAnfme).sum(); |
| | | if (asnOrderMapper.update(null, new LambdaUpdateWrapper<WkOrder>() |
| | | .set(WkOrder::getExceStatus, AsnExceStatus.OUT_STOCK_STATUS_TASK_INIT.val) |
| | | .set(WkOrder::getAnfme, purQty).eq(WkOrder::getId, order.getId())) <= 0) { |
| | | WkOrder currentOrder = asnOrderMapper.selectById(order.getId()); |
| | | if (Objects.isNull(currentOrder)) { |
| | | throw new CoolException("单据数量修改失败!!"); |
| | | } |
| | | currentOrder.setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_INIT.val) |
| | | .setAnfme(purQty); |
| | | if (asnOrderMapper.updateById(currentOrder) <= 0) { |
| | | throw new CoolException("单据数量修改失败!!"); |
| | | } |
| | | } |