From 0dc15775095a25797daf376e47999f0c11486e75 Mon Sep 17 00:00:00 2001
From: luofl <1442745593@qq.com>
Date: 星期一, 07 四月 2025 22:17:13 +0800
Subject: [PATCH] 修改bug
---
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPayOrderServiceImpl.java | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPayOrderServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPayOrderServiceImpl.java
index 4d6ed9f..c8d77eb 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPayOrderServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TPayOrderServiceImpl.java
@@ -69,12 +69,13 @@
if (bill == null) {
throw new ServiceException("账单不存在");
}
- //计算欠费金额:租金+违约金-实收金额
- long rent = caculateRentFee(bill);
+ //欠费金额转成单位分比较
+ long rent = bill.getOutstandingMoney().multiply(AmountConstant.b100)
+ .setScale(2,RoundingMode.HALF_DOWN).longValue();
if (rent==0){
throw new ServiceException("该账单已缴费");
}
- if (rent>dto.getAmount()){
+ if (rent<dto.getAmount()){
throw new ServiceException("支付金额超过了账单欠费金额");
}
@@ -105,7 +106,11 @@
orderBills.add(new TOrderBill(orderNo,bill.getId()));
return bill;
}).collect(Collectors.toList());
- long sumRent = bills.stream().mapToLong((bill) -> caculateRentFee(bill)).sum();
+ //欠费金额转成单位分比较
+ long sumRent = bills.stream().mapToLong((bill)
+ -> bill.getOutstandingMoney().multiply(AmountConstant.b100)
+ .setScale(2,RoundingMode.HALF_DOWN).longValue())
+ .sum();
if (sumRent==0){
throw new ServiceException("账单已缴费");
}
--
Gitblit v1.7.1