|
@@ -5,6 +5,7 @@ import com.smppw.analysis.domain.service.BaseInfoService;
|
|
|
import com.smppw.analysis.domain.service.NavService;
|
|
|
import com.smppw.common.pojo.dto.DateValue;
|
|
|
import com.smppw.common.pojo.dto.NavDto;
|
|
|
+import com.smppw.common.pojo.enums.Frequency;
|
|
|
import com.smppw.common.pojo.enums.NavType;
|
|
|
import com.smppw.common.pojo.enums.Visibility;
|
|
|
import com.smppw.constants.SecType;
|
|
@@ -49,16 +50,16 @@ public class NavServiceImpl implements NavService {
|
|
|
// private FactorNavDao factorNavDao;
|
|
|
//
|
|
|
@Autowired
|
|
|
- private MarketIndexNavDao marketIndexNavDao;
|
|
|
+ private MarketIndexDao marketIndexDao;
|
|
|
//
|
|
|
// @Autowired
|
|
|
// private UdfIndexNavDao udfIndexNavDao;
|
|
|
//
|
|
|
-// @Autowired
|
|
|
-// private CompanyNavDao companyNavDao;
|
|
|
-//
|
|
|
-// @Autowired
|
|
|
-// private ManagerNavDao managerNavDao;
|
|
|
+ @Autowired
|
|
|
+ private CompanyNavDao companyNavDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ManagerNavDao managerNavDao;
|
|
|
//
|
|
|
// @Autowired
|
|
|
// private CmAdvisoryPoolCurveWeeklyDao cmAdvisoryPoolCurveWeeklyDao;
|
|
@@ -130,7 +131,8 @@ public class NavServiceImpl implements NavService {
|
|
|
|
|
|
@Override
|
|
|
public Map<String, List<DateValue>> getSecIdDateValueNavListMapFromRedisAndDB(List<String> mainSecIdList, List<String> benchmarkIdList, List<String> indexList,
|
|
|
- String startDate, String endDate, NavType navType, Visibility visibility) {
|
|
|
+ String startDate, String endDate, Integer curveTypeId, Integer strategyId, NavType navType,
|
|
|
+ Visibility visibility, Map<String, Frequency> secFrequencyMap) {
|
|
|
|
|
|
//全部的标的集合
|
|
|
Map<String, Boolean> secIfExtractMap = new HashMap<>();
|
|
@@ -150,7 +152,7 @@ public class NavServiceImpl implements NavService {
|
|
|
Map<String, List<DateValue>> allSecNavListMap = new HashMap<>();
|
|
|
|
|
|
//取DB
|
|
|
- Map<String, List<DateValue>> secNavListMapDbData = getSecIdDateValueNavListMapByDb(secIds, startDate, endDate, visibility, navType);
|
|
|
+ Map<String, List<DateValue>> secNavListMapDbData = getSecIdDateValueNavListMapByDb(secIds, startDate, endDate, curveTypeId, strategyId, visibility, navType, secFrequencyMap);
|
|
|
allSecNavListMap.putAll(secNavListMapDbData);
|
|
|
|
|
|
//将取DB的标的的净值存进redis
|
|
@@ -160,8 +162,8 @@ public class NavServiceImpl implements NavService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, List<DateValue>> getSecIdDateValueNavListMapByDb(List<String> allSecIdList, String startDate, String endDate
|
|
|
- , Visibility visibility, NavType navType) {
|
|
|
+ public Map<String, List<DateValue>> getSecIdDateValueNavListMapByDb(List<String> allSecIdList, String startDate, String endDate,
|
|
|
+ Integer curveTypeId, Integer strategyId, Visibility visibility, NavType navType, Map<String, Frequency> secFrequencyMap) {
|
|
|
|
|
|
Map<String, List<DateValue>> allNavMap = new HashMap<>();
|
|
|
|
|
@@ -196,6 +198,20 @@ public class NavServiceImpl implements NavService {
|
|
|
allNavMap.putAll(rongzhiIndexIdNavMap);
|
|
|
}
|
|
|
|
|
|
+ //10.机构拟合净值
|
|
|
+ List<String> companyIdList = secIdTypeMap.get(SecType.COMPANY);
|
|
|
+ if(companyIdList != null && companyIdList.size() > 0){
|
|
|
+ Map<String, List<DateValue>> companyIdNavMap = getCompanyNavMap(companyIdList, startDate, endDate, curveTypeId, strategyId, navType, secFrequencyMap);
|
|
|
+ allNavMap.putAll(companyIdNavMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ //11.经理拟合净值
|
|
|
+ List<String> managerIdList = secIdTypeMap.get(SecType.MANAGER);
|
|
|
+ if(managerIdList != null && managerIdList.size() > 0){
|
|
|
+ Map<String, List<DateValue>> managerIdNavMap = getManagerNavMap(managerIdList, startDate, endDate, curveTypeId, strategyId, navType, secFrequencyMap);
|
|
|
+ allNavMap.putAll(managerIdNavMap);
|
|
|
+ }
|
|
|
+
|
|
|
//13.无风险收益
|
|
|
List<String> riskOfFree = secIdTypeMap.get(SecType.RISK_OF_FREE);
|
|
|
if (riskOfFree != null && riskOfFree.size() > 0) {
|
|
@@ -212,6 +228,18 @@ public class NavServiceImpl implements NavService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Map<String, List<DateValue>> getManagerNavMap(List<String> managerIdList, String startDate, String endDate, Integer curveType, Integer strategy, NavType navType, Map<String, Frequency> secFrequencyMap) {
|
|
|
+ Map<String, List<NavDto>> managerIdNavDtoListMap = managerNavDao.getNav(managerIdList, startDate, endDate, curveType, strategy, secFrequencyMap, false);
|
|
|
+ return SecNavDtoListMapToSecDateValueListMap(navType, managerIdNavDtoListMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, List<DateValue>> getCompanyNavMap(List<String> companyIdList, String startDate, String endDate, Integer curveType, Integer strategy, NavType navType, Map<String, Frequency> secFrequencyMap) {
|
|
|
+ Map<String, List<NavDto>> companyIdNavDtoListMap = companyNavDao.getNav(companyIdList, startDate, endDate, curveType, strategy, secFrequencyMap, false);
|
|
|
+ return SecNavDtoListMapToSecDateValueListMap(navType, companyIdNavDtoListMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public Map<String, List<DateValue>> getRongzhiIndexNavMap(List<String> rongzhiIndexIdList, String startDate, String endDate, NavType navType) {
|
|
|
Map<String, List<NavDto>> rongzhiIndexIdNavDtoListMap = rongzhiIndexNavDao.getNav(rongzhiIndexIdList, startDate, endDate, false);
|
|
|
return SecNavDtoListMapToSecDateValueListMap(navType, rongzhiIndexIdNavDtoListMap);
|
|
@@ -219,7 +247,7 @@ public class NavServiceImpl implements NavService {
|
|
|
|
|
|
@Override
|
|
|
public Map<String, List<DateValue>> getMarketIndexNavMap(List<String> marketIndexIdList, String startDate, String endDate, NavType navType) {
|
|
|
- Map<String, List<NavDto>> indexIdNavDtoListMap = marketIndexNavDao.getNav(marketIndexIdList, startDate, endDate, false);
|
|
|
+ Map<String, List<NavDto>> indexIdNavDtoListMap = marketIndexDao.getNav(marketIndexIdList, startDate, endDate, false);
|
|
|
return SecNavDtoListMapToSecDateValueListMap(navType, indexIdNavDtoListMap);
|
|
|
}
|
|
|
|