吴羡
12 小时以前 5563586beaa4c70d0d570848fa39c12a5f1e3ed7
src/main/java/com/ruoyi/account/service/impl/sales/AccountSalesCollectionServiceImpl.java
@@ -102,7 +102,7 @@
        if (dto.getPaymentDate() == null) {
            throw new ServiceException("请选择回款日期");
        }
        if (dto.getPaymentAmount() == null || dto.getPaymentAmount().compareTo(BigDecimal.valueOf(0.01)) < 0) {
        if (dto.getPaymentAmount() == null || dto.getPaymentAmount().compareTo(new BigDecimal("0.000001")) < 0) {
            throw new ServiceException("请输入回款金额");
        }
        if (StringUtils.isEmpty(dto.getSalesContractNo())) {
@@ -122,13 +122,14 @@
        }
        List<Long> stockOutRecordIds = accountSalesCollectionMapper.selectStockOutRecordIdsBySalesLedgerId(salesLedger.getId());
        if (CollectionUtils.isEmpty(stockOutRecordIds)) {
            throw new ServiceException("该合同暂无可回款的销售出库记录");
        }
        AccountSalesCollection collection = new AccountSalesCollection();
        collection.setCustomerId(dto.getCustomerId().intValue());
        collection.setStockOutRecordIds(stockOutRecordIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
        collection.setSalesLedgerId(salesLedger.getId());
        // 合同未发货时没有出库记录,此时仍允许回款,出库单关联留空
        collection.setStockOutRecordIds(CollectionUtils.isEmpty(stockOutRecordIds)
                ? null
                : stockOutRecordIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
        collection.setCollectionDate(dto.getPaymentDate());
        collection.setCollectionAmount(dto.getPaymentAmount());
        collection.setCollectionMethod(dto.getPaymentMethod());