RYang 5 lat temu
commit
c85ba23ecd
100 zmienionych plików z 8935 dodań i 0 usunięć
  1. 14 0
      .gitignore
  2. 14 0
      .idea/compiler.xml
  3. 17 0
      .idea/misc.xml
  4. 6 0
      .idea/sbt.xml
  5. 6 0
      .idea/vcs.xml
  6. 467 0
      .idea/workspace.xml
  7. 584 0
      pom.xml
  8. 42 0
      src/main/java/com/Customer.java
  9. 88 0
      src/main/java/com/Producer.java
  10. 20 0
      src/main/java/com/lightinit/hsdatashow/TestCon.java
  11. 62 0
      src/main/java/com/lightinit/hsdatashow/annotation/AnnotationHelper.java
  12. 21 0
      src/main/java/com/lightinit/hsdatashow/annotation/FieldDescriber.java
  13. 27 0
      src/main/java/com/lightinit/hsdatashow/annotation/FieldDescriberHelper.java
  14. 215 0
      src/main/java/com/lightinit/hsdatashow/common/Base64Utils.java
  15. 78 0
      src/main/java/com/lightinit/hsdatashow/common/BaseRemoteClient.java
  16. 35 0
      src/main/java/com/lightinit/hsdatashow/common/BytesUtil.java
  17. 14 0
      src/main/java/com/lightinit/hsdatashow/common/CharEncoding.java
  18. 19 0
      src/main/java/com/lightinit/hsdatashow/common/CharacterUtils.java
  19. 17 0
      src/main/java/com/lightinit/hsdatashow/common/ClassUtils.java
  20. 37 0
      src/main/java/com/lightinit/hsdatashow/common/ConfigUtils.java
  21. 84 0
      src/main/java/com/lightinit/hsdatashow/common/DateUtils.java
  22. 41 0
      src/main/java/com/lightinit/hsdatashow/common/ExcelTookitUtils.java
  23. 192 0
      src/main/java/com/lightinit/hsdatashow/common/ExcelUtils.java
  24. 93 0
      src/main/java/com/lightinit/hsdatashow/common/FTPConfigurationUtilsPro.java
  25. 364 0
      src/main/java/com/lightinit/hsdatashow/common/FTPTookitUtils.java
  26. 13 0
      src/main/java/com/lightinit/hsdatashow/common/GuidGenerator.java
  27. 214 0
      src/main/java/com/lightinit/hsdatashow/common/HttpTookitUtils.java
  28. 148 0
      src/main/java/com/lightinit/hsdatashow/common/IPUtils.java
  29. 53 0
      src/main/java/com/lightinit/hsdatashow/common/MD5Utils.java
  30. 162 0
      src/main/java/com/lightinit/hsdatashow/common/MenuUtils.java
  31. 43 0
      src/main/java/com/lightinit/hsdatashow/common/ObjectConvertorUtils.java
  32. 17 0
      src/main/java/com/lightinit/hsdatashow/common/ObjectMappingUtils.java
  33. 181 0
      src/main/java/com/lightinit/hsdatashow/common/OneTimePasswordAlgorithm.java
  34. 19 0
      src/main/java/com/lightinit/hsdatashow/common/OrderNumberUtils.java
  35. 36 0
      src/main/java/com/lightinit/hsdatashow/common/PermissionUtilsPro.java
  36. 43 0
      src/main/java/com/lightinit/hsdatashow/common/RoleComboUtils.java
  37. 127 0
      src/main/java/com/lightinit/hsdatashow/common/RoleModulesUtilsPro.java
  38. 71 0
      src/main/java/com/lightinit/hsdatashow/common/SecureCardUtilsPro.java
  39. 32 0
      src/main/java/com/lightinit/hsdatashow/common/ShiroFilterUtils.java
  40. 179 0
      src/main/java/com/lightinit/hsdatashow/common/SingleChartMapperUtils.java
  41. 43 0
      src/main/java/com/lightinit/hsdatashow/common/SolrUtils.java
  42. 32 0
      src/main/java/com/lightinit/hsdatashow/common/SysContants.java
  43. 28 0
      src/main/java/com/lightinit/hsdatashow/common/ThriftServerConfig.java
  44. 123 0
      src/main/java/com/lightinit/hsdatashow/common/TripleDESUtilsPro.java
  45. 70 0
      src/main/java/com/lightinit/hsdatashow/common/UploadFileUtils.java
  46. 50 0
      src/main/java/com/lightinit/hsdatashow/common/WebUtilsPro.java
  47. 210 0
      src/main/java/com/lightinit/hsdatashow/controller/ActiveMQController.java
  48. 74 0
      src/main/java/com/lightinit/hsdatashow/controller/BaseController.java
  49. 57 0
      src/main/java/com/lightinit/hsdatashow/controller/CacheController.java
  50. 94 0
      src/main/java/com/lightinit/hsdatashow/controller/CaptchaController.java
  51. 16 0
      src/main/java/com/lightinit/hsdatashow/controller/GrantController.java
  52. 33 0
      src/main/java/com/lightinit/hsdatashow/controller/HomeController.java
  53. 46 0
      src/main/java/com/lightinit/hsdatashow/controller/LogController.java
  54. 100 0
      src/main/java/com/lightinit/hsdatashow/controller/LoginController.java
  55. 81 0
      src/main/java/com/lightinit/hsdatashow/controller/MenuController.java
  56. 218 0
      src/main/java/com/lightinit/hsdatashow/controller/RoleController.java
  57. 164 0
      src/main/java/com/lightinit/hsdatashow/controller/SolrController.java
  58. 215 0
      src/main/java/com/lightinit/hsdatashow/controller/TokenController.java
  59. 114 0
      src/main/java/com/lightinit/hsdatashow/controller/UploadController.java
  60. 344 0
      src/main/java/com/lightinit/hsdatashow/controller/UserController.java
  61. 97 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/AccountController.java
  62. 100 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/AtmosphereController.java
  63. 62 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/BaseController.java
  64. 90 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/BuildingController.java
  65. 43 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/CockpitController.java
  66. 46 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/CommonController.java
  67. 90 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/CommunicationController.java
  68. 72 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/CountrysideController.java
  69. 21 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/DemoController.java
  70. 55 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/EcologicalCivilizationControllerr.java
  71. 59 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/EconomicDevelopmentController.java
  72. 144 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/EducationController.java
  73. 106 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/EnergyController.java
  74. 107 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/FacilitiesController.java
  75. 44 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/GarbageCanController.java
  76. 62 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/GarbageController.java
  77. 44 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/GreenController.java
  78. 96 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/HomeController.java
  79. 62 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/InnovateController.java
  80. 61 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/LivelihoodImproveController.java
  81. 90 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/LivingSecurityController.java
  82. 85 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/NewEconomicDevelopmentController.java
  83. 57 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/NewGarbageCanController.java
  84. 36 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/NewWaterTingController.java
  85. 41 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/NoiseController.java
  86. 97 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/PeopleGrowthController.java
  87. 92 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/ProduceSecurityController.java
  88. 62 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/ProgressController.java
  89. 43 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/PublishController.java
  90. 62 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/PublishServiceController.java
  91. 204 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/RoleMgrController.java
  92. 101 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/SocietySecurityController.java
  93. 67 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/SolidWasteController.java
  94. 47 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/StreetLampController.java
  95. 65 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/TourismCultureController.java
  96. 57 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/TrafficMonitorController.java
  97. 96 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/TrafficSecurityController.java
  98. 98 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/UserAdminController.java
  99. 67 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/WaterQualityController.java
  100. 0 0
      src/main/java/com/lightinit/hsdatashow/controller/admin/WaterThingController.java

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+# Created by .ignore support plugin (hsz.mobi)
+### Maven template
+target/
+out/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+.mvn/wrapper/maven-wrapper.jar
+

+ 14 - 0
.idea/compiler.xml

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

+ 17 - 0
.idea/misc.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="FrameworkDetectionExcludesConfiguration">
+    <file type="web" url="file://$PROJECT_DIR$" />
+  </component>
+  <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" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 6 - 0
.idea/sbt.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ScalaSbtSettings">
+    <option name="customVMPath" />
+  </component>
+</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>

+ 467 - 0
.idea/workspace.xml

@@ -0,0 +1,467 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ArtifactsWorkspaceSettings">
+    <artifacts-to-build>
+      <artifact name="hsdatashow:war" />
+    </artifacts-to-build>
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="5408e40b-8099-4cd0-85a1-bd6ca6a80353" name="Default" comment="">
+      <change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/config.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/config.properties" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/mybatis-generator/generatorConfig.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mybatis-generator/generatorConfig.xml" afterDir="false" />
+    </list>
+    <ignored path="$PROJECT_DIR$/target/" />
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="TRACKING_ENABLED" value="true" />
+    <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="FileEditorManager">
+    <leaf>
+      <file leaf-file-name="config.properties" pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/src/main/resources/config.properties">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="80">
+              <caret line="14" column="22" lean-forward="true" selection-start-line="14" selection-start-column="22" selection-end-line="14" selection-end-column="22" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="GradleLocalSettings">
+    <option name="projectSyncType">
+      <map>
+        <entry key="$USER_HOME$/Desktop/PAAS中标部署/app-cloud-master" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/PAAS中标部署/dcw-mgmt-server-master" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/apiplatform_2.1.0.201809200314" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/dcw-mgmt-server" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/i慧湖/cmsApi" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/proto-firechat/mars" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/sh-server" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/张家港E管家项目/GIT/bike-h5-zjg" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/张家港E管家项目/GIT/egj-dataserver" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/张家港E管家项目/GIT/egj-epay-server" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/张家港E管家项目/GIT/egj-manager-server" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/张家港E管家项目/GIT/steward-epay" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/智慧党建/GIT/gd-event-service" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/智慧党建/GIT/gd-infomation" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/智慧党建/GIT/partyaffairs" value="PREVIEW" />
+        <entry key="$USER_HOME$/Desktop/软著资料/dcw-mgmt-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/BigData/GIT/analysismgr" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/BigData/GIT/dataportal" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/analysismgr" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/cas" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/coupon-service" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/cspservice" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/dc-lcn" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/dc-tm-manager" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/dcw-boot" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/demoService" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/demoWebService" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/egj-manager-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/event-service" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/information-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/operationmgr" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/payment-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/points" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/securitycall" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/shopping-service" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/third-service" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/userservice" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/GIT/verifyserver" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/LCN事务管理器/GIT/test-tm-appa" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/LCN事务管理器/GIT/test-tm-appb" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/LCN事务管理器/GIT/test-tm-appc" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/developer/GIT/app-cloud" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/developer/GIT/dc-cas-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/developer/GIT/dc-cas-server/dc-cas-server-webapp" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/paycloud/GIT/dc-cas-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/sample/dc-lcn" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/sample/fescar-develop" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/sample/fescar-samples-master" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/sample/springboot-dubbo-fescar-master" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/sample/tx-lcn-5.0.2.RELEASE" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/sample/txlcn-demo-master" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/北京网/GIT/sh-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/大数据平台/GIT/analyflume" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/大数据平台/GIT/analysismgr" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/大数据平台/GIT/dataportal" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/开发者门户/GIT/app-cloud" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/开发者门户/GIT/dcw-mgmt-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../LIGHTINIT/00-项目资料/05-公租房/GIT/housing-common" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../LIGHTINIT/00-项目资料/05-公租房/GIT/housing-datasync" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../LCN事务管理器/GIT/mrf-lcn" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../LCN事务管理器/GIT/mrf-tm-manager" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../daas/GIT/apiOutService" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../daas/GIT/apiService" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../developer/GIT/dcw-mgmt-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../framework/GIT/csp-commons" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../framework/GIT/dc-cas-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../framework/GIT/demoService" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../framework/GIT/mrf-boot" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../framework/GIT/mrf-cas-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../platformBusiness/GIT/cas" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../platformBusiness/GIT/cspservice" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../platformBusiness/GIT/image" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../platformBusiness/GIT/operationmgr" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../platformBusiness/GIT/securitycall" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../platformBusiness/GIT/third-service" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../platformBusiness/GIT/userservice" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../platformBusiness/GIT/ytserver" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../product/鲜果多多/GIT/fruits-service" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/GradleSide-master/20-plugin-proguard" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/Installer-master" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/confusion-master" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/moco-master" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/proguard-spring-boot-example-master" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/sso-master/sso-client1" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/sso-master/sso-client2" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/sso-master/sso-server" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../sample/txlcn-demo-master" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../SR/framework/GIT/dcw-boot" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../TOOLS/lombok-intellij-plugin" value="PREVIEW" />
+      </map>
+    </option>
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="CHANGED_PATHS">
+      <list>
+        <option value="$PROJECT_DIR$/.gitignore" />
+        <option value="$PROJECT_DIR$/src/main/resources/config.properties" />
+      </list>
+    </option>
+  </component>
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
+  <component name="JsGulpfileManager">
+    <detection-done>true</detection-done>
+    <sorting>DEFINITION_ORDER</sorting>
+  </component>
+  <component name="LogFilters">
+    <option name="FILTER_ERRORS" value="false" />
+    <option name="FILTER_WARNINGS" value="false" />
+    <option name="FILTER_INFO" value="true" />
+    <option name="FILTER_DEBUG" value="true" />
+    <option name="CUSTOM_FILTER" />
+  </component>
+  <component name="MavenImportPreferences">
+    <option name="importingSettings">
+      <MavenImportingSettings>
+        <option name="importAutomatically" value="true" />
+      </MavenImportingSettings>
+    </option>
+  </component>
+  <component name="NodePackageJsonFileManager">
+    <packageJsonPaths />
+  </component>
+  <component name="ProjectFrameBounds" fullScreen="true">
+    <option name="width" value="1440" />
+    <option name="height" value="900" />
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
+  <component name="ProjectView">
+    <navigator proportions="" version="1">
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes>
+      <pane id="ProjectPane">
+        <subPane>
+          <expand>
+            <path>
+              <item name="hsdatashow" type="b2602c69:ProjectViewProjectNode" />
+              <item name="hsdatashow" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="hsdatashow" type="b2602c69:ProjectViewProjectNode" />
+              <item name="hsdatashow" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="hsdatashow" type="b2602c69:ProjectViewProjectNode" />
+              <item name="hsdatashow" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+              <item name="main" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="hsdatashow" type="b2602c69:ProjectViewProjectNode" />
+              <item name="hsdatashow" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+              <item name="main" type="462c0819:PsiDirectoryNode" />
+              <item name="java" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="hsdatashow" type="b2602c69:ProjectViewProjectNode" />
+              <item name="hsdatashow" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+              <item name="main" type="462c0819:PsiDirectoryNode" />
+              <item name="java" type="462c0819:PsiDirectoryNode" />
+              <item name="com" type="462c0819:PsiDirectoryNode" />
+            </path>
+            <path>
+              <item name="hsdatashow" type="b2602c69:ProjectViewProjectNode" />
+              <item name="hsdatashow" type="462c0819:PsiDirectoryNode" />
+              <item name="src" type="462c0819:PsiDirectoryNode" />
+              <item name="main" type="462c0819:PsiDirectoryNode" />
+              <item name="resources" type="462c0819:PsiDirectoryNode" />
+            </path>
+          </expand>
+          <select />
+        </subPane>
+      </pane>
+      <pane id="PackagesPane" />
+      <pane id="Scope" />
+      <pane id="AndroidView" />
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="aspect.path.notification.shown" value="true" />
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
+    <property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
+  </component>
+  <component name="RunDashboard">
+    <option name="ruleStates">
+      <list>
+        <RuleState>
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+        </RuleState>
+        <RuleState>
+          <option name="name" value="StatusDashboardGroupingRule" />
+        </RuleState>
+      </list>
+    </option>
+  </component>
+  <component name="RunManager">
+    <configuration default="true" type="Application" factoryName="Application">
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+    </configuration>
+    <configuration default="true" type="JUnit" factoryName="JUnit">
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+      <option name="PACKAGE_NAME" />
+      <option name="MAIN_CLASS_NAME" />
+      <option name="METHOD_NAME" />
+      <option name="TEST_OBJECT" value="class" />
+      <option name="VM_PARAMETERS" value="-ea" />
+      <option name="PARAMETERS" />
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
+      <option name="PASS_PARENT_ENVS" value="true" />
+      <option name="TEST_SEARCH_SCOPE">
+        <value defaultName="singleModule" />
+      </option>
+      <patterns />
+    </configuration>
+    <configuration default="true" type="TestNG" factoryName="TestNG">
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+      <option name="SUITE_NAME" />
+      <option name="PACKAGE_NAME" />
+      <option name="MAIN_CLASS_NAME" />
+      <option name="METHOD_NAME" />
+      <option name="GROUP_NAME" />
+      <option name="TEST_OBJECT" value="CLASS" />
+      <option name="VM_PARAMETERS" value="-ea" />
+      <option name="PARAMETERS" />
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
+      <option name="OUTPUT_DIRECTORY" />
+      <option name="PASS_PARENT_ENVS" value="true" />
+      <option name="TEST_SEARCH_SCOPE">
+        <value defaultName="singleModule" />
+      </option>
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
+      <option name="PROPERTIES_FILE" />
+      <properties />
+      <listeners />
+    </configuration>
+    <configuration name="Unnamed" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 8.0.30" ALTERNATIVE_JRE_ENABLED="false">
+      <option name="UPDATING_POLICY" value="restart-server" />
+      <deployment>
+        <artifact name="hsdatashow:war">
+          <settings>
+            <option name="CONTEXT_PATH" value="/" />
+          </settings>
+        </artifact>
+      </deployment>
+      <server-settings>
+        <option name="BASE_DIRECTORY_NAME" value="Unnamed_hsdatashow" />
+      </server-settings>
+      <predefined_log_file id="Tomcat" enabled="true" />
+      <predefined_log_file id="Tomcat Catalina" enabled="true" />
+      <predefined_log_file id="Tomcat Manager" enabled="false" />
+      <predefined_log_file id="Tomcat Host Manager" enabled="false" />
+      <predefined_log_file id="Tomcat Localhost Access" enabled="false" />
+      <RunnerSettings RunnerId="Debug">
+        <option name="DEBUG_PORT" value="60438" />
+      </RunnerSettings>
+      <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
+        <option name="USE_ENV_VARIABLES" value="true" />
+        <STARTUP>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </STARTUP>
+        <SHUTDOWN>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </SHUTDOWN>
+      </ConfigurationWrapper>
+      <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
+        <option name="USE_ENV_VARIABLES" value="true" />
+        <STARTUP>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </STARTUP>
+        <SHUTDOWN>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </SHUTDOWN>
+      </ConfigurationWrapper>
+      <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
+        <option name="USE_ENV_VARIABLES" value="true" />
+        <STARTUP>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </STARTUP>
+        <SHUTDOWN>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </SHUTDOWN>
+      </ConfigurationWrapper>
+      <method>
+        <option name="BuildArtifacts" enabled="true">
+          <artifact name="hsdatashow:war" />
+        </option>
+      </method>
+    </configuration>
+  </component>
+  <component name="SbtLocalSettings">
+    <option name="projectSyncType">
+      <map>
+        <entry key="$PROJECT_DIR$/../../../../DCW/BigData/GIT/NewSparkApp-MySQL" value="PREVIEW" />
+        <entry key="$PROJECT_DIR$/../../../../DCW/大数据平台/GIT/NewSparkApp-MySQL" value="PREVIEW" />
+      </map>
+    </option>
+  </component>
+  <component name="SvnConfiguration">
+    <configuration />
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="5408e40b-8099-4cd0-85a1-bd6ca6a80353" name="Default" comment="" />
+      <created>1575598984379</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1575598984379</updated>
+      <workItem from="1575598985649" duration="981000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TimeTrackingManager">
+    <option name="totallyTimeSpent" value="981000" />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="0" y="0" width="1440" height="900" extended-state="0" />
+    <editor active="true" />
+    <layout>
+      <window_info anchor="right" id="Palette" />
+      <window_info anchor="bottom" id="FindBugs-IDEA" />
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
+      <window_info anchor="bottom" id="Application Servers" weight="0.6848485" />
+      <window_info anchor="right" id="Maven Projects" />
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
+      <window_info id="Capture Tool" />
+      <window_info id="Designer" />
+      <window_info anchor="right" id="Database" />
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
+      <window_info id="UI Designer" />
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.34545454" />
+      <window_info anchor="bottom" id="TODO" order="6" />
+      <window_info anchor="bottom" id="Messages" />
+      <window_info anchor="right" id="Palette&#9;" />
+      <window_info id="Image Layers" />
+      <window_info anchor="bottom" id="Java Enterprise" />
+      <window_info anchor="right" id="Capture Analysis" />
+      <window_info anchor="bottom" id="Run" order="2" />
+      <window_info anchor="bottom" id="Version Control" />
+      <window_info anchor="bottom" id="Spring" />
+      <window_info anchor="bottom" id="Terminal" />
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24964234" />
+      <window_info anchor="right" id="Bean Validation" />
+      <window_info id="Web" side_tool="true" />
+      <window_info anchor="right" id="Theme Preview" />
+      <window_info id="Favorites" side_tool="true" />
+      <window_info anchor="bottom" id="Find" order="1" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
+      <window_info anchor="bottom" id="Message" order="0" />
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
+    </layout>
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="1" />
+  </component>
+  <component name="VcsContentAnnotationSettings">
+    <option name="myLimit" value="2678400000" />
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$PROJECT_DIR$/.gitignore">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="210">
+          <caret line="14" lean-forward="true" selection-start-line="14" selection-end-line="14" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/Producer.java">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-482">
+          <caret line="9" column="13" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/main/resources/config.properties">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="80">
+          <caret line="14" column="22" lean-forward="true" selection-start-line="14" selection-start-column="22" selection-end-line="14" selection-end-column="22" />
+        </state>
+      </provider>
+    </entry>
+  </component>
+  <component name="masterDetails">
+    <states>
+      <state key="ProjectJDKs.UI">
+        <settings>
+          <last-edited>1.8</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+    </states>
+  </component>
+</project>

+ 584 - 0
pom.xml

@@ -0,0 +1,584 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>com.lightinit</groupId>
+  <artifactId>hsdatashow</artifactId>
+  <packaging>war</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>HSDataShow Maven Webapp</name>
+  <url>http://maven.apache.org</url>
+  <properties>
+    <spring.version>4.2.6.RELEASE</spring.version>
+    <mysql.version>5.1.21</mysql.version>
+    <mybatis.version>3.4.2</mybatis.version>
+    <shiro.version>1.3.2</shiro.version>
+    <druid.version>1.0.29</druid.version>
+    <axis2.version>1.7.5</axis2.version>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+    <!--modelmapper映射-->
+    <dependency>
+      <groupId>org.modelmapper</groupId>
+      <artifactId>modelmapper</artifactId>
+      <version>0.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jdbc</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-orm</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-tx</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>3.1.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.servlet.jsp</groupId>
+      <artifactId>jsp-api</artifactId>
+      <version>2.1</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>jstl</groupId>
+      <artifactId>jstl</artifactId>
+      <version>1.2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>taglibs</groupId>
+      <artifactId>standard</artifactId>
+      <version>1.1.2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context-support</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-websocket</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>${mysql.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mybatis</groupId>
+      <artifactId>mybatis</artifactId>
+      <version>${mybatis.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mybatis</groupId>
+      <artifactId>mybatis-spring</artifactId>
+      <version>1.3.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-mapper-asl</artifactId>
+      <version>1.9.12</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-core-asl</artifactId>
+      <version>1.9.12</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-dbcp</groupId>
+      <artifactId>commons-dbcp</artifactId>
+      <version>1.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-pool</groupId>
+      <artifactId>commons-pool</artifactId>
+      <version>1.5.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.1.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>3.2.2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpclient</artifactId>
+      <version>4.5.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>3.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>2.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.shiro</groupId>
+      <artifactId>shiro-core</artifactId>
+      <version>${shiro.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.shiro</groupId>
+      <artifactId>shiro-web</artifactId>
+      <version>${shiro.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.shiro</groupId>
+      <artifactId>shiro-quartz</artifactId>
+      <version>${shiro.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.shiro</groupId>
+      <artifactId>shiro-ehcache</artifactId>
+      <version>${shiro.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.shiro</groupId>
+      <artifactId>shiro-spring</artifactId>
+      <version>${shiro.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>net.sf.ehcache</groupId>
+      <artifactId>ehcache-core</artifactId>
+      <version>2.6.11</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+      <version>2.7.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+      <version>2.7.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+      <version>2.7.4</version>
+    </dependency>
+    <!--Jaxen is a universal Java XPath engine. -->
+    <dependency>
+      <groupId>jaxen</groupId>
+      <artifactId>jaxen</artifactId>
+      <version>1.1.6</version>
+    </dependency>
+    <!--log4j-->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.10</version>
+    </dependency>
+
+    <!--<dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-jdk14</artifactId>
+      <version>1.7.10</version>
+    </dependency>-->
+
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.17</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>1.7.10</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-fileupload</groupId>
+      <artifactId>commons-fileupload</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.6</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>com.github.penggle</groupId>
+      <artifactId>kaptcha</artifactId>
+      <version>2.3.2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>redis.clients</groupId>
+      <artifactId>jedis</artifactId>
+      <version>2.9.0</version>
+      <type>jar</type>
+      <scope>compile</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework.data</groupId>
+      <artifactId>spring-data-mongodb</artifactId>
+      <version>1.10.1.RELEASE</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mongodb</groupId>
+      <artifactId>mongo-java-driver</artifactId>
+      <version>3.3.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-beanutils</groupId>
+      <artifactId>commons-beanutils</artifactId>
+      <version>1.9.3</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.alibaba</groupId>
+      <artifactId>druid</artifactId>
+      <version>${druid.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-configuration2</artifactId>
+      <version>2.1.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.google.zxing</groupId>
+      <artifactId>core</artifactId>
+      <version>3.3.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.google.zxing</groupId>
+      <artifactId>javase</artifactId>
+      <version>3.3.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+      <version>2.18.3</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-ftp</artifactId>
+      <version>2.18.3</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.thrift</groupId>
+      <artifactId>libthrift</artifactId>
+      <version>0.9.3</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>zookeeper</artifactId>
+      <version>3.3.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.bouncycastle</groupId>
+      <artifactId>bcprov-jdk16</artifactId>
+      <version>1.45</version>
+    </dependency>
+	<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
+	<dependency>
+    	<groupId>org.postgresql</groupId>
+    	<artifactId>postgresql</artifactId>
+    	<version>42.1.4</version>
+	</dependency>
+
+    <!--axis2-->
+<!-- 
+    <dependency>
+      <groupId>org.apache.axis2</groupId>
+      <artifactId>axis2-adb</artifactId>
+      <version>${axis2.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.axis2</groupId>
+      <artifactId>axis2-kernel</artifactId>
+      <version>${axis2.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.axis2</groupId>
+      <artifactId>axis2-transport-http</artifactId>
+      <version>${axis2.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.axis2</groupId>
+      <artifactId>axis2-transport-local</artifactId>
+      <version>${axis2.version}</version>
+    </dependency> -->
+    <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.axis2/addressing &ndash;&gt;-->
+    <!--<dependency>-->
+      <!--<groupId>org.apache.axis2</groupId>-->
+      <!--<artifactId>addressing</artifactId>-->
+      <!--<version>1.7.5</version>-->
+    <!--</dependency>-->
+
+    <dependency>
+      <groupId>org.apache.ws.commons.axiom</groupId>
+      <artifactId>axiom-api</artifactId>
+      <version>1.2.20</version>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun</groupId>
+      <artifactId>aliyun-java-sdk-core</artifactId>
+      <version>3.2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun</groupId>
+      <artifactId>aliyun-java-sdk-vod</artifactId>
+      <version>2.2.0</version>
+    </dependency>
+
+    <!--<dependency>
+      <groupId>com.microsoft.sqlserver</groupId>
+      <artifactId>mssql-jdbc</artifactId>
+      <version>6.2.1.jre8</version>
+    </dependency>-->
+	<!-- https://mvnrepository.com/artifact/org.apache.solr/solr-solrj -->
+	<!--<dependency>
+    	<groupId>org.apache.solr</groupId>
+    	<artifactId>solr-solrj</artifactId>
+    	<version>7.1.0</version>
+	</dependency>-->
+<!-- https://mvnrepository.com/artifact/org.apache.solr/solr-core -->
+<!--<dependency>
+    <groupId>org.apache.solr</groupId>
+    <artifactId>solr-core</artifactId>
+    <version>7.1.0</version>
+</dependency>-->
+
+    <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjweaver</artifactId>
+      <version>1.8.12</version>
+    </dependency>
+    <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjrt -->
+    <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjrt</artifactId>
+      <version>1.8.12</version>
+    </dependency>
+
+    <!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-core -->
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jms</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>activemq-core</artifactId>
+      <version>5.7.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>activemq-pool</artifactId>
+      <version>5.15.2</version>
+    </dependency>
+    <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
+    <dependency>
+      <groupId>org.apache.poi</groupId>
+      <artifactId>poi</artifactId>
+      <version>3.17</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.poi</groupId>
+      <artifactId>poi-ooxml</artifactId>
+      <version>3.17</version>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+      <version>1.1.0.Final</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-validator</artifactId>
+      <version>5.4.2.Final</version>
+    </dependency>
+
+    <!--rabbitmq组件-->
+    <!--<dependency>-->
+      <!--<groupId>com.rabbitmq</groupId>-->
+      <!--<artifactId>amqp-client</artifactId>-->
+      <!--<version>4.2.0</version>-->
+    <!--</dependency>-->
+    <!--<dependency>-->
+      <!--<groupId>org.springframework.amqp</groupId>-->
+      <!--<artifactId>spring-rabbit</artifactId>-->
+      <!--<version>2.0.0.M5</version>-->
+    <!--</dependency>-->
+
+    <dependency>
+      <groupId>org.springframework.amqp</groupId>
+      <artifactId>spring-rabbit</artifactId>
+      <version>1.4.5.RELEASE</version>
+      <!--<version>1.3.6.RELEASE</version>-->
+    </dependency>
+    <dependency>
+      <groupId>com.rabbitmq</groupId>
+      <artifactId>amqp-client</artifactId>
+      <version>3.5.1</version>
+    </dependency>
+
+
+    <!--爬取网页需要-->
+    <dependency>
+      <groupId>org.jsoup</groupId>
+      <artifactId>jsoup</artifactId>
+      <version>1.10.2</version>
+    </dependency>
+      <dependency>
+          <groupId>dom4j</groupId>
+          <artifactId>dom4j</artifactId>
+          <version>1.6.1</version>
+      </dependency>
+    <!--JSONObject-->
+    <dependency>
+      <groupId>net.sf.json-lib</groupId>
+      <artifactId>json-lib</artifactId>
+      <version>2.4</version>
+      <classifier>jdk15</classifier>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.poi</groupId>
+      <artifactId>poi</artifactId>
+      <version>3.10-FINAL</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.poi</groupId>
+      <artifactId>poi-ooxml</artifactId>
+      <version>3.10-FINAL</version>
+    </dependency>
+
+  </dependencies>
+  <build>
+    <finalName>HSDataShow</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.mybatis.generator</groupId>
+        <artifactId>mybatis-generator-maven-plugin</artifactId>
+        <version>1.3.5</version>
+        <configuration>
+          <configurationFile>src/main/resources/mybatis-generator/generatorConfig.xml</configurationFile>
+          <verbose>true</verbose>
+          <overwrite>true</overwrite>
+        </configuration>
+        <executions>
+          <execution>
+            <id>Generate MyBatis Artifacts</id>
+            <goals>
+              <goal>generate</goal>
+            </goals>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>org.mybatis.generator</groupId>
+            <artifactId>mybatis-generator-core</artifactId>
+            <version>1.3.5</version>
+          </dependency>
+          <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql.version}</version>
+          </dependency>
+          <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>mssql-jdbc</artifactId>
+            <version>6.2.1.jre8</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.8</source>
+          <target>1.8</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

+ 42 - 0
src/main/java/com/Customer.java

@@ -0,0 +1,42 @@
+package com;
+
+import com.rabbitmq.client.*;
+
+import java.io.IOException;
+import java.util.concurrent.TimeoutException;
+
+public class Customer {
+    private final static String QUEUE_NAME = "rabbitMQ.test1";
+
+    public static void main(String[] args) throws IOException, TimeoutException {
+        // 创建连接工厂
+        ConnectionFactory factory = new ConnectionFactory();
+        //设置RabbitMQ地址
+        factory.setHost("192.168.5.123");
+//        //factory.setHost("121.17.184.59");
+        factory.setUsername("admin");
+        factory.setPassword("admin123");
+        factory.setPort(5672);
+        factory.setVirtualHost("/");
+        //创建一个新的连接
+        Connection connection = factory.newConnection();
+        //创建一个通道
+        Channel channel = connection.createChannel();
+        //声明要关注的队列
+        channel.queueDeclare(QUEUE_NAME, false, false, true, null);
+        System.out.println("Customer Waiting Received messages");
+        //DefaultConsumer类实现了Consumer接口,通过传入一个频道,
+        // 告诉服务器我们需要那个频道的消息,如果频道中有消息,就会执行回调函数handleDelivery
+        Consumer consumer = new DefaultConsumer(channel) {
+            @Override
+            public void handleDelivery(String consumerTag, Envelope envelope,
+                                       AMQP.BasicProperties properties, byte[] body)
+                    throws IOException {
+                String message = new String(body, "UTF-8");
+                System.out.println("Customer Received '" + message + "'");
+            }
+        };
+        //自动回复队列应答 -- RabbitMQ中的消息确认机制
+        channel.basicConsume(QUEUE_NAME, true, consumer);
+    }
+}

+ 88 - 0
src/main/java/com/Producer.java

@@ -0,0 +1,88 @@
+package com;
+
+import com.rabbitmq.client.Channel;
+import com.rabbitmq.client.Connection;
+import com.rabbitmq.client.ConnectionFactory;
+
+import java.io.IOException;
+import java.util.concurrent.TimeoutException;
+
+public class Producer {
+//    private final static String EXCHANGE_NAME = "EXTAXIGPS";
+//
+//    public static void main(String[] args) throws Exception {
+//        ConnectionFactory factory = new ConnectionFactory();
+//        factory.setHost("121.17.184.59");
+//        factory.setPort(50052);
+//        factory.setUsername("guest");
+//        factory.setPassword("guest");
+//        Connection connection = factory.newConnection();
+//        Channel channel = connection.createChannel();
+//        channel.exchangeDeclare(EXCHANGE_NAME, "fanout");
+//        String queueName = channel.queueDeclare().getQueue();
+//        channel.queueBind(queueName, EXCHANGE_NAME, "");
+//
+//        Consumer consumer = new DefaultConsumer(channel) {
+//            @Override
+//            public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
+//                String message = new String(body, "UTF-8");
+//                System.out.println("receive message :" + message);
+//            }
+//        };
+//        channel.basicConsume(queueName, true, consumer);
+//    }
+
+//    private final static String QUEUE_NAME = "hello";
+//
+//    public static void main(String[] args) throws Exception {
+//        // TODO Auto-generated method stub
+//
+//        ConnectionFactory factory = new ConnectionFactory();
+//        factory.setHost("121.17.184.59");
+//        factory.setPort(50052);
+//        factory.setUsername("guest");
+//        factory.setPassword("guest");
+//        Connection connection = null;
+//        Channel channel = null;
+//
+//        connection = factory.newConnection();
+//        channel = connection.createChannel();
+//
+//        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
+//        String message = "Hello World!";
+//        channel.basicPublish("", QUEUE_NAME, null, message.getBytes("UTF-8"));
+//        System.out.println(" [Producer] Sent '" + message + "'");
+//
+//        channel.close();
+//        connection.close();
+//    }
+
+
+    public final static String QUEUE_NAME="rabbitMQ.test4";
+
+    public static void main(String[] args) throws IOException, TimeoutException {
+        //创建连接工厂
+        ConnectionFactory factory = new ConnectionFactory();
+        //设置RabbitMQ相关信息
+        //factory.setHost("localhost") ;
+        //factory.setHost("192.168.5.123");
+        factory.setHost("121.17.184.59");
+        factory.setUsername("admin");
+        factory.setPassword("admin123");
+        factory.setPort(50052);
+        factory.setVirtualHost("/");
+        //创建一个新的连接
+        Connection connection = factory.newConnection();
+        //创建一个通道
+        Channel channel = connection.createChannel();
+        //  声明一个队列
+        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
+        String message = "Hello RabbitMQ";
+        //发送消息到队列中
+        channel.basicPublish("", QUEUE_NAME, null, message.getBytes("UTF-8"));
+        System.out.println("Producer Send +'" + message + "'");
+        //关闭通道和连接
+        channel.close();
+        connection.close();
+    }
+}

+ 20 - 0
src/main/java/com/lightinit/hsdatashow/TestCon.java

@@ -0,0 +1,20 @@
+package com.lightinit.hsdatashow;
+
+public class TestCon {
+
+    public static void main(String[] args) {
+//        String path = "/Users/lidongyang/Downloads/衡水大数据任务清单-20190315.xlsx";
+//        try {
+//            List<List<String>> result = new ExcelUtils().readXlsx(path);
+//            System.out.println(result.size());
+//            for (int i = 0; i < result.size(); i++) {
+//                List<String> model = result.get(i);
+//                System.out.println("orderNum:" + model.get(0) + "--> orderAmount:" + model.get(1));
+//            }
+//
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+    }
+
+}

+ 62 - 0
src/main/java/com/lightinit/hsdatashow/annotation/AnnotationHelper.java

@@ -0,0 +1,62 @@
+package com.lightinit.hsdatashow.annotation;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author WangYao
+ * @date 2018/6/2 11:02
+ * @description 注解帮助类
+ */
+public class AnnotationHelper {
+
+    /**
+     * @param clazz 目标类.class
+     * @param fieldName 成员变量(字段)名
+     * @param clazzAnnotation 注解.class
+     * @param <T> 泛型,继承自Annotaion
+     * @return 注解类实例或null。
+     */
+    public static <T extends Annotation> T getFieldAnnotation(Class clazz, String fieldName, Class<T> clazzAnnotation){
+        List<Field> fieldList = new ArrayList<>();
+        Class tempClass = clazz;
+        while (tempClass != null) { //当父类为null的时候说明到达了最上层的父类(Object类).
+            Field[] fields = tempClass.getDeclaredFields();
+            fieldList.addAll(Arrays.asList(fields));
+            tempClass = tempClass.getSuperclass(); //得到父类,然后赋给自己
+        }
+        if (fieldList == null || fieldList.size() == 0){
+            return null;
+        }
+        Field targetField = null;
+        for (Field field : fieldList){
+            if (field.getName().equals(fieldName)){
+                targetField = field;
+                break;
+            }
+        }
+        if (targetField == null){
+            return null;
+        }
+        if (!targetField.isAnnotationPresent(clazzAnnotation)){
+            return null;
+        }
+        return targetField.getAnnotation(clazzAnnotation);
+    }
+
+
+    /**
+     * @param object 目标类对象
+     * @param fieldName 成员变量(字段)名
+     * @param clazzAnnotation 注解.class
+     * @param <TObject> 泛型目标类对象
+     * @param <TAnnotation> 泛型注解,继承自Annotaion
+     * @return 注解类实例或null。
+     */
+    public static <TObject, TAnnotation extends Annotation> TAnnotation getFieldAnnotation(TObject object, String fieldName, Class<TAnnotation> clazzAnnotation){
+        return object == null ? null : getFieldAnnotation(object.getClass(), fieldName, clazzAnnotation);
+    }
+}

+ 21 - 0
src/main/java/com/lightinit/hsdatashow/annotation/FieldDescriber.java

@@ -0,0 +1,21 @@
+package com.lightinit.hsdatashow.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author WangYao
+ * @date 2018/6/1 15:30
+ * @description 字段描述器
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface FieldDescriber {
+
+    /**
+     * 字段的描述
+     */
+    String descripton() default "";
+}

+ 27 - 0
src/main/java/com/lightinit/hsdatashow/annotation/FieldDescriberHelper.java

@@ -0,0 +1,27 @@
+package com.lightinit.hsdatashow.annotation;
+
+/**
+ * @author WangYao
+ * @date 2018/6/1 15:39
+ * @description 字段描述器帮助类
+ */
+public class FieldDescriberHelper {
+
+    public static <T> FieldDescriber getFieldDescriber(Class clazz, String fieldName){
+        return AnnotationHelper.getFieldAnnotation(clazz, fieldName, FieldDescriber.class);
+    }
+
+    public static <T> FieldDescriber getFieldDescriber(T object, String fieldName){
+        return AnnotationHelper.getFieldAnnotation(object, fieldName, FieldDescriber.class);
+    }
+
+    public static <T> String getFieldDescription(Class clazz, String fieldName){
+        FieldDescriber fieldDescriber = getFieldDescriber(clazz, fieldName);
+        return fieldDescriber == null ? null : fieldDescriber.descripton();
+    }
+
+    public static <T> String getFieldDescription(T object, String fieldName){
+        FieldDescriber fieldDescriber = getFieldDescriber(object, fieldName);
+        return fieldDescriber == null ? null : fieldDescriber.descripton();
+    }
+}

+ 215 - 0
src/main/java/com/lightinit/hsdatashow/common/Base64Utils.java

@@ -0,0 +1,215 @@
+package com.lightinit.hsdatashow.common;
+import java.io.UnsupportedEncodingException;
+/**
+ * Created by Mr.Yao on 2017/5/4.
+ */
+public class Base64Utils {
+    public static final String DEFAULT_ENCODING = "UTF-8";
+
+    /*
+     * The methods of this class are static. Do not instantiate this class. Use
+     * its static methods to get the encoded/decoded results
+     */
+    public static String encode(byte[] byteData) throws UnsupportedEncodingException {
+        return encode(byteData, DEFAULT_ENCODING);
+    }
+    public static String encode(byte[] byteData, String encoding) throws UnsupportedEncodingException {
+        if(byteData == null) { throw new IllegalArgumentException("byteData cannot be null"); }
+        return new String(_encode(byteData),encoding);
+    }
+
+    public static byte[] encode(String string) throws UnsupportedEncodingException {
+        return encode(string, DEFAULT_ENCODING);
+    }
+
+    public static byte[] encode(String string, String encoding) throws UnsupportedEncodingException {
+        if(string == null) { throw new IllegalArgumentException("string cannot be null"); }
+        return _encode(string.getBytes(encoding));
+    }
+
+    public final static byte[] _encode(byte[] byteData) {
+        /* If we received a null argument, exit this method. */
+        if (byteData == null) { throw new IllegalArgumentException("byteData cannot be null"); }
+
+        /*
+         * Declare working variables including an array of bytes that will
+         * contain the encoded data to be returned to the caller. Note that the
+         * encoded array is about 1/3 larger than the input. This is because
+         * every group of 3 bytes is being encoded into 4 bytes.
+         */
+        int iSrcIdx; // index into source (byteData)
+        int iDestIdx; // index into destination (byteDest)
+        // byte[] byteData = (byte[])byteData_in.clone();
+        // byte[] byteData = byteData_in;
+        byte[] byteDest = new byte[((byteData.length + 2) / 3) * 4];
+
+        /*
+         * Walk through the input array, 24 bits at a time, converting them from
+         * 3 groups of 8 to 4 groups of 6 with two unset bits between. as per
+         * Base64 spec see
+         * http://www.javaworld.com/javaworld/javatips/jw-javatip36-p2.html for
+         * example explanation
+         */
+        for (iSrcIdx = 0, iDestIdx = 0; iSrcIdx < byteData.length - 2; iSrcIdx += 3) {
+            byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] >>> 2) & 077);
+            byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] >>> 4) & 017 | (byteData[iSrcIdx] << 4) & 077);
+            byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 2] >>> 6) & 003 | (byteData[iSrcIdx + 1] << 2) & 077);
+            byteDest[iDestIdx++] = (byte) (byteData[iSrcIdx + 2] & 077);
+        }
+
+        /*
+         * If the number of bytes we received in the input array was not an even
+         * multiple of 3, convert the remaining 1 or 2 bytes.
+         */
+        if (iSrcIdx < byteData.length) {
+            byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] >>> 2) & 077);
+            if (iSrcIdx < byteData.length - 1) {
+                byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] >>> 4) & 017 | (byteData[iSrcIdx] << 4) & 077);
+                byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx + 1] << 2) & 077);
+            } else
+                byteDest[iDestIdx++] = (byte) ((byteData[iSrcIdx] << 4) & 077);
+        }
+
+        /*
+         * Use the encoded data as indexes into the Base64 alphabet. (The Base64
+         * alphabet is completely documented in RFC 1521.)
+         */
+        for (iSrcIdx = 0; iSrcIdx < iDestIdx; iSrcIdx++) {
+            if (byteDest[iSrcIdx] < 26)
+                byteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + 'A');
+            else if (byteDest[iSrcIdx] < 52)
+                byteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + 'a' - 26);
+            else if (byteDest[iSrcIdx] < 62)
+                byteDest[iSrcIdx] = (byte) (byteDest[iSrcIdx] + '0' - 52);
+            else if (byteDest[iSrcIdx] < 63)
+                byteDest[iSrcIdx] = '+';
+            else
+                byteDest[iSrcIdx] = '/';
+        }
+
+        /* Pad any unused bytes in the destination string with '=' characters. */
+        for (; iSrcIdx < byteDest.length; iSrcIdx++)
+            byteDest[iSrcIdx] = '=';
+
+        return byteDest;
+    }
+
+    public static String decode(byte[] encoded) throws UnsupportedEncodingException {
+        return decode(encoded, DEFAULT_ENCODING);
+    }
+
+    public static String decode(byte[] encoded, String encoding) throws UnsupportedEncodingException {
+        if(encoded == null) { throw new IllegalArgumentException("encoded cannot be null"); }
+        return new String(_decode(encoded), encoding);
+    }
+
+    public final static byte[] decode(String encoded) throws UnsupportedEncodingException {
+        return decode(encoded,DEFAULT_ENCODING);
+    }
+
+    public final static byte[] decode(String encoded, String encoding) throws IllegalArgumentException, UnsupportedEncodingException {
+        if(null == encoded) { throw new IllegalArgumentException("encoded cannot be null"); }
+        return _decode(encoded.getBytes(encoding));
+    }
+
+    public final static byte[] _decode(byte[] byteData) throws IllegalArgumentException {
+        /* If we received a null argument, exit this method. */
+        if (byteData == null) { throw new IllegalArgumentException("byteData cannot be null"); }
+
+        /*
+         * Declare working variables including an array of bytes that will
+         * contain the decoded data to be returned to the caller. Note that the
+         * decoded array is about 3/4 smaller than the input. This is because
+         * every group of 4 bytes is being encoded into 3 bytes.
+         */
+        int iSrcIdx; // index into source (byteData)
+        int reviSrcIdx; // index from end of the src array (byteData)
+        int iDestIdx; // index into destination (byteDest)
+        byte[] byteTemp = new byte[byteData.length];
+
+        /*
+         * remove any '=' chars from the end of the byteData they would have
+         * been padding to make it up to groups of 4 bytes note that I don't
+         * need to remove it just make sure that when progressing throug array
+         * we don't go past reviSrcIdx ;-)
+         */
+        for (reviSrcIdx = byteData.length; reviSrcIdx -1 > 0 && byteData[reviSrcIdx -1] == '='; reviSrcIdx--) {
+            ; // do nothing. I'm just interested in value of reviSrcIdx
+        }
+
+        /* sanity check */
+        if (reviSrcIdx -1 == 0) { return null; /* ie all padding */ }
+
+        /*
+         * Set byteDest, this is smaller than byteData due to 4 -> 3 byte munge.
+         * Note that this is an integer division! This fact is used in the logic
+         * l8r. to make sure we don't fall out of the array and create an
+         * OutOfBoundsException and also in handling the remainder
+         */
+        byte byteDest[] = new byte[((reviSrcIdx * 3) / 4)];
+
+        /*
+         * Convert from Base64 alphabet to encoded data (The Base64 alphabet is
+         * completely documented in RFC 1521.) The order of the testing is
+         * important as I use the '<' operator which looks at the hex value of
+         * these ASCII chars. So convert from the smallest up
+         *
+         * do all of this in a new array so as not to edit the original input
+         */
+        for (iSrcIdx = 0; iSrcIdx < reviSrcIdx; iSrcIdx++) {
+            if (byteData[iSrcIdx] == '+')
+                byteTemp[iSrcIdx] = 62;
+            else if (byteData[iSrcIdx] == '/')
+                byteTemp[iSrcIdx] = 63;
+            else if (byteData[iSrcIdx] < '0' + 10)
+                byteTemp[iSrcIdx] = (byte) (byteData[iSrcIdx] + 52 - '0');
+            else if (byteData[iSrcIdx] < ('A' + 26))
+                byteTemp[iSrcIdx] = (byte) (byteData[iSrcIdx] - 'A');
+            else if (byteData[iSrcIdx] < 'a' + 26)
+                byteTemp[iSrcIdx] = (byte) (byteData[iSrcIdx] + 26 - 'a');
+        }
+
+        /*
+         * 4bytes -> 3bytes munge Walk through the input array, 32 bits at a
+         * time, converting them from 4 groups of 6 to 3 groups of 8 removing
+         * the two unset most significant bits of each sorce byte as this was
+         * filler, as per Base64 spec. stop before potential buffer overun on
+         * byteDest, remember that byteDest is 3/4 (integer division) the size
+         * of input and won't necessary divide exactly (ie iDestIdx must be <
+         * (integer div byteDest.length / 3)*3 see
+         * http://www.javaworld.com/javaworld/javatips/jw-javatip36-p2.html for
+         * example
+         */
+        for (iSrcIdx = 0, iDestIdx = 0; iSrcIdx < reviSrcIdx
+                && iDestIdx < ((byteDest.length / 3) * 3); iSrcIdx += 4) {
+            byteDest[iDestIdx++] = (byte) ((byteTemp[iSrcIdx] << 2) & 0xFC | (byteTemp[iSrcIdx + 1] >>> 4) & 0x03);
+            byteDest[iDestIdx++] = (byte) ((byteTemp[iSrcIdx + 1] << 4) & 0xF0 | (byteTemp[iSrcIdx + 2] >>> 2) & 0x0F);
+            byteDest[iDestIdx++] = (byte) ((byteTemp[iSrcIdx + 2] << 6) & 0xC0 | byteTemp[iSrcIdx + 3] & 0x3F);
+        }
+
+        /*
+         * tidy up any remainders if iDestIdx >= ((byteDest.length / 3)*3) but
+         * iSrcIdx < reviSrcIdx then we have at most 2 extra destination bytes
+         * to fill and posiblr 3 input bytes yet to process
+         */
+        if (iSrcIdx < reviSrcIdx) {
+            if (iSrcIdx < reviSrcIdx - 2) {
+                // "3 input bytes left"
+                byteDest[iDestIdx++] = (byte) ((byteTemp[iSrcIdx] << 2) & 0xFC | (byteTemp[iSrcIdx + 1] >>> 4) & 0x03);
+                byteDest[iDestIdx++] = (byte) ((byteTemp[iSrcIdx + 1] << 4) & 0xF0 | (byteTemp[iSrcIdx + 2] >>> 2) & 0x0F);
+            } else if (iSrcIdx < reviSrcIdx - 1) {
+                // "2 input bytes left"
+                byteDest[iDestIdx++] = (byte) ((byteTemp[iSrcIdx] << 2) & 0xFC | (byteTemp[iSrcIdx + 1] >>> 4) & 0x03);
+            }
+            /*
+             * wont have just one input byte left (unless input wasn't base64
+             * encoded ) due to the for loop steps and array sizes, after "="
+             * pad removed, but for compleatness
+             */
+            else {
+                throw new IllegalArgumentException("Warning: 1 input bytes left to process. This was not Base64 input");
+            }
+        }
+        return byteDest;
+    }
+}

+ 78 - 0
src/main/java/com/lightinit/hsdatashow/common/BaseRemoteClient.java

@@ -0,0 +1,78 @@
+package com.lightinit.hsdatashow.common;
+
+import com.lightinit.hsdatashow.json.pojo.ServerEntity;
+import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.WatchedEvent;
+import org.apache.zookeeper.Watcher;
+import org.apache.zookeeper.ZooKeeper;
+import org.springframework.util.StringUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+/**
+ * Created by Mr.Yao on 2017/10/10.
+ */
+public class BaseRemoteClient implements Watcher{
+
+    private final Random random=new Random();
+    List<String> list = new ArrayList<String>();
+    private ZooKeeper zooKeeper=null;
+
+    protected BaseRemoteClient(String node, String service){
+        //RegisterServerList(node,service);
+    }
+
+    protected void RegisterServerList(String node, String service) {
+        try {
+            if (zooKeeper == null) {
+                ThriftServerConfig config = new ThriftServerConfig();
+                zooKeeper = new ZooKeeper(config.getHost() + ":" + config.getPort(), 30000, this);
+                if (zooKeeper.exists("/thrift", false) != null) {
+                    if (zooKeeper.exists(String.format("/thrift/%s", node), false) != null) {
+                        if (zooKeeper.exists(String.format("/thrift/%s/%s", node, service), true) != null) {
+                            list = zooKeeper.getChildren(String.format("/thrift/%s/%s", node, service), true);
+                        }
+                    }
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        } catch (KeeperException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public ServerEntity SelectServer(){
+        ServerEntity item=new ServerEntity();
+        if(list.size()<=0){
+            item.setServerIp("127.0.0.1");
+            item.setServerPort(9876);
+        }else{
+            String serverIp=list.get(random.nextInt(list.size()));
+            if (StringUtils.isEmpty(serverIp)){
+                item.setServerIp("127.0.0.1");
+                item.setServerPort(9876);
+            }else{
+                String []infos= serverIp.split(":");
+                if(infos.length==2) {
+                    item.setServerIp(infos[0]);
+                    item.setServerPort(Integer.valueOf(infos[1]));
+                }else{
+                    item.setServerIp("127.0.0.1");
+                    item.setServerPort(9876);
+                }
+            }
+        }
+        return item;
+    }
+
+    @Override
+    public void process(WatchedEvent watchedEvent) {
+
+    }
+}

+ 35 - 0
src/main/java/com/lightinit/hsdatashow/common/BytesUtil.java

@@ -0,0 +1,35 @@
+package com.lightinit.hsdatashow.common;
+
+/**
+ * Created by Mr.Yao on 2017/5/4.
+ */
+public class BytesUtil {
+
+    private static final char[] HEX_CHAR= {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+    private static int parse(char c) {
+        if (c >= 'a')
+            return (c - 'a' + 10) & 0x0f;
+        if (c >= 'A')
+            return (c - 'A' + 10) & 0x0f;
+        return (c - '0') & 0x0f;
+    }
+
+    public static byte[] HexStringToBytes(String hexstr) {
+        byte[] b = new byte[hexstr.length() / 2];
+        int j = 0;
+        for (int i = 0; i < b.length; i++) {
+            char c0 = hexstr.charAt(j++);
+            char c1 = hexstr.charAt(j++);
+            b[i] = (byte) ((parse(c0) << 4) | parse(c1));
+        }
+        return b;
+    }
+    public static String byteArrayToString(byte[] data){
+        StringBuilder stringBuilder= new StringBuilder();
+        for (int i=0; i<data.length; i++){
+            stringBuilder.append(HEX_CHAR[(data[i] & 0xf0)>>> 4]);
+            stringBuilder.append(HEX_CHAR[(data[i] & 0x0f)]);
+        }
+        return stringBuilder.toString();
+    }
+}

+ 14 - 0
src/main/java/com/lightinit/hsdatashow/common/CharEncoding.java

@@ -0,0 +1,14 @@
+package com.lightinit.hsdatashow.common;
+
+public enum CharEncoding {
+	UTF8("UTF-8"), GBK("GBK"), GB2312("GB2312");
+	String _charset = "UTF-8";
+
+	private CharEncoding(String charset) {
+		_charset = charset;
+	}
+
+	public String value() {
+		return _charset;
+	}
+}

+ 19 - 0
src/main/java/com/lightinit/hsdatashow/common/CharacterUtils.java

@@ -0,0 +1,19 @@
+package com.lightinit.hsdatashow.common;
+
+import java.util.Random;
+
+public class CharacterUtils {
+    /*
+    *随机字符串生成
+    */
+    public static String getRandomString(int length){
+        String str="zxcvbnmlkjhgfdsaqwertyuiopQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
+        Random random=new Random();
+        StringBuffer sb=new StringBuffer();
+        for(int i=0;i<length;i++){
+            int number=random.nextInt(62);
+            sb.append(str.charAt(number));
+        }
+        return sb.toString();
+    }
+}

+ 17 - 0
src/main/java/com/lightinit/hsdatashow/common/ClassUtils.java

@@ -0,0 +1,17 @@
+package com.lightinit.hsdatashow.common;
+
+/**
+ * @author WangYao
+ * @date 2018/6/15 13:46
+ * @description 类工具
+ */
+public class ClassUtils {
+
+    /** 判断类型是Java本身的类型,还是用户自定义的类型
+     * @param clazz 类型
+     * @return true/false
+     */
+    public static boolean isJavaClass(Class<?> clazz) {
+        return clazz != null && clazz.getClassLoader() == null;
+    }
+}

+ 37 - 0
src/main/java/com/lightinit/hsdatashow/common/ConfigUtils.java

@@ -0,0 +1,37 @@
+package com.lightinit.hsdatashow.common;
+
+import org.apache.commons.configuration2.Configuration;
+import org.apache.commons.configuration2.builder.fluent.Configurations;
+import org.apache.commons.configuration2.ex.ConfigurationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by WangYao on 2018/6/13.
+ */
+public class ConfigUtils {
+
+    private static final Logger logger = LoggerFactory.getLogger(ConfigUtils.class);
+
+    private Configuration configuration=null;
+    private static final Map<String, Configuration> configurationMap = new HashMap<>();
+
+    public static Configuration getConfiguration(String propertiesFile){
+        Configuration configuration = null;
+        if (!configurationMap.containsKey(propertiesFile)){
+            try {
+                Configurations configurations = new Configurations();
+                configuration = configurations.properties(new File(propertiesFile));
+                configurationMap.put(propertiesFile, configuration);
+            } catch (ConfigurationException e) {
+                logger.error(e.getMessage());
+                return null;
+            }
+        }
+        return configurationMap.get(propertiesFile);
+    }
+}

+ 84 - 0
src/main/java/com/lightinit/hsdatashow/common/DateUtils.java

@@ -0,0 +1,84 @@
+package com.lightinit.hsdatashow.common;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * Created by Mr.Yao on 2017/9/26.
+ */
+public class DateUtils {
+    public static int daysBetween(String begindate, String enddate) {
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(sdf.parse(begindate));
+            long time1 = cal.getTimeInMillis();
+            cal.setTime(sdf.parse(enddate));
+            long time2 = cal.getTimeInMillis();
+            long between_days = (time2 - time1) / (1000 * 3600 * 24);
+
+            return Integer.parseInt(String.valueOf(between_days));
+        } catch (ParseException e) {
+            return 0;
+        }
+    }
+
+    public static String weekBeginDate(Date date) {
+        try {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(date);
+            int d = 0;
+            if (cal.get(Calendar.DAY_OF_WEEK) == 1) {
+                d = -6;
+            } else {
+                d = 2 - cal.get(Calendar.DAY_OF_WEEK);
+            }
+            cal.add(Calendar.DAY_OF_WEEK, d);
+            return simpleDateFormat.format(cal.getTime());
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    public static String weekEndDate(Date date) {
+        try {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(date);
+            int d = 0;
+            if (cal.get(Calendar.DAY_OF_WEEK) == 1) {
+                d = -6;
+            } else {
+                d = 2 - cal.get(Calendar.DAY_OF_WEEK);
+            }
+            cal.add(Calendar.DAY_OF_WEEK, d);
+            cal.add(Calendar.DAY_OF_WEEK, 6);
+            return simpleDateFormat.format(cal.getTime());
+        } catch (Exception e) {
+            return "";
+        }
+    }
+
+    public static Date StringToDate(String str) {
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date result = sdf.parse(str);
+            return result;
+        } catch (ParseException ex) {
+            return null;
+        }
+    }
+
+    public static int YearOfDate() {
+        Calendar now = Calendar.getInstance();
+        return now.get(Calendar.YEAR);
+    }
+
+    public static int MonthOfDate() {
+        Calendar now = Calendar.getInstance();
+        return now.get(Calendar.MONTH) + 1;
+    }
+}

+ 41 - 0
src/main/java/com/lightinit/hsdatashow/common/ExcelTookitUtils.java

@@ -0,0 +1,41 @@
+package com.lightinit.hsdatashow.common;
+
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+
+/**
+ * Created by Mr.Yao on 2017/6/14.
+ */
+public class ExcelTookitUtils {
+    /**
+     * 获取97-2003EXCEL单元格内容
+     * @param xssfRow 单元格
+     * @return 单元格内容
+     */
+    @SuppressWarnings("static-access")
+    public static String getValue(XSSFCell xssfRow) {
+        if (xssfRow.getCellType() == xssfRow.CELL_TYPE_BOOLEAN) {
+            return String.valueOf(xssfRow.getBooleanCellValue());
+        } else if (xssfRow.getCellType() == xssfRow.CELL_TYPE_NUMERIC) {
+            return String.valueOf(xssfRow.getNumericCellValue());
+        } else {
+            return String.valueOf(xssfRow.getStringCellValue());
+        }
+    }
+
+    /**
+     * 获取xlsx格式的单元格内容
+     * @param hssfCell 单元格
+     * @return 单元格内容
+     */
+    @SuppressWarnings("static-access")
+    public static String getValue(HSSFCell hssfCell) {
+        if (hssfCell.getCellType() == hssfCell.CELL_TYPE_BOOLEAN) {
+            return String.valueOf(hssfCell.getBooleanCellValue());
+        } else if (hssfCell.getCellType() == hssfCell.CELL_TYPE_NUMERIC) {
+            return String.valueOf(hssfCell.getNumericCellValue());
+        } else {
+            return String.valueOf(hssfCell.getStringCellValue());
+        }
+    }
+}

+ 192 - 0
src/main/java/com/lightinit/hsdatashow/common/ExcelUtils.java

@@ -0,0 +1,192 @@
+package com.lightinit.hsdatashow.common;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.poi.ss.usermodel.Cell.*;
+
+public class ExcelUtils {
+
+    /**
+     *
+     * @Title: readXls
+     * @Description: 处理xls文件
+     * @param @param path
+     * @param @return
+     * @param @throws Exception    设定文件
+     * @return List<List<String>>    返回类型
+     * @throws
+     *
+//     * 从代码不难发现其处理逻辑:
+     * 1.先用InputStream获取excel文件的io流
+     * 2.然后穿件一个内存中的excel文件HSSFWorkbook类型对象,这个对象表示了整个excel文件。
+     * 3.对这个excel文件的每页做循环处理
+     * 4.对每页中每行做循环处理
+     * 5.对每行中的每个单元格做处理,获取这个单元格的值
+     * 6.把这行的结果添加到一个List数组中
+     * 7.把每行的结果添加到最后的总结果中
+     * 8.解析完以后就获取了一个List<List<String>>类型的对象了
+     *
+     */
+    public static List<List<String>> readXls(MultipartFile file) throws Exception {
+//        InputStream is = new FileInputStream(path);
+        InputStream is = file.getInputStream();
+        // HSSFWorkbook 标识整个excel
+        HSSFWorkbook hssfWorkbook = new HSSFWorkbook(is);
+        List<List<String>> result = new ArrayList<List<String>>();
+        int size = hssfWorkbook.getNumberOfSheets();
+        // 循环每一页,并处理当前循环页
+        for (int numSheet = 0; numSheet < size; numSheet++) {
+            // HSSFSheet 标识某一页
+            HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(numSheet);
+            if (hssfSheet == null) {
+                continue;
+            }
+            // 处理当前页,循环读取每一行
+            for (int rowNum = 1; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
+                // HSSFRow表示行
+                HSSFRow hssfRow = hssfSheet.getRow(rowNum);
+                int minColIx = hssfRow.getFirstCellNum();
+                int maxColIx = hssfRow.getLastCellNum();
+                List<String> rowList = new ArrayList<String>();
+                // 遍历改行,获取处理每个cell元素
+                for (int colIx = minColIx; colIx < maxColIx; colIx++) {
+                    // HSSFCell 表示单元格
+                    HSSFCell cell = hssfRow.getCell(colIx);
+                    if (cell == null) {
+                        continue;
+                    }
+                    rowList.add(getStringVal(cell));
+                }
+                result.add(rowList);
+            }
+        }
+        return result;
+    }
+
+    /**
+     *
+     * @Title: readXlsx
+     * @Description: 处理Xlsx文件
+     * @param @param path
+     * @param @return
+     * @param @throws Exception    设定文件
+     * @return List<List<String>>    返回类型
+     * @throws
+     */
+    public static List<List<String>> readXlsx(MultipartFile file) throws Exception {
+//        InputStream is = new FileInputStream(path);
+        InputStream is = file.getInputStream() ;
+        XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
+        List<List<String>> result = new ArrayList<List<String>>();
+        // 循环每一页,并处理当前循环页
+        for (XSSFSheet xssfSheet : xssfWorkbook) {
+            if (xssfSheet == null) {
+                continue;
+            }
+            // 处理当前页,循环读取每一行
+            for (int rowNum = 1; rowNum <= xssfSheet.getLastRowNum(); rowNum++) {
+                XSSFRow xssfRow = xssfSheet.getRow(rowNum);
+                int minColIx = xssfRow.getFirstCellNum();
+                int maxColIx = xssfRow.getLastCellNum();
+                List<String> rowList = new ArrayList<String>();
+                for (int colIx = minColIx; colIx < maxColIx; colIx++) {
+                    XSSFCell cell = xssfRow.getCell(colIx);
+                    if (cell == null) {
+                        continue;
+                    }
+                    rowList.add(cell.toString());
+                }
+                result.add(rowList);
+            }
+        }
+        return result;
+    }
+
+    // 存在的问题
+    /*
+     * 其实有时候我们希望得到的数据就是excel中的数据,可是最后发现结果不理想
+     * 如果你的excel中的数据是数字,你会发现Java中对应的变成了科学计数法。
+     * 所以在获取值的时候就要做一些特殊处理来保证得到自己想要的结果
+     * 网上的做法是对于数值型的数据格式化,获取自己想要的结果。
+     * 下面提供另外一种方法,在此之前,我们先看一下poi中对于toString()方法:
+     *
+     * 该方法是poi的方法,从源码中我们可以发现,该处理流程是:
+     * 1.获取单元格的类型
+     * 2.根据类型格式化数据并输出。这样就产生了很多不是我们想要的
+     * 故对这个方法做一个改造。
+     */
+    /*public String toString(){
+        switch(getCellType()){
+            case CELL_TYPE_BLANK:
+                return "";
+            case CELL_TYPE_BOOLEAN:
+                return getBooleanCellValue() ? "TRUE" : "FALSE";
+            case CELL_TYPE_ERROR:
+                return ErrorEval.getText(getErrorCellValue());
+            case CELL_TYPE_FORMULA:
+                return getCellFormula();
+            case CELL_TYPE_NUMERIC:
+                if(DateUtil.isCellDateFormatted(this)){
+                    DateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy")
+                    return sdf.format(getDateCellValue());
+                }
+                return getNumericCellValue() + "";
+            case CELL_TYPE_STRING:
+                return getRichStringCellValue().toString();
+            default :
+                return "Unknown Cell Type:" + getCellType();
+        }
+    }*/
+
+    /**
+     * 改造poi默认的toString()方法如下
+     * @Title: getStringVal
+     * @Description: 1.对于不熟悉的类型,或者为空则返回""控制串
+     *               2.如果是数字,则修改单元格类型为String,然后返回String,这样就保证数字不被格式化了
+     * @param @param cell
+     * @param @return    设定文件
+     * @return String    返回类型
+     * @throws
+     */
+    public static String getStringVal(HSSFCell cell) {
+        switch (cell.getCellType()) {
+            case CELL_TYPE_BOOLEAN:
+                return cell.getBooleanCellValue() ? "TRUE" : "FALSE";
+            case CELL_TYPE_FORMULA:
+                return cell.getCellFormula();
+            case CELL_TYPE_NUMERIC:
+                cell.setCellType(CELL_TYPE_STRING);
+                return cell.getStringCellValue();
+            case CELL_TYPE_STRING:
+                return cell.getStringCellValue();
+            default:
+                return "";
+        }
+    }
+
+    /**
+     * 获取文件类型
+     * @param path
+     * @return
+     */
+    public static String getPostfix (String path) {
+        if (StringUtils.isBlank(path) || !path.contains(".")) {
+            return null;
+        }
+        return path.substring(path.lastIndexOf(".") + 1, path.length()).trim();
+    }
+
+}

+ 93 - 0
src/main/java/com/lightinit/hsdatashow/common/FTPConfigurationUtilsPro.java

@@ -0,0 +1,93 @@
+package com.lightinit.hsdatashow.common;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by Mr.Yao on 2017/12/13.
+ */
+@Component
+public class FTPConfigurationUtilsPro {
+
+    @Value("${ftp.deploy.host}")
+    private String deploy_host;
+    @Value("${ftp.deploy.port}")
+    private int deploy_port;
+    @Value("${ftp.deploy.username}")
+    private String deploy_username;
+    @Value("${ftp.deploy.password}")
+    private String deploy_password;
+
+    public String getDeploy_host() {
+        return deploy_host;
+    }
+
+    public void setDeploy_host(String deploy_host) {
+        this.deploy_host = deploy_host;
+    }
+
+    public int getDeploy_port() {
+        return deploy_port;
+    }
+
+    public void setDeploy_port(int deploy_port) {
+        this.deploy_port = deploy_port;
+    }
+
+    public String getDeploy_username() {
+        return deploy_username;
+    }
+
+    public void setDeploy_username(String deploy_username) {
+        this.deploy_username = deploy_username;
+    }
+
+    public String getDeploy_password() {
+        return deploy_password;
+    }
+
+    public void setDeploy_password(String deploy_password) {
+        this.deploy_password = deploy_password;
+    }
+
+    @Value("${ftp.apk.host}")
+    private String apk_host;
+    @Value("${ftp.apk.port}")
+    private int apk_port;
+    @Value("${ftp.apk.username}")
+    private String apk_username;
+    @Value("${ftp.apk.password}")
+    private String apk_password;
+
+    public String getApk_host() {
+        return apk_host;
+    }
+
+    public void setApk_host(String apk_host) {
+        this.apk_host = apk_host;
+    }
+
+    public int getApk_port() {
+        return apk_port;
+    }
+
+    public void setApk_port(int apk_port) {
+        this.apk_port = apk_port;
+    }
+
+    public String getApk_username() {
+        return apk_username;
+    }
+
+    public void setApk_username(String apk_username) {
+        this.apk_username = apk_username;
+    }
+
+    public String getApk_password() {
+        return apk_password;
+    }
+
+    public void setApk_password(String apk_password) {
+        this.apk_password = apk_password;
+    }
+}

+ 364 - 0
src/main/java/com/lightinit/hsdatashow/common/FTPTookitUtils.java

@@ -0,0 +1,364 @@
+package com.lightinit.hsdatashow.common;
+import com.lightinit.hsdatashow.json.pojo.FTPConfigurationParameter;
+import org.apache.commons.net.PrintCommandListener;
+import org.apache.commons.net.ftp.*;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.SocketException;
+import java.net.URLEncoder;
+
+/**
+ * Created by Mr.Yao on 2017/5/8.
+ */
+@Component
+public class FTPTookitUtils {
+
+    private FTPClient ftpClient;
+
+    public FTPTookitUtils(){
+        ftpClient=new FTPClient();
+        this.ftpClient.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
+    }
+
+    private boolean login(String url, int port, String username, String password) throws SocketException, IOException
+    {
+        int reply;
+        ftpClient.connect(url, port);
+        ftpClient.setControlEncoding("UTF-8");
+        FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_NT);
+        conf.setServerLanguageCode("zh");
+        ftpClient.login(username, password);
+        reply = ftpClient.getReplyCode();
+        if (!FTPReply.isPositiveCompletion(reply))
+        {
+            ftpClient.disconnect();
+            return false;
+        }
+        return true;
+    }
+
+    private void free()
+    {
+        if (ftpClient.isAvailable())
+        {
+            try
+            {
+                ftpClient.logout();
+            } catch (IOException e)
+            {
+            }
+        }
+        if (ftpClient.isConnected())
+        {
+            try
+            {
+                ftpClient.disconnect();
+            } catch (IOException e)
+            {
+            }
+        }
+    }
+    public boolean uploadFile(InputStream input, String remoteAdr,FTPConfigurationParameter ftpconfig) throws IOException
+    {
+        boolean success = false;
+        try
+        {
+            success = login(ftpconfig.getHost(), ftpconfig.getPort(), ftpconfig.getUsername(),ftpconfig.getPassword());
+            if (!success)
+            {
+                return success;
+            }
+        } catch (IOException e)
+        {
+            return success;
+        }
+        ftpClient.enterLocalPassiveMode();
+        ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
+        String remoteFileName = remoteAdr;
+        if (remoteAdr.contains("/"))
+        {
+            remoteFileName = remoteAdr.substring(remoteAdr.lastIndexOf("/") + 1);
+            String directory = remoteAdr.substring(0, remoteAdr.lastIndexOf("/") + 1);
+            if (!directory.equalsIgnoreCase("/") && !ftpClient.changeWorkingDirectory(directory))
+            {
+                int start = 0, end = 0;
+                if (directory.startsWith("/"))
+                {
+                    start = 1;
+                } else
+                {
+                    start = 0;
+                }
+                end = directory.indexOf("/", start);
+                while (true)
+                {
+                    String subDirectory = remoteAdr.substring(start, end);
+                    if (!ftpClient.changeWorkingDirectory(subDirectory))
+                    {
+                        if (ftpClient.makeDirectory(subDirectory))
+                        {
+                            ftpClient.changeWorkingDirectory(subDirectory);
+                        } else
+                        {
+                            return false;
+                        }
+                    }
+                    start = end + 1;
+                    end = directory.indexOf("/", start);
+                    if (end <= start)
+                    {
+                        break;
+                    }
+                }
+            }
+        }
+        try
+        {
+            success = ftpClient.storeFile(remoteFileName, input);
+            input.close();
+        } catch (IOException e)
+        {
+            if (input != null)
+            {
+                input.close();
+            }
+        } finally
+        {
+            free();
+        }
+        return success;
+    }
+
+    public boolean uploadFile(String localAdr, String remoteAdr,FTPConfigurationParameter ftpconfig) throws IOException
+    {
+        boolean success = false;
+        try
+        {
+            success = login(ftpconfig.getHost(), ftpconfig.getPort(), ftpconfig.getUsername(),ftpconfig.getPassword());
+            if (!success)
+            {
+                return success;
+            }
+        } catch (IOException e)
+        {
+            return success;
+        }
+        ftpClient.enterLocalPassiveMode();
+        ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
+        String remoteFileName = remoteAdr;
+        if (remoteAdr.contains("/"))
+        {
+            remoteFileName = remoteAdr.substring(remoteAdr.lastIndexOf("/") + 1);
+            String directory = remoteAdr.substring(0, remoteAdr.lastIndexOf("/") + 1);
+            if (!directory.equalsIgnoreCase("/") && !ftpClient.changeWorkingDirectory(directory))
+            {
+                int start = 0, end = 0;
+                if (directory.startsWith("/"))
+                {
+                    start = 1;
+                } else
+                {
+                    start = 0;
+                }
+                end = directory.indexOf("/", start);
+                while (true)
+                {
+                    String subDirectory = remoteAdr.substring(start, end);
+                    if (!ftpClient.changeWorkingDirectory(subDirectory))
+                    {
+                        if (ftpClient.makeDirectory(subDirectory))
+                        {
+                            ftpClient.changeWorkingDirectory(subDirectory);
+                        } else
+                        {
+                            return false;
+                        }
+                    }
+                    start = end + 1;
+                    end = directory.indexOf("/", start);
+                    if (end <= start)
+                    {
+                        break;
+                    }
+                }
+            }
+        }
+        InputStream input = null;
+        try
+        {
+            File f = new File(localAdr);
+            //FTPFile[] fs = ftpClient.listFiles(remoteFileName);
+            input = new FileInputStream(f);
+            success = ftpClient.storeFile(remoteFileName, input);
+            input.close();
+        } catch (IOException e)
+        {
+            if (input != null)
+            {
+                input.close();
+            }
+        } finally
+        {
+            free();
+        }
+        return success;
+    }
+
+    public boolean deleteFile(String remoteAdr, String localAdr,FTPConfigurationParameter ftpconfig)
+    {
+        boolean success = false;
+        try
+        {
+            success = login(ftpconfig.getHost(), ftpconfig.getPort(), ftpconfig.getUsername(),ftpconfig.getPassword());
+            if (!success)
+            {
+                return success;
+            }
+            ftpClient.changeWorkingDirectory(remoteAdr);
+            FTPFile[] fs = ftpClient.listFiles();
+            if(fs.length>0)
+            {
+                success = ftpClient.removeDirectory(remoteAdr);
+                ftpClient.logout();
+            }
+        } catch (IOException e)
+        {
+        } finally
+        {
+            free();
+        }
+        return success;
+    }
+
+    public boolean deleteDir(String remoteAdr,FTPConfigurationParameter ftpconfig)
+    {
+        boolean success = false;
+        try
+        {
+            success = login(ftpconfig.getHost(), ftpconfig.getPort(), ftpconfig.getUsername(),ftpconfig.getPassword());
+            if (!success)
+            {
+                return success;
+            }
+            ftpClient.changeWorkingDirectory(remoteAdr);
+            FTPFile[] fs = ftpClient.listFiles();
+            if(fs.length>0)
+            {
+                success = ftpClient.removeDirectory(remoteAdr);
+                ftpClient.logout();
+            }
+        } catch (IOException e)
+        {
+        } finally
+        {
+            free();
+        }
+        return success;
+    }
+
+    public boolean downFile(String remoteremoteAdr, String localAdr, HttpServletResponse response,FTPConfigurationParameter ftpconfig)
+    {
+        boolean success = false;
+        try
+        {
+            success = login(ftpconfig.getHost(), ftpconfig.getPort(), ftpconfig.getUsername(),ftpconfig.getPassword());
+            if (!success)
+            {
+                return success;
+            }
+            ftpClient.changeWorkingDirectory(remoteremoteAdr);
+            FTPFile[] fs = ftpClient.listFiles();
+
+            for (FTPFile ftpFile : fs)
+            {
+                if (ftpFile.getName().equals(localAdr))
+                {
+                    response.setHeader("Content-disposition", "attachment;localAdr=" + URLEncoder.encode(localAdr, "UTF-8"));
+                    File f=new File(localAdr);
+                    OutputStream os=new FileOutputStream(f);
+                    ftpClient.retrieveFile(new String(ftpFile.getName().getBytes("UTF-8"), "ISO-8859-1"), os);
+                    os.flush();
+                    os.close();
+                }
+            }
+            ftpClient.logout();
+            success = true;
+        } catch (IOException e)
+        {
+            e.printStackTrace();
+        } finally
+        {
+            free();
+        }
+        return success;
+    }
+
+    public String readFileContent(String remoteremoteAdr, String localAdr,FTPConfigurationParameter ftpconfig)
+    {
+        String content = null;
+        try
+        {
+            boolean success = login(ftpconfig.getHost(), ftpconfig.getPort(), ftpconfig.getUsername(),ftpconfig.getPassword());
+            if (success)
+            {
+                ftpClient.changeWorkingDirectory(remoteremoteAdr);
+                FTPFile[] fs = ftpClient.listFiles();
+                for (FTPFile ftpFile : fs)
+                {
+                    if (ftpFile.getName().equals(localAdr))
+                    {
+                        File f=new File(localAdr);
+                        ftpClient.retrieveFile(new String(ftpFile.getName().getBytes("UTF-8"), "ISO-8859-1"), new FileOutputStream(f));
+                        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+                        ftpClient.retrieveFile(ftpFile.getName(), bos);
+                        bos.flush();
+                        bos.close();
+                        content = new String(bos.toByteArray(), "UTF-8");
+                    }
+                }
+            }
+        } catch (IOException e)
+        {
+        } finally
+        {
+            free();
+        }
+        return content;
+    }
+
+    public static boolean isDirExist(String localAdr, FTPFile[] fs)
+    {
+        for (FTPFile ftpFile : fs)
+        {
+            if (ftpFile.getName().equals(localAdr))
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static String changeName(String localAdr, FTPFile[] fs)
+    {
+        int n = 0;
+        StringBuffer localAdr_ = new StringBuffer("");
+        localAdr_ = localAdr_.append(localAdr);
+        while (isDirExist(localAdr_.toString(), fs))
+        {
+            n++;
+            String a = "[" + n + "]";
+            int b = localAdr_.lastIndexOf(".");
+            int c = localAdr_.lastIndexOf("[");
+            if (c < 0)
+            {
+                c = b;
+            }
+            StringBuffer name = new StringBuffer(localAdr_.substring(0, c));
+            StringBuffer suffix = new StringBuffer(localAdr_.substring(b + 1));
+            localAdr_ = name.append(a).append(".").append(suffix);
+        }
+        return localAdr_.toString();
+    }
+}

+ 13 - 0
src/main/java/com/lightinit/hsdatashow/common/GuidGenerator.java

@@ -0,0 +1,13 @@
+package com.lightinit.hsdatashow.common;
+
+import java.util.UUID;
+
+/**
+ * @author WangYao
+ */
+public abstract class GuidGenerator {
+
+    public static String generate() {
+        return UUID.randomUUID().toString()/*.replaceAll("-", "")*/;
+    }
+}

+ 214 - 0
src/main/java/com/lightinit/hsdatashow/common/HttpTookitUtils.java

@@ -0,0 +1,214 @@
+package com.lightinit.hsdatashow.common;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.NameValuePair;
+import org.apache.http.ParseException;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+//import org.apache.xmlbeans.impl.common.NameUtil;
+import org.springframework.util.StringUtils;
+
+/**
+ * Created by Mr.Yao on 2017/5/4.
+ */
+public class HttpTookitUtils {
+    public static int getApplicationStatus(String url) {
+        int statusCode=-1;
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+        try {
+            HttpGet httpget = new HttpGet(url);
+            CloseableHttpResponse response = httpclient.execute(httpget);
+            try {
+                StatusLine statusLine = response.getStatusLine();
+                statusCode= statusLine.getStatusCode();
+            } finally {
+                response.close();
+            }
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                httpclient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return statusCode;
+    }
+    public static String doGet(String url, List<NameValuePair> params, CharEncoding charset,String accept) {
+        String responseContent="";
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+        try {
+            String queryParams="";
+            if(params!= null) {
+                for (NameValuePair pair : params) {
+                    if (queryParams.length() > 0) {
+                        queryParams += "&";
+                    }
+                    queryParams += pair.getName() + "=" + pair.getValue();
+                }
+            }
+            if(StringUtils.isEmpty(queryParams)==false){
+                if(url.contains("?")){
+                    url+="&";
+                }else{
+                    url+="?";
+                }
+                url+=queryParams;
+            }
+            HttpGet httpget = new HttpGet(url);
+            if(StringUtils.isEmpty(accept)==false)
+                httpget.addHeader("Accept",accept);
+            CloseableHttpResponse response = httpclient.execute(httpget);
+            try {
+                HttpEntity entity = response.getEntity();
+                if (entity != null) {
+                    responseContent= EntityUtils.toString(entity, charset.value());
+                }
+            } finally {
+                response.close();
+            }
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                httpclient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return responseContent;
+    }
+    public static String doGet(String url, List<NameValuePair> params, CharEncoding charset) {
+        return doGet(url,params,charset,"");
+    }
+    public static String doPost(String url, List<NameValuePair> params, CharEncoding charset){
+        return doPost(url,params,charset,"");
+    }
+    public static String doPost(String url, List<NameValuePair> params, CharEncoding charset,String accept) {
+        String responseContent="";
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+        HttpPost httppost = new HttpPost(url);
+        if(StringUtils.isEmpty(accept)==false)
+            httppost.addHeader("Accept",accept);
+        UrlEncodedFormEntity uefEntity;
+        try {
+            uefEntity = new UrlEncodedFormEntity(params, charset.value());
+            httppost.setEntity(uefEntity);
+            CloseableHttpResponse response = httpclient.execute(httppost);
+            try {
+                HttpEntity entity = response.getEntity();
+                if (entity != null) {
+                    responseContent=EntityUtils.toString(entity, charset.value());
+                }
+            } finally {
+                response.close();
+            }
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (UnsupportedEncodingException e1) {
+            e1.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                httpclient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return responseContent;
+    }
+
+    public static String doPost(String url, List<NameValuePair> params, CharEncoding charset, Map<String,String> headers) {
+        String responseContent="";
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+        HttpPost httppost = new HttpPost(url);
+        if(headers!=null) {
+            for (Map.Entry<String, String> entry : headers.entrySet()) {
+                httppost.addHeader(entry.getKey(), entry.getValue());
+            }
+        }
+        UrlEncodedFormEntity uefEntity;
+        try {
+            uefEntity = new UrlEncodedFormEntity(params, charset.value());
+            httppost.setEntity(uefEntity);
+            CloseableHttpResponse response = httpclient.execute(httppost);
+            try {
+                HttpEntity entity = response.getEntity();
+                if (entity != null) {
+                    responseContent=EntityUtils.toString(entity, charset.value());
+                }
+            } finally {
+                response.close();
+            }
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (UnsupportedEncodingException e1) {
+            e1.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                httpclient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return responseContent;
+    }
+
+    public static String doPost(String url, String body, CharEncoding charset) {
+        String responseContent="";
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+        HttpPost httppost = new HttpPost(url);
+        try {
+            StringEntity uefEntity=new StringEntity(body, charset.value());
+            httppost.setEntity(uefEntity);
+            httppost.addHeader("Content-type","application/json");
+            CloseableHttpResponse response = httpclient.execute(httppost);
+            try {
+                HttpEntity entity = response.getEntity();
+                if (entity != null) {
+                    responseContent=EntityUtils.toString(entity, charset.value());
+                }
+            } finally {
+                response.close();
+            }
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (UnsupportedEncodingException e1) {
+            e1.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                httpclient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return responseContent;
+    }
+}

+ 148 - 0
src/main/java/com/lightinit/hsdatashow/common/IPUtils.java

@@ -0,0 +1,148 @@
+package com.lightinit.hsdatashow.common;
+
+import com.lightinit.hsdatashow.json.pojo.PingResultEntity;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Created by Mr.Yao on 2017/5/22.
+ */
+public class IPUtils {
+    static List<String> regList=new ArrayList<String>();
+    static {
+        regList.add(":1");
+        regList.add("^10\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$");
+        regList.add("^172\\.((1[6-9]{1})|(2[0-9]{1})|(3[0-1]{1}))\\.[0-9]{1,3}\\.[0-9]{1,3}$");
+        regList.add("^192\\.168\\.[0-9]{1,3}\\.[0-9]{1,3}$");
+    }
+    public static String getIpAddress(HttpServletRequest request){
+        String ip=request.getHeader("HTTP_X_FORWARDED_FOR");
+        if (StringUtils.isEmpty(ip)==false) {
+            String []ipArray=ip.split(",");
+            for (String _ip:ipArray) {
+                if(IsPrivateIpAddress(_ip))
+                    continue;
+                ip=_ip;
+                break;
+            }
+        }
+        if (StringUtils.isEmpty(ip)){
+            ip = request.getRemoteAddr();
+        }
+        return ip;
+    }
+
+    public static boolean IsPrivateIpAddress(String ip){
+        boolean isPrivateIp=false;
+        for (String regIp:regList) {
+            Pattern pattern=Pattern.compile(regIp);
+            Matcher matcher=pattern.matcher(ip);
+           if(matcher.matches())
+           {
+               isPrivateIp=true;
+               break;
+           }
+        }
+        return isPrivateIp;
+    }
+
+    public static PingResultEntity Ping(String domain,int pingTimes,String ping){
+        PingResultEntity entity=new PingResultEntity();
+        BufferedReader in = null;
+        Runtime r = Runtime.getRuntime();
+        // 将要执行的ping命令,此命令是windows格式的命令
+        //String pingCommand = "ping " + domain + " -n " + pingTimes;
+        String pingCommand=String.format(ping,domain,pingTimes);
+        try {
+            // 执行命令并获取输出
+            System.out.println(pingCommand);
+            Process p = r.exec(pingCommand);
+            if (p == null) {
+                entity.setReachable(false);
+            }
+            in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+            // 逐行检查输出,计算类似出现=23ms TTL=62字样的次数
+            int connectedCount = 0;
+            String line = null;
+            while ((line = in.readLine()) != null) {
+                if(StringUtils.isEmpty(entity.getIpAddress())) {
+                    String ipLine = getIpAddress(line);
+                    if (StringUtils.isEmpty(ipLine) == false)
+                        entity.setIpAddress(ipLine);
+                }
+                connectedCount += getCheckWindowsResult(line)+getCheckLinuxResult(line);
+            }
+            // 如果出现类似=23ms TTL=62这样的字样,出现的次数=测试次数则返回真
+            entity.setReachable(connectedCount>0);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            // 出现异常则返回假
+            entity.setReachable(false);
+        } finally {
+            try {
+                in.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return entity;
+    }
+
+    //若line含有=18ms TTL=16字样,说明已经ping通,返回1,否則返回0.
+    private static int getCheckWindowsResult(String line) {
+        // System.out.println("控制台输出的结果为:"+line);
+        Pattern pattern = Pattern.compile("(\\d+ms)(\\s+)(TTL=\\d+)",Pattern.CASE_INSENSITIVE);
+        Matcher matcher = pattern.matcher(line);
+        while (matcher.find()) {
+            return 1;
+        }
+        return 0;
+    }
+    //若line含有=18ms TTL=16字样,说明已经ping通,返回1,否則返回0.
+    private static int getCheckLinuxResult(String line) {
+        // 64 bytes from 150.138.158.3: icmp_seq=1 ttl=43 time=61.8 ms
+        Pattern pattern = Pattern.compile("(icmp_seq=\\d+\\s+ttl=\\d+\\s+time=[0-9]{1,}([.][0-9]*)*\\s*ms)",Pattern.CASE_INSENSITIVE);
+        Matcher matcher = pattern.matcher(line);
+        while (matcher.find()) {
+            return 1;
+        }
+        return 0;
+    }
+    public static String getIpAddress(String line) {
+        // System.out.println("控制台输出的结果为:"+line);
+        Pattern pattern = Pattern.compile("(([1-9]{1})([0-9]{0,2})\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})",Pattern.CASE_INSENSITIVE);
+        Matcher matcher = pattern.matcher(line);
+        while (matcher.find()) {
+            return matcher.group();
+        }
+        return "";
+    }
+    public static String getDomain(String line) {
+        // System.out.println("控制台输出的结果为:"+line);
+        Pattern pattern = Pattern.compile("(([a-zA-Z0-9][a-zA-Z0-9-_]+\\.)+[a-zA-Z0-9-_][^ ]*)",Pattern.CASE_INSENSITIVE);
+        Matcher matcher = pattern.matcher(line);
+        while (matcher.find()) {
+            return matcher.group();
+        }
+        return "";
+    }
+
+    public static boolean checkIpAddress(String targetIp,String rightIp) {
+        if(StringUtils.isEmpty(targetIp) || StringUtils.isEmpty(rightIp))
+            return false;
+        String []rightIps=rightIp.split(";");
+        for (String ip:rightIps) {
+            if(targetIp.trim().equalsIgnoreCase(ip.trim()))
+                return true;
+        }
+        return false;
+    }
+}

+ 53 - 0
src/main/java/com/lightinit/hsdatashow/common/MD5Utils.java

@@ -0,0 +1,53 @@
+package com.lightinit.hsdatashow.common;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.UUID;
+
+/**
+ * Created by Mr.Yao on 2017/4/7.
+ */
+public class MD5Utils {public static String MD5(String sourceStr) {
+    String result = "";
+    try {
+        MessageDigest md = MessageDigest.getInstance("MD5");
+        md.update(sourceStr.getBytes());
+        byte b[] = md.digest();
+        int i;
+        StringBuffer buf = new StringBuffer("");
+        for (int offset = 0; offset < b.length; offset++) {
+            i = b[offset];
+            if (i < 0)
+                i += 256;
+            if (i < 16)
+                buf.append("0");
+            buf.append(Integer.toHexString(i));
+        }
+        result = buf.toString();
+    } catch (NoSuchAlgorithmException e) {
+    }
+    return result;
+}
+
+    private static String[] chars = new String[] { "a", "b", "c", "d", "e", "f",
+            "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
+            "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5",
+            "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I",
+            "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
+            "W", "X", "Y", "Z" };
+
+    public static String generateShortUuid() {
+        StringBuffer shortBuffer = new StringBuffer();
+        String uuid = UUID.randomUUID().toString().replace("-", "");
+        for (int i = 0; i < 8; i++) {
+            String str = uuid.substring(i * 4, i * 4 + 4);
+            int x = Integer.parseInt(str, 16);
+            shortBuffer.append(chars[x % 0x3E]);
+        }
+        return shortBuffer.toString();
+    }
+
+    public static String generateGuid(){
+        return UUID.randomUUID().toString();
+    }
+}

Plik diff jest za duży
+ 162 - 0
src/main/java/com/lightinit/hsdatashow/common/MenuUtils.java


+ 43 - 0
src/main/java/com/lightinit/hsdatashow/common/ObjectConvertorUtils.java

@@ -0,0 +1,43 @@
+package com.lightinit.hsdatashow.common;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by Mr.Yao on 2017/5/9.
+ */
+public class ObjectConvertorUtils<T> {
+
+    public T DictToObject(Map<String, String> map,Class<T> classType)
+    {
+        T entity= null;
+        try {
+            entity = classType.newInstance();
+            Field[] fields = classType.getDeclaredFields();
+            if(fields!=null) {
+                for (Field field : fields) {
+                    if (map.containsKey(field.getName()))
+                        field.setAccessible(true);
+                        field.set(entity, map.get(field.getName()));
+                }
+            }
+        } catch (InstantiationException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        }
+        return entity;
+    }
+
+    public List<T> ListToObject(List<Map<String, String>> list, Class<T> classType) {
+        List<T> resultList = new ArrayList<T>();
+        for (Map<String, String> map : list) {
+            T item = DictToObject(map, classType);
+            if (item != null)
+                resultList.add(item);
+        }
+        return resultList;
+    }
+}

+ 17 - 0
src/main/java/com/lightinit/hsdatashow/common/ObjectMappingUtils.java

@@ -0,0 +1,17 @@
+package com.lightinit.hsdatashow.common;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.IOException;
+
+/**
+ * Created by WangYao on 2018/5/23.
+ */
+public class ObjectMappingUtils {
+
+    public static <S, T> T map(S source, Class<T> classType) throws IOException {
+        ObjectMapper objectMapper = new ObjectMapper();
+        String jsonString = objectMapper.writeValueAsString(source);
+        return objectMapper.readValue(jsonString, classType);
+    }
+}

+ 181 - 0
src/main/java/com/lightinit/hsdatashow/common/OneTimePasswordAlgorithm.java

@@ -0,0 +1,181 @@
+/*
+ * OneTimePasswordAlgorithm.java
+ * OATH Initiative,
+ * HOTP one-time password algorithm
+ *
+ */
+/* Copyright (C) 2004, OATH. All rights reserved.
+ *
+ * License to copy and use this software is granted provided that it
+ * is identified as the "OATH HOTP Algorithm" in all material
+ * mentioning or referencing this software or this function.
+ *
+ * License is also granted to make and use derivative works provided
+ * that such works are identified as
+ * "derived from OATH HOTP algorithm"
+ * in all material mentioning or referencing the derived work.
+ *
+ * OATH (Open AuTHentication) and its members make no
+ * representations concerning either the merchantability of this
+ * software or the suitability of this software for any particular
+ * purpose.
+ *
+ * It is provided "as is" without express or implied warranty
+ * of any kind and OATH AND ITS MEMBERS EXPRESSaLY DISCLAIMS
+ * ANY WARRANTY OR LIABILITY OF ANY KIND relating to this software.
+ *
+ * These notices must be retained in any copies of any part of this
+ * documentation and/or software.
+ */
+package com.lightinit.hsdatashow.common;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * This class contains static methods that are used to calculate the One-Time
+ * Password (OTP) using JCE to provide the HMAC-SHA-1.
+ * 
+ * @author Loren Hart
+ * @version 1.0
+ */
+public class OneTimePasswordAlgorithm {
+	private OneTimePasswordAlgorithm() {
+	}
+
+	// These are used to calculate the check-sum digits.
+	// 0 1 2 3 4 5 6 7 8 9
+	private static final int[] doubleDigits = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 };
+
+	/**
+	 * Calculates the checksum using the credit card algorithm. This algorithm
+	 * has the advantage that it detects any single mistyped digit and any
+	 * single transposition of adjacent digits.
+	 * 
+	 * @param num
+	 *            the number to calculate the checksum for
+	 * @param digits
+	 *            number of significant places in the number
+	 * 
+	 * @return the checksum of num
+	 */
+	public static int calcChecksum(long num, int digits) {
+		boolean doubleDigit = true;
+		int total = 0;
+		while (0 < digits--) {
+			int digit = (int) (num % 10);
+			num /= 10;
+			if (doubleDigit) {
+				digit = doubleDigits[digit];
+			}
+			total += digit;
+			doubleDigit = !doubleDigit;
+		}
+		int result = total % 10;
+		if (result > 0) {
+			result = 10 - result;
+		}
+		return result;
+	}
+
+	/**
+	 * This method uses the JCE to provide the HMAC-SHA-1 algorithm. HMAC
+	 * computes a Hashed Message Authentication Code and in this case SHA1 is
+	 * the hash algorithm used.
+	 * 
+	 * @param keyBytes
+	 *            the bytes to use for the HMAC-SHA-1 key
+	 * @param text
+	 *            the message or text to be authenticated.
+	 * 
+	 * @throws NoSuchAlgorithmException
+	 *             if no provider makes either HmacSHA1 or HMAC-SHA-1 digest
+	 *             algorithms available.
+	 * @throws InvalidKeyException
+	 *             The secret provided was not a valid HMAC-SHA-1 key.
+	 * 
+	 */
+	public static byte[] hmac_sha1(byte[] keyBytes, byte[] text)
+			throws NoSuchAlgorithmException, InvalidKeyException {
+		// try {
+		Mac hmacSha1;
+		try {
+			hmacSha1 = Mac.getInstance("HmacSHA1");
+		} catch (NoSuchAlgorithmException nsae) {
+			hmacSha1 = Mac.getInstance("HMAC-SHA-1");
+		}
+		SecretKeySpec macKey = new SecretKeySpec(keyBytes, "RAW");
+		hmacSha1.init(macKey);
+		return hmacSha1.doFinal(text);
+		// } catch (GeneralSecurityException gse) {
+		// throw new UndeclaredThrowableException(gse);
+		// }
+	}
+
+	private static final int[] DIGITS_POWER
+	// 0 1 2 3 4 5 6 7 8
+	= { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 };
+
+	/**
+	 * This method generates an OTP value for the given set of parameters.
+	 * 
+	 * @param secret
+	 *            the shared secret
+	 * @param movingFactor
+	 *            the counter, time, or other value that changes on a per use
+	 *            basis.
+	 * @param codeDigits
+	 *            the number of digits in the OTP, not including the checksum,
+	 *            if any.
+	 * @param addChecksum
+	 *            a flag that indicates if a checksum digit should be appended
+	 *            to the OTP.
+	 * @param truncationOffset
+	 *            the offset into the MAC result to begin truncation. If this
+	 *            value is out of the range of 0 ... 15, then dynamic truncation
+	 *            will be used. Dynamic truncation is when the last 4 bits of
+	 *            the last byte of the MAC are used to determine the start
+	 *            offset.
+	 * @throws NoSuchAlgorithmException
+	 *             if no provider makes either HmacSHA1 or HMAC-SHA-1 digest
+	 *             algorithms available.
+	 * @throws InvalidKeyException
+	 *             The secret provided was not a valid HMAC-SHA-1 key.
+	 * 
+	 * @return A numeric String in base 10 that includes {@link codeDigits}
+	 *         digits plus the optional checksum digit if requested.
+	 */
+	static public String generateOTP(byte[] secret, long movingFactor,
+			int codeDigits, boolean addChecksum, int truncationOffset)
+			throws NoSuchAlgorithmException, InvalidKeyException {
+		// put movingFactor value into text byte array
+		String result = null;
+		int digits = addChecksum ? (codeDigits + 1) : codeDigits;
+		byte[] text = new byte[8];
+		for (int i = text.length - 1; i >= 0; i--) {
+			text[i] = (byte) (movingFactor & 0xff);
+			movingFactor >>= 8;
+		}
+		// compute hmac hash
+		byte[] hash = hmac_sha1(secret, text);
+		// put selected bytes into result int
+		int offset = hash[hash.length - 1] & 0xf;
+		if ((0 <= truncationOffset) && (truncationOffset < (hash.length - 4))) {
+			offset = truncationOffset;
+		}
+		int binary = ((hash[offset] & 0x7f) << 24)
+				| ((hash[offset + 1] & 0xff) << 16)
+				| ((hash[offset + 2] & 0xff) << 8) | (hash[offset + 3] & 0xff);
+		int otp = binary % DIGITS_POWER[codeDigits];
+		if (addChecksum) {
+			otp = (otp * 10) + calcChecksum(otp, codeDigits);
+		}
+		result = Integer.toString(otp);
+		while (result.length() < digits) {
+			result = "0" + result;
+		}
+		return result;
+	}
+}

+ 19 - 0
src/main/java/com/lightinit/hsdatashow/common/OrderNumberUtils.java

@@ -0,0 +1,19 @@
+package com.lightinit.hsdatashow.common;
+
+import java.util.Random;
+
+public class OrderNumberUtils {
+
+    /**
+     * 生成唯一订单编号
+     * 格式:时间+随机数
+     * @return
+     */
+    public static synchronized String generate(){
+        Random random = new Random() ;
+        System.currentTimeMillis() ;
+        Integer number = random.nextInt(900000)+100000 ;
+        return System.currentTimeMillis() + String.valueOf(number) ;
+    }
+
+}

+ 36 - 0
src/main/java/com/lightinit/hsdatashow/common/PermissionUtilsPro.java

@@ -0,0 +1,36 @@
+package com.lightinit.hsdatashow.common;
+
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.subject.Subject;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by Mr.Yao on 2017/7/6.
+ */
+@Component
+public class PermissionUtilsPro {
+    /***
+     * 是否有超级权限
+     * @return
+     */
+    public boolean IsSuperPermission(){
+        Subject user = SecurityUtils.getSubject();
+        if (null == user)
+            return false;
+        Object objectUserName = user.getPrincipal();
+        if(objectUserName==null)
+            return false;
+        String currentUsername = (String) user.getPrincipal();
+        return "admin".contains(currentUsername.toLowerCase());
+    }
+
+    public String CurrentName(){
+        Subject user = SecurityUtils.getSubject();
+        if (null == user)
+            return "";
+        Object objectUserName = user.getPrincipal();
+        if(objectUserName==null)
+            return "";
+        return (String) user.getPrincipal();
+    }
+}

+ 43 - 0
src/main/java/com/lightinit/hsdatashow/common/RoleComboUtils.java

@@ -0,0 +1,43 @@
+package com.lightinit.hsdatashow.common;
+
+import com.lightinit.hsdatashow.json.pojo.RoleAttributesEntity;
+import com.lightinit.hsdatashow.json.pojo.RoleComboEntity;
+import com.lightinit.hsdatashow.entity.SentryRole;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Mr.Yao on 2017/4/24.
+ */
+public class RoleComboUtils {
+
+    public static RoleComboEntity  RoleComboxConverter(SentryRole role) {
+        RoleComboEntity entity=new RoleComboEntity();
+        if (role!=null)
+        {
+            List<RoleComboEntity> tmpList=new ArrayList<RoleComboEntity>();
+            List<SentryRole> list=role.getChildren();
+            if(list!=null && list.size()>0){
+                for (SentryRole _item:list) {
+                    RoleComboEntity _entity=RoleComboxConverter(_item);
+                    if (_entity!=null)
+                        tmpList.add(_entity);
+                }
+                entity.setIconCls("fi-page-copy");
+                entity.setChildren(tmpList);
+            }else {
+                entity.setIconCls("fi-page");
+                entity.setChildren(null);
+            }
+            entity.setId(role.getId());
+            entity.setText(role.getRolename());
+            RoleAttributesEntity roleAttributesEntity=new RoleAttributesEntity();
+            if (role.getParentid()!=null) {
+                roleAttributesEntity.setParentid(role.getParentid());
+            }
+        }
+        return entity;
+    }
+
+}

+ 127 - 0
src/main/java/com/lightinit/hsdatashow/common/RoleModulesUtilsPro.java

@@ -0,0 +1,127 @@
+package com.lightinit.hsdatashow.common;
+
+import com.lightinit.hsdatashow.entity.AdminRole;
+import com.lightinit.hsdatashow.entity.RoleModule;
+import com.lightinit.hsdatashow.entity.SentryRole;
+import com.lightinit.hsdatashow.entity.UserModule;
+import com.lightinit.hsdatashow.service.IRoleService;
+import com.lightinit.hsdatashow.service.IUserModuleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Mr.Yao on 2017/4/25.
+ */
+@Component
+public class RoleModulesUtilsPro {
+    @Autowired
+    private IRoleService roleService;
+    @Autowired
+    private IUserModuleService userModuleService;
+
+    public List<RoleModule> UserHasModules(long uid){
+        List<RoleModule> result=new ArrayList<RoleModule>();
+        if(uid>0) {
+            List<UserModule> userModuleList=userModuleService.QueryUserModuleList(uid);
+            if (userModuleList!=null && userModuleList.size()>0){
+                for (UserModule mUserModule:userModuleList) {
+                    RoleModule roleModule = new RoleModule();
+                    roleModule.setModuleid(mUserModule.getModuleid());
+                    result.add(roleModule);
+                }
+            }
+            if (result.size()>0)
+                return result;
+            List<AdminRole> list= roleService.QueryRoleList(uid);
+            List<Long> roleIds=new ArrayList<Long>();
+            for (AdminRole role:list) {
+                roleIds.add(role.getId());
+            }
+            List<SentryRole> sentryRoles= roleService.QueryManyRole(roleIds);
+            for (SentryRole sentryRole:sentryRoles) {
+                List<RoleModule> _result = roleService.QueryModuleList(sentryRole.getId());
+                if((_result==null || _result.size()==0)&& sentryRole!=null && sentryRole.getParentid()!=null && sentryRole.getParentid()>0){
+                    _result=new ArrayList<RoleModule>();
+                    List<RoleModule> tmpList =RoleModules(sentryRole.getParentid());
+                    if(tmpList!=null){
+                        for (RoleModule item:tmpList) {
+                            if(_result.contains(item)==false){
+                                _result.add(item);
+                            }
+                        }
+                    }
+                }
+                for (RoleModule item:_result) {
+                    if(result.contains(item)==false){
+                        result.add(item);
+                    }
+                }
+            }
+            return result;
+        }else
+            return null;
+    }
+    public List<RoleModule> RoleModules(long role){
+        List<RoleModule> result=new ArrayList<RoleModule>();
+        if(role>0) {
+            SentryRole sentryRole= roleService.QueryOne(role);
+            result = roleService.QueryModuleList(role);
+            if((result==null || result.size()==0)&& sentryRole!=null && sentryRole.getParentid()!=null && sentryRole.getParentid()>0){
+                List<RoleModule> tmpList =RoleModules(sentryRole.getParentid());
+                if(tmpList!=null){
+                    for (RoleModule item:tmpList) {
+                        if(result.contains(item)==false){
+                            result.add(item);
+                        }
+                    }
+                }
+            }
+            return result;
+        }else
+        return null;
+    }
+    public List<Long> RoleHasModules(long role){
+        List<Long> roleHasModules=new ArrayList<Long>();
+        List<RoleModule> result=new ArrayList<RoleModule>();
+        if(role>0) {
+            SentryRole sentryRole= roleService.QueryOne(role);
+            result = roleService.QueryModuleList(role);
+            if((result==null || result.size()==0)&& sentryRole!=null && sentryRole.getParentid()!=null && sentryRole.getParentid()>0){
+                List<RoleModule> tmpList =RoleModules(sentryRole.getParentid());
+                if(tmpList!=null){
+                    for (RoleModule item:tmpList) {
+                        if(result.contains(item)==false){
+                            result.add(item);
+                        }
+                    }
+                }
+            }
+        }
+        for (RoleModule _item:result) {
+            if(roleHasModules.contains(_item.getModuleid())==false){
+                roleHasModules.add(_item.getModuleid());
+            }
+        }
+        return roleHasModules;
+    }
+    public List<Long> RoleIds(SentryRole role){
+        List<Long> result=new ArrayList<Long>();
+        result.add(role.getId());
+        if(role.getChildren()!=null && role.getChildren().size()>0){
+            for (SentryRole item:role.getChildren()) {
+                List<Long> tmpResult=RoleIds(item);
+                if(tmpResult.size()>0){
+                    for (Long _item:tmpResult) {
+                        if(result.contains(_item)==false){
+                            result.add(_item);
+                        }
+                    }
+                }
+            }
+        }
+        return result;
+    }
+}

+ 71 - 0
src/main/java/com/lightinit/hsdatashow/common/SecureCardUtilsPro.java

@@ -0,0 +1,71 @@
+package com.lightinit.hsdatashow.common;
+
+import com.lightinit.hsdatashow.entity.Securekey;
+import com.lightinit.hsdatashow.service.ISecureKeyService;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.subject.Subject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.http.HttpSession;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Created by Lantinit on 2018/2/1.
+ */
+@Component
+public class SecureCardUtilsPro {
+    @Autowired
+    private ISecureKeyService secureKeyService;
+
+    public boolean verification(HttpSession session,String token,String cardno,long synctime){
+        String capText=session.getAttribute("SECUREKEY_SESSION_KEY")!=null?session.getAttribute("SECUREKEY_SESSION_KEY").toString():"";
+        if(StringUtils.isEmpty(capText)){
+            return false;
+        }
+        String realToken="";
+        String[]TokenArray=capText.split(":::");
+        for (String item:TokenArray) {
+            String secretStr=item.substring(1)+":::"+cardno+":::"+synctime+":::"+item.substring(0,1);
+            try {
+                realToken+=OneTimePasswordAlgorithm.generateOTP(secretStr.getBytes(), 0, 2, false, -1);
+            } catch (NoSuchAlgorithmException e) {
+                e.printStackTrace();
+            } catch (InvalidKeyException e) {
+                e.printStackTrace();
+            }
+        }
+        if(realToken.equalsIgnoreCase(token)==false){
+            return false;
+        }
+        session.removeAttribute("SECUREKEY_SESSION_KEY");
+        return true;
+    }
+
+    public boolean verification(HttpSession session,String token,String username){
+        Securekey securekey= secureKeyService.QueryOne(username);
+        if(securekey==null){
+            return false;
+        }
+        SimpleDateFormat syncDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            Date syncDate= syncDateFormat.parse(syncDateFormat.format(securekey.getSyncdatetime()));
+            return verification(session,token,securekey.getSecurekey(),syncDate.getTime());
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+    public boolean verification(HttpSession session,String token){
+        Subject currentUser = SecurityUtils.getSubject();
+        if(currentUser==null){
+            return false;
+        }
+        return verification(session,token,currentUser.getPrincipal().toString());
+    }
+}

+ 32 - 0
src/main/java/com/lightinit/hsdatashow/common/ShiroFilterUtils.java

@@ -0,0 +1,32 @@
+package com.lightinit.hsdatashow.common;
+
+import java.io.PrintWriter;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+import org.codehaus.jackson.map.ObjectMapper;
+/**
+ * Created by Mr.Yao on 2017/11/8.
+ */
+public class ShiroFilterUtils {
+    private static ObjectMapper objectMapper = new  ObjectMapper();
+    public static boolean isAjax(ServletRequest request){
+        return "XMLHttpRequest".equalsIgnoreCase(((HttpServletRequest) request).getHeader("X-Requested-With"));
+    }
+    public static void out(ServletResponse response, Map<String, String> resultMap){
+        PrintWriter out = null;
+        try {
+//            response.setCharacterEncoding("UTF-8");
+            out = response.getWriter();
+            out.println(objectMapper.writeValueAsString(resultMap));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }finally{
+            if(null != out){
+                out.flush();
+                out.close();
+            }
+        }
+    }
+}

+ 179 - 0
src/main/java/com/lightinit/hsdatashow/common/SingleChartMapperUtils.java

@@ -0,0 +1,179 @@
+package com.lightinit.hsdatashow.common;
+
+import com.lightinit.hsdatashow.entity.BaseExample;
+import com.lightinit.hsdatashow.model.ResultState;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/9/3 10:52
+ * @Description: 通过反射对单表的删,改,查进行操作的工具类
+ **/
+public class SingleChartMapperUtils {
+
+    public static List list(List clazz,String tableType,BaseExample.Page pager) {
+        ArrayList<Class> mappers = new ArrayList();
+        for (Object o : clazz) {
+            mappers.add(o.getClass().getInterfaces()[0]);
+        }
+        for(int i=0;i< mappers.size();i++){
+            Class name = mappers.get(i);
+            if(name.getSimpleName().equalsIgnoreCase(tableType+"Mapper")){
+                try{
+                    Class<?> aClass = Class.forName("com.lightinit.hsdatashow.entity."+tableType+ "Example");
+                    Object obj=aClass.newInstance();
+                    Method orderByClause = obj.getClass().getDeclaredMethod("setOrderByClause",String.class);
+                    orderByClause.invoke(obj,"data_year desc limit "+pager.getBeginIndex()+","+pager.getPageSize());
+
+                    Object  o= clazz.get(i);
+                    Method selectByExample = o.getClass().getDeclaredMethod("selectByExample", aClass);
+                    return  (List)selectByExample.invoke(o,obj);
+                }catch (Exception e){
+                    e.printStackTrace();
+                    throw new RuntimeException("查询失败");
+                }
+            }
+        }
+        return null;
+    }
+public static List list(List clazz,String tableType,BaseExample.Page pager,String orederClause) {
+        ArrayList<Class> mappers = new ArrayList();
+        for (Object o : clazz) {
+            mappers.add(o.getClass().getInterfaces()[0]);
+        }
+        for(int i=0;i< mappers.size();i++){
+            Class name = mappers.get(i);
+            if(name.getSimpleName().equalsIgnoreCase(tableType+"Mapper")){
+                try{
+                    Class<?> aClass = Class.forName("com.lightinit.hsdatashow.entity."+tableType+ "Example");
+                    Object obj=aClass.newInstance();
+                    Method orderByClause = obj.getClass().getDeclaredMethod("setOrderByClause",String.class);
+                    orderByClause.invoke(obj,orederClause+" desc limit "+pager.getBeginIndex()+","+pager.getPageSize());
+
+                    Object  o= clazz.get(i);
+                    Method selectByExample = o.getClass().getDeclaredMethod("selectByExample", aClass);
+                    return  (List)selectByExample.invoke(o,obj);
+                }catch (Exception e){
+                    e.printStackTrace();
+                    throw new RuntimeException("查询失败");
+                }
+            }
+        }
+        return null;
+    }
+
+
+    public static <V> ResultState add(V v, boolean isEdit,List clazz) {
+        ArrayList<Class> mappers = new ArrayList();
+        for (Object o : clazz) {
+            mappers.add(o.getClass().getInterfaces()[0]);
+        }
+        ResultState resultState = new ResultState();
+        int i=0;
+        try{
+            List<Class> names = mappers;
+            for(int j=0;j< names.size();j++){
+                if(names.get(j).getSimpleName().equalsIgnoreCase(v.getClass().getSimpleName()+"Mapper")){
+                    Object  o= clazz.get(j);
+                    if(isEdit){
+                        Method selectByExample = o.getClass().getDeclaredMethod("updateByPrimaryKeySelective", v.getClass());
+                        i=(Integer) selectByExample.invoke(o,v);
+                    }else{
+                        Method selectByExample = o.getClass().getDeclaredMethod("insert", v.getClass());
+                        i=(Integer) selectByExample.invoke(o,v);
+                    }
+                    break;
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        if(i<1){
+            resultState.setStateCode(400);
+            resultState.setMsg("操作失败");
+            return resultState;
+        }
+        resultState.setMsg("操作成功");
+        return resultState;
+    }
+
+
+    public static Object findById(List clazz,String tableType, Long id) {
+        ArrayList<Class> mappers = new ArrayList();
+        for (Object o : clazz) {
+            mappers.add(o.getClass().getInterfaces()[0]);
+        }
+        for(int i=0;i< mappers.size();i++){
+            Class name = mappers.get(i);
+            if(name.getSimpleName().equalsIgnoreCase(tableType+"Mapper")){
+                try {
+                    Object  o= clazz.get(i);
+                    Method  selectByPrimaryKey=o.getClass().getDeclaredMethod("selectByPrimaryKey",Long.class);
+                    return selectByPrimaryKey.invoke(o,id);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    throw new RuntimeException("查询失败");
+                }
+            }
+        }
+        return null;
+    }
+
+
+    public static long queryCount(List clazz,String tableType) {
+        ArrayList<Class> mappers = new ArrayList();
+        for (Object o : clazz) {
+            mappers.add(o.getClass().getInterfaces()[0]);
+        }
+        for(int i=0;i< mappers.size();i++){
+            Class name = mappers.get(i);
+            if(name.getSimpleName().equalsIgnoreCase(tableType+"Mapper")){
+                try{
+                    Class<?> aClass = Class.forName("com.lightinit.hsdatashow.entity."+tableType+ "Example");
+                    Object obj=aClass.newInstance();
+
+                    Object  o= clazz.get(i);
+                    Method selectByExample = o.getClass().getDeclaredMethod("countByExample", aClass);
+                    return  (long)selectByExample.invoke(o,obj);
+                }catch (Exception e){
+                    e.printStackTrace();
+                    throw new RuntimeException("查询失败");
+                }
+            }
+        }
+        return  0;
+    }
+
+
+    public static ResultState delete(List clazz,String tableType, Long id) {
+        ArrayList<Class> mappers = new ArrayList();
+        for (Object o : clazz) {
+            mappers.add(o.getClass().getInterfaces()[0]);
+        }
+        ResultState resultState = new ResultState();
+        int j=0;
+        for(int i=0;i< mappers.size();i++){
+            Class name = mappers.get(i);
+            if(name.getSimpleName().equalsIgnoreCase(tableType+"Mapper")){
+                try {
+                    Object  o= clazz.get(i);
+                    Method  deleteByPrimaryKey=o.getClass().getDeclaredMethod("deleteByPrimaryKey",Long.class);
+                    j=(Integer) deleteByPrimaryKey.invoke(o,id);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                break;
+            }
+        }
+        if(j<1){
+            resultState.setStateCode(400);
+            resultState.setMsg("删除失败");
+            return resultState;
+        }
+        resultState.setMsg("删除成功");
+        return resultState;
+    }
+}

+ 43 - 0
src/main/java/com/lightinit/hsdatashow/common/SolrUtils.java

@@ -0,0 +1,43 @@
+package com.lightinit.hsdatashow.common;
+
+import com.lightinit.hsdatashow.json.pojo.solr.CoreOverViewResponseEntity;
+import org.apache.http.NameValuePair;
+import org.apache.http.message.BasicNameValuePair;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.springframework.util.StringUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Mr.Yao on 2017/12/7.
+ */
+public class SolrUtils {
+    public static CoreOverViewResponseEntity parse(String service, String core){
+        CoreOverViewResponseEntity result=null;
+        if(StringUtils.isEmpty(service) || StringUtils.isEmpty(core))
+            return result;
+        List<NameValuePair> nameValuePairs=new ArrayList<NameValuePair>();
+        nameValuePairs.add(new BasicNameValuePair("wt","json"));
+        nameValuePairs.add(new BasicNameValuePair("show","index"));
+        nameValuePairs.add(new BasicNameValuePair("numTerms","0"));
+        nameValuePairs.add(new BasicNameValuePair("_",String.valueOf(System.currentTimeMillis())));
+        String responseBody= HttpTookitUtils.doGet(service+"/"+core+"/admin/luke",nameValuePairs, CharEncoding.UTF8,"application/json");
+        if(StringUtils.isEmpty(responseBody)==false) {
+            ObjectMapper objectMapper = new ObjectMapper();
+            try {
+                result = objectMapper.readValue(responseBody, CoreOverViewResponseEntity.class);
+            } catch (JsonParseException e) {
+                e.printStackTrace();
+            } catch (JsonMappingException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+}

+ 32 - 0
src/main/java/com/lightinit/hsdatashow/common/SysContants.java

@@ -0,0 +1,32 @@
+package com.lightinit.hsdatashow.common;
+
+import java.io.File;
+
+/**
+ * @author WangYao
+ * @date 2018/6/12 14:20
+ * @description
+ */
+public class SysContants {
+
+    //Property文件路径
+    public static class PropertyFilePath{
+        public final static String CONFIG = "config.properties";
+    }
+
+    //属性键
+    public static class PropertyKey{
+        public final static String UPLOAD_ROOT_DIR = "uploadRootDir"; //文件存放目录key
+    }
+
+    public static class UploadFilePath{
+        public static final String EDUCATION_PUBLISH_ROOT_DIR = "education" + File.separator;
+        public static final String DATA_REGISTER_ROOT_DIR = "DataRegister" + File.separator;
+        public static final String DATA_REGISTER_DATA_DIR = "DataFile" + File.separator;
+        public static final String DATA_REGISTER_DEMO_DIR = "DemoFile" + File.separator;
+        public static final String MICROAPP_REGISTER_ROOT_DIR = "MicroappRegister" + File.separator;
+        public static final String MICROAPP_PUBLISH_ROOT_DIR = "MicroappPublish" + File.separator;
+        public static final String MICROAPP_EDUCATION_ROOT_DIR = "MicroappEducation" + File.separator;
+    }
+
+}

+ 28 - 0
src/main/java/com/lightinit/hsdatashow/common/ThriftServerConfig.java

@@ -0,0 +1,28 @@
+package com.lightinit.hsdatashow.common;
+
+import org.apache.commons.configuration2.Configuration;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * Created by Mr.Yao on 2017/5/9.
+ */
+@Component
+public class ThriftServerConfig {
+    private static String zookeeperhost;
+    private static int zookeeperport;
+
+    static {
+        Configuration configuration = ConfigUtils.getConfiguration("thrift.properties");
+        zookeeperhost=configuration.getString("thrift.zookeeper.host");
+        zookeeperport=configuration.getInt("thrift.zookeeper.port");
+    }
+
+    public String getHost() {
+        return zookeeperhost;
+    }
+
+    public int getPort() {
+        return zookeeperport;
+    }
+}

+ 123 - 0
src/main/java/com/lightinit/hsdatashow/common/TripleDESUtilsPro.java

@@ -0,0 +1,123 @@
+package com.lightinit.hsdatashow.common;
+
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * Created by Mr.Yao on 2016/1/18.
+ */
+public class TripleDESUtilsPro {
+    private static String encypt_des_key="lantinit.com";
+    private static final String Algorithm = "DESede";  //定义 加密算法,可用 DES,DESede,Blowfish
+    private static final char[] HEX_CHAR= {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+
+    // 加密字符串
+    public static byte[] encryptMode(byte[] src) {
+        try { // 生成密钥
+            SecretKey deskey = new SecretKeySpec(build3DesKey(encypt_des_key), Algorithm); // 加密
+            Cipher c1 = Cipher.getInstance(Algorithm);
+            c1.init(Cipher.ENCRYPT_MODE, deskey);
+            return c1.doFinal(src);
+        } catch (java.security.NoSuchAlgorithmException e1) {
+            e1.printStackTrace();
+        } catch (javax.crypto.NoSuchPaddingException e2) {
+            e2.printStackTrace();
+        } catch (java.lang.Exception e3) {
+            e3.printStackTrace();
+        }
+        return null;
+    }
+    public static String encryptMode(String src) {
+        try {
+            byte[]decryptByte=encryptMode(src.getBytes("utf-8"));
+            if (decryptByte==null)
+                return "";
+            return byteArrayToString(decryptByte);
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+    // 解密字符串
+    public static byte[] decryptMode(byte[] src) {
+        try { // 生成密钥
+            SecretKey deskey = new SecretKeySpec(build3DesKey(encypt_des_key), Algorithm); // 解密
+            Cipher c1 = Cipher.getInstance(Algorithm);
+            c1.init(Cipher.DECRYPT_MODE, deskey);
+            return c1.doFinal(src);
+        } catch (java.security.NoSuchAlgorithmException e1) {
+            e1.printStackTrace();
+        } catch (javax.crypto.NoSuchPaddingException e2) {
+            e2.printStackTrace();
+        } catch (java.lang.Exception e3) {
+            e3.printStackTrace();
+        }
+        return null;
+    }
+    public static String decryptMode(String src) {
+        try {
+            byte[]decryptByte=decryptMode(HexString2Bytes(src));
+            if (decryptByte==null)
+                return "";
+            return new String(decryptByte);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+    public static String decryptHex(String src){
+        byte[]srcByte=HexString2Bytes(src);
+        byte[]decryptByte=decryptMode(srcByte);
+        if (decryptByte==null)
+            return "";
+        try {
+            return new String(decryptByte,"utf-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+    public static byte[] HexString2Bytes(String hexstr) {
+        byte[] b = new byte[hexstr.length() / 2];
+        int j = 0;
+        for (int i = 0; i < b.length; i++) {
+            char c0 = hexstr.charAt(j++);
+            char c1 = hexstr.charAt(j++);
+            b[i] = (byte) ((parse(c0) << 4) | parse(c1));
+        }
+        return b;
+    }
+    public static String byteArrayToString(byte[] data){
+        StringBuilder stringBuilder= new StringBuilder();
+        for (int i=0; i<data.length; i++){
+            stringBuilder.append(HEX_CHAR[(data[i] & 0xf0)>>> 4]);
+            stringBuilder.append(HEX_CHAR[(data[i] & 0x0f)]);
+        }
+        return stringBuilder.toString();
+    }
+    private static int parse(char c) {
+        if (c >= 'a')
+            return (c - 'a' + 10) & 0x0f;
+        if (c >= 'A')
+            return (c - 'A' + 10) & 0x0f;
+        return (c - '0') & 0x0f;
+    }
+
+    public static byte[] build3DesKey(String keyStr){
+        byte[] key = new byte[24];    //声明一个24位的字节数组,默认里面都是0
+        try {
+            byte[] temp = keyStr.getBytes("UTF-8");    //将字符串转成字节数组
+            if (key.length > temp.length) {
+                System.arraycopy(temp, 0, key, 0, temp.length);
+            } else {
+                System.arraycopy(temp, 0, key, 0, key.length);
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return key;
+    }
+}

+ 70 - 0
src/main/java/com/lightinit/hsdatashow/common/UploadFileUtils.java

@@ -0,0 +1,70 @@
+package com.lightinit.hsdatashow.common;
+
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * @author WangYao
+ * @date 2018/6/13 11:48
+ * @description
+ */
+public class UploadFileUtils {
+
+    private static final Logger logger = LoggerFactory.getLogger(UploadFileUtils.class);
+
+    public static void write(MultipartFile uploadFile, String targetDir) throws IOException {
+        String dataFileName = uploadFile.getOriginalFilename();
+        File dataFilePath = new File(targetDir, dataFileName);
+        //判断路径是否存在,如果不存在就创建一个
+        if (!dataFilePath.getParentFile().exists()) {
+            dataFilePath.getParentFile().mkdirs();
+        }
+        uploadFile.transferTo(new File(targetDir + dataFileName));
+    }
+
+    public static boolean writeUploadFile(MultipartFile dataFile, String dataFileDir, String relativeDir) {
+        try {
+            String uploadRootDir = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.UPLOAD_ROOT_DIR);
+            String absoluteDir = uploadRootDir + relativeDir;
+            write(dataFile, absoluteDir);
+        } catch (Exception e) {
+            logger.error(e.getMessage());
+            return false;
+        }
+        return true;
+    }
+
+    public static String buildRelativeDir(String parentDir, String uniqueDir, String childDir){
+        if (!StringUtils.isNotEmpty(uniqueDir)){
+            uniqueDir = GuidGenerator.generate() + File.separator;
+        }
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
+        String dir = (parentDir == null ? "" : parentDir) + uniqueDir + (childDir == null ? "" : childDir) + simpleDateFormat.format(new Date()) + File.separator;
+        return dir;
+    }
+
+    public static String getExistingFileRelativeDir(int removeParentDirs, String existingFilePath, int removeChildDirs){
+        String dir = new File(existingFilePath).getParent();
+        for (int i = 0; i < removeParentDirs; i++) {
+            dir = dir.substring(dir.indexOf(File.separator) + 1, dir.length());
+        }
+        for (int i = 0; i < removeChildDirs; i++) {
+            dir = dir.substring(0, dir.lastIndexOf(File.separator));
+        }
+        dir += File.separator;
+        return dir;
+    }
+
+    public static String getFileNameByPath(String filePath){
+        String fileName = new File(filePath).getName();
+        return fileName;
+    }
+
+}

+ 50 - 0
src/main/java/com/lightinit/hsdatashow/common/WebUtilsPro.java

@@ -0,0 +1,50 @@
+package com.lightinit.hsdatashow.common;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.PrintWriter;
+
+/**
+ * Created by Mr.Yao on 2017/4/18.
+ */
+public class WebUtilsPro {
+    public static boolean isAjaxRequest(HttpServletRequest request) {
+        String requestedWith = request.getHeader("x-requested-with");
+        if (requestedWith != null && requestedWith.equalsIgnoreCase("XMLHttpRequest")) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 发送消息 text/html;charset=utf-8
+     * @param response
+     * @param text
+     * @throws Exception
+     */
+    public static void writeText(HttpServletResponse response, String text) throws Exception {
+        response.setContentType("text/html; charset=utf-8");
+        PrintWriter writer = response.getWriter();
+        writer.print(text);
+        writer.close();
+        response.flushBuffer();
+    }
+
+    /**
+     * 将某个对象转换成json格式并发送到客户端
+     * @param response
+     * @param obj
+     * @throws Exception
+     */
+    public static <T> void  writeJson(HttpServletResponse response, T obj) throws Exception {
+        response.setContentType("application/json; charset=utf-8");
+        PrintWriter writer = response.getWriter();
+        ObjectMapper objectMapper = new ObjectMapper();
+        writer.print(objectMapper.writeValueAsString(obj));
+        writer.close();
+        response.flushBuffer();
+    }
+}

+ 210 - 0
src/main/java/com/lightinit/hsdatashow/controller/ActiveMQController.java

@@ -0,0 +1,210 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.common.CharEncoding;
+import com.lightinit.hsdatashow.common.HttpTookitUtils;
+import com.lightinit.hsdatashow.common.TripleDESUtilsPro;
+import com.lightinit.hsdatashow.json.pojo.BrokerEntity;
+import com.lightinit.hsdatashow.json.pojo.BrokerMessageEntity;
+import com.lightinit.hsdatashow.json.pojo.JsonResult;
+import com.lightinit.hsdatashow.json.pojo.ListResult;
+import com.lightinit.hsdatashow.json.pojo.actviemq.BrokerBrowseRequest;
+import com.lightinit.hsdatashow.json.pojo.actviemq.ObjectViewBeanRequest;
+import com.lightinit.hsdatashow.json.pojo.actviemq.QueuesBrowsRequest;
+import com.lightinit.hsdatashow.json.pojo.actviemq.RequestValueEntity;
+import com.lightinit.hsdatashow.entity.Queueserver;
+import com.lightinit.hsdatashow.service.IActiveMQService;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by Mr.Yao on 2017/12/5.
+ */
+@Controller
+@RequestMapping("/activemq")
+public class ActiveMQController {
+    @Autowired
+    private IActiveMQService activeMQService;
+    @RequestMapping(value = "view/broker.action",method = RequestMethod.GET)
+    public String print_activemq_view_broker(){
+        return "activemq/server";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/server.action",method = RequestMethod.GET)
+    public ListResult<Queueserver> print_JSON_ActiveMQ_Server(@RequestParam(defaultValue = "") String host) {
+        ListResult<Queueserver> result = new ListResult<Queueserver>();
+        result.setRows(activeMQService.queryServer(host));
+        if (result.getRows()!=null){
+            result.setTotal(result.getRows().size());
+        }else{
+            result.setTotal(0);
+        }
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/broker.action",method = RequestMethod.GET)
+    public ListResult<BrokerEntity> print_JSON_ActiveMQBroker(@RequestParam(defaultValue = "localhost") String host, @RequestParam(defaultValue = "8161") int port, @RequestParam(defaultValue = "localhost") String broker, @RequestParam(defaultValue = "") String token){
+        ListResult<BrokerEntity> result=new ListResult<BrokerEntity>();
+        if(StringUtils.isEmpty(host) || host.equalsIgnoreCase("localhost"))
+            return result;
+        // TODO: 2017/12/29 利用RESTful接口获取数据
+        try {
+            if(StringUtils.isEmpty(token)==false){
+                token= TripleDESUtilsPro.decryptMode(token)+"@";
+            }
+            List<BrokerEntity> brokeList=new ArrayList<BrokerEntity>();
+            String brokerUrl=String.format("http://%s%s:%d/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=%s/Queues",token, host, port,broker);
+            String responseBody= HttpTookitUtils.doGet(brokerUrl,null, CharEncoding.UTF8,"application/json");
+            ObjectMapper objectMapper = new ObjectMapper();
+            QueuesBrowsRequest itemList = objectMapper.readValue(responseBody, QueuesBrowsRequest.class);
+            if(itemList!=null && itemList.getValue()!=null) {
+                for (Map<String,String> mapObj : itemList.getValue()) {
+                    if(mapObj.containsKey("objectName") && mapObj.get("objectName")!=null) {
+                        String objectName = mapObj.get("objectName");
+                        if (StringUtils.isEmpty(objectName)==false) {
+                            BrokerEntity item = new BrokerEntity();
+                            String beanName = objectName.replace("org.apache.activemq:", "");
+                            String[] objectItemList = beanName.split(",");
+                            if (objectItemList != null && objectItemList.length > 0) {
+                                for (String _obj : objectItemList) {
+                                    if (_obj.startsWith("brokerName=")) {
+
+                                    } else if (_obj.startsWith("destinationName=")) {
+                                        item.setName(_obj.replace("destinationName=", ""));
+                                    } else if (_obj.startsWith("destinationType=")) {
+
+                                    } else if (_obj.startsWith("type=")) {
+
+                                    }
+                                }
+                            }
+                            String objectViewRequestUrl = String.format("http://%s%s:%d/api/jolokia/read/%s",token, host, port, objectName);
+                            String objectViewResponseBody = HttpTookitUtils.doGet(objectViewRequestUrl, null, CharEncoding.UTF8, "application/json");
+                            ObjectViewBeanRequest objectViewBeanList = objectMapper.readValue(objectViewResponseBody, ObjectViewBeanRequest.class);
+                            if (objectViewBeanList != null && objectViewBeanList.getValue() != null) {
+                                Object mQueueSize = objectViewBeanList.getValue().get("QueueSize");
+                                if (mQueueSize != null) {
+                                    item.setSize(Long.valueOf(mQueueSize.toString()));
+                                }
+                                Object mConsumers = objectViewBeanList.getValue().get("ConsumerCount");
+                                if (mConsumers != null) {
+                                    item.setConsumers(Long.valueOf(mConsumers.toString()));
+                                }
+                                Object mEnqueue = objectViewBeanList.getValue().get("EnqueueCount");
+                                if (mEnqueue != null) {
+                                    item.setEnqueue(Long.valueOf(mEnqueue.toString()));
+                                }
+                                Object mDequeue = objectViewBeanList.getValue().get("DequeueCount");
+                                if (mDequeue != null) {
+                                    item.setDequeue(Long.valueOf(mDequeue.toString()));
+                                }
+                                brokeList.add(item);
+                            }
+                        }
+                    }
+                }
+            }
+            result.setTotal(brokeList.size());
+            result.setRows(brokeList);
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/broker/destination.action",method = RequestMethod.GET)
+    public ListResult<BrokerMessageEntity> print_JSON_ActiveMQBroker_Destination(@RequestParam(defaultValue = "localhost") String host, @RequestParam(defaultValue = "8161") int port, @RequestParam(defaultValue = "localhost") String broker, @RequestParam(defaultValue = "") String queue, @RequestParam(defaultValue = "") String token) {
+        ListResult<BrokerMessageEntity> result = new ListResult<BrokerMessageEntity>();
+        if (StringUtils.isEmpty(host) || host.equalsIgnoreCase("localhost") || StringUtils.isEmpty(queue))
+            return result;
+        try {
+            if(StringUtils.isEmpty(token)==false){
+                token= TripleDESUtilsPro.decryptMode(token)+"@";
+            }
+            List<BrokerMessageEntity> brokeList = new ArrayList<BrokerMessageEntity>();
+            // TODO: 2017/12/29 RESTful获取队列消息
+            String brokerUrl=String.format("http://%s%s:%d/api/jolokia/exec/org.apache.activemq:type=Broker,brokerName=%s,destinationType=Queue,destinationName=%s/browse()/",token, host, port,broker,queue);
+            String responseBody= HttpTookitUtils.doGet(brokerUrl,null, CharEncoding.UTF8,"application/json");
+            ObjectMapper objectMapper = new ObjectMapper();
+            BrokerBrowseRequest itemList = objectMapper.readValue(responseBody, BrokerBrowseRequest.class);
+            if(itemList!=null && itemList.getValue()!=null){
+                for (RequestValueEntity item:itemList.getValue()) {
+                    BrokerMessageEntity _item = new BrokerMessageEntity();
+                    if (item.getJMSMessageID() != null) {
+                        _item.setMessageid(item.getJMSMessageID());
+                    }
+                    if (item.getJMSCorrelationID() != null) {
+                        _item.setCorrelationid(item.getJMSCorrelationID());
+                    }
+                    _item.setPriority(String.valueOf(item.getJMSPriority()));
+                    _item.setRedelivered(String.valueOf(item.isJMSRedelivered()));
+                    if (item.getJMSReplyTo() != null) {
+                        _item.setReplyto(item.getJMSReplyTo());
+                    }
+                    if (item.getJMSTimestamp() != null) {
+                        _item.setTimestamp(item.getJMSTimestamp());
+                    }
+                    if (item.getJMSType()!= null) {
+                        _item.setType(item.getJMSType());
+                    }
+                    if (item.getText() != null) {
+                        _item.setMessage(item.getText());
+                    }
+                    brokeList.add(_item);
+                }
+            }
+            result.setTotal(brokeList.size());
+            result.setRows(brokeList);
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (JsonParseException e) {
+            e.printStackTrace();
+        } catch (JsonMappingException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+
+    @ResponseBody
+    @RequestMapping(value = "json/message/delete.action",method = RequestMethod.GET)
+    public JsonResult print_JSON_ActiveMQBroker_Message_Delete(@RequestParam(defaultValue = "localhost") String host, @RequestParam(defaultValue = "8161") int port, @RequestParam(defaultValue = "localhost") String broker, @RequestParam(defaultValue = "") String queue, @RequestParam(defaultValue = "") String token, @RequestParam(defaultValue = "") String message) {
+        JsonResult result = new JsonResult();
+        if (StringUtils.isEmpty(host) || host.equalsIgnoreCase("localhost") || StringUtils.isEmpty(queue) || StringUtils.isEmpty(message)) {
+            result.setMessage("非法请求!");
+            result.setStatus(0);
+            return result;
+        }
+        try {
+            if(StringUtils.isEmpty(token)==false){
+                token= TripleDESUtilsPro.decryptMode(token)+"@";
+            }
+            String brokerUrl=String.format("http://%s%s:%d/api/jolokia/exec/org.apache.activemq:type=Broker,brokerName=%s,destinationType=Queue,destinationName=%s/removeMatchingMessages(java.lang.String)/JMSMessageID='%s'",token, host, port,broker,queue,message);
+            String responseBody= HttpTookitUtils.doGet(brokerUrl,null, CharEncoding.UTF8,"application/json");
+            System.out.println(responseBody);
+            result.setMessage("删除成功!");
+            result.setStatus(1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+}

+ 74 - 0
src/main/java/com/lightinit/hsdatashow/controller/BaseController.java

@@ -0,0 +1,74 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.common.WebUtilsPro;
+import com.lightinit.hsdatashow.json.pojo.ErrorEntity;
+import com.lightinit.hsdatashow.json.pojo.LoginResult;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authz.AuthorizationException;
+import org.apache.shiro.authz.UnauthenticatedException;
+import org.apache.shiro.authz.UnauthorizedException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.servlet.view.InternalResourceViewResolver;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.PrintWriter;
+
+/**
+ * Created by Mr.Yao on 2017/4/18.
+ */
+public abstract class BaseController
+{
+    /***
+     * 登录异常返回信息
+     * @param request 输入
+     * @param response 输出
+     * @return AJAX返回JSON数据格式 浏览器访问返回HTML格式
+     */
+    @ExceptionHandler({UnauthenticatedException.class,AuthenticationException.class})
+    public String authenticationException(HttpServletRequest request, HttpServletResponse response){
+        if(WebUtilsPro.isAjaxRequest(request)){
+            LoginResult loginResult=new LoginResult();
+            loginResult.setStatus(2008);
+            loginResult.setMessage(ErrorEntity.getMsg(loginResult.getStatus()));
+            writeJson(loginResult,response);
+            return null;
+        }else{
+            return InternalResourceViewResolver.REDIRECT_URL_PREFIX+"/passport/login.htm";
+        }
+    }
+
+    /***
+     * 授权异常返回信息
+     * @param request 输入
+     * @param response 输出
+     * @return AJAX返回JSON数据格式 浏览器访问返回HTML格式
+     */
+    @ExceptionHandler({ UnauthorizedException.class, AuthorizationException.class })
+    public String authorizationException(HttpServletRequest request, HttpServletResponse response) {
+        if (WebUtilsPro.isAjaxRequest(request)) {
+            LoginResult loginResult=new LoginResult();
+            loginResult.setStatus(2009);
+            loginResult.setMessage(ErrorEntity.getMsg(loginResult.getStatus()));
+            writeJson(loginResult,response);
+            return null;
+        } else {
+            return InternalResourceViewResolver.REDIRECT_URL_PREFIX+"/403.html";
+        }
+    }
+    private void writeJson(LoginResult result,HttpServletResponse response){
+        PrintWriter out=null;
+        try{
+            response.setContentType("application/json; charset=utf-8");
+            out = response.getWriter();
+            ObjectMapper objectMapper = new ObjectMapper();
+            out.write(objectMapper.writeValueAsString(result));
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            if(out!=null)
+                out.close();
+        }
+    }
+}

+ 57 - 0
src/main/java/com/lightinit/hsdatashow/controller/CacheController.java

@@ -0,0 +1,57 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.json.pojo.JsonResult;
+import com.lightinit.hsdatashow.json.pojo.ListResult;
+import com.lightinit.hsdatashow.entity.Cacheserver;
+import com.lightinit.hsdatashow.service.ICacheServerService;
+import com.lightinit.hsdatashow.service.IRedisService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import redis.clients.jedis.Jedis;
+
+/**
+ * Created by Mr.Yao on 2017/4/13.
+ */
+@Controller
+@RequestMapping("/cache")
+public class CacheController {
+    @Autowired
+    private IRedisService redisService;
+
+    @Autowired
+    private ICacheServerService cacheServerService;
+
+    @RequestMapping(value ="view/profile.action",method = RequestMethod.GET)
+    public String print_view_cache_list(){
+        return "cache/cacheserver";
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/list.action",method = RequestMethod.GET)
+    public ListResult<Cacheserver> print_json_cache_server_list(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int rows){
+        ListResult<Cacheserver> result=new ListResult<Cacheserver>();
+        result.setTotal(cacheServerService.QueryCount(null,""));
+        result.setRows(cacheServerService.QueryList(null,"",page,rows));
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/cache.action",method = RequestMethod.GET)
+    public JsonResult print_json_cache_value(@RequestParam String ip, @RequestParam(defaultValue = "0") int type, @RequestParam String key){
+        JsonResult result=new JsonResult();
+        switch (type){
+            case 0:
+                Jedis jedis = new Jedis(ip);
+                if(jedis.exists(key))
+                    result.setMessage(jedis.get(key));
+                else
+                    result.setMessage("当前键值缓存不存在!");
+                break;
+            case 1:
+                break;
+            case 2:
+                break;
+        }
+        result.setStatus(1);
+        return result;
+    }
+}

+ 94 - 0
src/main/java/com/lightinit/hsdatashow/controller/CaptchaController.java

@@ -0,0 +1,94 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.google.code.kaptcha.Constants;
+import com.google.code.kaptcha.Producer;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.WriterException;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.QRCodeWriter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.imageio.ImageIO;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+
+/**
+ * Created by Mr.Yao on 2017/4/11.
+ */
+@Controller
+@RequestMapping(value = "/captcha")
+public class CaptchaController {
+
+    @Autowired
+    private Producer captchaProducer;
+
+    @RequestMapping(value = "/image.action", method = RequestMethod.GET)
+    public ModelAndView getCaptchaImage(Model model, HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "timestamp", required = false) String timestamp) throws IOException {
+        if (StringUtils.isEmpty(timestamp)) {
+            model.addAttribute("timestamp", System.currentTimeMillis());
+        } else {
+            model.addAttribute("timestamp", timestamp);
+        }
+
+        response.setDateHeader("Expires", 0);
+        response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
+        response.addHeader("Cache-Control", "post-check=0, pre-check=0");
+        response.setHeader("Pragma", "no-cache");
+        response.setContentType("image/jpeg");
+        String capText = captchaProducer.createText();
+
+        request.getSession().setAttribute(Constants.KAPTCHA_SESSION_KEY, capText);
+        BufferedImage bi = captchaProducer.createImage(capText);
+        ServletOutputStream out = response.getOutputStream();
+        ImageIO.write(bi, "jpg", out);
+        try {
+            out.flush();
+        } finally {
+            out.close();
+        }
+        return null;
+    }
+    @RequestMapping(value = "/qrcode.action", method = RequestMethod.GET)
+    public ModelAndView getQRCodeImage(Model model, HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "timestamp", required = false) String timestamp) throws IOException {
+        if (StringUtils.isEmpty(timestamp)) {
+            model.addAttribute("timestamp", System.currentTimeMillis());
+        } else {
+            model.addAttribute("timestamp", timestamp);
+        }
+
+        response.setDateHeader("Expires", 0);
+        response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
+        response.addHeader("Cache-Control", "post-check=0, pre-check=0");
+        response.setHeader("Pragma", "no-cache");
+        response.setContentType("image/png");
+        String qrCodeText = captchaProducer.createText();
+        ServletOutputStream out = null;
+        QRCodeWriter writer=new QRCodeWriter();
+        int width=200;
+        int height=200;
+        BitMatrix m= null;
+        try {
+            out = response.getOutputStream();
+            m = writer.encode(qrCodeText, BarcodeFormat.QR_CODE, height,width);
+            MatrixToImageWriter.writeToStream(m, "png", out);
+            out.flush();
+        } catch (WriterException e) {
+            e.printStackTrace();
+        }finally {
+            if (out != null)
+                out.close();
+        }
+        return null;
+    }
+}

+ 16 - 0
src/main/java/com/lightinit/hsdatashow/controller/GrantController.java

@@ -0,0 +1,16 @@
+package com.lightinit.hsdatashow.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * Created by Mr.Yao on 2017/4/26.
+ */
+@Controller
+@RequestMapping("/grant")
+public class GrantController {
+    @RequestMapping(value = "view/list.action")
+    public String print_user_grant_list(){
+        return "grant/grant";
+    }
+}

+ 33 - 0
src/main/java/com/lightinit/hsdatashow/controller/HomeController.java

@@ -0,0 +1,33 @@
+package com.lightinit.hsdatashow.controller;
+import com.lightinit.hsdatashow.common.DateUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+
+/**
+ * Created by Mr.Yao on 2017/3/22.
+ */
+@Controller
+public class HomeController {
+    @RequestMapping(method = RequestMethod.GET)
+    public String printWelcome(ModelMap model, HttpServletRequest request) {
+//        return "index";
+        return  "admin/account/login";
+    }
+    @RequestMapping(value = "main.action",method = RequestMethod.GET)
+    public String printMain(ModelMap model) {
+        String begin= DateUtils.weekBeginDate(new Date());
+        String end=DateUtils.weekEndDate(new Date());
+        int year=DateUtils.YearOfDate();
+        int month=DateUtils.MonthOfDate();
+        model.addAttribute("mbegin",begin);
+        model.addAttribute("mend",end);
+        model.addAttribute("myear",year);
+        model.addAttribute("mmonth",month);
+        return "main";
+    }
+}

+ 46 - 0
src/main/java/com/lightinit/hsdatashow/controller/LogController.java

@@ -0,0 +1,46 @@
+package com.lightinit.hsdatashow.controller;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.lightinit.hsdatashow.json.pojo.ListResult;
+import com.lightinit.hsdatashow.entity.MTLogInfo;
+import com.lightinit.hsdatashow.service.IMTLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * Created by Mr.Yao on 2017/4/27.
+ */
+@Controller
+@RequestMapping("/log")
+public class LogController {
+    @Autowired
+    private IMTLogService logService;
+
+    @RequestMapping(value = "view/mtlog.action", method = RequestMethod.GET)
+    public String print_log_mtlog() {
+        return "log/mtlog";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/mtlogs.action", method = RequestMethod.GET)
+    public ListResult<MTLogInfo> GetLogs(@RequestParam(required = false, defaultValue = "") String dateStr, @RequestParam(required = false, defaultValue = "") String keywords, @RequestParam(required = false, defaultValue = "1") int page, @RequestParam(required = false, defaultValue = "10") int rows) {
+        ListResult<MTLogInfo> result = new ListResult<MTLogInfo>();
+        if (dateStr.isEmpty()||dateStr=="") {
+            SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
+            try {
+                dateStr=df.format(new Date());
+            } catch (Exception e) {
+            }
+            System.out.print(dateStr + "\r\n");
+        }
+        /*result.setRows(logService.QueryLogList(dateStr, keywords, page, rows));
+        result.setTotal(logService.QueryLogCount(dateStr, keywords));*/
+        return result;
+    }
+}

+ 100 - 0
src/main/java/com/lightinit/hsdatashow/controller/LoginController.java

@@ -0,0 +1,100 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.json.pojo.ErrorEntity;
+import com.google.code.kaptcha.Constants;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.*;
+import org.apache.shiro.subject.Subject;
+import org.springframework.stereotype.Controller;
+import com.lightinit.hsdatashow.json.pojo.LoginResult;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+/**
+ * Created by Mr.Yao on 2017/4/7.
+ */
+@Controller
+@RequestMapping("/passport")
+public class LoginController {
+
+    @RequestMapping(value = {"login.htm", "login"},method = RequestMethod.GET)
+    public String printMain(ModelMap model) {
+        return "index";
+    }
+    @ResponseBody
+    @RequestMapping(method = RequestMethod.POST,value = "login.action")
+    public  LoginResult printLoginAction(ModelMap model,HttpSession session, @RequestParam String username,@RequestParam String password,@RequestParam String captcha){
+        LoginResult result = new LoginResult();
+       String capText=session.getAttribute(Constants.KAPTCHA_SESSION_KEY)!=null?session.getAttribute(Constants.KAPTCHA_SESSION_KEY).toString():"";
+        if(StringUtils.isEmpty(capText) || StringUtils.isEmpty(captcha)){
+            result.setStatus(0003);
+        }else if (capText.equalsIgnoreCase(captcha)==false){
+            result.setStatus(2010);
+        }else {
+            UsernamePasswordToken token = new UsernamePasswordToken(username, password);
+            Subject currentUser = SecurityUtils.getSubject();
+            //token.setRememberMe(true);
+            try {
+                //在调用了login方法后,SecurityManager会收到AuthenticationToken,并将其发送给已配置的Realm执行必须的认证检查
+                currentUser.login(token);
+                if (currentUser.isAuthenticated()) {
+                    session.setAttribute("userinfo", username);
+                    result.setStatus(2001);
+                } else {
+                    token.clear();
+                }
+            } catch (UnknownAccountException uae) {
+                result.setStatus(2003);
+                token.clear();
+            } catch (IncorrectCredentialsException ice) {
+                result.setStatus(2004);
+                token.clear();
+            } catch (LockedAccountException lae) {
+                result.setStatus(2005);
+                token.clear();
+            } catch (ExcessiveAttemptsException eae) {
+                result.setStatus(2006);
+                token.clear();
+            } catch (AuthenticationException ae) {
+                //通过处理Shiro的运行时AuthenticationException就可以控制用户登录失败或密码错误时的情景
+                result.setStatus(2007);
+            }
+        }
+        result.setMessage(ErrorEntity.getMsg(result.getStatus()));
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(method = RequestMethod.POST,value = "logout.action")
+    public  LoginResult printLogoutAction(ModelMap model,HttpSession session){
+        LoginResult result = new LoginResult();
+        Subject currentUser = SecurityUtils.getSubject();
+        try {
+            currentUser.logout();
+            result.setStatus(2008);
+        } catch (Exception e) {
+            result.setStatus(0003);
+        }
+        result.setMessage(ErrorEntity.getMsg(result.getStatus()));
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(method = RequestMethod.GET,value = "auth.action")
+    public ModelAndView printAuthAction(ModelMap model, HttpServletRequest request, HttpServletResponse response,@CookieValue(defaultValue = "") String username){
+        try {
+           if(StringUtils.isEmpty(username)){
+               response.setStatus(401);
+           }else{
+               response.setStatus(200);
+           }
+        } catch (Exception e) {
+            response.setStatus(401);
+        }
+        return null;
+    }
+}

+ 81 - 0
src/main/java/com/lightinit/hsdatashow/controller/MenuController.java

@@ -0,0 +1,81 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.common.MenuUtils;
+import com.lightinit.hsdatashow.common.PermissionUtilsPro;
+import com.lightinit.hsdatashow.entity.Menu;
+import com.lightinit.hsdatashow.entity.MenuDataEntity;
+import com.lightinit.hsdatashow.entity.RoleModule;
+import com.lightinit.hsdatashow.service.IMenuService;
+import com.lightinit.hsdatashow.service.IRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Mr.Yao on 2017/4/10.
+ */
+@Controller
+@RequestMapping("/menu")
+public class MenuController {
+    @Autowired
+    private IMenuService menuService;
+    @Autowired
+    private PermissionUtilsPro permissionUtilsPro;
+    @Autowired
+    private IRoleService roleService;
+
+    @RequestMapping(value = "view/list.action")
+    public String print_menu_view_list(){
+        return "menu/module";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "list.action",method = RequestMethod.GET)
+    public List<MenuDataEntity> print_Json_Menu(){
+        List<MenuDataEntity> list=new ArrayList<MenuDataEntity>();
+        if(permissionUtilsPro.IsSuperPermission()) {
+            list.addAll(MenuUtils.InitSystemTopMenu());
+        }
+        List<Menu> menuList=new ArrayList<Menu>();
+        List<RoleModule> roleModuleList=new ArrayList<RoleModule>();
+        if(permissionUtilsPro.IsSuperPermission()) {
+            menuList=menuService.QueryList(1,0,null);
+        }else{
+            menuList=menuService.QueryList(permissionUtilsPro.CurrentName());
+            roleModuleList=roleService.QueryUserModuleList(permissionUtilsPro.CurrentName());
+        }
+        for (Menu item:menuList) {
+            MenuDataEntity _item= MenuUtils.MenuConverter(item,roleModuleList,permissionUtilsPro.IsSuperPermission());
+            if(_item!=null)
+                list.add(_item);
+        }
+        list.addAll(MenuUtils.InitSystemBottomMenu());
+        return list;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/module/list.action",method = RequestMethod.GET)
+    public List<Menu> print_Json_Module_Menu() {
+        List<Menu> list = new ArrayList<Menu>();
+        List<MenuDataEntity> topList = MenuUtils.InitSystemTopMenu();
+        for (MenuDataEntity topItem:topList) {
+            Menu _topMenuItem = MenuUtils.MenuDataConverter(topItem);
+            if (_topMenuItem != null)
+                list.add(_topMenuItem);
+        }
+        List<Menu> centerList = menuService.QueryList(1, 1000, null);
+        if (centerList != null && centerList.size() > 0)
+            list.addAll(centerList);
+        List<MenuDataEntity> bottomList = MenuUtils.InitSystemBottomMenu();
+        for (MenuDataEntity bottomItem:bottomList) {
+            Menu _bottomMenuItem = MenuUtils.MenuDataConverter(bottomItem);
+            if (_bottomMenuItem != null)
+                list.add(_bottomMenuItem);
+        }
+        return list;
+    }
+}

+ 218 - 0
src/main/java/com/lightinit/hsdatashow/controller/RoleController.java

@@ -0,0 +1,218 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.common.MenuUtils;
+import com.lightinit.hsdatashow.common.RoleComboUtils;
+import com.lightinit.hsdatashow.common.RoleModulesUtilsPro;
+import com.lightinit.hsdatashow.json.pojo.JsonResult;
+import com.lightinit.hsdatashow.json.pojo.ListResult;
+import com.lightinit.hsdatashow.json.pojo.RoleComboEntity;
+import com.lightinit.hsdatashow.entity.Menu;
+import com.lightinit.hsdatashow.entity.MenuDataEntity;
+import com.lightinit.hsdatashow.entity.RoleModule;
+import com.lightinit.hsdatashow.entity.SentryRole;
+import com.lightinit.hsdatashow.service.IMenuService;
+import com.lightinit.hsdatashow.service.IRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by Mr.Yao on 2017/4/24.
+ */
+@Controller
+@RequestMapping("/role")
+public class RoleController {
+    @Autowired
+    private IRoleService roleService;
+    @Autowired
+    private RoleModulesUtilsPro roleModulesUtilsPro;
+    @Autowired
+    private IMenuService menuService;
+
+    @RequestMapping(value = "view/list.action")
+    public String print_role_view_list(){
+        return "role/role";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/list.action",method = RequestMethod.GET)
+    public ListResult<SentryRole> print_Json_Role(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int rows){
+        ListResult<SentryRole> result=new ListResult<SentryRole>();
+        result.setTotal(roleService.QueryCount(null));
+        result.setRows(roleService.QueryList(page,rows,null));
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/combox/list.action",method = RequestMethod.GET)
+    public List<RoleComboEntity> print_Json_Combox_Role(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int rows, @RequestParam(defaultValue = "true") boolean combox){
+        List<RoleComboEntity> result=new ArrayList<RoleComboEntity>();
+        List<SentryRole> list=roleService.QueryList(page,rows,null);
+        if(combox) {
+            RoleComboEntity tipEntity = new RoleComboEntity();
+            tipEntity.setId(-1L);
+            tipEntity.setText("-请选择-");
+            tipEntity.setChildren(null);
+            tipEntity.setIconCls("fi-page");
+            result.add(tipEntity);
+        }
+        if (list!=null){
+            for (SentryRole item:list){
+                result.add(RoleComboUtils.RoleComboxConverter(item));
+            }
+        }
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "menu/list.action",method = RequestMethod.GET)
+    public List<MenuDataEntity> print_Json_Menu_Role(@RequestParam(defaultValue = "0") long role){
+        List<MenuDataEntity> resultList=new ArrayList<MenuDataEntity>();
+        List<MenuDataEntity> list=new ArrayList<MenuDataEntity>();
+        list.addAll(MenuUtils.InitSystemTopMenu());
+        List<Menu> menuList= menuService.QueryList(1,1000,null);
+        for (Menu item:menuList) {
+            MenuDataEntity _item= MenuUtils.MenuConverter(item,new ArrayList<RoleModule>(),true);
+            if(_item!=null)
+                list.add(_item);
+        }
+        list.addAll(MenuUtils.InitSystemBottomMenu());
+        if(role>0){
+            SentryRole sentryRole= roleService.QueryOne(role);
+            if(sentryRole.getParentid()!=null && sentryRole.getParentid()>0) {
+                List<Long> roleModules = roleModulesUtilsPro.RoleHasModules(sentryRole.getParentid());
+                resultList = MenuUtils.UserRolePermission(list, roleModules);
+            }else{
+                resultList.clear();
+                resultList.addAll(list);
+            }
+        }else{
+            resultList.clear();
+            resultList.addAll(list);
+        }
+        return resultList;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/module/list.action",method = RequestMethod.POST)
+    public List<RoleModule> print_Json_Module_Role(@RequestParam(defaultValue = "0") long role){
+        if(role>0) {
+            List<RoleModule> result = roleModulesUtilsPro.RoleModules(role);
+            return result;
+        }else
+            return new ArrayList<RoleModule>();
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/module/save.action",method = RequestMethod.POST)
+    public JsonResult print_Save_Module_Role(@RequestParam(defaultValue = "0") long role, @RequestParam(defaultValue = "") String ids){
+        JsonResult jsonResult=new JsonResult();
+        if(role>0) {
+            String[]list=ids.split(";");
+            List<Long> idList=new ArrayList<Long>();
+            for (String id:list) {
+                if (StringUtils.isEmpty(id)==false){
+                    idList.add(Long.valueOf(id));
+                }
+            }
+            roleService.SaveRoleModule(role,idList, null);
+            jsonResult.setStatus(1);
+            jsonResult.setMessage("授权成功");
+        }else{
+            jsonResult.setStatus(-1);
+            jsonResult.setMessage("参数错误");
+        }
+        return jsonResult;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/role/save.action",method = RequestMethod.POST)
+    public JsonResult print_Save_Role(@RequestParam(defaultValue = "0") long role,@RequestParam(defaultValue = "-1") long parentid,@RequestParam String code,@RequestParam String name){
+        JsonResult jsonResult=new JsonResult();
+        boolean success=false;
+        if(StringUtils.isEmpty(code)){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("角色编码不能为空");
+        }else if(StringUtils.isEmpty(name)){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("角色名称不能为空");
+        }else {
+            if (role > 0) {
+                SentryRole item = roleService.QueryOne(role);
+                if(item==null){
+                    jsonResult.setStatus(0);
+                    jsonResult.setMessage("当前角色不存在");
+                }else {
+                    item.setParentid(parentid <= 0 ? null : parentid);
+                    item.setRolecode(code.toLowerCase());
+                    item.setRolename(name);
+                    success = roleService.UpdateRole(item);
+                }
+            } else {
+                if(roleService.IsExitsRole(code)){
+                    jsonResult.setStatus(0);
+                    jsonResult.setMessage("当前角色已存在");
+                }else {
+                    SentryRole sentryRole = new SentryRole();
+                    sentryRole.setAddtiime(new Date());
+                    sentryRole.setChildren(null);
+                    sentryRole.setParentid(parentid <= 0 ? null : parentid);
+                    sentryRole.setRolename(name);
+                    sentryRole.setRolecode(code.toLowerCase());
+                    success = roleService.InsertRole(sentryRole);
+                }
+            }
+            jsonResult.setStatus(success ? 1 : 0);
+            jsonResult.setMessage(success ? "添加角色成功" : "添加角色失败");
+        }
+        return jsonResult;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/role/delete.action",method = RequestMethod.POST)
+    public JsonResult print_delete_Role(@RequestParam(defaultValue = "0") long role){
+        JsonResult jsonResult=new JsonResult();
+        boolean success=false;
+        if (role > 0) {
+            SentryRole item = roleService.QueryOne(role);
+            if(item==null){
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("当前角色已不存在");
+            }else if(item.getChildren()!=null && item.getChildren().size()>0){
+                jsonResult.setStatus(-1);
+                jsonResult.setMessage("角色【"+item.getRolename()+"】还有子角色,当前角色不能删除");
+            }else {
+                List<Long> roleIds=roleModulesUtilsPro.RoleIds(item);
+                if(roleIds.size()==0){
+                    jsonResult.setStatus(-1);
+                    jsonResult.setMessage("参数错误");
+                }else {
+                    if (roleService.CheckRoleHasModules(roleIds)) {
+                        jsonResult.setStatus(-1);
+                        jsonResult.setMessage("角色【"+item.getRolename()+"】已经分配权限,当前角色不能删除");
+                    }else if (roleService.CheckRoleHasUser(roleIds)) {
+                        jsonResult.setStatus(-1);
+                        jsonResult.setMessage("角色【"+item.getRolename()+"】已经分配用户,当前角色不能删除");
+                    }else{
+                       if(roleService.DeleteRole(role)){
+                           jsonResult.setStatus(1);
+                           jsonResult.setMessage("角色【"+item.getRolename()+"】删除成功");
+                       }else{
+                           jsonResult.setStatus(-1);
+                           jsonResult.setMessage("角色【"+item.getRolename()+"】删除失败");
+                       }
+                    }
+                }
+            }
+        } else {
+            jsonResult.setStatus(-1);
+            jsonResult.setMessage("参数错误");
+        }
+        return jsonResult;
+    }
+}

+ 164 - 0
src/main/java/com/lightinit/hsdatashow/controller/SolrController.java

@@ -0,0 +1,164 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.common.CharEncoding;
+import com.lightinit.hsdatashow.common.HttpTookitUtils;
+import com.lightinit.hsdatashow.common.SolrUtils;
+import com.lightinit.hsdatashow.json.pojo.JsonResult;
+import com.lightinit.hsdatashow.json.pojo.ListResult;
+import com.lightinit.hsdatashow.json.pojo.solr.*;
+import com.lightinit.hsdatashow.entity.Solrserver;
+import com.lightinit.hsdatashow.service.ISolrService;
+import org.apache.http.NameValuePair;
+import org.apache.http.message.BasicNameValuePair;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * Created by Mr.Yao on 2017/11/2.
+ */
+@Controller
+@RequestMapping("/solr")
+public class SolrController {
+//    @Autowired
+//    private HttpSolrClient httpSolrClient;
+    @Autowired
+    private ISolrService solrService;
+
+    @RequestMapping(value = "view/broker.action",method = RequestMethod.GET)
+    public String print_solr_view_broker(){
+        return "solr/server";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/server.action",method = RequestMethod.GET)
+    public ListResult<Solrserver> print_JSON_Solr_Server(@RequestParam(defaultValue = "") String keyword) {
+        ListResult<Solrserver> result = new ListResult<Solrserver>();
+        List<String> list=new ArrayList<String>();
+        result.setRows(solrService.querySolrServer(keyword));
+        if (result.getRows()!=null){
+            result.setTotal(result.getRows().size());
+        }else{
+            result.setTotal(0);
+        }
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/admin/core/detail.action",method = RequestMethod.GET)
+    public CoreOverViewItemEntity print_json_solr_admin_core_detail(@RequestParam(defaultValue = "http://192.168.107.112:8080/solr") String service, @RequestParam(defaultValue = "") String core) {
+        CoreOverViewItemEntity result = new CoreOverViewItemEntity();
+        if (StringUtils.isEmpty(service) || StringUtils.isEmpty(core))
+            return result;
+        CoreOverViewResponseEntity item = SolrUtils.parse(service, core);
+        if (item != null && item.getIndex() != null) {
+            result = item.getIndex();
+        }
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/admin/cores.action",method = RequestMethod.GET)
+    public ListResult<CoreItemDetailEntity> print_json_solr_admin_cores(@RequestParam(defaultValue = "") String service) {
+        ListResult<CoreItemDetailEntity> result = new ListResult<CoreItemDetailEntity>();
+        if(StringUtils.isEmpty(service))
+            return result;
+        List<CoreItemDetailEntity> mList=new ArrayList<CoreItemDetailEntity>();
+        List<NameValuePair> nameValuePairs=new ArrayList<NameValuePair>();
+        nameValuePairs.add(new BasicNameValuePair("wt","json"));
+        nameValuePairs.add(new BasicNameValuePair("indexInfo","false"));
+        nameValuePairs.add(new BasicNameValuePair("_",String.valueOf(System.currentTimeMillis())));
+        String responseBody= HttpTookitUtils.doGet(service+"/admin/cores",nameValuePairs, CharEncoding.UTF8,"application/json");
+        if(StringUtils.isEmpty(responseBody)==false) {
+            ObjectMapper objectMapper = new ObjectMapper();
+            try {
+                CoreResponseEntity item = objectMapper.readValue(responseBody, CoreResponseEntity.class);
+                if(item!=null && item.getStatus()!=null) {
+                    Iterator<Map.Entry<String, CoreItemEntity>> mIterator = item.getStatus().entrySet().iterator();
+                    while (mIterator.hasNext()) {
+                        Map.Entry<String, CoreItemEntity> entry = mIterator.next();
+                        CoreItemDetailEntity itemDetailEntity=new CoreItemDetailEntity(entry.getValue());
+                        CoreOverViewResponseEntity overviewItem = SolrUtils.parse(service, itemDetailEntity.getName());
+                        if (overviewItem != null && overviewItem.getIndex() != null) {
+                            CoreOverViewItemEntity coreOverViewItemEntity = overviewItem.getIndex();
+                            itemDetailEntity.setDeletedDocs(coreOverViewItemEntity.getDeletedDocs());
+                            itemDetailEntity.setLastModified(coreOverViewItemEntity.getLastModified());
+                            itemDetailEntity.setMaxDoc(coreOverViewItemEntity.getMaxDoc());
+                            itemDetailEntity.setNumDocs(coreOverViewItemEntity.getNumDocs());
+                            itemDetailEntity.setSegmentCount(coreOverViewItemEntity.getSegmentCount());
+                        }
+                        mList.add(itemDetailEntity);
+                    }
+                }
+            } catch (JsonParseException e) {
+                e.printStackTrace();
+            } catch (JsonMappingException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        result.setRows(mList);
+        if (result.getRows()!=null){
+            result.setTotal(result.getRows().size());
+        }else{
+            result.setTotal(0);
+        }
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/admin/core/dataimport/refresh.action",method = RequestMethod.GET)
+    public JsonResult print_json_solr_admin_core_dataimport_refresh(@RequestParam String service, @RequestParam String core, @RequestParam String entity) {
+        JsonResult result = new JsonResult();
+        if(StringUtils.isEmpty(service)) {
+            result.setStatus(-1);
+            result.setMessage("参数错误");
+            return result;
+        }
+        List<CoreItemDetailEntity> mList=new ArrayList<CoreItemDetailEntity>();
+        List<NameValuePair> nameValuePairs=new ArrayList<NameValuePair>();
+        nameValuePairs.add(new BasicNameValuePair("wt","json"));
+        nameValuePairs.add(new BasicNameValuePair("command","status"));
+        nameValuePairs.add(new BasicNameValuePair("indent","true"));
+        nameValuePairs.add(new BasicNameValuePair("_",String.valueOf(System.currentTimeMillis())));
+        String responseBody= HttpTookitUtils.doGet(service+"/"+core+"/dataimport",nameValuePairs, CharEncoding.UTF8,"application/json");
+        result.setStatus(1);
+        result.setMessage(responseBody);
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/admin/core/dataimport.action",method = RequestMethod.GET)
+    public JsonResult print_json_solr_admin_core_dataimport(@RequestParam String service,@RequestParam String core,@RequestParam String entity) {
+        JsonResult result = new JsonResult();
+        if(StringUtils.isEmpty(service)){
+            result.setStatus(-1);
+            result.setMessage("参数错误");
+            return result;
+        }
+        List<CoreItemDetailEntity> mList=new ArrayList<CoreItemDetailEntity>();
+        List<NameValuePair> nameValuePairs=new ArrayList<NameValuePair>();
+        nameValuePairs.add(new BasicNameValuePair("wt","json"));
+        nameValuePairs.add(new BasicNameValuePair("command","full-import"));
+        nameValuePairs.add(new BasicNameValuePair("clean","true"));
+        nameValuePairs.add(new BasicNameValuePair("commit","true"));
+        nameValuePairs.add(new BasicNameValuePair("entity",entity));
+        nameValuePairs.add(new BasicNameValuePair("verbose","false"));
+        nameValuePairs.add(new BasicNameValuePair("optimize","false"));
+        nameValuePairs.add(new BasicNameValuePair("debug","false"));
+        nameValuePairs.add(new BasicNameValuePair("indent","true"));
+        nameValuePairs.add(new BasicNameValuePair("_",String.valueOf(System.currentTimeMillis())));
+        String responseBody= HttpTookitUtils.doPost(service+"/"+core+"/dataimport",nameValuePairs, CharEncoding.UTF8,"application/json");
+        result.setStatus(1);
+        result.setMessage(responseBody);
+        return result;
+    }
+}

+ 215 - 0
src/main/java/com/lightinit/hsdatashow/controller/TokenController.java

@@ -0,0 +1,215 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.common.OneTimePasswordAlgorithm;
+import com.lightinit.hsdatashow.common.SecureCardUtilsPro;
+import com.lightinit.hsdatashow.json.pojo.BindCardEntity;
+import com.lightinit.hsdatashow.json.pojo.CardJsonResult;
+import com.lightinit.hsdatashow.json.pojo.JsonResult;
+import com.lightinit.hsdatashow.entity.Securekey;
+import com.lightinit.hsdatashow.service.ISecureKeyService;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.subject.Subject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpSession;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * Created by Lantinit on 2018/1/31.
+ */
+@Controller
+@RequestMapping("/token")
+public class TokenController {
+    @Autowired
+    private ISecureKeyService secureKeyService;
+    @Autowired
+    private SecureCardUtilsPro secureCardUtilsPro;
+    @ResponseBody
+    @RequestMapping(value = "json/user/secret.action",method = RequestMethod.GET)
+    public JsonResult print_json_user_secret(HttpSession session) {
+        JsonResult result = new JsonResult();
+        String []xAxis=new String[]{"A","B","C","D","E","F","G","H","J","K"};
+        String []yAxis=new String[]{"1","2","3","4","5","6","7","8"};
+        Random xRand = new Random();
+        Random yRand = new Random();
+        List<String> keyList=new ArrayList<String>();
+        for (int i=0;i<4;i++) {
+            keyList.add(xAxis[xRand.nextInt(10)]+yAxis[yRand.nextInt(8)]);
+        }
+        session.setAttribute("SECUREKEY_SESSION_KEY", String.join(":::",keyList));
+        result.setStatus(1);
+        result.setMessage("请输入对应的密钥:"+String.join("、",keyList));
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/user/secret/key.action",method = RequestMethod.GET)
+    public JsonResult print_json_user_secret_key(HttpSession session) {
+        JsonResult result = new JsonResult();
+        String []xAxis=new String[]{"A","B","C","D","E","F","G","H","J","K"};
+        String []yAxis=new String[]{"1","2","3","4","5","6","7","8"};
+        Random xRand = new Random();
+        Random yRand = new Random();
+        List<String> keyList=new ArrayList<String>();
+        for (int i=0;i<4;i++) {
+            keyList.add(xAxis[xRand.nextInt(10)]+yAxis[yRand.nextInt(8)]);
+        }
+        session.setAttribute("SECUREKEY_SESSION_KEY", String.join(":::",keyList));
+        result.setStatus(1);
+        result.setMessage(String.join(":",keyList));
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/user/secret/verification.action",method = RequestMethod.GET)
+    public JsonResult print_json_user_secret_verification(HttpSession session, @RequestParam(defaultValue = "")String token) {
+        JsonResult result = new JsonResult();
+        if (StringUtils.isEmpty(token)) {
+            result.setStatus(-1);
+            result.setMessage("非法Token!");
+            return result;
+        }
+        Subject currentUser = SecurityUtils.getSubject();
+        if (currentUser == null) {
+            result.setStatus(-1);
+            result.setMessage("当前用户不存在!");
+            return result;
+        }
+        String capText = session.getAttribute("SECUREKEY_SESSION_KEY") != null ? session.getAttribute("SECUREKEY_SESSION_KEY").toString() : "";
+        if (StringUtils.isEmpty(capText)) {
+            result.setStatus(-1);
+            result.setMessage("系统异常!");
+            return result;
+        }
+        Securekey securekey = secureKeyService.QueryOne(currentUser.getPrincipal().toString());
+        if (securekey == null) {
+            result.setStatus(-1);
+            result.setMessage("授权失败!");
+            return result;
+        }
+        String realToken = "";
+        String[] TokenArray = capText.split(":::");
+        for (String item : TokenArray) {
+            String secretStr = item.substring(1) + ":::" + securekey.getSecurekey() + ":::" + item.substring(0, 1);
+            try {
+                realToken += OneTimePasswordAlgorithm.generateOTP(secretStr.getBytes(), 0, 2, false, -1);
+            } catch (NoSuchAlgorithmException e) {
+                e.printStackTrace();
+            } catch (InvalidKeyException e) {
+                e.printStackTrace();
+            }
+        }
+        if (realToken.equalsIgnoreCase(token) == false) {
+            result.setStatus(-1);
+            result.setMessage("授权失败!");
+            return result;
+        } else {
+            session.removeAttribute("SECUREKEY_SESSION_KEY");
+            result.setStatus(1);
+            result.setMessage("授权成功!");
+            return result;
+        }
+    }
+
+
+    @ResponseBody
+    @RequestMapping(value = "json/secret/make/card.action",method = RequestMethod.GET)
+    public CardJsonResult print_json_user_secret_make() {
+        CardJsonResult result = new CardJsonResult();
+        try {
+            SimpleDateFormat syncDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            try {
+                Date syncDate= syncDateFormat.parse(syncDateFormat.format(new Date()));
+                result.setSynctime(syncDate.getTime());
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyMMddHHmmssSSS");
+            String[][] CardSecret = new String[10][8];
+            String SerialNo = "1"+ org.apache.commons.lang3.StringUtils.leftPad(simpleDateFormat.format(new Date()),18,"0");
+            String[] xAxis = new String[]{"A", "B", "C", "D", "E", "F", "G", "H", "J", "K"};
+            String[] yAxis = new String[]{"1", "2", "3", "4", "5", "6", "7", "8"};
+            for (int j = 0; j < 8; j++) {
+                for (int i = 0; i < 10; i++) {
+                    String secretStr = yAxis[j] + ":::"+SerialNo+":::"+result.getSynctime()+":::" + xAxis[i];
+                    CardSecret[i][j] = OneTimePasswordAlgorithm.generateOTP(secretStr.getBytes(), 0, 2, false, -1);
+                }
+            }
+            result.setSecretkeys(CardSecret);
+            result.setSerialno(SerialNo);
+            result.setStatus(1);
+            result.setMessage("操作成功");
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+            result.setStatus(0);
+            result.setMessage("服务异常");
+        } catch (InvalidKeyException e) {
+            e.printStackTrace();
+            result.setStatus(0);
+            result.setMessage("服务异常");
+        }
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/secret/bind/card.action",method = RequestMethod.POST)
+    public JsonResult print_json_user_secret_bind(HttpSession session,@RequestBody BindCardEntity item) {
+        JsonResult result = new JsonResult();
+        try {
+            if(secureCardUtilsPro.verification(session,item.getToken(),item.getCardno(),item.getSynctime())==false){
+                result.setStatus(0);
+                result.setMessage("服务异常");
+                return result;
+            }
+            SimpleDateFormat syncDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            try {
+                Date syncDate=syncDateFormat.parse(syncDateFormat.format(item.getSynctime()));
+                Securekey record=secureKeyService.QueryOne(item.getUsername());
+                if(record==null){
+                    record=new Securekey();
+                }
+                record.setBinddatetime(new Date());
+                record.setCyclestep(0);
+                Calendar rightNow = Calendar.getInstance();
+                rightNow.setTime(new Date());
+                rightNow.add(Calendar.YEAR,1);
+                record.setExpiresdatetime(rightNow.getTime());
+                record.setSecurekey(item.getCardno());
+                record.setSyncdatetime(syncDate);
+                record.setSecurekeytype(0);
+                record.setUsername(item.getUsername());
+                if(record.getSecurekeyid()<=0) {
+                    if (secureKeyService.Insert(record)) {
+                        result.setStatus(1);
+                        result.setMessage("操作成功");
+                    } else {
+                        result.setStatus(1);
+                        result.setMessage("操作成功");
+                    }
+                }else{
+                    if (secureKeyService.Update(record)) {
+                        result.setStatus(1);
+                        result.setMessage("操作成功");
+                    } else {
+                        result.setStatus(1);
+                        result.setMessage("操作成功");
+                    }
+                }
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            result.setStatus(1);
+            result.setMessage("操作成功");
+        }catch (Exception e) {
+            e.printStackTrace();
+            result.setStatus(0);
+            result.setMessage("服务异常");
+        }
+        return result;
+    }
+}

+ 114 - 0
src/main/java/com/lightinit/hsdatashow/controller/UploadController.java

@@ -0,0 +1,114 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.common.FTPConfigurationUtilsPro;
+import com.lightinit.hsdatashow.common.FTPTookitUtils;
+import com.lightinit.hsdatashow.json.pojo.FTPConfigurationParameter;
+import com.lightinit.hsdatashow.json.pojo.UploadResultEntity;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.Iterator;
+
+/**
+ * Created by Mr.Yao on 2017/5/8.
+ */
+@Controller
+@RequestMapping("/upload")
+public class UploadController {
+    @Autowired
+    private FTPTookitUtils ftpTookitUtils;
+    @Autowired
+    private FTPConfigurationUtilsPro ftpConfigurationUtilsPro;
+    @ResponseBody
+    @RequestMapping(value = "deployment/{product}/zip/package.action")
+    public String print_save_file(HttpServletRequest request, @PathVariable String product){
+        try {
+            CommonsMultipartResolver multipartResolver=new CommonsMultipartResolver(request.getSession().getServletContext());
+            if(multipartResolver.isMultipart(request)){
+                MultipartHttpServletRequest multipartHttpServletRequest=(MultipartHttpServletRequest)request;
+                Iterator<String> iterator=multipartHttpServletRequest.getFileNames();
+                while (iterator.hasNext()){
+                    MultipartFile file=multipartHttpServletRequest.getFile(iterator.next());
+                    if(file!=null){
+                        String filename=file.getOriginalFilename();
+                        if(StringUtils.isEmpty(filename.trim())){
+                            continue;
+                        }
+                        FTPConfigurationParameter ftpConfigurationParameter=new FTPConfigurationParameter(ftpConfigurationUtilsPro.getDeploy_host(),ftpConfigurationUtilsPro.getDeploy_port(),ftpConfigurationUtilsPro.getDeploy_username(),ftpConfigurationUtilsPro.getDeploy_password());
+                        ftpTookitUtils.uploadFile(file.getInputStream(),String.format("deployment/%s/%s",product,filename),ftpConfigurationParameter);
+                    }
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "error";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "file/zip/upload.action")
+    public UploadResultEntity print_save_mtas_client_apk_file(HttpServletRequest request, @RequestParam String product) {
+        UploadResultEntity jsonResult=new UploadResultEntity();
+        try {
+            String remotePath = "test";
+            String itunsUrl = "";
+            if (StringUtils.isEmpty(remotePath) && StringUtils.isEmpty(itunsUrl))
+            {
+                jsonResult.setStatus(-1);
+                jsonResult.setMessage("参数异常");
+                jsonResult.setFilename("");
+                jsonResult.setDownloadurl("");
+                return jsonResult;
+            }
+            else if (!StringUtils.isEmpty(itunsUrl))
+            {
+                jsonResult.setStatus(1);
+                jsonResult.setMessage("上传成功");
+                jsonResult.setFilename("ios");
+                jsonResult.setDownloadurl(itunsUrl);
+                return jsonResult;
+            }
+            else {
+                CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(request.getSession().getServletContext());
+                if (multipartResolver.isMultipart(request)) {
+                    MultipartHttpServletRequest multipartHttpServletRequest = (MultipartHttpServletRequest) request;
+                    Iterator<String> iterator = multipartHttpServletRequest.getFileNames();
+                    while (iterator.hasNext()) {
+                        MultipartFile file = multipartHttpServletRequest.getFile(iterator.next());
+                        if (file != null) {
+                            String filename = file.getOriginalFilename();
+                            if (StringUtils.isEmpty(filename.trim())) {
+                                continue;
+                            }
+                            FTPConfigurationParameter ftpConfigurationParameter = new FTPConfigurationParameter(ftpConfigurationUtilsPro.getApk_host(), ftpConfigurationUtilsPro.getApk_port(), ftpConfigurationUtilsPro.getApk_username(), ftpConfigurationUtilsPro.getApk_password());
+                            ftpTookitUtils.uploadFile(file.getInputStream(), String.format("%s/%s", remotePath, filename), ftpConfigurationParameter);
+                            jsonResult.setStatus(1);
+                            jsonResult.setMessage("上传成功");
+                            jsonResult.setFilename(filename);
+                            jsonResult.setDownloadurl(String.format("http://localhost/file/down.action?p=%s", remotePath));
+                            return jsonResult;
+                        }
+                    }
+                } else {
+                    jsonResult.setStatus(-1);
+                    jsonResult.setMessage("参数错误");
+                }
+            }
+        } catch (IOException e) {
+            jsonResult.setStatus(-1);
+            jsonResult.setMessage("服务端异常");
+            e.printStackTrace();
+        }
+        return jsonResult;
+    }
+}

+ 344 - 0
src/main/java/com/lightinit/hsdatashow/controller/UserController.java

@@ -0,0 +1,344 @@
+package com.lightinit.hsdatashow.controller;
+
+import com.lightinit.hsdatashow.common.MenuUtils;
+import com.lightinit.hsdatashow.common.RoleModulesUtilsPro;
+import com.lightinit.hsdatashow.entity.*;
+import com.lightinit.hsdatashow.json.pojo.JsonResult;
+import com.lightinit.hsdatashow.json.pojo.ListResult;
+import com.lightinit.hsdatashow.service.IAdminService;
+import com.lightinit.hsdatashow.service.IMenuService;
+import com.lightinit.hsdatashow.service.IRoleService;
+import com.lightinit.hsdatashow.service.IUserModuleService;
+import com.google.code.kaptcha.Constants;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.crypto.SecureRandomNumberGenerator;
+import org.apache.shiro.crypto.hash.Md5Hash;
+import org.apache.shiro.subject.Subject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpSession;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by Mr.Yao on 2017/4/11.
+ */
+@Controller
+@RequestMapping("/user")
+public class UserController {
+    @Autowired
+    private IAdminService adminService;
+    @Autowired
+    private IRoleService roleService;
+    @Autowired
+    private RoleModulesUtilsPro roleModulesUtilsPro;
+    @Autowired
+    private IMenuService menuService;
+    @Autowired
+    private IUserModuleService userModuleService;
+
+    @RequestMapping(value = "view/password.action")
+    public String print_user_modify_password(){
+        return "user/modifypwd";
+    }
+
+    @RequestMapping(value = "view/list.action")
+    public String print_user_list(){
+        return "user/userlist";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/list.action",method = RequestMethod.GET)
+    public ListResult<Admin> print_json_user_list(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int rows){
+        ListResult<Admin> result=new ListResult<Admin>();
+        result.setTotal(adminService.QueryCount(null,""));
+        result.setRows(adminService.QueryList(null,"",page,rows));
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/save.action",method = RequestMethod.POST)
+    public JsonResult print_json_user_add(@RequestParam(defaultValue = "0") long id, @RequestParam String username, @RequestParam String fullname, @RequestParam String password, @RequestParam(defaultValue = "0") int lock){
+        JsonResult jsonResult=new JsonResult();
+        if(StringUtils.isEmpty(username)){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("用户名称不能为空");
+        }else if(StringUtils.isEmpty(fullname)){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("用户全称不能为空");
+        }else if(StringUtils.isEmpty(password)){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("账户密码不能为空");
+        }else if(lock<0){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("账户状态不能为空");
+        }else {
+            boolean success=false;
+            String salt ="";
+            String password_cipherText="";
+            Admin admin=adminService.QueryOne(id);
+            if(id <= 0  || admin==null){
+                if(adminService.IsExits(username)){
+                    jsonResult.setStatus(0);
+                    jsonResult.setMessage("账户已经存在");
+                    return jsonResult;
+                }else {
+                    admin = new Admin();
+                    salt = new SecureRandomNumberGenerator().nextBytes().toHex();
+                    password_cipherText = new Md5Hash(password, username + salt, 3).toHex();
+                    admin.setUsername(username);
+                    admin.setAccountlock(lock);
+                    admin.setPassword(password_cipherText);
+                    admin.setSalt(salt);
+                    admin.setShowname(fullname);
+                    admin.setCreatedAt(new Date());
+                    success = adminService.AddAdmin(admin);
+                }
+            }else if(admin.getUsername().equalsIgnoreCase(username)==false){
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("用户信息错误");
+                return jsonResult;
+            }else{
+                salt = admin.getSalt();
+                password_cipherText= new Md5Hash(password,username+salt,3).toHex();
+                admin.setAccountlock(lock);
+                if(admin.getPassword().equalsIgnoreCase(password)==false && admin.getPassword().equalsIgnoreCase(password_cipherText)==false){
+                    admin.setPassword(password_cipherText);
+                }
+                admin.setShowname(fullname);
+                success =adminService.UpdateAdmin(admin);
+            }
+            jsonResult.setStatus(success?1:0);
+            jsonResult.setMessage(success?"账户添加成功":"账户添加失败");
+        }
+        return jsonResult;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/role/grant.action",method = RequestMethod.POST)
+    public JsonResult print_Grant_User_Role(@RequestParam(defaultValue = "0") long uid,@RequestParam(defaultValue = "") String ids){
+        JsonResult jsonResult=new JsonResult();
+        if(uid>0) {
+            String[]list=ids.split(";");
+            List<Long> idList=new ArrayList<Long>();
+            for (String id:list) {
+                if (StringUtils.isEmpty(id)==false){
+                    idList.add(Long.valueOf(id));
+                }
+            }
+            roleService.SaveUserRoles(uid,idList);
+            jsonResult.setStatus(1);
+            jsonResult.setMessage("授权成功");
+        }else{
+            jsonResult.setStatus(-1);
+            jsonResult.setMessage("参数错误");
+        }
+        return jsonResult;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/lock.action",method = RequestMethod.POST)
+    public JsonResult print_json_user_lock(@RequestParam(defaultValue = "0") long id,@RequestParam(defaultValue = "0") int lock){
+        JsonResult jsonResult=new JsonResult();
+        String errorMsg="";
+        String successMsg="";
+        if(id<=0){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("参数错误");
+        }else {
+            boolean success=false;
+            Admin admin=adminService.QueryOne(id);
+            if(id <= 0  || admin==null){
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("账户已经存在");
+                return jsonResult;
+            }else{
+                if(lock==0){
+                    errorMsg="账户【"+admin.getShowname()+"】解除锁定失败";
+                    successMsg="账户【"+admin.getShowname()+"】已解除锁定";
+                }else if(lock==1){
+                    errorMsg="账户【"+admin.getShowname()+"】锁定失败";
+                    successMsg="账户【"+admin.getShowname()+"】已锁定";
+                }else{
+                    jsonResult.setStatus(0);
+                    jsonResult.setMessage("参数错误");
+                    return jsonResult;
+                }
+                admin.setAccountlock(lock);
+                success =adminService.UpdateAdmin(admin);
+            }
+            jsonResult.setStatus(success?1:0);
+            jsonResult.setMessage(success?successMsg:errorMsg);
+        }
+        return jsonResult;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/user/delete.action",method = RequestMethod.POST)
+    public JsonResult print_delete_user(@RequestParam(defaultValue = "0") long uid){
+        JsonResult jsonResult=new JsonResult();
+        if (uid > 1) {
+            Admin item = adminService.QueryOne(uid);
+            if(item==null){
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("当前用户已不存在");
+            }else if(roleService.CheckUserHasRole(uid)){
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("用户【"+item.getShowname()+"】已经分配角色,请先取消!");
+            }else if(userModuleService.CheckUserHasModules(uid)){
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("用户【"+item.getShowname()+"】已经分配模块,请先取消!");
+            }else {
+              if(adminService.Delete(uid)){
+                  jsonResult.setStatus(1);
+                  jsonResult.setMessage("用户【"+item.getShowname()+"】删除成功");
+              }else{
+                  jsonResult.setStatus(0);
+                  jsonResult.setMessage("用户【"+item.getShowname()+"】删除失败");
+              }
+            }
+        } else {
+            jsonResult.setStatus(-1);
+            jsonResult.setMessage("参数错误");
+        }
+        return jsonResult;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/role/list.action",method = RequestMethod.POST)
+    public List<AdminRole> print_user_roles_list(@RequestParam(defaultValue = "0") long uid){
+        List<AdminRole> result=new ArrayList<AdminRole>();
+        if (uid > 0) {
+            result = roleService.QueryRoleList(uid);
+        }
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/module/list.action",method = RequestMethod.POST)
+    public List<RoleModule> print_user_module_list(@RequestParam(defaultValue = "0") long uid){
+        List<RoleModule> result= roleModulesUtilsPro.UserHasModules(uid);
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(value = "json/menu/list.action",method = RequestMethod.GET)
+    public List<MenuDataEntity> print_Json_Menu_Role(@RequestParam(defaultValue = "0") long uid){
+        List<MenuDataEntity> resultList=new ArrayList<MenuDataEntity>();
+        List<MenuDataEntity> list=new ArrayList<MenuDataEntity>();
+        list.addAll(MenuUtils.InitSystemTopMenu());
+        List<Menu> menuList= menuService.QueryList(1,1000,null);
+        for (Menu item:menuList) {
+            MenuDataEntity _item= MenuUtils.MenuConverter(item,new ArrayList<RoleModule>(),true);
+            if(_item!=null)
+                list.add(_item);
+        }
+        list.addAll(MenuUtils.InitSystemBottomMenu());
+        if(uid>0){
+            List<AdminRole> adminRoleList= roleService.QueryRoleList(uid);
+            List<Long> roleIds=new ArrayList<Long>();
+            for (AdminRole mRrole:adminRoleList) {
+                roleIds.add(mRrole.getId());
+            }
+            List<SentryRole> sentryRole= roleService.QueryManyRole(roleIds);
+            List<Long> roleModules=new ArrayList<Long>();
+            for (SentryRole mSentryRole:sentryRole) {
+               List<Long> _tmpList=roleModulesUtilsPro.RoleHasModules(mSentryRole.getId());
+                for (Long i:_tmpList) {
+                    if(roleModules.contains(i)==false)
+                        roleModules.add(i);
+                }
+            }
+            resultList = MenuUtils.UserRolePermission(list, roleModules);
+        }else{
+            resultList.clear();
+        }
+        return resultList;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/module/grant.action",method = RequestMethod.POST)
+    public JsonResult print_Grant_User_Module(@RequestParam(defaultValue = "0") long uid,@RequestParam(defaultValue = "") String ids){
+        JsonResult jsonResult=new JsonResult();
+        if(uid>0) {
+            String[]list=ids.split(";");
+            List<Long> idList=new ArrayList<Long>();
+            for (String id:list) {
+                if (StringUtils.isEmpty(id)==false){
+                    idList.add(Long.valueOf(id));
+                }
+            }
+            userModuleService.SaveUserModule(uid,idList);
+            jsonResult.setStatus(1);
+            jsonResult.setMessage("授权成功");
+        }else{
+            jsonResult.setStatus(-1);
+            jsonResult.setMessage("参数错误");
+        }
+        return jsonResult;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "json/password/modify.action",method = RequestMethod.POST)
+    public JsonResult print_json_user_password_modify(HttpSession session, @RequestParam(defaultValue = "") String id, @RequestParam(defaultValue = "") String password, @RequestParam(defaultValue = "") String newpsw, @RequestParam(defaultValue = "") String captcha){
+        JsonResult jsonResult=new JsonResult();
+        String capText=session.getAttribute(Constants.KAPTCHA_SESSION_KEY)!=null?session.getAttribute(Constants.KAPTCHA_SESSION_KEY).toString():"";
+        if(StringUtils.isEmpty(capText) || StringUtils.isEmpty(captcha)){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("验证码错误");
+        }else if (capText.equalsIgnoreCase(captcha)==false){
+            jsonResult.setStatus(0);
+            jsonResult.setMessage("验证码错误");
+        }else {
+            if (StringUtils.isEmpty(id)) {
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("用户不存在");
+            } else if (StringUtils.isEmpty(password)) {
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("原始密码不能为空");
+            } else if (StringUtils.isEmpty(newpsw)) {
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("新密码不能为空");
+            } else if (newpsw.equalsIgnoreCase(password)) {
+                jsonResult.setStatus(0);
+                jsonResult.setMessage("新密码不能与原始密码一样");
+            } else {
+                boolean success = false;
+                String salt = "";
+                Admin admin = adminService.SelectOne(id);
+                if (admin == null) {
+                    jsonResult.setStatus(0);
+                    jsonResult.setMessage("账户不存在");
+                    return jsonResult;
+                } else {
+                    salt = admin.getSalt();
+                    String password_cipherText = new Md5Hash(password, admin.getUsername() + salt, 3).toHex();
+                    if (admin.getPassword().equalsIgnoreCase(password_cipherText) == false) {
+                        jsonResult.setStatus(0);
+                        jsonResult.setMessage("原始密码错误");
+                        return jsonResult;
+                    }
+                    String password_cipherText_new = new Md5Hash(newpsw, admin.getUsername() + salt, 3).toHex();
+                    admin.setPassword(password_cipherText_new);
+                    success = adminService.UpdateAdmin(admin);
+                    if(success){
+                        Subject currentUser = SecurityUtils.getSubject();
+                        try {
+                            currentUser.logout();
+                        } catch (Exception e) {
+
+                        }
+                    }
+                }
+                jsonResult.setStatus(success ? 1 : 0);
+                jsonResult.setMessage(success ? "密码修改成功,请重新登录" : "密码修改失败");
+            }
+        }
+        return jsonResult;
+    }
+}

+ 97 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/AccountController.java

@@ -0,0 +1,97 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.json.pojo.ErrorEntity;
+import com.lightinit.hsdatashow.json.pojo.LoginResult;
+import com.lightinit.hsdatashow.model.admin.LoginUser;
+import com.lightinit.hsdatashow.service.admin.IAccountService;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.*;
+import org.apache.shiro.subject.Subject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+/**
+ * Created by WangYao on 2018/5/21.
+ */
+@Controller("adminAccountController")
+@RequestMapping("/admin/account")
+public class AccountController {
+
+    @Autowired
+    private IAccountService accountService;
+
+    @RequestMapping(value = {"login.htm", "login"},method = RequestMethod.GET)
+    public String printMain(ModelMap modelMap) {
+        return "admin/account/login";
+    }
+
+    @ResponseBody
+    @RequestMapping(method = RequestMethod.POST,value = "login.action")
+    public LoginResult printLoginAction(ModelMap model,HttpSession session, @RequestParam String username,@RequestParam String password){
+        LoginResult result = new LoginResult();
+        UsernamePasswordToken token = new UsernamePasswordToken(username, password);
+        Subject currentUser = SecurityUtils.getSubject();
+        //token.setRememberMe(true);
+        try {
+            //在调用了login方法后,SecurityManager会收到AuthenticationToken,并将其发送给已配置的Realm执行必须的认证检查
+            currentUser.login(token);
+            if (currentUser.isAuthenticated()) {
+                session.setAttribute("userinfo", username);
+                session.setAttribute(LoginUser.SESSION_KEY_LOGIN_USER, accountService.getLoginUserByUsername(username));
+                result.setStatus(2001);
+            } else {
+                token.clear();
+            }
+        } catch (UnknownAccountException uae) {
+            result.setStatus(2003);
+            token.clear();
+        } catch (IncorrectCredentialsException ice) {
+            result.setStatus(2004);
+            token.clear();
+        } catch (LockedAccountException lae) {
+            result.setStatus(2005);
+            token.clear();
+        } catch (ExcessiveAttemptsException eae) {
+            result.setStatus(2006);
+            token.clear();
+        } catch (AuthenticationException ae) {
+            //通过处理Shiro的运行时AuthenticationException就可以控制用户登录失败或密码错误时的情景
+            result.setStatus(2007);
+        }
+        result.setMessage(ErrorEntity.getMsg(result.getStatus()));
+        return result;
+    }
+    @ResponseBody
+    @RequestMapping(method = RequestMethod.POST,value = "logout.action")
+    public ModelAndView logout(ModelMap model,HttpSession session){
+        Subject currentUser = SecurityUtils.getSubject();
+        try {
+            currentUser.logout();
+        } catch (Exception e) {
+        }
+        return new ModelAndView("redirect:/admin/");
+    }
+
+    @ResponseBody
+    @RequestMapping(method = RequestMethod.GET,value = "auth.action")
+    public ModelAndView printAuthAction(ModelMap model, HttpServletRequest request, HttpServletResponse response,@CookieValue(defaultValue = "") String username){
+        try {
+           if(StringUtils.isEmpty(username)){
+               response.setStatus(401);
+           }else{
+               response.setStatus(200);
+           }
+        } catch (Exception e) {
+            response.setStatus(401);
+        }
+        return null;
+    }
+}

+ 100 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/AtmosphereController.java

@@ -0,0 +1,100 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.dictionary.DicViewMenuTitle;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.*;
+import com.lightinit.hsdatashow.service.admin.IAtmosphereService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.Map;
+
+@Controller
+@RequestMapping(value = "/admin/atmosphere")
+public class AtmosphereController {
+
+    @Autowired
+    private IAtmosphereService atmosphereService ;
+
+    @RequestMapping("/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/atmosphere/index") ;
+        modelAndView.addObject("title", DicViewMenuTitle.ATMOSPHERE) ;
+        return modelAndView ;
+    }
+
+    //空气质量指数
+    @RequestMapping("/getAtmosphereIndex.action")
+    @ResponseBody
+    public AtmosphereNameAndValueModel getAtmosphereIndex(){
+        AtmosphereNameAndValueModel atmosphereNameAndValueModel = atmosphereService.getAtmosphereIndex() ;
+        return atmosphereNameAndValueModel ;
+    }
+
+
+    //全年空气质量状况
+    @RequestMapping("/getAtmosphereYear.action")
+    @ResponseBody
+    public AtmosphereYearResultModel getAtmosphereYear(){
+        AtmosphereYearResultModel atmosphereYearResultModel = atmosphereService.getAtmosphereYear() ;
+        return atmosphereYearResultModel ;
+    }
+
+    //机动车尾气排放情况
+    @RequestMapping("/getAtmosphereEmission.action")
+    @ResponseBody
+    public AtmosphereEmissionResultModel getAtmosphereEmission(){
+        AtmosphereEmissionResultModel atmosphereEmissionResultModel = atmosphereService.getAtmosphereEmission() ;
+        return atmosphereEmissionResultModel ;
+    }
+
+    //城市气化率
+    @RequestMapping("/getAtmosphereGasification.action")
+    @ResponseBody
+    public AtmosphereGasificationResultModel getAtmosphereGasification(){
+        AtmosphereGasificationResultModel atmosphereGasificationResultModel = atmosphereService.getAtmosphereGasification() ;
+        return atmosphereGasificationResultModel ;
+    }
+
+    //重点污染源工业废气排放
+    @RequestMapping("/getAtmosphereIndustry.action")
+    @ResponseBody
+    public AtmosphereIndustryResultModel getAtmosphereIndustry(){
+        AtmosphereIndustryResultModel atmosphereGasificationResultModel = atmosphereService.getAtmosphereIndustry() ;
+        return atmosphereGasificationResultModel ;
+    }
+
+    ////////////////////////衡水市空气质量日变化折线图 和 河北省空气质量日变化折线图////////////////////////////////////////////////////////
+    @RequestMapping("/newairquality.htm")       //这是华丽的新页面
+    public ModelAndView newairquality(){
+        ModelAndView modelAndView = new ModelAndView("admin/atmosphere/new_air_quality") ;
+        modelAndView.addObject("title", DicViewMenuTitle.ATMOSPHERE) ;
+        return modelAndView ;
+    }
+
+    @RequestMapping("/airquality.htm")
+    public ModelAndView airquality(){
+        ModelAndView modelAndView = new ModelAndView("admin/atmosphere/air_quality") ;
+        return modelAndView ;
+    }
+    @RequestMapping("/getHBCityAirQualityIndex.action")
+    @ResponseBody
+    public Map<String,Object> getHBCityAirQualityIndex(){
+        return atmosphereService.getHBCityAirQualityIndex();
+    }
+
+    @RequestMapping("/getHSAreaAirPollutionIndex.action")
+    @ResponseBody
+    public Map<String,Object> getHSAreaAirPollutionIndex(){
+        return atmosphereService.getHSAreaAirPollutionIndex();
+    }
+
+    @RequestMapping("/getHbAreaAirFineCount.action")
+    @ResponseBody
+    public ResultState getHbAreaAirFineCount(){
+        return atmosphereService.getHbAreaAirFineCount();
+    }
+}

+ 62 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/BaseController.java

@@ -0,0 +1,62 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.annotation.FieldDescriberHelper;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.ResultStateCode;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.FieldError;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @author WangYao
+ * @date 2018/6/2 11:33
+ * @description 控制器基类
+ */
+public class BaseController {
+
+    public static <T> LinkedHashMap<String, String> getAllFieldInvalidMsg(T modelObj, BindingResult bindingResult){
+        if (modelObj == null || bindingResult == null){
+            return null;
+        }
+        LinkedHashMap<String, String> result = new LinkedHashMap<>();
+        for (FieldError error : bindingResult.getFieldErrors()){
+            String fieldName = error.getField();
+            String fieldDescription = FieldDescriberHelper.getFieldDescription(modelObj, fieldName);
+            result.put(fieldName, fieldDescription + error.getDefaultMessage());
+        }
+
+        return result;
+    }
+
+    public static <T> Map.Entry<String, String> getFirstFieldInvalidMsg(T modelObj, BindingResult bindingResult){
+        LinkedHashMap<String, String> allFieldInvalidMsg = getAllFieldInvalidMsg(modelObj, bindingResult);
+        return allFieldInvalidMsg == null ? null : allFieldInvalidMsg.entrySet().stream().findFirst().get();
+    }
+
+    public static ResultState buildInvalidResultState(String message){
+        return buildInvalidResultState(message, null);
+    }
+
+    public static <T> ResultState<T> buildInvalidResultState(int stateCode, String message){
+        return buildInvalidResultState(stateCode, message, null);
+    }
+
+    public static <T> ResultState<T> buildInvalidResultState(String message, T data){
+        return buildInvalidResultState(ResultStateCode.INVALID_DATA, message, data);
+    }
+
+    public static <T> ResultState<T> buildInvalidResultState(int stateCode, String message, T data){
+        return new ResultState(stateCode, message, data);
+    }
+
+    public static <T> ResultState<LinkedHashMap<String, String>> getAllFieldInvalidResultState(T modelObj, BindingResult bindingResult){
+        return buildInvalidResultState("", getAllFieldInvalidMsg(modelObj, bindingResult));
+    }
+
+    public static <T> ResultState getFirstInvalidResultState(T modelObj, BindingResult bindingResult){
+        Map.Entry<String, String> firstFieldInvalidMsg = getFirstFieldInvalidMsg(modelObj, bindingResult);
+        return buildInvalidResultState(firstFieldInvalidMsg == null ? "" : firstFieldInvalidMsg.getValue());
+    }
+}

+ 90 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/BuildingController.java

@@ -0,0 +1,90 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.dictionary.DicCategoryIndex;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.service.admin.IBuildingService;
+import com.lightinit.hsdatashow.service.admin.ICockpitService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.ArrayList;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/8/14 15:01
+ * @Description:
+ **/
+@Controller
+@RequestMapping(value = "/admin/building")
+public class BuildingController {
+
+
+    @Autowired
+    private IBuildingService buildingService;
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/building/index");
+        return modelAndView;
+    }
+
+
+      /*
+      *@Description 项目分布
+      *@Param
+      *@Date 2018/12/8
+      *@return
+      **/
+    @RequestMapping(value = "project.action")
+    @ResponseBody
+    public ResultState getProjec(){
+        return buildingService.getProjec();
+    }
+    /*
+      *@Description 项目进展分析
+      *@Param
+      *@Date 2018/12/8
+      *@return
+      **/
+    @RequestMapping(value = "projectanalysis.action")
+    @ResponseBody
+    public ResultState getProjectAnalyse(){
+        return buildingService.getProjectAnalysis();
+    }
+    /*
+      *@Description 项目类型
+      *@Param
+      *@Date 2018/12/8
+      *@return
+      **/
+    @RequestMapping(value = "projectType.action")
+    @ResponseBody
+    public ResultState getProjectType(){
+        return buildingService.getProjectType();
+    }
+    /*
+      *@Description 投资项目统计
+      *@Param
+      *@Date 2018/12/8
+      *@return
+      **/
+    @RequestMapping(value = "projectStatistics.action")
+    @ResponseBody
+    public ResultState getProjectStatistics(){
+        return buildingService.getProjectStatistics();
+    }
+    /*
+      *@Description 项目事故分析
+      *@Param
+      *@Date 2018/12/8
+      *@return
+      **/
+    @RequestMapping(value = "projectAccidentAnalyse.action")
+    @ResponseBody
+    public ResultState getProjectAccidentAnalyser(){
+        return buildingService.getProjectAccidentAnalyser();
+    }
+
+}

+ 43 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/CockpitController.java

@@ -0,0 +1,43 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.dictionary.DicCategoryIndex;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.service.admin.ICockpitService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.ArrayList;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/8/14 15:01
+ * @Description:
+ **/
+@Controller
+@RequestMapping(value = "/admin/cockpit")
+public class CockpitController {
+
+    @Autowired
+    private ICockpitService cockpitService;
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/cockpit/index");
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "index.action")
+    @ResponseBody
+    public ResultState getIndex(){
+        ArrayList<String> findIndexes = new ArrayList<>();
+        for(String s: DicCategoryIndex.getInstacne().getDicMap().keySet()){
+            if(DicCategoryIndex.RESIDENTSERVICEINDEX.equals(s)||DicCategoryIndex.SOCIETYSECURITYINDEX.equals(s)){
+                continue;
+            }
+            findIndexes.add(s);
+        }
+        return cockpitService.getIndex(findIndexes);
+    }
+}

+ 46 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/CommonController.java

@@ -0,0 +1,46 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.common.RoleModulesUtilsPro;
+import com.lightinit.hsdatashow.entity.SentryRole;
+import com.lightinit.hsdatashow.model.admin.*;
+import com.lightinit.hsdatashow.service.IRoleService;
+import com.lightinit.hsdatashow.service.admin.ICommonService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 通用
+ */
+@Controller
+@RequestMapping("/admin/common")
+public class CommonController {
+
+    @Autowired
+    private ICommonService commonService;
+    @Autowired
+    private IRoleService roleService;
+    @Autowired
+    private RoleModulesUtilsPro roleModulesUtilsPro;
+
+    @RequestMapping(value = "role_tree_data.action")
+    @ResponseBody
+    public List<TreeModel> getRoleTreeData(Long selectedId){
+        return commonService.queryRoleTreeData(selectedId);
+    }
+
+    @RequestMapping(value = "module_tree_data.action")
+    @ResponseBody
+//    public List<TreeModel> getModuleTreeData(@RequestParam(required = false, value = "selectedIds[]") Long[] selectedIds, @RequestParam Long roleId){
+    public List<TreeModel> getModuleTreeData(@RequestBody RoleMgrModuleDataModel inputModel){
+        List<Long> moduleIds = null;
+        SentryRole sentryRole= roleService.QueryOne(inputModel.getRoleId());
+        if(sentryRole.getParentid() != null && sentryRole.getParentid() > 0) {
+            moduleIds = roleModulesUtilsPro.RoleHasModules(sentryRole.getParentid());
+        }
+        return commonService.queryModuleTreeData(moduleIds, inputModel.getSelectedModuleIds(), inputModel.getSelectedActionIds());
+    }
+
+}

+ 90 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/CommunicationController.java

@@ -0,0 +1,90 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.ChartModel;
+import com.lightinit.hsdatashow.service.admin.ICommunicationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/7/26 18:17
+ * @Description:
+ **/
+@Controller
+@RequestMapping(value = "/admin/commu")
+public class CommunicationController {
+
+    @Autowired
+    private ICommunicationService communicationService;
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/communication/index");
+        return modelAndView;
+    }
+
+    /*@Description 视频监控
+    *@Param
+    *@Date 2018/8/7
+    *@return
+    */
+    @RequestMapping(value = "videomonitor.action")
+    @ResponseBody
+    public ResultState getVideoMonitor(){
+        return communicationService.getVideoMonitor();
+    }
+
+    /*@Description 电视和wifi开通情况
+    *@Param
+    *@Date 2018/8/7
+    *@return
+    */
+    @RequestMapping(value = "tvandwifi.action")
+    @ResponseBody
+    public ResultState getTVAndWifi(){
+        return communicationService.getTVAndWifi();
+    }
+
+    /*
+    *@Description 通信故障
+    *@Param 
+    *@Date 2018/8/8
+    *@return 
+    **/
+    @RequestMapping(value = "areacommbreak.action")
+    @ResponseBody
+    public ResultState getAreaCommBreak(){
+        return communicationService.getAreaCommBreak();
+    }
+
+
+    /*
+    *@Description   故障占比
+    *@Param
+    *@Date 2018/8/8
+    *@return
+    **/
+    @RequestMapping(value = "areacommbreakprop.action")
+    @ResponseBody
+    public ResultState getAreaCommBreakProp(){
+        return communicationService.getAreaCommBreakProp();
+    }
+
+    /*@Description 光纤长度
+     *@Param
+     *@Date 2018/8/7
+     *@return
+     */
+    @RequestMapping(value = "fiber.action")
+    @ResponseBody
+    public ResultState getFiber(){
+        return communicationService.getFiber();
+    }
+
+}

+ 72 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/CountrysideController.java

@@ -0,0 +1,72 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.CountrysideNameAndValue;
+import com.lightinit.hsdatashow.service.admin.ICountrysideService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping(value = "/admin/countryside")
+public class CountrysideController {
+
+    @Autowired
+    private ICountrysideService countrysideService ;
+
+    @RequestMapping("/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/countryside/index") ;
+        return modelAndView ;
+    }
+
+
+    //农村自来水普及率
+    @RequestMapping("/getCountrysideWater.action")
+    @ResponseBody
+    public CountrysideNameAndValue getCountrysideWater(){
+        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideWater() ;
+        return countrysideNameAndValue ;
+    }
+
+    //农村无害化厕所普及率
+    @RequestMapping("/getCountrysideWc.action")
+    @ResponseBody
+    public CountrysideNameAndValue getCountrysideWc(){
+        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideWc() ;
+        return countrysideNameAndValue ;
+    }
+
+    //农村生活污水处理率
+    @RequestMapping("/getCountrysideSewage.action")
+    @ResponseBody
+    public CountrysideNameAndValue getCountrysideSewage(){
+        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideSewage() ;
+        return countrysideNameAndValue ;
+    }
+
+    //农村生活垃圾无害化处理率
+    @RequestMapping("/getCountrysideGarbage.action")
+    @ResponseBody
+    public CountrysideNameAndValue getCountrysideGarbage(){
+        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideGarbage() ;
+        return countrysideNameAndValue ;
+    }
+
+    //农村生活污水排名
+    @RequestMapping("/getCountrysideSewageRanking.action")
+    @ResponseBody
+    public CountrysideNameAndValue getCountrysideSewageRanking(){
+        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideSewageRanking() ;
+        return countrysideNameAndValue ;
+    }
+
+    //农村生活垃圾无害化排名
+    @RequestMapping("/getCountrysideGarbageRanking.action")
+    @ResponseBody
+    public CountrysideNameAndValue getCountrysideGarbageRanking(){
+        CountrysideNameAndValue countrysideNameAndValue = countrysideService.getCountrysideGarbageRanking() ;
+        return countrysideNameAndValue ;
+    }
+}

+ 21 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/DemoController.java

@@ -0,0 +1,21 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @author WangYao
+ * @date 2018/10/25 13:59
+ * @description 示例控制器
+ */
+@Controller
+@RequestMapping(value = "/admin/demo")
+public class DemoController extends BaseController {
+
+    @RequestMapping(value = {"/", "/index.htm"})
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/demo/index");
+        return modelAndView;
+    }
+}

+ 55 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/EcologicalCivilizationControllerr.java

@@ -0,0 +1,55 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.EnvironmentalQuality;
+import com.lightinit.hsdatashow.mapper.ConsumeMapper;
+import com.lightinit.hsdatashow.mapper.ConsumptionMapper;
+import com.lightinit.hsdatashow.model.admin.ConsumeListModel;
+import com.lightinit.hsdatashow.model.admin.CulturalFalitiesListModel;
+import com.lightinit.hsdatashow.model.admin.EnvironmentalGovernanceGdpListModel;
+import com.lightinit.hsdatashow.model.admin.SpreadListModel;
+import com.lightinit.hsdatashow.service.admin.IEcologicalCivilizationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/EcologicalCivilization")
+public class EcologicalCivilizationControllerr {
+    @Autowired
+    private IEcologicalCivilizationService ecologicalCivilizationService;
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/ecologicalCivilization/index") ;
+        return modelAndView ;
+    }
+    @RequestMapping(value = "/getConsume.action")
+    @ResponseBody
+    public ConsumeListModel getConsume() {
+        ConsumeListModel model = ecologicalCivilizationService.getConsume();
+        return model;
+    }
+
+    @RequestMapping(value = "/getEnvironmentalQuality.action")
+    @ResponseBody
+    public List<EnvironmentalQuality> getEnvironmentalQuality() {
+        List<EnvironmentalQuality> model = ecologicalCivilizationService.getEnvironmentalQuality();
+        return model;
+    }
+
+    @RequestMapping(value = "/getEnvironmentalGovernanceGdp.action")
+    @ResponseBody
+    public EnvironmentalGovernanceGdpListModel getEnvironmentalGovernanceGdp() {
+        EnvironmentalGovernanceGdpListModel model = ecologicalCivilizationService.getEnvironmentalGovernanceGdp();
+        return model;
+    }
+    @RequestMapping(value = "/getDealWithTheStandard.action")
+    @ResponseBody
+    public SpreadListModel getDealWithTheStandard() {
+        SpreadListModel model = ecologicalCivilizationService.getDealWithTheStandard();
+        return model;
+    }
+}

+ 59 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/EconomicDevelopmentController.java

@@ -0,0 +1,59 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.GdpOccupationRatio;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.AgeStructureNameAndValueModel;
+import com.lightinit.hsdatashow.model.admin.EconomicDevelopmentListModel;
+import com.lightinit.hsdatashow.model.admin.GroupNameAndValueModel;
+import com.lightinit.hsdatashow.model.admin.PerCapitaGdpListModel;
+import com.lightinit.hsdatashow.service.admin.IEconomicDevelopmentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/EconomicDevelopment")
+public class EconomicDevelopmentController {
+    @Autowired
+    private IEconomicDevelopmentService economicDevelopmentService;
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/economicDevelopment/index") ;
+        return modelAndView ;
+    }
+    @RequestMapping(value = "/getGDP.action")
+    @ResponseBody
+    public PerCapitaGdpListModel getGDP(){
+        PerCapitaGdpListModel model = economicDevelopmentService.getGDP();
+        return model;
+    }
+    @RequestMapping(value = "/getPerCapitaGdp.action")
+    @ResponseBody
+    public PerCapitaGdpListModel getPerCapitaGdp(){
+        PerCapitaGdpListModel model = economicDevelopmentService.getPerCapitaGdp();
+        return model;
+    }
+    @RequestMapping(value = "/getGdpOccupationRatio.action")
+    @ResponseBody
+    public ResultState getGdpOccupationRatio(){
+        ResultState model = economicDevelopmentService.getGdpOccupationRatio();
+        return model;
+    }
+
+    @RequestMapping(value = "/getLaborProduction.action")
+    @ResponseBody
+    public PerCapitaGdpListModel getLaborProduction(){
+        PerCapitaGdpListModel model = economicDevelopmentService.getLaborProduction();
+        return model;
+    }
+    @RequestMapping(value = "/getUrbanization.action")
+    @ResponseBody
+    public PerCapitaGdpListModel getUrbanization(){
+        PerCapitaGdpListModel model = economicDevelopmentService.getUrbanization();
+        return model;
+    }
+}

+ 144 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/EducationController.java

@@ -0,0 +1,144 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.EducationOrganizationResultModel;
+import com.lightinit.hsdatashow.service.admin.IEducationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/education")
+public class EducationController {
+
+    @Autowired
+    private IEducationService educationService ;
+
+    /**
+     * 教育机构
+     * @return
+     */
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/education/index") ;
+
+        return modelAndView ;
+    }
+
+    /**
+     * 教育机构
+     * @return
+     */
+    @RequestMapping(value = "getEducationOrganization.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getEducationOrganization(String categoryName,String name){
+        return educationService.getEducationOrganization(categoryName,name) ;
+    }
+
+    /**
+     * 医疗机构
+     * @return
+     */
+    @RequestMapping(value = "/medicalIndex.htm")
+    public ModelAndView medicalIndex(){
+        ModelAndView modelAndView = new ModelAndView("admin/education/medicalIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 医疗机构
+     * @return
+     */
+    @RequestMapping(value = "getMedicalOrganization.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getMedicalOrganization(String categoryName,String name){
+        return educationService.getEducationOrganization(categoryName,name) ;
+    }
+
+    /**
+     * 商业综合
+     * @return
+     */
+    @RequestMapping(value = "/businessIndex.htm")
+    public ModelAndView businessIndex(){
+        ModelAndView modelAndView = new ModelAndView("admin/education/businessIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 商业综合
+     * @return
+     */
+    @RequestMapping(value = "getBusinessOrganization.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getBusinessOrganization(String categoryName,String name){
+        return educationService.getEducationOrganization(categoryName,name) ;
+    }
+
+    /**
+     * 政府机构
+     * @return
+     */
+    @RequestMapping(value = "/governmentIndex.htm")
+    public ModelAndView governmentIndex
+    (){
+        ModelAndView modelAndView = new ModelAndView("admin/education/governmentIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 政府机构
+     * @return
+     */
+    @RequestMapping(value = "getGovernmentOrganization.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getGovernmentOrganization(String categoryName,String name){
+        return educationService.getEducationOrganization(categoryName,name) ;
+    }
+
+    /**
+     * 交通枢纽
+     * @return
+     */
+    @RequestMapping(value = "/trafficIndex.htm")
+    public ModelAndView trafficIndex(){
+        ModelAndView modelAndView = new ModelAndView("admin/education/trafficIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 交通枢纽
+     * @return
+     */
+    @RequestMapping(value = "getTrafficOrganization.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getTrafficOrganization(String categoryName,String name){
+        return educationService.getEducationOrganization(categoryName,name) ;
+    }
+
+    /**
+     * 交通服务
+     * @return
+     */
+    @RequestMapping(value = "/trafficServiceIndex.htm")
+    public ModelAndView trafficServiceIndex(){
+        ModelAndView modelAndView = new ModelAndView("admin/education/trafficServiceIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 交通服务
+     * @return
+     */
+    @RequestMapping(value = "getTrafficServiceOrganization.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getTrafficServiceOrganization(String categoryName,String name){
+        return educationService.getEducationOrganization(categoryName,name) ;
+    }
+
+
+
+}

+ 106 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/EnergyController.java

@@ -0,0 +1,106 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.ChartModel;
+import com.lightinit.hsdatashow.service.admin.IEnergyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/7/26 13:57
+ * @Description: 能源运行
+ **/
+@Controller
+@RequestMapping(value = "/admin/energy")
+public class EnergyController {
+
+    @Autowired
+    private IEnergyService energyService;
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/energy1/index");
+        return modelAndView;
+    }
+
+    /*
+    *@Description  能源消耗总量分析
+    *@Param
+    *@Date 2018/8/6
+    *@return 
+    **/
+    @RequestMapping(value = "engeryTotal.action")
+    @ResponseBody
+    public ResultState getEngeryTotal(){
+        return energyService.getEngeryTotal();
+    }
+
+    /*
+    *@Description 能源消耗占比分析
+    *@Param
+    *@Date 2018/8/6
+    *@return
+    **/
+    @RequestMapping(value = "engeryScale.action")
+    @ResponseBody
+    public ResultState getEngeryScale(){
+        return energyService.getEngeryScale();
+    }
+
+    /*
+    *@Description 污染、清洁能源比重分析
+    *@Param
+    *@Date 2018/8/6
+    *@return
+    **/
+    @RequestMapping(value = "cleanAndpollute.action")
+    @ResponseBody
+    public ResultState getCleanAndpollute(){
+        return energyService.getCleanAndpollute();
+    }
+
+    /*
+    *@Description 新能源基础设施
+    *@Param
+    *@Date 2018/8/6
+    *@return
+    **/
+    @RequestMapping(value = "newenergyinfrastructure.action")
+    @ResponseBody
+    public ResultState getNewenergyInfrastructure(){
+        return energyService.getNewenergyInfrastructure();
+    }
+    
+    /*
+    *@Description 原煤消耗分析
+    *@Param 
+    *@Date 2018/8/7
+    *@return 
+    **/
+    @RequestMapping(value = "coalconsume.action")
+    @ResponseBody
+    public ResultState getCoalconsume(){
+        return energyService.getCoalconsume();
+    }
+
+    /*
+    *@Description 电力消耗对比分析
+    *@Param
+    *@Date 2018/8/7
+    *@return
+    **/
+    @RequestMapping(value = "electricconsume.action")
+    @ResponseBody
+    public ResultState getElectricConsume(){
+        return energyService.getElectricConsume();
+    }
+}

+ 107 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/FacilitiesController.java

@@ -0,0 +1,107 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.EducationOrganizationResultModel;
+import com.lightinit.hsdatashow.model.admin.FacilitiesResultModel;
+import com.lightinit.hsdatashow.service.admin.IFacilitiesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/facilities")
+public class FacilitiesController {
+
+    @Autowired
+    private IFacilitiesService facilitiesService ;
+
+
+    /**
+     * 环卫设施
+     * @return
+     */
+    @RequestMapping(value = "/sanitationIndex.htm")
+    public ModelAndView sanitationIndex(){
+        ModelAndView modelAndView = new ModelAndView("admin/facilities/sanitationIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 环卫设施
+     * @return
+     */
+    @RequestMapping(value = "getSanitation.action")
+    @ResponseBody
+    public List<FacilitiesResultModel> getSanitation(String categoryName){
+        return facilitiesService.getFacility(categoryName) ;
+    }
+
+    /**
+     * 监控设施
+     * @return
+     */
+    @RequestMapping(value = "/monitorIndex.htm")
+    public ModelAndView monitorIndex(){
+        ModelAndView modelAndView = new ModelAndView("admin/facilities/monitorIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 监控设施
+     * @return
+     */
+    @RequestMapping(value = "getMonitor.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getMonitor(String categoryName, String name){
+        return facilitiesService.getMonitor(categoryName,name) ;
+    }
+
+    /**
+     * 公共设施
+     * @return
+     */
+    @RequestMapping(value = "/publishIndex.htm")
+    public ModelAndView publishIndex(){
+        ModelAndView modelAndView = new ModelAndView("admin/facilities/publishIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 公共设施
+     * @return
+     */
+    @RequestMapping(value = "getPublish.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getPublish(String categoryName, String name){
+        return facilitiesService.getMonitor(categoryName,name) ;
+    }
+//    public ResultState getCommunal(){
+//        return facilitiesService.getCommunal();
+//
+//    }
+
+
+    /**
+     * 路政设施
+     * @return
+     */
+    @RequestMapping(value = "/readIndex.htm")
+    public ModelAndView governmentIndex
+    (){
+        ModelAndView modelAndView = new ModelAndView("admin/facilities/readIndex") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 路政设施
+     * @return
+     */
+    @RequestMapping(value = "getRead.action")
+    @ResponseBody
+    public List<FacilitiesResultModel> getRead(String categoryName){
+        return facilitiesService.getFacility(categoryName) ;
+    }
+}

+ 44 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/GarbageCanController.java

@@ -0,0 +1,44 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.GarbageCan;
+import com.lightinit.hsdatashow.model.admin.GarbageCanModel;
+import com.lightinit.hsdatashow.model.admin.GroupNameAndValueModel;
+import com.lightinit.hsdatashow.service.admin.IGarbageCanService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/GarbageCan")
+public class GarbageCanController {
+    @Autowired
+    private IGarbageCanService iGarbageCanService;
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/garbageCan/index") ;
+        return modelAndView ;
+    }
+    @RequestMapping(value = "getGarbageCan.action")
+    @ResponseBody
+    public  List<GarbageCan> getGarbageCan(){
+        return iGarbageCanService.getGarbageCan() ;
+    }
+
+    @RequestMapping(value = "getGarbageCan2.action")
+    @ResponseBody
+    public GroupNameAndValueModel getGarbageCan2(String name,Integer falg){
+        return iGarbageCanService.getGarbageCan2(name,falg) ;
+    }
+
+    @RequestMapping(value = "getGarbageCanList.action")
+    @ResponseBody
+    public List<GarbageCanModel> getGarbageCanList(){
+        List<GarbageCanModel> list = iGarbageCanService.getGarbageCanList();
+        return  list;
+    }
+
+}

+ 62 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/GarbageController.java

@@ -0,0 +1,62 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.GarbageTreatment;
+import com.lightinit.hsdatashow.model.admin.GarbageNameAndValueModel;
+import com.lightinit.hsdatashow.model.admin.GarbageRegionResultModel;
+import com.lightinit.hsdatashow.model.admin.GarbageTrendResultModel;
+import com.lightinit.hsdatashow.model.admin.GarbagedangerTrendResultModel;
+import com.lightinit.hsdatashow.service.admin.IGarbageServer;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.math.BigDecimal;
+
+@Controller
+@RequestMapping(value = "/admin/garbage")
+public class GarbageController {
+
+    @Autowired
+    private IGarbageServer garbageServer ;
+
+    @RequestMapping("/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/garbage/index") ;
+        return modelAndView ;
+    }
+
+    @RequestMapping("/getGarbageTreatment.action")
+    @ResponseBody
+    public GarbageNameAndValueModel getGarbageTreatment(){
+        GarbageTreatment garbageTreatment = garbageServer.getGarbageTreatment() ;
+        GarbageNameAndValueModel garbageNameAndValueModel = new GarbageNameAndValueModel("最新处理率",garbageTreatment.getTreatmentRate()) ;
+        return garbageNameAndValueModel ;
+    }
+
+    @RequestMapping("/getGarbageRegion.action")
+    @ResponseBody
+    public GarbageRegionResultModel getGarbageRegion(){
+        return garbageServer.getGarbageRegion() ;
+    }
+
+    @RequestMapping("/getGarbagedangerRegion.action")
+    @ResponseBody
+    public BigDecimal getGarbagedangerRegion(){
+        return garbageServer.getGarbagedangerRegion() ;
+    }
+
+    @RequestMapping("/getGarbageTrend.action")
+    @ResponseBody
+    public GarbageTrendResultModel getGarbageTrend(){
+        return garbageServer.getGarbageTrend() ;
+    }
+
+    @RequestMapping("/getGarbagedangerTrend.action")
+    @ResponseBody
+    public GarbagedangerTrendResultModel getGarbagedangerTrend(){
+        return garbageServer.getGarbagedangerTrend() ;
+    }
+
+}

+ 44 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/GreenController.java

@@ -0,0 +1,44 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.GreenNameAndValueModel;
+import com.lightinit.hsdatashow.service.admin.IGreenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping(value = "/admin/green")
+public class GreenController {
+
+    @Autowired
+    private IGreenService greenService ;
+
+    @RequestMapping("/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/green/index") ;
+        return modelAndView ;
+    }
+
+    @RequestMapping("/getGreenCity.action")
+    @ResponseBody
+    public GreenNameAndValueModel getGreenCity(){
+        GreenNameAndValueModel greenNameAndValueModel = greenService.getGreenCity() ;
+        return greenNameAndValueModel ;
+    }
+
+    @RequestMapping("/getGreenForest.action")
+    @ResponseBody
+    public GreenNameAndValueModel getGreenForest(){
+        GreenNameAndValueModel greenNameAndValueModel = greenService.getGreenForest() ;
+        return greenNameAndValueModel ;
+    }
+
+    @RequestMapping("/getGreenBuild.action")
+    @ResponseBody
+    public GreenNameAndValueModel getGreenBuild(){
+        GreenNameAndValueModel greenNameAndValueModel = greenService.getGreenBuild() ;
+        return greenNameAndValueModel ;
+    }
+}

+ 96 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/HomeController.java

@@ -0,0 +1,96 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.dictionary.DicCategoryIndex;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.service.admin.ICockpitService;
+import com.lightinit.hsdatashow.service.admin.IHomeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.ArrayList;
+
+/**
+ * 用户管理
+ */
+@Controller("adminHomeController")
+@RequestMapping(value = {"/admin", "/admin/home"})
+public class HomeController {
+
+    @Autowired
+    private IHomeService homeService;
+    @Autowired
+    private ICockpitService cockpitService;
+    @RequestMapping(value = {"/", "/index.action"})
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/home/index");
+        return modelAndView;
+    }
+
+    /*
+     *@Description   城市绿化
+     *@Param
+     *@Date 2018/8/15
+     *@return
+     **/
+    @RequestMapping(value="moreindex.action")
+    @ResponseBody
+    public ResultState getMoreIndex(){
+        ArrayList<String> findIndexes = new ArrayList<>();
+        findIndexes.add(DicCategoryIndex.SOCIETYDEVELOPINDEX);
+        findIndexes.add(DicCategoryIndex.ECOLOGICALENVIRONMENTINDEX);
+        findIndexes.add(DicCategoryIndex.RESIDENTSERVICEINDEX);
+        findIndexes.add(DicCategoryIndex.SOCIETYSECURITYINDEX);
+        return cockpitService.getIndex(findIndexes);
+    }
+
+    /*
+     *@Description   城市绿化
+     *@Param
+     *@Date 2018/8/15
+     *@return
+     **/
+    @RequestMapping(value="citygreening.action")
+    @ResponseBody
+    public ResultState getCityGreening(){
+        return homeService.getCityGreening();
+    }
+
+    /*
+     *@Description   社会安全
+     *@Param
+     *@Date 2018/8/15
+     *@return
+     **/
+    @RequestMapping(value="societysecurity.action")
+    @ResponseBody
+    public ResultState getSocietySecurity(){
+        return homeService.getSocietySecurity();
+    }
+
+    /*
+    *@Description   污染指数
+    *@Param
+    *@Date 2018/8/16
+    *@return
+    **/
+    @RequestMapping(value="pollutionindex.action")
+    @ResponseBody
+    public ResultState getPollutionIndex(){
+        return homeService.getPollutionIndex();
+    }
+
+    /*
+    *@Description   社会发展
+    *@Param
+    *@Date 2018/8/15
+    *@return
+    **/
+    @RequestMapping(value="societydevelop.action")
+    @ResponseBody
+    public ResultState getSocietyDevelop(){
+        return homeService.getSocietyDevelop();
+    }
+}

+ 62 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/InnovateController.java

@@ -0,0 +1,62 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.RdPersonnel;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.SpreadListModel;
+import com.lightinit.hsdatashow.model.admin.UrbanRuralGdpListModel;
+import com.lightinit.hsdatashow.service.admin.IInnovateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/innovate")
+public class InnovateController {
+    @Autowired
+    private IInnovateService iInnovateService;
+
+
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/innovate/index") ;
+        return modelAndView ;
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/getRDpersonnel.action")
+    public SpreadListModel getRDpersonnel(){
+        return iInnovateService.getRDpersonnel();
+    }
+    @ResponseBody
+    @RequestMapping(value = "/getRDpersonnel1.action")
+    public ResultState getRDpersonnel1(){
+        return iInnovateService.getRDpersonnel1();
+    }
+    @ResponseBody
+    @RequestMapping(value = "/getTechnicalProducts.action")
+    public SpreadListModel getTechnicalProducts(){
+        return iInnovateService.getTechnicalProducts();
+    }
+    @ResponseBody
+    @RequestMapping(value = "/getPatentAuthorization.action")
+    public ResultState getPatentAuthorization(){
+        return iInnovateService.getPatentAuthorization();
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/getPatentAuthorization1.action")
+    public SpreadListModel  getPatentAuthorization1(){
+        return iInnovateService.getPatentAuthorization1();
+    }
+    @ResponseBody
+    @RequestMapping(value = "/getScientistsEngineers.action")
+    public SpreadListModel  getScientistsEngineers(){
+        return iInnovateService.getScientistsEngineers();
+    }
+
+
+}

+ 61 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/LivelihoodImproveController.java

@@ -0,0 +1,61 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.Coefficient;
+import com.lightinit.hsdatashow.entity.SocialSafety;
+import com.lightinit.hsdatashow.model.admin.EducationalPortraitListModel;
+import com.lightinit.hsdatashow.model.admin.UnemploymentListModel;
+import com.lightinit.hsdatashow.model.admin.UrbanRuralGdpListModel;
+import com.lightinit.hsdatashow.service.admin.ILivelihoodImproveService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/LivelihoodImprove")
+public class LivelihoodImproveController {
+    @Autowired
+    private ILivelihoodImproveService livelihoodImproveService;
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/livelihoodImprove/index") ;
+        return modelAndView ;
+    }
+    @ResponseBody
+    @RequestMapping(value = "/getUnemployment.action")
+    public UnemploymentListModel getUnemployment(){
+        return livelihoodImproveService.getUnemployment();
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/getUrbanRuralGdp.action")
+    public UrbanRuralGdpListModel getUrbanRuralGdp(){
+        return livelihoodImproveService.getUrbanRuralGdp();
+    }
+    @ResponseBody
+    @RequestMapping(value = "/getUrbanRuralContrast.action")
+    public UrbanRuralGdpListModel getUrbanRuralContrast(){
+        return livelihoodImproveService.getUrbanRuralContrast();
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/getQuality.action")
+    public EducationalPortraitListModel getQuality(){
+        return livelihoodImproveService.getQuality();
+    }
+    @RequestMapping(value = "/getCoefficient.action")
+    @ResponseBody
+    public List<Coefficient> getCoefficient(){
+        List<Coefficient> list =livelihoodImproveService.getCoefficient();
+        return list;
+    }
+    @RequestMapping(value = "/getCoefficient1.action")
+    @ResponseBody
+    public List<Coefficient> getCoefficient1(){
+        List<Coefficient> list =livelihoodImproveService.getCoefficient1();
+        return list;
+    }
+}

+ 90 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/LivingSecurityController.java

@@ -0,0 +1,90 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.service.admin.ILivingSecurityService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/8/3 16:34
+ * @Description:
+ **/
+@Controller
+@RequestMapping(value = "/admin/livingSecurity")
+public class LivingSecurityController {
+
+    @Autowired
+    private ILivingSecurityService livingSecurityService;
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/livingSecurity/index");
+        return modelAndView;
+    }
+
+    /*
+     *@Description 万人火灾事故死亡率
+     *@Param
+     *@Date 2018/8/7
+     *@return
+     **/
+    @RequestMapping(value = "areafiredeathrate.action")
+    @ResponseBody
+    public ResultState getAreaFireDeathRate(){
+        return livingSecurityService.getAreaFireDeathRate();
+    }
+
+
+    /*
+     *@Description 区域工伤事故占比
+     *@Param
+     *@Date 2018/8/8
+     *@return
+     **/
+    @RequestMapping(value = "arefireproportion.action")
+    @ResponseBody
+    public ResultState getAreFireProportion(){
+        return livingSecurityService.getAreFireProportion();
+    }
+    /*
+    *@Description 万人火灾事故死亡率趋势
+    *@Param
+    *@Date 2018/8/13
+    *@return
+    **/
+    @RequestMapping(value = "arefiretendency.action")
+    @ResponseBody
+    public ResultState getAreFireTendency(){
+        return livingSecurityService.getAreFireTendency();
+
+    }
+
+    /*
+    *@Description   火灾事故死亡率排名
+    *@Param
+    *@Date 2018/8/13
+    *@return
+    **/
+    @RequestMapping(value = "arefirerank.action")
+    @ResponseBody
+    public ResultState getAreFireRank(){
+        return livingSecurityService.getAreFireRank();
+
+    }
+
+    /*
+    *@Description
+    *@Param
+    *@Date 2018/8/13
+    *@return
+    **/
+    @RequestMapping(value = "arefiredistribution.action")
+    @ResponseBody
+    public ResultState getAreFireDistribution(){
+        return livingSecurityService.getAreFireDistribution();
+
+    }
+}

+ 85 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/NewEconomicDevelopmentController.java

@@ -0,0 +1,85 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.dictionary.DicViewMenuTitle;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.EconomicDevelopmentListModel;
+import com.lightinit.hsdatashow.model.admin.GdpOccupationRatioModel;
+import com.lightinit.hsdatashow.model.admin.PerCapitaGdpListModel;
+import com.lightinit.hsdatashow.service.admin.IEconomicDevelopmentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping(value = "/admin/newEconomicDevelopment")
+public class NewEconomicDevelopmentController {
+    @Autowired
+    private IEconomicDevelopmentService economicDevelopmentService;
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/economicDevelopment/new") ;
+        GdpOccupationRatioModel model = economicDevelopmentService.getGDPTotal();
+        modelAndView.addObject("value",model.getValue().get(0)) ;
+        modelAndView.addObject("value1",model.getValue1().get(0)) ;
+        modelAndView.addObject("value2",model.getValue2().get(0)) ;
+        modelAndView.addObject("value3",model.getValue3().get(0)) ;
+        modelAndView.addObject("title",DicViewMenuTitle.STATISTICS);
+        return modelAndView ;
+    }
+    @RequestMapping(value = "/getGDP.action")
+    @ResponseBody
+    public PerCapitaGdpListModel getGDP(){
+        PerCapitaGdpListModel model = economicDevelopmentService.getGDP();
+        return model;
+    }
+
+//    @RequestMapping(value = "/getGDPTotal.action")
+//    @ResponseBody
+//    public GdpOccupationRatioModel getGDPTotal(){
+//        GdpOccupationRatioModel model = economicDevelopmentService.getGDPTotal();
+//        return model;
+//    }
+
+    @RequestMapping(value = "/getPerCapitaGdp.action")
+    @ResponseBody
+    public PerCapitaGdpListModel getPerCapitaGdp(){
+        PerCapitaGdpListModel model = economicDevelopmentService.getPerCapitaGdp();
+        return model;
+    }
+    @RequestMapping(value = "/getGdpOccupationRatio.action")
+    @ResponseBody
+    public ResultState getGdpOccupationRatio(){
+        ResultState model = economicDevelopmentService.getGdpOccupationRatio();
+        return model;
+    }
+
+    @RequestMapping(value = "/getGdpOccupationRatio2.action")
+    @ResponseBody
+    public GdpOccupationRatioModel getGdpOccupationRatio2(){
+        GdpOccupationRatioModel model = economicDevelopmentService.getGdpOccupationRatio2();
+        return model;
+    }
+
+//    @RequestMapping(value = "/getLaborProduction.action")
+//    @ResponseBody
+//    public PerCapitaGdpListModel getLaborProduction(){
+//        PerCapitaGdpListModel model = economicDevelopmentService.getLaborProduction();
+//        return model;
+//    }
+    @RequestMapping(value = "/getUrbanization.action")
+    @ResponseBody
+    public PerCapitaGdpListModel getUrbanization(){
+        PerCapitaGdpListModel model = economicDevelopmentService.getUrbanization();
+        return model;
+    }
+
+    @RequestMapping(value = "/getDistrictCounty.action")
+    @ResponseBody
+    public ResultState getDistrictCounty(){
+        ResultState model = economicDevelopmentService.getDistrictCounty();
+        return model;
+    }
+
+}

+ 57 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/NewGarbageCanController.java

@@ -0,0 +1,57 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.dictionary.DicViewMenuTitle;
+import com.lightinit.hsdatashow.entity.GarbageCan;
+import com.lightinit.hsdatashow.model.admin.GarbageCanModel;
+import com.lightinit.hsdatashow.model.admin.GroupNameAndValueModel;
+import com.lightinit.hsdatashow.service.admin.IGarbageCanService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/newGarbageCan")
+public class NewGarbageCanController {
+    @Autowired
+    private IGarbageCanService iGarbageCanService;
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/garbageCan/new") ;
+        modelAndView.addObject("title",DicViewMenuTitle.ENVIRONMENTAL);
+        return modelAndView ;
+    }
+    @RequestMapping(value = "getGarbageCan.action")
+    @ResponseBody
+    public  List<GarbageCan> getGarbageCan(){
+        return iGarbageCanService.getGarbageCan() ;
+    }
+
+    @RequestMapping(value = "getGarbageCan2.action")
+    @ResponseBody
+    public GroupNameAndValueModel getGarbageCan2(String name,Integer falg){
+        return iGarbageCanService.getGarbageCan2(name,falg) ;
+    }
+
+    @RequestMapping(value = "getGarbageCanList.action")
+    @ResponseBody
+    public List<GarbageCanModel> getGarbageCanList(){
+        List<GarbageCanModel> list = iGarbageCanService.getGarbageCanList();
+        return  list;
+    }
+    @RequestMapping(value = "getTop.action")
+    @ResponseBody
+    public GroupNameAndValueModel getTop(){
+        return iGarbageCanService.getTop();
+    }
+//    @RequestMapping(value = "getBottom.action")
+//    @ResponseBody
+//    public GroupNameAndValueModel getBottom(){
+//        return iGarbageCanService.getBottom();
+//    }
+
+
+}

+ 36 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/NewWaterTingController.java

@@ -0,0 +1,36 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.dictionary.DicViewMenuTitle;
+import com.lightinit.hsdatashow.model.admin.PrecipitationAggregateResultModel;
+import com.lightinit.hsdatashow.model.admin.WaterResourceAggregateResultModel;
+import com.lightinit.hsdatashow.model.admin.WaterStorageAggregateResultModel;
+import com.lightinit.hsdatashow.service.admin.IWaterThingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+
+@Controller
+@RequestMapping(value = "/admin/newWater")
+public class NewWaterTingController extends BaseController {
+
+    @Autowired
+    private IWaterThingService waterThingService ;
+
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/newWater/index");
+        //降水总量
+        PrecipitationAggregateResultModel jiangshui = waterThingService.getnewPrecipitationAggregate() ;
+        modelAndView.addObject("jiangshui",jiangshui) ;
+        //水资源总量
+        WaterResourceAggregateResultModel shuiziyuan = waterThingService.getWaterResourceAggregate() ;
+        modelAndView.addObject("shuiziyuan",shuiziyuan) ;
+        //蓄水总量
+        WaterStorageAggregateResultModel xushui = waterThingService.getWaterStorageAggregate() ;
+        modelAndView.addObject("xushui",xushui) ;
+        modelAndView.addObject("title", DicViewMenuTitle.WATER) ;
+        return modelAndView;
+    }
+}

+ 41 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/NoiseController.java

@@ -0,0 +1,41 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.GreenNameAndValueModel;
+import com.lightinit.hsdatashow.service.admin.INoiseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.math.BigDecimal;
+
+@Controller
+@RequestMapping(value = "/admin/noise")
+public class NoiseController {
+
+    @Autowired
+    private INoiseService noiseService ;
+
+    @RequestMapping("/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/noise/index") ;
+        return modelAndView ;
+    }
+
+    @RequestMapping("/getNoiseRegion.action")
+    @ResponseBody
+    public BigDecimal getGreenCity(){
+        BigDecimal value = noiseService.getNoiseRegion() ;
+        return value ;
+    }
+
+    @RequestMapping("/getNoiseTraffic.action")
+    @ResponseBody
+    public BigDecimal getNoiseTraffic(){
+        BigDecimal value = noiseService.getNoiseTraffic() ;
+        return value ;
+    }
+
+}

+ 97 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/PeopleGrowthController.java

@@ -0,0 +1,97 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.*;
+import com.lightinit.hsdatashow.service.admin.IPeopleGrowthService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/peopleGrowth")
+public class PeopleGrowthController {
+
+    @Autowired
+    private IPeopleGrowthService peopleGrowthService ;
+
+
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/peopleGrowth/index") ;
+        return modelAndView ;
+    }
+
+    /**
+     * 平均寿命
+     * @return
+     */
+    @RequestMapping(value = "getLifetime.action")
+    @ResponseBody
+    public GroupNameAndValueModel getLifetime(){
+        return peopleGrowthService.getLifetime() ;
+    }
+
+    /**
+     * 平均预产期
+     * @return
+     */
+    @RequestMapping(value = "getExpectedRate.action")
+    @ResponseBody
+    public AverageExpectedRateResultModel getExpectedRate(){
+        return peopleGrowthService.getExpectedRate() ;
+    }
+
+    /**
+     * 抚养比
+     * @return
+     */
+    @RequestMapping(value = "getDependencyRatio.action")
+    @ResponseBody
+    public GroupNameAndValueModel getDependencyRatio(){
+        return peopleGrowthService.getDependencyRatio() ;
+    }
+
+    /**
+     * 人口状况
+     * @return
+     */
+    @RequestMapping(value = "getPopulationSummary.action")
+    @ResponseBody
+    public PopulationSummaryListModel getPopulationSummary(){
+        return peopleGrowthService.getPopulationSummary() ;
+    }
+
+    /**
+     * 年龄结构
+     * @return
+     */
+    @RequestMapping(value = "getAgeStructure.action")
+    @ResponseBody
+    public AgeStructureReturnModel getAgeStructure(){
+        return peopleGrowthService.getAgeStructure() ;
+    }
+
+    /**
+     * 区域人口
+     * @return
+     */
+    @RequestMapping(value = "getPopulationRegion.action")
+    @ResponseBody
+    public List<PopulationRegionResultModel> getPopulationRegion(){
+        return peopleGrowthService.getPopulationRegion() ;
+    }
+
+    /**
+     * 区域人口巨型图
+     * @return
+     */
+    @RequestMapping(value = "getPopulationRegionPicture.action")
+    @ResponseBody
+    public GroupNameAndValueModel getPopulationRegionPicture(){
+        return peopleGrowthService.getPopulationRegionPicture() ;
+    }
+
+}

+ 92 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/ProduceSecurityController.java

@@ -0,0 +1,92 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.service.admin.IProduceSecurityService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/8/2 15:40
+ * @Description:
+ **/
+@Controller
+@RequestMapping(value = "/admin/produceSecurity")
+public class ProduceSecurityController {
+
+    @Autowired
+    private IProduceSecurityService produceSecurityService;
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/produceSecurity/index");
+        return modelAndView;
+    }
+
+    /*
+    *@Description 万人工伤事故死亡率
+    *@Param 
+    *@Date 2018/8/8
+    *@return 
+    **/
+    @RequestMapping(value = "accidentdeath.action")
+    @ResponseBody
+    public ResultState getAccidentDeath(){
+        return produceSecurityService.getAccidentDeath();
+    }
+
+    /*
+    *@Description 区域工伤事故占比
+    *@Param
+    *@Date 2018/8/8
+    *@return
+    **/
+    @RequestMapping(value = "accidentproportion.action")
+    @ResponseBody
+    public ResultState getAccidentProportion(){
+        return produceSecurityService.getAccidentProportion();
+    }
+
+    /*
+    *@Description   工伤事故类别排名
+    *@Param
+    *@Date 2018/8/9
+    *@return
+    **/
+    @RequestMapping(value = "industrialaccidentranking.action")
+    @ResponseBody
+    public ResultState getIndustrialAccidentRanking(){
+        return produceSecurityService.getIndustrialAccidentRanking();
+    }
+
+    /*
+    *@Description   工伤事故类别排名
+    *@Param
+    *@Date 2018/8/9
+    *@return
+    **/
+    @RequestMapping(value = "industrialaccidenttendency.action")
+    @ResponseBody
+    public ResultState getIndustrialAccidentTendency(){
+        return produceSecurityService.getIndustrialAccidentTendency();
+
+    }
+
+    /*
+    *@Description
+    *@Param
+    *@Date 2018/8/16
+    *@return
+    **/
+    @RequestMapping(value = "industriaaccidentdistribution.action")
+    @ResponseBody
+    public ResultState getIndustrialAccidentDistribution(){
+        return produceSecurityService.getIndustrialAccidentDistribution();
+
+    }
+
+
+}

+ 62 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/ProgressController.java

@@ -0,0 +1,62 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.SocialSafety;
+import com.lightinit.hsdatashow.model.admin.ServiceExpenditureListModel;
+import com.lightinit.hsdatashow.model.admin.SpreadListModel;
+import com.lightinit.hsdatashow.model.admin.UnemploymentListModel;
+import com.lightinit.hsdatashow.service.admin.IProgressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/progress")
+public class ProgressController {
+    @Autowired
+    private IProgressService progressService;
+
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/progress/index");
+        return modelAndView;
+    }
+    @RequestMapping(value = "/getServiceExpenditure.action")
+    @ResponseBody
+    public ServiceExpenditureListModel getServiceExpenditure(){
+        ServiceExpenditureListModel list =progressService.getServiceExpenditure();
+        return list;
+    }
+
+    @RequestMapping(value = "/getYearsEducation.action")
+    @ResponseBody
+    public UnemploymentListModel getYearsEducation(){
+        UnemploymentListModel list =progressService.getYearsEducation();
+        return list;
+    }
+
+    @RequestMapping(value = "/getSocialSecurity.action")
+    @ResponseBody
+    public SpreadListModel getSocialSecurity(){
+        SpreadListModel list =progressService.getSocialSecurity();
+        return list;
+    }
+
+    @RequestMapping(value = "/getChildMortality.action")
+    @ResponseBody
+    public UnemploymentListModel getChildMortality(){
+        UnemploymentListModel list =progressService.getChildMortality();
+        return list;
+    }
+    @RequestMapping(value = "/getSocialSafety.action")
+    @ResponseBody
+    public List<SocialSafety> getSocialSafety(){
+        List<SocialSafety> list =progressService.getSocialSafety();
+        return list;
+    }
+
+
+}

+ 43 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/PublishController.java

@@ -0,0 +1,43 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.CulturalFalitiesListModel;
+import com.lightinit.hsdatashow.model.admin.EducationalPortraitListModel;
+import com.lightinit.hsdatashow.model.admin.SpreadListModel;
+import com.lightinit.hsdatashow.service.admin.IPublicService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping(value = "/admin/publish")
+public class PublishController {
+    @Autowired
+    private IPublicService publicService;
+
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/publish/index") ;
+        return modelAndView ;
+    }
+    @RequestMapping(value = "/getComprehensive.action")
+    @ResponseBody
+    public SpreadListModel getComprehensive(){
+        SpreadListModel model = publicService.getComprehensive();
+        return model;
+    }
+    @RequestMapping(value = "/getPublicSentiment.action")
+    @ResponseBody
+    public CulturalFalitiesListModel getPublicSentiment(){
+        CulturalFalitiesListModel model = publicService.getPublicSentiment();
+        return model;
+    }
+    @RequestMapping(value = "/getPublicSentiment1.action")
+    @ResponseBody
+    public CulturalFalitiesListModel getPublicSentiment1(){
+        CulturalFalitiesListModel model = publicService.getPublicSentiment1();
+        return model;
+    }
+
+}

+ 62 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/PublishServiceController.java

@@ -0,0 +1,62 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.PublicSecurity;
+import com.lightinit.hsdatashow.model.admin.EducationalPortraitListModel;
+import com.lightinit.hsdatashow.model.admin.GroupNameAndValueModel;
+import com.lightinit.hsdatashow.model.admin.SpreadListModel;
+import com.lightinit.hsdatashow.model.admin.TrafficTravelListModel;
+import com.lightinit.hsdatashow.service.admin.IPublishService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/publishService")
+public class PublishServiceController {
+    @Autowired
+    private IPublishService publishService;
+
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/publishService/index") ;
+        return modelAndView ;
+    }
+    @RequestMapping(value = "/getEducationalPortrait.action")
+    @ResponseBody
+    public EducationalPortraitListModel getEducationalPortrait(){
+        EducationalPortraitListModel model = publishService.getEducationalPortrait();
+        return model;
+    }
+    @RequestMapping(value = "/getGreening.action")
+    @ResponseBody
+    public GroupNameAndValueModel getGreening(){
+        GroupNameAndValueModel model = publishService.getGreening();
+        return model;
+    }
+
+    @RequestMapping(value = "/geHealthCarePlan.action")
+    @ResponseBody
+    public EducationalPortraitListModel geHealthCarePlan(){
+        EducationalPortraitListModel model = publishService.geHealthCarePlan();
+        return model;
+    }
+
+    @RequestMapping(value = "/gePublicSecurity.action")
+    @ResponseBody
+    public  List<PublicSecurity> gePublicSecurity(){
+        List<PublicSecurity> list = publishService.gePublicSecurity();
+        return list;
+    }
+
+    @RequestMapping(value = "/getTrafficTravel.action")
+    @ResponseBody
+    public TrafficTravelListModel getTrafficTravel(){
+        TrafficTravelListModel model = publishService.getTrafficTravel();
+        return model;
+    }
+
+}

+ 204 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/RoleMgrController.java

@@ -0,0 +1,204 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.common.RoleModulesUtilsPro;
+import com.lightinit.hsdatashow.entity.BaseExample;
+import com.lightinit.hsdatashow.entity.RoleModule;
+import com.lightinit.hsdatashow.entity.SentryRole;
+import com.lightinit.hsdatashow.entity.SentryRoleAction;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.ResultStateCode;
+import com.lightinit.hsdatashow.model.admin.*;
+import com.lightinit.hsdatashow.service.IRoleService;
+import com.lightinit.hsdatashow.service.IShiroPermissionsService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpSession;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author WangYao
+ * @date 2018/6/21 13:30
+ * @description 角色管理控制器
+ */
+@Controller
+@RequestMapping("/admin/role_mgr")
+public class RoleMgrController extends BaseController {
+
+    private static final Logger logger = LoggerFactory.getLogger(RoleMgrController.class);
+
+    @Autowired
+    private IRoleService roleService;
+    @Autowired
+    private RoleModulesUtilsPro roleModulesUtilsPro;
+    @Autowired
+    private IShiroPermissionsService shiroPermissionsService;
+
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/role_mgr/index");
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "list.action")
+    public ModelAndView list(@RequestParam(defaultValue = "1") int pageNo) {
+        ModelAndView modelAndView = new ModelAndView("admin/role_mgr/list");
+        BaseExample.Page pager = new BaseExample.Page(pageNo, 10);
+        List<SentryRole> outputModel = roleService.QueryList(pager.getPageNo(), pager.getPageSize(),null);
+        pager.setTotal(roleService.QueryCount(null));
+        modelAndView.addObject("list", outputModel);
+        modelAndView.addObject("pager", pager);
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "add.htm")
+    public ModelAndView add(){
+        ModelAndView modelAndView = new ModelAndView("admin/role_mgr/add");
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "add.action")
+    @ResponseBody
+    public ResultState doAdd(HttpSession session, @Valid RoleMgrDataModel inputModel, BindingResult bindingResult){
+        if (bindingResult.hasErrors()){
+            return getAllFieldInvalidResultState(inputModel, bindingResult);
+        }
+        if (roleService.IsExitsRole(inputModel.getRolecode())) {
+            return buildInvalidResultState(ResultStateCode.INVALID_DATA, "角色代码已存在");
+        }
+        SentryRole sentryRole = new SentryRole();
+        BeanUtils.copyProperties(inputModel, sentryRole);
+        sentryRole.setAddtiime(new Date());
+        boolean success = roleService.InsertRole(sentryRole);
+        ResultState resultState = new ResultState();
+        if (!success){
+            resultState.setStateCode(ResultStateCode.INVALID_DATA);
+            resultState.setMsg("添加角色失败");
+        }
+
+        return resultState;
+    }
+
+    @RequestMapping(value = "edit.htm/{id}")
+    public ModelAndView edit(@PathVariable long id){
+        SentryRole busiModel = roleService.QueryOne(id);
+        if(busiModel == null){
+            return null;
+        }
+        ModelAndView modelAndView = new ModelAndView("admin/role_mgr/edit");
+        modelAndView.addObject("busiModel", busiModel);
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "edit.action")
+    @ResponseBody
+    public ResultState doEdit(@Valid RoleMgrDataModel inputModel, BindingResult bindingResult){
+        if (bindingResult.hasErrors()){
+            return getAllFieldInvalidResultState(inputModel, bindingResult);
+        }
+        SentryRole role = roleService.QueryOne(inputModel.getId());
+        if(role == null){
+            return buildInvalidResultState(ResultStateCode.INVALID_DATA, "当前角色不存在");
+        }
+        role.setParentid(inputModel.getParentid());
+        role.setRolecode(inputModel.getRolecode().toLowerCase());
+        role.setRolename(inputModel.getRolename());
+        boolean success = roleService.UpdateRole(role);
+        ResultState resultState = new ResultState();
+        if (!success){
+            resultState.setStateCode(ResultStateCode.INVALID_DATA);
+            resultState.setMsg("编辑角色失败");
+        }
+        return resultState;
+    }
+
+    @RequestMapping(value = "auth.htm/{id}")
+    public ModelAndView auth(@PathVariable long id){
+        SentryRole busiModel = roleService.QueryOne(id);
+        if(busiModel == null){
+            return null;
+        }
+        ModelAndView modelAndView = new ModelAndView("admin/role_mgr/auth");
+        modelAndView.addObject("busiModel", busiModel);
+        List<RoleModule> roleModuleList = roleService.QueryModuleList(id);
+        modelAndView.addObject("selectedModuleList", roleModuleList);
+        SentryRole role = roleService.QueryOne(id);
+        List<String> roleCodeList = new ArrayList<>();
+        roleCodeList.add(role.getRolecode());
+        List<SentryRoleAction> selectedActionList = shiroPermissionsService.selectSentryRoleAction(roleCodeList);
+        modelAndView.addObject("selectedActionList", selectedActionList);
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "auth.action")
+    @ResponseBody
+    public ResultState doAuth(@RequestBody RoleMgrModuleDataModel inputModel){
+        if (inputModel == null || inputModel.getRoleId() == null || inputModel.getRoleId() <= 0){
+            return buildInvalidResultState(ResultStateCode.INVALID_DATA, "参数错误");
+        }
+        SentryRole role = roleService.QueryOne(inputModel.getRoleId());
+        if(role == null){
+            return buildInvalidResultState(ResultStateCode.INVALID_DATA, "当前角色不存在");
+        }
+        boolean success = roleService.SaveRoleModule(inputModel.getRoleId(), inputModel.getSelectedModuleIds(), inputModel.getSelectedActionIds());
+        ResultState resultState = new ResultState();
+        if (!success){
+            resultState.setStateCode(ResultStateCode.INVALID_DATA);
+            resultState.setMsg("授权失败");
+        }
+        return resultState;
+    }
+
+    @RequestMapping(value = "delete.action/{id}")
+    @ResponseBody
+    public ResultState delete(@PathVariable long id){
+        ResultState<Long> resultState = new ResultState<>();
+        boolean success=false;
+        if (id > 0) {
+            SentryRole item = roleService.QueryOne(id);
+            if(item == null){
+                resultState.setStateCode(ResultStateCode.INVALID_DATA);
+                resultState.setMsg("当前角色已不存在");
+            }else if(item.getChildren()!=null && item.getChildren().size()>0){
+                resultState.setStateCode(ResultStateCode.INVALID_DATA);
+                resultState.setMsg("角色【"+item.getRolename()+"】还有子角色,当前角色不能删除");
+            }else {
+                List<Long> roleIds=roleModulesUtilsPro.RoleIds(item);
+                if(roleIds.size()==0){
+                    resultState.setStateCode(ResultStateCode.INVALID_DATA);
+                    resultState.setMsg("参数错误");
+                }else {
+                    if (roleService.CheckRoleHasModules(roleIds)) {
+                        resultState.setStateCode(ResultStateCode.INVALID_DATA);
+                        resultState.setMsg("角色【"+item.getRolename()+"】已经分配权限,当前角色不能删除");
+                    }else if (roleService.CheckRoleHasUser(roleIds)) {
+                        resultState.setStateCode(ResultStateCode.INVALID_DATA);
+                        resultState.setMsg("角色【"+item.getRolename()+"】已经分配用户,当前角色不能删除");
+                    }else{
+                        if(roleService.DeleteRole(id)){
+                            /*resultState.setStateCode(ResultStateCode.SUCCESS);
+                            resultState.setMsg("角色【"+item.getRolename()+"】删除成功");*/
+                        }else{
+                            resultState.setStateCode(ResultStateCode.INVALID_DATA);
+                            resultState.setMsg("角色【"+item.getRolename()+"】删除失败");
+                        }
+                    }
+                }
+            }
+        } else {
+            resultState.setStateCode(ResultStateCode.INVALID_DATA);
+            resultState.setMsg("参数错误");
+        }
+        return resultState;
+    }
+
+}

+ 101 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/SocietySecurityController.java

@@ -0,0 +1,101 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.service.admin.ISocietySecurityService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/8/2 16:35
+ * @Description:
+ **/
+@Controller
+@RequestMapping(value = "/admin/societySecurity")
+public class SocietySecurityController {
+
+    @Autowired
+    private ISocietySecurityService societySecurityService;
+
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/societySecurity/index");
+        return modelAndView;
+    }
+
+    /*
+     *@Description 万人刑事犯罪率
+     *@Param
+     *@Date 2018/8/7
+     *@return
+     **/
+    @RequestMapping(value = "criminalrate.action")
+    @ResponseBody
+    public ResultState getCriminalRate(){
+        return societySecurityService.getCriminalRate();
+    }
+
+    /*
+     *@Description 区域立案数占比
+     *@Param
+     *@Date 2018/8/7
+     *@return
+     **/
+    @RequestMapping(value = "registerlegalpro.action")
+    @ResponseBody
+    public ResultState getRegisterLegalPro(){
+        return societySecurityService.getRegisterLegalPro();
+    }
+
+    /*
+    *@Description  万人犯罪率趋势
+    *@Param
+    *@Date 2018/8/9
+    *@return
+    **/
+    @RequestMapping(value = "registerlegalten.action")
+    @ResponseBody
+    public ResultState getRegisterLegalTen(){
+        return societySecurityService.getRegisterLegalTen();
+    }
+
+    /*
+    *@Description  刑事案件立案率
+    *@Param
+    *@Date 2018/8/9
+    *@return
+    **/
+    @RequestMapping(value = "criregpro.action")
+    @ResponseBody
+    public ResultState getCriRegPro(){
+        return societySecurityService.getCriRegPro();
+    }
+
+    /*
+    *@Description   重点部位安全监控覆盖率
+    *@Param
+    *@Date 2018/8/10
+    *@return
+    **/
+    @RequestMapping(value = "importantareamonitor.action")
+    @ResponseBody
+    public ResultState getImportantAreaMonitor(){
+        return societySecurityService.getImportantAreaMonitor();
+    }
+
+    /*
+    *@Description   警员配置数
+    *@Param
+    *@Date 2018/8/10
+    *@return
+    **/
+    @RequestMapping(value = "policepro.action")
+    @ResponseBody
+    public ResultState getPolicepro(){
+        return societySecurityService.getPolicepro();
+    }
+
+}

+ 67 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/SolidWasteController.java

@@ -0,0 +1,67 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.*;
+import com.lightinit.hsdatashow.service.admin.ISolidWasteService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping(value = "/admin/solidWaste")
+public class SolidWasteController {
+
+    @Autowired
+    private ISolidWasteService solidWasteService ;
+
+    @RequestMapping("/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/solidWaste/index") ;
+        return modelAndView ;
+    }
+
+    @RequestMapping("/getSolidwasteIndustry.action")
+    @ResponseBody
+    public SolidwasteIndustryResultModel getSolidwasteIndustry(){
+        SolidwasteIndustryResultModel solidwasteIndustryResultModel = solidWasteService.getSolidwasteIndustry() ;
+        return solidwasteIndustryResultModel ;
+    }
+
+    @RequestMapping("/getSolidwasteDanger.action")
+    @ResponseBody
+    public SolidwasteDangerResultModel getSolidwasteDanger(){
+        SolidwasteDangerResultModel solidwasteDangerResultModel = solidWasteService.getSolidwasteDanger() ;
+        return solidwasteDangerResultModel ;
+    }
+
+    @RequestMapping("/getOneSolidwasteClassification.action")
+    @ResponseBody
+    public OneSolidwasteClassificationResultModel getOneSolidwasteClassification(){
+        OneSolidwasteClassificationResultModel oneSolidwasteClassificationResultModel = solidWasteService.getOneSolidwasteClassification() ;
+        return oneSolidwasteClassificationResultModel ;
+    }
+
+    @RequestMapping("/getSolidwasteClassification.action")
+    @ResponseBody
+    public SolidwasteClassificationResultModel getSolidwasteClassification(){
+        SolidwasteClassificationResultModel solidwasteClassificationResultModel = solidWasteService.getSolidwasteClassification() ;
+        return solidwasteClassificationResultModel ;
+    }
+
+    @RequestMapping("/getOneSolidwasteLife.action")
+    @ResponseBody
+    public SolidWasteNameAndValueModel getOneSolidwasteLife(){
+        SolidWasteNameAndValueModel solidWasteNameAndValueModel = solidWasteService.getOneSolidwasteLife() ;
+        solidWasteNameAndValueModel.setName("处理率");
+        return solidWasteNameAndValueModel ;
+    }
+
+    @RequestMapping("/getSolidwasteLife.action")
+    @ResponseBody
+    public SolidwasteLifeResultModel getSolidwasteLife(){
+        SolidwasteLifeResultModel solidWasteServiceSolidwasteLife = solidWasteService.getSolidwasteLife() ;
+        return solidWasteServiceSolidwasteLife ;
+    }
+
+}

+ 47 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/StreetLampController.java

@@ -0,0 +1,47 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.StreetLamp;
+import com.lightinit.hsdatashow.model.admin.GarbageCanModel;
+import com.lightinit.hsdatashow.model.admin.StreetLampModel;
+import com.lightinit.hsdatashow.service.admin.IStreetLampService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "/admin/StreetLamp")
+public class StreetLampController {
+    @Autowired
+    private IStreetLampService iStreetLampService;
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/streetLamp/index") ;
+        return modelAndView ;
+    }
+    @ResponseBody
+    @RequestMapping(value = "getMainRoad.action")
+    public StreetLampModel getMainRoad(String type){
+        type = "主干道";
+        StreetLampModel model = iStreetLampService.getStreetLamp(type);
+        return model;
+    }
+    @ResponseBody
+    @RequestMapping(value = "getStreet.action")
+    public StreetLampModel getStreet(String type){
+        type = "小街巷";
+        StreetLampModel model = iStreetLampService.getStreetLamp(type);
+        return model;
+    }
+    @ResponseBody
+    @RequestMapping(value = "getName.action")
+    public List<GarbageCanModel> getList(String type){
+
+        return iStreetLampService.getList();
+    }
+
+
+}

+ 65 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/TourismCultureController.java

@@ -0,0 +1,65 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.*;
+import com.lightinit.hsdatashow.service.admin.ITourismCultureService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping(value = "/admin/TourismCulture")
+public class TourismCultureController {
+    @Autowired
+    private ITourismCultureService tourismCultureService;
+
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index() {
+        ModelAndView modelAndView = new ModelAndView("admin/tourismCulture/index");
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "/getCulturalFalities.action")
+    @ResponseBody
+    public CulturalFalitiesListModel getCulturalFalities() {
+        CulturalFalitiesListModel model = tourismCultureService.getCulturalFalities();
+        return model;
+    }
+
+    @RequestMapping(value = "/getSpread.action")
+    @ResponseBody
+    public SpreadListModel getSpread() {
+        SpreadListModel model = tourismCultureService.getSpread();
+        return model;
+    }
+
+    @RequestMapping(value = "/getConsumption.action")
+    @ResponseBody
+    public ConsumptionListModel getConsumption() {
+        ConsumptionListModel model = tourismCultureService.getConsumption();
+        return model;
+
+    }
+
+    @RequestMapping(value = "/getOutPutValue.action")
+    @ResponseBody
+    public ResultState getOutPutValue() {
+        ResultState model = tourismCultureService.getOutPutValue();
+        return model;
+    }
+
+    @RequestMapping(value = "/getRatio.action")
+    @ResponseBody
+    public OutPutValueRatioListMOdel getRatio() {
+        OutPutValueRatioListMOdel model = tourismCultureService.getRatio();
+        return model;
+    }
+    @RequestMapping(value = "/getIndustry.action")
+    @ResponseBody
+    public IndustryListModel getIndustry() {
+        IndustryListModel model = tourismCultureService.getIndustry();
+        return model;
+    }
+}

+ 57 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/TrafficMonitorController.java

@@ -0,0 +1,57 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.EducationOrganizationResultModel;
+import com.lightinit.hsdatashow.service.admin.ITrafficMonitorService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/12/9 13:20
+ * @Description:
+ **/
+@Controller
+@RequestMapping(value = "/admin/trafficmonitor")
+public class TrafficMonitorController {
+
+    @Autowired
+    private ITrafficMonitorService trafficMonitorService;
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/trafficmonitor/index") ;
+        return modelAndView ;
+    }
+
+    @RequestMapping(value = "trafficcondition.action/{type}")
+    @ResponseBody
+    public ResultState getTrafficCondition(@PathVariable String type){
+        if(StringUtils.isEmpty(type)){
+            return null;
+        }
+        String chinaType=null;
+        if("gjc".equals(type)){
+            chinaType="公交车";
+        }else if("czc".equals(type)){
+            chinaType="出租车";
+        }else if("zxc".equals(type)){
+            chinaType="自行车";
+        }
+        return trafficMonitorService.getTrafficCondition(chinaType);
+    }
+
+    @RequestMapping(value = "getTrafficmonitor.action")
+    @ResponseBody
+    public List<EducationOrganizationResultModel> getTrafficmonitor(String categoryName,String name){
+        return trafficMonitorService.getEducationOrganization(categoryName,name) ;
+    }
+
+
+}

+ 96 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/TrafficSecurityController.java

@@ -0,0 +1,96 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.service.admin.ITrafficSecurityService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @Author: sunxiang
+ * @Date: 2018/8/3 16:24
+ * @Description:
+ **/
+@Controller
+@RequestMapping(value = "/admin/trafficSecurity")
+public class TrafficSecurityController {
+
+    @Autowired
+    private ITrafficSecurityService trafficSecurityService;
+    @RequestMapping(value = "index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/trafficSecurity/index");
+        return modelAndView;
+    }
+
+    /*
+     *@Description 万人交通事故死亡率
+     *@Param
+     *@Date 2018/8/16
+     *@return
+     **/
+    @RequestMapping(value = "trafficdeathrate.action")
+    @ResponseBody
+    public ResultState getTrafficDeathRate(){
+        return trafficSecurityService.getTrafficDeathRate();
+    }
+    /*
+    *@Description  交通事故类型占比
+    *@Param
+    *@Date 2018/8/10
+    *@return
+    **/
+    @RequestMapping(value = "trafficaccidentpro.action")
+    @ResponseBody
+    public ResultState getTrafficAccidentPro(){
+        return trafficSecurityService.getTrafficAccidentPro();
+    }
+
+    /*
+    *@Description 交通事故趋势
+    *@Param
+    *@Date 2018/8/10
+    *@return
+    **/
+    @RequestMapping(value = "trafficaccidentten.action")
+    @ResponseBody
+    public ResultState getTrafficAccidentTen(){
+        return trafficSecurityService.getTrafficAccidentTen();
+    }
+    /*
+    *@Description 交通事故区域排名
+    *@Param
+    *@Date 2018/8/10
+    *@return
+    **/
+    @RequestMapping(value = "trafficaccidentrank.action")
+    @ResponseBody
+    public ResultState getTrafficAccidentRank(){
+        return trafficSecurityService.getTrafficAccidentRank();
+    }
+    
+    /*
+    *@Description 交通事故分布
+    *@Param 
+    *@Date 2018/8/10
+    *@return 
+    **/
+    @RequestMapping(value = "trafficaccidentdistri.action")
+    @ResponseBody
+    public ResultState getTrafficAccidentDistribution(){
+        return trafficSecurityService.getTrafficAccidentDistribution();
+    }
+    /*
+    *@Description 交通事故结案情况
+    *@Param
+    *@Date 2018/8/10
+    *@return
+    **/
+    @RequestMapping(value = "trafficaccidentcomplete.action")
+    @ResponseBody
+    public ResultState getTrafficAccidentComplete(){
+        return trafficSecurityService.getTrafficAccidentComplete();
+    }
+}

+ 98 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/UserAdminController.java

@@ -0,0 +1,98 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.entity.Admin;
+import com.lightinit.hsdatashow.entity.BaseExample;
+import com.lightinit.hsdatashow.model.ResultState;
+import com.lightinit.hsdatashow.model.admin.UserAddModel;
+import com.lightinit.hsdatashow.model.admin.UserAdminSearchModel;
+import com.lightinit.hsdatashow.model.admin.UserEditModel;
+import com.lightinit.hsdatashow.service.IAdminService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * Created by Mr.Yao on 2017/4/11.
+ */
+@Controller
+@RequestMapping("/admin/user")
+public class UserAdminController extends BaseController{
+    @Autowired
+    private IAdminService adminService;
+
+    @RequestMapping(value = "view/password.action")
+    public String print_user_modify_password() {
+        return "user/modifypwd";
+    }
+
+    @RequestMapping(value = "/index.htm")
+    public ModelAndView index() {
+        ModelAndView modelAndView = new ModelAndView("admin/user/index");
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "list.action")
+    public ModelAndView list(UserAdminSearchModel inputModel, @RequestParam(defaultValue = "1") int pageNo) {
+        ModelAndView modelAndView = new ModelAndView("admin/user/list");
+        BaseExample.Page pager = new BaseExample.Page();
+        pager.setPageNo(pageNo);
+        List<Admin> outputModel = adminService.queryList(inputModel, pager);
+        pager.setTotal(adminService.queryCount(inputModel));
+        modelAndView.addObject("list", outputModel);
+        modelAndView.addObject("pager", pager);
+        return modelAndView;
+    }
+
+
+    @RequestMapping(value = "add.htm")
+    public ModelAndView add() {
+        ModelAndView modelAndView = new ModelAndView("/admin/user/add");
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "add.action")
+    @ResponseBody
+    public ResultState add_action(@Valid UserAddModel userAddModel, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()){
+            return getAllFieldInvalidResultState(userAddModel, bindingResult);
+        }
+        return adminService.addAdmin(userAddModel);
+    }
+
+    @RequestMapping(value = "edit.htm/{id}")
+    public ModelAndView edit(@PathVariable Long id) {
+        ModelAndView modelAndView = new ModelAndView("/admin/user/edit");
+        modelAndView.addObject("admin", adminService.QueryOne(id));
+        return modelAndView;
+    }
+
+    @RequestMapping(value = "edit.action")
+    @ResponseBody
+    public ResultState edit_action(@Valid UserEditModel userEditModel,BindingResult bindingResult) {
+        if (bindingResult.hasErrors()){
+            return getAllFieldInvalidResultState(userEditModel,bindingResult) ;
+        }
+        return adminService.editAdmin(userEditModel);
+    }
+
+    @RequestMapping(value = "delete.action/{id}")
+    @ResponseBody
+    public ResultState<Long> delete_action(@PathVariable Long id) {
+        return adminService.deleteAdmin(id);
+    }
+
+    @RequestMapping(value = "view.htm/{id}")
+    public ModelAndView view(@PathVariable Long id) {
+        ModelAndView modelAndView = new ModelAndView("/admin/user/view");
+        modelAndView.addObject("admin", adminService.QueryOne(id));
+        return modelAndView;
+    }
+}

+ 67 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/WaterQualityController.java

@@ -0,0 +1,67 @@
+package com.lightinit.hsdatashow.controller.admin;
+
+import com.lightinit.hsdatashow.model.admin.WaterqualityFocusResultModel;
+import com.lightinit.hsdatashow.model.admin.WaterqualityIndustryResultModel;
+import com.lightinit.hsdatashow.model.admin.WaterqualitySurfaceResultModel;
+import com.lightinit.hsdatashow.service.admin.IWaterQualityService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.math.BigDecimal;
+
+@Controller
+@RequestMapping(value = "/admin/waterQuality")
+public class WaterQualityController {
+
+    @Autowired
+    private IWaterQualityService waterQualityService ;
+
+    @RequestMapping("/index.htm")
+    public ModelAndView index(){
+        ModelAndView modelAndView = new ModelAndView("admin/waterQuality/index") ;
+        return modelAndView ;
+    }
+
+    //水质达标率
+    @RequestMapping("/getWaterqualityHandle.action")
+    @ResponseBody
+    public BigDecimal getWaterqualityHandle(){
+        BigDecimal value = waterQualityService.getWaterqualityHandle() ;
+        return value ;
+    }
+
+    //城市污水处理率
+    @RequestMapping("/getWaterqualityCityHandle.action")
+    @ResponseBody
+    public BigDecimal getWaterqualityCityHandle(){
+        BigDecimal value = waterQualityService.getWaterqualityCityHandle() ;
+        return value ;
+    }
+
+    //地表水按水域功能类型占比
+    @RequestMapping("/getWaterqualitySurface.action")
+    @ResponseBody
+    public WaterqualitySurfaceResultModel getWaterqualitySurface(){
+        WaterqualitySurfaceResultModel waterqualitySurfaceResultModel = waterQualityService.getWaterqualitySurface() ;
+        return waterqualitySurfaceResultModel ;
+    }
+
+    //重点污染源工业废水排放
+    @RequestMapping("/getWaterqualityIndustry.action")
+    @ResponseBody
+    public WaterqualityIndustryResultModel getWaterqualityIndustry(){
+        WaterqualityIndustryResultModel waterqualityIndustryResultModel = waterQualityService.getWaterqualityIndustry() ;
+        return waterqualityIndustryResultModel ;
+    }
+
+    //集中式饮用水水源地水质情况
+    @RequestMapping("/getWaterqualityFocus.action")
+    @ResponseBody
+    public WaterqualityFocusResultModel getWaterqualityFocus(){
+        WaterqualityFocusResultModel waterqualityFocusResultModel = waterQualityService.getWaterqualityFocus() ;
+        return waterqualityFocusResultModel ;
+    }
+}

+ 0 - 0
src/main/java/com/lightinit/hsdatashow/controller/admin/WaterThingController.java


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików