xusl пре 1 година
комит
d369fadbae
100 измењених фајлова са 6726 додато и 0 уклоњено
  1. 19 0
      .gitignore
  2. 8 0
      .idea/.gitignore
  3. 29 0
      .idea/compiler.xml
  4. 19 0
      .idea/encodings.xml
  5. 55 0
      .idea/jarRepositories.xml
  6. 12 0
      .idea/misc.xml
  7. 6 0
      .idea/vcs.xml
  8. 102 0
      .idea/workspace.xml
  9. 3 0
      README.md
  10. 6 0
      ipfcst-znzx2.iml
  11. 6 0
      ipfcst/ipfcst-common/ipfcst-common-core/ipfcst-common-core.iml
  12. 80 0
      ipfcst/ipfcst-common/ipfcst-common-core/pom.xml
  13. 20 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/config/EncryptionConfig.java
  14. 36 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/config/JacksonConfig.java
  15. 19 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/config/RestTemplateConfig.java
  16. 18 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/CommonConstants.java
  17. 14 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/SecurityConstants.java
  18. 25 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/enums/ResponseEnum.java
  19. 21 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/enums/SysUserRoleEnum.java
  20. 21 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/enums/SysUserStatusEnum.java
  21. 30 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/exception/BusinessException.java
  22. 23 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/config/IntegrationConfig.java
  23. 21 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/constant/CacheConstant.java
  24. 46 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/constant/ConnectConstant.java
  25. 47 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/constant/DataTypeConstant.java
  26. 77 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/constant/StatusConstant.java
  27. 32 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/correct/dq/CForePowerShortTermCorrect.java
  28. 26 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/correct/dq/IForePowerShortTermCorrect.java
  29. 35 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/jackson/JavaTimeModule.java
  30. 44 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/BeanMapUtil.java
  31. 96 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/ClassUtil.java
  32. 206 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/CommonUtil.java
  33. 89 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/CronUtils.java
  34. 174 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/DateMomentUtil.java
  35. 251 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/DateTimeUtil.java
  36. 41 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/JsonBeanUtil.java
  37. 123 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/JwtUtil.java
  38. 141 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/NumberUtils.java
  39. 186 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/ProduceSql.java
  40. 56 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/RSAEncrypt.java
  41. 83 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/SpringContextHolder.java
  42. 40 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/StringUtil.java
  43. 328 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/SunRiseSet.java
  44. 763 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/TimeUtils.java
  45. 177 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/WebUtil.java
  46. 60 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/GlobalExceptionHandler.java
  47. 38 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/vo/RequestVO.java
  48. 87 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/vo/ResponseVO.java
  49. 122 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/xss/RequestWrapper.java
  50. 25 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/xss/RequestWrapperFilter.java
  51. 1 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/resources/META-INF/build-info.properties
  52. 4 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/resources/META-INF/spring.factories
  53. 4 0
      ipfcst/ipfcst-common/ipfcst-common-core/src/main/resources/banner.txt
  54. 83 0
      ipfcst/ipfcst-common/ipfcst-common-data/README.md
  55. 6 0
      ipfcst/ipfcst-common/ipfcst-common-data/ipfcst-common-data.iml
  56. 125 0
      ipfcst/ipfcst-common/ipfcst-common-data/pom.xml
  57. 105 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/AbstractBaseEntity.java
  58. 34 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/AbstractForecastPower.java
  59. 57 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/AbstractForecastPowerBase.java
  60. 59 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/AbstractForecastPowerHis.java
  61. 77 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/equipmentinfo/AbstractEquipmentInfo.java
  62. 138 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/equipmentstatus/AbstractEquipmentStatusData.java
  63. 138 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/AbnormalCode.java
  64. 21 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/AlarmStatusEnum.java
  65. 26 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/AlarmTypeEnum.java
  66. 19 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ChannelFileRuleEnum.java
  67. 20 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ChannelStatusEnum.java
  68. 21 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ComChannelTypeEnum.java
  69. 35 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/DataObjectTypeEnum.java
  70. 28 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/DataSourceEnum.java
  71. 23 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ElectricFieldStatrsEnum.java
  72. 20 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ElectricFieldTypeEnum.java
  73. 121 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/EquipmentTypeEnum.java
  74. 22 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/FeedbackFileStatusEnum.java
  75. 25 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/FileStatusEnum.java
  76. 409 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/FileTypeEnum.java
  77. 20 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/FtpPassiveModeEnum.java
  78. 36 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/HolidayTypeEnum.java
  79. 40 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/PredictionModelEnum.java
  80. 52 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ProvinceEnum.java
  81. 22 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/PvRotationModeEnum.java
  82. 20 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/SftpConnectModeEnum.java
  83. 143 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/TunnelStatus.java
  84. 83 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/TunnelType.java
  85. 20 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/UploadFileCharSetEnum.java
  86. 21 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/UploadFileNameLengthEnum.java
  87. 20 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/UploadFileSingleByteEnum.java
  88. 24 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/UploadProtocolEnum.java
  89. 23 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/AGC_AVCInfo.java
  90. 80 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/AGC_AVCStatusData.java
  91. 48 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/AccuracyPassRate.java
  92. 48 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/AccuracyPassRateDay.java
  93. 71 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/BaseTunnelInfo.java
  94. 23 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/BoosterStationInfo.java
  95. 35 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/ChannelAlarmInfo.java
  96. 75 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/ChannelDisconLog.java
  97. 29 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/CollectingPowerLineInfo.java
  98. 84 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/CommunicationEquipment.java
  99. 56 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/CustomReportForm.java
  100. 46 0
      ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/DataLimitation.java

+ 19 - 0
.gitignore

@@ -0,0 +1,19 @@
+.DS_Store
+node_modules/
+dist/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+package-lock.json
+tests/**/coverage/
+
+# Editor directories and files
+/*.iml
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+/src/main/resources/static/
+/.idea/
+**/target/

+ 8 - 0
.idea/.gitignore

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

+ 29 - 0
.idea/compiler.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <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="ipfcst-console" />
+        <module name="ipfcst-common-core" />
+        <module name="ipfcst-reportquery" />
+        <module name="ipfcst-common-data" />
+        <module name="ipfcst-common-security" />
+      </profile>
+    </annotationProcessing>
+  </component>
+  <component name="JavacSettings">
+    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
+      <module name="ipfcst" options="-bootclasspath C:/Java/jdk1.8/jre\lib\rt.jar;C:/Java/jdk1.8/jre\lib\jce.jar" />
+      <module name="ipfcst-common" options="-bootclasspath C:/Java/jdk1.8/jre\lib\rt.jar;C:/Java/jdk1.8/jre\lib\jce.jar" />
+      <module name="ipfcst-common-core" options="-bootclasspath C:/Java/jdk1.8/jre\lib\rt.jar;C:/Java/jdk1.8/jre\lib\jce.jar" />
+      <module name="ipfcst-common-data" options="-bootclasspath C:/Java/jdk1.8/jre\lib\rt.jar;C:/Java/jdk1.8/jre\lib\jce.jar" />
+      <module name="ipfcst-common-security" options="-bootclasspath C:/Java/jdk1.8/jre\lib\rt.jar;C:/Java/jdk1.8/jre\lib\jce.jar" />
+      <module name="ipfcst-console" options="-bootclasspath C:/Java/jdk1.8/jre\lib\rt.jar;C:/Java/jdk1.8/jre\lib\jce.jar" />
+      <module name="ipfcst-reportquery" options="-bootclasspath C:/Java/jdk1.8/jre\lib\rt.jar;C:/Java/jdk1.8/jre\lib\jce.jar" />
+      <module name="ipfcst-znzx2" options="-bootclasspath C:/Java/jdk1.8/jre\lib\rt.jar;C:/Java/jdk1.8/jre\lib\jce.jar" />
+    </option>
+  </component>
+</project>

+ 19 - 0
.idea/encodings.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-common/ipfcst-common-core/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-common/ipfcst-common-core/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-common/ipfcst-common-data/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-common/ipfcst-common-data/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-common/ipfcst-common-security/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-common/ipfcst-common-security/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-common/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-common/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-console/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/ipfcst-reportquery/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/ipfcst/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
+  </component>
+</project>

+ 55 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="aliyun-releases" />
+      <option name="name" value="阿里云仓库" />
+      <option name="url" value="https://maven.aliyun.com/repository/public" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jiayue-repos" />
+      <option name="name" value="jiayue maven" />
+      <option name="url" value="http://49.4.68.219:8888/repository/jiayue-group/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jiayue-releases" />
+      <option name="name" value="嘉越云仓库" />
+      <option name="url" value="http://49.4.68.219:8888/nexus/content/groups/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="https://repo.maven.apache.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="http://49.4.68.219:8888/repository/jiayue-group/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jiayue-repos" />
+      <option name="name" value="jiayue maven" />
+      <option name="url" value="http://49.4.68.219:8888/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>
+    <remote-repository>
+      <option name="id" value="aliyun-releases" />
+      <option name="name" value="阿里云仓库" />
+      <option name="url" value="http://49.4.68.219:8888/repository/jiayue-group/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jiayue-releases" />
+      <option name="name" value="嘉越云仓库" />
+      <option name="url" value="http://49.4.68.219:8888/repository/jiayue-group/" />
+    </remote-repository>
+  </component>
+</project>

+ 12 - 0
.idea/misc.xml

@@ -0,0 +1,12 @@
+<?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_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 102 - 0
.idea/workspace.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="AutoImportSettings">
+    <option name="autoReloadType" value="SELECTIVE" />
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="e8aef75d-2fd1-4547-92f3-f0e1816443a4" name="Changes" comment="">
+      <change afterPath="$PROJECT_DIR$/ipfcst/ipfcst-console/package.json" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/ipfcst/ipfcst-reportquery/package.json" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
+    </list>
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ComposerSettings">
+    <execution />
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="MarkdownSettingsMigration">
+    <option name="stateVersion" value="1" />
+  </component>
+  <component name="MavenImportPreferences">
+    <option name="generalSettings">
+      <MavenGeneralSettings>
+        <option name="localRepository" value="C:\Users\jy\.m2\repository" />
+        <option name="mavenHome" value="$PROJECT_DIR$/../../../tools/apache-maven-3.5.3" />
+        <option name="userSettingsFile" value="C:\Users\jy\.m2\v3-sertting\settings.xml" />
+      </MavenGeneralSettings>
+    </option>
+  </component>
+  <component name="ProjectColorInfo"><![CDATA[{
+  "associatedIndex": 4
+}]]></component>
+  <component name="ProjectId" id="2eXDILgHReZSrjOlsHiTnaGpN6i" />
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
+  <component name="ProjectViewState">
+    <option name="hideEmptyMiddlePackages" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "RunOnceActivity.OpenProjectViewOnStart": "true",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "WebServerToolWindowFactoryState": "false",
+    "git-widget-placeholder": "master",
+    "last_opened_file_path": "D:/code/glyc/ipfcst-znzx2/ipfcst/ipfcst-console",
+    "node.js.detected.package.eslint": "true",
+    "node.js.detected.package.tslint": "true",
+    "node.js.selected.package.eslint": "(autodetect)",
+    "node.js.selected.package.tslint": "(autodetect)",
+    "nodejs_package_manager_path": "npm",
+    "project.structure.last.edited": "Problems",
+    "project.structure.proportion": "0.0",
+    "project.structure.side.proportion": "0.31609195",
+    "settings.editor.selected.configurable": "MavenSettings",
+    "ts.external.directory.path": "D:\\idea2023\\plugins\\javascript-impl\\jsLanguageServicesImpl\\external",
+    "vue.rearranger.settings.migration": "true"
+  }
+}]]></component>
+  <component name="RecentsManager">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\code\glyc\ipfcst-znzx2\ipfcst\ipfcst-console" />
+      <recent name="D:\code\glyc\ipfcst-znzx2\ipfcst\ipfcst-reportquery" />
+      <recent name="D:\code\glyc\ipfcst-znzx2" />
+    </key>
+  </component>
+  <component name="RunManager" selected="Spring Boot.ConsoleApplication">
+    <configuration name="ConsoleApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
+      <module name="ipfcst-console" />
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.jiayue.ipfcst.ConsoleApplication" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <configuration name="ReportQueryApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
+      <module name="ipfcst-reportquery" />
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.jiayue.ipfcst.ReportQueryApplication" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+  </component>
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="e8aef75d-2fd1-4547-92f3-f0e1816443a4" name="Changes" comment="" />
+      <created>1712041953306</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1712041953306</updated>
+      <workItem from="1712041955235" duration="403000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="3" />
+  </component>
+</project>

+ 3 - 0
README.md

@@ -0,0 +1,3 @@
+# ipfcst-lf
+
+中能智新定制版本

+ 6 - 0
ipfcst-znzx2.iml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4">
+  <component name="SonarLintModuleSettings">
+    <option name="uniqueId" value="0ef59297-0ad8-4d45-87c4-bad5518f1e1a" />
+  </component>
+</module>

+ 6 - 0
ipfcst/ipfcst-common/ipfcst-common-core/ipfcst-common-core.iml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4">
+  <component name="SonarLintModuleSettings">
+    <option name="uniqueId" value="16c41aae-9dd2-4aaf-8120-7b39ac6d22ef" />
+  </component>
+</module>

+ 80 - 0
ipfcst/ipfcst-common/ipfcst-common-core/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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.jiayue.ipfcst</groupId>
+        <artifactId>ipfcst-common</artifactId>
+        <version>3.0.0</version>
+    </parent>
+
+    <artifactId>ipfcst-common-core</artifactId>
+    <version>3.0.0</version>
+    <packaging>jar</packaging>
+
+    <description>ipfcst 公共工具类核心包</description>
+
+    <dependencies>
+        <!--hutool-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+        <!--server-api-->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+        </dependency>
+        <!--hibernate-validator-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+        <!--json模块-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-json</artifactId>
+        </dependency>
+        <!--TTL-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>transmittable-thread-local</artifactId>
+            <version>${ttl.version}</version>
+        </dependency>
+        <!--swagger 依赖-->
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+        </dependency>
+        <!-- JWT -->
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>${javajwt.version}</version>
+        </dependency>
+        <!-- base64加密 -->
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.13</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+        </dependency>
+        <!--任务调度-->
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz</artifactId>
+            <version>${quartz.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>slf4j-api</artifactId>
+                    <groupId>org.slf4j</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+</project>

+ 20 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/config/EncryptionConfig.java

@@ -0,0 +1,20 @@
+package com.jiayue.ipfcst.common.core.config;
+
+import com.jiayue.ipfcst.common.core.util.RSAEncrypt;
+import org.jasypt.encryption.StringEncryptor;
+import org.springframework.context.annotation.Bean;
+
+/**
+ * 自定义加密解密器,用于数据库账号密码解密
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/8 10:57
+ */
+//@Configuration
+//@EnableEncryptableProperties
+public class EncryptionConfig {
+    @Bean("jasyptStringEncryptor") public StringEncryptor stringEncryptor() {
+        return new RSAEncrypt();
+    }
+}

+ 36 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/config/JacksonConfig.java

@@ -0,0 +1,36 @@
+package com.jiayue.ipfcst.common.core.config;
+
+//import cn.hutool.core.date.DatePattern;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import com.jiayue.ipfcst.common.core.jackson.JavaTimeModule;
+//import org.springframework.boot.autoconfigure.AutoConfigureBefore;
+//import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+//import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
+//import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+//import java.time.ZoneId;
+//import java.util.Locale;
+//import java.util.TimeZone;
+//
+///**
+// * JacksonConfig
+// *
+// * @author L.ym
+// * @version 3.0
+// **/
+//@Configuration
+//@ConditionalOnClass(ObjectMapper.class)
+//@AutoConfigureBefore(JacksonAutoConfiguration.class)
+//public class JacksonConfig {
+//    @Bean
+//    public Jackson2ObjectMapperBuilderCustomizer customizer() {
+//        return builder -> {
+//            builder.locale(Locale.CHINA);
+//            builder.timeZone(TimeZone.getTimeZone(ZoneId.systemDefault()));
+//            builder.simpleDateFormat(DatePattern.NORM_DATETIME_PATTERN);
+//            builder.modules(new JavaTimeModule());
+//        };
+//    }
+//}

+ 19 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/config/RestTemplateConfig.java

@@ -0,0 +1,19 @@
+package com.jiayue.ipfcst.common.core.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * RestTemplateConfig
+ *
+ * @author L.ym
+ * @version 3.0
+ **/
+@Configuration
+public class RestTemplateConfig {
+    @Bean
+    public RestTemplate restTemplate() {
+        return new RestTemplate();
+    }
+}

+ 18 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/CommonConstants.java

@@ -0,0 +1,18 @@
+package com.jiayue.ipfcst.common.core.constant;
+
+/**
+ * CommonConstants
+ *
+ * @author L.ym
+ * @version 3.0
+ **/
+public interface CommonConstants {
+    /**
+     * 成功标记
+     */
+    Integer SUCCESS = 0;
+    /**
+     * 失败标记
+     */
+    Integer FAIL = 1;
+}

+ 14 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/SecurityConstants.java

@@ -0,0 +1,14 @@
+package com.jiayue.ipfcst.common.core.constant;
+
+/**
+ * SecurityConstants
+ *
+ * @author L.ym
+ * @version 3.0
+ **/
+public interface SecurityConstants {
+    /**
+     * 刷新
+     */
+    String REFRESH_TOKEN = "refresh_token";
+}

+ 25 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/enums/ResponseEnum.java

@@ -0,0 +1,25 @@
+package com.jiayue.ipfcst.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 数据信息状态枚举类
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/6/24 9:34
+ */
+@Getter
+@AllArgsConstructor
+public enum ResponseEnum {
+    /**
+     * 0 表示返回成功
+     */
+    SUCCESS(0, "操作成功!"),
+    FAILED(1, "操作失败!"),
+    ERROR(-1, "系统错误!");
+
+    private Integer code;
+    private String message;
+}

+ 21 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/enums/SysUserRoleEnum.java

@@ -0,0 +1,21 @@
+package com.jiayue.ipfcst.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 系统用户角色枚举
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/6 14:49
+ */
+@Getter
+@AllArgsConstructor
+public enum SysUserRoleEnum {
+    E1(1, "系统管理员"),
+    E2(2, "场站管理员"),
+    E3(3, "场站业务员");
+    private Integer code;
+    private String message;
+}

+ 21 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/enums/SysUserStatusEnum.java

@@ -0,0 +1,21 @@
+package com.jiayue.ipfcst.common.core.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 系统用户状态枚举
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/5 15:05
+ */
+@Getter
+@AllArgsConstructor
+public enum SysUserStatusEnum {
+    E1(1, "正常"),
+    E2(2, "锁定"),
+    E3(3, "禁用");
+    private Integer code;
+    private String message;
+}

+ 30 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/exception/BusinessException.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.common.core.exception;
+
+import lombok.NoArgsConstructor;
+
+/**
+ * 业务异常
+ *
+ * @author zzy
+ * @version 2.0
+ * @since 2018/10/11 11:08
+ */
+@NoArgsConstructor
+public class BusinessException extends Exception{
+
+    public BusinessException(String message) {
+        super(message);
+    }
+
+    public BusinessException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public BusinessException(Throwable cause) {
+        super(cause);
+    }
+
+    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
+}

+ 23 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/config/IntegrationConfig.java

@@ -0,0 +1,23 @@
+package com.jiayue.ipfcst.common.core.integration.config;
+
+import com.jiayue.ipfcst.common.core.integration.correct.dq.CForePowerShortTermCorrect;
+import com.jiayue.ipfcst.common.core.integration.correct.dq.IForePowerShortTermCorrect;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @description: 一体化配置类
+ * @author: yuanhao
+ * @createDate: 2021/9/6
+ * @version: 1.0
+ */
+@Configuration
+public class IntegrationConfig {
+
+    @Bean
+    @ConditionalOnMissingBean(IForePowerShortTermCorrect.class)
+    public IForePowerShortTermCorrect forePowerShortTermCorrect(){
+        return new CForePowerShortTermCorrect();
+    }
+}

+ 21 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/constant/CacheConstant.java

@@ -0,0 +1,21 @@
+package com.jiayue.ipfcst.common.core.integration.constant;
+
+/**
+ * @description: 缓存常量
+ * @author: yuanhao
+ * @createDate: 2021/8/20
+ * @version: 1.0
+ */
+public interface CacheConstant {
+
+    /**
+     * token缓存存储位置
+     */
+    String TOKEN_DETAILS = "token_details";
+    /**
+     * token缓存存储key
+     */
+    String TOKEN_KEY = "token_key";
+
+    String CACHE_NAME ="integration";
+}

+ 46 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/constant/ConnectConstant.java

@@ -0,0 +1,46 @@
+package com.jiayue.ipfcst.common.core.integration.constant;
+
+/**
+ * @description: 交互常量
+ * @author: yuanhao
+ * @createDate: 2021/8/20
+ * @version: 1.0
+ */
+public interface ConnectConstant {
+
+    /**
+     * 数据传输类型:功率预测主站下发
+     */
+    String  TRANSFER_TYPE_DOWNLOAD = "download";
+    /**
+     * 数据传输类型:功率预测子站回传
+     */
+    String  TRANSFER_TYPE_UPLOAD = "upload";
+    /**
+     * 数据传输类型:一体化平台修正下发
+     */
+    String  TRANSFER_TYPE_CORRECT = "correct";
+
+    /**
+     * 换行
+     */
+    String LINE_CONSTANT ="\n";
+    /**
+     * 空格1
+     */
+    String SPACE1_CONSTANT = " ";
+    /**
+     * 空格2
+     */
+    String SPACE2_CONSTANT = "  ";
+    /**
+     * 空格3
+     */
+    String SPACE3_CONSTANT = "   ";
+    /**
+     * 空格4
+     */
+    String SPACE4_CONSTANT = "    ";
+
+
+}

+ 47 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/constant/DataTypeConstant.java

@@ -0,0 +1,47 @@
+package com.jiayue.ipfcst.common.core.integration.constant;
+/**
+ * @description: 数据类型常量
+ * @author: yuanhao
+ * @createDate: 2021/8/20
+ * @version: 1.0
+ */
+public interface DataTypeConstant {
+
+    /**
+     * 预测(Forecast)
+     * 数据类型:FORE
+     */
+    String FORE_TYPE = "FORE";
+
+    /**
+     * 概率分布(ProbabilityDistribution)
+     * 数据类型:
+     */
+    String PROBDIST_TYPE = "PROBDIST";
+
+    /**
+     *统计(Statistics)
+     * 数据类型:STAT
+     */
+    String STAT_TYPE = "STAT";
+
+    /**
+     * 优化后预测(CorrectForecast)
+     * 数据类型:CORRFORE
+     */
+    String CORRFORE_TYPE = "CORRFORE";
+
+    /**
+     * 超短期修正(CorrectUltraShort)
+     * 数据类型:CORRULTRSHOR
+     */
+    String CORRULTRSHOR_TYPE = "CORRULTRSHOR";
+
+    /**
+     * 检修计划(RepairPlan)
+     * 数据类型:REPAPLAN
+     */
+    String REPAPLAN_TYPE = "REPAPLAN";
+
+
+}

+ 77 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/constant/StatusConstant.java

@@ -0,0 +1,77 @@
+package com.jiayue.ipfcst.common.core.integration.constant;
+
+/**
+ * @description: 状态常量
+ * @author: yuanhao
+ * @createDate: 2021/8/20
+ * @version: 1.0
+ */
+public interface StatusConstant {
+
+    /**
+     *  请求成功
+     */
+    String REQUEST_SUCCESS = "T200";
+    /**
+     * token已过期
+     */
+    String TOKEN_EXPIRE = "I101";
+    /**
+     * 无效token
+     */
+    String TOKEN_INVALID = "I102";
+
+    /**
+     * 签名失败
+     */
+    String AUTOGRAPH_FAIL ="I103";
+
+    /**
+     * 用户未登录,请先登录
+     */
+    String LOGIN_NOT ="I104";
+
+    /**
+     * 返回非json格式
+     */
+    String RESPONSE_ERROR1="E500";
+    /**
+     * 返回空
+     */
+    String RESPONSE_ERROR2="E600";
+    /**
+     * 链接超时断开
+     */
+    String RESPONSE_ERROR3="E700";
+    /**
+     * 未请求到token
+     */
+    String RESPONSE_ERROR4="E800";
+
+
+
+    /**
+     * 上午
+     */
+    String AM_DAY ="AM";
+    /**
+     * 下午
+     */
+
+    String PM_DAY = "PM";
+
+
+    String BEAN_TYPE_DEFAULT = "default";
+
+    String BEAN_TYPE_REAL = "real";
+
+
+    String INTEGRATION_SIGN = "integration";
+
+
+
+
+
+
+
+}

+ 32 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/correct/dq/CForePowerShortTermCorrect.java

@@ -0,0 +1,32 @@
+package com.jiayue.ipfcst.common.core.integration.correct.dq;
+
+import com.jiayue.ipfcst.common.core.integration.constant.StatusConstant;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description:
+ * @author: yuanhao
+ * @createDate: 2021/9/6
+ * @version: 1.0
+ */
+@Component
+public class CForePowerShortTermCorrect implements IForePowerShortTermCorrect {
+    @Override
+    public String pushData(String el, Integer elType, List forcast, List nwp, Long starTime, Long endTime) {
+        return null;
+    }
+
+    @Override
+    public Map getCorrectData(Integer elType) {
+        return null;
+    }
+
+    @Override
+    public String beanType() {
+        return StatusConstant.BEAN_TYPE_DEFAULT;
+    }
+}

+ 26 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/integration/correct/dq/IForePowerShortTermCorrect.java

@@ -0,0 +1,26 @@
+package com.jiayue.ipfcst.common.core.integration.correct.dq;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 一体化短期修正接口
+ *
+ * @author yh
+ * @version 3.0
+ * @since 2020/4/13 20:00
+ */
+public interface IForePowerShortTermCorrect {
+
+    /**
+     * 上报文件生成
+     */
+    public String pushData(String el, Integer elType,List forcast, List nwp, Long starTime, Long endTime);
+    /**
+     * 获取上报文件类型
+     */
+    public Map getCorrectData(Integer elType);
+
+
+    public String beanType();
+}

+ 35 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/jackson/JavaTimeModule.java

@@ -0,0 +1,35 @@
+package com.jiayue.ipfcst.common.core.jackson;
+
+import cn.hutool.core.date.DatePattern;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.datatype.jsr310.PackageVersion;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * java 8 时间默认序列化
+ *
+ * @author L.ym
+ * @version 3.0
+ **/
+public class JavaTimeModule extends SimpleModule {
+
+    public JavaTimeModule() {
+        super(PackageVersion.VERSION);
+        this.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
+        this.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
+        this.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DatePattern.NORM_TIME_PATTERN)));
+        this.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
+        this.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
+        this.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DatePattern.NORM_TIME_PATTERN)));
+    }
+}

+ 44 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/BeanMapUtil.java

@@ -0,0 +1,44 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import org.springframework.cglib.beans.BeanMap;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * bean和map互转工具
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/10/11 14:30
+ */
+public class BeanMapUtil {
+    /**
+     * 将对象装换为map
+     * @param bean 实体对象
+     * @param <T> 实体对象泛型
+     * @return map
+     */
+    public static <T> Map<String, Object> beanToMap(T bean) {
+        Map<String, Object> map = new HashMap<>();
+        if (bean != null) {
+            BeanMap beanMap = BeanMap.create(bean);
+            for (Object key : beanMap.keySet()) {
+                map.put(key+"", beanMap.get(key));
+            }
+        }
+        return map;
+    }
+
+    /**
+     * 将map装换为javabean对象
+     * @param map map
+     * @param bean bean 类
+     * @return bean对象
+     */
+    public static <T> T mapToBean(Map<String, Object> map,T bean) {
+        BeanMap beanMap = BeanMap.create(bean);
+        beanMap.putAll(map);
+        return bean;
+    }
+}

+ 96 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/ClassUtil.java

@@ -0,0 +1,96 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import lombok.experimental.UtilityClass;
+import org.springframework.core.BridgeMethodResolver;
+import org.springframework.core.DefaultParameterNameDiscoverer;
+import org.springframework.core.MethodParameter;
+import org.springframework.core.ParameterNameDiscoverer;
+import org.springframework.core.annotation.AnnotatedElementUtils;
+import org.springframework.core.annotation.SynthesizingMethodParameter;
+import org.springframework.util.ClassUtils;
+import org.springframework.web.method.HandlerMethod;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * 类工具类
+ *
+ * @author L.cm
+ */
+@UtilityClass
+public class ClassUtil extends ClassUtils {
+	private final ParameterNameDiscoverer PARAMETERNAMEDISCOVERER = new DefaultParameterNameDiscoverer();
+
+	/**
+	 * 获取方法参数信息
+	 *
+	 * @param constructor    构造器
+	 * @param parameterIndex 参数序号
+	 * @return {MethodParameter}
+	 */
+	public MethodParameter getMethodParameter(Constructor<?> constructor, int parameterIndex) {
+		MethodParameter methodParameter = new SynthesizingMethodParameter(constructor, parameterIndex);
+		methodParameter.initParameterNameDiscovery(PARAMETERNAMEDISCOVERER);
+		return methodParameter;
+	}
+
+	/**
+	 * 获取方法参数信息
+	 *
+	 * @param method         方法
+	 * @param parameterIndex 参数序号
+	 * @return {MethodParameter}
+	 */
+	public MethodParameter getMethodParameter(Method method, int parameterIndex) {
+		MethodParameter methodParameter = new SynthesizingMethodParameter(method, parameterIndex);
+		methodParameter.initParameterNameDiscovery(PARAMETERNAMEDISCOVERER);
+		return methodParameter;
+	}
+
+	/**
+	 * 获取Annotation
+	 *
+	 * @param method         Method
+	 * @param annotationType 注解类
+	 * @param <A>            泛型标记
+	 * @return {Annotation}
+	 */
+	public <A extends Annotation> A getAnnotation(Method method, Class<A> annotationType) {
+		Class<?> targetClass = method.getDeclaringClass();
+		// The method may be on an interface, but we need attributes from the target class.
+		// If the target class is null, the method will be unchanged.
+		Method specificMethod = ClassUtils.getMostSpecificMethod(method, targetClass);
+		// If we are dealing with method with generic parameters, find the original method.
+		specificMethod = BridgeMethodResolver.findBridgedMethod(specificMethod);
+		// 先找方法,再找方法上的类
+		A annotation = AnnotatedElementUtils.findMergedAnnotation(specificMethod, annotationType);
+		;
+		if (null != annotation) {
+			return annotation;
+		}
+		// 获取类上面的Annotation,可能包含组合注解,故采用spring的工具类
+		return AnnotatedElementUtils.findMergedAnnotation(specificMethod.getDeclaringClass(), annotationType);
+	}
+
+	/**
+	 * 获取Annotation
+	 *
+	 * @param handlerMethod  HandlerMethod
+	 * @param annotationType 注解类
+	 * @param <A>            泛型标记
+	 * @return {Annotation}
+	 */
+	public <A extends Annotation> A getAnnotation(HandlerMethod handlerMethod, Class<A> annotationType) {
+		// 先找方法,再找方法上的类
+		A annotation = handlerMethod.getMethodAnnotation(annotationType);
+		if (null != annotation) {
+			return annotation;
+		}
+		// 获取类上面的Annotation,可能包含组合注解,故采用spring的工具类
+		Class<?> beanType = handlerMethod.getBeanType();
+		return AnnotatedElementUtils.findMergedAnnotation(beanType, annotationType);
+	}
+
+}

+ 206 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/CommonUtil.java

@@ -0,0 +1,206 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.*;
+import java.net.URI;
+import java.nio.file.FileSystem;
+import java.nio.file.*;
+import java.util.*;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * 通用工具类
+ *
+ * @author zzy
+ * @version 2.0
+ * @since 2018/11/20 17:27
+ */
+@Slf4j
+public abstract class CommonUtil {
+
+    private static final int BUFFER_SIZE = 2 * 1024;
+    public static Properties props = System.getProperties();
+    public static String osName = props.getProperty("os.name");
+
+    /**
+     * 获取随机数
+     *
+     * @param min 最小值
+     * @param max 最大值
+     * @return 随机数
+     */
+    public static long getRandom(int min, int max) {
+        return Math.round(Math.random() * (max - min) + min);
+    }
+
+    /**
+     * 功能描述: 获取异常堆栈信息
+     *
+     * @param t 异常
+     * @return String 异常堆栈信息
+     */
+    public static String printStackTraceToString(Throwable t) {
+        StringWriter sw = new StringWriter();
+        t.printStackTrace(new PrintWriter(sw, true));
+        return sw.getBuffer().toString();
+    }
+
+    /**
+     * 获取目录下所有文件(按时间排序)
+     *
+     * @param path
+     * @return
+     */
+    public static List<File> getFileSort(String path) {
+
+        List<File> list = getFiles(path, new ArrayList<>());
+
+        if (list != null && list.size() > 0) {
+
+            Collections.sort(list, new Comparator<File>() {
+                @Override
+                public int compare(File file, File newFile) {
+                    if (file.lastModified() < newFile.lastModified()) {
+                        return 1;
+                    } else if (file.lastModified() == newFile.lastModified()) {
+                        return 0;
+                    } else {
+                        return -1;
+                    }
+
+                }
+            });
+
+        }
+
+        return list;
+    }
+
+    /**
+     * 获取目录下所有文件
+     *
+     * @param realpath 文件路径
+     * @param files    返回的文件集合
+     * @return files
+     */
+    public static List<File> getFiles(String realpath, List<File> files) {
+
+        File realFile = new File(realpath);
+        File[] subfiles = realFile.listFiles();
+        for (File file : subfiles) {
+            files.add(file);
+        }
+        return files;
+    }
+
+    /**
+     * 压缩成ZIP 方法1
+     *
+     * @param srcDir           压缩文件夹路径
+     * @param out              压缩文件输出流
+     * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
+     *                         false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
+     * @throws RuntimeException 压缩失败会抛出运行时异常
+     */
+    public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure)
+            throws RuntimeException {
+
+        long start = System.currentTimeMillis();
+        ZipOutputStream zos = null;
+        try {
+            zos = new ZipOutputStream(out);
+            File sourceFile = new File(srcDir);
+            compress(sourceFile, zos, sourceFile.getName(), KeepDirStructure);
+            long end = System.currentTimeMillis();
+            System.out.println("压缩完成,耗时:" + (end - start) + " ms");
+        } catch (Exception e) {
+            throw new RuntimeException("zip error from ZipUtils", e);
+        } finally {
+            if (zos != null) {
+                try {
+                    zos.close();
+                } catch (IOException e) {
+                    log.error("系统错误", e);
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 递归压缩方法
+     *
+     * @param sourceFile       源文件
+     * @param zos              zip输出流
+     * @param name             压缩后的名称
+     * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
+     *                         false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
+     * @throws Exception
+     */
+    private static void compress(File sourceFile, ZipOutputStream zos, String name,
+                                 boolean KeepDirStructure) throws Exception {
+        byte[] buf = new byte[BUFFER_SIZE];
+        if (sourceFile.isFile()) {
+            // 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
+            zos.putNextEntry(new ZipEntry(name));
+            // copy文件到zip输出流中
+            int len;
+            FileInputStream in = new FileInputStream(sourceFile);
+            while ((len = in.read(buf)) != -1) {
+                zos.write(buf, 0, len);
+            }
+            zos.closeEntry();
+            in.close();
+        } else {
+            File[] listFiles = sourceFile.listFiles();
+            if (listFiles == null || listFiles.length == 0) {
+                // 需要保留原来的文件结构时,需要对空文件夹进行处理
+                if (KeepDirStructure) {
+                    // 空文件夹的处理
+                    zos.putNextEntry(new ZipEntry(name + "/"));
+                    // 没有文件,不需要文件的copy
+                    zos.closeEntry();
+                }
+            } else {
+                for (File file : listFiles) {
+                    // 判断是否需要保留原来的文件结构
+                    if (KeepDirStructure) {
+                        // 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
+                        // 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
+                        compress(file, zos, name + "/" + file.getName(), KeepDirStructure);
+                    } else {
+                        compress(file, zos, file.getName(), KeepDirStructure);
+                    }
+
+                }
+            }
+        }
+    }
+
+    /**
+     * 参数1:原始路径
+     * 参数2:.zip结束后的路径:例:D:\\temp\\playbook_1936_拍照商品照片.zip\\11\\22。此时11\\22\\文件名称就是参数2
+     * 参数3:固定写死的zip路径
+     * 注意: 1:zip压缩包不能动态的添加文件夹,所以在压缩之前需要生成好全部的文件夹。
+     * 2:在往zip包下不同文件夹添加数据时,需要注意:完整路径。例:D:/temp/playbook_1936_拍照商品照片.zip/33/44/时toUrl的路径开始地必须时zip之后第一个开始
+     */
+    public static boolean addZip(String zipUrl, String fromUrl, String toUrl) throws IOException {
+        Map<String, String> env = new HashMap<>();
+        env.put("create", "true");
+        //使用语法定位文件系统
+        //在java.net.JarURLConnection中定义
+        Path path = Paths.get(zipUrl);
+        URI uri = URI.create("jar:" + path.toUri());
+        try (FileSystem zipfs = FileSystems.newFileSystem(uri, env)) {
+            Path externalTxtFile = Paths.get(fromUrl);
+            Path pathInZipfile = zipfs.getPath(toUrl);
+            //将文件复制到zip文件中
+            Files.copy(externalTxtFile, pathInZipfile, StandardCopyOption.REPLACE_EXISTING);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+}

+ 89 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/CronUtils.java

@@ -0,0 +1,89 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import org.quartz.CronExpression;
+import org.quartz.CronScheduleBuilder;
+import org.quartz.CronTrigger;
+import org.quartz.TriggerBuilder;
+
+import java.text.ParseException;
+import java.util.Date;
+
+/**
+ * cron表达式工具类
+ */
+public class CronUtils {
+    /**
+     * 返回一个布尔值代表一个给定的Cron表达式的有效性
+     *
+     * @param cronExpression Cron表达式
+     * @return boolean 表达式是否有效
+     */
+    public static boolean isValid(String cronExpression) {
+        return CronExpression.isValidExpression(cronExpression);
+    }
+
+    /**
+     * 返回一个字符串值,表示该消息无效Cron表达式给出有效性
+     *
+     * @param cronExpression Cron表达式
+     * @return String 无效时返回表达式错误描述,如果有效返回null
+     */
+    public static String getInvalidMessage(String cronExpression) {
+        try {
+            new CronExpression(cronExpression);
+            return null;
+        } catch (ParseException pe) {
+            return pe.getMessage();
+        }
+    }
+
+    /**
+     * 返回下一个执行时间根据给定的Cron表达式
+     *
+     * @param cronExpression Cron表达式
+     * @return Date 下次Cron表达式执行时间
+     */
+    public static Date getNextExecution(String cronExpression) {
+        try {
+            CronExpression cron = new CronExpression(cronExpression);
+            return cron.getNextValidTimeAfter(new Date(System.currentTimeMillis()));
+        } catch (ParseException e) {
+            throw new IllegalArgumentException(e.getMessage());
+        }
+    }
+
+
+    /**
+     * 上次执行时间
+     *
+     * @param cron 表达式
+     * @return 上次时间
+     */
+    public static Date getLastTriggerTime(String cron) {
+
+        CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity("Caclulate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build();
+        Date time0 = trigger.getStartTime();
+        Date time1 = trigger.getFireTimeAfter(time0);
+        Date time2 = trigger.getFireTimeAfter(time1);
+        Date time3 = trigger.getFireTimeAfter(time2);
+        long l = time1.getTime() - (time3.getTime() - time2.getTime());
+//		Date date = new Date(l);
+//		SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date();
+        date.setTime(l);
+        return date;
+    }
+
+    /**
+     * 获取下次执行时间(getFireTimeAfter,也可以下下次...)
+     *
+     * @param cron 表达式
+     * @return 下次执行时间
+     */
+    public static Date getNextTriggerTime(String cron) {
+        CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity("Caclulate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build();
+        Date time0 = trigger.getStartTime();
+        Date time1 = trigger.getFireTimeAfter(time0);
+        return time1;
+    }
+}

+ 174 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/DateMomentUtil.java

@@ -0,0 +1,174 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import com.sun.istack.internal.NotNull;
+import java.util.Calendar;
+
+/**
+ * 时刻工具类
+ *
+ * @author zzy
+ * @version 2.0
+ * @since 2018/11/2 11:31
+ */
+public abstract class DateMomentUtil {
+
+
+    /**
+     * 获取月份
+     *
+     * @param dateTime 时间,单位毫秒
+     * @return 月份
+     */
+    public static Integer getMonth(@NotNull final Long dateTime) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeInMillis(dateTime);
+        return calendar.get(Calendar.MONTH) + 1;
+    }
+
+    /**
+     * 获取指定时间在当天所处于的时刻
+     * 例如:dateTime:2018-10-22 16:44:00 momentLength: 15分钟,既 15*60*1000毫秒
+     * 从0点0分开始计算,0点0分-0点15为第一个时刻,依次类推该时间的时刻数为67
+     *
+     * @param dateTime     时间毫秒
+     * @param momentLength 时刻长度,单位毫秒
+     * @return 时刻
+     */
+    public static int getMoment(@NotNull final Long dateTime, @NotNull final Long momentLength) {
+        return (int) ((dateTime - DateMomentUtil.getDayStartTime(dateTime)) / momentLength) + 1;
+    }
+
+    /**
+     * 获取指定时间所在时刻的标记时间 <br>
+     * 例如:dateTime:2018-10-22 16:44:00 momentLength: 15*60*1000 <br>
+     * 当前标记signType:1 那么该时刻的标记时间为2018-10-22 16:30:00
+     * 当后标记singType:2 那么该时刻的标记时间为2018-10-22 16:45:00
+     *
+     * @param dateTime     时间毫秒
+     * @param signType     标记方式:1前标记 2后标记
+     * @param momentLength 时刻长度,单位:毫秒
+     * @return 指定时间所在时刻的标记时间,单位:毫秒
+     */
+    public static long getMomentTime(@NotNull final Long dateTime, @NotNull final int signType, @NotNull final Long momentLength) throws Exception {
+        if (24 * 3600 * 1000L % momentLength != 0)
+            throw new Exception("时刻长度非法,时刻长度需要能够被一天整除");
+        int moment = DateMomentUtil.getMoment(dateTime, momentLength);// 获取指定时间所在时刻数
+        long differentTime = moment * momentLength;// 获取从0分0秒开始到现在的时间间隔,单位:毫秒
+        long dayStartTime = DateMomentUtil.getDayStartTime(dateTime);
+        switch (signType) {
+            case 2:
+                return dayStartTime + differentTime;
+            default:
+                return dayStartTime + differentTime - momentLength;
+        }
+    }
+
+    /**
+     * 获取指定时间所在天第一个时刻的标记时间 <br>
+     * 例如:dateTime:2018-10-22 16:44:00 momentLength: 15*60*1000 <br>
+     * 当前标记signType:1 那么第一个时刻的标记时间为2018-10-22 00:00:00
+     * 当后标记singType:2 那么第一个时刻的标记时间为2018-10-22 00:15:00
+     *
+     * @param dateTime     时间毫秒
+     * @param signType     标记方式:1前标记 2后标记
+     * @param momentLength 时刻长度,单位:毫秒
+     * @return 一天第一个时刻的标记时间,单位:毫秒
+     */
+    public static long getDayFirstMomentTime(@NotNull final Long dateTime, @NotNull final int signType, @NotNull final Long momentLength) throws Exception {
+        if (24 * 3600 * 1000L % momentLength != 0)
+            throw new Exception("时刻长度非法,时刻长度需要能够被一天整除");
+        long dayStartTime = DateMomentUtil.getDayStartTime(dateTime);
+        switch (signType) {
+            case 2:
+                return dayStartTime + momentLength;
+            default:
+                return dayStartTime;
+        }
+    }
+
+    /**
+     * 获取指定时间所在天的最后一个时刻的标记时间 <br>
+     * 例如:dateTime:2018-10-22 16:44:00 momentLength: 15*60*1000 <br>
+     * 当前标记signType:1 那么最后一个时刻的标记时间为2018-10-22 23:45:00
+     * 当后标记singType:2 那么最后一个时刻的标记时间为2018-10-23 00:00:00
+     *
+     * @param dateTime     时间毫秒
+     * @param signType     标记方式:1前标记 2后标记, 当null时按照前标记1处理
+     * @param momentLength 时刻长度,单位:毫秒
+     * @return 一天第一个时刻的标记时间,单位:毫秒
+     */
+    public static long getDayLastMomentTime(@NotNull final Long dateTime, @NotNull final int signType, @NotNull final Long momentLength) throws Exception {
+        if (24 * 3600 * 1000L % momentLength != 0)
+            throw new Exception("时刻长度非法,时刻长度需要能够被一天整除");
+        Calendar date = Calendar.getInstance();
+        date.setTimeInMillis(dateTime);
+        date.add(Calendar.DATE, 1);
+        date.set(Calendar.HOUR_OF_DAY, 0);
+        date.set(Calendar.MINUTE, 0);
+        date.set(Calendar.SECOND, 0);
+        date.set(Calendar.MILLISECOND, 0);
+        switch (signType) {
+            case 2:
+                return date.getTimeInMillis();
+            default:
+                return date.getTimeInMillis() - momentLength;
+        }
+    }
+
+    /**
+     * 获取指定时间所在天的0点0分
+     *
+     * @param dateTime 时间毫秒
+     * @return 0点0分的毫秒
+     */
+    public static long getDayStartTime(@NotNull final Long dateTime) {
+        Calendar date = Calendar.getInstance();
+        date.setTimeInMillis(dateTime);
+        date.set(Calendar.HOUR_OF_DAY, 0);
+        date.set(Calendar.MINUTE, 0);
+        date.set(Calendar.SECOND, 0);
+        date.set(Calendar.MILLISECOND, 0);
+        return date.getTimeInMillis();
+    }
+
+    /**
+     * 获取指定时间所在天的23点59分59秒
+     *
+     * @param dateTime 时间毫秒
+     * @return 23点59分59秒的毫秒
+     */
+    public static long getDayLastTime(@NotNull final Long dateTime) {
+        Calendar date = Calendar.getInstance();
+        date.setTimeInMillis(dateTime);
+        date.set(Calendar.HOUR_OF_DAY, 23);
+        date.set(Calendar.MINUTE, 59);
+        date.set(Calendar.SECOND, 59);
+        date.set(Calendar.MILLISECOND, 999);
+        return date.getTimeInMillis();
+    }
+
+    /**
+     * 获取两个时间间的间隔天数(自然天)
+     * @param dateFrom 开始时间
+     * @param dateTo 结束时间
+     * @return 自然天数
+     */
+    public static Integer getDaysBetweenTwoDate(Long dateFrom, Long dateTo) {
+        return (int) ((DateMomentUtil.getDayStartTime(dateTo) - DateMomentUtil.getDayStartTime(dateFrom)) / (1000 * 60 * 60 * 24L));
+    }
+
+
+
+    /**
+     * 获取指定时间段有多少时刻
+     * 例如:dateTime:2018-10-22 16:44:00 momentLength: 15分钟,既 15*60*1000毫秒
+     * 从0点0分开始计算,0点0分-0点15为第一个时刻,依次类推该时间的时刻数为67
+     *
+     * @param momentLength 时刻长度,单位毫秒
+     * @return 时刻
+     */
+    public static int getIntervalMoment(@NotNull final Long startTime,@NotNull final Long endTime, @NotNull final Long momentLength) {
+        return (int) ((endTime - startTime) / momentLength) + 1;
+    }
+
+}

+ 251 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/DateTimeUtil.java

@@ -0,0 +1,251 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import com.sun.istack.internal.NotNull;
+import org.apache.commons.lang.time.DateUtils;
+
+import java.math.BigDecimal;
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * 时间工具类
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/2 13:09
+ */
+@SuppressWarnings("WeakerAccess")
+public class DateTimeUtil {
+
+    /**
+     * 获取月份
+     *
+     * @param dateTime 时间,单位:毫秒
+     * @return 月份
+     */
+    public static int getMonth(@NotNull final Long dateTime) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeInMillis(dateTime);
+        return calendar.get(Calendar.MONTH) + 1;
+    }
+
+    /**
+     * 获取指定时间在当天所处于的时刻(15分钟为一个时刻)
+     * 例如:dateTime:2018-10-22 16:44:00
+     * 从0点0分开始计算,0点0分-0点15为第一个时刻,依次类推该时间的时刻数为67
+     *
+     * @param dateTime 时间,单位:毫秒
+     * @return 时刻
+     */
+    public static int getMomentFor15Minute(@NotNull final Long dateTime) {
+        return (int) ((dateTime - DateTimeUtil.getDayStartTime(dateTime).getTime()) / (15 * 60 * 1000)) + 1;
+    }
+
+    /**
+     * 获取指定时间在当天所处于的时刻(5分钟为一个时刻)
+     * 例如:dateTime:2018-10-22 01:44:00
+     * 从0点0分开始计算,0点0分-0点5为第一个时刻,依次类推该时间的时刻数为
+     *
+     * @param dateTime 时间,单位:毫秒
+     * @return 时刻
+     */
+    public static int getMomentFor5Minute(@NotNull final Long dateTime) {
+        return (int) ((dateTime - DateTimeUtil.getDayStartTime(dateTime).getTime()) / (5 * 60 * 1000)) + 1;
+    }
+
+    /**
+     * 获取指定时间所在时刻的标记时间(15分钟为一个时刻)<br>
+     * 例如:dateTime:2018-10-22 16:44:00 <br>
+     * 标记时间为2018-10-22 16:30:00
+     *
+     * @param dateTime 时间,单位:毫秒
+     * @return 指定时间所在时刻的标记时间,单位:毫秒
+     */
+    public static Date getMomentTimeFor15Minute(@NotNull final Long dateTime) {
+        int moment = DateTimeUtil.getMomentFor15Minute(dateTime);// 获取指定时间所在时刻数
+        long differentTime = moment * 15 * 60 * 1000;// 获取从0分0秒开始到现在的时间间隔,单位:毫秒
+        long dayStartTime = DateTimeUtil.getDayStartTime(dateTime).getTime();
+        return new Date(dayStartTime + differentTime - 15 * 60 * 1000);
+    }
+
+    /**
+     * 获取指定时间所在时刻的标记时间(5分钟为一个时刻)<br>
+     * 例如:dateTime:2018-10-22 16:44:00 <br>
+     * 标记时间为2018-10-22 16:40:00
+     *
+     * @param dateTime 时间,单位:毫秒
+     * @return 指定时间所在时刻的标记时间,单位:毫秒
+     */
+    public static Date getMomentTimeFor5Minute(@NotNull final Long dateTime) {
+        int moment = DateTimeUtil.getMomentFor15Minute(dateTime);// 获取指定时间所在时刻数
+        long differentTime = moment * 5 * 60 * 1000;// 获取从0分0秒开始到现在的时间间隔,单位:毫秒
+        long dayStartTime = DateTimeUtil.getDayStartTime(dateTime).getTime();
+        return new Date(dayStartTime + differentTime - 5 * 60 * 1000);
+    }
+
+    /**
+     * 获取当前时间(时间粒度分钟)
+     *
+     * @return 当前时间
+     */
+    public static Date getCurrentTimeForMinute() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return calendar.getTime();
+    }
+
+    /**
+     * 获取指定时间所在天的0点0分
+     *
+     * @param dateTime 时间毫秒
+     * @return 0点0分的毫秒
+     */
+    public static Date getDayStartTime(@NotNull final Long dateTime) {
+        Calendar date = Calendar.getInstance();
+        date.setTimeInMillis(dateTime);
+        date.set(Calendar.HOUR_OF_DAY, 0);
+        date.set(Calendar.MINUTE, 0);
+        date.set(Calendar.SECOND, 0);
+        date.set(Calendar.MILLISECOND, 0);
+        return date.getTime();
+    }
+
+    /**
+     * 今日凌晨 毫秒
+     *
+     * @return 时间
+     */
+    public static long getMillisecondsSubDay() {
+
+        Calendar c = Calendar.getInstance();
+
+        return c.getTimeInMillis() - DateUtils.getFragmentInMilliseconds(c, Calendar.DAY_OF_MONTH);
+    }
+
+    /**
+     * 获取指定时间所在天的23点59分59秒
+     *
+     * @param dateTime 时间毫秒
+     * @return 23点59分59秒的毫秒
+     */
+    public static Date getDayLastTime(@NotNull final Long dateTime) {
+        Calendar date = Calendar.getInstance();
+        date.setTimeInMillis(dateTime);
+        date.set(Calendar.HOUR_OF_DAY, 23);
+        date.set(Calendar.MINUTE, 59);
+        date.set(Calendar.SECOND, 59);
+        date.set(Calendar.MILLISECOND, 999);
+        return date.getTime();
+    }
+
+    /**
+     * 获取两个时间间的间隔天数(自然天)
+     *
+     * @param dateFrom 开始时间
+     * @param dateTo   结束时间
+     * @return 自然天数
+     */
+    public static int getDaysBetweenTwoDate(Long dateFrom, Long dateTo) {
+        return (int) ((DateTimeUtil.getDayStartTime(dateTo).getTime() - DateTimeUtil.getDayStartTime(dateFrom).getTime()) / (1000 * 60 * 60 * 24L));
+    }
+
+    /**
+     * 获取两个时间间的间隔间隔时刻数(15分钟一个时刻)
+     *
+     * @param dateFrom 开始时间
+     * @param dateTo   结束时间
+     * @return 间隔时刻数
+     */
+    public static int getMomentsBetweenTwoDate(Long dateFrom, Long dateTo) {
+        return (int) ((dateTo - dateFrom) / (15 * 60 * 1000));
+    }
+
+
+    /**
+     * 获取现在时间
+     *
+     * @return 返回字符串格式 yyyy-MM-dd HH:mm:ss
+     */
+    public static String getStringDate() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateString = formatter.format(currentTime);
+        return dateString;
+    }
+
+    /**
+     * 将长时间格式时间转换为字符串 yyyy-MM-dd HH:mm:ss
+     *
+     * @param dateDate
+     * @return
+     */
+    public static String dateToStrLong(java.util.Date dateDate) {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateString = formatter.format(dateDate);
+        return dateString;
+    }
+
+    /**
+     * 将时间格式字符串转换为时间 HH:mm
+     *
+     * @param strDate
+     * @return
+     */
+    public static Date strToDateLongHM(String strDate) {
+        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm");
+        ParsePosition pos = new ParsePosition(0);
+        Date strtodate = formatter.parse(strDate, pos);
+        return strtodate;
+    }
+
+    /**
+     * 判断tunnel日落
+     *
+     * @param time
+     * @param dfLonIn
+     * @param dfLatIn
+     * @return boolean 返回true,说明时间在日升日落之间,返回false,说明时间在日升之前或者日落之后。
+     */
+    public static boolean checkInSunriseAndSunset(Long time, double dfLonIn, double dfLatIn) {
+        Date date = new Date(time);
+
+        String str1 = SunRiseSet.getSunrise(new BigDecimal(dfLonIn), new BigDecimal(dfLatIn), date);
+        String str2 = SunRiseSet.getSunset(new BigDecimal(dfLonIn), new BigDecimal(dfLatIn), date);
+
+        Date dt1 = null;
+        Date dt2 = null;
+        Date dt3 = null;
+        try {
+            dt1 = strToDateLongHM(dateToStrLong(date).substring(11, 16));
+            dt2 = strToDateLongHM(str1);
+            dt3 = strToDateLongHM(str2);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (dt1.getTime() > dt2.getTime() && dt1.getTime() < dt3.getTime()) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 判断时间是不是今天
+     * @param date
+     * @return    是返回true,不是返回false
+     */
+    public static boolean isNow(Date date) {
+        //当前时间
+        Date now = new Date();
+        SimpleDateFormat sf = new SimpleDateFormat("yyyyMMdd");
+        //获取今天的日期
+        String nowDay = sf.format(now);
+        //对比的时间
+        String day = sf.format(date);
+        return day.equals(nowDay);
+    }
+
+}

+ 41 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/JsonBeanUtil.java

@@ -0,0 +1,41 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONUtil;
+
+import java.util.List;
+
+/**
+ * Json和bean相互转换
+ *
+ * @author bizy
+ * @version 3.0
+ */
+public class JsonBeanUtil {
+
+    /**
+     * json转bean
+     *
+     * @param json json字符串
+     * @param t    泛型
+     * @param <T>  泛型Class对象
+     * @return 泛型集合
+     */
+    public static <T> List<T> jsonToBean(String json, Class<T> t) {
+        JSONArray array = JSONUtil.parseArray(json);
+        List<T> list = array.toList(t);
+        return list;
+    }
+
+    /**
+     * bean转json
+     *
+     * @param list bean集合
+     * @param <T>
+     * @return 返回string对象
+     */
+    public static <T> String beanToJson(List<T> list) {
+        JSONArray jsonArray = JSONUtil.parseArray(list);
+        return jsonArray.toString();
+    }
+}

+ 123 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/JwtUtil.java

@@ -0,0 +1,123 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.StrUtil;
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.JWTVerifier;
+import com.auth0.jwt.algorithms.Algorithm;
+import com.auth0.jwt.exceptions.JWTCreationException;
+import com.auth0.jwt.exceptions.JWTDecodeException;
+import com.auth0.jwt.exceptions.JWTVerificationException;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import lombok.experimental.UtilityClass;
+
+/**
+ * JwtToken
+ *
+ * @author L.ym
+ * @version 3.0
+ **/
+@UtilityClass
+public class JwtUtil {
+
+    public static final String TOKEN_AUTHORIZATION_HEADER = "Authorization";
+    public static final String TOKEN_INNER_HEADER = "X-Token";
+    public static final String TOKEN_PREFIX = "Bearer ";
+
+    private final String SECRET = "!@#xwexe3@!#ds123";
+    private final String ISSUER = "jiayue";
+
+    private final String ROLE_CLAIMS = "role";
+
+    /**
+     * @Description: 单位秒,即过期时间是24个小时
+     */
+    private final long EXPIRATION = 24 * 60 * 60L;
+
+    /**
+     * @Description: 生成 token
+     * @param: [username]
+     * @return: java.lang.String
+     * @Author: Liyiming
+     * @Date: 2019/1/10
+     */
+    public String generateToken(String username) throws IllegalArgumentException, JWTCreationException {
+        Algorithm algorithm = Algorithm.HMAC256(SECRET);
+        String token = JWT.create().withJWTId(IdUtil.fastSimpleUUID())
+                .withSubject(username)
+                .withIssuer(ISSUER)
+                .withIssuedAt(DateUtil.date())
+                .withExpiresAt(DateUtil.date(System.currentTimeMillis() + EXPIRATION * 1000))
+                // 创建一个新的JWT,并使用给定的算法进行标记
+                .sign(algorithm);
+        return TOKEN_PREFIX + token;
+    }
+
+    /**
+     * @Description: 校验 token 是否正确
+     * @param: [token, username]
+     * @return: boolean
+     * @Author: Liyiming
+     * @Date: 2019/1/10
+     */
+    public boolean verify(String token, String username) throws JWTVerificationException {
+        token = tokenToJwt(token);
+        Algorithm algorithm = Algorithm.HMAC256(SECRET);
+        // 在token中附带了username信息
+        JWTVerifier verifier = JWT.require(algorithm).withSubject(username).withIssuer(ISSUER).build();
+        // 验证 token
+        verifier.verify(token);
+        return true;
+    }
+
+    /**
+     * @Description: 校验 token 是否过期
+     * @param: [token]
+     * @return: boolean
+     * @Author: Liyiming
+     * @Date: 2019/1/13
+     */
+    public boolean isTokenExpired(String token) throws JWTDecodeException {
+        token = tokenToJwt(token);
+        DecodedJWT jwt = JWT.decode(token);
+        return jwt.getExpiresAt().before(DateUtil.date());
+    }
+
+    /**
+     * @Description: 获得token中的信息,无需secret解密也能获得
+     * @param: [token]
+     * @return: java.lang.String
+     * @Author: Liyiming
+     * @Date: 2019/1/10
+     */
+    public String getUsername(String token) throws JWTDecodeException {
+        token = tokenToJwt(token);
+        DecodedJWT jwt = JWT.decode(token);
+        return jwt.getSubject();
+    }
+
+    /**
+     * @Description: 获取JWT ID
+     * @param: [token]
+     * @return: java.lang.String
+     * @Author: Liyiming
+     * @Date: 2019/1/10
+     */
+    public String getJwtId(String token) throws JWTDecodeException {
+        token = tokenToJwt(token);
+        DecodedJWT jwt = JWT.decode(token);
+        return jwt.getId();
+    }
+
+    /**
+     * @Description: 获取JWT
+     * @param: [token]
+     * @return: java.lang.String
+     * @Author: Liyiming
+     * @Date: 2019/1/14
+     */
+    public String tokenToJwt(String token) {
+        return StrUtil.removePrefix(token, TOKEN_PREFIX);
+    }
+}

+ 141 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/NumberUtils.java

@@ -0,0 +1,141 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.math.BigDecimal;
+
+/**
+ * 提供高精度的运算支持
+ *
+ * @author bizy
+ * @version 2.0
+ */
+@Slf4j
+public class NumberUtils {
+    private NumberUtils() {
+    }
+
+    /**
+     * 精确的加法运算.
+     *
+     * @param b1    加数
+     * @param b2    加数
+     * @param scale 运算结果小数后精确的位数
+     * @return 结果
+     */
+    public static BigDecimal add(BigDecimal b1, BigDecimal b2, int scale) {
+        return b1.add(b2).setScale(scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 精确的加法运算.
+     *
+     * @param b1 加数
+     * @param b2 加数
+     * @return 保留2位小数
+     */
+    public static BigDecimal add(BigDecimal b1, BigDecimal b2) {
+        return b1.add(b2).setScale(2, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 精确的减法运算.
+     *
+     * @param b1    被减数
+     * @param b2    减数
+     * @param scale 运算结果小数后精确的位数
+     * @return 结果
+     */
+    public static BigDecimal subtract(BigDecimal b1, BigDecimal b2, int scale) {
+        return b1.subtract(b2).setScale(scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+
+    /**
+     * 精确的减法运算.
+     *
+     * @param b1 被减数
+     * @param b2 减数
+     * @return 结果 保留2位小数
+     */
+    public static BigDecimal subtract(BigDecimal b1, BigDecimal b2) {
+        return b1.subtract(b2).setScale(2, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 提供精确的乘法运算,并对运算结果截位.
+     *
+     * @param b1    乘数
+     * @param b2    乘数
+     * @param scale 运算结果小数后精确的位数
+     * @return 结果
+     */
+    public static BigDecimal multiply(BigDecimal b1, BigDecimal b2, int scale) {
+        if (scale < 0) {
+            throw new IllegalArgumentException("The scale must be a positive integer or zero");
+        }
+        return b1.multiply(b2).setScale(scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 提供精确的乘法运算,并对运算结果截位.
+     *
+     * @param b1 乘数
+     * @param b2 乘数
+     * @return 结果 保留2位小数
+     */
+    public static BigDecimal multiply(BigDecimal b1, BigDecimal b2) {
+        return b1.multiply(b2).setScale(2, BigDecimal.ROUND_HALF_UP);
+    }
+
+
+    /**
+     * 提供(相对)精确的除法运算. 由scale参数指定精度,以后的数字四舍五入.
+     *
+     * @param b1    被除数
+     * @param b2    除数
+     * @param scale 表示表示需要精确到小数点以后几位
+     * @return 结果
+     */
+    public static BigDecimal divide(BigDecimal b1, BigDecimal b2, int scale) {
+        if (scale < 0) {
+            throw new IllegalArgumentException("The scale must be a positive integer or zero");
+        }
+        return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 提供(相对)精确的除法运算. 由scale参数指定精度,以后的数字四舍五入.
+     *
+     * @param b1 被除数
+     * @param b2 除数
+     * @return 结果 保留2位小数
+     */
+    public static BigDecimal divide(BigDecimal b1, BigDecimal b2) {
+        return b1.divide(b2, 2, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 提供精确的小数位四舍五入处理.
+     *
+     * @param b     需要四舍五入的数字
+     * @param scale 小数点后保留几位
+     * @return TODO
+     */
+    public static BigDecimal round(BigDecimal b, int scale) {
+        if (scale < 0) {
+            throw new IllegalArgumentException("The scale must be a positive integer or zero");
+        }
+        return b.setScale(scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 提供精确的小数位四舍五入处理.
+     *
+     * @param b 需要四舍五入的数字
+     * @return 保留2位小数
+     */
+    public static BigDecimal round(BigDecimal b) {
+        return b.setScale(2, BigDecimal.ROUND_HALF_UP);
+    }
+}

+ 186 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/ProduceSql.java

@@ -0,0 +1,186 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import cn.hutool.core.util.ReflectUtil;
+import cn.hutool.core.util.StrUtil;
+
+import java.lang.reflect.Field;
+
+/**
+ * TODO
+ *
+ * @author bizy
+ * @version 3.0
+ */
+public class ProduceSql {
+    /**
+     * 生成插入语句
+     *
+     * @param tablename 表明
+     * @param t         有数据的实体
+     * @param <T>       数据实体类型 如 User
+     */
+    public static <T> String getInsertSql(String tablename, T t) throws IllegalArgumentException {
+        //insert into table_name (column_name1,column_name2, ...) values (value1,value2, ...)
+        boolean flag = false;
+        String sql = "";
+        Field[] fields = ReflectUtil.getFieldsDirectly(t.getClass(), false);
+        StringBuffer topHalf = new StringBuffer("insert into " + tablename + " (");
+        StringBuffer afterAalf = new StringBuffer("values (");
+        for (Field field : fields) {
+//            if ("ID".equals(field.getName()) || "id".equals(field.getName())) {
+//                continue;   //id 自动生成无需手动插入
+//            }
+            String underScoreCaseColumn = field.getName();
+            for (int i = 0; i < field.getName().length(); i++) {
+                if (Character.isUpperCase(field.getName().charAt(i)))
+                // 将javabean中小驼峰命名变量的“大写字母”转换为“_小写字母”
+                {
+                    underScoreCaseColumn = field.getName().substring(0, i) + '_' + field.getName().substring(i, i + 1).toLowerCase() + field.getName().substring(i + 1, field.getName().length());
+                }
+            }
+            topHalf.append(underScoreCaseColumn + ",");
+            if (ReflectUtil.getFieldValue(t, underScoreCaseColumn) instanceof String) {
+                afterAalf.append("'" + ReflectUtil.getFieldValue(t, underScoreCaseColumn) + "',");
+                flag = true;
+            } else {
+                afterAalf.append(ReflectUtil.getFieldValue(t, underScoreCaseColumn) + ",");
+                flag = true;
+            }
+        }
+        if (!flag) {
+            throw new IllegalArgumentException(t.getClass() + "NullException.\nThere is no attribute that is not empty.You must provide an object with at least one attribute.");
+        }
+        topHalf = new StringBuffer(StrUtil.removeSuffix(topHalf.toString(), ","));
+        afterAalf = new StringBuffer(StrUtil.removeSuffix(afterAalf.toString(), ","));
+        topHalf.append(") ");
+        afterAalf.append(") ");
+        sql = topHalf.toString() + afterAalf.toString();
+        return sql;
+    }
+
+    /**
+     * 生成更新语句
+     * 必须含有id
+     * 数据实体中 null 与 空字段不参与更新
+     *
+     * @param tablename 数据库中的表明
+     * @param t         有数据的实体
+     * @param <T>       数据实体类型,如 User
+     */
+    public static <T> String getUpdateSql(String tablename, T t) throws IllegalArgumentException {
+        //UPDATE table_name SET column_name1 = value1, column_name2 = value2, ... where ID=xxx
+        //or
+        //UPDATE table_name SET column_name1 = value1, column_name2 = value2, ... where id=xxx
+        boolean flag = false;
+        String sql = "";
+        String id = ""; //保存id列名:ID or id
+        Field[] fields = ReflectUtil.getFieldsDirectly(t.getClass(), false);
+        sql = "update " + tablename + " set ";
+        for (Field field : fields) {
+            StringBuffer tmp = new StringBuffer();
+            if ("ID".equals(field.getName()) || "id".equals(field.getName())) {
+                id = field.getName();
+                continue;//更新的时候无需set id=xxx
+            }
+            if (ReflectUtil.getFieldValue(t, field.getName()) != null && (String) ReflectUtil.getFieldValue(t, field.getName()) != "") {
+
+                String underScoreCaseColumn = field.getName();
+                for (int i = 0; i < field.getName().length(); i++) {
+                    if (Character.isUpperCase(field.getName().charAt(i)))
+                    // 将javabean中小驼峰命名变量的“大写字母”转换为“_小写字母”
+                    {
+                        underScoreCaseColumn = field.getName().substring(0, i) + '_' + field.getName().substring(i, i + 1).toLowerCase() + field.getName().substring(i + 1, field.getName().length());
+                    }
+                }
+
+                tmp.append(underScoreCaseColumn + "=");
+                if (ReflectUtil.getFieldValue(t, underScoreCaseColumn) instanceof String) {
+                    tmp.append("'" + ReflectUtil.getFieldValue(t, underScoreCaseColumn) + "',");
+                    flag = true;
+                } else {
+                    tmp.append(ReflectUtil.getFieldValue(t, underScoreCaseColumn) + ",");
+                    flag = true;
+                }
+                sql += tmp;
+            }
+        }
+        if (!flag) {
+            throw new IllegalArgumentException(t.getClass() + "NullException.\nThere is no attribute that is not empty except for ID.You must provide an object with at least one attribute exclude ID.");
+        }
+        sql = StrUtil.removeSuffix(sql, ",") + " where " + id + "='" + ReflectUtil.getFieldValue(t, id) + "'";
+        return sql;
+    }
+
+    /**
+     * 生成删除语句
+     * 根据 user 中第一个不为空的字段删除,应该尽量使用 id,提供至少一个非空属性
+     *
+     * @param tablename 表明
+     * @param t         有数据的实体
+     * @param <T>       数据实体类型 如 User
+     */
+    public static <T> String getDeleteSql(String tablename, T t) throws IllegalArgumentException {
+        //delete from table_name where column_name = value
+        return getSelectOrDeleteSql(tablename, t, "delete");
+    }
+
+    /**
+     * 生成查询语句
+     * 根据 user 中第一个不为空的字段查询
+     *
+     * @param tablename 表名
+     * @param t         有数据的实体
+     * @param <T>       数据实体类型 如 User
+     */
+    public static <T> String getSelectSql(String tablename, T t) throws IllegalArgumentException {
+        //delete from table_name where column_name = value
+        return getSelectOrDeleteSql(tablename, t, "select *");
+    }
+
+    /**
+     * 根据 operation 生成一个如:operation from table_name where column_name = value 的sql语句
+     *
+     * @param tablename
+     * @param t
+     * @param operation "select *"  or "delete"
+     * @param <T>
+     * @return
+     * @throws IllegalArgumentException
+     */
+    private static <T> String getSelectOrDeleteSql(String tablename, T t, String operation) throws IllegalArgumentException {
+        //operation from table_name where column_name = value
+        boolean flag = false;
+        String sql = "";
+        Field[] fields = ReflectUtil.getFieldsDirectly(t.getClass(), false);
+        StringBuffer topHalf = new StringBuffer(operation + " from " + tablename + " where ");
+        for (Field field : fields) {
+            String underScoreCaseColumn = field.getName();
+            for (int i = 0; i < field.getName().length(); i++) {
+                if (Character.isUpperCase(field.getName().charAt(i)))
+                // 将javabean中小驼峰命名变量的“大写字母”转换为“_小写字母”
+                {
+                    underScoreCaseColumn = field.getName().substring(0, i) + '_' + field.getName().substring(i, i + 1).toLowerCase() + field.getName().substring(i + 1, field.getName().length());
+                }
+            }
+            if ("ID".equals(underScoreCaseColumn) || "id".equals(underScoreCaseColumn)) {
+                if (ReflectUtil.getFieldValue(t, underScoreCaseColumn) != null && (int) ReflectUtil.getFieldValue(t, underScoreCaseColumn) != 0) {
+                    //id 不为空
+                    topHalf.append(underScoreCaseColumn + " = " + ReflectUtil.getFieldValue(t, underScoreCaseColumn));
+                    flag = true;
+                    break;
+                }
+            } else {
+                if (ReflectUtil.getFieldValue(t, underScoreCaseColumn) != null && (String) ReflectUtil.getFieldValue(t, underScoreCaseColumn) != "") {
+                    topHalf.append(underScoreCaseColumn + " = '" + ReflectUtil.getFieldValue(t, underScoreCaseColumn) + "'");
+                    flag = true;
+                    break;
+                }
+            }
+        }
+        if (!flag) {
+            throw new IllegalArgumentException(t.getClass() + "NullException.\nThere is no attribute that is not empty.You must provide an object with at least one attribute.");
+        }
+        sql = topHalf.toString();
+        return sql;
+    }
+}

+ 56 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/RSAEncrypt.java

@@ -0,0 +1,56 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.jasypt.encryption.StringEncryptor;
+
+import javax.crypto.Cipher;
+import java.security.KeyFactory;
+import java.security.PublicKey;
+import java.security.spec.X509EncodedKeySpec;
+
+/**
+ * 非对称加密
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/8 11:17
+ */
+@Slf4j
+public class RSAEncrypt implements StringEncryptor {
+
+
+    //非对称密钥算法
+    private static final String KEY_ALGORITHM = "RSA";
+
+    private static final String CHARSET_NAME = "UTF-8";
+
+    //公钥
+    private static final String PUBLIC_KEY = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJG5x3e0r4/cgU/8cy158AzhPf1huiMDqPnazaIzjMId3N43dST5ODOvxe5I63/s8E2cC83lucZm33Dw8K9syK8CAwEAAQ==";
+
+    @Override
+    public String encrypt(String message) {
+        return null;
+    }
+
+    @Override
+    public String decrypt(String encryptedMessage) {
+        String message = "";
+        try {
+            //实例化密钥工厂
+            KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+            //初始化公钥
+            //密钥材料转换
+            X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(Base64.decodeBase64(PUBLIC_KEY));
+            //产生公钥
+            PublicKey pubKey = keyFactory.generatePublic(x509KeySpec);
+            //数据解密
+            Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+            cipher.init(Cipher.DECRYPT_MODE, pubKey);
+            message = new String(cipher.doFinal(Base64.decodeBase64(encryptedMessage)), CHARSET_NAME);
+        } catch (Exception e) {
+            log.error("解码失败:", e);
+        }
+        return message;
+    }
+}

+ 83 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/SpringContextHolder.java

@@ -0,0 +1,83 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author
+ * @date 2018/6/27
+ * Spring 工具类
+ */
+@Slf4j
+@Service
+@Lazy(false)
+public class SpringContextHolder implements ApplicationContextAware, DisposableBean {
+
+    private static ApplicationContext applicationContext = null;
+
+    /**
+     * 取得存储在静态变量中的ApplicationContext.
+     */
+    public static ApplicationContext getApplicationContext() {
+        return applicationContext;
+    }
+
+    /**
+     * 实现ApplicationContextAware接口, 注入Context到静态变量中.
+     */
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) {
+        SpringContextHolder.applicationContext = applicationContext;
+    }
+
+    /**
+     * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T getBean(String name) {
+        return (T) applicationContext.getBean(name);
+    }
+
+    /**
+     * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
+     */
+    public static <T> T getBean(Class<T> requiredType) {
+        return applicationContext.getBean(requiredType);
+    }
+
+    /**
+     * 清除SpringContextHolder中的ApplicationContext为Null.
+     */
+    public static void clearHolder() {
+        if (log.isDebugEnabled()) {
+            log.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext);
+        }
+        applicationContext = null;
+    }
+
+    /**
+     * 发布事件
+     *
+     * @param event
+     */
+    public static void publishEvent(ApplicationEvent event) {
+        if (applicationContext == null) {
+            return;
+        }
+        applicationContext.publishEvent(event);
+    }
+
+    /**
+     * 实现DisposableBean接口, 在Context关闭时清理静态变量.
+     */
+    @Override
+    public void destroy() {
+        SpringContextHolder.clearHolder();
+    }
+
+}

+ 40 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/StringUtil.java

@@ -0,0 +1,40 @@
+package com.jiayue.ipfcst.common.core.util;
+
+/**
+ * 字符串工具类
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/6/24 10:07
+ */
+public class StringUtil {
+
+    /**
+     * 首字母转小写
+     *
+     * @param s 字符串
+     * @return 首字母小写字符串
+     */
+    public static String toLowerCaseFirstOne(String s) {
+        if (Character.isLowerCase(s.charAt(0))) {
+            return s;
+        } else {
+            return (new StringBuilder()).append(Character.toLowerCase(s.charAt(0))).append(s.substring(1)).toString();
+        }
+    }
+
+
+    /**
+     * 首字母转大写
+     *
+     * @param s 字符串
+     * @return 首字母大写字符串
+     */
+    public static String toUpperCaseFirstOne(String s) {
+        if (Character.isUpperCase(s.charAt(0))) {
+            return s;
+        } else {
+            return (new StringBuilder()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1)).toString();
+        }
+    }
+}

+ 328 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/SunRiseSet.java

@@ -0,0 +1,328 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class SunRiseSet {
+
+    private static int[] days_of_month_1 = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+    private static int[] days_of_month_2 = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+    private final static double h = -0.833;//日出日落时太阳的位置
+
+    private final static double UTo = 180.0;//上次计算的日落日出时间,初始迭代值180.0
+
+    //输入日期
+
+//输入经纬度
+
+//判断是否为闰年:若为闰年,返回1;若不是闰年,返回0
+
+    public static boolean leap_year(int year) {
+
+        if (((year % 400 == 0) || (year % 100 != 0) && (year % 4 == 0))) return true;
+
+        else return false;
+
+    }
+
+//求从格林威治时间公元2000年1月1日到计算日天数days
+
+    public static int days(int year, int month, int date) {
+
+        int i, a = 0;
+
+        for (i = 2000; i < year; i++) {
+
+            if (leap_year(i)) a = a + 366;
+
+            else a = a + 365;
+
+        }
+
+        if (leap_year(year)) {
+
+            for (i = 0; i < month - 1; i++) {
+
+                a = a + days_of_month_2[i];
+
+            }
+
+        } else {
+
+            for (i = 0; i < month - 1; i++) {
+
+                a = a + days_of_month_1[i];
+
+            }
+
+        }
+
+        a = a + date;
+
+        return a;
+
+    }
+
+//求格林威治时间公元2000年1月1日到计算日的世纪数t
+
+    public static double t_century(int days, double UTo) {
+
+        return ((double) days + UTo / 360) / 36525;
+
+    }
+
+//求太阳的平黄径
+
+    public static double L_sun(double t_century) {
+
+        return (280.460 + 36000.770 * t_century);
+
+    }
+
+//求太阳的平近点角
+
+    public static double G_sun(double t_century) {
+
+        return (357.528 + 35999.050 * t_century);
+
+    }
+
+//求黄道经度
+
+    public static double ecliptic_longitude(double L_sun, double G_sun) {
+
+        return (L_sun + 1.915 * Math.sin(G_sun * Math.PI / 180) + 0.02 * Math.sin(2 * G_sun * Math.PI / 180));
+
+    }
+
+//求地球倾角
+
+    public static double earth_tilt(double t_century) {
+
+        return (23.4393 - 0.0130 * t_century);
+
+    }
+
+//求太阳偏差
+
+    public static double sun_deviation(double earth_tilt, double ecliptic_longitude) {
+
+        return (180 / Math.PI * Math.asin(Math.sin(Math.PI / 180 * earth_tilt) * Math.sin(Math.PI / 180 * ecliptic_longitude)));
+
+    }
+
+//求格林威治时间的太阳时间角GHA
+
+    public static double GHA(double UTo, double G_sun, double ecliptic_longitude) {
+
+        return (UTo - 180 - 1.915 * Math.sin(G_sun * Math.PI / 180) - 0.02 * Math.sin(2 * G_sun * Math.PI / 180) + 2.466 * Math.sin(2 * ecliptic_longitude * Math.PI / 180) - 0.053 * Math.sin(4 * ecliptic_longitude * Math.PI / 180));
+
+    }
+
+//求修正值e
+
+    public static double e(double h, double glat, double sun_deviation) {
+
+        return 180 / Math.PI * Math.acos((Math.sin(h * Math.PI / 180) - Math.sin(glat * Math.PI / 180) * Math.sin(sun_deviation * Math.PI / 180)) / (Math.cos(glat * Math.PI / 180) * Math.cos(sun_deviation * Math.PI / 180)));
+
+    }
+
+//求日出时间
+
+    public static double UT_rise(double UTo, double GHA, double glong, double e) {
+
+        return (UTo - (GHA + glong + e));
+
+    }
+
+//求日落时间
+
+    public static double UT_set(double UTo, double GHA, double glong, double e) {
+
+        return (UTo - (GHA + glong - e));
+
+    }
+
+//判断并返回结果(日出)
+
+    public static double result_rise(double UT, double UTo, double glong, double glat, int year, int month, int date) {
+
+        double d;
+
+        if (UT >= UTo) d = UT - UTo;
+
+        else d = UTo - UT;
+
+        if (d >= 0.1) {
+
+            UTo = UT;
+
+            UT = UT_rise(UTo,
+
+                    GHA(UTo, G_sun(t_century(days(year, month, date), UTo)),
+
+                            ecliptic_longitude(L_sun(t_century(days(year, month, date), UTo)),
+
+                                    G_sun(t_century(days(year, month, date), UTo)))),
+
+                    glong,
+
+                    e(h, glat, sun_deviation(earth_tilt(t_century(days(year, month, date), UTo)),
+
+                            ecliptic_longitude(L_sun(t_century(days(year, month, date), UTo)),
+
+                                    G_sun(t_century(days(year, month, date), UTo))))));
+
+            result_rise(UT, UTo, glong, glat, year, month, date);
+
+
+        }
+
+        return UT;
+
+    }
+
+//判断并返回结果(日落)
+
+    public static double result_set(double UT, double UTo, double glong, double glat, int year, int month, int date) {
+
+        double d;
+
+        if (UT >= UTo) d = UT - UTo;
+
+        else d = UTo - UT;
+
+        if (d >= 0.1) {
+
+            UTo = UT;
+
+            UT = UT_set(UTo,
+
+                    GHA(UTo, G_sun(t_century(days(year, month, date), UTo)),
+
+                            ecliptic_longitude(L_sun(t_century(days(year, month, date), UTo)),
+
+                                    G_sun(t_century(days(year, month, date), UTo)))),
+
+                    glong,
+
+                    e(h, glat, sun_deviation(earth_tilt(t_century(days(year, month, date), UTo)),
+
+                            ecliptic_longitude(L_sun(t_century(days(year, month, date), UTo)),
+
+                                    G_sun(t_century(days(year, month, date), UTo))))));
+
+            result_set(UT, UTo, glong, glat, year, month, date);
+
+        }
+
+        return UT;
+
+    }
+
+//求时区
+
+    public static int Zone(double glong) {
+
+        if (glong >= 0) return (int) ((int) (glong / 15.0) + 1);
+
+        else return (int) ((int) (glong / 15.0) - 1);
+
+    }
+
+    public static String getSunrise(BigDecimal longitude, BigDecimal latitude, Date sunTime) {
+        if (sunTime != null && longitude != null && latitude != null) {
+            double sunrise, glong, glat;
+            int year, month, date;
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String dateTime = sdf.format(sunTime);
+            String[] rq = dateTime.split("-");
+            String y = rq[0];
+            String m = rq[1];
+            String d = rq[2];
+            year = Integer.parseInt(y);
+            if (m != null && m != "" && m.indexOf("0") == -1) {
+                m = m.replaceAll("0", "");
+            }
+            month = Integer.parseInt(m);
+
+            date = Integer.parseInt(d);
+
+            glong = longitude.doubleValue();
+
+            glat = latitude.doubleValue();
+
+            sunrise = result_rise(UT_rise(UTo,
+
+                    GHA(UTo, G_sun(t_century(days(year, month, date), UTo)),
+
+                            ecliptic_longitude(L_sun(t_century(days(year, month, date), UTo)),
+
+                                    G_sun(t_century(days(year, month, date), UTo)))),
+
+                    glong,
+
+                    e(h, glat, sun_deviation(earth_tilt(t_century(days(year, month, date), UTo)),
+
+                            ecliptic_longitude(L_sun(t_century(days(year, month, date), UTo)),
+
+                                    G_sun(t_century(days(year, month, date), UTo)))))), UTo, glong, glat, year, month, date);
+
+//System.out.println("Sunrise is: "+(int)(sunrise/15+Zone(glong))+":"+(int)(60*(sunrise/15+Zone(glong)-(int)(sunrise/15+Zone(glong))))+" .\n");
+
+//        Log.d("Sunrise", "Sunrise is: "+(int)(sunrise/15+8)+":"+(int)(60*(sunrise/15+8-(int)(sunrise/15+8)))+" .\n");
+
+            //return "Sunrise is: "+(int)(sunrise/15+Zone(glong))+":"+(int)(60*(sunrise/15+Zone(glong)-(int)(sunrise/15+Zone(glong))))+" .\n";
+
+            return (int) (sunrise / 15 + 8) + ":" + (int) (60 * (sunrise / 15 + 8 - (int) (sunrise / 15 + 8)));
+        }
+        return null;
+    }
+
+
+    public static String getSunset(BigDecimal longitude, BigDecimal latitude, Date sunTime) {
+        if (sunTime != null && latitude != null && longitude != null) {
+            double sunset, glong, glat;
+            int year, month, date;
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String dateTime = sdf.format(sunTime);
+            String[] rq = dateTime.split("-");
+            String y = rq[0];
+            String m = rq[1];
+            String d = rq[2];
+            year = Integer.parseInt(y);
+            if (m != null && m != "" && m.indexOf("0") == -1) {
+                m = m.replaceAll("0", "");
+            }
+            month = Integer.parseInt(m);
+
+            date = Integer.parseInt(d);
+
+            glong = longitude.doubleValue();
+
+            glat = latitude.doubleValue();
+
+            sunset = result_set(UT_set(UTo,
+
+                    GHA(UTo, G_sun(t_century(days(year, month, date), UTo)),
+
+                            ecliptic_longitude(L_sun(t_century(days(year, month, date), UTo)),
+
+                                    G_sun(t_century(days(year, month, date), UTo)))),
+
+                    glong,
+
+                    e(h, glat, sun_deviation(earth_tilt(t_century(days(year, month, date), UTo)),
+
+                            ecliptic_longitude(L_sun(t_century(days(year, month, date), UTo)),
+
+                                    G_sun(t_century(days(year, month, date), UTo)))))), UTo, glong, glat, year, month, date);
+
+            return (int) (sunset / 15 + 8) + ":" + (int) (60 * (sunset / 15 + 8 - (int) (sunset / 15 + 8)));
+        }
+        return null;
+    }
+}

+ 763 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/TimeUtils.java

@@ -0,0 +1,763 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import java.text.ParseException;
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by bqw on 14/11/19.
+ */
+public class TimeUtils {
+
+
+    /**
+     * 今日凌晨 毫秒
+     * @return
+     */
+    public static long getCurrentTime(){
+
+        Calendar c = Calendar.getInstance();
+
+        return c.getTimeInMillis();
+    }
+
+    /**
+     * 日期的增加月数
+     * add by xxl
+     * @param date     日期
+     * @param addMonth 增加的月数,正数表示增加,负数表示减少
+     * @return Date 日期的增加月数后的结果
+     */
+    public static Date addMonth(Date date, int addMonth) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.MONTH, addMonth);
+        return new Date(calendar.getTime().getTime());
+    }
+    public static Date addYear(Date date, int addYear) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.MONTH, addYear);
+        return new Date(calendar.getTime().getTime());
+    }
+
+
+    /**
+     * 日期的增加天数
+     * add by xxl
+     * @param date   日期
+     * @param addDay 增加的天数,正数表示增加,负数表示减少
+     * @return Date 日期的增加月数后的结果
+     */
+    public static Date addDay(Date date, int addDay) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DAY_OF_MONTH, addDay);
+        return new Date(calendar.getTime().getTime());
+    }
+
+    /**
+     * 获取输入日期所属月份第一天
+     * add by xxl
+     * @param date
+     * @return
+     */
+    public static Date getFirstDateMonth(Date date) {
+
+        if (date == null) {
+            return null;
+        }
+        Date newDate = null;
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int start = calendar.getActualMinimum(Calendar.DAY_OF_MONTH);
+        calendar.set(Calendar.DAY_OF_MONTH, start);
+        newDate = new Date(calendar.getTime().getTime());
+        return newDate;
+    }
+    /**
+     * 获取输入日期所属月份最后一天
+     * add by xxl
+     * @param date
+     * @return
+     */
+    public static Date getLastDayOfMonth(Date date) {
+        if (date == null) {
+            return null;
+        }
+        Date newDate = null;
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int end = calendar.getActualMinimum(Calendar.DAY_OF_MONTH);
+        calendar.set(Calendar.DAY_OF_MONTH, end);
+        newDate = new Date(calendar.getTime().getTime());
+        return newDate;
+    }
+
+    /**
+     * creat by linwb 20160908
+     * @param date
+     * @return
+     */
+
+    public static Date getFirstDateYear(Date date){
+        if (date == null) {
+            return null;
+        }
+        Date newDate = null;
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int start = calendar.getMinimum(Calendar.DAY_OF_YEAR);
+        calendar.set(Calendar.DAY_OF_YEAR,start);
+        newDate = new Date(calendar.getTime().getTime());
+        return newDate;
+    }
+    /**
+     *
+     */
+    public static Date getLastDayOfyear(Date date) {
+        if (date == null) {
+            return null;
+        }
+        Date newDate = null;
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int end = calendar.getActualMaximum(Calendar.DAY_OF_YEAR);
+        calendar.set(Calendar.DAY_OF_YEAR, end);
+        newDate = new Date(calendar.getTime().getTime());
+        return newDate;
+    }
+
+
+    /**
+     * 得到本季度第一天的日期
+     * @Methods Name getFirstDayOfQuarter
+     * @return Date
+     */
+    public static Date getFirstDayOfQuarter(Date date)   {
+        Calendar cDay = Calendar.getInstance();
+        cDay.setTime(date);
+        int curMonth = cDay.get(Calendar.MONTH);
+        if (curMonth >= Calendar.JANUARY && curMonth <= Calendar.MARCH){
+            cDay.set(Calendar.MONTH, Calendar.JANUARY);
+        }
+        if (curMonth >= Calendar.APRIL && curMonth <= Calendar.JUNE){
+            cDay.set(Calendar.MONTH, Calendar.APRIL);
+        }
+        if (curMonth >= Calendar.JULY && curMonth <= Calendar.AUGUST) {
+            cDay.set(Calendar.MONTH, Calendar.JULY);
+        }
+        if (curMonth >= Calendar.OCTOBER && curMonth <= Calendar.DECEMBER) {
+            cDay.set(Calendar.MONTH, Calendar.OCTOBER);
+        }
+        cDay.set(Calendar.DAY_OF_MONTH, cDay.getActualMinimum(Calendar.DAY_OF_MONTH));
+        System.out.println(cDay.getTime());
+        return cDay.getTime();
+    }
+
+    /**
+     * 得到本季度最后一天的日期
+     * @Methods Name getLastDayOfQuarter
+     * @return Date
+     */
+    public static Date getLastDayOfQuarter(Date date)   {
+        Calendar cDay = Calendar.getInstance();
+        cDay.setTime(date);
+        int curMonth = cDay.get(Calendar.MONTH);
+        if (curMonth >= Calendar.JANUARY && curMonth <= Calendar.MARCH){
+            cDay.set(Calendar.MONTH, Calendar.MARCH);
+        }
+        if (curMonth >= Calendar.APRIL && curMonth <= Calendar.JUNE){
+            cDay.set(Calendar.MONTH, Calendar.JUNE);
+        }
+        if (curMonth >= Calendar.JULY && curMonth <= Calendar.AUGUST) {
+            cDay.set(Calendar.MONTH, Calendar.AUGUST);
+        }
+        if (curMonth >= Calendar.OCTOBER && curMonth <= Calendar.DECEMBER) {
+            cDay.set(Calendar.MONTH, Calendar.DECEMBER);
+        }
+        cDay.set(Calendar.DAY_OF_MONTH, cDay.getActualMaximum(Calendar.DAY_OF_MONTH));
+        return cDay.getTime();
+    }
+
+
+
+    public static void main(String[] args) throws Exception{
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        System.out.println(calendar.get(Calendar.DAY_OF_MONTH));
+
+//        Date date = addMonth(new Date(),1);
+//        System.out.println(DateFormatUtils.format(date.getTime(), "yyyyMM"));
+
+//        CronExpression cronExpression =new CronExpression("0 0 18 9 * ?");
+//        String str = cronExpression.getExpressionSummary();
+//        String crons = "{"+str.replaceAll("\n",",")+"}";
+//        JSONObject json = JSONUtil.parseObj(crons);
+//        String daysOfMonth = json.get("daysOfMonth").toString();
+//        System.out.println(daysOfMonth);
+//        System.out.println(cronExpression.getExpressionSummary());
+//        System.out.println(cronExpression.getFinalFireTime());
+
+
+//    	long ll=1467188298610l;
+//    	NumberFormat nf=NumberFormat.getInstance();
+//    	nf.setGroupingUsed(false);
+//    	System.out.println(""+nf.format(ll));
+//
+//    	String dd="1467188298610333";
+//    	BigDecimal bd=new BigDecimal(dd);
+//    	double dds=bd.doubleValue();
+//    	NumberFormat nf1 =NumberFormat.getInstance();
+//    	nf1.setGroupingUsed(false);
+//    	System.out.println(nf.format(dds));
+//
+//    	System.out.println(new Double("1467188298610333"));
+//    	String date = "2017-06-01";
+//    	getDateWithOutZero(date,"-");
+//    	String date = DateFormatUtils.format(Long.valueOf("1496214861000"), "yyyy/MM/dd");
+//    	String timed = date;
+//
+//        String date10 = date.substring(5, 7);
+//    	if(date10.compareTo("10") < 0)timed = date.substring(0,5) + date.substring(6, date.length());
+//    	else timed = date;
+//
+//    	if(timed.lastIndexOf("-") > 0){
+//    		int pos = timed.lastIndexOf("-");
+//    		String day = timed.substring(pos + 1,pos + 3);
+//    		if(day.compareTo("10") < 0)timed = timed.substring(0,pos + 1) + timed.substring(pos + 2, timed.length());
+//    	}
+//
+//
+//    	System.out.println(timed.toString());
+
+//    	String time10 = timel.substring(0, 2);
+//    	if(time10.compareTo("10") < 0)time10 = time10.substring(1,2);
+//
+//    	System.out.println(timel);
+//    	System.out.println(time10);
+//		Calendar cal = Calendar.getInstance();
+//		int current = 0;
+//		int suff = 0;
+//		long time = System.currentTimeMillis();
+//		cal.setTimeInMillis(Long.valueOf("1456120500000"));
+//		int currentMinute = cal.get(Calendar.MINUTE);
+//		current = currentMinute % 15;
+//		suff = currentMinute / 15;
+//		if (current < 4) {
+//			// 存储period的整数值
+//			cal.set(Calendar.MINUTE, suff * 15);
+//			// 赋值
+//		    time = cal.getTimeInMillis();
+//		}
+//		System.out.println(DateFormatUtils.format(time, "yyyy-MM-dd HH:mm:ss"));
+    }
+
+
+    /**
+     * 描述:获取int型的4位年和月
+     * 参数:
+     * 返回: Map<String,Integer>
+     * 创建时间:2016-11-07
+     * 作者: chendi
+     */
+    public static Map<String,Integer> getCurrenYearAndMonth(){
+        Map<String,Integer> result = new HashMap();
+        Date d = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
+        String year = simpleDateFormat.format(d);
+        simpleDateFormat.applyPattern("MM");
+        String month = simpleDateFormat.format(d);
+        result.put("year", Integer.parseInt(year));
+        result.put("month", Integer.parseInt(month));
+        return result;
+    }
+
+    /**
+     * 描述:获取一个月的开始时间和结束时间(1日零点、最后一天23点59分59秒)
+     * 参数:year month 传入年月则按照该年月计算起始,传入空则取当前时间接
+     * 返回: Map<String,Long> key:"startTime" "endTime"
+     * 创建时间:2016-11-07
+     * 作者: chendi
+     */
+    public static Map<String,Long> getCurrentMonthStartTimeAndEndTime(){
+        return getMonthStartTimeAndEndTime(null,null);
+    }
+    public static Map<String,Long> getMonthStartTimeAndEndTime(Integer year,Integer month){
+        Map<String,Long> result = new HashMap();
+        Calendar cal = Calendar.getInstance();
+        if(year!=null){
+            cal.set(Calendar.YEAR,year);
+        }
+        if(month!=null){
+            cal.set(Calendar.MONTH,month - 1);
+        }
+        cal.set(Calendar.HOUR_OF_DAY,0);
+        cal.set(Calendar.MINUTE,0);
+        cal.set(Calendar.SECOND,0);
+        Date firstDay = getFirstDateMonth(cal.getTime());
+        Date nextMonth = TimeUtils.addMonth(firstDay, 1);
+        nextMonth = getFirstDateMonth(nextMonth);
+        result.put("startTime",firstDay.getTime());
+        result.put("endTime",nextMonth.getTime()-1*1000);
+        return result;
+    }
+
+
+
+    /**
+     * 判断时间是否在时间段内
+     *
+     * @param date
+     *            当前时间 yyyy-MM-dd HH:mm:ss
+     * @param strDateBegin
+     *            开始时间 00:00:00
+     * @param strDateEnd
+     *            结束时间 00:05:00
+     * @return
+     */
+    public static boolean isInDate(Date date, String strDateBegin,
+                                   String strDateEnd) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String strDate = sdf.format(date);
+        //System.out.println(strDate);
+        // 截取当前时间时分秒
+        int strDateH = Integer.parseInt(strDate.substring(11, 13));
+        int strDateM = Integer.parseInt(strDate.substring(14, 16));
+        int strDateS = Integer.parseInt(strDate.substring(17, 19));
+        //System.out.println("strDateH:"+strDateH+"|strDateM:"+strDateM+"|strDateS:"+strDateS);
+        // 截取开始时间时分秒
+        int strDateBeginH = Integer.parseInt(strDateBegin.substring(11, 13));
+        int strDateBeginM = Integer.parseInt(strDateBegin.substring(14, 16));
+        int strDateBeginS = Integer.parseInt(strDateBegin.substring(17, 19));
+        //System.out.println("strDateBeginH:"+strDateBeginH+"|strDateBeginM:"+strDateBeginM+"|strDateBeginS:"+strDateBeginS);
+
+        // 截取结束时间时分秒
+        int strDateEndH = Integer.parseInt(strDateEnd.substring(11, 13));
+        int strDateEndM = Integer.parseInt(strDateEnd.substring(14, 16));
+        int strDateEndS = Integer.parseInt(strDateEnd.substring(17, 19));
+        //System.out.println("strDateEndH:"+strDateEndH+"|strDateEndM:"+strDateEndM+"|strDateEndS:"+strDateEndS);
+
+        if ((strDateH >= strDateBeginH && strDateH <= strDateEndH)) {
+            //System.out.println("strDateEndH1:");
+
+            // 当前时间小时数在开始时间和结束时间小时数之间
+            if (strDateH > strDateBeginH && strDateH < strDateEndH) {
+
+                return true;
+                // 当前时间小时数等于开始时间小时数,分钟数在开始和结束之间
+            } else if (strDateH == strDateBeginH && strDateM >= strDateBeginM
+                    && strDateM <= strDateEndM) {
+                //System.out.println("strDateEndH2:");
+
+                return true;
+                // 当前时间小时数等于开始时间小时数,分钟数等于开始时间分钟数,秒数在开始和结束之间
+            } else if (strDateH == strDateBeginH && strDateM == strDateBeginM
+                    && strDateS >= strDateBeginS && strDateS <= strDateEndS) {
+                return true;
+            }
+            // 当前时间小时数大等于开始时间小时数,等于结束时间小时数,分钟数小等于结束时间分钟数
+            else if (strDateH >= strDateBeginH && strDateH == strDateEndH
+                    && strDateM <= strDateEndM) {
+                return true;
+                // 当前时间小时数大等于开始时间小时数,等于结束时间小时数,分钟数等于结束时间分钟数,秒数小等于结束时间秒数
+            } else return strDateH >= strDateBeginH && strDateH == strDateEndH
+                    && strDateM == strDateEndM && strDateS <= strDateEndS;
+        } else {
+            return false;
+        }
+    }
+
+
+
+    /**
+     * 根据type获取两日期差
+     * @param start 开始时间
+     * @param end 结束时间
+     * @param type days表示相差天数 hours小时数 minutes分钟数
+     * @return 返回int,未设置type则返回0
+     */
+    public static int getDateDiffer(Date start,Date end,String type){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        String startDate = sdf.format(start);
+        String endDate = sdf.format(end);
+        try {
+            long from = sdf.parse(startDate).getTime();
+            long to = sdf.parse(endDate).getTime();
+
+            if (type.equals("days")){ // 返回相差天数
+                int days = (int) ((to - from)/(1000 * 60 * 60 * 24));
+                return days;
+            } else if (type.equals("hours")){ // 返回相差小时数
+                int hours = (int) ((to - from)/(1000 * 60 * 60));
+                return hours;
+            } else if (type.equals("minutes")){ // 返回相差分钟数
+                int minutes = (int) ((to - from)/(1000 * 60));
+                return minutes;
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return 0;
+    }
+
+	/**
+	 * 修改时间为不包含0的数据,格式必须报分隔符
+	 * @Title: getDateWithOutZero
+	 * @Description: TODO
+	 * @param date
+	 */
+	public static String getDateWithOutZero(String date,String split) {
+		String timed = date;
+		String date10 = date.substring(5, 7);
+		if(date10.compareTo("10") < 0)timed = date.substring(0,5) + date.substring(6, date.length());
+		else timed = date;
+
+		if(timed.lastIndexOf(split) > 0){
+			int pos = timed.lastIndexOf(split);
+			String day = timed.substring(pos + 1,pos + 3);
+			if(day.compareTo("10") < 0)timed = timed.substring(0,pos + 1) + timed.substring(pos + 2, timed.length());
+		}
+		System.out.println(timed);
+		return timed;
+	}
+
+   	/**
+   	 * 获取当前时间的后一天时间
+   	 *
+   	 * @param date
+   	 */
+	public static Date getAfterDay(Date date) {
+           Calendar calendar = Calendar.getInstance();
+           calendar.setTime(date);
+           calendar.add(Calendar.DAY_OF_MONTH, +1);
+           date = calendar.getTime();
+   		return date;
+   	}
+   	/**
+   	 * 获取时间的前一天时间
+   	 *
+   	 * @param date
+   	 */
+	public static Date getBeforeDay(Date date) {
+           Calendar calendar = Calendar.getInstance();
+           calendar.setTime(date);
+           calendar.add(Calendar.DAY_OF_MONTH, -1);
+           date = calendar.getTime();
+   		return date;
+   	}
+
+
+
+//   ----------------------------------------------------------------------------------------------------------------
+//    bizy添加时间工具
+    /**
+     * 时间戳转日期(传过来的参数没除1000)
+     * @param ms
+     * @return
+     */
+    public static String transForDateShort(Long ms){
+        String str = "";
+        if(ms!=null){
+            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
+            if(ms!=null){
+                try {
+                    str=sdf.format(ms);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return str;
+    }
+
+    /**
+     * 时间戳转日期(传过来的参数没除1000)
+     * @param ms
+     * @return
+     */
+    public static String transForDate(Long ms){
+        String str = "";
+        if(ms!=null){
+            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            if(ms!=null){
+                try {
+                    str=sdf.format(ms);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return str;
+    }
+    /**
+     * 获取现在时间
+     *
+     * @return 返回时间类型 yyyy-MM-dd HH:mm:ss
+     */
+    public static Date getNowDate() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateString = formatter.format(currentTime);
+        ParsePosition pos = new ParsePosition(0);
+        Date currentTime_2 = formatter.parse(dateString, pos);
+        return currentTime_2;
+    }
+
+    /**
+     * 获取现在时间
+     *
+     * @return返回短时间格式 yyyy-MM-dd
+     */
+    public static Date getNowDateShort() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+        String dateString = formatter.format(currentTime);
+        ParsePosition pos = new ParsePosition(0);
+        Date currentTime_2 = formatter.parse(dateString, pos);
+        return currentTime_2;
+    }
+
+    /**
+     * 获取现在时间
+     *
+     * @return返回字符串格式 yyyy-MM-dd HH:mm:ss
+     */
+    public static String getStringDate() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateString = formatter.format(currentTime);
+        return dateString;
+    }
+
+    /**
+     * 获取现在时间
+     *
+     * @return 返回短时间字符串格式yyyy-MM-dd
+     */
+    public static String getStringDateShort() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+        String dateString = formatter.format(currentTime);
+        return dateString;
+    }
+
+    /**
+     * 获取当日凌晨时间
+     *
+     * @return 返回短时间字符串格式yyyy-MM-dd
+     */
+    public static String getStringDateShortLc(Date currentTime) {
+//        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        String dateString = formatter.format(currentTime);
+        return dateString;
+    }
+
+    /**
+     * 获取现在时间
+     *
+     * @return 返回短时间字符串格式yyyy-MM-dd
+     */
+    public static String getStringDateShortYM() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
+        String dateString = formatter.format(currentTime);
+        return dateString;
+    }
+
+    /**
+     * 获取时间 小时:分;秒 HH:mm:ss
+     *
+     * @return
+     */
+    public static String getTimeShort() {
+        SimpleDateFormat formatter = new SimpleDateFormat("HHmmss");
+        Date currentTime = new Date();
+        String dateString = formatter.format(currentTime);
+        return dateString;
+    }
+
+    /**
+     * 将长时间格式字符串转换为时间 yyyy-MM-dd HH:mm:ss
+     *
+     * @param strDate
+     * @return
+     */
+    public static Date strToDateLong(String strDate) {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        ParsePosition pos = new ParsePosition(0);
+        Date strtodate = formatter.parse(strDate, pos);
+        return strtodate;
+    }
+
+    /**
+     * 将长时间格式字符串转换为时间 yyyy-MM-dd HH:mm:ss
+     *
+     * @param strDate
+     * @return
+     */
+    public static Date strToDateLongHM(String strDate) {
+        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm");
+        ParsePosition pos = new ParsePosition(0);
+        Date strtodate = formatter.parse(strDate, pos);
+        return strtodate;
+    }
+
+    /**
+     * 将长时间格式时间转换为字符串 yyyy-MM-dd HH:mm:ss
+     *
+     * @param dateDate
+     * @return
+     */
+    public static String dateToStrLong(Date dateDate) {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateString = formatter.format(dateDate);
+        return dateString;
+    }
+
+    /**
+     * 将短时间格式时间转换为字符串 yyyy-MM-dd
+     *
+     * @param dateDate
+     * @param
+     * @return
+     */
+    public static String dateToStr(Date dateDate) {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+        String dateString = formatter.format(dateDate);
+        return dateString;
+    }
+
+    /**
+     * 将短时间格式字符串转换为时间 yyyy-MM-dd
+     *
+     * @param strDate
+     * @return
+     */
+    public static Date strToDate(String strDate) {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+        ParsePosition pos = new ParsePosition(0);
+        Date strtodate = formatter.parse(strDate, pos);
+        return strtodate;
+    }
+
+    /**
+     * 得到现在时间
+     *
+     * @return
+     */
+    public static Date getNow() {
+        Date currentTime = new Date();
+        return currentTime;
+    }
+
+    /**
+     * 提取一个月中的最后一天
+     *
+     * @param day
+     * @return
+     */
+    public static Date getLastDate(long day) {
+        Date date = new Date();
+        long date_3_hm = date.getTime() - 3600000 * 34 * day;
+        Date date_3_hm_date = new Date(date_3_hm);
+        return date_3_hm_date;
+    }
+
+    /**
+     * 得到现在时间
+     *
+     * @return 字符串 yyyyMMdd HHmmss
+     */
+    public static String getStringToday() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
+        String dateString = formatter.format(currentTime);
+        return dateString;
+    }
+
+
+    /**
+     * 得到现在月份
+     *
+     * @return 字符串 yyyyMMdd HHmmss
+     */
+    public static String getStringTodayMonth() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
+        String dateString = formatter.format(currentTime);
+        String month;
+        month = dateString.substring(4, 6);
+        return month;
+    }
+
+
+    /**
+     * 得到现在小时
+     */
+    public static String getHour() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateString = formatter.format(currentTime);
+        String hour;
+        hour = dateString.substring(11, 13);
+        return hour;
+    }
+
+    /**
+     * 得到现在分钟
+     *
+     * @return
+     */
+    public static String getTime() {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateString = formatter.format(currentTime);
+        String min;
+        min = dateString.substring(14, 16);
+        return min;
+    }
+
+    /**
+     * 根据用户传入的时间表示格式,返回当前时间的格式 如果是yyyyMMdd,注意字母y不能大写。
+     *
+     * @param sformat yyyyMMddhhmmss
+     * @return
+     */
+    public static String getUserDate(String sformat) {
+        Date currentTime = new Date();
+        SimpleDateFormat formatter = new SimpleDateFormat(sformat);
+        String dateString = formatter.format(currentTime);
+        return dateString;
+    }
+
+    /**
+     * 获得指定日期的前一天
+     * @param specifiedDay
+     * @return
+     * @throws Exception
+     */
+    public static String getSpecifiedDayBefore(String specifiedDay){
+//SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar c = Calendar.getInstance();
+        Date date=null;
+        try {
+            date = new SimpleDateFormat("yyyy-MM-dd").parse(specifiedDay);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        c.setTime(date);
+        int day=c.get(Calendar.DATE);
+        c.set(Calendar.DATE,day-1);
+
+        String dayBefore=new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
+        return dayBefore;
+    }
+
+}

+ 177 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/WebUtil.java

@@ -0,0 +1,177 @@
+package com.jiayue.ipfcst.common.core.util;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import lombok.experimental.UtilityClass;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.MediaType;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.method.HandlerMethod;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+
+/**
+ * Miscellaneous utilities for web applications.
+ *
+ * @author L.cm
+ */
+@Slf4j
+@UtilityClass
+public class WebUtil extends org.springframework.web.util.WebUtils {
+    private final String BASIC_ = "Basic ";
+    private final String UNKNOWN = "unknown";
+
+    /**
+     * 判断是否ajax请求
+     * spring ajax 返回含有 ResponseBody 或者 RestController注解
+     *
+     * @param handlerMethod HandlerMethod
+     * @return 是否ajax请求
+     */
+    public boolean isBody(HandlerMethod handlerMethod) {
+        ResponseBody responseBody = ClassUtil.getAnnotation(handlerMethod, ResponseBody.class);
+        return responseBody != null;
+    }
+
+    /**
+     * 读取cookie
+     *
+     * @param name cookie name
+     * @return cookie value
+     */
+    public String getCookieVal(String name) {
+        HttpServletRequest request = WebUtil.getRequest();
+        Assert.notNull(request, "request from RequestContextHolder is null");
+        return getCookieVal(request, name);
+    }
+
+    /**
+     * 读取cookie
+     *
+     * @param request HttpServletRequest
+     * @param name    cookie name
+     * @return cookie value
+     */
+    public String getCookieVal(HttpServletRequest request, String name) {
+        Cookie cookie = getCookie(request, name);
+        return cookie != null ? cookie.getValue() : null;
+    }
+
+    /**
+     * 清除 某个指定的cookie
+     *
+     * @param response HttpServletResponse
+     * @param key      cookie key
+     */
+    public void removeCookie(HttpServletResponse response, String key) {
+        setCookie(response, key, null, 0);
+    }
+
+    /**
+     * 设置cookie
+     *
+     * @param response        HttpServletResponse
+     * @param name            cookie name
+     * @param value           cookie value
+     * @param maxAgeInSeconds maxage
+     */
+    public void setCookie(HttpServletResponse response, String name, String value, int maxAgeInSeconds) {
+        Cookie cookie = new Cookie(name, value);
+        cookie.setPath("/");
+        cookie.setMaxAge(maxAgeInSeconds);
+        cookie.setHttpOnly(true);
+        response.addCookie(cookie);
+    }
+
+    /**
+     * 获取 HttpServletRequest
+     *
+     * @return {HttpServletRequest}
+     */
+    public HttpServletRequest getRequest() {
+        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+    }
+
+    /**
+     * 获取 HttpServletResponse
+     *
+     * @return {HttpServletResponse}
+     */
+    public HttpServletResponse getResponse() {
+        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+    }
+
+    /**
+     * 返回json
+     *
+     * @param response HttpServletResponse
+     * @param result   结果对象
+     */
+    public void renderJson(HttpServletResponse response, Object result) {
+        renderJson(response, result, MediaType.APPLICATION_JSON_VALUE);
+    }
+
+    /**
+     * 返回json
+     *
+     * @param response    HttpServletResponse
+     * @param result      结果对象
+     * @param contentType contentType
+     */
+    public void renderJson(HttpServletResponse response, Object result, String contentType) {
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType(contentType);
+        try (PrintWriter out = response.getWriter()) {
+            out.append(JSONUtil.toJsonStr(result));
+        } catch (IOException e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 获取ip
+     *
+     * @return {String}
+     */
+    public String getIP() {
+        return getIP(WebUtil.getRequest());
+    }
+
+    /**
+     * 获取ip
+     *
+     * @param request HttpServletRequest
+     * @return {String}
+     */
+    public String getIP(HttpServletRequest request) {
+        Assert.notNull(request, "HttpServletRequest is null");
+        String ip = request.getHeader("X-Requested-For");
+        if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("X-Forwarded-For");
+        }
+        if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("Proxy-Client-IP");
+        }
+        if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("WL-Proxy-Client-IP");
+        }
+        if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("HTTP_CLIENT_IP");
+        }
+        if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+        }
+        if (StrUtil.isBlank(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+            ip = request.getRemoteAddr();
+        }
+        return StrUtil.isBlank(ip) ? null : ip.split(",")[0];
+    }
+}

+ 60 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/GlobalExceptionHandler.java

@@ -0,0 +1,60 @@
+package com.jiayue.ipfcst.common.core.web;
+
+import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Optional;
+
+/**
+ * 全局异常处理
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/11/25 14:35
+ */
+@Slf4j
+@ControllerAdvice(
+        annotations = {RestController.class, Controller.class}
+)
+public class GlobalExceptionHandler {
+    private static final String ERROR_MSG_TPL = "ip: %s, path: %s, message: %s";
+
+    /**
+     * 处理业务异常
+     *
+     * @param request
+     * @param exception
+     * @return com.jiayue.ipfcst.common.core.web.vo.ResponseVO
+     * @author L.ym
+     * @date 2020/1/14
+     **/
+    @ResponseBody
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    @ExceptionHandler({BusinessException.class})
+    public ResponseVO handleExceptionInternal(HttpServletRequest request, BusinessException exception) {
+        log.error(String.format(ERROR_MSG_TPL, request.getRemoteAddr(), request.getRequestURI() + Optional.ofNullable(request.getQueryString()).orElse(""), exception.getMessage()), exception);
+        return ResponseVO.fail(exception);
+    }
+
+    /**
+     * 处理全局异常
+     *
+     * @param request
+     * @param throwable
+     * @return com.jiayue.ipfcst.common.core.web.vo.ResponseVO
+     * @author L.ym
+     * @date 2020/1/14
+     **/
+    @ResponseBody
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    @ExceptionHandler({Throwable.class})
+    public ResponseVO defaultErrorHandler(HttpServletRequest request, Throwable throwable) {
+        log.error(String.format(ERROR_MSG_TPL, request.getRemoteAddr(), request.getRequestURI() + Optional.ofNullable(request.getQueryString()).orElse(""), throwable.getMessage()), throwable);
+        return ResponseVO.error(throwable);
+    }
+}

+ 38 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/vo/RequestVO.java

@@ -0,0 +1,38 @@
+package com.jiayue.ipfcst.common.core.web.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * 数据格式请求统一
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/5/10 16:34
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class RequestVO<T> implements Serializable {
+
+    private static final long serialVersionUID = -437839076132402939L;
+
+    private Map<String,Object> parameters;
+    /**
+     * 页码
+     */
+    private Integer page;
+
+    /**
+     * 每页记录数
+     */
+    private Integer size;
+
+    /**
+     * 数据
+     */
+    private T data;
+
+}

+ 87 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/vo/ResponseVO.java

@@ -0,0 +1,87 @@
+package com.jiayue.ipfcst.common.core.web.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.jiayue.ipfcst.common.core.constant.enums.ResponseEnum;
+import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import lombok.*;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * 数据格式返回统一
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/5/10 16:34
+ */
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseVO<T> implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 状态码
+     */
+    @Getter
+    @Setter
+    private Integer code;
+
+    /**
+     * 描述
+     */
+    @Getter
+    @Setter
+    private String message;
+
+    /**
+     * 数据
+     */
+    @Getter
+    @Setter
+    private T data;
+
+    public static <T> ResponseVO<T> success() {
+        return restResult(ResponseEnum.SUCCESS.getCode(), null, null);
+    }
+
+    public static <T> ResponseVO<T> success(T data) {
+        return restResult(ResponseEnum.SUCCESS.getCode(), data, ResponseEnum.SUCCESS.getMessage());
+    }
+
+    public static <T> ResponseVO<T> success(T data, String message) {
+        return restResult(ResponseEnum.SUCCESS.getCode(), data, message);
+    }
+
+    public static <T> ResponseVO<T> fail() {
+        return restResult(ResponseEnum.FAILED.getCode(), null, null);
+    }
+
+    public static <T> ResponseVO<T> fail(T data) {
+        return restResult(ResponseEnum.FAILED.getCode(), data, ResponseEnum.FAILED.getMessage());
+    }
+
+    public static <T> ResponseVO<T> fail(T data, String msg) {
+        return restResult(ResponseEnum.FAILED.getCode(), data, msg);
+    }
+
+    public static ResponseVO fail(BusinessException exception) {
+        return restResult(ResponseEnum.FAILED.getCode(), null, exception.getMessage());
+    }
+
+    public static ResponseVO error(Throwable exception) {
+        return restResult(ResponseEnum.ERROR.getCode(), null, exception.getMessage());
+    }
+
+    private static <T> ResponseVO<T> restResult(Integer code, T data, String message) {
+        ResponseVO<T> apiResult = new ResponseVO<>();
+        apiResult.setCode(code);
+        apiResult.setData(data);
+        apiResult.setMessage(message);
+        return apiResult;
+    }
+}

+ 122 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/xss/RequestWrapper.java

@@ -0,0 +1,122 @@
+package com.jiayue.ipfcst.common.core.web.xss;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StreamUtils;
+import org.springframework.web.util.HtmlUtils;
+
+import javax.servlet.ReadListener;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+/**
+ * 1. XSS过滤 2. body重复读
+ *
+ * @author L.ym
+ * @version 3.0
+ */
+@Slf4j
+public class RequestWrapper extends HttpServletRequestWrapper {
+    private final byte[] body;
+
+    RequestWrapper(HttpServletRequest request) {
+        super(request);
+        this.body = getByteBody(request);
+    }
+
+    @Override
+    public BufferedReader getReader() {
+        return ObjectUtils.isEmpty(body) ? null : new BufferedReader(new InputStreamReader(getInputStream()));
+    }
+
+    @Override
+    public ServletInputStream getInputStream() {
+        final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body);
+        return new ServletInputStream() {
+            @Override
+            public boolean isFinished() {
+                return false;
+            }
+
+            @Override
+            public boolean isReady() {
+                return false;
+            }
+
+            @Override
+            public void setReadListener(ReadListener readListener) {
+
+            }
+
+            @Override
+            public int read() {
+                return byteArrayInputStream.read();
+            }
+        };
+    }
+
+    @Override
+    public String[] getParameterValues(String name) {
+        String[] values = super.getParameterValues(name);
+        if (values == null) {
+            return null;
+        }
+        int count = values.length;
+        String[] encodedValues = new String[count];
+        for (int i = 0; i < count; i++) {
+            encodedValues[i] = HtmlUtils.htmlEscape(values[i]);
+        }
+        return encodedValues;
+    }
+
+    @Override
+    public String getParameter(String name) {
+        String value = super.getParameter(name);
+        if (value == null) {
+            return null;
+        }
+        return HtmlUtils.htmlEscape(value);
+    }
+
+    @Override
+    public Object getAttribute(String name) {
+        Object value = super.getAttribute(name);
+        if (value instanceof String) {
+            HtmlUtils.htmlEscape((String) value);
+        }
+        return value;
+    }
+
+    @Override
+    public String getHeader(String name) {
+        String value = super.getHeader(name);
+        if (value == null) {
+            return null;
+        }
+        return HtmlUtils.htmlEscape(value);
+    }
+
+    @Override
+    public String getQueryString() {
+        String value = super.getQueryString();
+        if (value == null) {
+            return null;
+        }
+        return HtmlUtils.htmlEscape(value);
+    }
+
+    private static byte[] getByteBody(HttpServletRequest request) {
+        byte[] body = new byte[0];
+        try {
+            body = StreamUtils.copyToByteArray(request.getInputStream());
+        } catch (IOException e) {
+            log.error("解析流中数据异常", e);
+        }
+        return body;
+    }
+}

+ 25 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/web/xss/RequestWrapperFilter.java

@@ -0,0 +1,25 @@
+package com.jiayue.ipfcst.common.core.web.xss;
+
+import org.springframework.lang.NonNull;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * request 处理过滤器
+ *
+ * @author L.ym
+ * @version 3.0
+ */
+public class RequestWrapperFilter extends OncePerRequestFilter {
+
+    @Override
+    protected void doFilterInternal(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response,
+                                    @NonNull FilterChain filterChain) throws ServletException, IOException {
+        filterChain.doFilter(new RequestWrapper(request), response);
+    }
+}

+ 1 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/resources/META-INF/build-info.properties

@@ -0,0 +1 @@
+build.version=test

+ 4 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/resources/META-INF/spring.factories

@@ -0,0 +1,4 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+  com.jiayue.ipfcst.common.core.config.EncryptionConfig,\
+  com.jiayue.ipfcst.common.core.config.RestTemplateConfig,\
+  com.jiayue.ipfcst.common.core.util.SpringContextHolder

+ 4 - 0
ipfcst/ipfcst-common/ipfcst-common-core/src/main/resources/banner.txt

@@ -0,0 +1,4 @@
+====================================
+************************************
+    启动【智能功率预测系统V3.0】
+====================================

+ 83 - 0
ipfcst/ipfcst-common/ipfcst-common-data/README.md

@@ -0,0 +1,83 @@
+# druid datasource configuration demo
+#spring:
+#  datasource:
+#    type: com.alibaba.druid.pool.DruidDataSource
+#    druid:
+#      driver-class-name: com.mysql.cj.jdbc.Driver
+#      username: ${MYSQL-USER:用户名}
+#      password: ${MYSQL-PWD:密码}
+#      url: jdbc:mysql://${MYSQL-HOST:数据库地址}:${MYSQL-PORT:3306}/${MYSQL-DB:数据库名}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true
+#      # 初始连接数
+#      initialSize: 5
+#      # 最小连接池数量
+#      minIdle: 10
+#      # 最大连接池数量
+#      maxActive: 20
+#      # 配置获取连接等待超时的时间
+#      maxWait: 60000
+#      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+#      timeBetweenEvictionRunsMillis: 60000
+#      # 配置一个连接在池中最小生存的时间,单位是毫秒
+#      minEvictableIdleTimeMillis: 300000
+#      # 配置一个连接在池中最大生存的时间,单位是毫秒
+#      maxEvictableIdleTimeMillis: 900000
+#      # 配置检测连接是否有效
+#      validationQuery: SELECT 1 FROM DUAL
+#      testWhileIdle: true
+#      testOnBorrow: false
+#      testOnReturn: false
+#      webStatFilter:
+#        enabled: true
+#      statViewServlet:
+#        enabled: true
+#        # 设置白名单,不填则允许所有访问
+#        allow:
+#        url-pattern: /druid/*
+#        # 控制台管理用户名和密码
+#        login-username:
+#        login-password:
+#      filter:
+#        stat:
+#          enabled: true
+#          # 慢SQL记录
+#          log-slow-sql: true
+#          slow-sql-millis: 1000
+#          merge-sql: true
+#        wall:
+#          config:
+#            multi-statement-allow: true
+
+
+省份代号
+北京:E11
+天津:E12
+河北:E13
+山西:E14
+蒙东:E15
+蒙西:E16
+辽宁:E21
+吉林:E22
+黑龙江:E23
+上海:E31
+江苏:E32
+浙江:E33
+安徽:E34
+福建:E35
+江西:E36
+山东:E37
+河南:E41
+湖北:E42
+湖南:E43
+广东:E44
+广西:E45
+海南:E46
+重庆:E50
+四川:E51
+贵州:E52
+云南:E53
+西藏:E54
+陕西:E61
+甘肃:E62
+青海:E63
+宁夏:E64
+新疆:E65

+ 6 - 0
ipfcst/ipfcst-common/ipfcst-common-data/ipfcst-common-data.iml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4">
+  <component name="SonarLintModuleSettings">
+    <option name="uniqueId" value="4a54f3da-8ad3-4de5-9b24-aa66ed1d201d" />
+  </component>
+</module>

+ 125 - 0
ipfcst/ipfcst-common/ipfcst-common-data/pom.xml

@@ -0,0 +1,125 @@
+<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.jiayue.ipfcst</groupId>
+        <artifactId>ipfcst-common</artifactId>
+        <version>3.0.0</version>
+    </parent>
+
+    <artifactId>ipfcst-common-data</artifactId>
+    <version>3.0.0</version>
+    <packaging>jar</packaging>
+
+    <description>ipfcst 数据相关</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+
+    <repositories>
+    <repository>
+        <id>jiayue-releases</id>
+        <name>嘉越云仓库</name>
+        <url>http://49.4.68.219:8888/nexus/content/groups/public/</url>
+    </repository>
+    </repositories>
+    <dependencies>
+        <dependency>
+            <groupId>com.jiayue.ipfcst</groupId>
+            <artifactId>ipfcst-common-core</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+        <!--mysql 驱动-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <!-- druid 连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.20</version>
+        </dependency>
+        <!--JPA-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-entitymanager</artifactId>
+            <version>5.2.3.Final</version>
+        </dependency>
+        <!--任务调度-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz-jobs</artifactId>
+            <version>${quartz.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>5.0.4.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
+        <!-- 缓存依赖-->
+        <dependency>
+            <groupId>net.sf.ehcache</groupId>
+            <artifactId>ehcache</artifactId>
+            <version>2.10.5</version>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.json-lib</groupId>
+            <artifactId>json-lib</artifactId>
+            <version>2.4</version>
+            <classifier>jdk15</classifier>
+        </dependency>
+
+        <!-- h2数据库-->
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!-- 金昌数据库-->
+        <dependency>
+            <groupId>kingbasejdbc4</groupId>
+            <artifactId>kingbasejdbc4</artifactId>
+            <version>1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>openjpadictionary</groupId>
+            <artifactId>openjpadictionary</artifactId>
+            <version>1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate.core</groupId>
+            <artifactId>hibernate</artifactId>
+            <version>5.4.6.Finaldialect</version>
+        </dependency>
+
+        <dependency>
+            <groupId>wei.yigulu</groupId>
+            <artifactId>protocol-all</artifactId>
+            <version>1.2.31</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.netty</groupId>
+                    <artifactId>netty-all</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+</project>

+ 105 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/AbstractBaseEntity.java

@@ -0,0 +1,105 @@
+package com.jiayue.ipfcst.common.data.abst;
+
+import lombok.Data;
+import org.springframework.core.annotation.Order;
+import org.springframework.data.annotation.CreatedBy;
+import org.springframework.data.annotation.CreatedDate;
+import org.springframework.data.annotation.LastModifiedBy;
+import org.springframework.data.annotation.LastModifiedDate;
+import org.springframework.data.jpa.domain.support.AuditingEntityListener;
+
+import javax.persistence.Column;
+import javax.persistence.EntityListeners;
+import javax.persistence.MappedSuperclass;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 所有实体的基类
+ *
+ * @author zzy
+ * @version 2.0
+ * @since 2018/10/11 11:08
+ */
+@Data
+@MappedSuperclass
+@EntityListeners(AuditingEntityListener.class)
+public
+class AbstractBaseEntity implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 备用字段A
+	 */
+	@Order(200)
+	@Column
+	private String backupA;
+
+	/**
+	 * 备用字段B
+	 */
+	@Order(201)
+	@Column
+	private String backupB;
+
+	/**
+	 * 备用字段C
+	 */
+	@Order(202)
+	@Column
+	private String backupC;
+
+	/**
+	 * 备用字段D
+	 */
+	@Order(203)
+	@Column
+	private String backupD;
+
+	/**
+	 * 备用字段E
+	 */
+	@Order(204)
+	@Column
+	private String backupE;
+
+	/**
+	 * 备用字段F
+	 */
+	@Order(205)
+	@Column
+	private String backupF;
+
+
+	/**
+	 * 创建人,不允许修改
+	 */
+	@Order(206)
+	@CreatedBy
+	@Column(updatable = false)
+	private String creator;
+
+	/**
+	 * 创建时间,不允许修改
+	 */
+	@Order(207)
+	@CreatedDate
+	@Column(updatable = true)
+	private Date createTime;
+
+	/**
+	 * 最后修改者
+	 */
+	@Order(208)
+	@LastModifiedBy
+	@Column(insertable = false)
+	private String lastModifier;
+	/**
+	 * 最后修改时间
+	 */
+	@Order(209)
+	@LastModifiedDate
+	@Column(insertable = false)
+	private Date lastModifyTime;
+}

+ 34 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/AbstractForecastPower.java

@@ -0,0 +1,34 @@
+package com.jiayue.ipfcst.common.data.abst;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+import javax.validation.constraints.Digits;
+import java.math.BigDecimal;
+
+/**
+ * 实时预测功率抽象实体
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/11/28 16:04
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@MappedSuperclass
+public class AbstractForecastPower
+		extends AbstractForecastPowerBase {
+
+	/**
+	 * 预测功率(MW)
+	 */
+	@Order(20)
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal fpValue;
+
+
+}

+ 57 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/AbstractForecastPowerBase.java

@@ -0,0 +1,57 @@
+package com.jiayue.ipfcst.common.data.abst;
+
+import com.jiayue.ipfcst.common.data.constant.enums.PredictionModelEnum;
+import lombok.Data;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+import org.springframework.data.annotation.CreatedDate;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 预测功率抽象实体
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2018/11/2 12:23
+ */
+@Data
+@MappedSuperclass
+public class AbstractForecastPowerBase implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+    /**
+     * 生成日期
+     */
+    @Order(100)
+    @Temporal(TemporalType.TIMESTAMP)
+    @CreatedDate
+    @Column
+    private Date genDate;
+
+    /**
+     * 预测时间
+     */
+    @Order(101)
+    @Column
+    private Long forecastTime;
+
+    /**
+     * 预测模型
+     */
+    @Order(102)
+    @Column
+    @Enumerated(EnumType.STRING)
+    private PredictionModelEnum predictionModelEnum;
+
+}

+ 59 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/AbstractForecastPowerHis.java

@@ -0,0 +1,59 @@
+package com.jiayue.ipfcst.common.data.abst;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+import javax.validation.constraints.Digits;
+import java.math.BigDecimal;
+
+/**
+ * 上报预测功率抽象实体
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/11/28 16:05
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@MappedSuperclass
+public class AbstractForecastPowerHis extends AbstractForecastPowerBase {
+
+	/**
+	 * 可用预测功率(MW)
+	 */
+	@Order(10)
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal ableValue;
+
+	/**
+	 * 理论预测功率(MW)
+	 */
+	@Order(11)
+	@Digits(integer = 10, fraction = 2)
+	@Column
+	private BigDecimal theoryValue;
+
+	/**
+	 * 开机容量(MW)
+	 */
+	@Order(12)
+	@Column
+	@Digits(integer = 10, fraction = 2)
+	private BigDecimal suCapacity;
+
+	/**
+	 * 装机容量(MW)
+	 */
+	@Order(13)
+	@Column
+	@Digits(integer = 10, fraction = 2)
+	private BigDecimal capacity;
+
+	/*提前多久预测*/
+	@Column
+	private Integer forecastHowLongAgo;
+}

+ 77 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/equipmentinfo/AbstractEquipmentInfo.java

@@ -0,0 +1,77 @@
+package com.jiayue.ipfcst.common.data.abst.equipmentinfo;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * 设备
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/19 14:21
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@MappedSuperclass
+public class AbstractEquipmentInfo extends AbstractBaseEntity {
+
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+
+    /**
+     * 设备类型
+     */
+    protected EquipmentTypeEnum equipmentType;
+
+    /**
+     * 名称
+     */
+    @Column
+    private String name;
+
+    /**
+     * 制造商
+     */
+    private String manufacturer;
+
+    /**
+     * 型号
+     */
+    private String modelNumber;
+
+    /**
+     * 安装时间
+     */
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date installationTime;
+
+    /**
+     * 是否上报
+     */
+    private Boolean report;
+
+    /**
+     * 场站编号(运维标识)
+     */
+    @Column
+    private String stationCode;
+
+    /**
+     * 入库时间间隔  单位 s
+     */
+    @Column
+    private Integer interval;
+
+
+}

+ 138 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/abst/equipmentstatus/AbstractEquipmentStatusData.java

@@ -0,0 +1,138 @@
+package com.jiayue.ipfcst.common.data.abst.equipmentstatus;
+
+import lombok.Data;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+import javax.validation.constraints.Digits;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 设备数据
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/19 14:28
+ */
+
+@Data
+@MappedSuperclass
+public class AbstractEquipmentStatusData implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+    /**
+     * 设备编号
+     */
+    @Column
+    private Integer equipmentNo;
+
+    /**
+     * 状态
+     * 状态值为0代表运行,1代表故障,2代表待机,3代表检修
+     */
+    @Column
+    private Integer status = 0;
+
+
+    /**
+     * 时间
+     */
+    @Temporal(TemporalType.TIMESTAMP)
+    @Column
+    private Date time;
+
+
+    /**
+     * 备用字段1
+     */
+    @Order(200)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data1 = new BigDecimal(-99);
+
+    /**
+     * 备用字段2
+     */
+    @Order(201)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data2 = new BigDecimal(-99);
+
+    /**
+     * 备用字段3
+     */
+    @Order(202)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data3 = new BigDecimal(-99);
+
+    /**
+     * 备用字段4
+     */
+    @Order(203)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data4 = new BigDecimal(-99);
+
+    /**
+     * 备用字段5
+     */
+    @Order(204)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data5 = new BigDecimal(-99);
+
+    /**
+     * 备用字段6
+     */
+    @Order(205)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data6 = new BigDecimal(-99);
+
+    /**
+     * 备用字段7
+     */
+    @Order(206)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data7 = new BigDecimal(-99);
+
+    /**
+     * 备用字段8
+     */
+    @Order(207)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data8 = new BigDecimal(-99);
+
+
+    /**
+     * 备用字段9
+     */
+    @Order(208)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data9 = new BigDecimal(-99);
+
+    /**
+     * 备用字段10
+     */
+    @Order(209)
+    @Digits(integer = 5, fraction = 2)
+    @Column
+    private BigDecimal data10 = new BigDecimal(-99);
+
+
+}

+ 138 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/AbnormalCode.java

@@ -0,0 +1,138 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+/**
+ * 测风塔数据或者 气象站数据的异常码
+ *
+ * @author xiuwei
+ * @date 2021/10/18
+ */
+public enum AbnormalCode {
+
+    /**
+     * 正常的
+     */
+    NORMAL,
+    /**
+     * 10米死值
+     */
+    DEAD10,
+    /**
+     * 10米空值
+     */
+    NULL10,
+    /**
+     * 30米死值
+     */
+    DEAD30,
+    /**
+     * 30米空值
+     */
+    NULL30,
+    /**
+     * 50米死值
+     */
+    DEAD50,
+    /**
+     * 50米空值
+     */
+    NULL50,
+    /**
+     * 60米死值
+     */
+    DEAD60,
+    /**
+     * 60米空值
+     */
+    NULL60,
+    /**
+     * 70米死值
+     */
+    DEAD70,
+    /**
+     * 70米空值
+     */
+    NULL70,
+    /**
+     * 80米死值
+     */
+    DEAD80,
+    /**
+     * 80米空值
+     */
+    NULL80,
+    /**
+     * 90米死值
+     */
+    DEAD90,
+    /**
+     * 90米空值
+     */
+    NULL90,
+    /**
+     * 100米死值
+     */
+    DEAD100,
+    /**
+     * 100米空值
+     */
+    NULL100,
+    /**
+     * HUB米死值
+     */
+    DEADHUB,
+
+    NULL,
+    DEAD,
+    BOTH,
+
+    /**
+     * HUB米空值
+     */
+    NULLHUB;
+
+
+    public  String getErrInfo() {
+        switch (this) {
+            case NULL10:
+                return "10米风速空值";
+            case DEAD10:
+                return "10米风速死值";
+            case NULL30:
+                return "30米风速空值";
+            case DEAD30:
+                return "30米风速死值";
+            case NULL50:
+                return "50米风速空值";
+            case DEAD50:
+                return "50米风速死值";
+            case NULL60:
+                return "60米风速空值";
+            case DEAD60:
+                return "60米风速死值";
+            case NULL70:
+                return "70米风速空值";
+            case DEAD70:
+                return "70米风速死值";
+            case NULL80:
+                return "80米风速空值";
+            case DEAD80:
+                return "80米风速死值";
+            case NULL90:
+                return "90米风速空值";
+            case DEAD90:
+                return "90米风速死值";
+            case NULL100:
+                return "100米风速空值";
+            case DEAD100:
+                return "100米风速死值";
+            case NULLHUB:
+                return "轮毂高风速空值";
+            case DEADHUB:
+                return "轮毂高风速死值";
+            case NORMAL:
+                return "数据正常";
+        }
+        return "";
+    }
+
+}

+ 21 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/AlarmStatusEnum.java

@@ -0,0 +1,21 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 告警状态枚举
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/6 11:04
+ */
+@Getter
+@AllArgsConstructor
+public enum AlarmStatusEnum {
+	E1(1, "未处理"),
+	E2(2, "已处理");
+
+	private Integer code;
+	private String message;
+}

+ 26 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/AlarmTypeEnum.java

@@ -0,0 +1,26 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 告警类型枚举
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/6 11:04
+ */
+@Getter
+@AllArgsConstructor
+public enum AlarmTypeEnum {
+	// 告警类型枚举
+	E1(1, "文件生成"),
+	E2(2, "文件上报"),
+	E3(3, "通信通道"),
+	E4(4, "回传数据"),
+	E5(5, "接收数据"),
+	E6(6, "文件解析");
+
+	private Integer code;
+	private String message;
+}

+ 19 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ChannelFileRuleEnum.java

@@ -0,0 +1,19 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 通道文件生成规则
+ *
+ * @author xsl
+ * @version 3.0
+ */
+@Getter
+@AllArgsConstructor
+public enum ChannelFileRuleEnum {
+	E1(1, "所有通道都生成文件"),
+	E2(2, "通道连通的生成文件");
+	private Integer code;
+	private String message;
+}

+ 20 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ChannelStatusEnum.java

@@ -0,0 +1,20 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 通道状态枚举类
+ *
+ * @author xsl
+ * @version 3.0
+ * @since 2020/4/15 19:30
+ */
+@Getter
+@AllArgsConstructor
+public enum ChannelStatusEnum {
+	E1(1, "使用"),
+	E2(2, "停用");
+	private Integer code;
+	private String message;
+}

+ 21 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ComChannelTypeEnum.java

@@ -0,0 +1,21 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 通道类型
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/9/18 10:15
+ */
+@Getter
+@AllArgsConstructor
+public enum ComChannelTypeEnum {
+	E1(1, "数据接入"),
+	E2(2, "数据回传"),
+	E3(3, "文件上报");
+	private Integer code;
+	private String message;
+}

+ 35 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/DataObjectTypeEnum.java

@@ -0,0 +1,35 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 数据对象类型枚举
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/19 8:59
+ */
+@Getter
+@AllArgsConstructor
+public enum DataObjectTypeEnum {
+	E1(1, "实际功率"),
+	E2(2, "气象站"),
+	E3(3, "逆变器"),
+	E4(4, "测风塔"),
+	E5(5, "风机"),
+	E6(6, "可用超短期"),
+	E7(7, "可用短期"),
+	E8(8, "理论超短期"),
+	E9(9, "理论短期"),
+	E10(10, "可用功率"),
+	E11(11, "理论功率"),
+	E12(12, "站内受阻功率"),
+	E13(13, "站外受阻功率"),
+	E14(14, "装机容量"),
+	E15(15, "开机容量"),
+	E16(16, "并网设备数"),
+	E17(17, "告警信息");
+	private Integer code;
+	private String message;
+}

+ 28 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/DataSourceEnum.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 接收数据类型
+ * modifying
+ * 20.3.27 修唯   自主生成修改为公式生成   新增 预测数据  类型  细化了数据来源方式
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/16 15:01
+ */
+@Getter
+@AllArgsConstructor
+/*@JsonFormat(shape = JsonFormat.Shape.OBJECT)*/
+public enum DataSourceEnum {
+
+	/***
+	 * 数据的集中来源方式
+	 */
+	GATHER(1, "外部接入"),
+	GENERATE(2, "公式生成"),
+	FORECAST(3, "预测生成");
+	private Integer code;
+	private String message;
+}

+ 23 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ElectricFieldStatrsEnum.java

@@ -0,0 +1,23 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 场站状态枚举
+ *
+ * @author bizy
+ * @version 3.0
+ */
+@Getter
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum ElectricFieldStatrsEnum {
+	E1(1, "未运维"),
+
+	E2(2, "运维中");
+
+	private Integer code;
+	private String message;
+}

+ 20 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ElectricFieldTypeEnum.java

@@ -0,0 +1,20 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 场站类型枚举
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/2 11:33
+ */
+@Getter
+@AllArgsConstructor
+public enum ElectricFieldTypeEnum {
+	E1(1, "光伏电站"),
+	E2(2, "风力电站");
+	private Integer code;
+	private String message;
+}

+ 121 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/EquipmentTypeEnum.java

@@ -0,0 +1,121 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sun.org.apache.xpath.internal.objects.XBoolean;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 设备数据对象类型枚举
+ * lastModify
+ * 2020.3.26  修唯   枚举名修改,新增发电站类型,删除各种功率,设备数,开机容量等类型
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/19 8:59
+ */
+@Getter
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum EquipmentTypeEnum {
+
+    /**
+     * 场站也视为设备类型的一种
+     */
+    POWERSTATION(0, "发电站"),
+    WEATHERSTATION(1, "气象站"),
+    INVERTER(2, "逆变器"),
+    WINDTOWER(3, "测风塔"),
+    WINDTURBINE(4, "风机"),
+    FORECASTDATA(5, "预测数据"),
+    BOOSTERSTATION(6, "升压站"),
+    AGC_AVC(7, "AGC_AVC"),
+    BWD(8, "并网点"),
+    CYB(9, "厂用变"),
+    JDX(10, "集电线"),
+    SYZMX(11, "升压站母线"),
+    WGBC(12, "无功补偿"),
+    DLQ(13, "断路器"),
+    DZ(14, "刀闸"),
+    JDDZ(15, "接地刀闸"),
+    DXFDJ(16, "等效发电机"),
+    QBB(17, "启备变"),
+    LLB(18, "联络变"),
+    FZ(19, "方阵"),
+    XB(20,"箱变");
+
+    private Integer code;
+    private String message;
+
+
+    /**
+     * 附属设备
+     */
+    public static final List<EquipmentTypeEnum> SUBSIDIARY_EQUIPMENT_TYPE = Arrays.asList(
+            EquipmentTypeEnum.JDX,//并网点
+            EquipmentTypeEnum.BWD,//并网点
+            EquipmentTypeEnum.CYB,//厂用变
+            EquipmentTypeEnum.SYZMX,//升压站母线
+            EquipmentTypeEnum.WGBC,//"无功补偿
+            EquipmentTypeEnum.DLQ,//"断路器
+            EquipmentTypeEnum.DZ,//"刀闸
+            EquipmentTypeEnum.JDDZ,//"接地刀闸
+            EquipmentTypeEnum.DXFDJ,//"等效发电机
+            EquipmentTypeEnum.QBB,//"启备变
+            EquipmentTypeEnum.LLB,//"联络变
+            EquipmentTypeEnum.FZ,//方阵
+            EquipmentTypeEnum.XB//箱变
+    );
+
+
+    public static EquipmentTypeEnum valueOf(Integer code) {
+        switch (code) {
+            case 0:
+                return POWERSTATION;
+            case 1:
+                return WEATHERSTATION;
+            case 2:
+                return INVERTER;
+            case 3:
+                return WINDTOWER;
+            case 4:
+                return WINDTURBINE;
+            case 5:
+                return FORECASTDATA;
+            case 6:
+                return BOOSTERSTATION;
+            case 7:
+                return AGC_AVC;
+            case 8:
+                return BWD;
+            case 9:
+                return CYB;
+            case 10:
+                return JDX;
+            case 11:
+                return SYZMX;
+            case 12:
+                return WGBC;
+            case 13:
+                return DLQ;
+            case 14:
+                return DZ;
+            case 15:
+                return JDDZ;
+            case 16:
+                return DXFDJ;
+            case 17:
+                return QBB;
+            case 18:
+                return LLB;
+            case 19:
+                return FZ;
+            case 20:
+                return XB;
+        }
+        return null;
+    }
+}

+ 22 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/FeedbackFileStatusEnum.java

@@ -0,0 +1,22 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 反馈文件状态枚举
+ * @author zy
+ * @version 1.0
+ * @since 2019/8/19 8:59
+ */
+@Getter
+@AllArgsConstructor
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum FeedbackFileStatusEnum {
+	E1(1, "获取成功"),
+	E2(0, "获取失败");
+	private Integer code;
+	private String message;
+
+}

+ 25 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/FileStatusEnum.java

@@ -0,0 +1,25 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 文件状态枚举类
+ *
+ * @author xsl
+ * @version 3.0
+ * @since 2020/4/15 19:30
+ */
+@Getter
+@AllArgsConstructor
+public enum FileStatusEnum {
+    E1(1,"文件生成"),
+    E2(2,"上报成功"),
+    E3(3,"上报失败"),
+    E4(4,"文件未生成"),
+    E5(5,"上传D5000成功"),
+    E6(6,"上传D5000失败"),
+    E7(7,"文件过期");
+    private Integer code;
+    private String message;
+}

+ 409 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/FileTypeEnum.java

@@ -0,0 +1,409 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 文件类型枚举类
+ *
+ * @author xsl
+ * @version 2.0
+ * @since 2018/11/16 11:18
+ */
+@Getter
+@AllArgsConstructor
+public enum FileTypeEnum {
+	E1(1,"短期"),
+	E2(2,"超短期"),
+	E3(3,"理论功率"),
+	E4(4,"24NWP"),
+	E5(5,"72NWP"),
+	E6(6,"气象站"),
+	E7(7,"测风塔"),
+	E8(8,"逆变器"),
+	E9(9,"风机信息"),
+	E10(10,"光伏组件信息"),
+	E11(11,"检修计划"),
+	E12(12,"昨日开机容量"),
+	E13(13,"短期发电计划"),
+	E14(14,"超短期发电计划"),
+	E15(15,"日前预测"),
+	E16(16,"日前预测14"),
+	E17(17,"短期168"),
+	E18(18,"限电计划"),
+	E19(19,"弃电计划"),
+	E20(20,"场站信息"),
+	E21(21,"短期_集控"),
+	E22(22,"超短期_集控"),
+	E23(23,"测风塔_集控"),
+	E24(24,"72NWP_集控"),
+	E25(25,"短期_D5000"),
+	// 青海
+	E26(26,"可用短期"),
+	// 青海
+	E27(27,"可用超短期"),
+	// 宁夏
+	E28(28,"理论超短期"),
+	// 以下是青海新增
+	E29(29,"短期预测风速风向"),
+	E30(30,"实测功率"),
+	E31(31,"短期预测辐照度"),
+	E32(32,"短期日志"),
+	E33(33,"超短期日志"),
+	E34(34,"短期可用日志"),
+	E35(35,"超短期可用日志"),
+	E36(36,"气象站日志"),
+	E37(37,"理论功率日志"),
+	E38(38,"逆变器日志"),
+	E39(39,"风机信息日志"),
+	E40(40,"测风塔日志"),
+	E41(41,"指标数据"),
+	//贵州
+	E42(42,"电网上报状态"),
+	E43(43,"预测准确率"),
+	//海南
+	E44(44,"升压变"),
+	//青海
+	E45(45,"超短期预测风速风向"),
+	//广西
+	E46(46,"超短期SFTP"),
+	//青海
+	E47(47,"超短期预测辐照度"),
+	E48(48,"单机"),
+	//广西TODO
+	E49(49,"短期SFTP"),
+	//海南,广西(南方电网)
+	E50(50,"升压站信息"),
+	E51(51,"AGC_AVC信息"),
+	E52(52,"风电总体信息"),
+	E53(53,"光伏总体信息"),
+	E54(54,"统计信息"),
+	E55(55,"逆变器/汇流箱信息"),
+	E56(56,"南网短期预测"),
+	E57(57,"南网超短期预测"),
+	E58(58,"D5000样板机"),
+	E59(59,"短期02"),
+	E60(60,"离线理论功率"),
+	E61(61,"在线理论功率"),
+	//湖北康桥旧文件和湖北其他站的地调
+	E62(62,"湖北短期"),
+	E63(63,"湖北超短期"),
+	E64(64,"湖北72nwp"),
+	E65(65,"湖北气象站"),
+	E66(66,"湖北测风塔"),
+	E67(67,"湖北单机"),
+	//湖北康桥地调
+	E68(68,"荆门地调短期"),
+	E69(69,"荆门地调超短期"),
+	E70(70,"荆门地调72nwp"),
+	E71(71,"荆门地调气象站"),
+	E72(72,"荆门地调测风塔"),
+	E73(73,"荆门地调单机"),
+	E74(74,"荆门地调风机信息"),
+	E75(75,"荆门地调逆变器"),
+	E76(76,"南网风电机组"),
+	//新疆网调光伏
+	E77(77,"新疆网调逆变器"),
+	E78(78,"新疆网调气象站"),
+	E79(79,"新疆网调超短期"),
+	E80(80,"新疆网调短期"),
+	E81(81,"新疆网调实时量测"),
+	E82(82,"新疆网调集电线"),
+
+	E83(83,"南网压缩包"),
+	E84(84,"湖北逆变器"),
+	E85(85,"青海理论功率(风)"),
+	E86(86,"短期_辽宁龙源集控"),
+	E87(87,"超短期_辽宁龙源集控"),
+	E88(88,"测风塔_辽宁龙源集控"),
+	E89(89,"风机_辽宁龙源集控"),
+	//浙江省调上报文件
+	E90(90,"省调短期"),
+	E91(91,"省调昨日开机容量"),
+
+	E92(92,"湖北逆变器信息"),
+
+	E93(93,"黄冈地调短期"),
+	E94(94,"黄冈地调超短期"),
+	E95(95,"黄冈地调72nwp"),
+	E96(96,"黄冈地调气象站"),
+	E97(97,"黄冈地调测风塔"),
+	E98(98,"黄冈地调风机"),
+	E99(99,"黄冈地调逆变器"),
+
+	E100(100,"随州地调短期"),
+	E101(101,"随州地调超短期"),
+	E102(102,"随州地调72nwp"),
+	E103(103,"随州地调气象站"),
+	E104(104,"随州地调逆变器"),
+
+	E105(105,"广东中调短期WPD"),
+	E106(106,"广东中调超短期WPD"),
+	E107(107,"广东中调气象站WPD"),
+	E108(108,"广东中调逆变器WPD"),
+	E109(109,"广东中调短期dat"),
+	E110(110,"广东中调超短期dat"),
+	E111(111,"广东中调气象站dat"),
+	E112(112,"广东中调逆变器dat"),
+
+	E113(113,"NWP_辽宁龙源集控"),
+
+	E114(114,"蒙东南瑞集控测风塔"),
+	E115(115,"龙源南瑞集控测风塔"),
+
+	E116(116,"贵州总调短期"),
+	E117(117,"贵州总调超短期"),
+	E118(118,"贵州总调气象站"),
+	E119(119,"贵州总调逆变器"),
+
+	E120(120,"孝感地调测风塔"),
+	E121(121,"孝感地调风机"),
+
+	E122(122,"贵州新短期"),
+	E123(123,"贵州新超短期"),
+	E124(124,"贵州新气象站"),
+	E125(125,"贵州新测风塔"),
+	E126(126,"贵州新逆变器"),
+	E127(127,"贵州新风机"),
+	E128(128,"贵州新理论功率"),
+	E129(129,"贵州新逆变器信息"),
+	E130(130,"贵州新风机信息"),
+
+	E131(131,"山东新上午短期"),
+	E132(132,"山东新下午短期"),
+	E133(133,"山东新超短期"),
+	E134(134,"山东新气象站"),
+	E135(135,"山东新测风塔"),
+	E136(136,"山东新逆变器"),
+	E137(137,"山东新风机"),
+	E138(138,"山东新理论功率"),
+	E139(139,"山东新逆变器信息"),
+	E140(140,"山东新风机信息"),
+	E141(141,"孝感地调短期"),
+	E142(142,"孝感地调超短期"),
+	E143(143,"孝感地调nwp"),
+	E144(144,"日内预测短期"),
+	E145(145,"内蒙古新上午短期"),
+	E146(146,"内蒙古新下午短期"),
+	E147(147,"内蒙古新超短期"),
+
+	E148(148,"贵州中转短期"),
+	E149(149,"贵州中转超短期"),
+	E150(150,"贵州中转气象站"),
+	E151(151,"贵州中转统计信息"),
+	E152(152,"贵州中转方阵信息"),
+	E153(153,"甘肃新短期"),
+	E154(154,"甘肃12个月电量预测"),
+
+	E155(155,"吉林新上午短期"),
+	E156(156,"吉林新电量预测"),
+	E157(157,"吉林新下午短期"),
+
+	E158(158,"青海新电量预测"),
+	E159(159,"广西升压站信息"),
+	E160(160,"广西AGC-AVC信息"),
+	E161(161,"广西风电场总体信息"),
+	E162(162,"广西气象环境监视信息"),
+	E163(163,"广西风/光统计信息"),
+	E164(164,"广西逆变器/汇流箱信息"),
+	E165(165,"广西短期预测"),
+	E166(166,"广西超短期预测"),
+	E167(167,"广西风力发电机组信息"),
+	// 新疆用的短期下午
+	E168(168,"短期下午"),
+
+	E169(169,"河南漯河地调气象站"),
+	//江苏省调短期
+	E170(170,"省调短期"),
+	//江苏省调超短期
+	E171(171,"省调超短期"),
+	//江苏省调短期
+	E172(172,"省调旧短期"),
+	//江苏省调旧超短期
+	E173(173,"省调旧超短期"),
+
+
+	E174(174,"湖北咸宁地调短期"),
+	E175(175,"湖北咸宁地调超短期"),
+	E176(176,"湖北咸宁地调气象站"),
+	E177(177,"湖北咸宁地调逆变器"),
+	E178(178,"湖北咸宁地调NWP"),
+	E179(179,"湖北上午短期"),
+	E180(180,"湖北下午短期"),
+	E181(181,"湖北原短期下午"),
+
+	E182(182,"湖北上午短期(老系统)"),
+	E183(183,"湖北下午短期(老系统)"),
+	E184(184,"湖北原短期下午(老系统)"),
+
+	E185(185,"湖北荆州地调短期"),
+	E186(186,"湖北荆州地调超短期"),
+	E187(187,"湖北荆州地调nwp"),
+	E188(188,"湖北荆州地调测风塔"),
+	E189(189,"湖北荆州地调风机"),
+
+	E190(190,"江西萍乡地调短期"),
+	E191(191,"江西萍乡地调超短期"),
+	E192(192,"江西萍乡地调气象站"),
+
+	//黑龙江综合通信日志
+	E193(193,"72nwp日志(黑)"),
+	E194(194,"测风塔日志(黑)"),
+	E195(195,"风机日志(黑)"),
+	E196(196,"检修计划日志(黑)"),
+	E197(197,"短期日志(黑)"),
+	E198(198,"超短期日志(黑)"),
+	E199(199,"气象站日志(黑)"),
+	E200(200,"逆变器日志(黑)"),
+
+	E201(201,"黑龙江新电量预测"),
+
+	//华北直调
+	E202(202,"中短期功率预测"),
+
+	E203(203,"华北新可用超短期"),
+	E204(204,"华北新上午可用短期"),
+	E205(205,"华北新下午可用短期"),
+
+	E206(206,"冀北短期"),
+	E207(207,"冀北气象"),
+
+	E208(208,"(黑)三峡新能集控短期"),
+	E209(209,"(黑)三峡新能集控超短期"),
+	E210(210,"(黑)三峡新能集控nwp"),
+	E211(211,"(黑)三峡新能集控理论功率"),
+	E212(212,"(黑)三峡新能集控功率预测系统状态"),
+
+	E213(213,"广东升压站信息"),
+	E214(214,"广东AGC-AVC信息"),
+	E215(215,"广东风电场总体信息"),
+	E216(216,"广东气象环境监视信息"),
+	E217(217,"广东风/光统计信息"),
+	E218(218,"广东逆变器/汇流箱信息"),
+	E219(219,"广东短期预测"),
+	E220(220,"广东超短期预测"),
+	E221(221,"广东风力发电机组信息"),
+	E222(222,"广东箱变/方阵信息"),
+
+	E223(223,"辽宁三峡新能源短期"),
+	E224(224,"辽宁三峡新能源超短期"),
+
+	E225(225,"宜昌地调短期"),
+	E226(226,"宜昌地调超短期"),
+	E227(227,"宜昌地调NWP"),
+	E228(228,"宜昌地调测风塔"),
+	E229(229,"宜昌地调单机"),
+	E230(230,"宜昌地调气象站"),
+	E231(231,"宜昌地调逆变器"),
+	E232(232,"宜昌地调风机信息"),
+	E233(233,"宜昌地调逆变器信息"),
+
+	E234(234,"孝感地调气象站"),
+	E235(235,"孝感地调逆变器"),
+
+	E236(236,"开机容量(未来)"),
+
+	//湖北康桥地调
+	E237(237,"荆门地调72nwp(下午)"),
+	E238(238,"荆门地调短期(下午)"),
+
+	//河南地调文件
+	E239(239,"河南地调短期"),
+	E240(240,"河南地调超短期"),
+	E241(241,"河南地调24nwp"),
+	E242(242,"河南地调72nwp"),
+	E243(243,"河南地调测风塔"),
+	E244(244,"河南地调风机"),
+	E245(245,"河南地调昨日开机容量"),
+
+	E246(246,"安徽新上午短期"),
+	E247(247,"安徽新下午短期"),
+
+	E248(248,"云南升压站信息"),
+	E249(249,"云南AGC-AVC信息"),
+	E250(250,"云南风电场总体信息"),
+	E251(251,"云南气象环境监视信息"),
+	E252(252,"云南风/光统计信息"),
+	E253(253,"云南逆变器/汇流箱信息"),
+	E254(254,"云南08短期预测"),
+	E255(255,"云南超短期预测"),
+	E256(256,"云南风力发电机组信息"),
+	E257(257,"云南箱变/方阵信息"),
+	E258(258,"云南10短期预测"),
+	E259(259,"云南14短期预测"),
+	E260(260,"云南15短期预测"),
+	E261(261,"安徽中期上午"),
+	E262(262,"安徽中期下午"),
+	E263(263,"安徽短期下午"),
+
+	E264(264,"广东湛江集控短期"),
+	E265(265,"广东湛江集控超短期"),
+	E266(266,"广东湛江集控测风塔"),
+
+	E400(400,"新疆备调短期"),
+	E401(401,"新疆备调下午短期"),
+
+	E402(402,"单机转发上送"),
+
+	E500(500,"一体化短期"),
+	E501(501,"一体化短期(预测10天)");
+	/*
+	添加了超短期类型别忘了在下面getCDQ()方法中也加上
+	⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇
+	⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇
+	⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇
+	⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇
+	⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇
+	 */
+	private Integer code;
+	private String message;
+
+
+	//封装黑龙江类型的返回值
+	public static List<FileTypeEnum> getHLJ(){
+		List<FileTypeEnum> fileTypeEnums = new ArrayList<>();
+		fileTypeEnums.add(FileTypeEnum.E194);
+		fileTypeEnums.add(FileTypeEnum.E195);
+		fileTypeEnums.add(FileTypeEnum.E198);
+		fileTypeEnums.add(FileTypeEnum.E199);
+		fileTypeEnums.add(FileTypeEnum.E200);
+		return fileTypeEnums;
+	}
+
+
+	//封装所有使用超短期提前参数的超短期类型的返回值
+	public static List<FileTypeEnum> getCDQ(){
+		List<FileTypeEnum> fileTypeEnums = new ArrayList<>();
+		fileTypeEnums.add(FileTypeEnum.E2);
+		fileTypeEnums.add(FileTypeEnum.E27);
+		fileTypeEnums.add(FileTypeEnum.E63);
+		fileTypeEnums.add(FileTypeEnum.E69);
+		fileTypeEnums.add(FileTypeEnum.E79);
+		fileTypeEnums.add(FileTypeEnum.E94);
+		fileTypeEnums.add(FileTypeEnum.E101);
+		fileTypeEnums.add(FileTypeEnum.E106);
+		fileTypeEnums.add(FileTypeEnum.E110);
+		fileTypeEnums.add(FileTypeEnum.E117);
+		fileTypeEnums.add(FileTypeEnum.E123);
+		fileTypeEnums.add(FileTypeEnum.E133);
+		fileTypeEnums.add(FileTypeEnum.E147);
+		fileTypeEnums.add(FileTypeEnum.E149);
+		fileTypeEnums.add(FileTypeEnum.E166);
+		fileTypeEnums.add(FileTypeEnum.E171);
+		fileTypeEnums.add(FileTypeEnum.E173);
+		fileTypeEnums.add(FileTypeEnum.E175);
+		fileTypeEnums.add(FileTypeEnum.E186);
+		fileTypeEnums.add(FileTypeEnum.E191);
+		fileTypeEnums.add(FileTypeEnum.E203);
+		fileTypeEnums.add(FileTypeEnum.E220);
+		fileTypeEnums.add(FileTypeEnum.E224);
+		fileTypeEnums.add(FileTypeEnum.E226);
+		fileTypeEnums.add(FileTypeEnum.E240);
+		fileTypeEnums.add(FileTypeEnum.E265);
+		return fileTypeEnums;
+	}
+
+}

+ 20 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/FtpPassiveModeEnum.java

@@ -0,0 +1,20 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * FTP模式
+ *
+ * @author xsl
+ * @version 3.0
+ * @since 2020/4/15 19:30
+ */
+@Getter
+@AllArgsConstructor
+public enum FtpPassiveModeEnum {
+	E1(1, "主动"),
+	E2(2, "被动");
+	private Integer code;
+	private String message;
+}

+ 36 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/HolidayTypeEnum.java

@@ -0,0 +1,36 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 假期类型
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/7 15:31
+ */
+@Getter
+@AllArgsConstructor
+public enum HolidayTypeEnum {
+	E1(1, "假期"),
+	E2(2, "特殊工作日");
+	private Integer code;
+	private String message;
+
+	/**
+	 * 根据code获取去value
+	 *
+	 * @param code
+	 * @return
+	 */
+	public static HolidayTypeEnum getEnumByCode(int code) {
+		for (HolidayTypeEnum platformFree : HolidayTypeEnum.values()) {
+			if (code == platformFree.getCode()) {
+				return platformFree;
+			}
+		}
+		return null;
+	}
+
+}

+ 40 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/PredictionModelEnum.java

@@ -0,0 +1,40 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 预测模型枚举
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/9/27 9:39
+ */
+@Getter
+@AllArgsConstructor
+public enum PredictionModelEnum {
+	// 云端预测结果
+	E1(1, "云端模型"),
+	// 本地物理模型
+	E2(2, "物理模型"),
+	// 本地统计模型
+	E3(3, "统计模型"),
+	// 本地补录数据
+	E4(4, "补录数据"),
+	// 本地差值模型
+	E5(5, "差值模型"),
+	// 人工干预模型
+	E6(6, "干预模型"),
+	// 上下限修正
+	E7(7, "上下限修正"),
+	// 更新短期
+	E8(8, "更新短期"),
+	// 短期乘系数
+	E9(9, "短期乘系数"),
+	// 人工干预系数
+	E10(10, "干预系数模型"),
+
+	E11(11,"一体化修正形");
+	private Integer code;
+	private String message;
+}

+ 52 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/ProvinceEnum.java

@@ -0,0 +1,52 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 省调度中心枚举
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/5 9:02
+ */
+@Getter
+@AllArgsConstructor
+public enum ProvinceEnum {
+	E11(11, "北京市"),
+	E12(12, "天津市"),
+	E13(13, "河北省-冀北"),
+	E17(17, "河北省-南网"),
+	E14(14, "山西省"),
+	E15(15, "内蒙古自治区-蒙东"),
+	E16(16, "内蒙古自治区-蒙西"),
+	E21(21, "辽宁省"),
+	E22(22, "吉林省"),
+	E23(23, "黑龙江省"),
+	E31(31, "上海市"),
+	E32(32, "江苏省"),
+	E33(33, "浙江省"),
+	E34(34, "安徽省"),
+	E35(35, "福建省"),
+	E36(36, "江西省"),
+	E37(37, "山东省"),
+	E41(41, "河南省"),
+	E42(42, "湖北省"),
+	E43(43, "湖南省"),
+	E44(44, "广东省"),
+	E45(45, "广西壮族自治区"),
+	E46(46, "海南省"),
+	E50(50, "重庆市"),
+	E51(51, "四川省"),
+	E52(52, "贵州省"),
+	E53(53, "云南省"),
+	E54(54, "西藏自治区"),
+	E61(61, "陕西省"),
+	E62(62, "甘肃省"),
+	E63(63, "青海省"),
+	E64(64, "宁夏回族自治区"),
+	E65(65, "新疆维吾尔自治区"),
+	E99(99, "华北直调");
+	private Integer code;
+	private String message;
+}

+ 22 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/PvRotationModeEnum.java

@@ -0,0 +1,22 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 光伏组件旋转方式
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/9/18 13:43
+ */
+@Getter
+@AllArgsConstructor
+public enum PvRotationModeEnum {
+	E1(1, "固定角度"),
+	E2(2, "水平旋转"),
+	E3(3, "上下旋转"),
+	E4(4, "混合旋转");
+	private Integer code;
+	private String message;
+}

+ 20 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/SftpConnectModeEnum.java

@@ -0,0 +1,20 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * SFTP模式
+ *
+ * @author xsl
+ * @version 3.0
+ * @since 2020/4/15 19:30
+ */
+@Getter
+@AllArgsConstructor
+public enum SftpConnectModeEnum {
+    E1(1,"密码连接"),
+    E2(2,"密钥连接");
+    private Integer code;
+    private String message;
+}

+ 143 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/TunnelStatus.java

@@ -0,0 +1,143 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 通道的状态
+ *
+ * @author 修唯xiuwei
+ * @version 3.0
+ */
+@Getter
+@AllArgsConstructor
+public enum TunnelStatus {
+
+
+  /**
+   * 通道状态枚举
+   */
+  BUILT(0, "已创建"),
+  /**
+   * 已连接
+   */
+  CONNECTED(1, "已连接"),
+  /**
+   * 被动丢失连接
+   */
+  LOSECONN(2, "被动丢失连接"),
+  /**
+   * 通道已主动关闭
+   */
+  ACTIVECLOSE(3, "通道已主动关闭"),
+  /**
+   * 正在尝试连接
+   */
+  CONNECTING(4, "正在尝试连接"),
+
+  /**
+   * listeningport 监听网口成功
+   */
+  LISTENPORTSUCCESS(5, "监听端口成功"),
+
+  /**
+   * listeningSerial 监听串口成功
+   */
+  LISTENSERIALSUCCESS(6, "监听串口成功"),
+
+  /**
+   * listeningport 监听网口失败
+   */
+  LISTENPORTFAIL(7, "监听端口失败"),
+
+  /**
+   * listeningSerial 监听串口失败
+   */
+  LISTENSERIALFAIL(8, "监听串口失败"),
+
+  /**
+   * listeningport 正在监听网口
+   */
+  LISTENINGPORT(9, "正在监听端口"),
+
+  /**
+   * listeningSerial 正在监听串口
+   */
+  LISTENINGSERIAL(10, "正在监听串口"),
+
+  /**
+   * listeningport 监听网口成功,并有客户端连接
+   */
+  LISTENPORTSUCCESSANDCONN(13, "监听端口成功并有客户端连接"),
+
+  /**
+   * listeningport 监听网口成功,并无客户端连接
+   */
+  LISTENPORTSUCCESSANDNOCONN(14, "监听端口成功并无客户端连接"),
+
+  /**
+   * listeningport 监听网口成功,并有客户端连接,且交互异常
+   */
+  LISTENPORTSUCCESSANDCONNANDCOMMERROR(15, "监听端口成功并有客户端连接但交互异常"),
+
+  /**
+   * listeningSerial 监听串口成功但交互异常
+   */
+  LISTENSERIALSUCCESSANDCOMMERROR(16, "监听串口成功但交互异常"),
+
+
+  /**
+   * 已连接,但是交互异常
+   */
+  CONNECTEDANDCOMMERROR(17, "已连接但交互异常");
+
+
+  /**
+   * 通道的类型代号
+   */
+  private Integer code;
+
+
+  /**
+   * 通道的类型描述
+   */
+  private String cnDescribe;
+
+
+ public static List<TunnelStatus> getRunningProperlyStatus() {
+    List<TunnelStatus> list = new ArrayList<>();
+    list.add(TunnelStatus.LISTENSERIALSUCCESS);
+    list.add(TunnelStatus.CONNECTED);
+    list.add(TunnelStatus.LISTENPORTSUCCESSANDCONN);
+    list.add(TunnelStatus.LISTENPORTSUCCESS);
+    return list;
+  }
+
+
+  /**
+   * 可用状态
+   */
+  public static final List<TunnelStatus> ABLE_STATUS= Arrays.asList(
+          TunnelStatus.LISTENSERIALSUCCESS,//监听串口正常
+          TunnelStatus.LISTENPORTSUCCESSANDCONN, //监听端口成功,并有连接
+          TunnelStatus.LISTENPORTSUCCESSANDCONNANDCOMMERROR,//监听端口成功,并有连接且交互异常
+          TunnelStatus.LISTENSERIALSUCCESSANDCOMMERROR,//监听串口正常 且交互异常
+          TunnelStatus.CONNECTED,//客户端 成功连接端
+          TunnelStatus.CONNECTEDANDCOMMERROR//客户端 成功连接端 但交互异常
+  );
+
+
+  /**
+   * 正确的状态
+   */
+  public static final List<TunnelStatus> CORRECT_STATUS= Arrays.asList(
+          TunnelStatus.LISTENSERIALSUCCESS,//监听串口正常
+          TunnelStatus.LISTENPORTSUCCESSANDCONN, //监听端口成功,并有连接
+          TunnelStatus.CONNECTED//客户端 成功连接端
+  );
+
+}

+ 83 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/TunnelType.java

@@ -0,0 +1,83 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import com.jiayue.ipfcst.common.data.entity.BaseTunnelInfo;
+import com.jiayue.ipfcst.common.data.entity.gathertunnelinfo.*;
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.Sender104TcpTunnelInfo;
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderCdtRtuTunnelInfo;
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderModbusRtuTunnelInfo;
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderModbusTcpTunnelInfo;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 通道的类型
+ *
+ * @author 修唯xiuwei
+ * @version 3.0
+ */
+@Getter
+@AllArgsConstructor
+public enum TunnelType {
+
+
+  /**
+   * 通道类型枚举
+   */
+  MODBUSTCPMASTER("modbusTCP采集", "in", GatherModbusTcpTunnelInfo.class),
+  /**
+   * modbusRTU采集
+   */
+  MODBUSRTUMASTER("modbusRTU采集", "in", GatherModbusRtuTunnelInfo.class),
+  /**
+   * IEC104TCP采集
+   */
+  IEC104TCPMASTER("IEC104TCP采集", "in", Gather104TcpTunnelInfo.class),
+  /**
+   * CDTRTU采集
+   */
+  CDTRTUMASTER("CDTRTU采集", "in",GatherCdtRtuTunnelInfo.class),
+  /**
+   * modbusTCP转发
+   */
+  MODBUSTCPSLAVE("modbusTCP转发", "out", SenderModbusTcpTunnelInfo.class),
+  /**
+   * modbusRTU转发
+   */
+  MODBUSRTUSLAVE("modbusRTU转发", "out", SenderModbusRtuTunnelInfo.class),
+  /**
+   * IEC104TCP转发
+   */
+  IEC104TCPSLAVE("IEC104TCP转发", "out", Sender104TcpTunnelInfo.class),
+  /**
+   * CDTRTU转发
+   */
+  CDTRTUSLAVE("CDTRTU转发", "out", SenderCdtRtuTunnelInfo.class),
+
+  /**
+   * 隔离文件解析 暂时将这种传输方式视为一种通道
+   * 因为如果视为另一种数据源 点表页面将很难展示
+   */
+  FILEPARSE("穿隔离文件解析", "in", FileParseTunnelInfo.class),
+
+
+  TCPSERVERASMODBUSMASTER("TcpServer扮演RtuMaster","in",GatherModbusRtuWithTcpServerTunnelInfo.class),
+
+  TCPCLIENTASMODBUSMASTER("TcpClient扮演RtuMaster","in",GatherModbusRtuWithTcpClientTunnelInfo.class);
+
+
+  /**
+   * 通道的类型描述
+   */
+  private String cnDescribe;
+
+
+  /**
+   * 流向
+   */
+  private String flow;
+
+
+  private  Class<? extends BaseTunnelInfo>  tunnelInfoClazz;
+
+
+}

+ 20 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/UploadFileCharSetEnum.java

@@ -0,0 +1,20 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 上报文件字符集枚举类
+ *
+ * @author xsl
+ * @version 3.0
+ * @since 2020/4/15 19:30
+ */
+@Getter
+@AllArgsConstructor
+public enum UploadFileCharSetEnum {
+	E1(1, "UTF-8"),
+	E2(2, "GBK");
+	private Integer code;
+	private String message;
+}

+ 21 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/UploadFileNameLengthEnum.java

@@ -0,0 +1,21 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 上报文件名称长度字节枚举类
+ *
+ * @author xsl
+ * @version 3.0
+ * @since 2020/4/15 19:30
+ */
+@Getter
+@AllArgsConstructor
+public enum UploadFileNameLengthEnum {
+	E1(1, "32"),
+	E2(2, "64"),
+	E3(3, "128");
+	private Integer code;
+	private String message;
+}

+ 20 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/UploadFileSingleByteEnum.java

@@ -0,0 +1,20 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 上报文件单次传输字节枚举类
+ *
+ * @author xsl
+ * @version 3.0
+ * @since 2020/4/15 19:30
+ */
+@Getter
+@AllArgsConstructor
+public enum UploadFileSingleByteEnum {
+	E1(1, "512"),
+	E2(2, "1024");
+	private Integer code;
+	private String message;
+}

+ 24 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/UploadProtocolEnum.java

@@ -0,0 +1,24 @@
+package com.jiayue.ipfcst.common.data.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 上报协议枚举类
+ *
+ * @author xsl
+ * @version 3.0
+ * @since 2020/4/15 19:30
+ */
+@Getter
+@AllArgsConstructor
+public enum UploadProtocolEnum {
+	E1("102s", "102服务端"),
+	E2("102m_sd_client", "102山东客户端"),
+	E3("102m_sd_server", "102山东服务端"),
+	E4("ftp", "ftp"),
+	E5("sftp", "sftp"),
+	E6("zj102_client", "102浙江客户端");
+	private String code;
+	private String message;
+}

+ 23 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/AGC_AVCInfo.java

@@ -0,0 +1,23 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.equipmentinfo.AbstractEquipmentInfo;
+import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.persistence.Entity;
+
+/**
+ * AGC AVC 设备信息
+ *
+ * @author: xiuwei
+ * @version:
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class AGC_AVCInfo extends AbstractEquipmentInfo {
+	public AGC_AVCInfo() {
+		super.setEquipmentType(EquipmentTypeEnum.AGC_AVC);
+	}
+}

+ 80 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/AGC_AVCStatusData.java

@@ -0,0 +1,80 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.equipmentstatus.AbstractEquipmentStatusData;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.persistence.Entity;
+import java.math.BigDecimal;
+
+/**
+ * AGC和AVC的状态数据
+ *
+ * @author: xiuwei
+ * @version:
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class AGC_AVCStatusData extends AbstractEquipmentStatusData {
+
+
+	/**
+	 * 全场出力上限 MW
+	 */
+	BigDecimal upperLimitOfWholeStation;
+	/**
+	 * 全厂出力下限	KW
+	 */
+	BigDecimal lowerLimitOfWholeStation;
+	/**
+	 * 全场响应速率	 MW/min
+	 */
+	BigDecimal speedRateOfWholeStation;
+	/**
+	 * 全场目标定值返回值 MW
+	 */
+	BigDecimal targetValueOfWholeStation;
+	/**
+	 * AGC投/退
+	 */
+	Boolean AGCOnOrOff;
+	/**
+	 * AGC远方/就地
+	 */
+	Boolean AGCRemoteOrOnTheSpot;
+	/**
+	 * AGC增出力闭锁
+	 */
+	Boolean AGCIncreaseOutputAtresia;
+	/**
+	 * AGC减出力闭锁
+	 */
+	Boolean AGCDecreaseOutputAtresia;
+	/**
+	 * 升压变高压侧母线电压上限值  KV
+	 */
+	BigDecimal upperLimitOfBoosterHighPressureSideBusVoltage;
+	/**
+	 * 升压变高压侧母线电压下限值  KV
+	 */
+	BigDecimal lowerLimitOfBoosterHighPressureSideBusVoltage;
+	/**
+	 * AVC投/退
+	 */
+	Boolean AVCOnOrOff;
+	/**
+	 * AVC远方/就地
+	 */
+	Boolean AVCRemoteOrOnTheSpot;
+	/**
+	 * AVC增出力闭锁
+	 */
+	Boolean AVCIncreaseOutputAtresia;
+	/**
+	 * AVC减出力闭锁
+	 */
+	Boolean AVCDecreaseOutputAtresia;
+
+
+}

+ 48 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/AccuracyPassRate.java

@@ -0,0 +1,48 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+
+/**
+ * 准确率合格率
+ *
+ * @author yh
+ * @version 1.0
+ * @since 2020/7/8 10:56
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class AccuracyPassRate extends AbstractBaseEntity {
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+    //时间
+    @Column
+    private Long time;
+
+    //短期准确率
+    @Column
+    private String shortTermAccuracy;
+
+    //短期合格率
+    @Column
+    private String shortTermPassRate;
+
+    //超短期准确率
+    @Column
+    private String ultraShortTermAccuracy;
+
+    //超短期合格率
+    @Column
+    private String ultraShortTermPassRate;
+
+}

+ 48 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/AccuracyPassRateDay.java

@@ -0,0 +1,48 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+
+/**
+ * 准确率合格率
+ *
+ * @author zcl
+ * @version 1.0
+ * @since 2022/7/19 15:15
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class AccuracyPassRateDay extends AbstractBaseEntity {
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+    //时间
+    @Column
+    private Long time;
+
+    //短期准确率
+    @Column
+    private String shortTermAccuracy;
+
+    //短期合格率
+    @Column
+    private String shortTermPassRate;
+
+    //超短期准确率
+    @Column
+    private String ultraShortTermAccuracy;
+
+    //超短期合格率
+    @Column
+    private String ultraShortTermPassRate;
+
+}

+ 71 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/BaseTunnelInfo.java

@@ -0,0 +1,71 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.constant.enums.TunnelType;
+import lombok.Data;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.data.jpa.domain.support.AuditingEntityListener;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 通道信息的基类,用于与数据库交互传递信息的实体
+ *
+ * @author 修唯xiuwei
+ * @version 3.0
+ */
+@Data
+@MappedSuperclass
+@EntityListeners(AuditingEntityListener.class)
+public abstract class BaseTunnelInfo<T> implements Serializable {
+
+    /**
+     * 通道的id  使用String的UUID 或雪花值 方便后期的通道联合查询
+     */
+    @Id
+    @GenericGenerator(name = "custom-uuid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomUUIDGenerator")
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "custom-uuid")
+    @Column(length = 64)
+    protected String id;
+    /**
+     * 通道的名称
+     */
+    @Column(length = 100)
+    protected String tunnelName;
+
+    /**
+     * 通道的类型,冗余字段
+     */
+    @Transient
+    protected TunnelType tunnelType;
+
+    /**
+     * 数据刷新时间间隔 单位s 秒
+     */
+    @Column
+    protected Integer refreshInterval = 5;
+
+    /**
+     * 通道是否启用
+     */
+    @Column
+    protected Boolean isEnable = true;
+
+
+    /**
+     * 场站标识
+     */
+    @Column
+    private String stationCode;
+
+
+    /**
+     * 通道中的点位
+     */
+    @JoinColumn(name = "tunnelId", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT), updatable = false)
+    @OneToMany(fetch = FetchType.EAGER)
+    List<T> dataPoints;
+
+
+}

+ 23 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/BoosterStationInfo.java

@@ -0,0 +1,23 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.equipmentinfo.AbstractEquipmentInfo;
+import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.persistence.Entity;
+
+/**
+ * 升压站的信息
+ *
+ * @author: xiuwei
+ * @version:
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class BoosterStationInfo extends AbstractEquipmentInfo {
+	public BoosterStationInfo() {
+		super.setEquipmentType(EquipmentTypeEnum.BOOSTERSTATION);
+	}
+}

+ 35 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/ChannelAlarmInfo.java

@@ -0,0 +1,35 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * 通道告警实体
+ * @author zy
+ * @version 3.0
+ */
+@Data
+@Entity
+public class ChannelAlarmInfo implements Serializable {
+    /**
+     * Id
+     */
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    Integer id;
+    /**
+     * 通道类型 上报upload 回传callBack 接收 dataexchange
+     */
+    @Column
+    private String channelType;
+    /**
+     * 通道号
+     */
+    @Column
+    private String channelId;
+}

+ 75 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/ChannelDisconLog.java

@@ -0,0 +1,75 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+
+/**
+ * 通道断开日志
+ *
+ * @author xsl
+ * @version 3.0
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class ChannelDisconLog extends AbstractBaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+    /**
+     * 通道ID
+     */
+    @Column
+    private String channelId;
+
+    /**
+     * 通道名称
+     */
+    @Column
+    private String channelName;
+
+    /**
+     * 断开时间
+     */
+    @Column
+    private Long disconnectTime;
+
+    /**
+     * 重连时间
+     */
+    @Column
+    private Long reconnectTime;
+
+    /**
+     * 时长
+     */
+    @Column
+    private String duration;
+
+
+    /**
+     * 计算并配置持续时间
+     */
+    public void countAndSetDuration(){
+        if(this.reconnectTime==null || this.disconnectTime==null || this.reconnectTime <= this.disconnectTime){
+            return;
+        }
+        Long durationL = this.reconnectTime-this.disconnectTime;
+        if (durationL/1000>=60){
+            setDuration(durationL/(1000*60)+"分");
+        }
+        else{
+           setDuration(durationL/1000+"秒");
+        }
+    }
+}

+ 29 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/CollectingPowerLineInfo.java

@@ -0,0 +1,29 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.equipmentinfo.AbstractEquipmentInfo;
+import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.persistence.Entity;
+
+/**
+ * 集电线信息
+ *
+ * @author: xiuwei
+ * @version:
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class CollectingPowerLineInfo extends AbstractEquipmentInfo {
+
+	/**
+	 * 编号
+	 */
+	private String code;
+
+	public CollectingPowerLineInfo() {
+		super.setEquipmentType(EquipmentTypeEnum.JDX);
+	}
+}

+ 84 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/CommunicationEquipment.java

@@ -0,0 +1,84 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import lombok.Data;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+
+/**
+ * 通信设备
+ *
+ * @author zy
+ * @version 3.0
+ */
+@Data
+@Entity
+public class CommunicationEquipment {
+    /**
+     * Id
+     */
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    Integer id;
+    /**
+     * 通信设备名称
+     */
+    @Column
+    private String name;
+    /**
+     * 通信设备的网卡名称
+     */
+    @Column
+    private String  netCardName;
+    /**
+     * 通信设备网卡的Ip地址
+     */
+    @Column
+    private String  netCardIp;
+    /**
+     * 通信设备的子网掩码
+     */
+    @Column
+    private String  netmask;
+    /**
+     * 通信设备的网关
+     */
+    @Column
+    private String  gateway;
+    /**
+     * 通信设备的端口
+     */
+    @Column
+    private String  port;
+    /**
+     * 功率预测名称
+     */
+    @Column
+    private String systemName;
+    /**
+     * 功率预测的网卡名称
+     */
+    @Column
+    private String  systemNetCardName;
+    /**
+     * 功率预测网卡的Ip地址
+     */
+    @Column
+    private String  systemNetCardIp;
+    /**
+     * 功率预测的子网掩码
+     */
+    @Column
+    private String  systemNetmask;
+    /**
+     * 功率预测的网关
+     */
+    @Column
+    private String  systemGateway;
+    /**
+     * 功率预测的端口
+     */
+    @Column
+    private String  systemPort;
+}

+ 56 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/CustomReportForm.java

@@ -0,0 +1,56 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+
+/**
+ * 自定义报表
+ *
+ * @author yh
+ * @version 3.0
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class CustomReportForm extends AbstractBaseEntity {
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+    //自定义报表名称
+    @Column
+    private String name;
+    //短期
+    @Column
+    private Integer dq;
+    //超短期
+    @Column
+    private Integer cdq;
+    //实际功率
+    private String rp;
+    //nwp
+    @Column
+    private String nwp;
+    //环境类数据
+    @Column
+    private String env;
+    //时间间隔
+    @Column
+    private Integer interval;
+    //是否修改
+    @Column
+    private Boolean isUpdate;
+    //是否定时查询 1为定时 0 为实时
+    @Column
+    private String timingRealTime;
+
+
+
+
+}

+ 46 - 0
ipfcst/ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/DataLimitation.java

@@ -0,0 +1,46 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+import java.math.BigDecimal;
+
+/**
+ * 数据限制实体
+ *
+ * @author tl
+ * @version 3.0
+ * @since 2021/1/5 11:20
+ */
+@EqualsAndHashCode(callSuper = true)
+@Entity
+@Data
+public class DataLimitation  extends AbstractBaseEntity {
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    @Column
+    private Integer id;
+
+    /**
+     * 被限制时间点
+     */
+    @Column
+    private Long limitTime;
+
+    /**
+     * 上限值
+     */
+    @Column
+    private BigDecimal upperLimit;
+
+    /**
+     * 下限值
+     */
+    @Column
+    private BigDecimal lowerLimit;
+
+}

Неке датотеке нису приказане због велике количине промена