liyong
18 小时以前 b2089cc76bdf959a2e9ff71142dc3fcf0bd9b80b
src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.sales.dto.CustomerInteractionDto;
import com.ruoyi.sales.dto.InvoiceLedgerDto;
@@ -246,7 +247,19 @@
            customerInteractionDto.setUnReceiptAmount(amountTotal);
            result.add(customerInteractionDto);
        }
        return result;
        ArrayList<CustomerInteractionDto> newResult = new ArrayList<>();
        for (int i = 0; i < result.size(); i++) {
            CustomerInteractionDto customerInteractionDto = result.get(i);
            if (i == 0) {
                customerInteractionDto.setUnReceiptAmount(customerInteractionDto.getInvoiceAmount().subtract(customerInteractionDto.getReceiptAmount()));
            }else {
                CustomerInteractionDto customerInteractionDto1 = result.get(i-1);
                customerInteractionDto.setUnReceiptAmount(customerInteractionDto1.getUnReceiptAmount()
                        .add(customerInteractionDto.getInvoiceAmount()).subtract(customerInteractionDto.getReceiptAmount()));
            }
            newResult.add(customerInteractionDto);
        }
        return newResult;
    }
    /**
@@ -266,8 +279,15 @@
    @Override
    public void exportPaymentList(HttpServletResponse response, List<Long> ids) {
        List<ReceiptPaymentExeclDto> receiptPaymentDtoList =  receiptPaymentMapper.bindInvoiceNoRegListByIds(ids);
        ExcelUtil<ReceiptPaymentExeclDto> util = new ExcelUtil<ReceiptPaymentExeclDto>(ReceiptPaymentExeclDto.class);
        util.exportExcel(response, receiptPaymentDtoList, "回款登记");
        if (ids == null) {
            List<ReceiptPaymentExeclDto> receiptPaymentDtoList =  receiptPaymentMapper.bindInvoiceNoRegListByIds(new ArrayList<>(), SecurityUtils.getLoginUser().getTenantId());
            ExcelUtil<ReceiptPaymentExeclDto> util = new ExcelUtil<ReceiptPaymentExeclDto>(ReceiptPaymentExeclDto.class);
            util.exportExcel(response, receiptPaymentDtoList, "回款登记");
        }else {
            List<ReceiptPaymentExeclDto> receiptPaymentDtoList =  receiptPaymentMapper.bindInvoiceNoRegListByIds(ids,SecurityUtils.getLoginUser().getTenantId());
            ExcelUtil<ReceiptPaymentExeclDto> util = new ExcelUtil<ReceiptPaymentExeclDto>(ReceiptPaymentExeclDto.class);
            util.exportExcel(response, receiptPaymentDtoList, "回款登记");
        }
    }
}