|
@@ -14,11 +14,9 @@ import com.smppw.analysis.application.dto.info.ManualFundManagerParams;
|
|
import com.smppw.analysis.application.dto.info.ManualFundNoticeReq;
|
|
import com.smppw.analysis.application.dto.info.ManualFundNoticeReq;
|
|
import com.smppw.analysis.domain.dataobject.*;
|
|
import com.smppw.analysis.domain.dataobject.*;
|
|
import com.smppw.analysis.domain.dto.info.*;
|
|
import com.smppw.analysis.domain.dto.info.*;
|
|
-import com.smppw.analysis.domain.manager.performance.PerformanceFactory;
|
|
|
|
import com.smppw.analysis.domain.service.BaseIndicatorServiceV2;
|
|
import com.smppw.analysis.domain.service.BaseIndicatorServiceV2;
|
|
import com.smppw.analysis.domain.service.BaseInfoService;
|
|
import com.smppw.analysis.domain.service.BaseInfoService;
|
|
import com.smppw.analysis.domain.service.NavService;
|
|
import com.smppw.analysis.domain.service.NavService;
|
|
-import com.smppw.analysis.infrastructure.utils.StringUtil;
|
|
|
|
import com.smppw.common.pojo.IStrategy;
|
|
import com.smppw.common.pojo.IStrategy;
|
|
import com.smppw.common.pojo.NewSubStrategy;
|
|
import com.smppw.common.pojo.NewSubStrategy;
|
|
import com.smppw.common.pojo.ValueLabelVO;
|
|
import com.smppw.common.pojo.ValueLabelVO;
|
|
@@ -72,15 +70,12 @@ public class FundInfoService {
|
|
}
|
|
}
|
|
|
|
|
|
private final NavService navService;
|
|
private final NavService navService;
|
|
- private final PerformanceFactory factory;
|
|
|
|
private final BaseInfoService baseInfoService;
|
|
private final BaseInfoService baseInfoService;
|
|
private final BaseIndicatorServiceV2 baseIndicatorServiceV2;
|
|
private final BaseIndicatorServiceV2 baseIndicatorServiceV2;
|
|
|
|
|
|
public FundInfoService(NavService navService,
|
|
public FundInfoService(NavService navService,
|
|
- PerformanceFactory factory,
|
|
|
|
BaseInfoService baseInfoService,
|
|
BaseInfoService baseInfoService,
|
|
BaseIndicatorServiceV2 baseIndicatorServiceV2) {
|
|
BaseIndicatorServiceV2 baseIndicatorServiceV2) {
|
|
- this.factory = factory;
|
|
|
|
this.navService = navService;
|
|
this.navService = navService;
|
|
this.baseInfoService = baseInfoService;
|
|
this.baseInfoService = baseInfoService;
|
|
this.baseIndicatorServiceV2 = baseIndicatorServiceV2;
|
|
this.baseIndicatorServiceV2 = baseIndicatorServiceV2;
|
|
@@ -175,7 +170,6 @@ public class FundInfoService {
|
|
String s = typeMapper.get(params.getType());
|
|
String s = typeMapper.get(params.getType());
|
|
typeList.addAll(StrUtil.split(s, ","));
|
|
typeList.addAll(StrUtil.split(s, ","));
|
|
}
|
|
}
|
|
- //todo 确认基金公告表所在的库
|
|
|
|
List<ManualFundNoticeInfoDO> dataList = this.baseInfoService.queryFundAnnounce(fundId, typeList, title);
|
|
List<ManualFundNoticeInfoDO> dataList = this.baseInfoService.queryFundAnnounce(fundId, typeList, title);
|
|
List<ManualFundNoticeInfoVO> resultList = ListUtil.list(true);
|
|
List<ManualFundNoticeInfoVO> resultList = ListUtil.list(true);
|
|
// key value互换
|
|
// key value互换
|
|
@@ -219,47 +213,46 @@ public class FundInfoService {
|
|
}
|
|
}
|
|
|
|
|
|
private FundFeeDo numberFormat(FundFeeDo fundFees) {
|
|
private FundFeeDo numberFormat(FundFeeDo fundFees) {
|
|
- FundFeeDo fundFeeDo = fundFees;
|
|
|
|
String minInvestmentShare = fundFees.getMinInvestmentShare();
|
|
String minInvestmentShare = fundFees.getMinInvestmentShare();
|
|
- fundFeeDo.setMinInvestmentShare(minInvestmentShare != null && StringUtil.isNumeric(minInvestmentShare) ? BigDecimalUtils.toBigDecimal(minInvestmentShare)
|
|
|
|
|
|
+ fundFees.setMinInvestmentShare(NumberUtil.isNumber(minInvestmentShare) ? BigDecimalUtils.toBigDecimal(minInvestmentShare)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "万" : minInvestmentShare);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "万" : minInvestmentShare);
|
|
|
|
|
|
String managementFeeBank = fundFees.getManagementFeeBank();
|
|
String managementFeeBank = fundFees.getManagementFeeBank();
|
|
- fundFeeDo.setManagementFeeBank(managementFeeBank != null && StringUtil.isNumeric(managementFeeBank) ? BigDecimalUtils.toBigDecimal(managementFeeBank)
|
|
|
|
|
|
+ fundFees.setManagementFeeBank(NumberUtil.isNumber(managementFeeBank) ? BigDecimalUtils.toBigDecimal(managementFeeBank)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFeeBank);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFeeBank);
|
|
|
|
|
|
String subscriptionFee = fundFees.getSubscriptionFee();
|
|
String subscriptionFee = fundFees.getSubscriptionFee();
|
|
- fundFeeDo.setSubscriptionFee(subscriptionFee != null && StringUtil.isNumeric(subscriptionFee) ? BigDecimalUtils.toBigDecimal(subscriptionFee)
|
|
|
|
|
|
+ fundFees.setSubscriptionFee(NumberUtil.isNumber(subscriptionFee) ? BigDecimalUtils.toBigDecimal(subscriptionFee)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : subscriptionFee);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : subscriptionFee);
|
|
|
|
|
|
String redemptionFee = fundFees.getRedemptionFee();
|
|
String redemptionFee = fundFees.getRedemptionFee();
|
|
- fundFeeDo.setRedemptionFee(redemptionFee != null && StringUtil.isNumeric(redemptionFee) ? BigDecimalUtils.toBigDecimal(redemptionFee)
|
|
|
|
|
|
+ fundFees.setRedemptionFee(NumberUtil.isNumber(redemptionFee) ? BigDecimalUtils.toBigDecimal(redemptionFee)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : redemptionFee);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : redemptionFee);
|
|
|
|
|
|
String managementFee = fundFees.getManagementFee();
|
|
String managementFee = fundFees.getManagementFee();
|
|
- fundFeeDo.setManagementFee(managementFee != null && StringUtil.isNumeric(managementFee) ? BigDecimalUtils.toBigDecimal(managementFee)
|
|
|
|
|
|
+ fundFees.setManagementFee(NumberUtil.isNumber(managementFee) ? BigDecimalUtils.toBigDecimal(managementFee)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFee);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFee);
|
|
|
|
|
|
String managementFeeConsult = fundFees.getManagementFeeConsult();
|
|
String managementFeeConsult = fundFees.getManagementFeeConsult();
|
|
- fundFeeDo.setManagementFeeConsult(managementFeeConsult != null && StringUtil.isNumeric(managementFeeConsult) ? BigDecimalUtils.toBigDecimal(managementFeeConsult)
|
|
|
|
|
|
+ fundFees.setManagementFeeConsult(NumberUtil.isNumber(managementFeeConsult) ? BigDecimalUtils.toBigDecimal(managementFeeConsult)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFeeConsult);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFeeConsult);
|
|
|
|
|
|
String performanceFee = fundFees.getPerformanceFee();
|
|
String performanceFee = fundFees.getPerformanceFee();
|
|
- fundFeeDo.setPerformanceFee(performanceFee != null && StringUtil.isNumeric(performanceFee) ? BigDecimalUtils.toBigDecimal(performanceFee)
|
|
|
|
|
|
+ fundFees.setPerformanceFee(NumberUtil.isNumber(performanceFee) ? BigDecimalUtils.toBigDecimal(performanceFee)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : performanceFee);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : performanceFee);
|
|
|
|
|
|
String guardLine = fundFees.getGuardLine();
|
|
String guardLine = fundFees.getGuardLine();
|
|
- fundFeeDo.setGuardLine(guardLine != null && StringUtil.isNumeric(guardLine) ? BigDecimalUtils.toBigDecimal(guardLine)
|
|
|
|
|
|
+ fundFees.setGuardLine(NumberUtil.isNumber(guardLine) ? BigDecimalUtils.toBigDecimal(guardLine)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : guardLine);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : guardLine);
|
|
|
|
|
|
String subsequentInvestmentShare = fundFees.getSubsequentInvestmentShare();
|
|
String subsequentInvestmentShare = fundFees.getSubsequentInvestmentShare();
|
|
- fundFeeDo.setSubsequentInvestmentShare(subsequentInvestmentShare != null && StringUtil.isNumeric(subsequentInvestmentShare) ? BigDecimalUtils.toBigDecimal(subsequentInvestmentShare)
|
|
|
|
|
|
+ fundFees.setSubsequentInvestmentShare(NumberUtil.isNumber(subsequentInvestmentShare) ? BigDecimalUtils.toBigDecimal(subsequentInvestmentShare)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "万" : subsequentInvestmentShare);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "万" : subsequentInvestmentShare);
|
|
|
|
|
|
String stopLossLine = fundFees.getStopLossLine();
|
|
String stopLossLine = fundFees.getStopLossLine();
|
|
- fundFeeDo.setStopLossLine(stopLossLine != null && StringUtil.isNumeric(stopLossLine) ? BigDecimalUtils.toBigDecimal(stopLossLine)
|
|
|
|
|
|
+ fundFees.setStopLossLine(NumberUtil.isNumber(stopLossLine) ? BigDecimalUtils.toBigDecimal(stopLossLine)
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : stopLossLine);
|
|
.setScale(2, RoundingMode.HALF_DOWN) + "%" : stopLossLine);
|
|
- return fundFeeDo;
|
|
|
|
|
|
+ return fundFees;
|
|
}
|
|
}
|
|
|
|
|
|
public ManualFundFeeInfoVO getMfFundFee(String fundId) {
|
|
public ManualFundFeeInfoVO getMfFundFee(String fundId) {
|
|
@@ -466,9 +459,9 @@ public class FundInfoService {
|
|
String refId = params.getRefId();
|
|
String refId = params.getRefId();
|
|
String benchmarkId = params.getBenchmarkId();
|
|
String benchmarkId = params.getBenchmarkId();
|
|
List<ManualFundManagerInfoVO> resultList = ListUtil.list(true);
|
|
List<ManualFundManagerInfoVO> resultList = ListUtil.list(true);
|
|
- //1.先获取基金下的现任基金经理基本信息
|
|
|
|
|
|
+ //1.先获取基金下的现任基金经理基本信息
|
|
List<PersonnelInformationDo> managerInfoList = this.baseInfoService.getFundPresentManagerInfo(refId);
|
|
List<PersonnelInformationDo> managerInfoList = this.baseInfoService.getFundPresentManagerInfo(refId);
|
|
- if(CollUtil.isEmpty(managerInfoList)){
|
|
|
|
|
|
+ if (CollUtil.isEmpty(managerInfoList)) {
|
|
return resultList;
|
|
return resultList;
|
|
}
|
|
}
|
|
List<String> managerIdList = managerInfoList.stream().map(PersonnelInformationDo::getPersonnelId).collect(Collectors.toList());
|
|
List<String> managerIdList = managerInfoList.stream().map(PersonnelInformationDo::getPersonnelId).collect(Collectors.toList());
|
|
@@ -485,12 +478,10 @@ public class FundInfoService {
|
|
manualFundManagerInfoDo.setAvatar2(e.getAvatar2());
|
|
manualFundManagerInfoDo.setAvatar2(e.getAvatar2());
|
|
List<MfManagerFundNumDo> mfManagerFundNumDos = listMap.get(managerId);
|
|
List<MfManagerFundNumDo> mfManagerFundNumDos = listMap.get(managerId);
|
|
if (CollUtil.isNotEmpty(mfManagerFundNumDos)) {
|
|
if (CollUtil.isNotEmpty(mfManagerFundNumDos)) {
|
|
- MfManagerFundNumDo mfManagerFundNumDo = mfManagerFundNumDos.stream().filter(k -> refId.equals(k.getFundId())).findFirst().orElse(null);
|
|
|
|
- if (manualFundManagerInfoDo != null) {
|
|
|
|
- manualFundManagerInfoDo.setStartDate(mfManagerFundNumDo.getStartDate());
|
|
|
|
- }
|
|
|
|
|
|
+ mfManagerFundNumDos.stream().filter(k -> refId.equals(k.getFundId())).findFirst()
|
|
|
|
+ .ifPresent(mfManagerFundNumDo -> manualFundManagerInfoDo.setStartDate(mfManagerFundNumDo.getStartDate()));
|
|
long publicProductNumAll = mfManagerFundNumDos.stream().filter(v -> v.getFundId().startsWith("MF")).count();
|
|
long publicProductNumAll = mfManagerFundNumDos.stream().filter(v -> v.getFundId().startsWith("MF")).count();
|
|
- long publicProductNumRunning = mfManagerFundNumDos.stream().filter(w -> Objects.equals(2, w.getStatus()) && w.getEndDate()==null).count();
|
|
|
|
|
|
+ long publicProductNumRunning = mfManagerFundNumDos.stream().filter(w -> Objects.equals(2, w.getStatus()) && w.getEndDate() == null).count();
|
|
manualFundManagerInfoDo.setPublicProductNumAll(String.valueOf(publicProductNumAll));
|
|
manualFundManagerInfoDo.setPublicProductNumAll(String.valueOf(publicProductNumAll));
|
|
manualFundManagerInfoDo.setPublicProductNumRunning(String.valueOf(publicProductNumRunning));
|
|
manualFundManagerInfoDo.setPublicProductNumRunning(String.valueOf(publicProductNumRunning));
|
|
}
|
|
}
|
|
@@ -500,7 +491,7 @@ public class FundInfoService {
|
|
// 按基金经理分组每个经理只取一条数据
|
|
// 按基金经理分组每个经理只取一条数据
|
|
Map<String, ManualFundManagerInfoDo> managerInfoMap = MapUtil.newHashMap();
|
|
Map<String, ManualFundManagerInfoDo> managerInfoMap = MapUtil.newHashMap();
|
|
Map<String, List<ManualFundManagerInfoDo>> collect = dataList.stream().collect(Collectors.groupingBy(ManualFundManagerInfoDo::getManagerId, Collectors.toList()));
|
|
Map<String, List<ManualFundManagerInfoDo>> collect = dataList.stream().collect(Collectors.groupingBy(ManualFundManagerInfoDo::getManagerId, Collectors.toList()));
|
|
- collect.forEach((k ,v) -> {
|
|
|
|
|
|
+ collect.forEach((k, v) -> {
|
|
ManualFundManagerInfoDo temp = v.stream().findFirst().orElse(null);
|
|
ManualFundManagerInfoDo temp = v.stream().findFirst().orElse(null);
|
|
managerInfoMap.put(k, temp);
|
|
managerInfoMap.put(k, temp);
|
|
});
|
|
});
|