|
@@ -136,29 +136,17 @@ public class ValuationEmailParser extends AbstractEmailParser {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
List<EmailFundNavDTO> emailFundNavDTOList = CollUtil.newArrayList();
|
|
List<EmailFundNavDTO> emailFundNavDTOList = CollUtil.newArrayList();
|
|
- Map<String, List<AssetsValuationResult.Record>> dateSuccessRecordMap = parseSuccessList.stream().collect(Collectors.groupingBy(AssetsValuationResult.Record::getDate));
|
|
|
|
- for (Map.Entry<String, List<AssetsValuationResult.Record>> successRecordEntry : dateSuccessRecordMap.entrySet()) {
|
|
|
|
- String date = successRecordEntry.getKey();
|
|
|
|
- List<AssetsValuationResult.Record> recordList = successRecordEntry.getValue();
|
|
|
|
- String fundName = recordList.stream().map(AssetsValuationResult.Record::getParseValuationInfo)
|
|
|
|
- .filter(Objects::nonNull).map(ParseValuationInfo::getFundName).distinct().findFirst().orElse(null);
|
|
|
|
- String registerNumber = recordList.stream().map(AssetsValuationResult.Record::getParseValuationInfo)
|
|
|
|
- .filter(Objects::nonNull).map(ParseValuationInfo::getRegisterNumber).distinct().findFirst().orElse(null);
|
|
|
|
- String nav = recordList.stream().map(AssetsValuationResult.Record::getNav).filter(Objects::nonNull).distinct().findFirst().orElse(null);
|
|
|
|
- String cumulativeNavWithdrawal = recordList.stream().map(AssetsValuationResult.Record::getCumulativeNavWithdrawal).filter(Objects::nonNull).distinct().findFirst().orElse(null);
|
|
|
|
- String assetNet = recordList.stream().map(AssetsValuationResult.Record::getAssetNet).filter(Objects::nonNull).distinct().findFirst().orElse(null);
|
|
|
|
- String assetShare = recordList.stream().map(AssetsValuationResult.Record::getAssetShare).filter(Objects::nonNull).distinct().findFirst().orElse(null);
|
|
|
|
- List<String> fundIdList = recordList.stream().map(AssetsValuationResult.Record::getFundId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
|
|
+ // 考虑一个估值表匹配到多个基金的情况
|
|
|
|
+ for (AssetsValuationResult.Record record : parseSuccessList) {
|
|
EmailFundNavDTO fundNavDTO = new EmailFundNavDTO();
|
|
EmailFundNavDTO fundNavDTO = new EmailFundNavDTO();
|
|
- fundNavDTO.setFundName(fundName);
|
|
|
|
- fundNavDTO.setRegisterNumber(registerNumber);
|
|
|
|
- fundNavDTO.setPriceDate(date);
|
|
|
|
- fundNavDTO.setNav(nav);
|
|
|
|
- fundNavDTO.setCumulativeNavWithdrawal(cumulativeNavWithdrawal);
|
|
|
|
- fundNavDTO.setAssetNet(assetNet);
|
|
|
|
- fundNavDTO.setAssetShare(assetShare);
|
|
|
|
- fundNavDTO.setFundIdList(fundIdList);
|
|
|
|
|
|
+ fundNavDTO.setFundName(record.getParseValuationInfo() != null ? record.getParseValuationInfo().getFundName() : null);
|
|
|
|
+ fundNavDTO.setRegisterNumber(record.getParseValuationInfo() != null ? record.getParseValuationInfo().getRegisterNumber() : null);
|
|
|
|
+ fundNavDTO.setPriceDate(record.getDate());
|
|
|
|
+ fundNavDTO.setNav(record.getNav());
|
|
|
|
+ fundNavDTO.setCumulativeNavWithdrawal(record.getCumulativeNavWithdrawal());
|
|
|
|
+ fundNavDTO.setAssetNet(record.getAssetNet());
|
|
|
|
+ fundNavDTO.setAssetShare(record.getAssetShare());
|
|
|
|
+ fundNavDTO.setFundIdList(StrUtil.isNotBlank(record.getFundId()) ? ListUtil.toList(record.getFundId()) : null);
|
|
emailFundNavDTOList.add(fundNavDTO);
|
|
emailFundNavDTOList.add(fundNavDTO);
|
|
}
|
|
}
|
|
return emailFundNavDTOList;
|
|
return emailFundNavDTOList;
|