|
@@ -1,5 +1,6 @@
|
|
package com.smppw.analysis.domain.service.impl;
|
|
package com.smppw.analysis.domain.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.map.MapUtil;
|
|
import cn.hutool.core.map.MapUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.smppw.analysis.domain.dao.info.InfoFactory;
|
|
import com.smppw.analysis.domain.dao.info.InfoFactory;
|
|
@@ -47,7 +48,7 @@ public class BaseIndicatorServiceV2Impl implements BaseIndicatorServiceV2 {
|
|
CurveType curveType = CurveType.getCurveType(raiseType, strategy);
|
|
CurveType curveType = CurveType.getCurveType(raiseType, strategy);
|
|
Map<String, List<DateValue>> allNavMap = navService.getSecIdDateValueNavListMapFromRedisAndDB(mainSecIdList, benchmarkIdList, indexIdList,
|
|
Map<String, List<DateValue>> allNavMap = navService.getSecIdDateValueNavListMapFromRedisAndDB(mainSecIdList, benchmarkIdList, indexIdList,
|
|
null, null, curveType.getId(), strategy.getStrategyId(), navType, visibility, MapUtil.empty());
|
|
null, null, curveType.getId(), strategy.getStrategyId(), navType, visibility, MapUtil.empty());
|
|
- Map<String, Frequency> secFreqMap = this.infoFactory.getInstance(SecType.PRIVATE_FUND).getSecFreqMap(mainSecIdList);
|
|
|
|
|
|
+ Map<String, Frequency> secFreqMap = this.loadMultiSecFreq(mainSecIdList);
|
|
return IndicatorService.getInstance().calcMultipleSecMultipleTimeRangeIndicator(req, allNavMap, secFreqMap);
|
|
return IndicatorService.getInstance().calcMultipleSecMultipleTimeRangeIndicator(req, allNavMap, secFreqMap);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -60,7 +61,7 @@ public class BaseIndicatorServiceV2Impl implements BaseIndicatorServiceV2 {
|
|
CurveType curveType = CurveType.getCurveType(raiseType, strategy);
|
|
CurveType curveType = CurveType.getCurveType(raiseType, strategy);
|
|
Map<String, List<DateValue>> allNavMap = navService.getSecIdDateValueNavListMapFromRedisAndDB(mainSecIdList, benchmarkIdList, indexIdList,
|
|
Map<String, List<DateValue>> allNavMap = navService.getSecIdDateValueNavListMapFromRedisAndDB(mainSecIdList, benchmarkIdList, indexIdList,
|
|
null, null, curveType.getId(), strategy.getStrategyId(), navType, visibility, MapUtil.empty());
|
|
null, null, curveType.getId(), strategy.getStrategyId(), navType, visibility, MapUtil.empty());
|
|
- Map<String, Frequency> secFreqMap = this.infoFactory.getInstance(SecType.PRIVATE_FUND).getSecFreqMap(mainSecIdList);
|
|
|
|
|
|
+ Map<String, Frequency> secFreqMap = this.loadMultiSecFreq(mainSecIdList);
|
|
return IndicatorService.getInstance().getMultipleSecTrend(mainSecIdList, secBenchmarkIdMap, indexIdList, dateIntervalDto, fixedIncome,
|
|
return IndicatorService.getInstance().getMultipleSecTrend(mainSecIdList, secBenchmarkIdMap, indexIdList, dateIntervalDto, fixedIncome,
|
|
initValue, frequency, trendTypeV2List, secFreqMap, allNavMap);
|
|
initValue, frequency, trendTypeV2List, secFreqMap, allNavMap);
|
|
}
|
|
}
|
|
@@ -69,8 +70,31 @@ public class BaseIndicatorServiceV2Impl implements BaseIndicatorServiceV2 {
|
|
public Map<String, List<IndicatorCalcPropertyDto>> getMultiSecRetListNew(List<String> mainSecIdList, List<String> indexIds, Frequency frequency, Frequency rollingFrequency,
|
|
public Map<String, List<IndicatorCalcPropertyDto>> getMultiSecRetListNew(List<String> mainSecIdList, List<String> indexIds, Frequency frequency, Frequency rollingFrequency,
|
|
String startDate, String endDate, boolean ifExcessReturn, String benchmarkId, RaiseType raiseType, IStrategy strategy,
|
|
String startDate, String endDate, boolean ifExcessReturn, String benchmarkId, RaiseType raiseType, IStrategy strategy,
|
|
Visibility visible, NavType navType, Map<String, List<DateValue>> allNavMap) {
|
|
Visibility visible, NavType navType, Map<String, List<DateValue>> allNavMap) {
|
|
- Map<String, Frequency> secFreqMap = this.infoFactory.getInstance(SecType.PRIVATE_FUND).getSecFreqMap(mainSecIdList);
|
|
|
|
|
|
+ Map<String, Frequency> secFreqMap = this.loadMultiSecFreq(mainSecIdList);
|
|
return IndicatorService.getInstance().getMultiSecRetListNew(mainSecIdList, indexIds, frequency, rollingFrequency, startDate, endDate, ifExcessReturn,
|
|
return IndicatorService.getInstance().getMultiSecRetListNew(mainSecIdList, indexIds, frequency, rollingFrequency, startDate, endDate, ifExcessReturn,
|
|
benchmarkId, raiseType, strategy, visible, navType, allNavMap, secFreqMap);
|
|
benchmarkId, raiseType, strategy, visible, navType, allNavMap, secFreqMap);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取多种类型的标的的净值频率
|
|
|
|
+ *
|
|
|
|
+ * @param secIds 多个标的id集合
|
|
|
|
+ * @return /
|
|
|
|
+ */
|
|
|
|
+ private Map<String, Frequency> loadMultiSecFreq(List<String> secIds) {
|
|
|
|
+ if (CollUtil.isEmpty(secIds)) {
|
|
|
|
+ return MapUtil.empty();
|
|
|
|
+ }
|
|
|
|
+ Map<String, List<String>> typeSecMap = SecType.getTypeSecMap(secIds, null);
|
|
|
|
+ Map<String, Frequency> temp = MapUtil.newHashMap(secIds.size());
|
|
|
|
+ typeSecMap.forEach((k, v) -> {
|
|
|
|
+ Map<String, Frequency> secNameMap = this.infoFactory.getInstance(k).getSecFreqMap(v);
|
|
|
|
+ temp.putAll(secNameMap);
|
|
|
|
+ });
|
|
|
|
+ Map<String, Frequency> result = MapUtil.newHashMap(secIds.size());
|
|
|
|
+ for (String secId : secIds) {
|
|
|
|
+ result.put(secId, temp.get(secId));
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
}
|
|
}
|