| | |
| | | if (wkOrders.isEmpty()) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | |
| | | Config allowChang = configService.getOne(new LambdaQueryWrapper<Config>().eq(Config::getFlag, GlobalConfigCode.ALLOW_OVER_CHANGE)); |
| | | |
| | | wkOrders.forEach(order -> { |
| | | //检查单据是否完成 |
| | | //判断是否允许超收,不允许超收添加拒收判断 |
| | | if (!Objects.isNull(allowChang)) { |
| | | if (!Boolean.parseBoolean(allowChang.getVal())) { |
| | | if (order.getAnfme().compareTo(order.getQty()) == 0) { |
| | | order.setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_DONE.val); |
| | | // if (order.getType().equals(OrderType.ORDER_IN)) { |
| | | // order.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val); |
| | | // } else { |
| | | // order.setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_DONE.val); |
| | | // } |
| | | if (!asnOrderService.updateById(order)) { |
| | | throw new CoolException("出库单更新状态失败"); |
| | | } |
| | | } |
| | | } else { |
| | | if (order.getAnfme().compareTo(order.getQty()) <= 0) { |
| | | order.setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_DONE.val); |
| | | if (!asnOrderService.updateById(order)) { |
| | | throw new CoolException("出库单更新状态失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //检查单据是否完成 |
| | | |
| | | }); |
| | | //出库单上报RCS修改库位状态 |
| | | try { |