From 15929f913857a779c6d4e792a203a5dacc62e6c8 Mon Sep 17 00:00:00 2001
From: 1098226878 <1098226878@qq.com>
Date: 星期二, 07 九月 2021 17:51:06 +0800
Subject: [PATCH] 优化代码
---
service-fee/src/main/java/com/java110/fee/discount/impl/DiscountWithoutArrearsRule.java | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/service-fee/src/main/java/com/java110/fee/discount/impl/DiscountWithoutArrearsRule.java b/service-fee/src/main/java/com/java110/fee/discount/impl/DiscountWithoutArrearsRule.java
old mode 100644
new mode 100755
index 020a509..45c136c
--- a/service-fee/src/main/java/com/java110/fee/discount/impl/DiscountWithoutArrearsRule.java
+++ b/service-fee/src/main/java/com/java110/fee/discount/impl/DiscountWithoutArrearsRule.java
@@ -4,7 +4,7 @@
import com.java110.dto.fee.FeeDto;
import com.java110.dto.feeDiscount.ComputeDiscountDto;
import com.java110.dto.feeDiscount.FeeDiscountDto;
-import com.java110.dto.feeDiscountSpec.FeeDiscountSpecDto;
+import com.java110.dto.feeDiscount.FeeDiscountSpecDto;
import com.java110.fee.discount.IComputeDiscount;
import com.java110.intf.fee.IFeeInnerServiceSMO;
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +13,7 @@
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
+import java.util.Map;
/**
* 鎵撴姌鏃犳瑺璐硅鍒�
@@ -95,7 +96,7 @@
//澶╂暟涓嶅ぇ浜�1澶╂椂鎸�1澶╂潵绠�
day = (date.getTime() - endTime.getTime()) / (1000 * 60 * 60 * 24) + 1;
}
- if (day >= arrearsDay) {
+ if (day > arrearsDay) {
ComputeDiscountDto computeDiscountDto = new ComputeDiscountDto();
computeDiscountDto.setDiscountId(feeDiscountDto.getDiscountId());
computeDiscountDto.setDiscountType(FeeDiscountDto.DISCOUNT_TYPE_D);
@@ -106,8 +107,8 @@
computeDiscountDto.setFeeDiscountSpecs(feeDiscountSpecDtos);
return computeDiscountDto;
}
- double price = computeFeeSMOImpl.getFeePrice(feeDtos.get(0));
- BigDecimal priceDec = new BigDecimal(price);
+ Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDtos.get(0));
+ BigDecimal priceDec = new BigDecimal(feePriceAll.get("feePrice").toString());
BigDecimal cycleDec = new BigDecimal(feeDiscountDto.getCycles());
double discountPrice = priceDec.multiply(cycleDec).multiply(new BigDecimal(1.0 - rate)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
--
Gitblit v1.8.0