skyouc
2025-04-11 43e98544b21f452b8dfa94834dc4b8906bd2dec4
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/AsnOrderServiceImpl.java
@@ -231,6 +231,21 @@
        return R.ok("收货成功!!");
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R closeOrder(Long id) {
        AsnOrder order = this.getById(id);
        if (Objects.isNull(order)) {
            throw new CoolException("单据不存在!!");
        }
        try {
            operateOrderLogs(order);
        } catch (Exception e) {
            throw new CoolException("单据关闭失败!!");
        }
        return null;
    }
    /**
     * @author Ryan
     * @description 删除原主单及明细,加入历史档
@@ -243,6 +258,15 @@
        if (Objects.isNull(asrder) || Objects.isNull(asrder.getId())) {
            throw new CoolException("参数不能为空!!");
        }
        asrder.setExceStatus(Short.parseShort(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val));
        if (!this.updateById(asrder)) {
            throw new CoolException("单据关闭失败!!");
        }
        List<AsnOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getAsnId, asrder.getId()));
        if (orderItems.isEmpty()) {
            throw new CoolException("收货明细为空!!");
        }
        if (Objects.isNull(asrder.getAnfme()) || asrder.getAnfme().compareTo(0.00) == 0) {
            throw new CoolException("收货数量不能为零!!");
        }