wangzaijun 1 سال پیش
کامیت
04f982fc08
100فایلهای تغییر یافته به همراه6075 افزوده شده و 0 حذف شده
  1. 8 0
      .idea/.gitignore
  2. 14 0
      .idea/compiler.xml
  3. 20 0
      .idea/jarRepositories.xml
  4. 14 0
      .idea/misc.xml
  5. 124 0
      .idea/uiDesigner.xml
  6. 80 0
      pom.xml
  7. 28 0
      src/main/java/com/smppw/common/cache/BasicLocalCache.java
  8. 263 0
      src/main/java/com/smppw/common/cache/CaffeineLocalCache.java
  9. 28 0
      src/main/java/com/smppw/common/exception/APIException.java
  10. 23 0
      src/main/java/com/smppw/common/exception/DataException.java
  11. 23 0
      src/main/java/com/smppw/common/pojo/ComStrateRankDto.java
  12. 25 0
      src/main/java/com/smppw/common/pojo/CommonData.java
  13. 28 0
      src/main/java/com/smppw/common/pojo/DataSetOtherInfoAndDateRes.java
  14. 29 0
      src/main/java/com/smppw/common/pojo/DataSetOtherInfoRes.java
  15. 87 0
      src/main/java/com/smppw/common/pojo/FundFuturesOption.java
  16. 31 0
      src/main/java/com/smppw/common/pojo/IStrategy.java
  17. 456 0
      src/main/java/com/smppw/common/pojo/IndexesProfile.java
  18. 121 0
      src/main/java/com/smppw/common/pojo/IndexesTradeDateDo.java
  19. 23 0
      src/main/java/com/smppw/common/pojo/IndicatorCalcType.java
  20. 80 0
      src/main/java/com/smppw/common/pojo/InvestmentType.java
  21. 69 0
      src/main/java/com/smppw/common/pojo/NewPublicSubStrategy.java
  22. 107 0
      src/main/java/com/smppw/common/pojo/NewSubStrategy.java
  23. 77 0
      src/main/java/com/smppw/common/pojo/PublicSubStrategyFullName.java
  24. 35 0
      src/main/java/com/smppw/common/pojo/SecurityBaseValues.java
  25. 29 0
      src/main/java/com/smppw/common/pojo/SecurityDoubleValuesContainsName.java
  26. 85 0
      src/main/java/com/smppw/common/pojo/StrategyTreeDto.java
  27. 49 0
      src/main/java/com/smppw/common/pojo/ValueLabelDo.java
  28. 50 0
      src/main/java/com/smppw/common/pojo/ValueLabelVO.java
  29. 47 0
      src/main/java/com/smppw/common/pojo/ValueLabelWithEn.java
  30. 24 0
      src/main/java/com/smppw/common/pojo/dto/CompoundRet.java
  31. 104 0
      src/main/java/com/smppw/common/pojo/dto/DateRange.java
  32. 83 0
      src/main/java/com/smppw/common/pojo/dto/DateValue.java
  33. 37 0
      src/main/java/com/smppw/common/pojo/dto/Interval.java
  34. 36 0
      src/main/java/com/smppw/common/pojo/dto/NavDto.java
  35. 15 0
      src/main/java/com/smppw/common/pojo/dto/NewDateValue.java
  36. 20 0
      src/main/java/com/smppw/common/pojo/dto/PageInfoRes.java
  37. 9 0
      src/main/java/com/smppw/common/pojo/dto/Value.java
  38. 42 0
      src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcBenchmarkDataDto.java
  39. 48 0
      src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcIndexDataDto.java
  40. 15 0
      src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcMultiTimeRangeDto.java
  41. 40 0
      src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcPropertyDto.java
  42. 119 0
      src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcReqPropertyDto.java
  43. 12 0
      src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcRiskFreeDataDto.java
  44. 63 0
      src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcSecDataDto.java
  45. 32 0
      src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcTimeRangeDto.java
  46. 68 0
      src/main/java/com/smppw/common/pojo/dto/indicator/CalcMultipleSecMultipleTimeRangeIndicatorReq.java
  47. 42 0
      src/main/java/com/smppw/common/pojo/dto/indicator/DateIntervalDto.java
  48. 13 0
      src/main/java/com/smppw/common/pojo/dto/log/RequestErrorInfo.java
  49. 14 0
      src/main/java/com/smppw/common/pojo/dto/log/RequestInfo.java
  50. 12 0
      src/main/java/com/smppw/common/pojo/dto/time/TimeIntervalDto.java
  51. 12 0
      src/main/java/com/smppw/common/pojo/dto/time/TimeRollingDto.java
  52. 11 0
      src/main/java/com/smppw/common/pojo/dto/time/TimeTrailingDto.java
  53. 21 0
      src/main/java/com/smppw/common/pojo/enums/AssetStyleType.java
  54. 62 0
      src/main/java/com/smppw/common/pojo/enums/BarrConstant.java
  55. 48 0
      src/main/java/com/smppw/common/pojo/enums/BarraRiskProfitEnum.java
  56. 71 0
      src/main/java/com/smppw/common/pojo/enums/BarraStyleRespEnum.java
  57. 29 0
      src/main/java/com/smppw/common/pojo/enums/CombinationType.java
  58. 24 0
      src/main/java/com/smppw/common/pojo/enums/Constraint.java
  59. 83 0
      src/main/java/com/smppw/common/pojo/enums/CurveType.java
  60. 8 0
      src/main/java/com/smppw/common/pojo/enums/DataSourceType.java
  61. 33 0
      src/main/java/com/smppw/common/pojo/enums/DateIntervalType.java
  62. 31 0
      src/main/java/com/smppw/common/pojo/enums/FileType.java
  63. 110 0
      src/main/java/com/smppw/common/pojo/enums/Frequency.java
  64. 50 0
      src/main/java/com/smppw/common/pojo/enums/FutureStyleRespEnum.java
  65. 367 0
      src/main/java/com/smppw/common/pojo/enums/Indicator.java
  66. 274 0
      src/main/java/com/smppw/common/pojo/enums/IndicatorContrastEnum.java
  67. 25 0
      src/main/java/com/smppw/common/pojo/enums/IndustryType.java
  68. 29 0
      src/main/java/com/smppw/common/pojo/enums/MarketIndexEnum.java
  69. 36 0
      src/main/java/com/smppw/common/pojo/enums/NavType.java
  70. 32 0
      src/main/java/com/smppw/common/pojo/enums/OptionsType.java
  71. 18 0
      src/main/java/com/smppw/common/pojo/enums/OrderTypeEnum.java
  72. 27 0
      src/main/java/com/smppw/common/pojo/enums/RBSAIndexType.java
  73. 78 0
      src/main/java/com/smppw/common/pojo/enums/RaiseType.java
  74. 61 0
      src/main/java/com/smppw/common/pojo/enums/SystemObjectEnum.java
  75. 194 0
      src/main/java/com/smppw/common/pojo/enums/TimeRange.java
  76. 66 0
      src/main/java/com/smppw/common/pojo/enums/TrendType.java
  77. 24 0
      src/main/java/com/smppw/common/pojo/enums/ValueGrowthType.java
  78. 23 0
      src/main/java/com/smppw/common/pojo/enums/Visibility.java
  79. 23 0
      src/main/java/com/smppw/common/pojo/enums/WinRateBmk.java
  80. 126 0
      src/main/java/com/smppw/common/pojo/enums/status/ResultCode.java
  81. 6 0
      src/main/java/com/smppw/common/pojo/enums/status/StatusCode.java
  82. 263 0
      src/main/java/com/smppw/common/pojo/enums/strategy/Strategy.java
  83. 69 0
      src/main/java/com/smppw/common/pojo/enums/strategy/SubStrategy.java
  84. 72 0
      src/main/java/com/smppw/common/pojo/enums/strategy/SysStrategy.java
  85. 81 0
      src/main/java/com/smppw/common/pojo/enums/strategy/ThirdStrategy.java
  86. 95 0
      src/main/java/com/smppw/common/pojo/vo/ResultVo.java
  87. 13 0
      src/main/java/com/smppw/common/rollrange/DateSpliter.java
  88. 149 0
      src/main/java/com/smppw/common/rollrange/RollingSpliter.java
  89. 25 0
      src/main/java/com/smppw/common/rollrange/date/DateConvertor.java
  90. 109 0
      src/main/java/com/smppw/common/rollrange/date/DateConvertorImpl.java
  91. 72 0
      src/main/java/com/smppw/common/rollrange/date/DateVerifier.java
  92. 19 0
      src/main/java/com/smppw/common/rollrange/date/IDateTime.java
  93. 11 0
      src/main/java/com/smppw/common/rollrange/date/PeriodPosition.java
  94. 32 0
      src/main/java/com/smppw/common/rollrange/date/TimeFactory.java
  95. 24 0
      src/main/java/com/smppw/common/rollrange/date/item/BaseDateTime.java
  96. 36 0
      src/main/java/com/smppw/common/rollrange/date/item/Day.java
  97. 36 0
      src/main/java/com/smppw/common/rollrange/date/item/HalfYear.java
  98. 29 0
      src/main/java/com/smppw/common/rollrange/date/item/Month.java
  99. 37 0
      src/main/java/com/smppw/common/rollrange/date/item/Quarter.java
  100. 0 0
      src/main/java/com/smppw/common/rollrange/date/item/Week.java

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 14 - 0
.idea/compiler.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="true" />
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="data-calc" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>

+ 20 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+  </component>
+</project>

+ 14 - 0
.idea/misc.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 124 - 0
.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 80 - 0
pom.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.smppw</groupId>
+    <artifactId>data-calc</artifactId>
+    <version>0.1.1-SNAPSHOT</version>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <hutool-version>5.8.12</hutool-version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.26</version>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-core</artifactId>
+            <version>${hutool-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-json</artifactId>
+            <version>${hutool-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.12.0</version>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.10.13</version>
+        </dependency>
+        <dependency>
+            <groupId>com.belerweb</groupId>
+            <artifactId>pinyin4j</artifactId>
+            <version>2.5.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.ben-manes.caffeine</groupId>
+            <artifactId>caffeine</artifactId>
+            <version>2.8.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-math3</artifactId>
+            <version>3.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+            <version>2.17.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <version>2.17.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-jul</artifactId>
+            <version>2.17.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jul-to-slf4j</artifactId>
+            <version>1.7.36</version>
+        </dependency>
+    </dependencies>
+</project>

+ 28 - 0
src/main/java/com/smppw/common/cache/BasicLocalCache.java

@@ -0,0 +1,28 @@
+package com.smppw.common.cache;
+
+/**
+ *
+ */
+public abstract class BasicLocalCache {
+
+    /**
+     * 基金本地缓存最大容量(16 * 512) 8192
+     */
+    static final int FUND_CAPACITY = 8192;
+
+    /**
+     * 指数本地缓存最大容量(16 * 8) 128
+     */
+    static final int INDEX_CAPACITY = 128;
+
+    /**
+     * 获取不到数据得 sec ,只有几种情况,所以设最小值 16
+     */
+    static final int NO_DATA_CAPACITY = 16;
+
+    /**
+     * 定时任务起始时间缓存 512
+     */
+    static final int SCHEDULE_TASK_CAPACITY = 512;
+
+}

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

@@ -0,0 +1,263 @@
+package com.smppw.common.cache;
+
+import com.github.benmanes.caffeine.cache.Cache;
+import com.github.benmanes.caffeine.cache.Caffeine;
+import com.smppw.constants.Consts;
+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 org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author lizhuang
+ * @Title: ${file_name}
+ * @Package ${package_name}
+ * @Description: ${todo}
+ * @date 2021/10/23 14:05
+ */
+public class CaffeineLocalCache extends BasicLocalCache {
+
+    /******************************************************************************************************************************/
+    // 添加机构基本信息列到缓存中
+    private static final Cache<String, List<String>> COMPANY_BASE_INFO_COLUMNS = Caffeine.newBuilder().maximumSize(16384).build();
+    // 添加机构指标列到缓存中
+    private static final Cache<String, List<String>> COMPANY_INDICATOR_COLUMNS = Caffeine.newBuilder().maximumSize(16384).build();
+    // 添加经理基本信息列到缓存中
+    private static final Cache<String, List<String>> MANAGER_BASE_INFO_COLUMNS = Caffeine.newBuilder().maximumSize(16384).build();
+    // 添加经理指标列到缓存中
+    private static final Cache<String, List<String>> MANAGER_INDICATOR_COLUMNS = Caffeine.newBuilder().maximumSize(16384).build();
+    /**
+     * 缓存所有非交易日 日期
+     */
+    private static Cache<String, String> NON_TRADING_DAY = Caffeine.newBuilder().maximumSize(16384).build();
+    /**
+     * 缓存所有日期对应的年周
+     */
+    private static Cache<String, String> DATE_YEAR_WEEK = Caffeine.newBuilder().maximumSize(16384).build();
+    /**
+     * 缓存所有年周的最后交易日
+     */
+    private static Cache<String, String> YEAR_WEEK_LAST_TRADE_DATE = Caffeine.newBuilder().maximumSize(16384).build();
+    /**
+     * 缓存所有日期对应的年月
+     */
+    private static Cache<String, String> DATE_YEAR_MONTH = Caffeine.newBuilder().maximumSize(16384).build();
+    /**
+     * 缓存所有的三方指数ID
+     */
+    private static Cache<String, List<String>> THIRD_INDEXES = Caffeine.newBuilder().maximumSize(16384).build();
+    private static Cache<String, String> DATE_MONTH_WEEK = Caffeine.newBuilder().maximumSize(16384).build();
+    /**
+     * 缓存所有年月的最后交易日
+     */
+    private static Cache<String, String> YEAR_MONTH_LAST_TRADE_DATE = Caffeine.newBuilder().maximumSize(8192).build();
+    /**
+     * 交易日  indexes_trade_date 指数和交易日一对多
+     */
+    private static Cache<String, List<IndexesTradeDateDo>> LIST_INFO_TREND_DATE = Caffeine.newBuilder().maximumSize(1).build();
+    /**
+     * 缓存所有的无风险ID
+     */
+    private static Cache<String, List<String>> RISKOFFREEIDS = Caffeine.newBuilder().maximumSize(16384).build();
+    /**
+     * 缓存 基金研究 所有的 key对应的配置项
+     */
+    private static Cache<String, List<ValueLabelDo>> INDICATOR_SCREENING_CONFIG = Caffeine.newBuilder().maximumSize(16384).build();
+    private static Cache<String, List<String>> YEAR_INDICATOR = Caffeine.newBuilder().maximumSize(16384).build();
+
+    /**
+     * 获取某一天前最接近的一个交易日日期
+     *
+     * @param date
+     * @return
+     */
+    public static String getClosestTradingDay(DateTime date) {
+        String result = date.toString(Consts.DEFAULT_DATE_PATTERN);
+        for (int i = 1; i <= 30; i++) {
+            String tradingDate = date.minusDays(i).toString(Consts.DEFAULT_DATE_PATTERN);
+            String value = NON_TRADING_DAY.getIfPresent(tradingDate);
+            if (StringUtils.isEmpty(value)) {
+                result = tradingDate;
+                break;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 添加非交易日日期
+     */
+    public static void addNonTradingDay(List<String> dates) {
+        for (String date : dates) {
+            NON_TRADING_DAY.put(date, date);
+        }
+    }
+
+    /**
+     * 判断某一天是否为交易日
+     *
+     * @param date
+     * @return
+     */
+    public static boolean getIsTradingDay(String date) {
+        if (StringUtils.isEmpty(date)) {
+            return false;
+        }
+        String value = NON_TRADING_DAY.getIfPresent(date);
+        return StringUtils.isEmpty(value);
+    }
+
+    public static void cleanDateYearWeek() {
+        DATE_YEAR_WEEK.invalidateAll();
+    }
+
+    public static String getYearWeekByDate(String date) {
+        return DATE_YEAR_WEEK.getIfPresent(date);
+    }
+
+    public static void addDateYearWeek(List<IndexesTradeDateDo> indexesTradeDateDoList) {
+        for (IndexesTradeDateDo indexesTradeDateDo : indexesTradeDateDoList) {
+            DATE_YEAR_WEEK.put(indexesTradeDateDo.getTradeDate(), indexesTradeDateDo.getYearWeek());
+        }
+    }
+
+    public static void cleanYearWeekLastTradeDate() {
+        YEAR_WEEK_LAST_TRADE_DATE.invalidateAll();
+    }
+
+    public static String getLastTradeDateByYearWeek(String yearWeek) {
+        return YEAR_WEEK_LAST_TRADE_DATE.getIfPresent(yearWeek);
+    }
+
+    public static void addYearWeekLastTradeDate(List<IndexesTradeDateDo> indexesTradeDateDoList) {
+        for (IndexesTradeDateDo indexesTradeDateDo : indexesTradeDateDoList) {
+            YEAR_WEEK_LAST_TRADE_DATE.put(indexesTradeDateDo.getYearWeek(), indexesTradeDateDo.getTradeDate());
+        }
+    }
+
+    public static void cleanDateYearMonth() {
+        DATE_YEAR_MONTH.invalidateAll();
+    }
+
+    public static void addDateYearMonth(List<IndexesTradeDateDo> indexesTradeDateDoList) {
+        for (IndexesTradeDateDo indexesTradeDateDo : indexesTradeDateDoList) {
+            DATE_YEAR_MONTH.put(indexesTradeDateDo.getTradeDate(), indexesTradeDateDo.getYearmonth());
+        }
+    }
+
+    public static void cleanThirdIndexes() {
+        THIRD_INDEXES.invalidateAll();
+    }
+
+    public static List<String> getThirdIndexes() {
+        return THIRD_INDEXES.getIfPresent(IndexConst.THIRD_INDEXES_CAFFEINE_KEY);
+    }
+
+    public static void addThirdIndexes(List<String> indexIdList) {
+        THIRD_INDEXES.put(IndexConst.THIRD_INDEXES_CAFFEINE_KEY, indexIdList);
+    }
+
+    public static void cleanDateMonthWeek() {
+        DATE_MONTH_WEEK.invalidateAll();
+    }
+
+    public static void addDateMonthWeek(Map<String, String> dateCateMap) {
+        for (Map.Entry<String, String> dateCateMapEntry : dateCateMap.entrySet()) {
+            DATE_MONTH_WEEK.put(dateCateMapEntry.getKey(), dateCateMapEntry.getValue());
+        }
+    }
+
+    public static String getDateMonthWeek(String date) {
+        return DATE_MONTH_WEEK.getIfPresent(date);
+    }
+
+    public static void addYearMonthLastTradeDate(List<IndexesTradeDateDo> indexesTradeDateDoList) {
+        for (IndexesTradeDateDo indexesTradeDateDo : indexesTradeDateDoList) {
+            YEAR_MONTH_LAST_TRADE_DATE.put(indexesTradeDateDo.getYearmonth(), indexesTradeDateDo.getTradeDate());
+        }
+    }
+
+    public static void cleanYearMonthLastTradeDate() {
+        YEAR_MONTH_LAST_TRADE_DATE.invalidateAll();
+    }
+
+    public static void addListInfoTrendDate(List<IndexesTradeDateDo> indexesTradeDateDoList) {
+        LIST_INFO_TREND_DATE.put(DateConst.TREND_DATE, indexesTradeDateDoList);
+    }
+
+    public static List<IndexesTradeDateDo> getListInfoTrendDate() {
+        return LIST_INFO_TREND_DATE.getIfPresent(DateConst.TREND_DATE);
+    }
+
+    public static void cleanListInfoTrendDate() {
+        LIST_INFO_TREND_DATE.invalidateAll();
+    }
+
+    public static void cleanRiskOfFreeId() {
+        RISKOFFREEIDS.invalidateAll();
+    }
+
+    public static List<String> getRiskOfFreeId() {
+        return RISKOFFREEIDS.getIfPresent(IndexConst.RISKOFFREE_CAFFEINE_KEY);
+    }
+
+    public static void addRiskOfFreeId(List<String> indexIdList) {
+        RISKOFFREEIDS.put(IndexConst.RISKOFFREE_CAFFEINE_KEY, indexIdList);
+    }
+
+    public static void addIndicatorScreeningConfig(Map<String, List<ValueLabelDo>> valueLabelMap) {
+        INDICATOR_SCREENING_CONFIG.putAll(valueLabelMap);
+    }
+
+    public static Map<String, List<ValueLabelDo>> getIndicatorScreeningConfig() {
+        return INDICATOR_SCREENING_CONFIG.asMap();
+    }
+
+    public static void addYearFundIndicator(List<String> indicators) {
+        YEAR_INDICATOR.put(SearchConst.FUND_YEAR_INDICATOR, indicators);
+    }
+
+    public static List<String> getYearFundIndicator() {
+        return YEAR_INDICATOR.getIfPresent(SearchConst.FUND_YEAR_INDICATOR);
+    }
+
+    public static void addCompanyBaseInfoColumns(List<String> indicators) {
+        COMPANY_BASE_INFO_COLUMNS.put(SearchConst.COMPANY_BASE_INFO_COLUMNS, indicators);
+    }
+
+    public static List<String> getCompanyBaseInfoColumns() {
+        return COMPANY_BASE_INFO_COLUMNS.getIfPresent(SearchConst.COMPANY_BASE_INFO_COLUMNS);
+    }
+
+    public static void addCompanyIndicatorColumns(List<String> indicators) {
+        COMPANY_INDICATOR_COLUMNS.put(SearchConst.COMPANY_INDICATOR_COLUMNS, indicators);
+    }
+
+    public static List<String> getCompanyIndicatorColumns() {
+        return COMPANY_INDICATOR_COLUMNS.getIfPresent(SearchConst.COMPANY_INDICATOR_COLUMNS);
+    }
+
+    public static void addManagerBaseInfoColumns(List<String> indicators) {
+        MANAGER_BASE_INFO_COLUMNS.put(SearchConst.MANAGER_BASE_INFO_COLUMNS, indicators);
+    }
+
+    public static List<String> getManagerBaseInfoColumns() {
+        return MANAGER_BASE_INFO_COLUMNS.getIfPresent(SearchConst.MANAGER_BASE_INFO_COLUMNS);
+    }
+
+    public static void addManagerIndicatorColumns(List<String> indicators) {
+        MANAGER_INDICATOR_COLUMNS.put(SearchConst.MANAGER_INDICATOR_COLUMNS, indicators);
+    }
+
+    public static List<String> getManagerIndicatorColumns() {
+        return MANAGER_INDICATOR_COLUMNS.getIfPresent(SearchConst.MANAGER_INDICATOR_COLUMNS);
+    }
+
+    /******************************************************************************************************************************/
+}

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

@@ -0,0 +1,28 @@
+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;
+    }
+}

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

@@ -0,0 +1,23 @@
+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;
+    }
+}

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

@@ -0,0 +1,23 @@
+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;
+
+}

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

@@ -0,0 +1,25 @@
+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;
+}

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

@@ -0,0 +1,28 @@
+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;
+    }
+}

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

@@ -0,0 +1,29 @@
+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;
+    }
+}

+ 87 - 0
src/main/java/com/smppw/common/pojo/FundFuturesOption.java

@@ -0,0 +1,87 @@
+package com.smppw.common.pojo;
+
+import java.util.stream.Stream;
+
+/**
+ * 新 - 第一级策略
+ */
+public enum FundFuturesOption {
+
+	/** 期货及其衍生品数据**/
+	All(0, "全部","All"),
+	Product(1, "商品","Product"),
+	Bond(2, "国债","Bond"),
+	StockIndex(3, "股指","StockIndex"),
+	Future(4, "期权","Future"),
+	Other(5, "其他衍生品","Other"),
+	PreciousMetal(11, "贵金属","PreciousMetal"),
+	Metal(12, "金属","Metal"),
+	NonFerrousMetal(13, "有色","NonFerrousMetal"),
+	BlackMetal(17, "黑色","BlackMetal"),
+	Energization(14, "能化","Energization"),
+	IndustrialProducts(15, "工业品","IndustrialProducts"),
+	AgriculturalProducts(16, "农产品","AgriculturalProducts"),
+	StockIndexFuture(31, "股指期货","StockIndexFuture"),
+	StockIndexOption(41, "股指期权","StockIndexOption"),
+	BondFuture(21, "国债期货","BondFuture");
+	private Integer id;
+	private String nameDesc;
+	private String nameEnDesc;
+
+	FundFuturesOption(int id, String nameDesc, String nameEnDesc) {
+		this.id = id;
+		this.nameDesc = nameDesc;
+		this.nameEnDesc = nameEnDesc;
+	}
+
+	public int getId() {
+		return id;
+	}
+
+	public String getNameDesc() {
+		return nameDesc;
+	}
+	public String getNameEnDesc() {
+		return nameEnDesc;
+	}
+
+
+	public static FundFuturesOption getFundFuturesOption(Integer id) {
+		return Stream.of(FundFuturesOption.values()).filter(e -> e.id.equals(id)).findFirst().orElse(null);
+	}
+
+	public static FundFuturesOption getFundFuturesOption(String id) {
+		if (null == id){
+			return null;
+		}
+		for(FundFuturesOption s : FundFuturesOption.values()){
+			if(id.equals(s.getId()+"") || id.equals(s.name())){
+				return s;
+			}
+		}
+		return null;
+	}
+
+	public static FundFuturesOption getFundFuturesOptionByName(String name) {
+		if (null == name){
+			return null;
+		}
+		for(FundFuturesOption s : FundFuturesOption.values()){
+			if(name.equals(s.getNameDesc()+"")){
+				return s;
+			}
+		}
+		return null;
+	}
+	public static FundFuturesOption getFundFuturesOptionByEnName(String name) {
+		if (null == name){
+			return null;
+		}
+		for(FundFuturesOption s : FundFuturesOption.values()){
+			if(name.equals(s.getNameEnDesc()+"")){
+				return s;
+			}
+		}
+		return null;
+	}
+}

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

@@ -0,0 +1,31 @@
+package com.smppw.common.pojo;
+
+/**
+ * @author Rain
+ * @date 2022/12/9 18:01
+ * @description
+ */
+public interface IStrategy {
+
+    /**
+     * 获取策略id
+     */
+    Integer getStrategyId();
+
+    /**
+     * 获取策略的名称
+     */
+    String getStrategyOriginName();
+
+    /**
+     * 获取策略的名称描述
+     */
+    String getStrategyNameDesc();
+
+    /**
+     * 获取该策略指数对应的基准id
+     */
+    String getBenchmark();
+
+}
+

+ 456 - 0
src/main/java/com/smppw/common/pojo/IndexesProfile.java

@@ -0,0 +1,456 @@
+package com.smppw.common.pojo;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * indexes_profile
+ * @author 
+ */
+public class IndexesProfile implements Serializable {
+    /**
+     * id
+     */
+    private Integer id;
+
+    /**
+     * 指数Id
+     */
+    private String indexId;
+
+    /**
+     * 指数类型,见池库基础参数表
+     */
+    private Integer indexType;
+
+    /**
+     * 指数二级类型,见池库基础参数表
+     */
+    private Integer indexTypeSecond;
+
+    /**
+     * 指数三级类型,见池库基础参数表
+     */
+    private Integer indexTypeThird;
+
+    /**
+     * 指数类型:1-对冲基金指数、2-信心指数、3-公募基金指数、4-沪深港股票指数、5-全球股票指数、6-金汇期指、7-无风险利率、-1-其他
+     */
+    private Integer indexTypeId;
+
+    /**
+     * 指数代码
+     */
+    private String indexCode;
+
+    /**
+     * 指数中文全称
+     */
+    private String indexName;
+
+    /**
+     * 指数中文简称
+     */
+    private String indexShortName;
+
+    /**
+     * 1-中国,2-全球
+     */
+    private Integer indexAreaFlag;
+
+    /**
+     * 指数提供机构ID
+     */
+    private String indexFamilyId;
+
+    /**
+     * 指数发布周期,1-日度、2-周、3-月度、4-季度、5-半年度、6-年度
+
+     */
+    private Integer pricingFrequency;
+
+    /**
+     * 指数基期,指数开始日期
+     */
+    private Date inceptionDate;
+
+    /**
+     * 指数基点
+     */
+    private BigDecimal indexInitialValue;
+
+    /**
+     * 计算指数所使用的货币,1-人民币,2-港币,3-美元、-1-其他
+     */
+    private Integer baseCurrency;
+
+    /**
+     * 编制指数所使用的计算方法
+     */
+    private String calculationMethod;
+
+    /**
+     * 计算成份基金权重的方法
+     */
+    private String weightingScheme;
+
+    /**
+     * 成份基金筛选方法
+     */
+    private String selectionScheme;
+
+    /**
+     * 指数重构周期,1-周、2-月度、3-季度、4-半年度、5-年度、-1-其他
+     */
+    private Integer reconstitutionFrequency;
+
+    /**
+     * 指数调整周期,1-周、2-月度、3-季度、4-半年度、5-年度、-1-其他
+     */
+    private Integer rebalanceFrequency;
+
+    /**
+     * 创建者Id,默认第一次创建者名称,创建后不变更
+     */
+    private Integer creatorid;
+
+    /**
+     * 创建时间,默认第一次创建的getdate()时间
+     */
+    private Date createtime;
+
+    /**
+     * 修改者Id;第一次创建时与Creator值相同,修改时与修改人值相同
+     */
+    private Integer updaterid;
+
+    /**
+     * 修改时间;第一次创建时与CreatTime值相同,修改时与修改时间相同
+     */
+    private Date updatetime;
+
+    /**
+     * 记录的有效性;1-有效;0-无效;
+     */
+    private Byte isvalid;
+
+    /**
+     * 质检员ID
+     */
+    private String qc;
+
+    /**
+     * 质检日期
+     */
+    private Date qcdate;
+
+    /**
+     * 质检状态
+     */
+    private Integer qcstate;
+
+    /**
+     * 审核人员ID
+     */
+    private String auditor;
+
+    /**
+     * 审核时间
+     */
+    private Date auditdate;
+
+    /**
+     * 审核状态
+     */
+    private Integer auditstate;
+
+    /**
+     * 质检员意见
+     */
+    private String qcremark;
+
+    /**
+     * 审核员意见
+     */
+    private String auditremark;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getIndexId() {
+        return indexId;
+    }
+
+    public void setIndexId(String indexId) {
+        this.indexId = indexId;
+    }
+
+    public Integer getIndexType() {
+        return indexType;
+    }
+
+    public void setIndexType(Integer indexType) {
+        this.indexType = indexType;
+    }
+
+    public Integer getIndexTypeSecond() {
+        return indexTypeSecond;
+    }
+
+    public void setIndexTypeSecond(Integer indexTypeSecond) {
+        this.indexTypeSecond = indexTypeSecond;
+    }
+
+    public Integer getIndexTypeThird() {
+        return indexTypeThird;
+    }
+
+    public void setIndexTypeThird(Integer indexTypeThird) {
+        this.indexTypeThird = indexTypeThird;
+    }
+
+    public Integer getIndexTypeId() {
+        return indexTypeId;
+    }
+
+    public void setIndexTypeId(Integer indexTypeId) {
+        this.indexTypeId = indexTypeId;
+    }
+
+    public String getIndexCode() {
+        return indexCode;
+    }
+
+    public void setIndexCode(String indexCode) {
+        this.indexCode = indexCode;
+    }
+
+    public String getIndexName() {
+        return indexName;
+    }
+
+    public void setIndexName(String indexName) {
+        this.indexName = indexName;
+    }
+
+    public String getIndexShortName() {
+        return indexShortName;
+    }
+
+    public void setIndexShortName(String indexShortName) {
+        this.indexShortName = indexShortName;
+    }
+
+    public Integer getIndexAreaFlag() {
+        return indexAreaFlag;
+    }
+
+    public void setIndexAreaFlag(Integer indexAreaFlag) {
+        this.indexAreaFlag = indexAreaFlag;
+    }
+
+    public String getIndexFamilyId() {
+        return indexFamilyId;
+    }
+
+    public void setIndexFamilyId(String indexFamilyId) {
+        this.indexFamilyId = indexFamilyId;
+    }
+
+    public Integer getPricingFrequency() {
+        return pricingFrequency;
+    }
+
+    public void setPricingFrequency(Integer pricingFrequency) {
+        this.pricingFrequency = pricingFrequency;
+    }
+
+    public Date getInceptionDate() {
+        return inceptionDate;
+    }
+
+    public void setInceptionDate(Date inceptionDate) {
+        this.inceptionDate = inceptionDate;
+    }
+
+    public BigDecimal getIndexInitialValue() {
+        return indexInitialValue;
+    }
+
+    public void setIndexInitialValue(BigDecimal indexInitialValue) {
+        this.indexInitialValue = indexInitialValue;
+    }
+
+    public Integer getBaseCurrency() {
+        return baseCurrency;
+    }
+
+    public void setBaseCurrency(Integer baseCurrency) {
+        this.baseCurrency = baseCurrency;
+    }
+
+    public String getCalculationMethod() {
+        return calculationMethod;
+    }
+
+    public void setCalculationMethod(String calculationMethod) {
+        this.calculationMethod = calculationMethod;
+    }
+
+    public String getWeightingScheme() {
+        return weightingScheme;
+    }
+
+    public void setWeightingScheme(String weightingScheme) {
+        this.weightingScheme = weightingScheme;
+    }
+
+    public String getSelectionScheme() {
+        return selectionScheme;
+    }
+
+    public void setSelectionScheme(String selectionScheme) {
+        this.selectionScheme = selectionScheme;
+    }
+
+    public Integer getReconstitutionFrequency() {
+        return reconstitutionFrequency;
+    }
+
+    public void setReconstitutionFrequency(Integer reconstitutionFrequency) {
+        this.reconstitutionFrequency = reconstitutionFrequency;
+    }
+
+    public Integer getRebalanceFrequency() {
+        return rebalanceFrequency;
+    }
+
+    public void setRebalanceFrequency(Integer rebalanceFrequency) {
+        this.rebalanceFrequency = rebalanceFrequency;
+    }
+
+    public Integer getCreatorid() {
+        return creatorid;
+    }
+
+    public void setCreatorid(Integer creatorid) {
+        this.creatorid = creatorid;
+    }
+
+    public Date getCreatetime() {
+        return createtime;
+    }
+
+    public void setCreatetime(Date createtime) {
+        this.createtime = createtime;
+    }
+
+    public Integer getUpdaterid() {
+        return updaterid;
+    }
+
+    public void setUpdaterid(Integer updaterid) {
+        this.updaterid = updaterid;
+    }
+
+    public Date getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(Date updatetime) {
+        this.updatetime = updatetime;
+    }
+
+    public Byte getIsvalid() {
+        return isvalid;
+    }
+
+    public void setIsvalid(Byte isvalid) {
+        this.isvalid = isvalid;
+    }
+
+    public String getQc() {
+        return qc;
+    }
+
+    public void setQc(String qc) {
+        this.qc = qc;
+    }
+
+    public Date getQcdate() {
+        return qcdate;
+    }
+
+    public void setQcdate(Date qcdate) {
+        this.qcdate = qcdate;
+    }
+
+    public Integer getQcstate() {
+        return qcstate;
+    }
+
+    public void setQcstate(Integer qcstate) {
+        this.qcstate = qcstate;
+    }
+
+    public String getAuditor() {
+        return auditor;
+    }
+
+    public void setAuditor(String auditor) {
+        this.auditor = auditor;
+    }
+
+    public Date getAuditdate() {
+        return auditdate;
+    }
+
+    public void setAuditdate(Date auditdate) {
+        this.auditdate = auditdate;
+    }
+
+    public Integer getAuditstate() {
+        return auditstate;
+    }
+
+    public void setAuditstate(Integer auditstate) {
+        this.auditstate = auditstate;
+    }
+
+    public String getQcremark() {
+        return qcremark;
+    }
+
+    public void setQcremark(String qcremark) {
+        this.qcremark = qcremark;
+    }
+
+    public String getAuditremark() {
+        return auditremark;
+    }
+
+    public void setAuditremark(String auditremark) {
+        this.auditremark = auditremark;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+}

+ 121 - 0
src/main/java/com/smppw/common/pojo/IndexesTradeDateDo.java

@@ -0,0 +1,121 @@
+package com.smppw.common.pojo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+    * 交易日
+    */
+@Data
+public class IndexesTradeDateDo {
+    /**
+    * 主键ID
+    */
+    private Integer id;
+
+    /**
+    * 指数代码
+    */
+    private String indexCode;
+
+    /**
+    * 日期
+    */
+    private String tradeDate;
+
+    /**
+    * 截止年份
+    */
+    private String endYear;
+
+    /**
+    * 全年的第几周
+    */
+    private Integer weekOfYear;
+
+    /**
+    * 年周
+    */
+    private String yearWeek;
+
+    /**
+    * 星期,周一为1
+    */
+    private Integer dayOfWeek;
+
+    /**
+    * 周的开始日期
+    */
+    private Date weekBegin;
+
+    /**
+    * 周的结束日期
+    */
+    private Date weekEnd;
+
+    /**
+    * 上一周所在的年
+    */
+    private String preYear;
+
+    /**
+    * 上一周
+    */
+    private Byte preWeek;
+
+    /**
+    * 是否为节假日 0 工作日 1 节假日
+    */
+    private Integer isholiday;
+
+    /**
+    * 是否周最后交易日:1-是,2-否
+    */
+    private Integer isWeekend;
+
+    /**
+    * 是否月最后交易日:1-是,2-否
+    */
+    private Integer isMonthend;
+
+    /**
+    * 是否季最后交易日:1-是,2-否
+    */
+    private Integer isQuarterend;
+
+    /**
+    * 是否年最后交易日:1-是,2-否
+    */
+    private Integer isYearend;
+
+    /**
+    * 记录有效性 1 有效 0 无效
+    */
+    private Integer isvalid;
+
+    /**
+    * 创建人id
+    */
+    private Integer creatorid;
+
+    /**
+    * 创建时间
+    */
+    private Date createtime;
+
+    /**
+    * 更新人id
+    */
+    private Integer updaterid;
+
+    /**
+    * 更新时间
+    */
+    private Date updatetime;
+
+    /**
+    * 年月
+    */
+    private String yearmonth;
+}

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

@@ -0,0 +1,23 @@
+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);
+	}
+}

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

@@ -0,0 +1,80 @@
+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;
+	}
+	
+}

+ 69 - 0
src/main/java/com/smppw/common/pojo/NewPublicSubStrategy.java

@@ -0,0 +1,69 @@
+package com.smppw.common.pojo;
+
+import java.util.stream.Stream;
+
+// 新公募二级策略
+public enum NewPublicSubStrategy implements IStrategy{
+    Other(-10000, "其他策略","IN00000008"),
+    Initiative(10101, "主动","IN00000008"),
+    Passive(10102, "被动","IN00000008"),
+    IndexEnhancement(10103, "指数增强","IN00000008"),
+    PartialStock(10201, "偏股","IN00000008"),
+    Balance(10202, "平衡","IN000002F1"),
+    PartialDebt(10203, "偏债","IN0000028F"),
+    OrdinaryDebt(10301, "普通债","IN0000028F"),
+    ConvertibleBond(10302, "可转债","IN0000028F"),
+    Exponential(10303, "指数型","IN0000028F"),
+    Monetary(10401, "货币","IN0000007G"),
+    FinancialManagement(10402, "理财","IN0000007G"),
+    Commodity(10501, "商品","IN0000008S"),
+    MarketNeutral(10601, "市场中性","IN00000008"),
+    FofPartialStock(10701, "偏股","IN00000008"),
+    FofBalance(10702, "平衡","IN000002F1"),
+    FofPartialDebt(10703, "偏债","IN0000028F"),
+    OverseeInitiative(10801, "主动","IN00000008"),
+    OverseePassive(10802, "被动","IN00000008"),
+    OverseeIndexEnhancement(10803, "指数增强","IN00000008");
+
+    private final Integer id;
+    private final String nameDesc;
+    private final String benchmarkId;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public String getNameDesc() {
+        return nameDesc;
+    }
+
+    NewPublicSubStrategy(Integer id, String nameDesc,String benchmarkId) {
+        this.id = id;
+        this.nameDesc = nameDesc;
+        this.benchmarkId = benchmarkId;
+    }
+
+    public static NewPublicSubStrategy getPublicSubStrategy(int id) {
+        return Stream.of(NewPublicSubStrategy.values()).filter(e -> e.id == id).findFirst().orElse(null);
+    }
+
+    @Override
+    public Integer getStrategyId() {
+        return this.getId();
+    }
+
+    @Override
+    public String getStrategyOriginName() {
+        return this.name();
+    }
+
+    @Override
+    public String getStrategyNameDesc() {
+        return this.getNameDesc();
+    }
+
+    @Override
+    public String getBenchmark() {
+        return this.benchmarkId;
+    }
+}

+ 107 - 0
src/main/java/com/smppw/common/pojo/NewSubStrategy.java

@@ -0,0 +1,107 @@
+package com.smppw.common.pojo;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+
+// 新策略 - 第二级策略
+public enum NewSubStrategy implements IStrategy{
+    OtherStrategy(-1, "其他策略", "", "IN00000008"), /**/
+    EquityLongOnly(100101, "主观多头", "IN000002D7", "IN00000008"), /**/
+    EquityQuantitative(100102, "量化多头", "IN000002D8", "IN00000008"), /**/
+    EquityLongShort(100103, "股票多空", "IN000002D9", "IN00000008"), /**/
+    EquityNeutral(100104, "股票市场中性", "IN000002DA", "IN00000008"), /**/
+    BondPure(100201, "纯债策略", "IN000002DB", "IN00000077"), /**/
+    BondStrong(100202, "债券增强", "IN000002DC", "IN00000077"), /**/
+    BondMultiple(100203, "债券复合", "IN000002DD", "IN00000077"), /**/
+    CnvtbBondTrd(100204, "转债交易策略", "IN000002DE", "IN0000008J"),
+    ActMgtFut(100301, "主观CTA", "IN000002DF", "IN0000008S"),
+    MgtFutQuant(100302, "量化CTA", "IN000002DG", "IN0000008S"),
+    OptionStrgy(100303, "期权策略", "IN000002DH", "IN0000008S"),
+    OtherFutures(100304, "其他衍生品策略", "IN000002DI", "IN0000008S"),
+    MacroStrgy(100401, "宏观策略", "IN000002DJ", "IN00000008"),
+    ArbitrageStrgy(100402, "套利策略", "IN000002DK", "IN00000008"),
+    CombinedStrgy(100403, "复合策略", "IN000002DL", "IN00000008"),
+    SubFOF(100501, "FOF", "IN000002DM", "IN00000008"), /**/
+    MOM(100502, "MOM", "IN000002DN", "IN00000008"),
+    ; /**/
+
+
+    public static final List<NewSubStrategy> STRATEGY_LIST = Arrays.asList(EquityLongOnly, EquityQuantitative, EquityLongShort, EquityNeutral,
+            BondPure, BondStrong,
+            BondMultiple, CnvtbBondTrd, ActMgtFut, MgtFutQuant, OptionStrgy, OtherFutures,MacroStrgy,ArbitrageStrgy,CombinedStrgy, SubFOF,MOM);
+
+    private Integer id;
+    private String nameDesc;
+    private String rongZhiIndex;
+    private String benchmark;
+
+    private NewSubStrategy(Integer id, String nameDesc, String rongZhiIndex, String benchmark) {
+        this.id = id;
+        this.nameDesc = nameDesc;
+        this.rongZhiIndex = rongZhiIndex;
+        this.benchmark = benchmark;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+    public String getNameDesc() {
+        return nameDesc;
+    }
+
+    public String getRongZhiIndex() {
+        return rongZhiIndex;
+    }
+
+    public String getBenchmark() {
+        return benchmark;
+    }
+
+    public static NewSubStrategy getSubStrategy(int id) {
+        return Stream.of(NewSubStrategy.values()).filter(e -> e.id == id).findFirst().orElse(null);
+    }
+
+    public static NewSubStrategy getStrategyByName(String name) {
+        if (null == name){
+            return null;
+        }
+        for(NewSubStrategy s : NewSubStrategy.values()){
+            if(name.equals(s.getNameDesc()+"")){
+                return s;
+            }
+        }
+        return null;
+    }
+
+    public static NewSubStrategy getStrategyByN(String name) {
+        if (null == name){
+            return null;
+        }
+        for(NewSubStrategy s : NewSubStrategy.values()){
+            if(name.equals(s.name())){
+                return s;
+            }
+        }
+        return null;
+    }
+
+    public static NewSubStrategy getStrategy(Integer id) {
+        return Stream.of(NewSubStrategy.values()).filter(e -> e.id.equals(id)).findFirst().orElse(null);
+    }
+
+    @Override
+    public Integer getStrategyId() {
+        return this.getId();
+    }
+
+    @Override
+    public String getStrategyOriginName() {
+        return this.name();
+    }
+
+    @Override
+    public String getStrategyNameDesc() {
+        return this.getNameDesc();
+    }
+}

+ 77 - 0
src/main/java/com/smppw/common/pojo/PublicSubStrategyFullName.java

@@ -0,0 +1,77 @@
+package com.smppw.common.pojo;
+
+import java.util.stream.Stream;
+
+/**
+ * @author mozuwen
+ * @date 2023/07/26 10:00
+ * @description 公募二级策略完整名称
+ */
+
+public enum PublicSubStrategyFullName implements IStrategy{
+    Other(-10000, "其他型","IN00000008"),
+    Initiative(10101, "主动股票型","IN00000008"),
+    Passive(10102, "被动股票型","IN00000008"),
+    IndexEnhancement(10103, "指增股票型","IN00000008"),
+    PartialStock(10201, "偏股混合型","IN00000008"),
+    Balance(10202, "平衡混合型","IN000002F1"),
+    PartialDebt(10203, "偏债混合型","IN0000028F"),
+    OrdinaryDebt(10301, "普通债型","IN0000028F"),
+    ConvertibleBond(10302, "可转债型","IN0000028F"),
+    Exponential(10303, "指数债券型","IN0000028F"),
+    Monetary(10401, "货币型","IN0000007G"),
+    FinancialManagement(10402, "理财型","IN0000007G"),
+    Commodity(10501, "商品型","IN0000008S"),
+    MarketNeutral(10601, "市场中性型","IN00000008"),
+    FofPartialStock(10701, "偏股FOF型","IN00000008"),
+    FofBalance(10702, "平衡FOF型","IN000002F1"),
+    FofPartialDebt(10703, "偏债FOF型","IN0000028F"),
+    OverseeInitiative(10801, "海外主动型","IN00000008"),
+    OverseePassive(10802, "海外被动型","IN00000008"),
+    OverseeIndexEnhancement(10803, "海外指增型","IN00000008");
+
+    private final Integer id;
+    private final String nameDesc;
+    private final String benchmarkId;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public String getNameDesc() {
+        return nameDesc;
+    }
+
+    PublicSubStrategyFullName(Integer id, String nameDesc,String benchmarkId) {
+        this.id = id;
+        this.nameDesc = nameDesc;
+        this.benchmarkId = benchmarkId;
+    }
+
+    public static NewPublicSubStrategy getPublicSubStrategy(int id) {
+        return Stream.of(NewPublicSubStrategy.values()).filter(e -> e.getId() == id).findFirst().orElse(null);
+    }
+    public static PublicSubStrategyFullName getPublicSubStrategyFullName(int id) {
+        return Stream.of(PublicSubStrategyFullName.values()).filter(e -> e.getId() == id).findFirst().orElse(null);
+    }
+
+    @Override
+    public Integer getStrategyId() {
+        return this.getId();
+    }
+
+    @Override
+    public String getStrategyOriginName() {
+        return this.name();
+    }
+
+    @Override
+    public String getStrategyNameDesc() {
+        return this.getNameDesc();
+    }
+
+    @Override
+    public String getBenchmark() {
+        return this.benchmarkId;
+    }
+}

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

@@ -0,0 +1,35 @@
+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;
+	}
+}

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

@@ -0,0 +1,29 @@
+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;
+    }
+
+
+}

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

@@ -0,0 +1,85 @@
+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;
+    }
+}

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

@@ -0,0 +1,49 @@
+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 + '\'' +
+                '}';
+    }
+}

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

@@ -0,0 +1,50 @@
+package com.smppw.common.pojo;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.util.Objects;
+
+/**
+ * value-label对象,用于配置前端选项内容使用
+ * @author wangzaijun
+ * @date 2023/4/12 19:31
+ * @description value-label对象
+ */
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+public class ValueLabelVO {
+    /**
+     * 对象具体值
+     */
+    private String value;
+    /**
+     * 对象显示的文本值
+     */
+    private String label;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        ValueLabelVO that = (ValueLabelVO) o;
+        return value.equals(that.value) && Objects.equals(label, that.label);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(value, label);
+    }
+
+    @Override
+    public String toString() {
+        return "ValueLabelVO{" +
+                "value='" + value + '\'' +
+                ", label='" + label + '\'' +
+                '}';
+    }
+}

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

@@ -0,0 +1,47 @@
+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 + '\'' +
+                '}';
+    }
+}

+ 24 - 0
src/main/java/com/smppw/common/pojo/dto/CompoundRet.java

@@ -0,0 +1,24 @@
+package com.smppw.common.pojo.dto;
+
+import lombok.Data;
+
+@Data
+public class CompoundRet {
+	private String endDate;
+	private Double retOfFund; // Fund
+	private Double retOfBmk; // Benchmark
+	private Double retOfRf; // Risk-free rate
+	private Double retOfStg; // Strategy
+
+	/*lizhuang  加的基金净值和指数净值属性,
+	方便在不修改大逻辑的情况下进行超额回撤计算,
+	这么改是不得已,一般不推荐*/
+	private Double fundNav;
+	private Double indexNav;
+
+	@Override
+	public String toString() {
+		return "MultiFunValue [endDate=" + endDate + ", retOfFund=" + retOfFund + ", retOfBmk=" + retOfBmk
+				+ ", retOfRf=" + retOfRf + ", retOfStg=" + retOfStg + ",fundNav=" + fundNav+ ",indexNav=" + indexNav+"]";
+	}
+}

+ 104 - 0
src/main/java/com/smppw/common/pojo/dto/DateRange.java

@@ -0,0 +1,104 @@
+package com.smppw.common.pojo.dto;
+
+import com.smppw.constants.Consts;
+import com.smppw.common.pojo.enums.TimeRange;
+import org.joda.time.DateTime;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public class DateRange {
+	private String startDate;
+	private String endDate;
+
+	private String retStartDate;
+	private String navEndDate;
+
+	private TimeRange timeRange;
+
+	public TimeRange getTimeRange() {
+		return timeRange;
+	}
+
+	public void setTimeRange(TimeRange timeRange) {
+		this.timeRange = timeRange;
+	}
+
+	public String getRetStartDate() {
+		return retStartDate;
+	}
+
+	public void setRetStartDate(String retStartDate) {
+		this.retStartDate = retStartDate;
+	}
+
+	public String getNavEndDate() {
+		return navEndDate;
+	}
+
+	public void setNavEndDate(String navEndDate) {
+		this.navEndDate = navEndDate;
+	}
+
+	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;
+	}
+
+	public DateRange(String startDate, String endDate) {
+		super();
+		this.startDate = startDate;
+		this.endDate = endDate;
+	}
+
+	public DateRange(String startDate, String endDate, TimeRange timeRange) {
+		super();
+		this.startDate = startDate;
+		this.endDate = endDate;
+		this.timeRange = timeRange;
+	}
+
+	public DateRange(String dateRangeStr) {
+		String[] arr = dateRangeStr.split("~");
+		this.startDate = arr[0];
+		this.endDate = arr[1];
+	}
+
+	public DateRange(DateTime startDate, DateTime endDate) {
+		super();
+		this.startDate = startDate.toString(Consts.DEFAULT_DATE_PATTERN);
+		this.endDate = endDate.toString(Consts.DEFAULT_DATE_PATTERN);
+	}
+
+	public DateRange() {
+		super();
+	}
+
+//	public boolean include(String date) {
+//		DateConvertor convertor = new DateConvertorImpl();
+//
+//		int startIndex = convertor.convertToIndex(startDate);
+//		int endIndex = convertor.convertToIndex(endDate);
+//		int index = convertor.convertToIndex(date);
+//
+//		return startIndex <= index && index <= endIndex;
+//	}
+
+	@Override
+	public String toString() {
+		return startDate + "~" + endDate;
+	}
+
+}

+ 83 - 0
src/main/java/com/smppw/common/pojo/dto/DateValue.java

@@ -0,0 +1,83 @@
+package com.smppw.common.pojo.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author lzj
+ *
+ */
+@Data
+public class DateValue implements Value, Comparable<DateValue> {
+	private String date;
+	private Double value;
+	private Integer isvalid;
+
+	private BigDecimal originalNav;
+
+	private BigDecimal cumulativeNav;
+
+	private BigDecimal cumulativeNavWithdrawal;
+
+	public BigDecimal getOriginalNav() {
+		return originalNav;
+	}
+
+	public void setOriginalNav(BigDecimal originalNav) {
+		this.originalNav = originalNav;
+	}
+
+	public BigDecimal getCumulativeNav() {
+		return cumulativeNav;
+	}
+
+	public void setCumulativeNav(BigDecimal cumulativeNav) {
+		this.cumulativeNav = cumulativeNav;
+	}
+
+	public BigDecimal getCumulativeNavWithdrawal() {
+		return cumulativeNavWithdrawal;
+	}
+
+	public void setCumulativeNavWithdrawal(BigDecimal cumulativeNavWithdrawal) {
+		this.cumulativeNavWithdrawal = cumulativeNavWithdrawal;
+	}
+
+	public DateValue() {
+	}
+
+	public DateValue(String date, Double value) {
+		this.date = date;
+		this.value = value;
+	}
+
+	public Integer getIsvalid() {
+		return isvalid;
+	}
+
+	public void setIsvalid(Integer isvalid) {
+		this.isvalid = isvalid;
+	}
+
+	public String getDate() {
+		return date;
+	}
+
+	public void setDate(String date) {
+		this.date = date;
+	}
+
+	public Double getValue() {
+		return value;
+	}
+
+	public void setValue(Double value) {
+		this.value = value;
+	}
+
+	@Override
+	public int compareTo(DateValue o) {
+		return this.getDate().compareTo(o.getDate());
+	}
+}

+ 37 - 0
src/main/java/com/smppw/common/pojo/dto/Interval.java

@@ -0,0 +1,37 @@
+package com.smppw.common.pojo.dto;
+
+/**
+ * @author zhengsongliang
+ */
+public class Interval {
+	private Double lb;
+	private Double ub;
+
+	public Interval(Double lb, Double ub) {
+		super();
+		this.lb = lb;
+		this.ub = ub;
+	}
+
+	public Double getLb() {
+		return lb;
+	}
+
+	public void setLb(Double lb) {
+		this.lb = lb;
+	}
+
+	public Double getUb() {
+		return ub;
+	}
+
+	public void setUb(Double ub) {
+		this.ub = ub;
+	}
+
+	@Override
+	public String toString() {
+		return lb + "~" + ub;
+	}
+
+}

+ 36 - 0
src/main/java/com/smppw/common/pojo/dto/NavDto.java

@@ -0,0 +1,36 @@
+package com.smppw.common.pojo.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class NavDto {
+    private Integer id;
+
+    private String fundId;
+
+    private Double nav;
+
+    private String priceDate;
+
+    private BigDecimal originalNav;
+
+    private BigDecimal cumulativeNav;
+
+    private BigDecimal cumulativeNavWithdrawal;
+
+    private BigDecimal virtualNav;
+
+    private Integer isvalid;
+
+    private String updatetime;
+
+    private Integer updateId;
+
+    private String createtime;
+
+    private Integer createId;
+
+    private Byte isPpwData;
+}

+ 15 - 0
src/main/java/com/smppw/common/pojo/dto/NewDateValue.java

@@ -0,0 +1,15 @@
+package com.smppw.common.pojo.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+public class NewDateValue {
+    private String date;
+    private String value;
+}

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

@@ -0,0 +1,20 @@
+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;
+
+
+}

+ 9 - 0
src/main/java/com/smppw/common/pojo/dto/Value.java

@@ -0,0 +1,9 @@
+package com.smppw.common.pojo.dto;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public interface Value {
+	Double getValue();
+}

+ 42 - 0
src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcBenchmarkDataDto.java

@@ -0,0 +1,42 @@
+package com.smppw.common.pojo.dto.calc;
+
+import com.smppw.common.pojo.dto.CompoundRet;
+import com.smppw.common.pojo.dto.DateValue;
+import com.smppw.common.pojo.enums.TrendType;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class IndicatorCalcBenchmarkDataDto {
+
+    /**
+     * benchmarkId的净值序列
+     */
+    private List<DateValue> benchmarkNavList = new ArrayList<>();
+
+    private List<DateValue> oriBenchmarkNavList = new ArrayList<>();
+
+    /**
+     * benchmarkId的回撤  key-指数ID, value指数的回撤
+     */
+    private List<DateValue> benchmarkDrawdown = new ArrayList<>();
+
+    /**
+     * benchmarkId的收益序列
+     */
+    private List<CompoundRet> benchmarkRetList = new ArrayList<>();
+
+    /**
+     *  benchmarkId的指标
+     */
+    private Map<String, String> benchmarkIndicatorValueMap = new HashMap<>();
+
+    /**
+     * 存放走势的结果集的map
+     */
+    private Map<TrendType, List<Double>> benchmarkTrendValueMap = new HashMap<>();
+}

+ 48 - 0
src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcIndexDataDto.java

@@ -0,0 +1,48 @@
+package com.smppw.common.pojo.dto.calc;
+
+import com.smppw.common.pojo.dto.CompoundRet;
+import com.smppw.common.pojo.dto.DateValue;
+import com.smppw.common.pojo.enums.TrendType;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class IndicatorCalcIndexDataDto {
+    /**
+     * 指数的净值序列  key-指数ID, value指数的净值序列
+     */
+    private Map<String, List<DateValue>> indexNavMap = new HashMap<>();
+    private Map<String, List<DateValue>> oriIndexNavMap = new HashMap<>();
+
+    private Map<String, List<DateValue>> indexExtraNavMap = new HashMap<>();
+
+    /**
+     * 指数的回撤  key-指数ID, value指数的回撤
+     */
+    private Map<String, List<DateValue>> indexDrawdownMap = new HashMap<>();
+
+    /**
+     * 指数的收益序列 Map
+     */
+    private Map<String, List<CompoundRet>> indexRetListMap = new HashMap<>();
+
+    /**
+     * 指数的超额收益序列-几何
+     */
+    private Map<String, List<CompoundRet>> indexExtraRetGeoListMap = new HashMap<>();
+
+    /**
+     *  指数的指标
+     */
+    private Map<String, Map<String, String>> indexIndicatorValueMap = new HashMap<>();
+
+    private Map<String, Map<String, String>> indexGeoExtraIndicatorValueMap = new HashMap<>();
+
+    /**
+     * 存放走势的结果集的map
+     */
+    private Map<String, Map<TrendType, List<Double>>> indexTrendValueMap = new HashMap<>();
+}

+ 15 - 0
src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcMultiTimeRangeDto.java

@@ -0,0 +1,15 @@
+package com.smppw.common.pojo.dto.calc;
+
+import com.smppw.common.pojo.enums.Indicator;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class IndicatorCalcMultiTimeRangeDto {
+
+
+    IndicatorCalcTimeRangeDto indicatorCalcTimeRangeDto;
+
+    List<Indicator> indicatorList;
+}

+ 40 - 0
src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcPropertyDto.java

@@ -0,0 +1,40 @@
+package com.smppw.common.pojo.dto.calc;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class IndicatorCalcPropertyDto {
+
+    /**
+     * 入参
+     */
+    private IndicatorCalcReqPropertyDto indicatorCalcReq = new IndicatorCalcReqPropertyDto();
+
+    /**
+     * 日期集合
+     */
+    private List<String> dateList = new ArrayList<>();
+
+    /**
+     * 标的的数据
+     */
+    private IndicatorCalcSecDataDto secData = new IndicatorCalcSecDataDto();
+
+    /**
+     * 基准的数据
+     */
+    private IndicatorCalcBenchmarkDataDto benchmarkData = new IndicatorCalcBenchmarkDataDto();
+
+    /**
+     * 指数的数据
+     */
+    private IndicatorCalcIndexDataDto indexData = new IndicatorCalcIndexDataDto();
+
+    /**
+     * 无风险收益
+     */
+    private IndicatorCalcRiskFreeDataDto riskFreeData = new IndicatorCalcRiskFreeDataDto();
+}

+ 119 - 0
src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcReqPropertyDto.java

@@ -0,0 +1,119 @@
+package com.smppw.common.pojo.dto.calc;
+
+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.TrendType;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class IndicatorCalcReqPropertyDto {
+
+    /**
+     * 标的ID
+     */
+    private String secId;
+
+    /**
+     * 基准ID
+     */
+    private String benchmarkId;
+
+    /**
+     * 指数ID的数组
+     */
+    private List<String> indexIdList = new ArrayList<>();
+
+    /**
+     * 开始日期, 结束日期, timeRange
+     */
+    private IndicatorCalcTimeRangeDto indicatorCalcTimeRangeDto;
+
+    /**
+     * 所有标的的净值序列的map  key-标的ID  value=净值序列
+     */
+    private Map<String,List<DateValue>> allNavMap;
+
+    /**
+     * 无风险收益Id
+     */
+    private String riskOfFreeId;
+
+
+    private Double riskOfFreeValue;
+
+    /**
+     * 策略的收益, key-日期, value-收益
+     */
+    private Map<String, CompoundRet> strategyDateRetMap;
+
+    /**
+     * 需要计算的指标集合
+     */
+    private List<Indicator> indicatorList = new ArrayList<>();
+
+    /**
+     * 需要计算的指标集合
+     */
+    private List<Indicator> ariIndicatorList = new ArrayList<>();
+
+    /**
+     * 需要计算的指标集合
+     */
+    private List<Indicator> geoIndicatorList = new ArrayList<>();
+
+    /**
+     * 用于收益类指标计算
+     */
+    private Frequency frequency;
+
+    private Frequency defaultFrequency;
+
+    /**
+     * 是否年化  true-年化, false-不年化
+     */
+    private boolean ifAnnualize;
+
+    /**
+     * 需要获取的数据类型 - 用于走势
+     */
+    private List<TrendType> trendTypeList;
+
+    /**
+     * 固定收益-来自走势图的
+     */
+    private BigDecimal fixedIncome;
+
+    /**
+     * 零点值-来自走势图的
+     */
+    private BigDecimal initValue;
+
+    /**
+     * 是否需要算出超额几何收益
+     */
+    private Boolean needExtraGeoRet = false;
+
+    /**
+     * 是否需要算出收益
+     */
+    private Boolean needRet = false;
+
+    /**
+     * 是否计算指数的指标, 默认不计算指数的指标
+     */
+    private Boolean calcIndexRetIndicatorValue = false;
+
+    /**
+     *
+     */
+    private boolean ifConvertPerformanceConsistencyWord = false;
+
+    private int leastRetNum = 6;
+}

+ 12 - 0
src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcRiskFreeDataDto.java

@@ -0,0 +1,12 @@
+package com.smppw.common.pojo.dto.calc;
+
+import com.smppw.common.pojo.dto.DateValue;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class IndicatorCalcRiskFreeDataDto {
+    private List<DateValue> riskFreeNavList = new ArrayList<>();
+}

+ 63 - 0
src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcSecDataDto.java

@@ -0,0 +1,63 @@
+package com.smppw.common.pojo.dto.calc;
+
+import com.smppw.common.pojo.dto.CompoundRet;
+import com.smppw.common.pojo.dto.DateValue;
+import com.smppw.common.pojo.enums.TrendType;
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class IndicatorCalcSecDataDto {
+    /**
+     * secId的净值序列
+     */
+    private List<DateValue> navList;
+
+    /**
+     * 没有归一的的净值序列
+     */
+    private List<DateValue> oriNavList;
+
+    /**
+     * secId的超额净值序列
+     */
+    private List<DateValue> extraNavList;
+
+    /**
+     * secId的回撤
+     */
+    private List<DateValue> drawdownList;
+
+    /**
+     * secId的收益序列
+     */
+    private List<CompoundRet> retList;
+
+    /**
+     * secId的超额收益序列-算术
+     */
+    private List<CompoundRet> extraRetAriList;
+
+    /**
+     * secId的超额收益序列-几何
+     */
+    private List<CompoundRet> extraRetGeoList;
+
+    /**
+     * 指标值, key-指标名称, value-指标值
+     */
+    private Map<String, String> indicatorValueMap = new HashMap<>();
+
+    /**
+     * 几何超额指标值, key-指标名称, value-指标值
+     */
+    private Map<String, String> extraGeoIndicatorValueMap = new HashMap<>();
+
+    /**
+     * 存放走势的结果集的map
+     */
+    private Map<TrendType, List<Double>> trendValueMap = new HashMap<>();
+}

+ 32 - 0
src/main/java/com/smppw/common/pojo/dto/calc/IndicatorCalcTimeRangeDto.java

@@ -0,0 +1,32 @@
+package com.smppw.common.pojo.dto.calc;
+
+import com.smppw.common.pojo.enums.TimeRange;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class IndicatorCalcTimeRangeDto {
+    private String id;
+    /**
+     * 开始日期-必传
+     */
+    private String startDate;
+    /**
+     * 结束日期-必传
+     */
+    private String endDate;
+    /**
+     * 必传
+     */
+    private TimeRange timeRange;
+    /**
+     * 周频和日频是前四天交易日序列, 又大到小,
+     */
+    private List<String> preDays;
+
+    private List<String> monthPreDays;
+
+    private List<String> monthLaterDays;
+
+}

+ 68 - 0
src/main/java/com/smppw/common/pojo/dto/indicator/CalcMultipleSecMultipleTimeRangeIndicatorReq.java

@@ -0,0 +1,68 @@
+package com.smppw.common.pojo.dto.indicator;
+
+import com.smppw.common.pojo.IStrategy;
+import com.smppw.common.pojo.enums.*;
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+@Data
+@Builder
+public class CalcMultipleSecMultipleTimeRangeIndicatorReq {
+    private List<String> mainSecIdList;
+    private Map<String, String> secBenchmarkIdMap;
+    private List<String> indexIdList;
+    private RaiseType raiseType;
+    private IStrategy strategy;
+    private Visibility visibility;
+    private Map<String, List<DateIntervalDto>> secDateIntervalDtoListMap;
+    private Frequency dataFrequency;
+    private NavType navType;
+    private List<Indicator> indicatorList;
+    private List<Indicator> geoExtraindicatorList;
+    private String riskOfFreeId;
+    private Double riskOfFreeValue;
+    private boolean ifAnnualize = true;
+    private boolean calcIndexRetIndicatorValue;
+    private boolean needRet;
+    private boolean needExtraRet;
+    private boolean ifConvertPerformanceConsistencyWord;
+    private boolean ifExtract;
+    private Integer userId;
+    private boolean combExtract;
+    private Integer combExtractCombId;
+
+    public CalcMultipleSecMultipleTimeRangeIndicatorReq() {
+    }
+
+    public CalcMultipleSecMultipleTimeRangeIndicatorReq(List<String> mainSecIdList, Map<String, String> secBenchmarkIdMap, List<String> indexIdList,
+                                                        RaiseType raiseType, IStrategy strategy, Visibility visibility, Map<String, List<DateIntervalDto>> secDateIntervalDtoListMap,
+                                                        Frequency dataFrequency, NavType navType, List<Indicator> indicatorList, List<Indicator> geoExtraindicatorList, String riskOfFreeId,
+                                                        Double riskOfFreeValue, boolean ifAnnualize, boolean calcIndexRetIndicatorValue, boolean needRet, boolean needExtraRet,
+                                                        boolean ifConvertPerformanceConsistencyWord, boolean ifExtract, Integer userId, boolean combExtract, Integer combExtractCombId) {
+        this.mainSecIdList = mainSecIdList;
+        this.secBenchmarkIdMap = secBenchmarkIdMap;
+        this.indexIdList = indexIdList;
+        this.raiseType = raiseType;
+        this.strategy = strategy;
+        this.visibility = visibility;
+        this.secDateIntervalDtoListMap = secDateIntervalDtoListMap;
+        this.dataFrequency = dataFrequency;
+        this.navType = navType;
+        this.indicatorList = indicatorList;
+        this.geoExtraindicatorList = geoExtraindicatorList;
+        this.riskOfFreeId = riskOfFreeId;
+        this.riskOfFreeValue = riskOfFreeValue;
+        this.ifAnnualize = ifAnnualize;
+        this.calcIndexRetIndicatorValue = calcIndexRetIndicatorValue;
+        this.needRet = needRet;
+        this.needExtraRet = needExtraRet;
+        this.ifConvertPerformanceConsistencyWord = ifConvertPerformanceConsistencyWord;
+        this.ifExtract = ifExtract;
+        this.userId = userId;
+        this.combExtract = combExtract;
+        this.combExtractCombId = combExtractCombId;
+    }
+}

+ 42 - 0
src/main/java/com/smppw/common/pojo/dto/indicator/DateIntervalDto.java

@@ -0,0 +1,42 @@
+package com.smppw.common.pojo.dto.indicator;
+
+import com.smppw.common.pojo.enums.DateIntervalType;
+import com.smppw.common.pojo.enums.Frequency;
+import com.smppw.common.pojo.enums.TimeRange;
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class DateIntervalDto {
+    private String id;
+
+    private String startDate;
+
+    private String endDate;
+
+    private TimeRange timeRange;
+
+    private DateIntervalType dateIntervalType;
+
+    private Integer windowOrNum;
+
+    private Integer step;
+
+    private Frequency frequency;
+
+    public DateIntervalDto() {
+    }
+
+    public DateIntervalDto(String id, String startDate, String endDate, TimeRange timeRange, DateIntervalType dateIntervalType,
+                           Integer windowOrNum, Integer step, Frequency frequency) {
+        this.id = id;
+        this.startDate = startDate;
+        this.endDate = endDate;
+        this.timeRange = timeRange;
+        this.dateIntervalType = dateIntervalType;
+        this.windowOrNum = windowOrNum;
+        this.step = step;
+        this.frequency = frequency;
+    }
+}

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

@@ -0,0 +1,13 @@
+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;
+}

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

@@ -0,0 +1,14 @@
+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;
+}

+ 12 - 0
src/main/java/com/smppw/common/pojo/dto/time/TimeIntervalDto.java

@@ -0,0 +1,12 @@
+package com.smppw.common.pojo.dto.time;
+
+import com.smppw.common.pojo.enums.TimeRange;
+import lombok.Data;
+
+@Data
+public class TimeIntervalDto {
+    private String id;
+    private String startDate;
+    private String endDate;
+    private TimeRange timeRange;
+}

+ 12 - 0
src/main/java/com/smppw/common/pojo/dto/time/TimeRollingDto.java

@@ -0,0 +1,12 @@
+package com.smppw.common.pojo.dto.time;
+
+import lombok.Data;
+
+@Data
+public class TimeRollingDto {
+    private String id;
+    private String startDate;
+    private String endDate;
+    private Integer rollingWindow;
+    private Integer rollingStep;
+}

+ 11 - 0
src/main/java/com/smppw/common/pojo/dto/time/TimeTrailingDto.java

@@ -0,0 +1,11 @@
+package com.smppw.common.pojo.dto.time;
+
+import lombok.Data;
+
+@Data
+public class TimeTrailingDto {
+    private String id;
+    private String endDate;
+    private Integer trailingStep;
+    private Integer trailingNum;
+}

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

@@ -0,0 +1,21 @@
+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);
+	}
+}

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

@@ -0,0 +1,62 @@
+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";
+
+
+}

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

@@ -0,0 +1,48 @@
+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;
+    }
+}

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

@@ -0,0 +1,71 @@
+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 "";
+    }
+
+}

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

@@ -0,0 +1,29 @@
+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);
+    }
+}

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

@@ -0,0 +1,24 @@
+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);
+	}
+}

+ 83 - 0
src/main/java/com/smppw/common/pojo/enums/CurveType.java

@@ -0,0 +1,83 @@
+package com.smppw.common.pojo.enums;
+
+import com.smppw.common.pojo.IStrategy;
+import com.smppw.common.pojo.enums.strategy.Strategy;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+
+/**
+ * @author zhengsongliang
+ */
+public enum CurveType {
+	PrivateComprehension(1), PrivateSubstratgy(2), PrivateRights(3), PublicComprehension(4), PublicSubstrategy(
+			5), PublicRights(6), BothComprehension(7), BothSubstratgy(8), BothRights(9);
+
+	private int id;
+
+	private CurveType(int id) {
+		this.id = id;
+	}
+
+	public int getId() {
+		return id;
+	}
+
+	public static CurveType getCurveType(int id) {
+		return Stream.of(CurveType.values()).filter(e -> e.id == id).findFirst().orElse(null);
+	}
+
+	public static final List<CurveType> SUBSTRATEGY = Arrays.asList(PrivateSubstratgy, PublicSubstrategy, BothSubstratgy);
+
+	//		Equity2(101, "股票","IN0000001C", "IN00000008"),
+//		OverseeFund(108, "海外","IN0000001C", "IN00000008"),
+//		Hybrid(102,"混合", "IN0000001J", "IN00000008"),
+//		Bond2(103, "债券","IN0000001H", "IN000002C0"),
+//		Cash(104,"货币", "IN0000001H", "IN000002C0"),
+//		Commodity(105, "商品","IN0000001E", "IN0000001A"),
+//		MarketNeutral(106, "市场中性","IN0000001G", "IN00000008"),
+//		FOF(107, "FOF","IN0000001G", "IN00000008"),
+//		Others2(-100, "其他","", "");
+	private static final List<Strategy> mutualFundStrategy = Arrays.asList(Strategy.Equity2, Strategy.OverseeFund, Strategy.Hybrid, Strategy.Bond2,
+			Strategy.Cash, Strategy.Commodity, Strategy.MarketNeutral, Strategy.FOF, Strategy.Others2);
+
+	public static CurveType getCurveType(RaiseType raiseType, IStrategy strategy) {
+		if (strategy instanceof Strategy) {
+			if (mutualFundStrategy.contains(strategy))
+				return PublicSubstrategy;
+
+			if (strategy == Strategy.All) {
+				if (raiseType == RaiseType.Private)
+					return PrivateComprehension;
+				else if (raiseType == RaiseType.Public)
+					return PublicComprehension;
+				else
+					return BothComprehension;
+			}
+			if (strategy == Strategy.Rights) {
+				// 原本权益类策略
+				if (raiseType == RaiseType.Private)
+					return PrivateRights;
+				else if (raiseType == RaiseType.Public)
+					return PublicRights;
+				else
+					return BothRights;
+			}else {
+				if (raiseType == RaiseType.Private)
+					return PrivateSubstratgy;
+				else if (raiseType == RaiseType.Public)
+					return PublicSubstrategy;
+				else
+					return BothSubstratgy;
+			}
+		}else {
+			if (raiseType == RaiseType.Private)
+				return PrivateSubstratgy;
+			else if (raiseType == RaiseType.Public)
+				return PublicSubstrategy;
+			else
+				return BothSubstratgy;
+		}
+	}
+}

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

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

+ 33 - 0
src/main/java/com/smppw/common/pojo/enums/DateIntervalType.java

@@ -0,0 +1,33 @@
+package com.smppw.common.pojo.enums;
+
+public enum DateIntervalType {
+    /**
+     * 默认滚动  历史收益, 滚动收益的周, 月, 年  , 此类滚动是前后收尾相接的
+     */
+    DefaultRolling,
+
+    /**
+     * 自定义滚动 例子 区间收益的单窗口, 滚动收益的自定义   是需要选择窗口和步长的这种
+     */
+    CustomRolling,
+
+    /**
+     * 自定义区间 例子  就是选择好了开始日期 结束日期 或者是选择好了 结束日期和timerange的这种
+     */
+    CustomInterval,
+
+    /**
+     * 回溯区间   例子  区间收益的回溯窗口
+     */
+    TrailingInterval,
+
+    /**
+     * 默认区间  例子 区间收益的默认区间
+     */
+    DefaultInterval,
+
+    /**
+     * 所有的区间
+     */
+    AllInterval;
+}

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

@@ -0,0 +1,31 @@
+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;
+    }
+}

+ 110 - 0
src/main/java/com/smppw/common/pojo/enums/Frequency.java

@@ -0,0 +1,110 @@
+package com.smppw.common.pojo.enums;
+
+import cn.hutool.core.collection.CollUtil;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @author Yu Liu
+ */
+public enum Frequency {
+    /**
+     * 日频
+     */
+    Daily(1, "d", 252, "日频", "天"),
+    /**
+     * 周频
+     */
+    Weekly(2, "w", 52, "周频", "周"),
+    /**
+     * 月频
+     */
+    Monthly(3, "m", 12, "月频", "月"),
+    /**
+     * 季频
+     */
+    Quarterly(4, "q", 4, "季频", "季"),
+    /**
+     * 半年频
+     */
+    SemiAnnually(5, "s", 2, "半年频", "半年"),
+    /**
+     * 年频
+     */
+    Annually(6, "y", 1, "年频", "年"),
+    /**
+     * 实际频率
+     */
+    Default(0, "def", -1, "实际频率", "实际频率");
+
+    private final int id;
+    private final String shortName;
+    private final double num;
+    private final String desc;
+
+    private final String navFrequencyName;
+
+    Frequency(int id, String shortName, double num, String desc, String navFrequencyName) {
+        this.id = id;
+        this.shortName = shortName;
+        this.num = num;
+        this.desc = desc;
+        this.navFrequencyName = navFrequencyName;
+    }
+
+    public static Frequency getFrequency(String shortName) {
+        return Stream.of(Frequency.values()).filter(e -> e.shortName.equals(shortName)).findFirst().orElse(null);
+    }
+
+    /**
+     * 根据指定频率id获取对应的频率
+     * @param id 频率id
+     * @return /
+     */
+    public static Frequency getFrequency(int id) {
+        return Stream.of(Frequency.values()).filter(e -> e.getId() == id).findFirst().orElse(null);
+    }
+
+    public static Frequency getFrequencyByDesc(String desc) {
+        return Stream.of(Frequency.values()).filter(e -> e.desc.equals(desc)).findFirst().orElse(null);
+    }
+
+    /**
+     * 获取
+     * 
+     * @param frequency
+     *            给定频率
+     * @return /
+     */
+    public static List<Frequency> getThanTargetFreq(Frequency frequency) {
+        List<Frequency> res = CollUtil.newArrayList();
+        if (frequency == null) {
+            return res;
+        }
+        return Stream.of(Frequency.values())
+            .filter(e -> e != Frequency.Default && e.getId() >= frequency.getId() && e.getId() > 1)
+            .collect(Collectors.toList());
+    }
+
+    public double getNum() {
+        return num;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public String getShortName() {
+        return shortName;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public String getNavFrequencyName() {
+        return navFrequencyName;
+    }
+}

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

@@ -0,0 +1,50 @@
+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 "";
+    }
+
+}

+ 367 - 0
src/main/java/com/smppw/common/pojo/enums/Indicator.java

@@ -0,0 +1,367 @@
+package com.smppw.common.pojo.enums;
+
+import java.util.ArrayList;
+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 Indicator {
+
+	/**
+	 * 业绩可持续性指标,用净值计算
+	 */
+	HURST(120),
+
+	/** 区间收益(%)用净值计算 */
+	IntervalReturn(1),
+
+	/**IRR: Internal Rate of Return内部收益率,即累计NPV=0时的折现率, IRR为定期,XIRR不受限制*/
+	XIRR(-998),
+
+	/** 年化收益(%)(几何) */
+	AnnualReturn(39),
+	/** 年化标准差(%) */
+	AnnualStdDev(10),
+	/** 超额收益(%) */
+	ExcessReturn(60),
+	/**
+	 * 超额收益 几何
+	 */
+	ExcessReturnRealTimeCalc(69),
+	/** 最大回撤(%) */
+	MaxDrawdown(2),
+
+	/** 最大回撤区间月份数 */
+	MaxDrawdownInterval(50),
+	/** 最大回撤修复日期 */
+	MaxDrawdownRecureDate(8),
+	/** 最大回撤修复月份数 */
+	MaxDrawdownRecureInterval(52),
+	/** 最大回撤修复天数 */
+	MaxDrawdownRecureIntervalDays(76),
+
+	/** 最大回撤修波峰日期 added by xjs*/
+	MaxDrawdownPeakDate(63),
+	/** 最大回撤波谷日期  added by xjs*/
+	MaxDrawdownValleyDate(64),
+
+	/** 贝塔 */
+	Beta(12),
+	/** 阿尔法(%) */
+	Alpha(11),
+	/** 上行捕获率 */
+	UpCaptureRatio(35),
+	/** 下行捕获率 */
+	DownCaptureRatio(36),
+	/** 上行捕获收益率(%) */
+	UpCaptureReturn(33),
+	/** 下行捕获收益率(%) */
+	DownCaptureReturn(34),
+	/** 下行风险(%) */
+	DownsideStdDev(21),
+	/** 夏普比率 */
+	SharpeRatio(18),
+	/** 索提诺比率 */
+	SortinoRatio(58),
+	/** 索提诺比率(MAR) */
+	SortinoRatioMAR(19),
+	/** 特雷诺比率 */
+	TreynorRatio(15),
+	/** 欧米伽比率 */
+	Omega(17),
+	/** 卡帕比率 */
+	Kappa(14),
+	/** 卡玛比率 */
+	CalmarRatio(40),
+	/** 信息比率 */
+	InformationRatio(38),
+	/** 偏度 */
+	Skewness(9),
+	/** 峰度 */
+	Kurtosis(6),
+	/** SMDD模型VaR(%) */
+	SMDDVaR(43),
+	/** SMDD模型CVaR(%) */
+	SMDDCVaR(44),
+	/** 历史VaR(%) */
+	HistoricalVaR(41),
+	/** 历史CVaR(%) */
+	HistoricalCVaR(42),
+	/** SMDD模型LPM1(%) */
+	SMDDLPM1(45),
+	/** SMDD模型LPM2(%) */
+	SMDDLPM2(46),
+	/** SMDD模型下行偏差(%) */
+	DownsideDeviation(47),
+	/** 詹森指数(%) */
+	Jensen(16),
+	/** M2(%) */
+	M2(49),
+	/** 跟踪误差(%) */
+	TrackingError(48),
+	/** 区间收益(%)用收益计算 */
+	RangeReturn(-1),
+	/** 业绩持续性 */
+	PerformanceConsistency(37),
+	/** 胜率(%) */
+	WinRate(59),
+	/** 胜率-基于0(%) */
+	WinRateWithZero(59),
+	/** 年化收益(%)(算术) */
+	AnnualReturnAlg(-2),
+	/** 基金评级 */
+	FundRating(9999),
+	/** 单月最大下跌(%) */
+	SingleMaxDrawdown(61),
+	/** 最大连续下跌月份数(%) */
+	MaxContinuouslyDrawdownCount(62),
+
+	/** 超额收益最大回撤(%) */
+	ExcessReturnMaxDrawdown(75),
+	/** 超额收益夏普比率 */
+	ExcessReturnSharpeRatio(72),
+
+	/**
+	 * 最好月份收益
+	 */
+	BestRetMonthly(101),
+
+	/**
+	 * 最好周份收益
+	 */
+	BestRetWeekly(102),
+
+	/**
+	 * 最差月份收益
+	 */
+	WorstRetMonthly(103),
+
+	/**
+	 * 最差周份收益
+	 */
+	WorstRetWeekly(104),
+
+	/**
+	 * 盈亏比
+	 */
+	ProfitLossRatio(5),
+
+	/** 历史VaR(90%) */
+	HistoricalVaR90(106),
+	/** 历史CVaR(90%) */
+	HistoricalCVaR90(107),
+	/** 历史VaR(95%) */
+	HistoricalVaR95(108),
+	/** 历史CVaR(95%) */
+	HistoricalCVaR95(109),
+	/** 历史VaR(99%) */
+	HistoricalVaR99(110),
+	/** 历史CVaR(99%) */
+	HistoricalCVaR99(111),
+	/**
+	 * 超额夏普比率 -- 几何算法(超额净值)
+	 */
+	ExcessReturnSharpeRatioExtra(72),
+	/**
+	 * 超额年化标准差
+	 */
+	ExcessReturnAnnualStdDevExtra(71),
+
+	/**
+	 * 超额最大回撤修复日期
+	 */
+	ExcessReturnMaxDrawdownRecureDateExtra(114),
+
+	/**
+	 * 超额最大回撤修复数
+	 */
+	ExcessReturnMaxDrawdownRecureIntervalExtra(115),
+
+	/**
+	 * 超额卡玛
+	 */
+	ExcessReturnCalmarRatio(73),
+
+	/**
+	 * 超额索提诺
+	 */
+	ExcessReturnSortinoRatio(78),
+
+	/**
+	 * 超额下行风险
+	 */
+	ExcessReturnDownsideStdDev(74),
+
+	/**
+	 * 最长连续不创新高天数
+	 */
+	LongestNoNewHighDays(67),
+
+	/**
+	 * 超额最长连续不创新高天数
+	 */
+	ExcessReturnLongestNoNewHighDays(77),
+
+	//年化超额收益
+	ExcessReturnAnnualized(70),
+
+	//算术超额区间收益
+	ExcessAriIntervalReturn(68),
+
+	//算术超额区间收益
+	ExcessAnnualAriIntervalReturn(80);
+
+//	//年度超额收益
+//	ExcessReturnAnnual(64),
+//	//区间超额收益
+//	ExcessReturnInterval(65),
+//	//月度超额收益
+//	ExcessReturnMonthly(66),
+//	//季度超额收益
+//	ExcessReturnQuarterly(67);
+
+	private int id;
+
+	private Indicator(int id) {
+		this.id = id;
+	}
+
+	public int getId() {
+		return id;
+	}
+
+	public static Frequency getValidFreq(Frequency dataSource, Frequency frequency, Indicator indicator) {
+//		if (TYPES_RELATE_TO_MAXDRAWDOWN.contains(indicator))
+//			dataSource = Frequency.Daily;
+		return TYPES_NEED_NAV.contains(indicator) ? dataSource : frequency;
+	}
+
+	public static Frequency getValidRankFreq(Frequency dataSource, Frequency frequency, Indicator indicator) {
+		Frequency freq = getValidFreq(dataSource, frequency, indicator);
+		return freq;
+	}
+
+	public static Indicator getIndicator(int id) {
+		return Stream.of(Indicator.values()).filter(e -> e.id == id).findFirst().orElse(null);
+	}
+
+	public static Indicator getIndicatorByName(String indicatorStr) {
+		if (null == indicatorStr){
+			return null;
+		}
+		for (Indicator indicator : Indicator.values()) {
+			if (indicatorStr.equals(indicator.name())) {
+				return indicator;
+			}
+		}
+		return null;
+	}
+
+	public final static List<Indicator> INDICATOR_TYPE_ARRAY = Arrays.asList(IntervalReturn, AnnualReturn, AnnualStdDev,
+			DownsideStdDev, Skewness, Kurtosis, Alpha, Beta, SharpeRatio, InformationRatio, CalmarRatio, Kappa,
+			SortinoRatio, SortinoRatioMAR, Omega, TreynorRatio, Jensen, M2, WinRateWithZero, TrackingError, MaxDrawdown,
+			MaxDrawdownInterval, MaxDrawdownRecureDate, MaxDrawdownRecureInterval, MaxDrawdownPeakDate, MaxDrawdownValleyDate,
+			HistoricalVaR, HistoricalCVaR, HURST,
+			SMDDVaR, SMDDCVaR, SMDDLPM1, SMDDLPM2, DownsideDeviation, PerformanceConsistency, UpCaptureRatio,
+			DownCaptureRatio, UpCaptureReturn, DownCaptureReturn, LongestNoNewHighDays, MaxDrawdownRecureIntervalDays, ProfitLossRatio);
+
+	public final static List<Indicator> INTEGER_VALUE_ARRAY = Arrays.asList(MaxDrawdownRecureIntervalDays, LongestNoNewHighDays, MaxDrawdownRecureInterval, MaxDrawdownInterval);
+
+	public final static List<Indicator> RISK_TABLE_EXCESS_INDICATOR_ARRAY = Arrays.asList(IntervalReturn, WinRate,
+			AnnualReturn, SharpeRatio, SortinoRatio, MaxDrawdown, AnnualStdDev, MaxDrawdownInterval, MaxDrawdownRecureDate,
+			MaxDrawdownRecureIntervalDays, LongestNoNewHighDays, CalmarRatio, DownsideStdDev);
+
+	public final static List<Indicator> INDICATOR_EXCESS_RETURN_TYPE_ARRAY = Arrays.asList(ExcessReturnRealTimeCalc,
+			ExcessReturnAnnualized, ExcessReturnLongestNoNewHighDays, ExcessReturnSharpeRatioExtra, ExcessReturnCalmarRatio,
+			ExcessReturnSortinoRatio, ExcessReturnMaxDrawdown, ExcessReturnAnnualStdDevExtra, ExcessReturnDownsideStdDev, ExcessReturnMaxDrawdownRecureIntervalExtra);
+
+	/** 依赖净值计算的指标 */
+	public final static List<Indicator> TYPES_NEED_NAV = Arrays.asList(MaxDrawdown, MaxDrawdownInterval, HURST,PerformanceConsistency,
+			MaxDrawdownRecureDate, MaxDrawdownRecureInterval, MaxDrawdownPeakDate, MaxDrawdownValleyDate, ExcessReturnMaxDrawdown,
+			CalmarRatio, ExcessReturnCalmarRatio, IntervalReturn, ExcessReturnRealTimeCalc, AnnualReturn, ExcessReturnAnnualized
+			,MaxDrawdownRecureIntervalDays,ExcessReturnMaxDrawdownRecureIntervalExtra,LongestNoNewHighDays);
+
+	/** 最大回撤相关的指标 */
+	public final static List<Indicator> TYPES_RELATE_TO_MAXDRAWDOWN = Arrays.asList(MaxDrawdown, MaxDrawdownInterval,
+			MaxDrawdownRecureDate, MaxDrawdownPeakDate, MaxDrawdownValleyDate, MaxDrawdownRecureInterval);
+
+	/** 依赖基准的指标 */
+	public final static List<Indicator> TYPES_NEED_BENCHMARK = Arrays.asList(UpCaptureRatio, UpCaptureReturn,
+			DownCaptureRatio, DownCaptureReturn, Beta, Alpha, TrackingError, WinRate, InformationRatio, Jensen, ExcessReturn,
+			ExcessReturnMaxDrawdown, ExcessReturnSharpeRatio, ExcessReturnSharpeRatioExtra);
+
+	/** 依赖无风险收益的指标 */
+	public final static List<Indicator> TYPES_NEED_RISK_OF_FREE = Arrays.asList(SharpeRatio, Kappa, SortinoRatio,
+			SortinoRatioMAR, Omega, TreynorRatio, M2, Jensen, ExcessReturnSharpeRatio, ExcessReturnSharpeRatioExtra);
+
+	/** 同策略指标 */
+	public final static List<Indicator> SAME_STRATEGY = Arrays.asList(IntervalReturn, UpCaptureRatio, UpCaptureReturn,
+			DownCaptureRatio, DownCaptureReturn, Alpha, SharpeRatio, InformationRatio, Kappa, SortinoRatio,
+			SortinoRatioMAR, Omega, TreynorRatio, CalmarRatio, Jensen, M2, ProfitLossRatio);
+
+	/** 收益指标 */
+	public final static List<Indicator> TYPES_RET = Arrays.asList(IntervalReturn, AnnualReturn);
+
+	/** 年化的指标 */
+	public final static List<Indicator> ANNUAL_INDICATOR = Arrays.asList(AnnualStdDev, AnnualReturn, AnnualReturnAlg);
+
+	public final static List<Indicator> SORT_FROM_SMALL_TO_LARGE_INDICATOR = Arrays.asList(AnnualStdDev, Beta, Skewness, Kurtosis, TrackingError,
+			HistoricalVaR, HistoricalCVaR, SMDDVaR, SMDDCVaR, SMDDLPM1, SMDDLPM2, DownsideDeviation, DownsideStdDev);
+
+	public final static List<Indicator> NEED_SKIP_HOLIDAY = Arrays.asList(IntervalReturn,AnnualReturn,ExcessReturn,ExcessReturnRealTimeCalc);
+
+	//动态列使用了的超额指标
+	public final static List<Indicator> DYNAMIC_LIST_EXCESS_INDICATOR = Arrays.asList(ExcessReturn,ExcessReturnSharpeRatio,ExcessReturnMaxDrawdown, ExcessReturnRealTimeCalc);
+
+	public static List<Indicator> getNeedNavIndicators(List<Indicator> list) {
+		List<Indicator> res = new ArrayList<>();
+		for (Indicator indicator : list) {
+			if (Indicator.TYPES_NEED_NAV.contains(indicator)) {
+				res.add(indicator);
+			}
+		}
+		return res;
+	}
+
+	public static boolean needNav(List<Indicator> list) {
+		for (Indicator indicator : list) {
+			if (TYPES_NEED_NAV.contains(indicator)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public static boolean needRet(List<Indicator> list) {
+		List<Indicator> temp = new ArrayList<>(list);
+		temp.removeAll(TYPES_NEED_NAV);
+		return temp.isEmpty() ? false : true;
+	}
+
+	public static boolean needBmk(List<Indicator> list) {
+		for (Indicator indicator : list) {
+			if (TYPES_NEED_BENCHMARK.contains(indicator)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public static boolean needRf(List<Indicator> list) {
+		for (Indicator indicator : list) {
+			if (TYPES_NEED_RISK_OF_FREE.contains(indicator)) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public static boolean needStrategy(List<Indicator> list) {
+		return list.contains(PerformanceConsistency);
+	}
+}
+

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

@@ -0,0 +1,274 @@
+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;
+    }
+}

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

@@ -0,0 +1,25 @@
+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;
+	}
+
+}

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

@@ -0,0 +1,29 @@
+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;
+    }
+}

+ 36 - 0
src/main/java/com/smppw/common/pojo/enums/NavType.java

@@ -0,0 +1,36 @@
+package com.smppw.common.pojo.enums;
+
+/**
+ * @author zhengsongliang
+ */
+public enum NavType {
+	/**分红再投*/
+	CumulativeNav(1,"复权净值"),
+	/**分红不投*/
+	WithdrawalNav(2,"累计净值"),
+	/**原始净值*/
+	OriginalNav(3,"单位净值"),
+	/**单位与分红再投净值*/
+	UnitAndCumulativeNav(5,"单位与分红再投净值"),
+	/**
+	 * 全部
+	 */
+	All(4,"全部");
+
+
+	private final int id;
+	private final String desc;
+
+	NavType(int id, String desc) {
+		this.id = id;
+		this.desc = desc;
+	}
+
+	public int getId() {
+		return id;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

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

@@ -0,0 +1,32 @@
+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;
+    }
+}

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

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

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

@@ -0,0 +1,27 @@
+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;
+	}
+}

+ 78 - 0
src/main/java/com/smppw/common/pojo/enums/RaiseType.java

@@ -0,0 +1,78 @@
+package com.smppw.common.pojo.enums;
+
+
+import com.smppw.common.pojo.enums.strategy.Strategy;
+
+/**
+ * @author zhengsongliang
+ */
+public enum RaiseType {
+	Private(1), Public(2), Both(3), Comb(4);//组合
+	private int id;
+
+	private RaiseType(int id) {
+		this.id = id;
+	}
+
+	public int getId() {
+		return id;
+	}
+
+	public static RaiseType getRaiseType(int id) {
+		//		return Stream.of(RaiseType.values()).filter(e -> e.id == id).findFirst().orElse(null);
+		if (Private.id == id)
+			return Private;
+		if (Public.id == id)
+			return Public;
+		if (Both.id == id)
+			return Both;
+		return null;
+	}
+	
+	public static RaiseType getRaiseType(String id) {
+		if (null == id)
+			return null;
+		// Private(1), Public(2), Both(3);
+		if ("1".equals(id))
+			return Private;
+		if ("2".endsWith(id))
+			return Public;
+		if ("3".equals(id))
+			return Both;
+		return null;
+	}
+
+	public static RaiseType getRaiseType(CurveType curveType, Strategy strategy) {
+		if (strategy == Strategy.All) {
+			if (curveType == CurveType.PrivateComprehension)
+				return Private;
+			if (curveType == CurveType.PublicComprehension)
+				return Public;
+			
+			return Both;
+		}
+
+		if (strategy == Strategy.Rights) {
+			if (curveType == CurveType.PrivateRights)
+				return Private;
+			if (curveType == CurveType.PublicRights)
+				return Public;
+
+			return Both;
+		} else {
+			if (curveType == CurveType.PrivateSubstratgy)
+				return Private;
+
+			if (curveType == CurveType.PublicSubstrategy)
+				return Public;
+
+			return Both;
+		}
+	}
+
+	public static RaiseType getRaiseType(int curveTypeId, int strategyId) {
+		CurveType curveType = CurveType.getCurveType(curveTypeId);
+		Strategy strategy = Strategy.getStrategy(strategyId);
+		return getRaiseType(curveType, strategy);
+	}
+}

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

@@ -0,0 +1,61 @@
+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;
+    }
+}

+ 194 - 0
src/main/java/com/smppw/common/pojo/enums/TimeRange.java

@@ -0,0 +1,194 @@
+package com.smppw.common.pojo.enums;
+
+import cn.hutool.core.map.MapUtil;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public enum TimeRange {
+
+	Custom(-1, "custom", "Custom", "Custom"), /**/
+	FromThisMonth(-2, "1m", "ma-0", "ma-0"), /**/
+	FromThisQuarter(-3, "1q", "qa-0", "qa-0"), /**/
+	FromThisYear(13, "ytd", "ya-0", "ytd"), /**/
+	Last1Week(0.25, "1w", "wa-1", "wb-1"), /**/
+	Last1Month(1, "1m", "ma-1", "mb-1"), /**/
+	Last2Months(2, "1m", "ma-2", "mb-2"), /**/
+	Last3Months(3, "3m", "ma-3", "mb-3"), /**/
+	LastHalfYear(6, "6m", "ma-6", "mb-6"), /**/
+	Last1Year(12, "1y", "ya-1", "yb-1"), /**/
+	Last2Years(24, "2y", "ya-2", "yb-2"), /**/
+	Last3Years(36, "3y", "ya-3", "yb-3"), /**/
+	Last4Years(48, "4y", "ya-4", "yb-4"), /**/
+	Last5Years(60, "5y", "ya-5", "yb-5"), /**/
+	Last10Years(120, "10y", "ya-10", "yb-10"), /**/
+	FromSetup(0, "incep", "FromSetup", "FromSetup"),
+	Operation(-10, "operation", "Operation", ""),
+	ThisWeek(1002, "tw", "tw-1", ""),
+	ThisMonth(1003, "tm", "tm-1", ""),
+	ThisQuarter(1004, "tq", "tq-1", ""),
+	Last1RollYear(1005, "1ry", "ya-1-r", "yb-1-r"), /**/
+	Last2RollYears(1006, "2ry", "ya-2-r", "yb-2-r"), /**/
+	Last3RollYears(1007, "3ry", "ya-3-r", "yb-3-r"), /**/
+	Last4RollYears(1008, "4ry", "ya-4-r", "yb-4-r"), /**/
+	Last5RollYears(1009, "5ry", "ya-5-r", "yb-5-r") /**/;
+
+	private double id;
+	private String symbel;
+	private String floatDateSymbel;
+	private String amacSymbel;
+
+	public static final List<TimeRange> TRAILING_DATES = Arrays.asList(FromThisYear, Last1Week, Last1Month, Last3Months,
+			LastHalfYear, Last1Year, Last2Years, Last3Years, Last5Years, FromSetup);
+
+	public static final List<TimeRange> TRAILING_DATES_WITH_TEN_YEARS = Arrays.asList(FromThisYear, Last1Week,
+			Last1Month, Last3Months, LastHalfYear, Last1Year, Last2Years, Last3Years, Last5Years, Last10Years,
+			FromSetup);
+
+	public static final List<TimeRange> STRATEHGY_AVG_DATES = Arrays.asList(FromThisYear, Last1Month, Last3Months,
+			LastHalfYear, Last1Year, Last2Years, Last3Years, Last5Years, Last10Years);
+
+	public static final List<TimeRange> ROLLING_TIMERANGE = Arrays.asList(ThisWeek, ThisMonth, ThisQuarter, Last1RollYear, Last2RollYears, Last3RollYears, Last4RollYears, Last5RollYears);
+
+	public static final List<TimeRange> YEAR_ROLLING_TIMERANGE = Arrays.asList(Last1RollYear, Last2RollYears, Last3RollYears, Last4RollYears, Last5RollYears);
+
+	/**
+	 * 私募观察-主策略指数使用时段
+	 */
+	public static final List<TimeRange> STRATEGY_INDEX_DATES = Arrays.asList(Last1Week, Last1Month, Last3Months,
+			LastHalfYear, FromThisYear, Last1Year, Last2Years, Last3Years, Last5Years, FromSetup, Last10Years);
+
+	public static final List<TimeRange> TIMERANGE_LIST = Arrays.asList(LastHalfYear, FromThisYear, Last1Year, Last2Years, Last3Years, Last5Years, FromSetup);
+
+	/**
+	 * 排排网风格总览
+	 */
+	public static final Map<TimeRange, String> RZ_STYLE_TIMERANGE = MapUtil.<TimeRange, String>builder(MapUtil.newHashMap(true))
+			.put(Last1Year, "近一年")
+			.put(Last2Years, "近两年")
+			.put(Last3Years, "近三年")
+			.put(FromSetup, "成立以来")
+			.build();
+
+	public static final Map<TimeRange, String> COR_DATES = MapUtil.<TimeRange, String>builder(MapUtil.newHashMap(true))
+			.put(FromThisYear, "今年以来")
+			.put(Last3Months, "近三月")
+			.put(LastHalfYear, "近六月")
+			.put(Last1Year, "近一年")
+			.put(Last2Years, "近二年")
+			.put(Last3Years, "近三年")
+			.put(Last5Years, "近五年")
+			.put(Last10Years, "近十年")
+			.put(FromSetup, "成立以来")
+			.build();
+
+	public static final Map<TimeRange, String> INDEX_INDICATOR_DATES = MapUtil.<TimeRange, String>builder(MapUtil.newHashMap(true))
+			.put(Last1Week,"近一周")
+			.put(Last1Month, "近一月")
+			.put(Last3Months, "近三月")
+			.put(LastHalfYear, "近六月")
+			.put(Last1Year, "近一年")
+			.put(Last2Years, "近二年")
+			.put(Last3Years, "近三年")
+			.put(Last5Years, "近五年")
+			.put(Last10Years, "近十年")
+			.put(FromThisYear, "今年以来")
+			.put(FromSetup, "成立以来")
+			.put(Custom, "统计区间")
+			.build();
+
+	public static final Map<TimeRange, String> RANGE_INDICATOR_DATES = MapUtil.<TimeRange, String>builder(MapUtil.newHashMap(true))
+			.put(FromThisYear, "今年以来")
+			.put(Last1Week, "近一周")
+			.put(Last1Month, "近一月")
+			.put(Last3Months, "近三月")
+			.put(LastHalfYear, "近半年")
+			.put(Last1Year, "近一年")
+			.put(Last2Years, "近二年")
+			.put(Last3Years, "近三年")
+			.put(Last5Years, "近五年")
+			.put(Custom,"对比区间")
+			.build();
+
+	private TimeRange(double id, String symbel, String floatDateSymbel, String amacSymbel) {
+		this.id = id;
+		this.symbel = symbel;
+		this.floatDateSymbel = floatDateSymbel;
+		this.amacSymbel = amacSymbel;
+	}
+
+	public double getId() {
+		return id;
+	}
+
+	public String getFloatDateSymbel() {
+		return floatDateSymbel;
+	}
+
+	public String getSymbel() {
+		return symbel;
+	}
+
+	public String getAmacSymbel() {
+		return amacSymbel;
+	}
+
+	public static TimeRange getTimeRange(double id) {
+		return Stream.of(values()).filter(e -> e.id == id).findFirst().orElse(null);
+	}
+
+	public static TimeRange getTimeRange(String floatDateSymbel) {
+		return Stream.of(values()).filter(e -> e.floatDateSymbel.equals(floatDateSymbel)).findFirst().orElse(null);
+	}
+
+	public static TimeRange getTimeRangeBySmbel(String symbel) {
+		return Stream.of(values()).filter(e -> e.symbel.equals(symbel)).findFirst().orElse(null);
+	}
+
+	public static TimeRange getTimeRangeByFsOrAsOrS(String date) {
+		TimeRange tr = null;
+		TimeRange[] values = TimeRange.values();
+		for (TimeRange timeRange : values) {
+			if (timeRange.getFloatDateSymbel().equals(date) || timeRange.getAmacSymbel().equals(date) || timeRange.getSymbel().equals(date)) {
+				tr = timeRange;
+				break;
+			}
+		}
+		return tr;
+	}
+
+	public static TimeRange getTimeRangeByName(String name) {
+		TimeRange tr = null;
+		TimeRange[] values = TimeRange.values();
+		for (TimeRange timeRange : values) {
+			if (timeRange.name().equals(name)){
+				tr = timeRange;
+				break;
+			}
+		}
+		return tr;
+	}
+
+	public static List<String> timeRanges2StringList(List<TimeRange> trs) {
+		List<String> tsStrList = new ArrayList<>();
+		for (TimeRange tr : trs) {
+			tsStrList.add(tr.toString());
+		}
+		return tsStrList;
+	}
+
+	public static List<String> getSymbels(List<TimeRange> timeRanges) {
+		List<String> res = new ArrayList<>(timeRanges.size());
+		for (TimeRange timeRange : timeRanges) {
+			res.add(timeRange.getSymbel());
+		}
+		return res;
+	}
+}

+ 66 - 0
src/main/java/com/smppw/common/pojo/enums/TrendType.java

@@ -0,0 +1,66 @@
+package com.smppw.common.pojo.enums;
+
+import java.util.Arrays;
+import java.util.List;
+
+public enum TrendType {
+    /**
+     * 净值走势
+     */
+    Nav(1),
+
+    /**
+     * 收益走势
+     */
+    Ret(2),
+
+    /**
+     * 超额净值走势
+     */
+    ExtraNav(3),
+
+    /**
+     * 超额算术收益走势
+     */
+    ExtraRetAri(4),
+
+    /**
+     * 超额几何收益走势
+     */
+    ExtraRetGeo(5),
+
+    /**
+     * 回撤走势
+     */
+    DrawdownTrend(6),
+
+    /**
+     * 超额回撤走势
+     */
+    ExtraDrawdownTrend(7),
+
+    /**
+     * 净值变化率
+     */
+    NetValueChange(8),
+
+    /**
+     * 净值变化率
+     */
+    OrigNav(9);
+
+    private int id;
+    private TrendType(int id) {
+        this.id = id;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public static final List<TrendType> TABLE_TREND_LIST = Arrays.asList(Nav, ExtraNav, Ret, NetValueChange, DrawdownTrend, ExtraDrawdownTrend, OrigNav);
+
+    public static final List<TrendType> RET_LIST = Arrays.asList(Ret, ExtraRetAri, ExtraRetGeo);
+
+    public static final List<TrendType> NAV_LIST = Arrays.asList(Nav, ExtraNav);
+}

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

@@ -0,0 +1,24 @@
+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);
+	}
+	
+}

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

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

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

@@ -0,0 +1,23 @@
+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);
+	}
+}

+ 126 - 0
src/main/java/com/smppw/common/pojo/enums/status/ResultCode.java

@@ -0,0 +1,126 @@
+package com.smppw.common.pojo.enums.status;
+
+import lombok.Getter;
+
+/**
+ * @author Administrator
+ */
+
+@Getter
+public enum ResultCode implements StatusCode {
+    /**
+     * 请求成功
+     */
+    SUCCESS(20000, ""),
+    /**
+     * 参数错误
+     */
+    VALIDATE_ERROR(20005, "参数校验失败"),
+    ARGS_NOT_READABLE_ERROR(200020, "参数类型不匹配"),
+
+    /**
+     * 请求失败
+     */
+    COMMON_ERROR(20006, "请求失败"),
+    /**
+     * 权限不足
+     */
+    PERMISSION_DENIED(20004, "拒绝访问"),
+    /**
+     * 用户名或密码错误
+     */
+    AUTH_FAILD(20003, "用户名或密码错误"),
+    /**
+     * 用户名或密码错误
+     */
+    LOGIN_TIME_OUT(401, "登录已过期,请重新登录"),
+    /**
+     * 用户不存在
+     */
+    USER_NOT_EXIST(20007, "用户不存在"),
+
+    DEL_GROUP_PERMISSION_PLAN_FAILED(20000, "不可删除,已有团队配置该权限方案,请将相关团队变更权限方案后删除此权限方案"),
+
+    DEL_PERSON_PERMISSION_PLAN_FAILED(20000, "不可删除,已有用户配置该权限方案,请将相关用户变更权限方案后删除此权限方案"),
+
+    PERMISSION_PLAN_FAILED_DONT_EXIST(20009, "当前方案不存在"),
+
+    DEL_DEFAULT_PERMISSION_PLAN_FAILED(20000, "当前方案为默认方案,删除失败"),
+
+    CREATE_NEW_GROUP_FAILED(20010, "已存在相同名称的团队,请修改名称"),
+
+    NEW_PERMISSION_PLAN_IS_NULL(20011, "当前选择的权限方案为空,请重新选择权限方案"),
+
+    EDIT_USER_GROUP_FAILED(20012, "该用户为当前所在团队的最后一位管理员,更换团队失败"),
+
+    PERMISSION_PLAN_NAME_EXIST(20013, "方案名重复,请重新输入"),
+
+    EDIT_USER_ROLE_FAILED(20014, "该用户为当前所在团队的最后一位管理员,更换角色失败"),
+
+    DEL_ROLE_FAILED(20000, "该角色已关联至如下用户:{},请解除该角色与以上用户关联后再删除角色。"),
+
+    ROLE_NAME_EXIST(20016, "角色名称不可重复"),
+
+    COLUMN_NAME_EXIST(20017, "模板列名称不可重复"),
+
+    TEMPLATE_NOT_EXIST(20018, "模板不存在"),
+
+    DUPLICATE_ERROR(20019, "名称已存在"),
+
+    SAVE_SUCCESS(20000, "保存成功"),
+
+    OPERATE_SUCCESS(20000, "操作成功"),
+
+    PRIVATE_FUND_COPY_SUCCESS(20000, "复制成功,复制内容不包含估值信息"),
+
+    UPDATE_SUCCESS(20000, "更新成功"),
+
+    DELETE_SUCCESS(20000, "删除成功"),
+
+    SUBMIT_SUCCESS(20000, "提交成功,感谢您的反馈!"),
+
+    SUBMIT_FAILED(20006, "提交失败,提交策略纠偏申请仅限于私募基金"),
+
+    SUBMIT_FAILED_CONFIRMED(20006, "提交失败,该基金策略已确认"),
+
+    UPDATE_FAILED(20001, "更新失败"),
+
+    ECOSPHERE_UPDATE_FAILED(20001, "请先维护机构信息,再开启展示"),
+
+    DELETE_FAILED(20002, "删除失败"),
+
+    PARSE_FAILED(20020, "解析失败"),
+
+    FILE_SIZE_EXCEED_LIMIT_ERROR(20021, "文件大小超过%s限制"),
+
+    FILE_TYPE_MISMATCH_ERROR(20022, "文件类型不匹配,请下载最新模板"),
+
+    POOL_UPLOAD_MAX_ERROR(20023, "单次导入不能超过1000只"),
+
+    POOL_FUND_EXCEED_MAX_ERROR(20023, "单个%s最大上限为1000只"),
+
+    OUT_CASH_EXCEED_MAX_ERROR(20024, "%s 出金大于可用现金"),
+
+    PORTFOLIO_NOT_EXIST_ERROR(20025, "组合不存在"),
+
+    SAVE_FAILED(20027, "保存失败"),
+
+    /**
+     * 请求失败
+     */
+    SERVER_ERROR(500, "服务器内部错误"),
+
+    /**
+     *
+     * 特殊处理  前端需要展示 但是不弹框
+     */
+    DATA_PRE_SHOW_MESSAGE_ERROR(20026,"");
+
+    private final int code;
+    private final String msg;
+
+    ResultCode(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+}

+ 6 - 0
src/main/java/com/smppw/common/pojo/enums/status/StatusCode.java

@@ -0,0 +1,6 @@
+package com.smppw.common.pojo.enums.status;
+
+public interface StatusCode {
+    public int getCode();
+    public String getMsg();
+}

+ 263 - 0
src/main/java/com/smppw/common/pojo/enums/strategy/Strategy.java

@@ -0,0 +1,263 @@
+package com.smppw.common.pojo.enums.strategy;
+
+import com.smppw.common.pojo.IStrategy;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+
+/**
+ * 新 - 第一级策略
+ */
+public enum Strategy implements IStrategy {
+
+	/** 私募策略 新融智策略 **/
+	Others(-1, "其它", "", ""),
+
+	All(0, "全部", "", "IN00000008"),
+
+	Equity(1001, "股票策略", "IN000002D2", "IN00000008"),
+
+	Bond(1002, "债券策略", "IN000002D3", "IN00000077"),
+
+	Future(1003, "期货及衍生品策略","IN000002D4", "IN0000008S"),
+
+	Multiple(1004, "多资产策略","IN000002D5", "IN00000008"),
+
+	Portfolio(1005,"组合基金", "IN000002D6", "IN00000008"),
+
+	Rights(9, "权益类", "IN0000001B", "IN00000008"),
+
+	/** 公募策略 **/
+	Equity2(101, "股票","IN0000001C", "IN00000008"),
+
+	OverseeFund(108, "海外","IN0000001C", "IN00000009"),
+
+	Hybrid(102,"混合", "IN0000001J", "IN00000008"),
+
+	Bond2(103, "债券","IN0000001H", "IN00000077"),
+
+	Cash(104,"货币", "IN0000001H", "IN00000077"),
+
+	Commodity(105, "商品","IN0000001E", "IN0000008S"),
+
+	MarketNeutral(106, "市场中性","IN0000001G", "IN00000008"),
+
+	FOF(107, "FOF","IN0000001G", "IN00000008"),
+
+	Others2(-100, "其他","", "");
+
+	private Integer id;
+	private String nameDesc;
+	private String rongZhiIndex;
+	private String benchmark;
+
+	private Strategy(Integer id, String nameDesc, String rongZhiIndex, String benchmark) {
+		this.id = id;
+		this.nameDesc = nameDesc;
+		this.rongZhiIndex = rongZhiIndex;
+		this.benchmark = benchmark;
+	}
+
+	public int getId() {
+		return id;
+	}
+
+	public String getRongZhiIndex() {
+		return rongZhiIndex;
+	}
+
+	public String getBenchmark() {
+		return benchmark;
+	}
+
+
+	public String getNameDesc() {
+		return nameDesc;
+	}
+
+	public static boolean isStrategy(String str) {
+		if (StringUtils.isEmpty(str))
+			return false;
+
+		for (Strategy s : Strategy.values()) {
+			if (str.equals(s.getId() + "") || str.equals(s.name())) {
+				return true;
+			}
+		}
+
+		return false;
+	}
+
+	public static Strategy getStrategy(Integer id) {
+		return Stream.of(Strategy.values()).filter(e -> e.id.equals(id)).findFirst().orElse(null);
+	}
+
+	// 已修正
+	/**新的策略归为原来的策略*/
+	public static Strategy getOldStrategy(Integer id) {
+		if(Math.abs(id) >= 100 && Math.abs(id) < 1000){
+			switch (id) {
+				case 101:
+				case 108:
+					return Strategy.Equity;
+				case 102:
+					return Strategy.Multiple;
+				case 103:
+				case 104:
+					return Strategy.Bond;
+				case 105:
+					return Strategy.Future;
+				case 106:
+					return Strategy.Equity;	// 对应策略:股票 - 股票市场中性
+				case 107:
+					return Strategy.Portfolio;
+
+				default:
+					return Strategy.Others;
+			}
+		}
+		return Stream.of(Strategy.values()).filter(e -> e.id.equals(id)).findFirst().orElse(null);
+	}
+
+
+
+	public static Strategy getStrategy(String id) {
+		if (null == id){
+			return null;
+		}
+		for(Strategy s : Strategy.values()){
+			if(id.equals(s.getId()+"") || id.equals(s.name())){
+				return s;
+			}
+		}
+		return null;
+	}
+
+	public static Strategy getStrategyByName(String name) {
+		if (null == name){
+			return null;
+		}
+		for(Strategy s : Strategy.values()){
+			if(name.equals(s.getNameDesc()+"")){
+				return s;
+			}
+		}
+		return null;
+	}
+
+	public static Strategy getStrategyByRongZhiIndex(String rongZhiIndex) {
+		return Stream.of(Strategy.values()).filter(e -> e.rongZhiIndex.equals(rongZhiIndex)).findFirst().orElse(null);
+	}
+
+	// 已修正
+	//	1-股票策略,2-宏观策略,3-管理期货,4-事件驱动,5-相对价值策略,6-债券策略,7-组合基金,8-复合策略,-1-其它策略
+	private static final Map<String, String> EIGHT_TRATEGY_NAME_MAP = new HashMap<>();
+	static {
+		EIGHT_TRATEGY_NAME_MAP.put("1001", "股票策略");
+		EIGHT_TRATEGY_NAME_MAP.put("1002", "债券策略");
+		EIGHT_TRATEGY_NAME_MAP.put("1003", "期货及衍生品策略");
+		EIGHT_TRATEGY_NAME_MAP.put("1004", "多资产策略");
+		EIGHT_TRATEGY_NAME_MAP.put("1005", "组合基金");
+		EIGHT_TRATEGY_NAME_MAP.put("-1", "其它策略");
+
+		EIGHT_TRATEGY_NAME_MAP.put("101", "股票");
+		EIGHT_TRATEGY_NAME_MAP.put("102", "混合");
+		EIGHT_TRATEGY_NAME_MAP.put("103", "债券");
+		EIGHT_TRATEGY_NAME_MAP.put("104", "货币");
+		EIGHT_TRATEGY_NAME_MAP.put("105", "商品");
+		EIGHT_TRATEGY_NAME_MAP.put("106", "市场中性");
+		EIGHT_TRATEGY_NAME_MAP.put("107", "FOF");
+		EIGHT_TRATEGY_NAME_MAP.put("108", "海外");
+		EIGHT_TRATEGY_NAME_MAP.put("-100", "其他");
+
+	}
+
+	public static String getStrategyName(String stragegyId, String defaultValue) {
+		return EIGHT_TRATEGY_NAME_MAP.getOrDefault(stragegyId, defaultValue);
+	}
+
+
+	public static final List<Strategy> STRATEGY_LIST = Arrays.asList(All, Equity, Bond, Future, Multiple, Portfolio, Equity2,
+			OverseeFund, Hybrid, Bond2, Cash, Commodity, MarketNeutral, FOF);
+
+	public static final List<Strategy> EIGHT_STRATEGY = Arrays.asList(Equity, Future, Bond, Portfolio, Multiple);
+
+	public static final List<Strategy> EIGHT_STRATEGY_WITH_RIGHTS = Arrays.asList(Equity, Bond, Future, Multiple, Portfolio);
+
+	public static final List<Strategy> EIGHT_STRATEGY_WITH_OTHERS = Arrays.asList(Equity, Bond, Future, Multiple, Portfolio, Others);
+
+	/** 新添加了公募基金策略 */
+	public static final List<Strategy> NEW_STRATEGY_WITH_OTHERS = Arrays.asList(Equity, Bond, Future, Multiple, Portfolio, Others,
+			Equity2, OverseeFund, Hybrid, Bond2, Cash, Commodity, MarketNeutral, FOF, Others2);
+
+	public static final List<Strategy> STRATEGY_WITHOUT_OTHERS = Arrays.asList(All, Equity, Bond, Future, Multiple, Portfolio);
+
+	// 公募策略集合
+	public static final List<Strategy> PUBLIC_STRATEGY = Arrays.asList(All,Equity2, OverseeFund, Hybrid, Bond2, Cash, Commodity, MarketNeutral, FOF, Others2);
+	// 公募策略id集合
+	public static final List<Integer> PUBLIC_STRATEGY_ID_LIST = Arrays.asList(All.getId(),Equity2.getId(), OverseeFund.getId(), Hybrid.getId(),
+			Bond2.getId(), Cash.getId(), Commodity.getId(), MarketNeutral.getId(), FOF.getId(), Others2.getId());
+
+//	public static Map<Strategy, List<Strategy.RzSubstrategy>> rzStrategySubstrategy() {
+//		return StrategyDao.getInstance().rzStrategySubstrategy();
+//	}
+
+	@Override
+	public Integer getStrategyId() {
+		return this.getId();
+	}
+
+	@Override
+	public String getStrategyOriginName() {
+		return this.name();
+	}
+
+	@Override
+	public String getStrategyNameDesc() {
+		return this.getNameDesc();
+	}
+
+
+
+	public class RzSubstrategy {
+		private String substrategyId;
+		private String indexId;
+		private String indexCode;
+
+		public RzSubstrategy(String substrategyId, String indexCode, String indexId) {
+			super();
+			this.substrategyId = substrategyId;
+			this.indexCode = indexCode;
+			this.indexId = indexId;
+		}
+
+		public String getSubstrategyId() {
+			return substrategyId;
+		}
+
+		public void setSubstrategyId(String substrategyId) {
+			this.substrategyId = substrategyId;
+		}
+
+		public String getIndexId() {
+			return indexId;
+		}
+
+		public void setIndexId(String indexId) {
+			this.indexId = indexId;
+		}
+
+		public String getIndexCode() {
+			return indexCode;
+		}
+
+		public void setIndexCode(String indexCode) {
+			this.indexCode = indexCode;
+		}
+	}
+	
+}

+ 69 - 0
src/main/java/com/smppw/common/pojo/enums/strategy/SubStrategy.java

@@ -0,0 +1,69 @@
+package com.smppw.common.pojo.enums.strategy;
+
+import java.util.stream.Stream;
+
+// 新策略 - 第二级策略
+public enum SubStrategy {
+    OtherStrategy(-1, "其他策略", "", ""), /**/
+    EquityLongOnly(100101, "主观多头", "IN000002D7", ""), /**/
+    EquityQuantitative(100102, "量化多头", "IN000002D8", ""), /**/
+    EquityLongShort(100103, "股票多空", "IN000002D9", "IN00000008"), /**/
+    EquityNeutral(100104, "股票市场中性", "IN000002DA", "IN00000008"), /**/
+    BondPure(100201, "纯债策略", "IN000002DB", "IN00000077"), /**/
+    BondStrong(100202, "债券增强", "IN000002DC", "IN00000077"), /**/
+    BondMultiple(100203, "债券复合", "IN000002DD", "IN00000077"), /**/
+    CnvtbBondTrd(100204, "转债交易策略", "IN000002DE", "IN0000008J"),
+    ActMgtFut(100301, "主观CTA", "IN000002DF", ""),
+    MgtFutQuant(100302, "量化CTA", "IN000002DG", ""),
+    OptionStrgy(100303, "期权策略", "IN000002DH", "IN0000008S"),
+    OtherFutures(100304, "其他衍生品策略", "IN000002DI", "IN0000008S"),
+    MacroStrgy(100401, "宏观策略", "IN000002DJ", "IN00000008"),
+    ArbitrageStrgy(100402, "套利策略", "IN000002DK", "IN00000008"),
+    CombinedStrgy(100403, "复合策略", "IN000002DL", "IN00000008"),
+    FOF(100501, "FOF", "IN000002DM", ""), /**/
+    MOM(100502, "MOM", "IN000002DN", ""),
+    ; /**/
+
+    private int id;
+    private String name;
+    private String rongZhiIndex;
+    private String benchmark;
+
+    private SubStrategy(int id, String name, String rongZhiIndex, String benchmark) {
+        this.id = id;
+        this.name = name;
+        this.rongZhiIndex = rongZhiIndex;
+        this.benchmark = benchmark;
+    }
+
+    public int getId() {
+        return id;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public String getRongZhiIndex() {
+        return rongZhiIndex;
+    }
+
+    public String getBenchmark() {
+        return benchmark;
+    }
+
+    public static SubStrategy getSubStrategy(int id) {
+        return Stream.of(SubStrategy.values()).filter(e -> e.id == id).findFirst().orElse(OtherStrategy);
+    }
+
+    public static SubStrategy getStrategyByName(String name) {
+        if (null == name){
+            return null;
+        }
+        for(SubStrategy s : SubStrategy.values()){
+            if(name.equals(s.getName()+"")){
+                return s;
+            }
+        }
+        return null;
+    }
+}

+ 72 - 0
src/main/java/com/smppw/common/pojo/enums/strategy/SysStrategy.java

@@ -0,0 +1,72 @@
+package com.smppw.common.pojo.enums.strategy;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.stream.Stream;
+
+public enum SysStrategy {
+
+    OtherStrategy(-1, "其他策略", ""), /**/
+    EquityLongOnly(100101,"主观多头", "IN00000008"), /**/
+    EquityQuantitative(100102,"量化多头", ""), /**/
+    EquityLongShort(100103, "股票多空", "IN00000008"), /**/
+    EquityNeutral(100104,"股票市场中性", "IN00000008"), /**/
+    BondPure(100201,"纯债策略", "IN00000077"), /**/
+    BondStrong(100202,"债券增强", "IN00000077"), /**/
+    BondMultiple(100203,"债券复合", "IN00000077"), /**/
+    CnvtbBondTrd(100204,"转债交易", "IN0000008J"),
+    OptionStrgy(100303, "期权策略", "IN0000008S"),
+    OtherFutures(100304, "其他衍生品", "IN0000008S"),
+    MacroStrgy(100401, "宏观策略", "IN00000008"),
+    ArbitrageStrgy(100402, "套利策略", "IN00000008"),
+    CombinedStrgy(100403, "复合策略", "IN00000008"),
+    FOF(100501, "FOF", ""), /**/
+    MOM(100502, "MOM", ""),
+
+    ActTrendFlw(10030101, "主观趋势", "IN0000008S"),
+    ActMktNutrl(10030102, "主观套利", "IN0000008S"),
+    MltFutMgtStrgy(10030103, "主观多策略", "IN0000008S"),
+    TrendFlwQuant(10030201, "量化趋势", "IN0000008S"),
+    MktNutrlQuant(10030202, "量化套利", "IN0000008S"),
+    MltFutMgtQuant(10030203, "量化多策略", "IN0000008S");
+
+    private Integer id;
+    private String name;
+    private String benchmark;
+
+    private SysStrategy(Integer id, String name, String benchmark) {
+        this.id = id;
+        this.name = name;
+        this.benchmark = benchmark;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getBenchmark() {
+        return benchmark;
+    }
+
+    public static SysStrategy getSysStrategy(int id) {
+        return Stream.of(SysStrategy.values()).filter(e -> e.id == id).findFirst().orElse(OtherStrategy);
+    }
+
+    public static boolean isStrategy(String str) {
+        if (StringUtils.isEmpty(str)) {
+            return false;
+        }
+
+        for (SysStrategy s : SysStrategy.values()) {
+            if (str.equals(s.getId() + "") || str.equals(s.name())) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+}

+ 81 - 0
src/main/java/com/smppw/common/pojo/enums/strategy/ThirdStrategy.java

@@ -0,0 +1,81 @@
+package com.smppw.common.pojo.enums.strategy;
+
+import com.smppw.common.pojo.IStrategy;
+
+import java.util.stream.Stream;
+
+// 第三级策略
+public enum ThirdStrategy implements IStrategy {
+    BuyLowSellHigh(10010101, "主观选股", "", "IN00000008"),
+    PrivtPlcIPOAllct(10010102, "定增打新", "", "IN00000008"),
+    CSI300Strong(10010201, "沪深300增强", "", "IN00000008"),
+    CSI500Strong(10010202, "中证500增强", "", "IN0000007M"),
+    CSI1000Strong(10010203, "中证1000增强", "", "IN0000008O"),
+    OtherEifStrgy(10010204, "其他指增", "", "IN00000008"),
+    StkPickQuant(10010205, "量化选股", "", "IN0000028E"),
+    ActTrendFlw(10030101, "主观趋势", "", "IN0000008S"),
+    ActMktNutrl(10030102, "主观套利", "", "IN0000008S"),
+    MltFutMgtStrgy(10030103, "主观多策略", "", "IN0000008S"),
+    TrendFlwQuant(10030201, "量化趋势", "", "IN0000008S"),
+    MktNutrlQuant(10030202, "量化套利", "", "IN0000008S"),
+    MltFutMgtQuant(10030203, "量化多策略", "", "IN0000008S"),
+    ThirdOthers(-99999, "无三级策略", "", "");
+    private int id;
+    private String nameDesc;
+    private String rongZhiIndex;
+    private String benchmark;
+
+    private ThirdStrategy(int id, String nameDesc, String rongZhiIndex, String benchmark) {
+        this.id = id;
+        this.nameDesc = nameDesc;
+        this.rongZhiIndex = rongZhiIndex;
+        this.benchmark = benchmark;
+    }
+
+    public static ThirdStrategy getStrategyByName(String name) {
+        if (null == name) {
+            return null;
+        }
+        for (ThirdStrategy s : ThirdStrategy.values()) {
+            if (name.equals(s.getNameDesc() + "")) {
+                return s;
+            }
+        }
+        return null;
+    }
+
+    public static ThirdStrategy getSubStrategy(int id) {
+        return Stream.of(ThirdStrategy.values()).filter(e -> e.id == id).findFirst().orElse(null);
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public String getNameDesc() {
+        return nameDesc;
+    }
+
+    public String getRongZhiIndex() {
+        return rongZhiIndex;
+    }
+
+    public String getBenchmark() {
+        return benchmark;
+    }
+
+    @Override
+    public Integer getStrategyId() {
+        return this.getId();
+    }
+
+    @Override
+    public String getStrategyOriginName() {
+        return this.name();
+    }
+
+    @Override
+    public String getStrategyNameDesc() {
+        return this.getNameDesc();
+    }
+}

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

@@ -0,0 +1,95 @@
+package com.smppw.common.pojo.vo;
+
+import com.smppw.common.pojo.enums.status.ResultCode;
+import com.smppw.common.pojo.enums.status.StatusCode;
+import lombok.Data;
+
+/**
+ * @author lzj
+ * @param <T>   数据对象类型
+ */
+@Data
+public class ResultVo<T> {
+    private int code;
+    private String msg;
+    private T data;
+
+    /**
+     * 手动设置返回vo
+     * @param code  状态
+     * @param msg   返回信息
+     * @param data  数据对象
+     */
+    public ResultVo(int code, String msg, T data) {
+        this.code = code;
+        this.msg = msg;
+        this.data = data;
+    }
+
+    /**
+     * 默认返回成功状态码,数据对象
+     * @param data  数据对象
+     */
+    public ResultVo(T data) {
+        this.code = ResultCode.SUCCESS.getCode();
+        this.msg = ResultCode.SUCCESS.getMsg();
+        this.data = data;
+    }
+
+    /**
+     * 返回指定状态码,数据对象
+     * @param statusCode    状态枚举
+     * @param data  数据对象
+     */
+    public ResultVo(StatusCode statusCode, T data) {
+        this.code = statusCode.getCode();
+        this.msg = statusCode.getMsg();
+        this.data = data;
+    }
+
+    /**
+     * 只返回状态码
+     * @param statusCode    状态枚举
+     */
+    public ResultVo(StatusCode statusCode) {
+        this.code = statusCode.getCode();
+        this.msg = statusCode.getMsg();
+        this.data = null;
+    }
+
+    private static <T> ResultVo<T> createResult(int code, String msg, T data) {
+        return new ResultVo<>(code, msg, data);
+    }
+
+    private static <T> ResultVo<T> createResult(StatusCode statusCode, T data) {
+        return createResult(statusCode.getCode(), statusCode.getMsg(), data);
+    }
+
+    private static <T> ResultVo<T> createResult(StatusCode statusCode) {
+        return createResult(statusCode.getCode(), statusCode.getMsg(), null);
+    }
+
+    public static <T> ResultVo<T> ok(T data) {
+        return createResult(ResultCode.SUCCESS, data);
+    }
+
+    public static <T> ResultVo<T> ok(StatusCode statusCode, T data) {
+        return createResult(statusCode, data);
+    }
+
+    public static <T> ResultVo<T> ok(int code, String msg, T data) {
+        return createResult(code, msg, data);
+    }
+
+    public static <T> ResultVo<T> fail() {
+        return createResult(ResultCode.COMMON_ERROR);
+    }
+
+    public static <T> ResultVo<T> fail(StatusCode statusCode) {
+        return createResult(statusCode);
+    }
+
+    public static <T> ResultVo<T> fail(int code, String msg) {
+        return createResult(code, msg, null);
+    }
+}

+ 13 - 0
src/main/java/com/smppw/common/rollrange/DateSpliter.java

@@ -0,0 +1,13 @@
+package com.smppw.common.rollrange;
+
+import com.smppw.common.pojo.dto.DateRange;
+
+import java.util.List;
+
+/**
+ * @author zhengsongliang
+ */
+public interface DateSpliter {
+	List<DateRange> split();
+
+}

+ 149 - 0
src/main/java/com/smppw/common/rollrange/RollingSpliter.java

@@ -0,0 +1,149 @@
+package com.smppw.common.rollrange;
+
+import com.smppw.common.pojo.dto.DateRange;
+import com.smppw.common.pojo.enums.Frequency;
+import com.smppw.common.rollrange.date.DateConvertorImpl;
+import com.smppw.common.rollrange.date.DateVerifier;
+import org.joda.time.DateTime;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author zhengsongliang
+ */
+public class RollingSpliter implements DateSpliter {
+    private String startDate;
+    private String endDate;
+    private Integer rollingWindow;
+    private Integer rollingStep;
+    private boolean ifEdgeNeeded;
+    private Frequency freq;
+
+    public RollingSpliter(String startDate, String endDate, Integer rollingWindow, Integer rollingStep,
+                          boolean ifEdgeNeeded, Frequency freq) {
+        super();
+        this.endDate = endDate;
+        this.startDate = startDate;
+        this.rollingWindow = rollingWindow;
+        this.rollingStep = rollingStep;
+        this.ifEdgeNeeded = ifEdgeNeeded;
+        this.freq = freq;
+    }
+
+    @Override
+    public List<DateRange> split() {
+        List<DateRange> ranges = new ArrayList<>();
+
+        if (rollingWindow == 0 || rollingStep == 0) {
+            ranges.add(new DateRange(startDate, endDate));
+            return ranges;
+        }
+
+        DateTime dtEnd = DateTime.parse(endDate);
+        DateTime dtStart = DateTime.parse(startDate);
+
+        if (Frequency.Weekly == this.freq) {
+            DateTime dtWeekEnd = dtStart.plusWeeks(rollingWindow).minusDays(1);
+            while (!dtWeekEnd.isAfter(dtEnd)) {
+                ranges.add(new DateRange(dtStart, dtWeekEnd));
+                dtStart = dtStart.plusWeeks(rollingStep);
+                dtWeekEnd = dtStart.plusWeeks(rollingWindow).minusDays(1);
+            }
+        } else {
+            DateTime dtMonthEnd = dtStart.plusMonths(rollingWindow).minusDays(1);
+            while (!dtMonthEnd.isAfter(dtEnd)) {
+                ranges.add(new DateRange(dtStart, dtMonthEnd));
+                dtStart = dtStart.plusMonths(rollingStep);
+                dtMonthEnd = dtStart.plusMonths(rollingWindow).minusDays(1);
+            }
+        }
+
+
+        if (ifEdgeNeeded && dtStart.isBefore(dtEnd))
+            ranges.add(new DateRange(dtStart, dtEnd));
+
+        if (freq != Frequency.Daily && freq != Frequency.Weekly) {
+            // Rolling Annually, when the last period is less than a full year, also should be added
+
+//			int n = ranges.size();
+//			for (int i = 0; i < n; i++) {
+//				DateRange dr = ranges.get(i);
+//				String start = DateVerifier.verifyPeriodStart(dr.getStartDate(), freq);
+//				String end = DateVerifier.verifyPeriodEnd(dr.getEndDate(), freq);
+//				dr.setStartDate(start);
+//				dr.setEndDate(end);
+//			}
+
+
+            List<DateRange> validRanges = new ArrayList<>();
+            for (DateRange dr : ranges) {
+                if (DateTime.parse(dr.getStartDate()).isBefore(DateTime.parse(dr.getEndDate())))
+                    validRanges.add(dr);
+            }
+            ranges = validRanges;
+        }
+        return ranges;
+    }
+
+    public static List<DateRange> getDateRangesAmong(String startDate, String endDate, Frequency rollingFrequency,
+                                                     boolean ifEdgeNeeded, Frequency freq) {
+        return getDateRangesAmong(startDate, endDate, rollingFrequency, ifEdgeNeeded, freq, true);
+    }
+
+    public static List<DateRange> getDateRangesAmong(String startDate, String endDate, Frequency rollingFrequency,
+                                                     boolean ifEdgeNeeded, Frequency freq, boolean headEgde) {
+        Frequency rollingfreq = Frequency.valueOf(rollingFrequency.name());
+        DateRange drEdgeHead = null;
+        String verifiedStartDate = DateVerifier.verifyPeriodStart(startDate, rollingfreq);
+        if (ifEdgeNeeded) {
+            String currentFreqEnd = new DateConvertorImpl().setPeriodLast(startDate, rollingfreq);
+            if (!startDate.equals(verifiedStartDate)) {
+                if (DateTime.parse(currentFreqEnd).isBefore(DateTime.parse(endDate)))
+                    drEdgeHead = new DateRange(startDate, currentFreqEnd);
+                else {
+                    drEdgeHead = new DateRange(startDate, endDate);
+                    return Arrays.asList(drEdgeHead);
+                }
+            }
+        }
+
+        if (Frequency.Weekly == rollingfreq) {
+            int weekCount = 52 / (int) rollingfreq.getNum();
+            //List<DateRange> ranges = new RollingSpliter(verifiedStartDate, endDate, weekCount, weekCount, ifEdgeNeeded, freq).split();
+            List<DateRange> ranges = new RollingSpliter(verifiedStartDate, endDate, weekCount, weekCount, ifEdgeNeeded, rollingfreq).split();
+            if (drEdgeHead != null && headEgde)
+                ranges.add(0, drEdgeHead);
+            return ranges;
+
+        } else {
+            int freqMonthCount = 12 / (int) rollingfreq.getNum();
+            //List<DateRange> ranges = new RollingSpliter(verifiedStartDate, endDate, freqMonthCount, freqMonthCount, ifEdgeNeeded, freq).split();
+            List<DateRange> ranges = new RollingSpliter(verifiedStartDate, endDate, freqMonthCount, freqMonthCount, ifEdgeNeeded, rollingfreq).split();
+            if (drEdgeHead != null && headEgde)
+                ranges.add(0, drEdgeHead);
+            return ranges;
+        }
+    }
+
+//	public static void main(String[] args) {
+//		Frequency rollingfreq = Frequency.Weekly;
+//		String startDate = "2020-01-01";
+//		String endDate = "2020-12-22";
+//		
+//		String verifiedStartDate = DateVerifier.verifyPeriodStart(startDate, rollingfreq);
+//
+//		System.out.println(verifiedStartDate);
+//
+//		int weekCount = 52 / (int) rollingfreq.getNum();
+//
+//		System.out.println("week:" + weekCount);
+//
+//		List<DateRange> ranges = new RollingSpliter(verifiedStartDate, endDate, weekCount, weekCount, true, rollingfreq).split();
+//
+//		for (DateRange dr : ranges)
+//			System.out.println(dr);
+//		
+//	}
+}

+ 25 - 0
src/main/java/com/smppw/common/rollrange/date/DateConvertor.java

@@ -0,0 +1,25 @@
+package com.smppw.common.rollrange.date;
+
+import com.smppw.common.pojo.enums.Frequency;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public interface DateConvertor {
+	// Index is number of day from START_DATE that is 1900-01-01.
+	String convertToString(int index);
+
+	int convertToIndex(String date);
+
+	int getDateOffset(String startDate, String endDate, Frequency frequency, boolean isUse5DaysPerWeek);
+
+	String addPeriod(String date, int periods, Frequency frequency, PeriodPosition position, boolean isUse5DaysPerWeek);
+
+	String setPeriodFirst(String date, Frequency frequency);
+
+	String setPeriodLast(String date, Frequency frequency);
+	
+	String setPeriodLast(String date, Frequency frequency, boolean isUse5DaysPerWeek);
+
+}

+ 109 - 0
src/main/java/com/smppw/common/rollrange/date/DateConvertorImpl.java

@@ -0,0 +1,109 @@
+package com.smppw.common.rollrange.date;
+
+import com.smppw.constants.Consts;
+import com.smppw.common.pojo.enums.Frequency;
+import org.joda.time.DateTime;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public class DateConvertorImpl implements DateConvertor {
+	//这玩意线程不安全
+//	static DateFormat dfm = new SimpleDateFormat(Consts.DEFAULT_DATE_PATTERN);
+//	static {
+//		dfm.setTimeZone(TimeZone.getTimeZone("GMT"));
+//	}
+
+	@Override
+	public String convertToString(int index) {
+		Calendar startDate = getCalendar(Consts.START_DATE);
+		startDate = TimeFactory.getDateTime(Frequency.Daily).shift(startDate, index);
+		return new SimpleDateFormat(Consts.DEFAULT_DATE_PATTERN).format(startDate.getTime());
+	}
+
+	private Calendar getCalendar(String dateStr) {
+		Calendar c = Calendar.getInstance();
+		try {
+			//			System.out.println("====================>>"+dateStr);
+			//			date = dfm.parse(dateStr);
+
+			if (dateStr != null && !dateStr.equals("")) {
+				Date date = DateTime.parse(dateStr).toDate();
+				c.setTime(date);
+			}
+		} catch (Exception e) {
+//			LogUtils.e("date error:"+dateStr);
+//			throw new RuntimeException(e);
+			e.printStackTrace();
+		}
+		return c;
+	}
+
+	@Override
+	public int convertToIndex(String dateStr) {
+		Calendar startDate = getCalendar(Consts.START_DATE);
+		Calendar endDate = getCalendar(dateStr);
+		return TimeFactory.getDateTime(Frequency.Daily).between(startDate, endDate);
+	}
+
+	@Override
+	public int getDateOffset(String startStr, String endStr, Frequency frequency, boolean isUse5DaysPerWeek) {
+		Calendar startDate = getCalendar(startStr);
+		Calendar endDate = getCalendar(endStr);
+		return TimeFactory.getDateTime(frequency).between(startDate, endDate);
+	}
+
+	@Override
+	public String addPeriod(String date, int periods, Frequency frequency, PeriodPosition position,
+			boolean isUse5DaysPerWeek) {
+		Calendar startDate = getCalendar(date);
+		IDateTime time = TimeFactory.getDateTime(frequency);
+		startDate = time.shift(startDate, periods);
+		if (position == PeriodPosition.PeriodFirst) {
+			startDate = time.startDayOfPeriod(startDate);
+		} else if (position == PeriodPosition.PeriodLast) {
+			startDate = time.endDayOfPeriod(startDate);
+			if (frequency == Frequency.Weekly && isUse5DaysPerWeek) {
+				String res = new SimpleDateFormat(Consts.DEFAULT_DATE_PATTERN).format(startDate.getTime());
+				return setPeriodLast(res, frequency, true);
+			}
+		}
+		// else if(position == PeriodPosition.PeriodFixed) {
+		// do nothing
+		// }
+		return new SimpleDateFormat(Consts.DEFAULT_DATE_PATTERN).format(startDate.getTime());
+	}
+
+	@Override
+	public String setPeriodFirst(String date, Frequency frequency) {
+		if(Frequency.Daily == frequency)
+			return date;
+		
+		Calendar startDate = getCalendar(date);
+		startDate = TimeFactory.getDateTime(frequency).startDayOfPeriod(startDate);
+		return new SimpleDateFormat(Consts.DEFAULT_DATE_PATTERN).format(startDate.getTime());
+	}
+
+	@Override
+	public String setPeriodLast(String date, Frequency frequency) {
+		return setPeriodLast(date, frequency, false);
+	}
+
+	@Override
+	public String setPeriodLast(String date, Frequency frequency, boolean isUse5DaysPerWeek) {
+		if (frequency == Frequency.Weekly && isUse5DaysPerWeek) {
+			DateTime dt = DateTime.parse(date);
+			dt = dt.dayOfWeek().setCopy(5);
+			return dt.toString(Consts.DEFAULT_DATE_PATTERN);
+		}
+		Calendar endDate = getCalendar(date);
+		endDate = TimeFactory.getDateTime(frequency).endDayOfPeriod(endDate);
+		return new SimpleDateFormat(Consts.DEFAULT_DATE_PATTERN).format(endDate.getTime());
+	}
+
+}

+ 72 - 0
src/main/java/com/smppw/common/rollrange/date/DateVerifier.java

@@ -0,0 +1,72 @@
+package com.smppw.common.rollrange.date;
+
+import com.smppw.constants.Consts;
+import com.smppw.common.pojo.dto.DateRange;
+import com.smppw.common.pojo.enums.Frequency;
+import com.smppw.utils.DateUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
+
+import java.util.List;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public class DateVerifier {
+	private static DateConvertorImpl convertor = new DateConvertorImpl();
+
+	public static String verifyPeriodEnd(String endDate, Frequency freq) {
+		if (null == endDate) {
+			return endDate;
+		}
+
+		String periodEnd = convertor.setPeriodLast(endDate, freq, true);
+		if (periodEnd.equals(endDate)) {
+			return periodEnd;
+		}
+
+		String lastPeriodEnd = convertor.addPeriod(endDate, -1, freq, PeriodPosition.PeriodLast, false);
+		return lastPeriodEnd;
+	}
+	
+	public static String verifyPeriodStart(String startDate, Frequency freq) {
+		if (null == startDate) {
+			return startDate;
+		}
+
+		String periodStart = convertor.setPeriodFirst(startDate, freq);
+		if (periodStart.equals(startDate)) {
+			return periodStart;
+		}
+
+		String nextPeriodFirst = convertor.addPeriod(startDate, 1, freq, PeriodPosition.PeriodFirst, false);
+		return nextPeriodFirst;
+	}
+	
+	public static void verifyDateRanges(List<DateRange> drs, Frequency freq) {
+		for (DateRange dr : drs) {
+			dr.setStartDate(verifyPeriodStart(dr.getStartDate(), freq));
+			dr.setEndDate(verifyPeriodEnd(dr.getEndDate(), freq));
+		}
+	}
+
+	public static boolean verifyPeriodLegality(String startDate, String endDate) {
+		if (convertor.convertToIndex(startDate) - convertor.convertToIndex(endDate) >= 0)
+			return false;
+		return true;
+	}
+
+	public static String getRankDate(String date) {
+		if (StringUtils.isEmpty(date)) {
+			return null;
+		}
+		if (DateUtil.getDatePattern(date) == Consts.SHORT_DATE_PATTERN) {
+			return date;
+		} else {
+			return DateTime.parse(DateVerifier.verifyPeriodEnd(date, Frequency.Monthly))
+					.toString(Consts.SHORT_DATE_PATTERN);
+		}
+
+	}
+}

+ 19 - 0
src/main/java/com/smppw/common/rollrange/date/IDateTime.java

@@ -0,0 +1,19 @@
+package com.smppw.common.rollrange.date;
+
+import java.util.Calendar;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public interface IDateTime {
+	int between(Calendar startDate, Calendar endDate);
+	
+	Calendar shift(Calendar date, int offside);
+	
+	Calendar endDayOfPeriod(Calendar date);
+	
+	Calendar startDayOfPeriod(Calendar date);
+	
+	final int MILLIS_IN_DAY = 1000 * 60 * 60 * 24;
+}

+ 11 - 0
src/main/java/com/smppw/common/rollrange/date/PeriodPosition.java

@@ -0,0 +1,11 @@
+package com.smppw.common.rollrange.date;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public enum PeriodPosition {
+	PeriodFirst, 
+	PeriodLast, 
+	PeriodFixed;
+}

+ 32 - 0
src/main/java/com/smppw/common/rollrange/date/TimeFactory.java

@@ -0,0 +1,32 @@
+package com.smppw.common.rollrange.date;
+
+
+import com.smppw.common.pojo.enums.Frequency;
+import com.smppw.common.rollrange.date.item.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public class TimeFactory {
+	private static Map<Frequency, IDateTime> map = new HashMap<Frequency, IDateTime>();
+	static {
+		map.put(Frequency.Daily, 		new Day());
+		map.put(Frequency.Monthly, 		new Month());
+		map.put(Frequency.Quarterly, 	new Quarter());
+		map.put(Frequency.SemiAnnually, new HalfYear());
+		map.put(Frequency.Annually, 	new Year());
+		map.put(Frequency.Weekly, 		new Week());
+	}
+	
+	public static IDateTime getDateTime(Frequency frequency) {
+		IDateTime time =  map.get(frequency);
+		if (time == null) {
+			throw new UnsupportedOperationException(frequency.name());
+		}
+		return time;
+	}
+}

+ 24 - 0
src/main/java/com/smppw/common/rollrange/date/item/BaseDateTime.java

@@ -0,0 +1,24 @@
+package com.smppw.common.rollrange.date.item;
+
+
+import com.smppw.common.rollrange.date.IDateTime;
+
+import java.util.Calendar;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public abstract class BaseDateTime implements IDateTime {
+	@Override
+	public Calendar endDayOfPeriod(Calendar date) {
+		//shift to next period.
+		date = shift(date, 1);
+		//shift to the first day of that period.
+		date = startDayOfPeriod(date);
+		//move one day backward, then we reach the end of the previous period.
+		date.add(Calendar.DAY_OF_YEAR, -1);
+		return date;
+	}
+
+}

+ 36 - 0
src/main/java/com/smppw/common/rollrange/date/item/Day.java

@@ -0,0 +1,36 @@
+package com.smppw.common.rollrange.date.item;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Calendar;
+
+/**
+ * @author Yu Liu
+ */
+public class Day extends BaseDateTime {
+
+    @Override
+    public int between(Calendar startDate, Calendar endDate) {
+        long endInstant = endDate.getTimeInMillis();
+        double presumedDays = ((double) (endInstant - startDate.getTimeInMillis()) / MILLIS_IN_DAY);
+
+        if (!Double.isNaN(presumedDays) && !Double.isInfinite(presumedDays)) {
+            BigDecimal bd = new BigDecimal(presumedDays);
+            BigDecimal bd1 = bd.setScale(0, RoundingMode.HALF_UP);
+            presumedDays = bd1.doubleValue();
+        }
+        return (int) presumedDays;
+    }
+
+    @Override
+    public Calendar shift(Calendar startDate, int offside) {
+        startDate.add(Calendar.DAY_OF_YEAR, offside);
+        return startDate;
+    }
+
+    @Override
+    public Calendar startDayOfPeriod(Calendar date) {
+        return date;
+    }
+
+}

+ 36 - 0
src/main/java/com/smppw/common/rollrange/date/item/HalfYear.java

@@ -0,0 +1,36 @@
+package com.smppw.common.rollrange.date.item;
+
+import java.util.Calendar;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public class HalfYear extends BaseDateTime {
+	
+	@Override
+	public int between(Calendar startDate, Calendar endDate) {
+		int years = endDate.get(Calendar.YEAR) - startDate.get(Calendar.YEAR);
+		return years * 2 + (getHalfYear(endDate) - getHalfYear(startDate));
+	}
+
+	@Override
+	public Calendar shift(Calendar date, int offside) {
+		date.add(Calendar.MONTH, offside * 6);
+		return date;
+	}
+
+	@Override
+	public Calendar startDayOfPeriod(Calendar date) {
+		int halfYear = getHalfYear(date);
+		date.set(Calendar.MONTH, (halfYear - 1) * 6);
+		date.set(Calendar.DAY_OF_MONTH, 1);
+		return date;
+	}
+
+	private int getHalfYear(Calendar date) {
+		int month = date.get(Calendar.MONTH); // JANUARY is 0
+		return month / 6 + 1;
+	}
+
+}

+ 29 - 0
src/main/java/com/smppw/common/rollrange/date/item/Month.java

@@ -0,0 +1,29 @@
+package com.smppw.common.rollrange.date.item;
+
+import java.util.Calendar;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public class Month extends BaseDateTime {
+	
+	@Override
+	public int between(Calendar startDate, Calendar endDate) {
+		int years = endDate.get(Calendar.YEAR) - startDate.get(Calendar.YEAR);
+		return years * 12 + (endDate.get(Calendar.MONTH) - startDate.get(Calendar.MONTH));
+	}
+
+	@Override
+	public Calendar shift(Calendar date, int offside) {
+		date.add(Calendar.MONTH, offside);
+		return date;
+	}
+
+	@Override
+	public Calendar startDayOfPeriod(Calendar date) {
+		date.set(Calendar.DAY_OF_MONTH, 1);
+		return date;
+	}
+
+}

+ 37 - 0
src/main/java/com/smppw/common/rollrange/date/item/Quarter.java

@@ -0,0 +1,37 @@
+package com.smppw.common.rollrange.date.item;
+
+import java.util.Calendar;
+
+/**
+ * @author Yu Liu
+ *
+ */
+public class Quarter extends BaseDateTime {
+
+	@Override
+	public int between(Calendar startDate, Calendar endDate) {
+		int years = endDate.get(Calendar.YEAR) - startDate.get(Calendar.YEAR);
+		return years * 4 + (getQuarter(endDate) - getQuarter(startDate));
+	}
+
+	@Override
+	public Calendar shift(Calendar date, int offside) {
+		date.add(Calendar.MONTH, offside * 3);
+		return date;
+	}
+
+	@Override
+	public Calendar startDayOfPeriod(Calendar date) {
+		int quarter = getQuarter(date);
+		date.set(Calendar.MONTH, (quarter-1) * 3);
+		date.set(Calendar.DAY_OF_MONTH, 1);
+		return date;
+	}
+	
+	private int getQuarter(Calendar date){
+		int month = date.get(Calendar.MONTH); //JANUARY is 0
+		return month / 3 + 1;
+	}
+
+
+}

+ 0 - 0
src/main/java/com/smppw/common/rollrange/date/item/Week.java


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است