From c0acea28aa00a888a8a6eb4d86d1d47abcf2029a Mon Sep 17 00:00:00 2001
From: qiankun <qiankun@wealthgrow.cn>
Date: Fri, 18 Feb 2022 14:40:15 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9C=80=E6=96=B0=E5=87=80?=
 =?UTF-8?q?=E5=80=BC=EF=BC=8C=E9=83=BD=E6=94=B9=E4=B8=BA=E7=94=A8=E6=96=B0?=
 =?UTF-8?q?=E6=96=B9=E6=A1=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../com/tanpu/fund/service/impl/ProductForPcServiceImpl.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/com/tanpu/fund/service/impl/ProductForPcServiceImpl.java b/src/main/java/com/tanpu/fund/service/impl/ProductForPcServiceImpl.java
index 1c915a8..65622ee 100644
--- a/src/main/java/com/tanpu/fund/service/impl/ProductForPcServiceImpl.java
+++ b/src/main/java/com/tanpu/fund/service/impl/ProductForPcServiceImpl.java
@@ -21,13 +21,16 @@ import java.util.stream.Collectors;
 public class ProductForPcServiceImpl implements ProductForPcService {
     @Resource
     private FundInfoCustomMapper fundInfoCustomMapper;
+    @Resource
+    private FundLatestNavService fundLatestNavService;
 
     @Override
     public List<Net> getFundNewnet(List<String> list) {
         if (CollectionUtils.isEmpty(list)) {
             return new ArrayList<>();
         }
-        List<FundNav> fundInfoNewNet = fundInfoCustomMapper.getFundInfoNewNet(list);
+        // 原先的老sql耗时太大,这里用新方案
+        List<FundNav> fundInfoNewNet = fundLatestNavService.getLatestNavBy(list);
         if (CollectionUtils.isNotEmpty(fundInfoNewNet)) {
           return fundInfoNewNet.stream().map(item -> Net.builder()
                     .fundId(item.getFundId())
-- 
2.18.1