|
@@ -93,19 +93,22 @@ public class FundNavService {
|
|
|
List<String> deletionFundIdList = getDeletionFundId(fundInfoCompanyNameList, fundIdDeletionInfoMap);
|
|
|
List<String> notDeletionFundIdList = allFundIdList.stream().filter(e -> !deletionFundIdList.contains(e)).toList();
|
|
|
|
|
|
+ // 获取大赛开赛时间
|
|
|
+ String competitionStartTime = DateUtil.format(fundInfoMapper.queryCompetitionStartTime(competitionId), DateConst.YYYY_MM_DD);
|
|
|
+
|
|
|
// 过滤掉净值没有缺失的基金Id
|
|
|
fundInfoCompanyNameList = fundInfoCompanyNameList.stream().filter(e -> !notDeletionFundIdList.contains(e.getFundId())).toList();
|
|
|
for (FundAndCompanyInfoDO fundAndCompanyInfoDO : fundInfoCompanyNameList) {
|
|
|
String fundId = fundAndCompanyInfoDO.getFundId();
|
|
|
- String entryDate = DateUtil.format(fundAndCompanyInfoDO.getEntryDate(), DateConst.YYYY_MM_DD);
|
|
|
- // 获取净值日期所在年和所在周
|
|
|
- Map<String, TradeDateDTO> tradeDateDoMap = getYearAndWeekOfDate(entryDate, endDate);
|
|
|
-
|
|
|
+ String inceptionDate = DateUtil.format(fundAndCompanyInfoDO.getInceptionDate(), DateConst.YYYY_MM_DD);
|
|
|
+ // 如果基金成立日期小于大赛开始日期 -> 取大赛开始日期,否则取基金成立日期
|
|
|
+ String date = inceptionDate.compareTo(competitionStartTime) <= 0 ? competitionStartTime : inceptionDate;
|
|
|
List<FundDeletionInfoDO> fundDeletionInfoDOList = fundIdDeletionInfoMap.get(fundId);
|
|
|
if (CollUtil.isNotEmpty(fundDeletionInfoDOList)) {
|
|
|
- fundDeletionInfoDOList = fundDeletionInfoDOList.stream().filter(e -> e.getDeletionDate().compareTo(entryDate) >= 0).toList();
|
|
|
+ fundDeletionInfoDOList = fundDeletionInfoDOList.stream().filter(e -> e.getDeletionDate().compareTo(date) >= 0).toList();
|
|
|
}
|
|
|
-
|
|
|
+ // 获取净值日期所在年和所在周
|
|
|
+ Map<String, TradeDateDTO> tradeDateDoMap = getYearAndWeekOfDate(date, endDate);
|
|
|
List<FundNavDeletionDTO> fundNavDataDTOList = buildFundNavDeletionDTO(fundAndCompanyInfoDO, fundDeletionInfoDOList, tradeDateDoMap);
|
|
|
navDeletionDTOList.addAll(fundNavDataDTOList);
|
|
|
}
|