Sfoglia il codice sorgente

fix:修复规模日期数据重复的问题

mozuwen 1 mese fa
parent
commit
c94c54311f

+ 1 - 1
service-base/src/main/resources/mapper/NavMapper.xml

@@ -116,7 +116,7 @@
     </select>
 
     <select id="queryAllNav" resultMap="BaseResultMap">
-        SELECT t1.fund_id, t1.price_date, t1.nav, t1.cumulative_nav, t1.cumulative_nav_withdrawal
+        SELECT distinct t1.fund_id, t1.price_date, t1.nav, t1.cumulative_nav, t1.cumulative_nav_withdrawal
         from nav t1
             join rc_competition_apply t2 on t1.fund_id = t2.product_code and t2.isvalid = 1
         where t1.isvalid = 1

+ 1 - 1
service-manage/src/main/java/com/simuwang/manage/service/competition/FundNavService.java

@@ -220,7 +220,7 @@ public class FundNavService {
         String trustRegisterNumber = fundInfoDO.getCompanyRegisterNumber();
         Map<String, BigDecimal> priceDateAssetMap = MapUtil.newHashMap();
         if (CollUtil.isNotEmpty(fundAssetDoList)) {
-            priceDateAssetMap = fundAssetDoList.stream().collect(Collectors.toMap(k -> DateUtil.format(k.getPriceDate(), DateConst.YYYY_MM_DD), AssetDO::getAssetNet));
+            priceDateAssetMap = fundAssetDoList.stream().collect(Collectors.toMap(k -> DateUtil.format(k.getPriceDate(), DateConst.YYYY_MM_DD), AssetDO::getAssetNet, (v1, v2) -> v1));
         }
         Map<String, BigDecimal> finalPriceDateAssetMap = priceDateAssetMap;
         return fundNavDoList.stream().map(e -> {