From 263184b07832118da6283391683bdcebf15d2eec Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 03 四月 2026 17:36:01 +0800
Subject: [PATCH] yys 取绝对值
---
src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java | 9 ++++++---
1 files changed, 6 insertions(+), 3 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 ae93c3b..7f76021 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
@@ -275,18 +275,21 @@
customerInteractionDto.setInvoiceAmount(invoiceAmount);
customerInteractionDto.setReceiptAmount(currentReceiptAmount);
amountTotal = customerInteractionDto.getInvoiceAmount().subtract(customerInteractionDto.getReceiptAmount());
- customerInteractionDto.setUnReceiptAmount(amountTotal);
+ customerInteractionDto.setUnReceiptAmount(amountTotal.abs());
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()));
+ customerInteractionDto.setUnReceiptAmount(customerInteractionDto
+ .getInvoiceAmount()
+ .subtract(customerInteractionDto.getReceiptAmount())
+ .abs());
}else {
CustomerInteractionDto customerInteractionDto1 = result.get(i-1);
customerInteractionDto.setUnReceiptAmount(customerInteractionDto1.getUnReceiptAmount()
- .add(customerInteractionDto.getInvoiceAmount()).subtract(customerInteractionDto.getReceiptAmount()));
+ .add(customerInteractionDto.getInvoiceAmount()).subtract(customerInteractionDto.getReceiptAmount()).abs());
}
newResult.add(customerInteractionDto);
}
--
Gitblit v1.9.3