From f8dc8889897431d908c658fb415186d39b963eb6 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期三, 14 一月 2026 18:05:44 +0800
Subject: [PATCH] yys 销售报价,供应商,客户
---
src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java | 55 ++-----------------------------------------------------
1 files changed, 2 insertions(+), 53 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
index e93d62f..5a19bde 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
@@ -256,59 +256,8 @@
* @return
*/
@Override
- public List<CustomerInteractionDto> customerInteractions(ReceiptPaymentDto receiptPaymentDto) {
- ArrayList<CustomerInteractionDto> result = new ArrayList<>();
- List<CustomerInteractionDto> customerInteractionDtos = receiptPaymentMapper.customerInteractions(receiptPaymentDto);
- if(CollectionUtils.isEmpty(customerInteractionDtos)){
- return result;
- }
- // 搴旀敹鎬婚噾棰濋噾棰濊绠�
- BigDecimal amountTotal = BigDecimal.ZERO;
- Map<LocalDate, List<CustomerInteractionDto>> dateListMap = customerInteractionDtos.stream().collect(
- Collectors.groupingBy(
- CustomerInteractionDto::getHappenTime,
- LinkedHashMap::new,
- Collectors.toList()
- )
- );
- for (LocalDate localDate : dateListMap.keySet()) {
- BigDecimal currentReceiptAmount = BigDecimal.ZERO;
- BigDecimal invoiceAmount = BigDecimal.ZERO;
- BigDecimal currentDateTotal = BigDecimal.ZERO;
- List<CustomerInteractionDto> customerInteractionDtoList = dateListMap.get(localDate);
- // 璁$畻褰撳ぉ鏀舵鏁�
- currentReceiptAmount = customerInteractionDtoList.stream()
- .filter(item ->item.getType() == 0)
- .map(CustomerInteractionDto::getReceiptAmount)
- .reduce(BigDecimal.ZERO,BigDecimal::add);
- // 璁$畻褰撳ぉ寮�绁ㄦ暟
- invoiceAmount = customerInteractionDtoList.stream()
- .filter(item ->item.getType() == 1)
- .map(CustomerInteractionDto::getInvoiceAmount)
- .reduce(BigDecimal.ZERO,BigDecimal::add);
- // 璁$畻褰撴棩姹囨��
- currentDateTotal = currentDateTotal.add(invoiceAmount).subtract(currentReceiptAmount);
- CustomerInteractionDto customerInteractionDto = new CustomerInteractionDto();
- customerInteractionDto.setHappenTime(localDate);
- customerInteractionDto.setInvoiceAmount(invoiceAmount);
- customerInteractionDto.setReceiptAmount(currentReceiptAmount);
- amountTotal = customerInteractionDto.getInvoiceAmount().subtract(customerInteractionDto.getReceiptAmount());
- customerInteractionDto.setUnReceiptAmount(amountTotal);
- result.add(customerInteractionDto);
- }
- 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;
+ public List<InvoiceLedgerDto> customerInteractions(InvoiceLedgerDto receiptPaymentDto) {
+ return receiptPaymentMapper.invoiceLedgerSalesAccount(receiptPaymentDto);
}
/**
--
Gitblit v1.9.3