|
@@ -9,12 +9,10 @@ import cn.hutool.core.text.CharSequenceUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.smppw.analysis.application.dto.info.*;
|
|
|
import com.smppw.analysis.domain.dataobject.FundArchivesInfoDO;
|
|
|
+import com.smppw.analysis.domain.dataobject.FundFeeDo;
|
|
|
import com.smppw.analysis.domain.dataobject.ManualFundNoticeInfoDO;
|
|
|
import com.smppw.analysis.domain.dataobject.FundSimilarDo;
|
|
|
-import com.smppw.analysis.domain.dto.info.FundSimilarParams;
|
|
|
-import com.smppw.analysis.domain.dto.info.FundSimilarVO;
|
|
|
-import com.smppw.analysis.domain.dto.info.ManualFundInvestInfoVO;
|
|
|
-import com.smppw.analysis.domain.dto.info.ManualFundNoticeInfoVO;
|
|
|
+import com.smppw.analysis.domain.dto.info.*;
|
|
|
import com.smppw.analysis.domain.dto.performance.IndicatorParams;
|
|
|
import com.smppw.analysis.domain.manager.performance.Performance;
|
|
|
import com.smppw.analysis.domain.manager.performance.PerformanceConstants;
|
|
@@ -22,21 +20,25 @@ import com.smppw.analysis.domain.manager.performance.PerformanceFactory;
|
|
|
import com.smppw.analysis.domain.service.BaseIndicatorServiceV2;
|
|
|
import com.smppw.analysis.domain.service.BaseInfoService;
|
|
|
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.NewSubStrategy;
|
|
|
import com.smppw.common.pojo.dto.DateValue;
|
|
|
import com.smppw.common.pojo.dto.calc.IndicatorCalcPropertyDto;
|
|
|
import com.smppw.common.pojo.dto.calc.IndicatorCalcTimeRangeDto;
|
|
|
import com.smppw.common.pojo.enums.*;
|
|
|
+import com.smppw.constants.Consts;
|
|
|
+import com.smppw.constants.DateConst;
|
|
|
import com.smppw.core.IndicatorService;
|
|
|
+import com.smppw.utils.BigDecimalUtils;
|
|
|
import com.smppw.utils.CalcUtils;
|
|
|
import com.smppw.utils.NavUtil;
|
|
|
import com.smppw.utils.StrategyHandleUtils;
|
|
|
+import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.TreeMap;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -45,6 +47,8 @@ public class FundInfoService {
|
|
|
private final PerformanceFactory factory;
|
|
|
private final BaseInfoService baseInfoService;
|
|
|
private final BaseIndicatorServiceV2 baseIndicatorServiceV2;
|
|
|
+ private static final Map<String, String> ACCRUED_FREQUENCY = MapUtil.newHashMap();
|
|
|
+ private static final Map<String, String> ACCRUED_METHOD = MapUtil.newHashMap();
|
|
|
|
|
|
public FundInfoService(NavService navService, PerformanceFactory factory,
|
|
|
BaseInfoService baseInfoService, BaseIndicatorServiceV2 baseIndicatorServiceV2) {
|
|
@@ -54,6 +58,17 @@ public class FundInfoService {
|
|
|
this.baseIndicatorServiceV2 = baseIndicatorServiceV2;
|
|
|
}
|
|
|
|
|
|
+ static {
|
|
|
+ ACCRUED_FREQUENCY.put("1", "月");
|
|
|
+ ACCRUED_FREQUENCY.put("2", "季");
|
|
|
+ ACCRUED_FREQUENCY.put("3", "半年");
|
|
|
+ ACCRUED_FREQUENCY.put("4", "年");
|
|
|
+ ACCRUED_FREQUENCY.put("0", "不固定");
|
|
|
+ ACCRUED_METHOD.put("1", "高水位");
|
|
|
+ ACCRUED_METHOD.put("2", "高水位+赎回时补充");
|
|
|
+ ACCRUED_METHOD.put("3", "单客户高水位");
|
|
|
+ }
|
|
|
+
|
|
|
public PrivatelyFundHeadInfoVO headInfo(HeadInfoReq params) {
|
|
|
return new PrivatelyFundHeadInfoVO();
|
|
|
}
|
|
@@ -215,7 +230,7 @@ public class FundInfoService {
|
|
|
public ManualFundInvestInfoVO investInfo(String refId) {
|
|
|
ManualFundInvestInfoVO fundInvestInfoVO = new ManualFundInvestInfoVO();
|
|
|
FundArchivesInfoDO fundArchivesInfo = this.baseInfoService.queryFundArchives(refId);
|
|
|
- if(fundArchivesInfo==null){
|
|
|
+ if (fundArchivesInfo == null) {
|
|
|
return fundInvestInfoVO;
|
|
|
}
|
|
|
fundInvestInfoVO.setInvestmentObjective(fundArchivesInfo.getInvestmentObjective());
|
|
@@ -223,4 +238,66 @@ public class FundInfoService {
|
|
|
fundInvestInfoVO.setInvestmentScope(fundArchivesInfo.getInvestmentScope());
|
|
|
return fundInvestInfoVO;
|
|
|
}
|
|
|
+
|
|
|
+ public FundBaseFeeVO getFundFee(String refId) {
|
|
|
+ FundFeeDo fundFee = this.baseInfoService.getFundFee(refId);
|
|
|
+ DateFormatUtils.format(new Date(), DateConst.YYYY, TimeZone.getDefault());
|
|
|
+ //数字格式处理
|
|
|
+ FundFeeDo fundFees = numberFormat(fundFee);
|
|
|
+ FundBaseFeeVO fee = BeanUtil.copyProperties(fundFees, FundBaseFeeVO.class);
|
|
|
+ String frequency = Optional.ofNullable(fundFees.getAccruedFrequency()).map(e -> StrUtil.subBetween(e, "[", "]"))
|
|
|
+ .map(e -> StrUtil.split(e, ",")).orElse(ListUtil.empty()).stream().filter(StrUtil::isNotBlank)
|
|
|
+ .map(ACCRUED_FREQUENCY::get).collect(Collectors.joining(","));
|
|
|
+ fee.setAccruedFrequency(frequency);
|
|
|
+ String method = Optional.ofNullable(fundFees.getAccruedMethod()).map(e -> StrUtil.subBetween(e, "[", "]"))
|
|
|
+ .map(e -> StrUtil.split(e, ",")).orElse(ListUtil.empty()).stream().filter(StrUtil::isNotBlank)
|
|
|
+ .map(ACCRUED_METHOD::get).collect(Collectors.joining(","));
|
|
|
+ fee.setAccruedMethod(method);
|
|
|
+ return fee;
|
|
|
+ }
|
|
|
+
|
|
|
+ private FundFeeDo numberFormat(FundFeeDo fundFees) {
|
|
|
+ FundFeeDo fundFeeDo = fundFees;
|
|
|
+ String minInvestmentShare = fundFees.getMinInvestmentShare();
|
|
|
+ fundFeeDo.setMinInvestmentShare(minInvestmentShare != null && StringUtil.isNumeric(minInvestmentShare) ? BigDecimalUtils.toBigDecimal(minInvestmentShare)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "万" : minInvestmentShare);
|
|
|
+
|
|
|
+ String managementFeeBank = fundFees.getManagementFeeBank();
|
|
|
+ fundFeeDo.setManagementFeeBank(managementFeeBank != null && StringUtil.isNumeric(managementFeeBank) ? BigDecimalUtils.toBigDecimal(managementFeeBank)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFeeBank);
|
|
|
+
|
|
|
+ String subscriptionFee = fundFees.getSubscriptionFee();
|
|
|
+ fundFeeDo.setSubscriptionFee(subscriptionFee != null && StringUtil.isNumeric(subscriptionFee) ? BigDecimalUtils.toBigDecimal(subscriptionFee)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "%" : subscriptionFee);
|
|
|
+
|
|
|
+ String redemptionFee = fundFees.getRedemptionFee();
|
|
|
+ fundFeeDo.setRedemptionFee(redemptionFee != null && StringUtil.isNumeric(redemptionFee) ? BigDecimalUtils.toBigDecimal(redemptionFee)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "%" : redemptionFee);
|
|
|
+
|
|
|
+ String managementFee = fundFees.getManagementFee();
|
|
|
+ fundFeeDo.setManagementFee(managementFee != null && StringUtil.isNumeric(managementFee) ? BigDecimalUtils.toBigDecimal(managementFee)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFee);
|
|
|
+
|
|
|
+ String managementFeeConsult = fundFees.getManagementFeeConsult();
|
|
|
+ fundFeeDo.setManagementFeeConsult(managementFeeConsult != null && StringUtil.isNumeric(managementFeeConsult) ? BigDecimalUtils.toBigDecimal(managementFeeConsult)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "%" : managementFeeConsult);
|
|
|
+
|
|
|
+ String performanceFee = fundFees.getPerformanceFee();
|
|
|
+ fundFeeDo.setPerformanceFee(performanceFee != null && StringUtil.isNumeric(performanceFee) ? BigDecimalUtils.toBigDecimal(performanceFee)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "%" : performanceFee);
|
|
|
+
|
|
|
+ String guardLine = fundFees.getGuardLine();
|
|
|
+ fundFeeDo.setGuardLine(guardLine != null && StringUtil.isNumeric(guardLine) ? BigDecimalUtils.toBigDecimal(guardLine)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "%" : guardLine);
|
|
|
+
|
|
|
+ String subsequentInvestmentShare = fundFees.getSubsequentInvestmentShare();
|
|
|
+ fundFeeDo.setSubsequentInvestmentShare(subsequentInvestmentShare != null && StringUtil.isNumeric(subsequentInvestmentShare) ? BigDecimalUtils.toBigDecimal(subsequentInvestmentShare)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "万" : subsequentInvestmentShare);
|
|
|
+
|
|
|
+ String stopLossLine = fundFees.getStopLossLine();
|
|
|
+ fundFeeDo.setStopLossLine(stopLossLine != null && StringUtil.isNumeric(stopLossLine) ? BigDecimalUtils.toBigDecimal(stopLossLine)
|
|
|
+ .setScale(2, RoundingMode.HALF_DOWN) + "%" : stopLossLine);
|
|
|
+ return fundFeeDo;
|
|
|
+ }
|
|
|
+
|
|
|
}
|