//package com.smppw.fofapi.service.indicator;
//
//
//import cn.hutool.core.collection.CollectionUtil;
//import cn.hutool.core.collection.ListUtil;
//import cn.hutool.core.map.MapUtil;
//import cn.hutool.core.util.StrUtil;
//import com.smppw.constants.Consts;
//import com.smppw.common.pojo.IStrategy;
//import com.smppw.common.pojo.dto.Benchmark;
//import com.smppw.common.pojo.dto.calc.IndicatorCalcPropertyDto;
//import com.smppw.common.pojo.dto.calc.IndicatorCalcTimeRangeDto;
//import com.smppw.common.pojo.dto.indicator.CalcMultipleSecMultipleTimeRangeIndicatorReq;
//import com.smppw.common.pojo.dto.indicator.DateIntervalDto;
//import com.smppw.common.pojo.enums.*;
//import com.smppw.common.pojo.enums.strategy.Strategy;
//
//import java.math.BigDecimal;
//import java.time.LocalDate;
//import java.time.format.DateTimeFormatter;
//import java.util.List;
//import java.util.Map;
//
//public interface BaseIndicatorServiceV2 {
//
//    /**
//     * 指标计算
//     *
//     * @return
//     */
//    Map<String, List<IndicatorCalcPropertyDto>> calcMultipleSecMultipleTimeRangeIndicator(CalcMultipleSecMultipleTimeRangeIndicatorReq req);
//
//    /**
//     * 指标计算 - 多频率的
//     *
//     * @return
//     */
//    Map<String, Map<Frequency, List<IndicatorCalcPropertyDto>>> calcMultipleSecMultipleTimeRangeIndicator(List<String> mainSecIdList, Map<String, String> secBenchmarkIdMap, List<String> indexIdList,
//                                                                                                          Integer raiseTypeId, Integer strategyId, Visibility visibility,
//                                                                                                          List<DateIntervalDto> dateIntervalDtoList,
//                                                                                                          List<Frequency> dataFrequencyList, NavType navType, Map<Frequency, List<Indicator>> dataFrequencyIndicatorListMap,
//                                                                                                          Map<Frequency, List<Indicator>> dataFrequencyGeoExtraIndicatorListMap, String riskOfFreeId, Double riskOfFreeValue,
//                                                                                                          boolean ifAnnualize, boolean calcIndexRetIndicatorValue, boolean needRet, boolean needExtraRet, String serverName, int leastRetNum);
//
//    /**
//     * 指标计算 - 动态列的
//     *
//     * @return
//     */
//    Map<Integer, Map<String, String>> calcMultipleSecMultipleTimeRangeIndicator(List<String> mainSecIdList, List<Integer> idList, Map<String, String> idBenchmarkMap, List<String> indexIdList,
//                                                                                Map<String, DateIntervalDto> idDateIntervalDtoMap, Map<String, Frequency> idNavFrequencyMap,
//                                                                                Map<String, Frequency> idCalcFrequencyMap, Map<String, NavType> idNavTypeMap,
//                                                                                Map<String, List<Indicator>> idIndicatorListMap, Map<String, List<Indicator>> idGeoExtraindicatorListMap,
//                                                                                Map<String, String> idRiskOfFreeIdMap, Map<String, Double> idRiskOfFreeValueMap, Map<String, Benchmark> benchmarkMap);
//
//    /**
//     * 走势
//     *
//     * @return
//     */
//    Map<String, List<IndicatorCalcPropertyDto>> getMultipleSecTrend(List<String> mainSecIdList, Map<String, String> secBenchmarkIdMap, List<String> indexIdList,
//                                                                    DateIntervalDto dateIntervalDto, Frequency frequency, BigDecimal fixedIncome, BigDecimal initValue, RaiseType raiseType,
//                                                                    IStrategy strategy, Visibility visibility, NavType navType, List<TrendType> trendTypeV2List, Boolean ifExtract, Integer userId);
//
//    /**
//     * 根据时段获取开始结束时间
//     *
//     * @param secId     标的
//     * @param raiseType 类型
//     * @param timeRange 时段
//     * @return 开始结束时间
//     */
//    default Map<String, String> getSecDateByTimeRange(String secId, RaiseType raiseType, TimeRange timeRange) {
//        String endDate = null;
//        String startDate = null;
//        List<IndicatorCalcTimeRangeDto> secTimeRange = getSecTimeRange(secId, raiseType, Strategy.All, Visibility.Both);
//        if (CollectionUtil.isNotEmpty(secTimeRange)) {
//            for (IndicatorCalcTimeRangeDto dto : secTimeRange) {
//                if (dto.getTimeRange() != timeRange) {
//                    continue;
//                }
//                startDate = dto.getStartDate();
//                endDate = dto.getEndDate();
//            }
//        }
//        if (StrUtil.isBlank(startDate)) {
//            startDate = Consts.START_DATE;
//        }
//        if (StrUtil.isBlank(endDate)) {
//            endDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
//        }
//        return MapUtil.<String, String>builder().put("startDate", startDate).put("endDate", endDate).build();
//    }
//
//    /**
//     * 获取标的的所有时段，包括开始结束日期，时段名称
//     *
//     * @param secId     标的
//     * @param raiseType 类型
//     * @return 所有时段
//     */
//    default List<Map<String, String>> getSecTimeRanges(String secId, RaiseType raiseType, IStrategy strategy, Visibility visibility) {
//        List<Map<String, String>> timeRangeList = ListUtil.list(true);
//        List<IndicatorCalcTimeRangeDto> secTimeRange = getSecTimeRange(secId, raiseType, strategy, visibility);
//        if (secTimeRange == null || secTimeRange.isEmpty()) {
//            return timeRangeList;
//        }
//        for (IndicatorCalcTimeRangeDto dto : secTimeRange) {
//            Map<String, String> data = MapUtil.<String, String>builder()
//                    .put("name", dto.getTimeRange().name())
//                    .put("startDate", dto.getStartDate())
//                    .put("endDate", dto.getEndDate())
//                    .build();
//            timeRangeList.add(data);
//        }
//        return timeRangeList;
//    }
//
//
//    /**
//     * time-range
//     *
//     * @return
//     */
//    List<IndicatorCalcTimeRangeDto> getSecTimeRange(String mainSecId, RaiseType raiseType, IStrategy strategy, Visibility visibility);
//
//    default List<Map<String, Object>> getMultiSecRetList(List<String> mainSecIdList, List<String> indexIds, Frequency frequency, String strategyKey, RaiseType raiseType) {
//        return this.getMultiSecRetList(mainSecIdList, indexIds, frequency, strategyKey, raiseType, null, null);
//    }
//
//    /**
//     * 获取标的 收益序列
//     *
//     * @param mainSecIdList 标的，可以多个
//     * @param indexIds      指数，可以多个
//     * @param strategyKey   策略 名称或id
//     * @param frequency     净值频率
//     * @param raiseType     类型
//     * @return 收益序列 {fund_id, end_date, ret_range}
//     */
//    List<Map<String, Object>> getMultiSecRetList(List<String> mainSecIdList, List<String> indexIds, Frequency frequency, String strategyKey, RaiseType raiseType, String startDate, String endDate);
//
//
//    default Map<String, List<IndicatorCalcPropertyDto>> getMultiSecRetListNew(List<String> mainSecIdList, List<String> indexIds, Frequency frequency, Frequency frequency1, String startDate, String endDate, boolean b, String benchmarkId, RaiseType raiseType, IStrategy strategy, Visibility visible, NavType navType){
//        return getMultiSecRetListNew(mainSecIdList, indexIds, frequency, frequency1, startDate, endDate, b, benchmarkId, raiseType, strategy, visible, navType,false, null);
//    }
//
//    Map<String, List<IndicatorCalcPropertyDto>> getMultiSecRetListNew(List<String> mainSecIdList, List<String> indexIds, Frequency frequency,
//                                                                      Frequency frequency1, String startDate, String endDate, boolean b,
//                                                                      String benchmarkId, RaiseType raiseType, IStrategy strategy,
//                                                                      Visibility visible, NavType navType,boolean isExtract, Integer userId);
//}
