From e6caf7b3eb84c5ccb9106f8a849a43085bedfcbf Mon Sep 17 00:00:00 2001
From: zhangyh <zhangyahui@wealthgrow.cn>
Date: Thu, 18 Mar 2021 16:01:50 +0800
Subject: [PATCH] init

---
 .../fund/service/impl/ProductServiceImpl.java | 20 ++++++-------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java b/src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
index fe14106..6310525 100644
--- a/src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+++ b/src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
@@ -779,13 +779,9 @@ public class ProductServiceImpl implements ProductService, Constant {
                 if (i < fundNavs.size() - 1) {
                     FundNav pre = fundNavs.get(i + 1);
 
-                    if (pre.getCumulativeNavWithdrawal() != null && f.getCumulativeNavWithdrawal() != null) {
-                        if (pre.getCumulativeNavWithdrawal().compareTo(BigDecimal.ZERO) == 1) {
-                            BigDecimal dailyIncrease = f.getCumulativeNavWithdrawal().subtract(pre.getCumulativeNavWithdrawal()).divide(pre.getCumulativeNavWithdrawal(), 4, BigDecimal.ROUND_HALF_UP);
-                            vo.setDailyIncrease(BigDecimalUtil.multiply100(dailyIncrease));
-                        }
-                    } else {
-                        vo.setDailyIncrease("--");
+                    if (pre.getNav().compareTo(BigDecimal.ZERO) == 1) {
+                        BigDecimal dailyIncrease = f.getNav().subtract(pre.getNav()).divide(pre.getNav(), 4, BigDecimal.ROUND_HALF_UP);
+                        vo.setDailyIncrease(BigDecimalUtil.multiply100(dailyIncrease));
                     }
                 }
             }
@@ -1494,13 +1490,9 @@ public class ProductServiceImpl implements ProductService, Constant {
                 if (i < fundNavs.size() - 1) {
                     IfaImportedFundNav pre = fundNavs.get(i + 1);
 
-                    if (pre.getCumulativeNav() != null && f.getCumulativeNav() != null) {
-                        if (pre.getCumulativeNav().compareTo(BigDecimal.ZERO) == 1) {
-                            BigDecimal dailyIncrease = f.getCumulativeNav().subtract(pre.getCumulativeNav()).divide(pre.getCumulativeNav(), 4, BigDecimal.ROUND_HALF_UP);
-                            vo.setDailyIncrease(BigDecimalUtil.multiply100(dailyIncrease));
-                        }
-                    } else {
-                        vo.setDailyIncrease("--");
+                    if (pre.getNav().compareTo(BigDecimal.ZERO) == 1) {
+                        BigDecimal dailyIncrease = f.getNav().subtract(pre.getNav()).divide(pre.getNav(), 4, BigDecimal.ROUND_HALF_UP);
+                        vo.setDailyIncrease(BigDecimalUtil.multiply100(dailyIncrease));
                     }
                 }
             }
-- 
2.18.1