From 5d59808a9937fd01576e658e70b226a1ed62e615 Mon Sep 17 00:00:00 2001
From: zhangyh <zhangyahui@wealthgrow.cn>
Date: Thu, 18 Mar 2021 19:49:38 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E9=87=91bug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../tanpu/fund/service/impl/ProductServiceImpl.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 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 36d35c9..178faf9 100644
--- a/src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+++ b/src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
@@ -1490,9 +1490,13 @@ public class ProductServiceImpl implements ProductService, Constant {
                 if (i < fundNavs.size() - 1) {
                     IfaImportedFundNav pre = fundNavs.get(i + 1);
 
-                    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));
+                    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("--");
                     }
                 }
             }
-- 
2.18.1