Browse Source

去掉业务工具和方法,提取公共代码

wangzaijun 1 year ago
parent
commit
aea6a5410a
57 changed files with 168 additions and 2396 deletions
  1. 1 1
      pom.xml
  2. 4 4
      src/main/java/com/smppw/common/cache/CaffeineLocalCache.java
  3. 0 28
      src/main/java/com/smppw/common/exception/APIException.java
  4. 0 23
      src/main/java/com/smppw/common/exception/DataException.java
  5. 0 23
      src/main/java/com/smppw/common/pojo/ComStrateRankDto.java
  6. 0 25
      src/main/java/com/smppw/common/pojo/CommonData.java
  7. 0 28
      src/main/java/com/smppw/common/pojo/DataSetOtherInfoAndDateRes.java
  8. 0 29
      src/main/java/com/smppw/common/pojo/DataSetOtherInfoRes.java
  9. 0 23
      src/main/java/com/smppw/common/pojo/IndicatorCalcType.java
  10. 0 80
      src/main/java/com/smppw/common/pojo/InvestmentType.java
  11. 1 1
      src/main/java/com/smppw/common/pojo/vo/ResultVo.java
  12. 0 35
      src/main/java/com/smppw/common/pojo/SecurityBaseValues.java
  13. 0 29
      src/main/java/com/smppw/common/pojo/SecurityDoubleValuesContainsName.java
  14. 0 85
      src/main/java/com/smppw/common/pojo/StrategyTreeDto.java
  15. 0 49
      src/main/java/com/smppw/common/pojo/ValueLabelDo.java
  16. 0 47
      src/main/java/com/smppw/common/pojo/ValueLabelWithEn.java
  17. 2 4
      src/main/java/com/smppw/common/pojo/dto/NewDateValue.java
  18. 0 20
      src/main/java/com/smppw/common/pojo/dto/PageInfoRes.java
  19. 0 13
      src/main/java/com/smppw/common/pojo/dto/log/RequestErrorInfo.java
  20. 0 14
      src/main/java/com/smppw/common/pojo/dto/log/RequestInfo.java
  21. 0 21
      src/main/java/com/smppw/common/pojo/enums/AssetStyleType.java
  22. 0 62
      src/main/java/com/smppw/common/pojo/enums/BarrConstant.java
  23. 0 48
      src/main/java/com/smppw/common/pojo/enums/BarraRiskProfitEnum.java
  24. 0 71
      src/main/java/com/smppw/common/pojo/enums/BarraStyleRespEnum.java
  25. 0 29
      src/main/java/com/smppw/common/pojo/enums/CombinationType.java
  26. 0 24
      src/main/java/com/smppw/common/pojo/enums/Constraint.java
  27. 0 8
      src/main/java/com/smppw/common/pojo/enums/DataSourceType.java
  28. 0 31
      src/main/java/com/smppw/common/pojo/enums/FileType.java
  29. 0 50
      src/main/java/com/smppw/common/pojo/enums/FutureStyleRespEnum.java
  30. 0 274
      src/main/java/com/smppw/common/pojo/enums/IndicatorContrastEnum.java
  31. 0 25
      src/main/java/com/smppw/common/pojo/enums/IndustryType.java
  32. 0 29
      src/main/java/com/smppw/common/pojo/enums/MarketIndexEnum.java
  33. 0 32
      src/main/java/com/smppw/common/pojo/enums/OptionsType.java
  34. 0 18
      src/main/java/com/smppw/common/pojo/enums/OrderTypeEnum.java
  35. 0 27
      src/main/java/com/smppw/common/pojo/enums/RBSAIndexType.java
  36. 0 61
      src/main/java/com/smppw/common/pojo/enums/SystemObjectEnum.java
  37. 0 24
      src/main/java/com/smppw/common/pojo/enums/ValueGrowthType.java
  38. 0 23
      src/main/java/com/smppw/common/pojo/enums/WinRateBmk.java
  39. 0 28
      src/main/java/com/smppw/constants/DataSourceConst.java
  40. 0 15
      src/main/java/com/smppw/constants/IndexTypeConf.java
  41. 0 33
      src/main/java/com/smppw/constants/MapFieldConstants.java
  42. 0 9
      src/main/java/com/smppw/constants/NavConst.java
  43. 0 68
      src/main/java/com/smppw/constants/RedisConst.java
  44. 8 9
      src/main/java/com/smppw/core/CalcService.java
  45. 2 2
      src/main/java/com/smppw/core/reta/calc/SingleMaxDrawdown.java
  46. 0 26
      src/main/java/com/smppw/utils/AbsPasswordUtils.java
  47. 0 85
      src/main/java/com/smppw/utils/BinarySearchUtil.java
  48. 0 26
      src/main/java/com/smppw/utils/CardIdUtil.java
  49. 0 32
      src/main/java/com/smppw/utils/CheckUtil.java
  50. 0 33
      src/main/java/com/smppw/utils/CommonUtil.java
  51. 0 168
      src/main/java/com/smppw/utils/IndicatorCalc.java
  52. 150 0
      src/main/java/com/smppw/utils/IndicatorCalcUtil.java
  53. 0 43
      src/main/java/com/smppw/utils/QuartileUtil.java
  54. 0 76
      src/main/java/com/smppw/utils/RBSAIndexTypeMap.java
  55. 0 206
      src/main/java/com/smppw/utils/RateConvertorUtils.java
  56. 0 99
      src/main/java/com/smppw/utils/RedisUtils.java
  57. 0 20
      src/main/java/com/smppw/utils/StrategyUtil.java

+ 1 - 1
pom.xml

@@ -6,7 +6,7 @@
 
     <groupId>com.smppw</groupId>
     <artifactId>data-calc</artifactId>
-    <version>0.1.3-SNAPSHOT</version>
+    <version>0.1.4-SNAPSHOT</version>
 
     <properties>
         <maven.compiler.source>17</maven.compiler.source>

+ 4 - 4
src/main/java/com/smppw/common/cache/CaffeineLocalCache.java

@@ -7,7 +7,7 @@ import com.smppw.constants.DateConst;
 import com.smppw.constants.IndexConst;
 import com.smppw.constants.SearchConst;
 import com.smppw.common.pojo.IndexesTradeDateDo;
-import com.smppw.common.pojo.ValueLabelDo;
+import com.smppw.common.pojo.ValueLabelVO;
 import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
 
@@ -68,7 +68,7 @@ public class CaffeineLocalCache extends BasicLocalCache {
     /**
      * 缓存 基金研究 所有的 key对应的配置项
      */
-    private static Cache<String, List<ValueLabelDo>> INDICATOR_SCREENING_CONFIG = Caffeine.newBuilder().maximumSize(16384).build();
+    private static Cache<String, List<ValueLabelVO>> INDICATOR_SCREENING_CONFIG = Caffeine.newBuilder().maximumSize(16384).build();
     private static Cache<String, List<String>> YEAR_INDICATOR = Caffeine.newBuilder().maximumSize(16384).build();
 
     /**
@@ -211,11 +211,11 @@ public class CaffeineLocalCache extends BasicLocalCache {
         RISKOFFREEIDS.put(IndexConst.RISKOFFREE_CAFFEINE_KEY, indexIdList);
     }
 
-    public static void addIndicatorScreeningConfig(Map<String, List<ValueLabelDo>> valueLabelMap) {
+    public static void addIndicatorScreeningConfig(Map<String, List<ValueLabelVO>> valueLabelMap) {
         INDICATOR_SCREENING_CONFIG.putAll(valueLabelMap);
     }
 
-    public static Map<String, List<ValueLabelDo>> getIndicatorScreeningConfig() {
+    public static Map<String, List<ValueLabelVO>> getIndicatorScreeningConfig() {
         return INDICATOR_SCREENING_CONFIG.asMap();
     }
 

+ 0 - 28
src/main/java/com/smppw/common/exception/APIException.java

@@ -1,28 +0,0 @@
-package com.smppw.common.exception;
-
-import com.smppw.common.pojo.enums.status.ResultCode;
-import com.smppw.common.pojo.enums.status.StatusCode;
-import lombok.Getter;
-
-@Getter
-public class APIException extends RuntimeException {
-    private final int code;
-    private final String msg;
-
-    // 手动设置异常
-    public APIException(StatusCode statusCode, String message) {
-        // message用于用户设置抛出错误详情,例如:当前价格-5,小于0
-        super(message);
-        // 状态码
-        this.code = statusCode.getCode();
-        // 状态码配套的msg
-        this.msg = statusCode.getMsg();
-    }
-
-    // 默认异常使用APP_ERROR状态码
-    public APIException(String message) {
-        super(message);
-        this.code = ResultCode.COMMON_ERROR.getCode();
-        this.msg = message;
-    }
-}

+ 0 - 23
src/main/java/com/smppw/common/exception/DataException.java

@@ -1,23 +0,0 @@
-package com.smppw.common.exception;
-
-import com.smppw.common.pojo.enums.status.ResultCode;
-
-/**
- * @author Rain
- * @date 2023/4/6 18:02
- * @description
- */
-public class DataException extends RuntimeException {
-
-    private static final long serialVersionUID = 8706998320785170500L;
-    private final int code = ResultCode.DATA_PRE_SHOW_MESSAGE_ERROR.getCode();
-
-    public DataException(String message) {
-        super(message);
-    }
-
-
-    public int getCode() {
-        return code;
-    }
-}

+ 0 - 23
src/main/java/com/smppw/common/pojo/ComStrateRankDto.java

@@ -1,23 +0,0 @@
-package com.smppw.common.pojo;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class ComStrateRankDto {
-    private String vColumn;
-    private String vTable;
-    private String orderType;
-    private String strategySql;
-    private String companyAssetSizeSql;
-    private String startDate;
-    private String endDate;
-    private String citySql;
-    private String vEndDate1;
-    private String companyNameSql;
-    private String rankLimitSql;
-
-}

+ 0 - 25
src/main/java/com/smppw/common/pojo/CommonData.java

@@ -1,25 +0,0 @@
-package com.smppw.common.pojo;
-
-import lombok.Builder;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.io.Serializable;
-import java.util.Map;
-
-/**
-* @author wangzaijun
-* @date 2023/3/3 17:27
-* @description 公共返回模型,可以通过工具方法扩展为map
-*/
-@Setter
-@Getter
-@Builder
-public final class CommonData<T> implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private T dataset;
-    private Map<String, String> productNameMapping;
-
-    private Map<String, Object> extInfos;
-}

+ 0 - 28
src/main/java/com/smppw/common/pojo/DataSetOtherInfoAndDateRes.java

@@ -1,28 +0,0 @@
-package com.smppw.common.pojo;
-
-/**
- * @author Rain
- * @date 2023/2/16 9:58
- * @description 图表通用的返回结构 添加了 起始日期
- */
-public class DataSetOtherInfoAndDateRes<T, S> extends DataSetOtherInfoRes<T,S>{
-
-    private String startDate;
-    private String endDate;
-
-    public String getStartDate() {
-        return startDate;
-    }
-
-    public void setStartDate(String startDate) {
-        this.startDate = startDate;
-    }
-
-    public String getEndDate() {
-        return endDate;
-    }
-
-    public void setEndDate(String endDate) {
-        this.endDate = endDate;
-    }
-}

+ 0 - 29
src/main/java/com/smppw/common/pojo/DataSetOtherInfoRes.java

@@ -1,29 +0,0 @@
-package com.smppw.common.pojo;
-
-/**
- * @author Rain
- * @date 2023/2/16 9:58
- * @description 图表通用的返回结构
- */
-public class DataSetOtherInfoRes<T, S> {
-
-    protected T dataset;
-    protected S productNameMapping;
-
-
-    public T getDataset() {
-        return dataset;
-    }
-
-    public void setDataset(T dataset) {
-        this.dataset = dataset;
-    }
-
-    public S getProductNameMapping() {
-        return productNameMapping;
-    }
-
-    public void setProductNameMapping(S productNameMapping) {
-        this.productNameMapping = productNameMapping;
-    }
-}

+ 0 - 23
src/main/java/com/smppw/common/pojo/IndicatorCalcType.java

@@ -1,23 +0,0 @@
-package com.smppw.common.pojo;
-
-import java.util.stream.Stream;
-
-/**
- * @author zhengsongliang
- */
-public enum IndicatorCalcType {
-	Curve(1), Average(2);
-	private int id;
-
-	private IndicatorCalcType(int id) {
-		this.id = id;
-	}
-
-	public int getId() {
-		return id;
-	}
-
-	public static IndicatorCalcType getReturnRiskCalcType(int id) {
-		return Stream.of(IndicatorCalcType.values()).filter(e -> e.id == id).findFirst().orElse(null);
-	}
-}

+ 0 - 80
src/main/java/com/smppw/common/pojo/InvestmentType.java

@@ -1,80 +0,0 @@
-package com.smppw.common.pojo;
-
-import com.smppw.common.pojo.enums.strategy.Strategy;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-import java.util.stream.Stream;
-
-/**
- * @author Rain
- *
- */
-public enum InvestmentType {
-
-	Fund(1, "^[HM]F.*"), Company(2, "^CO.*"), Manager(3, "^PL.*"), ExternalFund(4, "^CF.*"), Portfolio(5,
-			"^PO.*"), Index(6, "^IN.*"), UDIndex(8, "^CI.*"),BFI(9,"^FA.*"),ADVISORYPOOL(10,"^AP.*");
-
-	private InvestmentType(int id, String regex) {
-		this.regex = regex;
-		this.id = id;
-	}
-
-	private final int id;
-	private final String regex;
-
-	public int getId() {
-		return id;
-	}
-
-	public String getRegex() {
-		return regex;
-	}
-
-	public static InvestmentType getInvestmentType(int id) {
-		return Stream.of(values()).filter(e -> e.id == id).findFirst().orElse(null);
-	}
-
-	public static InvestmentType getInvestmentType(String secId) {
-		if(null == secId)
-			return null;
-		
-		String secIdUpper = secId.toUpperCase();
-		
-		for (InvestmentType type : values())
-			if (Pattern.matches(type.getRegex(), secIdUpper))
-				return type;
-		
-		return null;
-	}
-
-	public static boolean check(String id) {
-		if (StringUtils.isEmpty(id))
-			return false;
-		return getInvestmentType(id) != null;
-	}
-
-	/**
-	 * 将输入的ID值按类型分为不同的List
-	 *
-	 * @param secIds ID值
-	 * @return 返回值key为类型,value为对应类型的ID值
-	 */
-	public static Map<InvestmentType, List<String>> classifyIds(List<String> secIds) {
-		Map<InvestmentType, List<String>> map = new HashMap<>();
-		for (String id : secIds) {
-			if (id == null || Strategy.isStrategy(id))
-				continue;
-			InvestmentType type = getInvestmentType(id);
-			if (!map.containsKey(type))
-				map.put(type, new ArrayList<>());
-			map.get(type).add(id);
-		}
-		return map;
-	}
-	
-}

+ 1 - 1
src/main/java/com/smppw/common/pojo/vo/ResultVo.java

@@ -1,4 +1,4 @@
-package com.smppw.common.pojo.vo;
+package com.smppw.common.pojo;
 
 import com.smppw.common.pojo.enums.status.ResultCode;
 import com.smppw.common.pojo.enums.status.StatusCode;

+ 0 - 35
src/main/java/com/smppw/common/pojo/SecurityBaseValues.java

@@ -1,35 +0,0 @@
-package com.smppw.common.pojo;
-
-import java.util.List;
-
-
-public class SecurityBaseValues<T> {
-	private String id;
-	private List<T> values;
-
-	public SecurityBaseValues() {
-		super();
-	}
-
-	public SecurityBaseValues(String id, List<T> values) {
-		super();
-		this.id = id;
-		this.values = values;
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public List<T> getValues() {
-		return values;
-	}
-
-	public void setValues(List<T> values) {
-		this.values = values;
-	}
-}

+ 0 - 29
src/main/java/com/smppw/common/pojo/SecurityDoubleValuesContainsName.java

@@ -1,29 +0,0 @@
-package com.smppw.common.pojo;
-
-import java.util.List;
-
-@SuppressWarnings("rawtypes")
-public class SecurityDoubleValuesContainsName extends SecurityBaseValues{
-
-    @SuppressWarnings({ "unchecked" })
-	public SecurityDoubleValuesContainsName(String id, List values, String name) {
-        super(id, values);
-        this.name = name;
-    }
-
-    public SecurityDoubleValuesContainsName(String name) {
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    private String name;
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-
-}

+ 0 - 85
src/main/java/com/smppw/common/pojo/StrategyTreeDto.java

@@ -1,85 +0,0 @@
-package com.smppw.common.pojo;
-
-import java.util.List;
-
-public class StrategyTreeDto {
-    private String id;  // 数据库ID
-
-    private Integer strategyId; // 策略ID
-
-    private String value;   // 策略英文名
-
-    private String label;   // 策略中文名
-
-    private String benchmarkId; // 基准ID
-
-    private String benchmarkName;   // 基准中文名
-
-    private String rongzhiIndex; // 基准ID
-
-    private List<StrategyTreeDto> child;   // 子策略
-
-    public Integer getStrategyId() {
-        return strategyId;
-    }
-
-    public void setStrategyId(Integer strategyId) {
-        this.strategyId = strategyId;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
-    public String getBenchmarkId() {
-        return benchmarkId;
-    }
-
-    public void setBenchmarkId(String benchmarkId) {
-        this.benchmarkId = benchmarkId;
-    }
-
-    public String getRongzhiIndex() {
-        return rongzhiIndex;
-    }
-
-    public void setRongzhiIndex(String rongzhiIndex) {
-        this.rongzhiIndex = rongzhiIndex;
-    }
-
-    public String getBenchmarkName() {
-        return benchmarkName;
-    }
-
-    public void setBenchmarkName(String benchmarkName) {
-        this.benchmarkName = benchmarkName;
-    }
-
-    public List<StrategyTreeDto> getChild() {
-        return child;
-    }
-
-    public void setChild(List<StrategyTreeDto> child) {
-        this.child = child;
-    }
-}

+ 0 - 49
src/main/java/com/smppw/common/pojo/ValueLabelDo.java

@@ -1,49 +0,0 @@
-package com.smppw.common.pojo;
-
-import com.smppw.constants.Consts;
-
-import java.io.Serializable;
-
-/**
- * @author Rain
- * @date 2023/2/27 14:34
- * @description 初始化配置项
- */
-public class ValueLabelDo implements Serializable {
-    private static final long serialVersionUID = Consts.DEFAULT_SERIAL_VERSION_UID;
-
-    protected String label;
-    protected String value;
-
-    public ValueLabelDo() {
-    }
-
-    public ValueLabelDo(String label, String value) {
-        this.label = label;
-        this.value = value;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    @Override
-    public String toString() {
-        return "ValueLabelDo{" +
-                "label='" + label + '\'' +
-                ", value='" + value + '\'' +
-                '}';
-    }
-}

+ 0 - 47
src/main/java/com/smppw/common/pojo/ValueLabelWithEn.java

@@ -1,47 +0,0 @@
-package com.smppw.common.pojo;
-
-/**
- * @author Rain
- * @date 2023/3/20 13:57
- * @description
- */
-public class ValueLabelWithEn extends ValueLabelDo{
-
-    private Integer id;
-    private String valueEn;
-
-    public ValueLabelWithEn() {
-    }
-
-    public ValueLabelWithEn(Integer id, String valueEn,String value,String label) {
-        super(label, value);
-        this.id = id;
-        this.valueEn = valueEn;
-    }
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getValueEn() {
-        return valueEn;
-    }
-
-    public void setValueEn(String valueEn) {
-        this.valueEn = valueEn;
-    }
-
-    @Override
-    public String toString() {
-        return "ValueLabelWithEn{" +
-                "id=" + id +
-                ", valueEn='" + valueEn + '\'' +
-                ", label='" + label + '\'' +
-                ", value='" + value + '\'' +
-                '}';
-    }
-}

+ 2 - 4
src/main/java/com/smppw/common/pojo/dto/NewDateValue.java

@@ -1,14 +1,12 @@
 package com.smppw.common.pojo.dto;
 
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
+import lombok.*;
 
 @Setter
 @Getter
 @NoArgsConstructor
 @AllArgsConstructor
+@EqualsAndHashCode
 public class NewDateValue {
     private String date;
     private String value;

+ 0 - 20
src/main/java/com/smppw/common/pojo/dto/PageInfoRes.java

@@ -1,20 +0,0 @@
-package com.smppw.common.pojo.dto;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.List;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class PageInfoRes<T> {
-    // 总条数
-    private long total;
-
-    // 结果集
-    private List<T> list;
-
-
-}

+ 0 - 13
src/main/java/com/smppw/common/pojo/dto/log/RequestErrorInfo.java

@@ -1,13 +0,0 @@
-package com.smppw.common.pojo.dto.log;
-
-import lombok.Data;
-
-@Data
-public class RequestErrorInfo {
-    private String ip;
-    private String url;
-    private String httpMethod;
-    private String classMethod;
-    private Object requestParams;
-    private RuntimeException exception;
-}

+ 0 - 14
src/main/java/com/smppw/common/pojo/dto/log/RequestInfo.java

@@ -1,14 +0,0 @@
-package com.smppw.common.pojo.dto.log;
-
-import lombok.Data;
-
-@Data
-public class RequestInfo {
-    private String ip;
-    private String url;
-    private String httpMethod;
-    private String classMethod;
-    private Object requestParams;
-    private Object result;
-    private Long timeCost;
-}

+ 0 - 21
src/main/java/com/smppw/common/pojo/enums/AssetStyleType.java

@@ -1,21 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import java.util.stream.Stream;
-
-public enum AssetStyleType {
-	MultiAsset(2),
-	SegmentationAsset(10),
-	RongZhiStrategy(7);
-	
-	private int id;
-	private AssetStyleType(int id) {
-		this.id = id;
-	}
-	public int getId() {
-		return id;
-	}
-	
-	public static AssetStyleType getIndex(int id) {
-		return Stream.of(AssetStyleType.values()).filter(e -> e.id == id).findFirst().orElse(null);
-	}
-}

+ 0 - 62
src/main/java/com/smppw/common/pojo/enums/BarrConstant.java

@@ -1,62 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-/**
- * barra因子相关的常量
- * @author lwq
- */
-public final class BarrConstant {
-
-    private BarrConstant(){}
-
-    /**
-     * 计算给定时间段的总的业绩归因
-     */
-    public static final int CONTROL_ZERO = 0;
-
-    /**
-     * 计算给定时间段的各个时间点上的的所有Beta值和因子业绩归因
-     */
-    public static final int CONTROL_ONE = 1;
-
-    /**
-     * 敏感度趋势
-     */
-    public static final int CONTROL_TWO = 2;
-
-    /**
-     * 查询因子时固定的参数顺序
-     */
-    public static final String BARRA_FACTOR_INDEXS = "beta_book-to-price-ratio_earnings-yield_growth_leverage_liquidity_momentum_non-linear-size_residual-volatility_size";
-    public static final String FUTURE_INDEXS = "ts22_cs5_cs22_skew22_skew66_ts5_wh22_cv22_tr22_basis22_vol5_vol22";
-
-    /**
-     * 股票池为全市场
-     */
-    public static final String POOL_CACHE_ALL = "all_market";
-
-    /**
-     * 请求Python的URL
-     */
-    public static final String FACTOR_URL = "getBarraSensitivity";
-
-    public static final String FUTURE_URL = "futuresStyle";
-
-    /**
-     * R的方
-     */
-    public static final String R_SQUARED = "r_squared";
-
-    public static final String RSQUARED_S = "rSquared";
-
-    public static final String PRODUCT = "product";
-
-    public static final String EXPOSE = "expose";
-
-    public static final String STATUS = "status";
-
-    public static final String END_DATE = "end_date";
-    public static final String SPECIAL_FACTOR_RET = "special_factor_ret";
-    public static final String NAV_R_SQUARED = "nav_r_squared";
-
-
-}

+ 0 - 48
src/main/java/com/smppw/common/pojo/enums/BarraRiskProfitEnum.java

@@ -1,48 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-/**
- * @author Rain
- * @date 2023/3/14 23:05
- * @description
- */
-public enum BarraRiskProfitEnum {
-
-    PRODUCT_RET(1, "productRet", "product_ret", "产品波动率", "产品收益率"),
-    SPECIAL_FACTOR_RET(2, "specialFactorRet", "special_factor_ret", "特质因子贡献波动率", "特质因子贡献收益率"),
-    MARKET_RET(3, "marketRet", "market_ret", "风格因子贡献波动率", "风格因子贡献收益率"),
-    R_SQUARE(4, "r2", "r_squared", "R2值", "R2值");
-
-    BarraRiskProfitEnum(int type, String key, String code, String risk, String profit) {
-        this.type = type;
-        this.key = key;
-        this.code = code;
-        this.risk = risk;
-        this.profit = profit;
-    }
-
-    private final int type;
-    private final String key;
-    private final String code;
-    private final String risk;
-    private final String profit;
-
-    public int getType() {
-        return type;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public String getRisk() {
-        return risk;
-    }
-
-    public String getProfit() {
-        return profit;
-    }
-}

+ 0 - 71
src/main/java/com/smppw/common/pojo/enums/BarraStyleRespEnum.java

@@ -1,71 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import lombok.Getter;
-
-@Getter
-public enum BarraStyleRespEnum {
-    //beta_book-to-price-ratio_earnings-yield_growth_leverage_liquidity_momentum_non-linear-size_residual-volatility_size
-    BETA(1,2,"beta","贝塔","beta因子"),
-    BOOKTOPRICERATIO(2,10,"bookToPriceRatio","账面市值比","账面市值比因子"),
-    EARNINGSYIELD(3,9,"earningsYield","盈利率","盈利预期因子"),
-    GROWTH(4,4,"growth","成长性","成长因子"),
-    LEVERAGE(5,6,"leverage","杠杆率","杠杆因子"),
-    LIQUIDITY(6,1,"liquidity","流动性","流动性因子"),
-    MOMENTUM(7,5,"momentum","动量","动量因子"),
-    NONLINEARSIZE(8,7,"nonLinearSize","非线性市值","非线性市值因子"),
-    RESIDUALVOLATILITY(9,3,"residualVolatility","残差波动率","残差波动因子"),
-    SIZE(10,8,"size","规模","市值因子"),
-    ;
-
-    private Integer num;
-    private Integer posNum;
-    private String name;
-    private String cName;
-    private String yName;
-
-    BarraStyleRespEnum(Integer num, Integer posNum, String name, String cName, String yName) {
-        this.num = num;
-        this.posNum = posNum;
-        this.name = name;
-        this.cName = cName;
-        this.yName = yName;
-    }
-
-    public static String getBarrCname(int num){
-        for (BarraStyleRespEnum barrNum : BarraStyleRespEnum.values()){
-            if (barrNum.getNum() == num) {
-                return barrNum.getCName();
-            }
-        }
-        return "";
-    }
-
-    public static BarraStyleRespEnum getBarrEnum(int num){
-        for (BarraStyleRespEnum barrNum : BarraStyleRespEnum.values()){
-            if (barrNum.getNum().intValue() == num) {
-                return barrNum;
-            }
-        }
-        return null;
-    }
-
-    public static BarraStyleRespEnum getBarrEnumPos(int posNum){
-        for (BarraStyleRespEnum barrNum : BarraStyleRespEnum.values()){
-            if (barrNum.getPosNum().intValue() == posNum) {
-                return barrNum;
-            }
-        }
-        return null;
-    }
-
-
-    public static String getBarrYNameByName(String name){
-        for (BarraStyleRespEnum barrNum : BarraStyleRespEnum.values()){
-            if (barrNum.getName().equals(name)) {
-                return barrNum.getYName();
-            }
-        }
-        return "";
-    }
-
-}

+ 0 - 29
src/main/java/com/smppw/common/pojo/enums/CombinationType.java

@@ -1,29 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import java.util.Arrays;
-
-public enum CombinationType {
-
-    MANUALLY_CREATE(1,"手动创建"),AUTO_CREATE(2,"智能创建");
-
-    private final int code;
-
-    private final String desc;
-
-    CombinationType(int type, String desc) {
-        this.code= type;
-        this.desc=desc;
-    }
-
-    public int getCode() {
-        return code;
-    }
-
-    public String getDesc() {
-        return desc;
-    }
-
-    public static CombinationType getCombinationByCode(int code){
-        return Arrays.stream(CombinationType.values()).filter(p->p.code == code).findFirst().orElse(null);
-    }
-}

+ 0 - 24
src/main/java/com/smppw/common/pojo/enums/Constraint.java

@@ -1,24 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import java.util.stream.Stream;
-
-/**
- * @author zhengsongliang
- * @datetime 2017年8月7日 下午4:41:43
- */
-public enum Constraint {
-	LongPosition(1), ShortPosition(2);
-	private int id;
-
-	public int getId() {
-		return id;
-	}
-
-	private Constraint(int id) {
-		this.id = id;
-	}
-
-	public static Constraint getConstraint(int id) {
-		return Stream.of(Constraint.values()).filter(e -> e.id == id).findFirst().orElse(null);
-	}
-}

+ 0 - 8
src/main/java/com/smppw/common/pojo/enums/DataSourceType.java

@@ -1,8 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-/**
- * @author zhengsongliang
- */
-public enum DataSourceType {
-	Ret,Nav,Both,ExtraNav, ExtraRetAri, ExtraRetGeo, Drawdown, ExtraDrawdown;
-}

+ 0 - 31
src/main/java/com/smppw/common/pojo/enums/FileType.java

@@ -1,31 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import lombok.Getter;
-
-/**
- * @author:zhouf
- * @date:2023/7/5
- * @description:
- */
-@Getter
-public enum FileType {
-    PDF(1, ".pdf"),
-    PPT(2, ".ppt"),
-    PPTX(3,".pptx"),
-    DOC(4,".doc");
-    private final int type;
-    private final String fileName;
-
-    FileType(int type, String fileName) {
-        this.type = type;
-        this.fileName = fileName;
-    }
-    public static int  getIndex(String fileName) {
-        for (FileType fileType:FileType.values()) {
-            if (fileType.getFileName().equalsIgnoreCase(fileName)){
-                return fileType.getType();
-            }
-        }
-        return 0;
-    }
-}

+ 0 - 50
src/main/java/com/smppw/common/pojo/enums/FutureStyleRespEnum.java

@@ -1,50 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import lombok.Getter;
-
-@Getter
-public enum FutureStyleRespEnum {
-    //ts22_cs5_cs22_skew22_skew66_ts5_wh22_cv22_tr22_basis22_vol5_vol22
-    TS22(1,"ts22","时序动量因子"),
-    CS5(2,"cs5","短周期截面动量因子"),
-    CS22(3,"cs22","截面动量因子"),
-    SKEW22(4,"skew22","偏度因子"),
-    SKEW66(5,"skew66","长周期偏度因子"),
-    TS5(6,"ts5","短周期时序动量因子"),
-    WH22(7,"wh22","仓单因子"),
-    CV22(8,"cv22","基差因子"),
-    TR22(9,"tr22","展期收益率因子"),
-    BASIS22(10,"basis22","基差动量因子"),
-    VOL5(11,"vol5","短周期波动因子"),
-    VOL22(12,"vol22","波动因子"),
-    ;
-
-    private Integer num;
-    private String name;
-    private String cName;
-
-    FutureStyleRespEnum(Integer num, String name, String cName) {
-        this.num = num;
-        this.name = name;
-        this.cName = cName;
-    }
-
-    public static String getFutureCname(int num){
-        for (FutureStyleRespEnum futureNum : FutureStyleRespEnum.values()){
-            if (futureNum.getNum() == num) {
-                return futureNum.getCName();
-            }
-        }
-        return "";
-    }
-
-    public static String getFutureName(int num){
-        for (FutureStyleRespEnum futureNum : FutureStyleRespEnum.values()){
-            if (futureNum.getNum() == num) {
-                return futureNum.getName();
-            }
-        }
-        return "";
-    }
-
-}

+ 0 - 274
src/main/java/com/smppw/common/pojo/enums/IndicatorContrastEnum.java

@@ -1,274 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Stream;
-
-/**
- * 指标
- * 更多介绍:http://112.74.196.215:8090/pages/viewpage.action?pageId=362530
- */
-public enum IndicatorContrastEnum {
-
-    /**
-     * 区间收益(%)用净值计算
-     */
-    IntervalReturn(1, "IntervalReturn", "IntervalReturn", "区间收益", true, true),
-    ExcessReturnDynamic(69, "ExcessReturnDynamic", "ExcessReturnRealTimeCalc", "超额区间收益", true, true),
-    ExcessReturnDynamicAnnual(69, "ExcessReturnDynamicAnnual", "ExcessReturnRealTimeCalc", "超额年化收益", true, true),
-    /**
-     * 年化收益(%)(几何)
-     */
-    AnnualReturn(39, "AnnualReturn", "AnnualReturn", "年化收益率", true, true),
-    /**
-     * 阿尔法(%)
-     */
-    Alpha(11, "Alpha", "Alpha", "阿尔法", true, true),
-    /**
-     * 上行捕获率
-     */
-    UpCaptureRatio(35, "UpCaptureRatio", "UpCaptureRatio", "上行捕获率", false, false),
-    /**
-     * 下行捕获率
-     */
-    DownCaptureRatio(36, "DownCaptureRatio", "DownCaptureRatio", "下行捕获率", false, false),
-    /**
-     * 上行捕获收益率(%)
-     */
-    UpCaptureReturn(33, "UpCaptureReturn", "UpCaptureReturn", "上行捕获收益率", true, true),
-    /**
-     * 下行捕获收益率(%)
-     */
-    DownCaptureReturn(34, "DownCaptureReturn", "DownCaptureReturn", "下行捕获收益率", true, true),
-    /**
-     * 夏普比率
-     */
-    SharpeRatio(18, "SharpeRatio", "SharpeRatio", "夏普比率", false, false),
-    /**
-     * 索提诺比率
-     */
-    SortinoRatio(58, "SortinoRatio", "SortinoRatio", "索提诺比率", false, false),
-    /**
-     * 索提诺比率(MAR)
-     */
-    SortinoRatioMAR(19, "SortinoRatioMAR", "SortinoRatioMAR", "索提诺比率(MAR)", false, false),
-    /**
-     * 特雷诺比率
-     */
-    TreynorRatio(15, "TreynorRatio", "TreynorRatio", "特雷诺比率", false, false),
-    /**
-     * 欧米伽比率
-     */
-    Omega(17, "Omega", "Omega", "欧米伽比率", false, false),
-    /**
-     * 卡帕比率
-     */
-    Kappa(14, "Kappa", "Kappa", "卡帕比率", false, false),
-    /**
-     * 卡玛比率
-     */
-    CalmarRatio(40, "CalmarRatio", "CalmarRatio", "卡玛比率", false, false),
-    /**
-     * 信息比率
-     */
-    InformationRatio(38, "InformationRatio", "InformationRatio", "信息比率", false, false),
-    /**
-     * 詹森指数(%)
-     */
-    Jensen(16, "Jensen", "Jensen", "詹森指数", true, false),
-    /**
-     * M2(%)
-     */
-    M2(49, "M2", "M2", "M2", true, true),
-    WinRate(59, "WinRate", "WinRate", "超额胜率", true, false),
-//	WinRateMonth(59,"WinRateMonth","WinRate","超额月胜率",true,false),
-    /**
-     * 超额收益夏普比率
-     */
-    ExcessReturnSharpeRatio(72, "ExcessReturnSharpeRatio", "ExcessReturnSharpeRatio", "超额夏普比率", false, false),
-    /**
-     * 年化标准差(%)
-     */
-    AnnualStdDev(10, "AnnualStdDev", "AnnualStdDev", "年化标准差", true, false),
-    /**
-     * 贝塔
-     */
-    Beta(12, "Beta", "Beta", "贝塔", false, false),
-    /**
-     * 偏度
-     */
-    Skewness(9, "Skewness", "Skewness", "偏度", false, false),
-    /**
-     * 峰度
-     */
-    Kurtosis(6, "Kurtosis", "Kurtosis", "峰度", false, false),
-    /**
-     * 跟踪误差(%)
-     */
-    TrackingError(48, "TrackingError", "TrackingError", "跟踪误差", true, false),
-    /**
-     * 最大回撤(%)
-     */
-    MaxDrawdown(2, "MaxDrawdown", "MaxDrawdown", "最大回撤", true, false),
-    /**
-     * 超额收益最大回撤(%)
-     */
-    ExcessReturnMaxDrawdown(75, "ExcessReturnMaxDrawdown", "ExcessReturnMaxDrawdown", "超额最大回撤", true, false),
-    /**
-     * 最大回撤修复日期
-     */
-    MaxDrawdownRecureDate(8, "MaxDrawdownRecureDate", "MaxDrawdownRecureDate", "最大回撤修复日期", false, false),
-    /**
-     * 最大回撤修复数
-     */
-    MaxDrawdownRecureIntervalDays(76, "MaxDrawdownRecureIntervalDays", "MaxDrawdownRecureIntervalDays", "最大回撤修复天数", false, false),
-    /**
-     * 历史VaR(%)
-     */
-    HistoricalVaR(41, "HistoricalVaR", "HistoricalVaR", "历史VaR", true, false),
-    /**
-     * 历史CVaR(%)
-     */
-    HistoricalCVaR(42, "HistoricalCVaR", "HistoricalCVaR", "历史CVaR", true, false),
-    /**
-     * 下行风险(%)
-     */
-    DownsideStdDev(21, "DownsideStdDev", "DownsideStdDev", "下行风险", true, false),
-    /**
-     * 最大回撤波峰日期 added by xjs
-     */
-    MaxDrawdownPeakDate(63, "MaxDrawdownPeakDate", "MaxDrawdownPeakDate", "最大回撤起始日期", false, false),
-    /**
-     * 最大回撤波谷日期  added by xjs
-     */
-    MaxDrawdownValleyDate(64, "MaxDrawdownValleyDate", "MaxDrawdownValleyDate", "最大回撤波谷日期", false, false),
-    /**
-     * 超额夏普比率 -- 几何算法(超额净值)
-     */
-    ExcessReturnSharpeRatioExtra(72, "ExcessReturnSharpeRatioExtra", "ExcessReturnSharpeRatioExtra", "超额夏普比率", false, false),
-    /**
-     * 超额年化标准差
-     */
-    ExcessReturnAnnualStdDevExtra(71, "ExcessReturnAnnualStdDevExtra", "ExcessReturnAnnualStdDevExtra", "超额年化标准差", true, false),
-
-    /**
-     * 超额最大回撤修复日期
-     */
-    ExcessReturnMaxDrawdownRecureDateExtra(114, "ExcessReturnMaxDrawdownRecureDateExtra", "ExcessReturnMaxDrawdownRecureDateExtra", "超额最大回撤修复日期", false, false),
-
-    /**
-     * 超额最大回撤修复数
-     */
-    ExcessReturnMaxDrawdownRecureIntervalExtra(115, "ExcessReturnMaxDrawdownRecureIntervalExtra", "ExcessReturnMaxDrawdownRecureIntervalExtra", "超额最大回撤修复天数", false, false),
-
-    FundId(-1, "FundId", "FundId", "基金ID", false, false),
-    FundName(-2, "FundName", "FundName", "基金名称", false, false),
-
-    LongestNoNewHighDays(67, "LongestNoNewHighDays", "LongestNoNewHighDays", "最长连续未创新高天数", false, false),
-
-    ProfitLossRatio(5, "ProfitLossRatio", "ProfitLossRatio", "盈利亏损比", false, false),
-
-    ;
-
-    public static List<IndicatorContrastEnum> retList = Arrays.asList(IntervalReturn, ExcessReturnDynamic, AnnualReturn,
-            ExcessReturnDynamicAnnual, Alpha, UpCaptureRatio, UpCaptureReturn, DownCaptureRatio, DownCaptureReturn,
-            WinRate, ProfitLossRatio);
-    public static List<IndicatorContrastEnum> adjustList = Arrays.asList(InformationRatio, SharpeRatio, Jensen, CalmarRatio,
-            Kappa, SortinoRatio, SortinoRatioMAR, Omega, TreynorRatio, M2, ExcessReturnSharpeRatioExtra);
-    public static List<IndicatorContrastEnum> riskList = Arrays.asList(AnnualStdDev, Beta, Skewness, Kurtosis, TrackingError,
-            MaxDrawdown, ExcessReturnMaxDrawdown, MaxDrawdownRecureDate, MaxDrawdownRecureIntervalDays, HistoricalVaR,
-            HistoricalCVaR, DownsideStdDev, LongestNoNewHighDays, ExcessReturnAnnualStdDevExtra, ExcessReturnMaxDrawdownRecureDateExtra,
-            ExcessReturnMaxDrawdownRecureIntervalExtra, MaxDrawdownPeakDate, MaxDrawdownValleyDate);
-    public static List<IndicatorContrastEnum> retList2 = Arrays.asList(IntervalReturn, AnnualReturn,
-            Alpha, UpCaptureRatio, UpCaptureReturn, DownCaptureRatio, DownCaptureReturn,
-            WinRate, ProfitLossRatio);
-    public static List<IndicatorContrastEnum> adjustList2 = Arrays.asList(InformationRatio, SharpeRatio, Jensen, CalmarRatio,
-            Kappa, SortinoRatio, SortinoRatioMAR, Omega, TreynorRatio, M2);
-    public static List<IndicatorContrastEnum> riskList2 = Arrays.asList(AnnualStdDev, Beta, Skewness, Kurtosis, TrackingError,
-            MaxDrawdown, MaxDrawdownRecureDate, MaxDrawdownRecureIntervalDays, HistoricalVaR,
-            HistoricalCVaR, DownsideStdDev, LongestNoNewHighDays,
-            MaxDrawdownPeakDate, MaxDrawdownValleyDate);
-    public static List<IndicatorContrastEnum> needExtraGeo = Arrays.asList(IntervalReturn, AnnualReturn, SharpeRatio, MaxDrawdown, AnnualStdDev, MaxDrawdownRecureDate, MaxDrawdownRecureIntervalDays);
-    public static List<String> dataIndicatorList = Arrays.asList(MaxDrawdownPeakDate.toString(), MaxDrawdownValleyDate.toString(),
-            MaxDrawdownRecureDate.toString(), ExcessReturnMaxDrawdownRecureDateExtra.toString());
-    public static List<String> daysIndicatorList = Arrays.asList(MaxDrawdownRecureIntervalDays.toString(), ExcessReturnMaxDrawdownRecureIntervalExtra.toString(), LongestNoNewHighDays.toString());
-    private int id;
-    private String label;
-    private String indicatorName;
-    private String symbol;
-    private boolean isPercent;
-    private boolean isColor;
-
-    private IndicatorContrastEnum(int id, String symbol, String label, String indicatorName, boolean isPercent, boolean isColor) {
-        this.id = id;
-        this.label = label;
-        this.indicatorName = indicatorName;
-        this.symbol = symbol;
-        this.isPercent = isPercent;
-        this.isColor = isColor;
-    }
-
-    private IndicatorContrastEnum(int id) {
-        this.id = id;
-    }
-
-    public static IndicatorContrastEnum getIndicator(int id) {
-        return Stream.of(IndicatorContrastEnum.values()).filter(e -> e.id == id).findFirst().orElse(null);
-    }
-
-    /**
-     * 根据 symbol 获取 isPercent,为null时返回false
-     *
-     * @param label 名称
-     * @return /
-     */
-    public static boolean isPercent(String label) {
-        IndicatorContrastEnum anEnum = Stream.of(IndicatorContrastEnum.values())
-                .filter(e -> e.label.equals(label)).findFirst().orElse(null);
-        return anEnum != null && anEnum.getIsPercent();
-    }
-
-    public boolean isColor() {
-        return isColor;
-    }
-
-    public void setColor(boolean color) {
-        isColor = color;
-    }
-
-    public boolean getIsPercent() {
-        return isPercent;
-    }
-
-    public void setIsPercent(boolean isPercent) {
-        this.isPercent = isPercent;
-    }
-
-    public String getSymbol() {
-        return symbol;
-    }
-
-    public void setSymbol(String symbol) {
-        symbol = symbol;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
-    public String getIndicatorName() {
-        return indicatorName;
-    }
-
-    public void setIndicatorName(String indicatorName) {
-        this.indicatorName = indicatorName;
-    }
-
-    public int getId() {
-        return id;
-    }
-}

+ 0 - 25
src/main/java/com/smppw/common/pojo/enums/IndustryType.java

@@ -1,25 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import java.util.stream.Stream;
-
-/**
- * @author zhengsongliang
- * @datetime 2017年8月7日 下午4:22:10
- */
-public enum IndustryType {
-	CSI10(1), CITIC5(2),ShenWan(3);
-	private int id;
-
-	private IndustryType(int id) {
-		this.id = id;
-	}
-
-	public static IndustryType getIndustryIndexByNum(int id) {
-		return Stream.of(IndustryType.values()).filter(e -> e.id == id).findFirst().orElse(null);
-	}
-
-	public int getId() {
-		return id;
-	}
-
-}

+ 0 - 29
src/main/java/com/smppw/common/pojo/enums/MarketIndexEnum.java

@@ -1,29 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import lombok.Getter;
-
-/**
- * 市场指数对象枚举
- *
- * @author mozuwen
- * @version 1.0
- * @date 2023-03-31 11:47
- */
-@Getter
-public enum MarketIndexEnum {
-    A_SHARE_INDEX(1, "A股指数"),
-    PRIVATE_INDEX(2, "私募指数"),
-    PUBLIC_INDEX(3, "公募指数"),
-    SECTOR_INDEX(4, "行业指数"),
-    BOND_INDEX(5, "债券指数"),
-    FUTURES_INDEX(6, "期货指数"),
-    OTHER_INDEX(999, "其他指数");
-
-    private final int type;
-    private final String name;
-
-    MarketIndexEnum(int type, String name) {
-        this.type = type;
-        this.name = name;
-    }
-}

+ 0 - 32
src/main/java/com/smppw/common/pojo/enums/OptionsType.java

@@ -1,32 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-/**
- * @author fwz
- * @date 2023/2/16 17:40
- * @description
- */
-public enum OptionsType {
-    ETF50("MF00003UC2","华夏上证50ETF"),
-    ZHONGZHENG1000("SE000040MY", "中证1000"),
-    HUSHEN300("SE0000E4CC", "沪深300"),
-    HUATAI300ETF("MF00003UAZ","华泰300ETF"),
-    JIASHI300ETF("MF00003TGP", "嘉实沪深300ETF"),
-    NANFANG500ETF("MF00003UB7", "南方500ETF"),
-    JIASHI500ETF("MF00003TGS", "嘉实中证500ETF");
-
-    private final String secId;
-    private final String name;
-
-    OptionsType(String secId, String name) {
-        this.secId = secId;
-        this.name = name;
-    }
-
-    public String getSecId() {
-        return secId;
-    }
-
-    public String getName() {
-        return name;
-    }
-}

+ 0 - 18
src/main/java/com/smppw/common/pojo/enums/OrderTypeEnum.java

@@ -1,18 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-/**
- * 排序枚举类
- * @author David
- * @version 1.0
- * @date 2023-04-21
- */
-public enum OrderTypeEnum {
-    /**
-     * 升序
-     */
-    ASC,
-    /**
-     * 降序
-     */
-    DESC
-}

+ 0 - 27
src/main/java/com/smppw/common/pojo/enums/RBSAIndexType.java

@@ -1,27 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import java.util.stream.Stream;
-
-/**
- * 
- * @author diaofan
- * @date 2017年11月8日 下午3:52:24
- * @description
- */
-public enum RBSAIndexType {
-	CNI7Style(1), CNI3Style(2), CNI7Strategy(3), CSI11(4), CITIC6(5), RZ5Strategy(7), Large4Assets(
-			8), SegmentationAsset(10), ShenWan(9);
-	private int id;
-
-	private RBSAIndexType(int id) {
-		this.id = id;
-	}
-
-	public static RBSAIndexType getRbsaIndexs(int id) {
-		return Stream.of(RBSAIndexType.values()).filter(e -> e.id == id).findFirst().orElse(null);
-	}
-
-	public int getId() {
-		return id;
-	}
-}

+ 0 - 61
src/main/java/com/smppw/common/pojo/enums/SystemObjectEnum.java

@@ -1,61 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import lombok.Getter;
-
-/**
- * 全站标的对象枚举,应用于所有使用不同类型组合的场景,系统全站需和前端一样保持使用该类类型
- * @author David
- * @version 1.0
- * @date 2023-03-31 11:47
- */
-@Getter
-public enum SystemObjectEnum {
-    /**
-     * 私募基金类型定义,用于全站搜索类型通用
-     */
-    PRIVATE_FUND(1, "私募基金"),
-    /**
-     * 公募基金类型定义,用于全站搜索类型通用
-     */
-    PUBLIC_FUND(2, "公募基金"),
-    /**
-     * 自建基金类型定义,用于全站搜索类型通用
-     */
-    USER_FUND(3, "自建基金"),
-    /**
-     * 机构类型定义,用于全站搜索类型通用
-     */
-    COMPANY(4, "机构"),
-    /**
-     * 经理类型定义,用于全站搜索类型通用
-     */
-    MANAGER(5, "经理"),
-    /**
-     * 组合类型定义,用于全站搜索类型通用
-     */
-    USER_PORTFOLIO(6, "组合"),
-    /**
-     * 市场指数类型定义,用于全站搜索类型通用
-     */
-    MARKET_INDEX(7, "市场指数"),
-    /**
-     * 自建指数定义,用于全站搜索类型通用
-     */
-    USER_INDEX(8, "自建指数"),
-    /**
-     * 全局搜索用  包含市场私募基金和市场公募基金
-     */
-    FUND(9,"基金"),
-    /**
-     * 全局搜索用 只包含市场指数
-     */
-    INDEX(10,"指数");
-
-    private final int type;
-    private final String name;
-
-    SystemObjectEnum(int type, String name) {
-        this.type = type;
-        this.name = name;
-    }
-}

+ 0 - 24
src/main/java/com/smppw/common/pojo/enums/ValueGrowthType.java

@@ -1,24 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import java.util.stream.Stream;
-
-/**
- * @author zhengsongliang
- * @datetime 2017年8月7日 下午4:27:35
- */
-public enum ValueGrowthType {
-	CNI6Style(1), CNI2Style(2),CNI6Strategy(3);
-	private int id;
-
-	private ValueGrowthType(int id) {
-		this.id=id;
-	}
-	public int getId() {
-		return id;
-	}
-
-	public static ValueGrowthType getAllocationIndex(int id) {
-		return Stream.of(ValueGrowthType.values()).filter(e -> e.id == id).findFirst().orElse(null);
-	}
-	
-}

+ 0 - 23
src/main/java/com/smppw/common/pojo/enums/WinRateBmk.java

@@ -1,23 +0,0 @@
-package com.smppw.common.pojo.enums;
-
-import java.util.stream.Stream;
-
-/**
- * @author zhengsongliang
- */
-public enum WinRateBmk {
-	Benchmark(1), Zero(2),AssetModel(3);
-	private final int id;
-
-	WinRateBmk(int id) {
-		this.id = id;
-	}
-
-	public int getId() {
-		return id;
-	}
-
-	public static WinRateBmk getWinningRateBmk(int id) {
-		return Stream.of(WinRateBmk.values()).filter(e -> e.id == id).findFirst().orElse(null);
-	}
-}

+ 0 - 28
src/main/java/com/smppw/constants/DataSourceConst.java

@@ -1,28 +0,0 @@
-package com.smppw.constants;
-
-/**
- * @author Rain
- * @date 2023/5/31 13:40
- * @description
- */
-public class DataSourceConst {
-
-    public static final String  DS_CLICKHOUSE_PROPERTIES = "spring.datasource.clickhouse";
-    public static final String  DS_CLICKHOUSE = "spring.datasource.clickhouse.hikari";
-
-
-    public static final String  DS_MASTER_PROPERTIES = "spring.datasource.combination-master";
-    public static final String  DS_MASTER = "spring.datasource.combination-master.hikari";
-
-    public static final String  DS_CORE_PROPERTIES = "spring.datasource.hfdb-core";
-    public static final String  DS_CORE = "spring.datasource.hfdb-core.hikari";
-
-    public static final String  DS_REPORT_BUILDER_PROPERTIES = "spring.datasource.report-builder";
-    public static final String  DS_REPORT_BUILDER = "spring.datasource.report-builder.hikari";
-
-    public static final String  DS_ADVISOR_PROPERTIES = "spring.datasource.advisor";
-    public static final String  DS_ADVISOR = "spring.datasource.advisor.hikari";
-
-    public static final String  DS_MFINFO_PROPERTIES = "spring.datasource.mf-info";
-    public static final String  DS_MFINFO = "spring.datasource.mf-info.hikari";
-}

+ 0 - 15
src/main/java/com/smppw/constants/IndexTypeConf.java

@@ -1,15 +0,0 @@
-package com.smppw.constants;
-
-/**
- * @author Rain
- * @date 2023/2/20 18:07
- * @description 字典  通过指数 获取对应大类指数
- */
-public interface IndexTypeConf {
-
-    /**
-     * 南华商品期货指数 对标指数
-     */
-
-    String NANHUA_INDEX_TYPE = "nanhua_future_index";
-}

+ 0 - 33
src/main/java/com/smppw/constants/MapFieldConstants.java

@@ -1,33 +0,0 @@
-package com.smppw.constants;
-
-/**
- * @author wangzaijun
- * @date 2023/5/4 10:02
- * @description map对象的key属性定义常量
- */
-public class MapFieldConstants {
-    /**
-     * 详情页数据集字段
-     */
-    public static final String FIELD_DATASET = "dataset";
-    /**
-     * 详情页标的名称映射字段
-     */
-    public static final String FIELD_NAME_MAPPING = "productNameMapping";
-    /**
-     * 开始时间
-     */
-    public static final String FIELD_START_DATE = "startDate";
-    /**
-     * 结束时间
-     */
-    public static final String FIELD_END_DATE = "endDate";
-    /**
-     * 日期时间序列
-     */
-    public static final String FIELD_DATE_LIST = "dateList";
-    /**
-     * 日期
-     */
-    public static final String FIELD_DATE_KEY = "date";
-}

+ 0 - 9
src/main/java/com/smppw/constants/NavConst.java

@@ -1,9 +0,0 @@
-package com.smppw.constants;
-
-public class NavConst {
-
-    public final static String CUMULATIVE_NAV_SQL_FIELD = "cumulative_nav";
-    public final static String COMBINATION_CUMULATIVE_NAV_SQL_FIELD = "cm_cumulative_nav";
-    public final static String NAV_SQL_FIELD = "nav";
-    public final static String CUMULATIVE_NAV_WITHDRAWAL_SQL_FIELD = "cumulative_nav_withdrawal";
-}

+ 0 - 68
src/main/java/com/smppw/constants/RedisConst.java

@@ -1,68 +0,0 @@
-package com.smppw.constants;
-
-/**
- * @author Rain
- * @date 2023/3/26 14:31
- * @description redis相关的前缀或者后缀key 在此统一维护
- */
-public final class RedisConst {
-    /**
-     * 用户中心登录成功后生成token用于后续验权
-     */
-    public static final String USER_CENTER_TOKEN_KEY = "user_center_token_key:";
-    /**
-     * 全局搜索历史记录缓存
-     */
-    public static final String SEARCH_HISTORY = "search_history:";
-    /**
-     * 获取基金分布式锁key
-     */
-    public static final String GENERATE_FUND_ID_KEY = "fundId:generate";
-    /**
-     * 获取缓存基金最大值key
-     */
-    public static final String MAX_FUND_ID = "fundId:max";
-    /**
-     * 获取组合分布式锁key
-     */
-    public static final String GENERATE_PORTFOLIO_ID_KEY = "portfolioId:generate";
-    /**
-     * 获取缓存组合最大值key
-     */
-    public static final String MAX_PORTFOLIO_ID = "portfolioId:max";
-    /**
-     * 存储和获取组合拟合净值任务key
-     */
-    public static final String PORTFOLIO_NAV_TASK_KEY = "portfolio:nav:task:";
-
-
-    // -------------- 基金持仓分析key 和 超时时间 -------------------------------
-
-
-    public static final long POSITION_MONTH_TTL = 28 * 24 * 60 * 60L;
-    public static final long POSITION_YEAR_TTL = 365 * 24 * 60 * 60L;
-    public static final long POSITION_DAY_TTL = 24 * 60 * 60L;
-
-    /**
-     * (沪深300、中证500和中证1000)成分股占比,原则上每月更新一次,目前先设置超时时间28天
-     * todo 提供接口在成分股更新时刷新缓存
-     */
-    public static final String POSITION_INDEX_WEIGHT_KEY = "position:index:weight:";
-    /**
-     * 所有股票与行业对应关系,每天都有更新,设置超时时间1天
-     * todo 做一个定时任务每天预缓存该数据
-     */
-    public static final String POSITION_STOCK_INDUSTRY_KEY = "position:stock:industry";
-    /**
-     * 估值表详情信息
-     * todo 基金估值表解析时要更新
-     */
-    public static final String POSITION_DETAIL_KEY = "position:detail:";
-    /**
-     * 市场上的股票收盘价缓存,A股(沪深、创业板),缓存一年吧
-     */
-    public static final String POSITION_STOCK_PRICE_KEY = "position:stock:price";
-
-    private RedisConst() {
-    }
-}

+ 8 - 9
src/main/java/com/smppw/core/CalcService.java

@@ -6,7 +6,6 @@ import com.smppw.common.pojo.dto.calc.IndicatorCalcPropertyDto;
 import com.smppw.common.pojo.dto.calc.IndicatorCalcReqPropertyDto;
 import com.smppw.common.pojo.enums.Indicator;
 import com.smppw.utils.BigDecimalUtils;
-import com.smppw.utils.IndicatorCalc;
 import com.smppw.utils.IndicatorCalcUtil;
 import com.smppw.utils.NavUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -83,7 +82,7 @@ public final class CalcService {
                                                  Map<String, Map<String, String>> extraIndexIndicatorValueMap, IndicatorCalcPropertyDto indicatorCalcPropertyDto) {
         if (geoRetIndicatorList.size() > 0) {
             List<CompoundRet> secRetList = indicatorCalcPropertyDto.getSecData().getExtraRetGeoList();
-            Map<String, String> retIndicatorValueMap = IndicatorCalc.calcRetIndicatorValue(secRetList, indicatorCalcReq.getIndicatorCalcTimeRangeDto().getTimeRange(),
+            Map<String, String> retIndicatorValueMap = IndicatorCalcUtil.calcRetIndicatorValue(secRetList, indicatorCalcReq.getIndicatorCalcTimeRangeDto().getTimeRange(),
                     indicatorCalcReq.getFrequency(), indicatorCalcReq.isIfAnnualize(), geoRetIndicatorList, indicatorCalcReq.isIfConvertPerformanceConsistencyWord(), indicatorCalcReq.getLeastRetNum());
             ariIndicatorValueMap.putAll(retIndicatorValueMap);
 
@@ -91,7 +90,7 @@ public final class CalcService {
             Map<String, List<CompoundRet>> indexExtraRetGeoListMap = indicatorCalcPropertyDto.getIndexData().getIndexExtraRetGeoListMap();
             for (String indexId : indexIdList) {
                 List<CompoundRet> indexExtraRetGeoList = indexExtraRetGeoListMap.get(indexId);
-                Map<String, String> indexRetIndicatorValueMap = IndicatorCalc.calcRetIndicatorValue(indexExtraRetGeoList, indicatorCalcReq.getIndicatorCalcTimeRangeDto().getTimeRange(),
+                Map<String, String> indexRetIndicatorValueMap = IndicatorCalcUtil.calcRetIndicatorValue(indexExtraRetGeoList, indicatorCalcReq.getIndicatorCalcTimeRangeDto().getTimeRange(),
                         indicatorCalcReq.getFrequency(), indicatorCalcReq.isIfAnnualize(), geoRetIndicatorList, indicatorCalcReq.isIfConvertPerformanceConsistencyWord(), indicatorCalcReq.getLeastRetNum());
 
                 if (extraIndexIndicatorValueMap.containsKey(indexId)) {
@@ -111,7 +110,7 @@ public final class CalcService {
                                          Map<String, Map<String, String>> indexIndicatorValueMap, IndicatorCalcPropertyDto indicatorCalcPropertyDto) {
         if (retIndicatorList.size() > 0) {
             List<CompoundRet> secRetList = indicatorCalcPropertyDto.getSecData().getRetList();
-            Map<String, String> retIndicatorValueMap = IndicatorCalc.calcRetIndicatorValue(secRetList, indicatorCalcReq.getIndicatorCalcTimeRangeDto().getTimeRange(),
+            Map<String, String> retIndicatorValueMap = IndicatorCalcUtil.calcRetIndicatorValue(secRetList, indicatorCalcReq.getIndicatorCalcTimeRangeDto().getTimeRange(),
                     indicatorCalcReq.getFrequency(), indicatorCalcReq.isIfAnnualize(), retIndicatorList, indicatorCalcReq.isIfConvertPerformanceConsistencyWord(), indicatorCalcReq.getLeastRetNum());
             indicatorValueMap.putAll(retIndicatorValueMap);
 
@@ -120,7 +119,7 @@ public final class CalcService {
                 List<String> indexIdList = indicatorCalcPropertyDto.getIndicatorCalcReq().getIndexIdList();
                 for (String indexId : indexIdList) {
                     List<CompoundRet> indexRet = indexRetListMap.get(indexId);
-                    Map<String, String> indexRetIndicatorValueMap = IndicatorCalc.calcRetIndicatorValue(indexRet,
+                    Map<String, String> indexRetIndicatorValueMap = IndicatorCalcUtil.calcRetIndicatorValue(indexRet,
                             indicatorCalcReq.getIndicatorCalcTimeRangeDto().getTimeRange(), indicatorCalcReq.getFrequency(),
                             indicatorCalcReq.isIfAnnualize(), retIndicatorList, indicatorCalcReq.isIfConvertPerformanceConsistencyWord(), indicatorCalcReq.getLeastRetNum());
                     if (indexIndicatorValueMap.containsKey(indexId)) {
@@ -222,14 +221,14 @@ public final class CalcService {
                                                  IndicatorCalcPropertyDto indicatorCalcPropertyDto) {
         if (geoNavIndicatorList.size() > 0) {
             List<DateValue> extraNavList = indicatorCalcPropertyDto.getSecData().getExtraNavList();
-            Map<String, String> navIndicatorValueMap = IndicatorCalc.calcNavIndicatorValue(extraNavList, geoNavIndicatorList);
+            Map<String, String> navIndicatorValueMap = IndicatorCalcUtil.calcNavIndicatorValue(extraNavList, geoNavIndicatorList);
             indicatorValueMap.putAll(navIndicatorValueMap);
 
             List<String> indexIdList = indicatorCalcPropertyDto.getIndicatorCalcReq().getIndexIdList();
             Map<String, List<DateValue>> indexExtraNavMap = indicatorCalcPropertyDto.getIndexData().getIndexExtraNavMap();
             for (String indexId : indexIdList) {
                 List<DateValue> indexExtraNav = indexExtraNavMap.get(indexId);
-                Map<String, String> indexNavIndicatorValueMap = IndicatorCalc.calcNavIndicatorValue(indexExtraNav, geoNavIndicatorList);
+                Map<String, String> indexNavIndicatorValueMap = IndicatorCalcUtil.calcNavIndicatorValue(indexExtraNav, geoNavIndicatorList);
                 if (extraIndexIndicatorValueMap.containsKey(indexId)) {
                     Map<String, String> map = extraIndexIndicatorValueMap.get(indexId);
                     if (map == null) {
@@ -246,14 +245,14 @@ public final class CalcService {
     private void calcNavIndicator(List<Indicator> navIndicatorList, IndicatorCalcReqPropertyDto indicatorCalcReq, Map<String, String> indicatorValueMap,
                                          Map<String, Map<String, String>> indexIndicatorValueMap, IndicatorCalcPropertyDto indicatorCalcPropertyDto) {
         if (navIndicatorList.size() > 0) {
-            Map<String, String> navIndicatorValueMap = IndicatorCalc.calcNavIndicatorValue(indicatorCalcPropertyDto.getSecData().getNavList(), navIndicatorList);
+            Map<String, String> navIndicatorValueMap = IndicatorCalcUtil.calcNavIndicatorValue(indicatorCalcPropertyDto.getSecData().getNavList(), navIndicatorList);
             indicatorValueMap.putAll(navIndicatorValueMap);
 
             List<String> indexIdList = indicatorCalcReq.getIndexIdList();
             Map<String, List<DateValue>> indexNavMap = indicatorCalcPropertyDto.getIndexData().getIndexNavMap();
             for (String indexId : indexIdList) {
                 List<DateValue> indexNavList = indexNavMap.get(indexId);
-                Map<String, String> indexNavIndicatorValueMap = IndicatorCalc.calcNavIndicatorValue(indexNavList, navIndicatorList);
+                Map<String, String> indexNavIndicatorValueMap = IndicatorCalcUtil.calcNavIndicatorValue(indexNavList, navIndicatorList);
                 if (indexIndicatorValueMap.containsKey(indexId)) {
                     indexIndicatorValueMap.get(indexId).putAll(indexNavIndicatorValueMap);
                 } else {

+ 2 - 2
src/main/java/com/smppw/core/reta/calc/SingleMaxDrawdown.java

@@ -2,8 +2,8 @@ package com.smppw.core.reta.calc;
 
 import com.smppw.common.pojo.dto.CompoundRet;
 import com.smppw.common.pojo.enums.Frequency;
-import com.smppw.utils.IndicatorCalc;
 import com.smppw.core.reta.Rate;
+import com.smppw.utils.IndicatorCalcUtil;
 
 import java.util.Collections;
 import java.util.List;
@@ -16,7 +16,7 @@ public class SingleMaxDrawdown extends Rate {
 	public Double calc(List<CompoundRet> list, Frequency frequency, boolean ifAnnualized) {
 		if (list.isEmpty())
 			return null;
-		List<Double> fundRetList = IndicatorCalc.getFundRetList(list);
+		List<Double> fundRetList = IndicatorCalcUtil.getFundRetList(list);
 		if (fundRetList.size() == 0) {
 			return null;
 		}

+ 0 - 26
src/main/java/com/smppw/utils/AbsPasswordUtils.java

@@ -1,26 +0,0 @@
-package com.smppw.utils;
-
-import java.util.Random;
-
-/**
- * @author Rain
- * @date 2023/2/22 20:18
- * @description
- */
-public abstract class AbsPasswordUtils {
-
-
-    //随机密码生成
-    public static String generateRandomPassword(int len) {
-
-        char[] chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&*.?".toCharArray();
-        StringBuilder sb = new StringBuilder();
-        Random r = new Random();
-
-        for (int x = 0; x < len; ++x) {
-            sb.append(chars[r.nextInt(chars.length)]);
-        }
-        return sb.toString();
-
-    }
-}

+ 0 - 85
src/main/java/com/smppw/utils/BinarySearchUtil.java

@@ -1,85 +0,0 @@
-package com.smppw.utils;
-
-import java.util.List;
-import java.util.Objects;
-
-public class BinarySearchUtil {
-
-    /**
-     *
-     * @param dateList   从小到大的净值序列
-     * @param date  日期
-     * @return  小于等于 date 的 日期最大的净值
-     */
-    public static Integer getMostLeftLessNav(List<String> dateList, String date) {
-        if (dateList == null || dateList.size() == 0) {
-            return 0;
-        }
-        int L = 0;
-        int R = dateList.size() - 1;
-        int ans = -1;
-        while (L <= R) {
-            int mid = (L + R) / 2;
-            if (dateList.get(mid) !=null && dateList.get(mid).compareTo(date) <= 0) {
-                ans = mid;
-                L = mid + 1;
-            } else {
-                R = mid - 1;
-            }
-        }
-        return ans == -1 ? 0 : ans;
-    }
-
-    /**
-     *
-     * @param dateList   从小到大的净值序列
-     * @param date  日期
-     * @return  小于 date 的 日期最大的净值
-     */
-    public static Integer getMostLeftLessNotEqualsNav(List<String> dateList, String date) {
-        if (dateList == null || dateList.size() == 0) {
-            return 0;
-        }
-        int L = 0;
-        int R = dateList.size() - 1;
-        int ans = -1;
-        while (L <= R) {
-            int mid = (L + R) / 2;
-            if (dateList.get(mid) !=null && dateList.get(mid).compareTo(date) < 0) {
-                ans = mid;
-                L = mid + 1;
-            } else {
-                R = mid - 1;
-            }
-        }
-        return ans == -1 ? 0 : ans;
-    }
-
-
-    /**
-     *
-     * @param dateList   从小到大的净值序列
-     * @param date  日期
-     * @return  大于等于 date 的 日期最小的净值
-     */
-    public static Integer getMostRightThanNav(List<String> dateList, String date) {
-        if(dateList == null && Objects.requireNonNull(dateList).size() == 0){
-            return -1;
-        }else if(dateList.get(dateList.size()-1).compareTo(date) < 0){
-            return dateList.size() - 1;
-        }
-        int low = 0;
-        int high = dateList.size() - 1;
-        while(low < high){
-            //防止溢出
-            int mid = low + (high-low)/2;
-            if(dateList.get(mid).compareTo(date) < 0){
-                low = mid + 1;
-            }else{
-                high = mid;
-            }
-        }
-        return low;
-    }
-
-}

+ 0 - 26
src/main/java/com/smppw/utils/CardIdUtil.java

@@ -1,26 +0,0 @@
-package com.smppw.utils;
-
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * 证件号码处理的工具类
- */
-public class CardIdUtil {
-
-    /**
-     * 身份证号码脱敏,将第4-14位用*代替
-     *
-     * @return
-     */
-    public static String identityCardIdDesensitization(String str) {
-        if (StringUtils.isEmpty(str)) {
-            return str;
-        }
-
-        if (str.length() != 18) {
-            return str;
-        }
-
-        return str.substring(0, 3) + "***********" + str.substring(14, 18);
-    }
-}

+ 0 - 32
src/main/java/com/smppw/utils/CheckUtil.java

@@ -1,32 +0,0 @@
-package com.smppw.utils;
-
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class CheckUtil {
-
-    public static Boolean isCellPhoneNum(String cellPhoneNum){
-        if (cellPhoneNum.length() != 11) {
-            System.out.print("手机号应为11位数 ");
-            return false;
-        }else{
-            String regPattern =  "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$";
-            Pattern pattern = Pattern.compile(regPattern);
-            Matcher matcher = pattern.matcher(cellPhoneNum);
-            boolean isMatch = matcher.matches();
-            return isMatch;
-        }
-    }
-
-    public static boolean isEmail(String str) {
-        String tegex="[a-zA-Z0-9_]+@\\w+(\\.com|\\.cn){1}";
-        boolean flag=str.matches(tegex);
-        return flag;
-    }
-
-    public static boolean isUserName(String str) {
-        return !StringUtils.isEmpty(str) && str.length() <= 50;
-    }
-}

+ 0 - 33
src/main/java/com/smppw/utils/CommonUtil.java

@@ -1,7 +1,6 @@
 package com.smppw.utils;
 
 import cn.hutool.core.collection.CollUtil;
-import com.smppw.common.pojo.CommonData;
 import org.apache.commons.lang3.StringUtils;
 
 import java.math.BigDecimal;
@@ -151,38 +150,6 @@ public class CommonUtil {
         }
     }
 
-    /**
-     * 把CommonData扩展为map对象
-     *
-     * @param onlyExt   是否仅根据extInfos字段扩展
-     * @param extFields 要扩展的字段,从extInfos取数据
-     * @return /
-     */
-    public static <T> Map<String, Object> covertToMap(CommonData<T> data, boolean onlyExt, String... extFields) {
-        Map<String, Object> result = new HashMap<>();
-        result.put("dataset", data.getDataset());
-        result.put("productNameMapping", data.getProductNameMapping());
-        Map<String, Object> extInfos = data.getExtInfos();
-        if (onlyExt && extInfos != null && !extInfos.isEmpty()) {
-            result.putAll(extInfos);
-            return result;
-        }
-        if (extFields != null && extInfos != null && extFields.length > 0) {
-            for (String field : extFields) {
-                result.put(field, extInfos.get(field));
-            }
-        }
-        return result;
-    }
-
-    public static <T> Map<String, Object> covertToMap(CommonData<T> data) {
-        return covertToMap(data, true);
-    }
-
-    public static <T> Map<String, Object> covertToMap(CommonData<T> data, String... extFields) {
-        return covertToMap(data, false, extFields);
-    }
-
     public static String list2StringWithDot(List<String> idList) {
         StringJoiner stringJoiner = new StringJoiner("','", "'", "'");
         for (String s : idList) {

+ 0 - 168
src/main/java/com/smppw/utils/IndicatorCalc.java

@@ -1,168 +0,0 @@
-package com.smppw.utils;
-
-import com.smppw.constants.DateConst;
-import com.smppw.constants.IndicatorConst;
-import com.smppw.common.pojo.dto.CompoundRet;
-import com.smppw.common.pojo.dto.DateValue;
-import com.smppw.common.pojo.enums.Frequency;
-import com.smppw.common.pojo.enums.Indicator;
-import com.smppw.common.pojo.enums.TimeRange;
-import com.smppw.core.reta.IndicatorFactory;
-import com.smppw.core.reta.Rate;
-import com.smppw.core.reta.calc.PerformanceConsistency;
-import org.joda.time.DateTime;
-import org.joda.time.format.DateTimeFormat;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author lzj
- */
-public class IndicatorCalc {
-    public static List<Double> getFundRetList(List<CompoundRet> list) {
-        List<Double> doubleList = new ArrayList<>();
-        for (CompoundRet value : list) {
-            if (value.getRetOfFund() != null) {
-                doubleList.add(value.getRetOfFund());
-            }
-        }
-        return doubleList;
-    }
-
-    public static Map<String, String> calcNavIndicatorValue(List<DateValue> navList, List<Indicator> navIndicatorList) {
-        IndicatorFactory factory = IndicatorFactory.getInstance();
-        Map<String, String> navIndicatorValueMap = new HashMap<>();
-        for (Indicator indicator : navIndicatorList) {
-            if (null == navList || navList.size() == 0) {
-                navIndicatorValueMap.put(indicator.name(), null);
-                continue;
-            }
-            Rate rate = factory.get(indicator);
-            Double navIndicatorValue = null;
-            try {
-                navIndicatorValue = rate.calc(navList);
-            } catch (Exception e) {
-//                log.error("计算异常Exception",e.getMessage(),e);
-                navIndicatorValue = null;
-            }
-
-            if(navIndicatorValue != null && navIndicatorValue.isNaN()){
-                navIndicatorValue = null;
-            } else if( navIndicatorValue != null ) {
-                BigDecimal bigDecimalValue = new BigDecimal(navIndicatorValue.toString());
-                BigDecimal maxBigDecimalValue = new BigDecimal(IndicatorConst.MAX_INDICATOR_VALUE_STRING);
-                BigDecimal minBigDecimalValue = new BigDecimal(IndicatorConst.MIN_INDICATOR_VALUE_STRING);
-
-                if (bigDecimalValue.compareTo(maxBigDecimalValue)>0) {
-                    navIndicatorValueMap.put(indicator.name(), maxBigDecimalValue.toPlainString());
-                    continue;
-                } else if (bigDecimalValue.compareTo(minBigDecimalValue)<0) {
-                    navIndicatorValueMap.put(indicator.name(), minBigDecimalValue.toPlainString());
-                    continue;
-                }
-            }
-            if (Indicator.INTEGER_VALUE_ARRAY.contains(indicator)) {
-                navIndicatorValueMap.put(indicator.name(), CommonUtil.double2IntegerString(navIndicatorValue));
-            } else {
-                navIndicatorValueMap.put(indicator.name(), CommonUtil.double2StringPoint6WithoutHalfUp(navIndicatorValue));
-            }
-        }
-        convertMaxDrawdownRecureDate(navIndicatorValueMap, navIndicatorList);
-
-        return navIndicatorValueMap;
-    }
-
-    private static void convertMaxDrawdownRecureDate(Map<String, String> dataMap, List<Indicator> indicators) {
-        if (indicators.contains(Indicator.MaxDrawdownRecureDate)) {
-            String value = dataMap.get(Indicator.MaxDrawdownRecureDate.name());
-            if (value != null) {
-                String dateStr = String.valueOf(Double.valueOf(value).intValue());
-                dataMap.put(Indicator.MaxDrawdownRecureDate.name(), DateTime
-                        .parse(dateStr, DateTimeFormat.forPattern(DateConst.YYYYMMDD)).toString(DateConst.YYYY_MM_DD));
-            }
-        }
-
-        if (indicators.contains(Indicator.MaxDrawdownPeakDate)) {
-            String value = dataMap.get(Indicator.MaxDrawdownPeakDate.name());
-            if (value != null) {
-                String dateStr = String.valueOf(Double.valueOf(value).intValue());
-                dataMap.put(Indicator.MaxDrawdownPeakDate.name(), DateTime
-                        .parse(dateStr, DateTimeFormat.forPattern(DateConst.YYYYMMDD)).toString(DateConst.YYYY_MM_DD));
-            }
-        }
-
-        if (indicators.contains(Indicator.MaxDrawdownValleyDate)) {
-            String value = dataMap.get(Indicator.MaxDrawdownValleyDate.name());
-            if (value != null) {
-                String dateStr = String.valueOf(Double.valueOf(value).intValue());
-                dataMap.put(Indicator.MaxDrawdownValleyDate.name(), DateTime
-                        .parse(dateStr, DateTimeFormat.forPattern(DateConst.YYYYMMDD)).toString(DateConst.YYYY_MM_DD));
-            }
-        }
-    }
-
-    public static Map<String, String> calcRetIndicatorValue(List<CompoundRet> retList, TimeRange timeRange,
-                                                            Frequency frequency, boolean ifAnnualize, List<Indicator> retIndicatorList, boolean ifConvertPerformanceConsistencyWord, int leastRetNum) {
-        Map<String,String> retIndicatorValueMap = new HashMap<>();
-
-        IndicatorFactory factory = IndicatorFactory.getInstance();
-        for (Indicator indicator : retIndicatorList) {
-            if (indicator == null) {
-                continue;
-            }
-            Double value = null;
-            if (null == retList) {
-                retIndicatorValueMap.put(indicator.name(), null);
-                continue;
-            }
-            // update by wangzaijun on 2023-04-06 超额胜率支持
-            if (indicator.name().startsWith("ExcessReturn") || indicator == Indicator.ExcessAriIntervalReturn || indicator == Indicator.ExcessAnnualAriIntervalReturn || indicator == Indicator.WinRate
-                    || (retList != null && retList.size() >= leastRetNum) || timeRange == TimeRange.FromSetup) {
-                Rate rate = factory.get(indicator);
-
-                try {
-                    value = rate.calc(retList, frequency, ifAnnualize);
-                } catch (Exception e) {
-//                    log.info("计算异常Exception",e.getMessage(),e);
-                    value = null;
-                }
-                if (value != null && (value.isNaN() || value.isInfinite() )) {
-                    value = null;
-                } else if (value != null) {
-                    BigDecimal bigDecimalValue = new BigDecimal(value.toString());
-                    BigDecimal maxBigDecimalValue = new BigDecimal(IndicatorConst.MAX_INDICATOR_VALUE_STRING);
-                    BigDecimal minBigDecimalValue = new BigDecimal(IndicatorConst.MIN_INDICATOR_VALUE_STRING);
-
-                    if (bigDecimalValue.compareTo(maxBigDecimalValue) > 0) {
-                        retIndicatorValueMap.put(indicator.name(), maxBigDecimalValue.toPlainString());
-                        continue;
-                    } else if (bigDecimalValue.compareTo(minBigDecimalValue) < 0) {
-                        retIndicatorValueMap.put(indicator.name(), minBigDecimalValue.toPlainString());
-                        continue;
-                    }
-                }
-                retIndicatorValueMap.put(indicator.name(), CommonUtil.double2StringPoint6WithoutHalfUp(value));
-            } else {
-                retIndicatorValueMap.put(indicator.name(), null);
-            }
-        }
-        convertPerformanceConsistency(retIndicatorList, retIndicatorValueMap, ifConvertPerformanceConsistencyWord);
-        return retIndicatorValueMap;
-    }
-
-    private static void convertPerformanceConsistency(List<Indicator> retIndicatorList, Map<String, String> retIndicatorValueMap, boolean ifConvertPerformanceConsistencyWord) {
-
-        if (retIndicatorList.contains(Indicator.PerformanceConsistency) && ifConvertPerformanceConsistencyWord) {
-            String value = retIndicatorValueMap.get(Indicator.PerformanceConsistency.name());
-            if (value != null) {
-                retIndicatorValueMap.put(Indicator.PerformanceConsistency.name(),
-                        PerformanceConsistency.convert2Word(Double.valueOf(value)));
-            }
-        }
-    }
-
-}

+ 150 - 0
src/main/java/com/smppw/utils/IndicatorCalcUtil.java

@@ -6,11 +6,19 @@ 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.Frequency;
+import com.smppw.common.pojo.enums.Indicator;
 import com.smppw.common.pojo.enums.TimeRange;
 import com.smppw.common.pojo.enums.TrendType;
+import com.smppw.constants.DateConst;
+import com.smppw.constants.IndicatorConst;
+import com.smppw.core.reta.IndicatorFactory;
+import com.smppw.core.reta.Rate;
+import com.smppw.core.reta.calc.PerformanceConsistency;
 import com.smppw.core.trend.Trend;
 import com.smppw.core.trend.TrendFactory;
 import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormat;
 
 import java.math.BigDecimal;
 import java.util.*;
@@ -19,6 +27,148 @@ import java.util.*;
  * @author lzj
  */
 public class IndicatorCalcUtil {
+    public static List<Double> getFundRetList(List<CompoundRet> list) {
+        List<Double> doubleList = new ArrayList<>();
+        for (CompoundRet value : list) {
+            if (value.getRetOfFund() != null) {
+                doubleList.add(value.getRetOfFund());
+            }
+        }
+        return doubleList;
+    }
+
+    public static Map<String, String> calcNavIndicatorValue(List<DateValue> navList, List<Indicator> navIndicatorList) {
+        IndicatorFactory factory = IndicatorFactory.getInstance();
+        Map<String, String> navIndicatorValueMap = new HashMap<>();
+        for (Indicator indicator : navIndicatorList) {
+            if (null == navList || navList.size() == 0) {
+                navIndicatorValueMap.put(indicator.name(), null);
+                continue;
+            }
+            Rate rate = factory.get(indicator);
+            Double navIndicatorValue = null;
+            try {
+                navIndicatorValue = rate.calc(navList);
+            } catch (Exception e) {
+//                log.error("计算异常Exception",e.getMessage(),e);
+                navIndicatorValue = null;
+            }
+
+            if(navIndicatorValue != null && navIndicatorValue.isNaN()){
+                navIndicatorValue = null;
+            } else if( navIndicatorValue != null ) {
+                BigDecimal bigDecimalValue = new BigDecimal(navIndicatorValue.toString());
+                BigDecimal maxBigDecimalValue = new BigDecimal(IndicatorConst.MAX_INDICATOR_VALUE_STRING);
+                BigDecimal minBigDecimalValue = new BigDecimal(IndicatorConst.MIN_INDICATOR_VALUE_STRING);
+
+                if (bigDecimalValue.compareTo(maxBigDecimalValue)>0) {
+                    navIndicatorValueMap.put(indicator.name(), maxBigDecimalValue.toPlainString());
+                    continue;
+                } else if (bigDecimalValue.compareTo(minBigDecimalValue)<0) {
+                    navIndicatorValueMap.put(indicator.name(), minBigDecimalValue.toPlainString());
+                    continue;
+                }
+            }
+            if (Indicator.INTEGER_VALUE_ARRAY.contains(indicator)) {
+                navIndicatorValueMap.put(indicator.name(), CommonUtil.double2IntegerString(navIndicatorValue));
+            } else {
+                navIndicatorValueMap.put(indicator.name(), CommonUtil.double2StringPoint6WithoutHalfUp(navIndicatorValue));
+            }
+        }
+        convertMaxDrawdownRecureDate(navIndicatorValueMap, navIndicatorList);
+
+        return navIndicatorValueMap;
+    }
+
+    private static void convertMaxDrawdownRecureDate(Map<String, String> dataMap, List<Indicator> indicators) {
+        if (indicators.contains(Indicator.MaxDrawdownRecureDate)) {
+            String value = dataMap.get(Indicator.MaxDrawdownRecureDate.name());
+            if (value != null) {
+                String dateStr = String.valueOf(Double.valueOf(value).intValue());
+                dataMap.put(Indicator.MaxDrawdownRecureDate.name(), DateTime
+                        .parse(dateStr, DateTimeFormat.forPattern(DateConst.YYYYMMDD)).toString(DateConst.YYYY_MM_DD));
+            }
+        }
+
+        if (indicators.contains(Indicator.MaxDrawdownPeakDate)) {
+            String value = dataMap.get(Indicator.MaxDrawdownPeakDate.name());
+            if (value != null) {
+                String dateStr = String.valueOf(Double.valueOf(value).intValue());
+                dataMap.put(Indicator.MaxDrawdownPeakDate.name(), DateTime
+                        .parse(dateStr, DateTimeFormat.forPattern(DateConst.YYYYMMDD)).toString(DateConst.YYYY_MM_DD));
+            }
+        }
+
+        if (indicators.contains(Indicator.MaxDrawdownValleyDate)) {
+            String value = dataMap.get(Indicator.MaxDrawdownValleyDate.name());
+            if (value != null) {
+                String dateStr = String.valueOf(Double.valueOf(value).intValue());
+                dataMap.put(Indicator.MaxDrawdownValleyDate.name(), DateTime
+                        .parse(dateStr, DateTimeFormat.forPattern(DateConst.YYYYMMDD)).toString(DateConst.YYYY_MM_DD));
+            }
+        }
+    }
+
+    public static Map<String, String> calcRetIndicatorValue(List<CompoundRet> retList, TimeRange timeRange,
+                                                            Frequency frequency, boolean ifAnnualize, List<Indicator> retIndicatorList, boolean ifConvertPerformanceConsistencyWord, int leastRetNum) {
+        Map<String,String> retIndicatorValueMap = new HashMap<>();
+
+        IndicatorFactory factory = IndicatorFactory.getInstance();
+        for (Indicator indicator : retIndicatorList) {
+            if (indicator == null) {
+                continue;
+            }
+            Double value = null;
+            if (null == retList) {
+                retIndicatorValueMap.put(indicator.name(), null);
+                continue;
+            }
+            // update by wangzaijun on 2023-04-06 超额胜率支持
+            if (indicator.name().startsWith("ExcessReturn") || indicator == Indicator.ExcessAriIntervalReturn || indicator == Indicator.ExcessAnnualAriIntervalReturn || indicator == Indicator.WinRate
+                    || (retList != null && retList.size() >= leastRetNum) || timeRange == TimeRange.FromSetup) {
+                Rate rate = factory.get(indicator);
+
+                try {
+                    value = rate.calc(retList, frequency, ifAnnualize);
+                } catch (Exception e) {
+//                    log.info("计算异常Exception",e.getMessage(),e);
+                    value = null;
+                }
+                if (value != null && (value.isNaN() || value.isInfinite() )) {
+                    value = null;
+                } else if (value != null) {
+                    BigDecimal bigDecimalValue = new BigDecimal(value.toString());
+                    BigDecimal maxBigDecimalValue = new BigDecimal(IndicatorConst.MAX_INDICATOR_VALUE_STRING);
+                    BigDecimal minBigDecimalValue = new BigDecimal(IndicatorConst.MIN_INDICATOR_VALUE_STRING);
+
+                    if (bigDecimalValue.compareTo(maxBigDecimalValue) > 0) {
+                        retIndicatorValueMap.put(indicator.name(), maxBigDecimalValue.toPlainString());
+                        continue;
+                    } else if (bigDecimalValue.compareTo(minBigDecimalValue) < 0) {
+                        retIndicatorValueMap.put(indicator.name(), minBigDecimalValue.toPlainString());
+                        continue;
+                    }
+                }
+                retIndicatorValueMap.put(indicator.name(), CommonUtil.double2StringPoint6WithoutHalfUp(value));
+            } else {
+                retIndicatorValueMap.put(indicator.name(), null);
+            }
+        }
+        convertPerformanceConsistency(retIndicatorList, retIndicatorValueMap, ifConvertPerformanceConsistencyWord);
+        return retIndicatorValueMap;
+    }
+
+    private static void convertPerformanceConsistency(List<Indicator> retIndicatorList, Map<String, String> retIndicatorValueMap, boolean ifConvertPerformanceConsistencyWord) {
+
+        if (retIndicatorList.contains(Indicator.PerformanceConsistency) && ifConvertPerformanceConsistencyWord) {
+            String value = retIndicatorValueMap.get(Indicator.PerformanceConsistency.name());
+            if (value != null) {
+                retIndicatorValueMap.put(Indicator.PerformanceConsistency.name(),
+                        PerformanceConsistency.convert2Word(Double.valueOf(value)));
+            }
+        }
+    }
+
 
     /**
      * 获取标的的有效净值序列

+ 0 - 43
src/main/java/com/smppw/utils/QuartileUtil.java

@@ -1,43 +0,0 @@
-package com.smppw.utils;
-
-/**
- * @author Rain
- * @date 2023/5/15 19:13
- * @description
- */
-public class QuartileUtil {
-
-    /**
-     * 根据相对排名计算 四分位
-     *
-     * @param absrank
-     * @return
-     */
-    public static String handleQuartile(String absrank) {
-        if (absrank != null && absrank.contains("/")) {
-            String[] split = absrank.split("/");
-            int rank = Integer.parseInt(split[0]);
-            int total = Integer.parseInt(split[1]);
-            return handleQuartile(rank, total);
-        }
-        return null;
-    }
-
-    public static String handleQuartile(Integer rank, Integer total) {
-        if (rank == null || total == null) {
-            return null;
-        }
-        int average = total / 4;
-        if (rank <= average) {
-            return "4";
-        } else if (rank <= average * 2) {
-            return "3";
-        } else if (rank <= average * 3) {
-            return "2";
-        } else if (rank <= total) {
-            return "1";
-        } else {
-            return null;
-        }
-    }
-}

+ 0 - 76
src/main/java/com/smppw/utils/RBSAIndexTypeMap.java

@@ -1,76 +0,0 @@
-package com.smppw.utils;
-
-import cn.hutool.core.map.MapUtil;
-import com.smppw.common.pojo.enums.RBSAIndexType;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-public class RBSAIndexTypeMap {
-    private static RBSAIndexTypeMap instance;
-    private final Map<RBSAIndexType, List<String>> map = MapUtil.newHashMap();
-
-    private RBSAIndexTypeMap() {
-        map.put(RBSAIndexType.CNI7Style, Arrays.asList("IN0000000S", "IN0000000T", "IN0000000W", "IN0000000X",
-                "IN0000000U", "IN0000000V"));
-        map.put(RBSAIndexType.CNI3Style, Arrays.asList("IN0000001T", "IN0000001U"));
-        map.put(RBSAIndexType.CNI7Strategy, Arrays.asList("IN00000020", "IN00000021", "IN00000022", "IN00000023",
-                "IN00000024", "IN00000025"));
-        map.put(RBSAIndexType.CSI11, Arrays.asList("IN0000000Y", "IN0000000Z", "IN00000010", "IN00000011", "IN00000012",
-                "IN00000013", "IN00000014", "IN00000015", "IN00000016", "IN00000017"));
-        map.put(RBSAIndexType.CITIC6,
-                Arrays.asList("IN0000001V", "IN0000001W", "IN0000001X", "IN0000001Y", "IN0000001Z"));
-        map.put(RBSAIndexType.RZ5Strategy,
-                Arrays.asList("IN0000001B", "IN0000001H", "IN0000001E", "IN0000001G"));
-        map.put(RBSAIndexType.Large4Assets, Arrays.asList("IN00000008", "IN000002C0", "IN0000008S"));
-
-        //细分指数: 沪深300,中证500,中证1000,恒生指数,中证海外(不含香港),中债总指数,南华商品指数,现金
-        map.put(RBSAIndexType.SegmentationAsset,
-                Arrays.asList("IN00000008", "IN0000007M", "IN0000008O", "IN00000009", "IN00000284", "IN000002C0", "IN0000008S"));
-
-        map.put(RBSAIndexType.ShenWan,
-                Arrays.asList("IN000002D1",
-                        "IN000002D0",
-                        "IN000002CZ",
-                        "IN000002CY",
-                        "IN000000OX",
-                        "IN000000OW",
-                        "IN000000OV",
-                        "IN000000OU",
-                        "IN000000OT",
-                        "IN000000OS",
-                        "IN000000OR",
-                        "IN000000OQ",
-                        "IN000000OP",
-                        "IN000000OO",
-                        "IN000000ON",
-                        "IN000000OM",
-                        "IN000000OL",
-                        "IN000000OK",
-                        "IN000000OJ",
-                        "IN000000OI",
-                        "IN000000OH",
-                        "IN000000OG",
-                        "IN000000OF",
-                        "IN000000OE",
-                        "IN000000OD",
-                        "IN000000OC",
-                        "IN000000OB",
-                        "IN000000OA",
-                        "IN000000O9",
-                        "IN000000O8",
-                        "IN000000O6"));
-    }
-
-    public synchronized static RBSAIndexTypeMap getInstance() {
-        if (null == instance) {
-            instance = new RBSAIndexTypeMap();
-        }
-        return instance;
-    }
-
-    public List<String> getIndexIds(RBSAIndexType tIndexType) {
-        return map.get(tIndexType);
-    }
-}

+ 0 - 206
src/main/java/com/smppw/utils/RateConvertorUtils.java

@@ -1,206 +0,0 @@
-package com.smppw.utils;
-
-import com.smppw.common.pojo.dto.CompoundRet;
-import com.smppw.common.pojo.dto.DateValue;
-import com.smppw.common.pojo.enums.Frequency;
-import com.smppw.common.pojo.enums.NavType;
-import org.joda.time.DateTime;
-
-import java.util.*;
-import java.util.Map.Entry;
-
-/**
- * @author zhengsongliang
- * @datetime 2017年7月5日 下午5:03:42
- */
-public class RateConvertorUtils {
-	public static <V> Map<String, Map<String, V>> seperateSingleItemById(List<Map<String, V>> initList, String idName) {
-		Map<String, Map<String, V>> map = new HashMap<>();
-		for (Map<String, V> item : initList) {
-			map.put(item.get("fund_id").toString(), item);
-		}
-		return map;
-	}
-
-	public static List<CompoundRet> convert2Obj(String secId, List<Map<String, Object>> secRets) {
-		List<CompoundRet> values = new ArrayList<>();
-		int n = secRets.size();
-		for (int i = 0; i < n; i++) {
-			Map<String, Object> map = secRets.get(i);
-			String fundId = (String) map.get("fund_id");
-			Double ret = CommonUtil.object2Double(map.get("ret_range"));
-			String endDate = (String) map.get("end_date");
-			if (fundId.equals(secId)) {
-				CompoundRet value = new CompoundRet();
-				value.setEndDate(endDate);
-				value.setRetOfFund(ret);
-				values.add(value);
-			}
-		}
-		return values;
-	}
-
-	public static List<CompoundRet> convert2Obj(Map<String, Double> retDvs) {
-		List<CompoundRet> values = new ArrayList<>();
-		for (Entry<String, Double> entry : retDvs.entrySet()) {
-			CompoundRet value = new CompoundRet();
-			value.setEndDate(entry.getKey());
-			value.setRetOfFund(entry.getValue());
-			values.add(value);
-		}
-		return values;
-	}
-
-	public static List<CompoundRet> convert2Obj(List<CompoundRet> values, List<Map<String, Object>> bmkRfRets,
-			String benchmarkId, String riskOfFreeId, Double riskOfFreeValue, String strategyId) {
-		Map<String, CompoundRet> temp = new HashMap<>();
-		for (CompoundRet value : values) {
-			temp.put(value.getEndDate(), value);
-		}
-		int n = bmkRfRets.size();
-		for (int i = 0; i < n; i++) {
-			Map<String, Object> map = bmkRfRets.get(i);
-			String fundId = (String) map.get("fund_id");
-			Double ret = CommonUtil.object2Double(map.get("ret_range"));
-			String endDate = (String) map.get("end_date");
-			if (temp.containsKey(endDate)) {
-				if (fundId.equals(benchmarkId))
-					temp.get(endDate).setRetOfBmk(ret);
-				else if (strategyId != null && fundId.equals(strategyId))
-					temp.get(endDate).setRetOfStg(ret);
-				else if (fundId.equals(riskOfFreeId)) {
-					temp.get(endDate).setRetOfRf(ret);
-				}
-				if (riskOfFreeId == null && riskOfFreeValue != null)
-					temp.get(endDate).setRetOfRf(riskOfFreeValue / 12);
-			}
-
-		}
-
-		values = new ArrayList<>(temp.values());
-		Collections.sort(values, new Comparator<CompoundRet>() {
-
-			@Override
-			public int compare(CompoundRet o1, CompoundRet o2) {
-				return o1.getEndDate().compareTo(o2.getEndDate());
-			}
-
-		});
-		return values;
-	}
-
-
-
-
-
-	public static Map<String, List<Map<String, Object>>> seperateListById(List<String> secIds,
-			List<Map<String, Object>> initDataList, String valueName) {
-		Map<String, List<Map<String, Object>>> map = seperateListById(initDataList, valueName);
-		for (String secId : secIds) {
-			if (!map.containsKey(secId)) {
-				map.put(secId, new ArrayList<>());
-			}
-		}
-		return map;
-	}
-
-	public static <V> Map<String, List<Map<String, V>>> seperateListById(List<Map<String, V>> initList, String idName) {
-		Map<String, List<Map<String, V>>> resMap = new HashMap<>();
-
-		int n = initList.size();
-		for (int i = 0; i < n; i++) {
-			Map<String, V> unit = initList.get(i);
-			if (unit == null)
-				continue;
-			String id = (String) unit.get(idName);
-			if (!resMap.containsKey(id))
-				resMap.put(id, new ArrayList<>());
-			resMap.get(id).add(unit);
-		}
-		return resMap;
-	}
-
-	public static Map<String, List<DateValue>> convertNavList(List<Map<String,Object>> initRetList, Frequency dataSource, NavType navType) {
-
-		switch (navType) {
-			case WithdrawalNav:
-				return convertNavList(initRetList, dataSource, "cumulative_nav_withdrawal");
-
-			case OriginalNav:
-				return convertNavList(initRetList, dataSource, "original_nav");
-
-			default:
-				return convertNavList(initRetList, dataSource, "cumulative_nav");
-		}
-
-	}
-
-	public static <T> Map<String, List<DateValue>> convertNavList(List<Map<String, T>> initRetList,
-																  Frequency dataSource, String navKey) {
-		Map<String, List<DateValue>> map = new HashMap<>();
-		String dataSourceKey = dataSource.getShortName() + "_nav";
-		for (Map<String, T> unit : initRetList) {
-			if (unit != null) {
-				String id = unit.get("fund_id").toString();
-				if (!map.containsKey(id)) {
-					map.put(id, new ArrayList<>());
-				}
-				if (!unit.containsKey(dataSourceKey)
-						|| unit.get(dataSourceKey).toString().equals("1") && unit.get(navKey) != null) {
-					map.get(id).add(new DateValue(unit.get("price_date").toString(),
-							CommonUtil.string2Double(unit.get(navKey).toString())));
-				}
-			}
-		}
-		for (List<DateValue> dvs : map.values()) {
-			Collections.sort(dvs);
-		}
-
-		return map;
-	}
-
-	public static Map<String, Map<String, Object>> getIdValueMap(String startDate, String endDate, Map<String, List<DateValue>> navMap, Frequency dataSource) {
-		Map<String, Map<String, Object>> idDateValueMap = new HashMap<>();
-		for (String secId : navMap.keySet()) {
-			List<DateValue> validNavList = navMap.get(secId);
-			List<DateValue> values = new ArrayList<>();
-			for(DateValue dv : validNavList){
-				if(startDate.equals(dv.getDate()) || endDate.equals(dv.getDate()) || (DateTime.parse(dv.getDate()).isAfter(DateTime.parse(startDate)) && DateTime.parse(dv.getDate()).isBefore(DateTime.parse(endDate)))){
-					values.add(dv);
-				}
-			}
-			Map<String, Object> dateValueMap = convert2Map(values);
-			idDateValueMap.put(secId, dateValueMap);
-		}
-		return idDateValueMap;
-	}
-
-	private static Map<String, Object> convert2Map(List<DateValue> validNavList) {
-		Map<String, Object> map = new HashMap<>();
-		for (DateValue dv : validNavList) {
-			map.put(dv.getDate(), dv.getValue());
-		}
-		return map;
-	}
-
-
-	public static <T> Map<String, Map<String, Double>> transfer2TwoDimensionMap(List<Map<String, T>> initRetList,
-																				String firstKey, String secondKey, String valueKey) {
-		Map<String, Map<String, Double>> map = new TreeMap<>();
-		for (Map<String, T> unit : initRetList) {
-			if (unit != null) {
-				String id = unit.get(firstKey).toString();
-				if (!map.containsKey(id)) {
-					map.put(id, new TreeMap<String, Double>());
-				}
-				T t = unit.get(valueKey);
-				if (t == null) {
-					continue;
-				}
-				map.get(id).put(unit.get(secondKey).toString(), Double.valueOf(unit.get(valueKey).toString()));
-			}
-
-		}
-		return map;
-	}
-}

+ 0 - 99
src/main/java/com/smppw/utils/RedisUtils.java

@@ -1,99 +0,0 @@
-package com.smppw.utils;
-
-import com.smppw.constants.SecType;
-import com.smppw.common.pojo.InvestmentType;
-import com.smppw.common.pojo.enums.Frequency;
-import com.smppw.common.pojo.enums.NavType;
-import com.smppw.common.pojo.enums.Visibility;
-
-/**
- * 关于Redis操作的工具类,底层封装jedis;
- * 建议调用这里的方法而不是直接调用jedis方法;
- */
-public class RedisUtils {
-
-    public static String getNavKey(String secId, Integer curveTypeId, Integer strategyId, Integer visibilityId) {
-        String key = null;
-        if(secId.startsWith("CO")){
-            key = "nav:company:" + secId + ":" + curveTypeId + ":" + strategyId;
-        }else if(secId.startsWith("PL")){
-            key = "nav:manager:" + secId + ":" + curveTypeId + ":" + strategyId;
-        }else{
-            InvestmentType investmentType = InvestmentType.getInvestmentType(secId);
-            if (investmentType == InvestmentType.Fund || investmentType == InvestmentType.ExternalFund) {
-                key = "nav:fund:" + secId + ":" + visibilityId;
-            } else if (investmentType == InvestmentType.Index) {
-                key = "nav:index:" + secId;
-            } else if (investmentType == InvestmentType.BFI) {
-                key = "nav:bfi:" + secId;
-            }
-        }
-        return key;
-    }
-
-    public static String getHashLockKey(String secId, String key) {
-        return secId + key + "lock";
-    }
-
-
-    public static String getLockKey(String key) {
-        return key+"lock";
-    }
-
-    public static String getNewNavKey(String secId, NavType navType, Integer curveTypeId, Integer strategyId, Visibility visibility, String fundType) {
-
-        Integer visibilityId = visibility.getId();
-
-        String key = null;
-        if (SecType.PRIVATELY_OFFERED_FUND.equals(fundType)) {
-            key = "nav:" + navType.name() + ":" + visibilityId;
-        } else if (SecType.PUBLICLY_OFFERED_FUNDS.equals(fundType)) {
-            key = "nav:" + navType.name() + ":" + visibilityId;
-        } else if (SecType.PRIVATE_FUND.equals(fundType)) {
-            key = "nav:" + navType.name();
-        } else if (SecType.INDEX_FUND.equals(fundType)) {
-            key = "nav:" + navType.name();
-        }
-
-        return key;
-    }
-    public static String getDateRangeKey(String secId, Integer curveTypeId, Integer strategyId, Integer visibilityId) {
-        String key = null;
-        if(secId.startsWith("CO")){
-            key = "dateRange:company:" + secId + ":" + curveTypeId + ":" + strategyId;
-        }else if(secId.startsWith("PL")){
-            key = "dateRange:manager:" + secId + ":" + curveTypeId + ":" + strategyId;
-        }else{
-            InvestmentType investmentType = InvestmentType.getInvestmentType(secId);
-            if (investmentType == InvestmentType.Fund || investmentType == InvestmentType.ExternalFund) {
-                key = "dateRange:fund:" + secId + ":" + visibilityId;
-            } else if (investmentType == InvestmentType.Index) {
-                key = "dateRange:index:" + secId;
-            } else if (investmentType == InvestmentType.BFI) {
-                key = "dateRange:bfi:" + secId;
-            }
-        }
-        return key;
-    }
-
-    public static String getRetKey(String secId, Integer curveTypeId, Integer strategyId, Integer visibilityId, Frequency frequency) {
-        String key = null;
-        if(secId.startsWith("CO")){
-            key = "ret:company:" + frequency.getShortName() + ":" + secId + ":" + curveTypeId + ":" + strategyId;
-        }else if(secId.startsWith("PL")){
-            key = "ret:manager:" + frequency.getShortName() + ":" + secId + ":" + curveTypeId + ":" + strategyId;
-        }else{
-            InvestmentType investmentType = InvestmentType.getInvestmentType(secId);
-            if (investmentType == InvestmentType.Fund || investmentType == InvestmentType.ExternalFund) {
-                key = "ret:fund:" + frequency.getShortName() + ":" + secId + ":" + visibilityId;
-            } else if (investmentType == InvestmentType.Index) {
-                key = "ret:index:" + frequency.getShortName() + ":" + secId;
-            } else if (investmentType == InvestmentType.BFI) {
-                key = "ret:bfi:" + frequency.getShortName() + ":" + secId;
-            }
-
-        }
-        return key;
-    }
-
-}

+ 0 - 20
src/main/java/com/smppw/utils/StrategyUtil.java

@@ -1,20 +0,0 @@
-package com.smppw.utils;
-
-import com.smppw.common.pojo.enums.strategy.SysStrategy;
-
-public class StrategyUtil {
-
-
-    public static SysStrategy getStrategyByPpwStrategyId(String subStrategyId, Integer thirdStrategyId) {
-
-        if (thirdStrategyId != null) {
-            SysStrategy sysStrategy = SysStrategy.getSysStrategy(thirdStrategyId);
-            if (sysStrategy != null && sysStrategy != SysStrategy.OtherStrategy) {
-                return sysStrategy;
-            }
-        }
-
-        SysStrategy sysStrategy = SysStrategy.getSysStrategy(thirdStrategyId);
-        return sysStrategy;
-    }
-}