wucl 1 năm trước cách đây
mục cha
commit
10058fe162
100 tập tin đã thay đổi với 3981 bổ sung0 xóa
  1. 0 0
      .idea/.gitignore
  2. 18 0
      .idea/compiler.xml
  3. 6 0
      .idea/encodings.xml
  4. 25 0
      .idea/jarRepositories.xml
  5. 113 0
      .idea/libraries/activation_1_1.xml
  6. 9 0
      .idea/libraries/base_1_4_0.xml
  7. 15 0
      .idea/misc.xml
  8. 202 0
      .idea/workspace.xml
  9. BIN
      __MACOSX/._pom.xml
  10. BIN
      __MACOSX/src/._.DS_Store
  11. BIN
      __MACOSX/src/main/._.DS_Store
  12. BIN
      __MACOSX/src/main/java/._.DS_Store
  13. BIN
      __MACOSX/src/main/java/com/._.DS_Store
  14. BIN
      __MACOSX/src/main/java/com/leeroa/._.DS_Store
  15. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/._.DS_Store
  16. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/._.DS_Store
  17. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/ali/._.DS_Store
  18. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/ali/bo/._.DS_Store
  19. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/ali/service/._.DS_Store
  20. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/lianjia/._.DS_Store
  21. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/lianjia/dao/._.DS_Store
  22. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/lianjia/service/._.DS_Store
  23. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/loanorder/._.DS_Store
  24. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/loanorder/bo/._.DS_Store
  25. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/loanorder/dao/._.DS_Store
  26. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/loanorder/service/._.DS_Store
  27. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/meishan/._.DS_Store
  28. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/meishan/bo/._.DS_Store
  29. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/meishan/service/._.DS_Store
  30. BIN
      __MACOSX/src/main/java/com/leeroa/dydb/datasource/touming/._.DS_Store
  31. BIN
      __MACOSX/src/main/resources/._.DS_Store
  32. BIN
      __MACOSX/src/main/resources/exp/._export_communityImport.xlsx
  33. BIN
      __MACOSX/src/main/resources/exp/._export_communityPrice.xlsx
  34. BIN
      __MACOSX/src/main/resources/exp/._export_dataQiyuDeal.xlsx
  35. BIN
      __MACOSX/src/main/resources/exp/._export_dataQiyuUp.xlsx
  36. BIN
      __MACOSX/src/main/resources/imp/._数据库-不动产证.xlsx
  37. BIN
      __MACOSX/src/main/resources/imp/._数据库-土地证.xlsx
  38. BIN
      __MACOSX/src/main/resources/imp/._数据库-房产证.xlsx
  39. BIN
      __MACOSX/src/main/resources/imp/._数据库-指导价.xlsx
  40. BIN
      __MACOSX/src/main/webapp/._.DS_Store
  41. BIN
      __MACOSX/src/main/webapp/WEB-INF/._.DS_Store
  42. BIN
      __MACOSX/src/main/webapp/app/._.DS_Store
  43. BIN
      __MACOSX/src/main/webapp/app/core/._.DS_Store
  44. BIN
      __MACOSX/src/main/webapp/app/dydb/._.DS_Store
  45. BIN
      __MACOSX/src/main/webapp/app/dyoa/._.DS_Store
  46. BIN
      __MACOSX/src/main/webapp/app/main/._.DS_Store
  47. BIN
      __MACOSX/src/main/webapp/app/mobile/._.DS_Store
  48. BIN
      __MACOSX/src/main/webapp/vendor/._.DS_Store
  49. 68 0
      pom.xml
  50. BIN
      src/.DS_Store
  51. BIN
      src/main/.DS_Store
  52. BIN
      src/main/java/.DS_Store
  53. BIN
      src/main/java/com/.DS_Store
  54. BIN
      src/main/java/com/leeroa/.DS_Store
  55. 9 0
      src/main/java/com/leeroa/core/index/bo/IndexWeightBo.java
  56. 20 0
      src/main/java/com/leeroa/core/index/bo/IndexWeightDetailBo.java
  57. 50 0
      src/main/java/com/leeroa/core/index/dao/IndexWeightDao.java
  58. 42 0
      src/main/java/com/leeroa/core/index/dao/IndexWeightDetailDao.java
  59. 94 0
      src/main/java/com/leeroa/core/index/dao/impl/IndexWeightDaoImpl.java
  60. 82 0
      src/main/java/com/leeroa/core/index/dao/impl/IndexWeightDetailDaoImpl.java
  61. 76 0
      src/main/java/com/leeroa/core/index/domain/IndexWeight.java
  62. 133 0
      src/main/java/com/leeroa/core/index/domain/IndexWeightDetail.java
  63. 52 0
      src/main/java/com/leeroa/core/index/service/IndexWeightDetailService.java
  64. 54 0
      src/main/java/com/leeroa/core/index/service/IndexWeightService.java
  65. 130 0
      src/main/java/com/leeroa/core/index/service/impl/IndexWeightDetailServiceImpl.java
  66. 111 0
      src/main/java/com/leeroa/core/index/service/impl/IndexWeightServiceImpl.java
  67. 172 0
      src/main/java/com/leeroa/core/index/utils/IndexWeightUtils.java
  68. 59 0
      src/main/java/com/leeroa/core/index/utils/RegUtils.java
  69. 10 0
      src/main/java/com/leeroa/core/index/vo/IndexWeightDetailVo.java
  70. 10 0
      src/main/java/com/leeroa/core/index/vo/IndexWeightVo.java
  71. 113 0
      src/main/java/com/leeroa/core/index/web/IndexWeightCtrl.java
  72. 104 0
      src/main/java/com/leeroa/core/index/web/IndexWeightDetailCtrl.java
  73. 99 0
      src/main/java/com/leeroa/core/score/bo/ItemScoreBo.java
  74. 60 0
      src/main/java/com/leeroa/core/score/bo/TargetsBo.java
  75. 42 0
      src/main/java/com/leeroa/core/score/dao/ItemScoreDao.java
  76. 42 0
      src/main/java/com/leeroa/core/score/dao/TargetsDao.java
  77. 82 0
      src/main/java/com/leeroa/core/score/dao/impl/ItemScoreDaoImpl.java
  78. 82 0
      src/main/java/com/leeroa/core/score/dao/impl/TargetsDaoImpl.java
  79. 185 0
      src/main/java/com/leeroa/core/score/domain/ItemScore.java
  80. 152 0
      src/main/java/com/leeroa/core/score/domain/Targets.java
  81. 46 0
      src/main/java/com/leeroa/core/score/service/ItemScoreService.java
  82. 46 0
      src/main/java/com/leeroa/core/score/service/TargetsService.java
  83. 97 0
      src/main/java/com/leeroa/core/score/service/impl/ItemScoreServiceImpl.java
  84. 92 0
      src/main/java/com/leeroa/core/score/service/impl/TargetsServiceImpl.java
  85. 10 0
      src/main/java/com/leeroa/core/score/vo/ItemScoreVo.java
  86. 10 0
      src/main/java/com/leeroa/core/score/vo/TargetsVo.java
  87. 158 0
      src/main/java/com/leeroa/core/score/web/ItemScoreCtrl.java
  88. 158 0
      src/main/java/com/leeroa/core/score/web/TargetsCtrl.java
  89. 34 0
      src/main/java/com/leeroa/core/tree/bo/CategoryTreeBo.java
  90. 42 0
      src/main/java/com/leeroa/core/tree/dao/CategoryTreeDao.java
  91. 82 0
      src/main/java/com/leeroa/core/tree/dao/impl/CategoryTreeDaoImpl.java
  92. 138 0
      src/main/java/com/leeroa/core/tree/domain/CategoryTree.java
  93. 46 0
      src/main/java/com/leeroa/core/tree/service/CategoryTreeService.java
  94. 100 0
      src/main/java/com/leeroa/core/tree/service/impl/CategoryTreeServiceImpl.java
  95. 19 0
      src/main/java/com/leeroa/core/tree/vo/CategoryTreeVo.java
  96. 115 0
      src/main/java/com/leeroa/core/tree/web/CategoryTreeCtrl.java
  97. 162 0
      src/main/java/com/leeroa/core/utils/sql/DoubleUtils.java
  98. 105 0
      src/main/java/com/leeroa/core/utils/sql/SQLUtils.java
  99. BIN
      src/main/java/com/leeroa/dydb/.DS_Store
  100. 0 0
      src/main/java/com/leeroa/dydb/base/bo/LocationBo.java

+ 0 - 0
.idea/.gitignore


+ 18 - 0
.idea/compiler.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="project-dydb" />
+      </profile>
+    </annotationProcessing>
+  </component>
+  <component name="JavacSettings">
+    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
+      <module name="project-dydb" options="-extdirs F:\development\dydb/src/main/webapp/WEB-INF/lib" />
+    </option>
+  </component>
+</project>

+ 6 - 0
.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>

+ 25 - 0
.idea/jarRepositories.xml

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

+ 113 - 0
.idea/libraries/activation_1_1.xml

@@ -0,0 +1,113 @@
+<component name="libraryTable">
+  <library name="activation-1.1">
+    <ANNOTATIONS>
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-shared-utils-3.0.0.jar!/" />
+    </ANNOTATIONS>
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/activation-1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aether-api-1.7.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aether-impl-1.7.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aether-spi-1.7.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aether-util-1.7.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/animal-sniffer-annotations-1.14.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/antlr-2.7.7.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aopalliance-1.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aspectjrt-1.7.3.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/aspectjweaver-1.7.3.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/base-1.4.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/classmate-1.3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-beanutils-1.8.3.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-codec-1.9.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-collections4-4.3.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-compress-1.18.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-fileupload-1.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-io-2.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-lang3-3.3.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-lang-2.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-logging-1.1.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/commons-math3-3.6.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/curvesapi-1.06.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/dom4j-1.6.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/druid-1.0.18.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/error_prone_annotations-2.0.18.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/file-management-3.0.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/fluent-hc-4.5.9.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/freemarker-2.3.20.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/gson-2.2.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/guava-22.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/hamcrest-core-1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/hibernate-commons-annotations-5.0.1.Final.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/hibernate-core-5.1.0.Final.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/hibernate-validator-5.0.3.Final.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/httpclient-4.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/httpcore-4.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/hutool-core-5.7.7.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/hutool-crypto-5.7.7.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/j2objc-annotations-1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jandex-2.0.0.Final.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javaee-api-7.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javassist-3.20.0-GA.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/javax.mail-1.5.6.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jboss-logging-3.3.0.Final.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jsoup-1.12.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jsr305-1.3.9.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jstl-1.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/junit-4.10.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/log4j-1.2.16.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-aether-provider-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-artifact-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-compat-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-core-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-model-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-model-builder-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-plugin-api-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-repository-metadata-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-settings-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-settings-builder-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-shared-io-3.0.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/maven-shared-utils-3.0.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/mysql-connector-java-5.1.22.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/plexus-cipher-1.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/plexus-classworlds-2.2.3.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/plexus-component-annotations-1.5.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/plexus-interpolation-1.14.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/plexus-sec-dispatcher-1.3.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/plexus-utils-3.0.22.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/poi-4.1.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/poi-ooxml-4.1.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/poi-ooxml-schemas-4.1.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/poi-scratchpad-4.1.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/sisu-guice-2.1.7-noaop.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/sisu-inject-bean-1.4.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/sisu-inject-plexus-1.4.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/slf4j-api-1.7.6.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/slf4j-log4j12-1.7.6.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-aop-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-beans-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-context-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-core-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-expression-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-jdbc-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-messaging-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-orm-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-test-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-tx-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-web-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-webmvc-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/spring-websocket-4.2.0.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/tools-poi-1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/UserAgentUtils-1.20.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/validation-api-1.1.0.Final.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/wagon-provider-api-2.10.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/xml-apis-1.0.b2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/xmlbeans-3.1.0.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES>
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/hamcrest-core-1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/jsr305-1.3.9.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 9 - 0
.idea/libraries/base_1_4_0.xml

@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="base-1.4.0">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/src/main/webapp/WEB-INF/lib/base-1.4.0.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>

+ 15 - 0
.idea/misc.xml

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

+ 202 - 0
.idea/workspace.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ArtifactsWorkspaceSettings">
+    <artifacts-to-build>
+      <artifact name="project-dydb:war" />
+    </artifacts-to-build>
+  </component>
+  <component name="AutoImportSettings">
+    <option name="autoReloadType" value="SELECTIVE" />
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="7ccd1d49-504a-4f69-8dd5-6c0dce4175ec" name="Changes" comment="" />
+    <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="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="MarkdownSettingsMigration">
+    <option name="stateVersion" value="1" />
+  </component>
+  <component name="MavenImportPreferences">
+    <option name="generalSettings">
+      <MavenGeneralSettings>
+        <option name="localRepository" value="C:\Users\Administrator\.m2\repository" />
+        <option name="mavenHome" value="$PROJECT_DIR$/../maven/apache-maven-3.3.9" />
+        <option name="useMavenConfig" value="true" />
+        <option name="userSettingsFile" value="F:\development\maven\apache-maven-3.3.9\conf\settings.xml" />
+      </MavenGeneralSettings>
+    </option>
+  </component>
+  <component name="ProjectId" id="2cceqq0xhKeRZDfK3rFVmMszsYZ" />
+  <component name="ProjectViewState">
+    <option name="hideEmptyMiddlePackages" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "RunOnceActivity.OpenProjectViewOnStart": "true",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "WebServerToolWindowFactoryState": "false",
+    "node.js.detected.package.eslint": "true",
+    "node.js.detected.package.tslint": "true",
+    "node.js.selected.package.eslint": "(autodetect)",
+    "node.js.selected.package.tslint": "(autodetect)",
+    "project.structure.last.edited": "Artifacts",
+    "project.structure.proportion": "0.15",
+    "project.structure.side.proportion": "0.2",
+    "settings.editor.selected.configurable": "MavenSettings",
+    "spring.configuration.checksum": "d41d8cd98f00b204e9800998ecf8427e",
+    "vue.rearranger.settings.migration": "true"
+  }
+}]]></component>
+  <component name="RebelAgentSelection">
+    <selection>jr</selection>
+  </component>
+  <component name="RunManager">
+    <configuration name="dydb-tomcat" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 8.5.40" ALTERNATIVE_JRE_ENABLED="false">
+      <option name="OPEN_IN_BROWSER_URL" value="http://localhost:8080/project_dydb_war" />
+      <option name="UPDATING_POLICY" value="restart-server" />
+      <deployment>
+        <artifact name="project-dydb:war">
+          <settings>
+            <option name="CONTEXT_PATH" value="/" />
+          </settings>
+        </artifact>
+      </deployment>
+      <server-settings>
+        <option name="BASE_DIRECTORY_NAME" value="a6d01123-d683-4d7d-89ec-a60305ddfb3e" />
+      </server-settings>
+      <predefined_log_file enabled="true" id="Tomcat" />
+      <predefined_log_file enabled="true" id="Tomcat Catalina" />
+      <predefined_log_file id="Tomcat Manager" />
+      <predefined_log_file id="Tomcat Host Manager" />
+      <predefined_log_file id="Tomcat Localhost Access" />
+      <RunnerSettings RunnerId="Debug">
+        <option name="DEBUG_PORT" value="62990" />
+      </RunnerSettings>
+      <RunnerSettings RunnerId="JRebel Debug">
+        <option name="DEBUG_PORT" value="62991" />
+      </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="JRebel 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="JRebel Executor">
+        <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="Profile">
+        <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 v="2">
+        <option name="Make" enabled="true" />
+        <option name="BuildArtifacts" enabled="true">
+          <artifact name="project-dydb:war" />
+        </option>
+      </method>
+    </configuration>
+  </component>
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="7ccd1d49-504a-4f69-8dd5-6c0dce4175ec" name="Changes" comment="" />
+      <created>1708415489784</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1708415489784</updated>
+      <workItem from="1708415491364" duration="6336000" />
+      <workItem from="1708476641696" duration="7054000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="3" />
+  </component>
+</project>

BIN
__MACOSX/._pom.xml


BIN
__MACOSX/src/._.DS_Store


BIN
__MACOSX/src/main/._.DS_Store


BIN
__MACOSX/src/main/java/._.DS_Store


BIN
__MACOSX/src/main/java/com/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/ali/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/ali/bo/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/ali/service/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/lianjia/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/lianjia/dao/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/lianjia/service/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/loanorder/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/loanorder/bo/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/loanorder/dao/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/loanorder/service/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/meishan/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/meishan/bo/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/meishan/service/._.DS_Store


BIN
__MACOSX/src/main/java/com/leeroa/dydb/datasource/touming/._.DS_Store


BIN
__MACOSX/src/main/resources/._.DS_Store


BIN
__MACOSX/src/main/resources/exp/._export_communityImport.xlsx


BIN
__MACOSX/src/main/resources/exp/._export_communityPrice.xlsx


BIN
__MACOSX/src/main/resources/exp/._export_dataQiyuDeal.xlsx


BIN
__MACOSX/src/main/resources/exp/._export_dataQiyuUp.xlsx


BIN
__MACOSX/src/main/resources/imp/._数据库-不动产证.xlsx


BIN
__MACOSX/src/main/resources/imp/._数据库-土地证.xlsx


BIN
__MACOSX/src/main/resources/imp/._数据库-房产证.xlsx


BIN
__MACOSX/src/main/resources/imp/._数据库-指导价.xlsx


BIN
__MACOSX/src/main/webapp/._.DS_Store


BIN
__MACOSX/src/main/webapp/WEB-INF/._.DS_Store


BIN
__MACOSX/src/main/webapp/app/._.DS_Store


BIN
__MACOSX/src/main/webapp/app/core/._.DS_Store


BIN
__MACOSX/src/main/webapp/app/dydb/._.DS_Store


BIN
__MACOSX/src/main/webapp/app/dyoa/._.DS_Store


BIN
__MACOSX/src/main/webapp/app/main/._.DS_Store


BIN
__MACOSX/src/main/webapp/app/mobile/._.DS_Store


BIN
__MACOSX/src/main/webapp/vendor/._.DS_Store


+ 68 - 0
pom.xml

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.leeroa</groupId>
+    <artifactId>project-dydb</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>war</packaging>
+    <description>
+        大友数据库系统
+    </description>
+    <!-- 指定仓库地址 -->
+    <repositories>
+        <repository>
+            <id>central</id>
+            <name>central repo</name>
+            <url>http://nexus.leeroa.com/content/groups/public</url>
+        </repository>
+    </repositories>
+
+
+    <dependencies>
+        
+        <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.24</version>
+            <scope>provided</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <!--
+            排除资源文件,不打在jar包中
+            由于是war包,所以直接将资源文件拷贝到classes目录下
+        -->
+        <finalName>dydb</finalName>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <excludes>
+                    <exclude>config-*.properties</exclude>
+                </excludes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                    <encoding>utf-8</encoding>
+                    <compilerArguments>
+                        <extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
+                    </compilerArguments>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>

BIN
src/.DS_Store


BIN
src/main/.DS_Store


BIN
src/main/java/.DS_Store


BIN
src/main/java/com/.DS_Store


BIN
src/main/java/com/leeroa/.DS_Store


+ 9 - 0
src/main/java/com/leeroa/core/index/bo/IndexWeightBo.java

@@ -0,0 +1,9 @@
+package com.leeroa.core.index.bo;
+
+import com.michael.core.hibernate.criteria.BO;
+
+/**
+ * @author Michael
+ */
+public class IndexWeightBo implements BO {
+}

+ 20 - 0
src/main/java/com/leeroa/core/index/bo/IndexWeightDetailBo.java

@@ -0,0 +1,20 @@
+package com.leeroa.core.index.bo;
+
+import com.michael.core.hibernate.criteria.BO;
+import com.michael.core.hibernate.criteria.Condition;
+
+/**
+ * @author Michael
+ */
+public class IndexWeightDetailBo implements BO {
+    @Condition
+    private String indexWeightName;
+
+    public String getIndexWeightName() {
+        return indexWeightName;
+    }
+
+    public void setIndexWeightName(String indexWeightName) {
+        this.indexWeightName = indexWeightName;
+    }
+}

+ 50 - 0
src/main/java/com/leeroa/core/index/dao/IndexWeightDao.java

@@ -0,0 +1,50 @@
+package com.leeroa.core.index.dao;
+
+import com.leeroa.core.index.bo.IndexWeightBo;
+import com.leeroa.core.index.domain.IndexWeight;
+
+import java.util.List;
+
+/**
+ * @author Michael
+ */
+public interface IndexWeightDao {
+
+    String save(IndexWeight indexWeight);
+
+    void update(IndexWeight indexWeight);
+
+    /**
+     * 高级查询接口,不使用分页
+     */
+    List<IndexWeight> query(IndexWeightBo bo);
+
+    /**
+     * 高级查询接口,使用分页
+     */
+    List<IndexWeight> pageQuery(IndexWeightBo bo);
+
+    /**
+     * 查询总记录数
+     */
+    Long getTotal(IndexWeightBo bo);
+
+    IndexWeight findById(String id);
+
+    void deleteById(String id);
+
+    /**
+     * 根据实体对象删除
+     * 必须保证该实体是存在的(一般是get或者load得到的对象)
+     */
+    void delete(IndexWeight indexWeight);
+
+    /**
+     * 判断是否具有重复的项
+     *
+     * @param name 指标项
+     * @param id   排除自身
+     * @return true:存在
+     */
+    boolean hasName(String name, String id);
+}

+ 42 - 0
src/main/java/com/leeroa/core/index/dao/IndexWeightDetailDao.java

@@ -0,0 +1,42 @@
+package com.leeroa.core.index.dao;
+
+import com.leeroa.core.index.bo.IndexWeightDetailBo;
+import com.leeroa.core.index.domain.IndexWeightDetail;
+
+import java.util.List;
+
+/**
+ * @author Michael
+ */
+public interface IndexWeightDetailDao {
+
+    String save(IndexWeightDetail indexWeightDetail);
+
+    void update(IndexWeightDetail indexWeightDetail);
+
+    /**
+     * 高级查询接口,不使用分页
+     */
+    List<IndexWeightDetail> query(IndexWeightDetailBo bo);
+
+    /**
+     * 高级查询接口,使用分页
+     */
+    List<IndexWeightDetail> pageQuery(IndexWeightDetailBo bo);
+
+    /**
+     * 查询总记录数
+     */
+    Long getTotal(IndexWeightDetailBo bo);
+
+    IndexWeightDetail findById(String id);
+
+    void deleteById(String id);
+
+    /**
+     * 根据实体对象删除
+     * 必须保证该实体是存在的(一般是get或者load得到的对象)
+     */
+    void delete(IndexWeightDetail indexWeightDetail);
+
+}

+ 94 - 0
src/main/java/com/leeroa/core/index/dao/impl/IndexWeightDaoImpl.java

@@ -0,0 +1,94 @@
+package com.leeroa.core.index.dao.impl;
+
+import com.leeroa.core.index.bo.IndexWeightBo;
+import com.leeroa.core.index.dao.IndexWeightDao;
+import com.leeroa.core.index.domain.IndexWeight;
+import com.michael.core.hibernate.HibernateDaoHelper;
+import com.michael.core.hibernate.criteria.CriteriaUtils;
+import com.michael.utils.string.StringUtils;
+import org.hibernate.Criteria;
+import org.hibernate.criterion.Restrictions;
+import org.springframework.stereotype.Repository;
+import org.springframework.util.Assert;
+
+import java.util.List;
+
+
+/**
+ * @author Michael
+ */
+@Repository("indexWeightDao")
+public class IndexWeightDaoImpl extends HibernateDaoHelper implements IndexWeightDao {
+
+    @Override
+    public String save(IndexWeight indexWeight) {
+        return (String) getSession().save(indexWeight);
+    }
+
+    @Override
+    public void update(IndexWeight indexWeight) {
+        getSession().update(indexWeight);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<IndexWeight> query(IndexWeightBo bo) {
+        Criteria criteria = createCriteria(IndexWeight.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<IndexWeight> pageQuery(IndexWeightBo bo) {
+        Criteria criteria = createPagerCriteria(IndexWeight.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    public Long getTotal(IndexWeightBo bo) {
+        Criteria criteria = createRowCountsCriteria(IndexWeight.class);
+        initCriteria(criteria, bo);
+        return (Long) criteria.uniqueResult();
+    }
+
+
+    @Override
+    public void deleteById(String id) {
+        getSession().createQuery("delete from " + IndexWeight.class.getName() + " e where e.id=:id")
+                .setParameter("id", id)
+                .executeUpdate();
+    }
+
+    @Override
+    public void delete(IndexWeight indexWeight) {
+        Assert.notNull(indexWeight, "要删除的对象不能为空!");
+        getSession().delete(indexWeight);
+    }
+
+    @Override
+    public IndexWeight findById(String id) {
+        Assert.hasText(id, "ID不能为空!");
+        return (IndexWeight) getSession().get(IndexWeight.class, id);
+    }
+
+    @Override
+    public boolean hasName(String name, String id) {
+        Assert.hasText(name, "查询失败!指标项不能为空!");
+        Criteria criteria = createRowCountsCriteria(IndexWeight.class)
+                .add(Restrictions.eq("name", name));
+        if (StringUtils.isNotEmpty(id)) {
+            criteria.add(Restrictions.ne("id", id));
+        }
+        return (Long) criteria.uniqueResult() > 0;
+    }
+
+    private void initCriteria(Criteria criteria, IndexWeightBo bo) {
+        Assert.notNull(criteria, "criteria must not be null!");
+        if (bo != null) {
+            CriteriaUtils.addCondition(criteria, bo);
+        }
+    }
+
+}

+ 82 - 0
src/main/java/com/leeroa/core/index/dao/impl/IndexWeightDetailDaoImpl.java

@@ -0,0 +1,82 @@
+package com.leeroa.core.index.dao.impl;
+
+import com.leeroa.core.index.bo.IndexWeightDetailBo;
+import com.leeroa.core.index.dao.IndexWeightDetailDao;
+import com.leeroa.core.index.domain.IndexWeightDetail;
+import com.michael.core.hibernate.HibernateDaoHelper;
+import com.michael.core.hibernate.criteria.CriteriaUtils;
+import org.hibernate.Criteria;
+import org.springframework.stereotype.Repository;
+import org.springframework.util.Assert;
+
+import java.util.List;
+
+
+/**
+ * @author Michael
+ */
+@Repository("indexWeightDetailDao")
+public class IndexWeightDetailDaoImpl extends HibernateDaoHelper implements IndexWeightDetailDao {
+
+    @Override
+    public String save(IndexWeightDetail indexWeightDetail) {
+        return (String) getSession().save(indexWeightDetail);
+    }
+
+    @Override
+    public void update(IndexWeightDetail indexWeightDetail) {
+        getSession().update(indexWeightDetail);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<IndexWeightDetail> query(IndexWeightDetailBo bo) {
+        Criteria criteria = createCriteria(IndexWeightDetail.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<IndexWeightDetail> pageQuery(IndexWeightDetailBo bo) {
+        Criteria criteria = createPagerCriteria(IndexWeightDetail.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    public Long getTotal(IndexWeightDetailBo bo) {
+        Criteria criteria = createRowCountsCriteria(IndexWeightDetail.class);
+        initCriteria(criteria, bo);
+        return (Long) criteria.uniqueResult();
+    }
+
+
+    @Override
+    public void deleteById(String id) {
+        getSession().createQuery("delete from " + IndexWeightDetail.class.getName() + " e where e.id=:id")
+                .setParameter("id", id)
+                .executeUpdate();
+    }
+
+    @Override
+    public void delete(IndexWeightDetail indexWeightDetail) {
+        Assert.notNull(indexWeightDetail, "要删除的对象不能为空!");
+        getSession().delete(indexWeightDetail);
+    }
+
+    @Override
+    public IndexWeightDetail findById(String id) {
+        Assert.hasText(id, "ID不能为空!");
+        return (IndexWeightDetail) getSession().get(IndexWeightDetail.class, id);
+    }
+
+
+    private void initCriteria(Criteria criteria, IndexWeightDetailBo bo) {
+        Assert.notNull(criteria, "criteria must not be null!");
+        if (bo != null) {
+            CriteriaUtils.addCondition(criteria, bo);
+        }
+    }
+
+}

+ 76 - 0
src/main/java/com/leeroa/core/index/domain/IndexWeight.java

@@ -0,0 +1,76 @@
+package com.leeroa.core.index.domain;
+
+import com.michael.common.CommonDomain;
+import com.michael.docs.annotations.ApiField;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Index;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+
+/**
+ * 指标权重
+ *
+ * @author Michael
+ */
+@Entity
+@Table(name = "base_index_weight", indexes = {
+        @Index(name = "index_name", columnList = "name")
+})
+public class IndexWeight extends CommonDomain {
+    public static final String TYPE_VALUE = "值等";
+    public static final String TYPE_RANGE = "范围";
+    @ApiField(value = "指标项")
+    @NotNull
+    @Column(name = "name", nullable = false, unique = true, length = 32)
+    private String name;
+
+    @ApiField(value = "公式类型")
+    @NotNull
+    @Column(name = "formulaType", nullable = false, length = 20)
+    private String formulaType;
+
+    @ApiField(value = "权重")
+    @Column(name = "weight", length = 20)
+    private String weight;
+
+    @ApiField(value = "备注")
+    @Column(name = "description", length = 100)
+    private String description;
+
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setFormulaType(String formulaType) {
+        this.formulaType = formulaType;
+    }
+
+    public String getFormulaType() {
+        return this.formulaType;
+    }
+
+    public void setWeight(String weight) {
+        this.weight = weight;
+    }
+
+    public String getWeight() {
+        return this.weight;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+
+}

+ 133 - 0
src/main/java/com/leeroa/core/index/domain/IndexWeightDetail.java

@@ -0,0 +1,133 @@
+package com.leeroa.core.index.domain;
+
+import com.michael.common.CommonDomain;
+import com.michael.docs.annotations.ApiField;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Index;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+
+/**
+ * 指标权重明细
+ *
+ * @author Michael
+ */
+@Entity
+@Table(name = "base_index_weight_detail", indexes = {
+        @Index(name = "index_indexWeightName", columnList = "indexWeightName")
+})
+public class IndexWeightDetail extends CommonDomain {
+
+    @ApiField(value = "指标项")
+    @NotNull
+    @Column(name = "indexWeightName", nullable = false, length = 32)
+    private String indexWeightName;
+
+    @ApiField(value = "公式类型")
+    @NotNull
+    @Column(name = "formulaType", nullable = false, length = 20)
+    private String formulaType;
+
+    @ApiField(value = "公式")
+    @NotNull
+    @Column(name = "formula", nullable = false, length = 100)
+    private String formula;
+
+    @ApiField(value = "值")
+    @NotNull
+    @Column(name = "index_values", nullable = false, length = 64)
+    private String values;
+
+    // 只有当是范围时,该字段才有效。
+    @ApiField(value = "等级")
+    @Column(name = "levels")
+    private Integer levels;
+    @ApiField(value = "预留字段1")
+    @Column(length = 100)
+    private String c1;
+    @ApiField(value = "预留字段2")
+    @Column(length = 100)
+    private String c2;
+    @ApiField(value = "预留字段3")
+    @Column(length = 100)
+    private String c3;
+    @ApiField(value = "预留字段4")
+    @Column(length = 100)
+    private String c4;
+
+    public String getC3() {
+        return c3;
+    }
+
+    public void setC3(String c3) {
+        this.c3 = c3;
+    }
+
+    public String getC4() {
+        return c4;
+    }
+
+    public void setC4(String c4) {
+        this.c4 = c4;
+    }
+
+    public String getC1() {
+        return c1;
+    }
+
+    public void setC1(String c1) {
+        this.c1 = c1;
+    }
+
+    public String getC2() {
+        return c2;
+    }
+
+    public void setC2(String c2) {
+        this.c2 = c2;
+    }
+
+    public void setIndexWeightName(String indexWeightName) {
+        this.indexWeightName = indexWeightName;
+    }
+
+    public String getIndexWeightName() {
+        return this.indexWeightName;
+    }
+
+    public void setFormulaType(String formulaType) {
+        this.formulaType = formulaType;
+    }
+
+    public String getFormulaType() {
+        return this.formulaType;
+    }
+
+    public void setFormula(String formula) {
+        this.formula = formula;
+    }
+
+    public String getFormula() {
+        return this.formula;
+    }
+
+    public void setValues(String values) {
+        this.values = values;
+    }
+
+    public String getValues() {
+        return this.values;
+    }
+
+    public void setLevels(Integer levels) {
+        this.levels = levels;
+    }
+
+    public Integer getLevels() {
+        return this.levels;
+    }
+
+
+}

+ 52 - 0
src/main/java/com/leeroa/core/index/service/IndexWeightDetailService.java

@@ -0,0 +1,52 @@
+package com.leeroa.core.index.service;
+
+import com.leeroa.core.index.bo.IndexWeightDetailBo;
+import com.leeroa.core.index.domain.IndexWeightDetail;
+import com.leeroa.core.index.vo.IndexWeightDetailVo;
+import com.michael.core.pager.PageVo;
+
+import java.util.List;
+
+/**
+ * @author Michael
+ */
+public interface IndexWeightDetailService {
+
+    /**
+     * 保存
+     */
+    String save(IndexWeightDetail indexWeightDetail);
+
+    /**
+     * 更新
+     */
+    void update(IndexWeightDetail indexWeightDetail);
+
+    /**
+     * 分页查询
+     */
+    PageVo pageQuery(IndexWeightDetailBo bo);
+
+    /**
+     * 不进行分页,常用于对外提供的查询接口
+     */
+    List<IndexWeightDetailVo> query(IndexWeightDetailBo bo);
+
+    /**
+     * 根据ID查询对象的信息
+     */
+    IndexWeightDetailVo findById(String id);
+
+    /**
+     * 强制删除
+     */
+    void deleteByIds(String[] ids);
+
+
+    /**
+     * 重新保存
+     *
+     * @param indexWeightDetail
+     */
+    void batchSave(IndexWeightDetail[] indexWeightDetail);
+}

+ 54 - 0
src/main/java/com/leeroa/core/index/service/IndexWeightService.java

@@ -0,0 +1,54 @@
+package com.leeroa.core.index.service;
+
+import com.leeroa.core.index.bo.IndexWeightBo;
+import com.leeroa.core.index.domain.IndexWeight;
+import com.leeroa.core.index.vo.IndexWeightVo;
+import com.michael.core.pager.PageVo;
+
+import java.util.List;
+
+/**
+ * @author Michael
+ */
+public interface IndexWeightService {
+
+    /**
+     * 保存
+     */
+    String save(IndexWeight indexWeight);
+
+    /**
+     * 删除以前的重新保存
+     *
+     * @param indexWeights
+     */
+    void clearAndSave(IndexWeight[] indexWeights);
+
+
+    /**
+     * 更新
+     */
+    void update(IndexWeight indexWeight);
+
+    /**
+     * 分页查询
+     */
+    PageVo pageQuery(IndexWeightBo bo);
+
+    /**
+     * 不进行分页,常用于对外提供的查询接口
+     */
+    List<IndexWeightVo> query(IndexWeightBo bo);
+
+    /**
+     * 根据ID查询对象的信息
+     */
+    IndexWeightVo findById(String id);
+
+    /**
+     * 强制删除
+     */
+    void deleteByIds(String[] ids);
+
+
+}

+ 130 - 0
src/main/java/com/leeroa/core/index/service/impl/IndexWeightDetailServiceImpl.java

@@ -0,0 +1,130 @@
+package com.leeroa.core.index.service.impl;
+
+import com.leeroa.base.parameter.service.ParameterContainer;
+import com.leeroa.core.index.bo.IndexWeightDetailBo;
+import com.leeroa.core.index.dao.IndexWeightDetailDao;
+import com.leeroa.core.index.domain.IndexWeightDetail;
+import com.leeroa.core.index.service.IndexWeightDetailService;
+import com.leeroa.core.index.vo.IndexWeightDetailVo;
+import com.michael.core.beans.BeanWrapBuilder;
+import com.michael.core.beans.BeanWrapCallback;
+import com.michael.core.hibernate.HibernateUtils;
+import com.michael.core.hibernate.validator.ValidatorUtils;
+import com.michael.core.pager.PageVo;
+import com.michael.utils.string.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
+
+import javax.annotation.Resource;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Michael
+ */
+@Service("indexWeightDetailService")
+public class IndexWeightDetailServiceImpl implements IndexWeightDetailService, BeanWrapCallback<IndexWeightDetail, IndexWeightDetailVo> {
+    @Resource
+    private IndexWeightDetailDao indexWeightDetailDao;
+
+    @Override
+    public String save(IndexWeightDetail indexWeightDetail) {
+        validate(indexWeightDetail);
+        String id = indexWeightDetailDao.save(indexWeightDetail);
+        return id;
+    }
+
+    @Override
+    public void update(IndexWeightDetail indexWeightDetail) {
+        validate(indexWeightDetail);
+        indexWeightDetailDao.update(indexWeightDetail);
+    }
+
+    private void validate(IndexWeightDetail indexWeightDetail) {
+        ValidatorUtils.validate(indexWeightDetail);
+    }
+
+    @Override
+    public PageVo pageQuery(IndexWeightDetailBo bo) {
+        PageVo vo = new PageVo();
+        Long total = indexWeightDetailDao.getTotal(bo);
+        vo.setTotal(total);
+        if (total == null || total == 0) {
+            return vo;
+        }
+        List<IndexWeightDetail> indexWeightDetailList = indexWeightDetailDao.pageQuery(bo);
+        List<IndexWeightDetailVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(indexWeightDetailList, IndexWeightDetailVo.class);
+        vo.setData(vos);
+        return vo;
+    }
+
+
+    @Override
+    public IndexWeightDetailVo findById(String id) {
+        IndexWeightDetail indexWeightDetail = indexWeightDetailDao.findById(id);
+        return BeanWrapBuilder.newInstance()
+                .wrap(indexWeightDetail, IndexWeightDetailVo.class);
+    }
+
+    @Override
+    public void deleteByIds(String[] ids) {
+        if (ids == null || ids.length == 0) {
+            return;
+        }
+        for (String id : ids) {
+            indexWeightDetailDao.deleteById(id);
+        }
+    }
+
+    @Override
+    public synchronized void batchSave(IndexWeightDetail[] indexWeightDetail) {
+        Assert.notEmpty(indexWeightDetail, "要保存的指标配置不能为空!");
+        // 删除原来的指标
+        // 指标类型(必须相等)
+        String indexWeightName = indexWeightDetail[0].getIndexWeightName();
+        HibernateUtils.getSession().createQuery("delete from " + IndexWeightDetail.class.getName() + " o where o.indexWeightName=:indexWeightName")
+                .setParameter("indexWeightName", indexWeightName)
+                .executeUpdate();
+
+        // 指标名称(必须不等)
+        Set<String> name = new HashSet<>();
+
+        int index = 1;
+        for (IndexWeightDetail detail : indexWeightDetail) {
+            Assert.isTrue(StringUtils.equals(indexWeightName, detail.getIndexWeightName()), "批量保存失败!指标类型必须一致!");
+
+            //  当为范围的时候,对范围公式进行校验
+            if (StringUtils.equals("范围", detail.getFormulaType())) {
+                // 为了保证数据的正确性,去掉中文符号和空白符号
+                String formula = detail.getFormula().replaceAll("【", "[").replaceAll("(", "(")
+                        .replaceAll("】", "]")
+                        .replaceAll(")", ")")
+                        .replaceAll("\\s+", "");
+                detail.setFormula(formula);
+            }
+            Assert.isTrue(!name.contains(detail.getFormula()), "批量保存失败!不能存在同名的公式!" + detail.getFormula());
+            name.add(detail.getFormula());
+            detail.setLevels(index++);
+            save(detail);
+        }
+    }
+
+    @Override
+    public List<IndexWeightDetailVo> query(IndexWeightDetailBo bo) {
+        List<IndexWeightDetail> indexWeightDetailList = indexWeightDetailDao.query(bo);
+        List<IndexWeightDetailVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(indexWeightDetailList, IndexWeightDetailVo.class);
+        return vos;
+    }
+
+
+    @Override
+    public void doCallback(IndexWeightDetail indexWeightDetail, IndexWeightDetailVo vo) {
+        ParameterContainer container = ParameterContainer.getInstance();
+
+    }
+}

+ 111 - 0
src/main/java/com/leeroa/core/index/service/impl/IndexWeightServiceImpl.java

@@ -0,0 +1,111 @@
+package com.leeroa.core.index.service.impl;
+
+import com.leeroa.base.parameter.service.ParameterContainer;
+import com.leeroa.core.index.bo.IndexWeightBo;
+import com.leeroa.core.index.dao.IndexWeightDao;
+import com.leeroa.core.index.domain.IndexWeight;
+import com.leeroa.core.index.service.IndexWeightService;
+import com.leeroa.core.index.vo.IndexWeightVo;
+import com.michael.core.beans.BeanWrapBuilder;
+import com.michael.core.beans.BeanWrapCallback;
+import com.michael.core.hibernate.HibernateUtils;
+import com.michael.core.hibernate.validator.ValidatorUtils;
+import com.michael.core.pager.PageVo;
+import com.michael.utils.string.StringUtils;
+import org.hibernate.Session;
+import org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author Michael
+ */
+@Service("indexWeightService")
+public class IndexWeightServiceImpl implements IndexWeightService, BeanWrapCallback<IndexWeight, IndexWeightVo> {
+    @Resource
+    private IndexWeightDao indexWeightDao;
+
+    @Override
+    public synchronized String save(IndexWeight indexWeight) {
+        validate(indexWeight);
+        String id = indexWeightDao.save(indexWeight);
+        return id;
+    }
+
+    @Override
+    public synchronized void clearAndSave(IndexWeight[] indexWeights) {
+        final Session session = HibernateUtils.getSession();
+        session.createQuery("delete from " + IndexWeight.class.getName())
+                .executeUpdate();
+        for (IndexWeight indexWeight : indexWeights) {
+            save(indexWeight);
+        }
+    }
+
+    @Override
+    public void update(IndexWeight indexWeight) {
+        validate(indexWeight);
+        indexWeightDao.update(indexWeight);
+    }
+
+    private void validate(IndexWeight indexWeight) {
+        ValidatorUtils.validate(indexWeight);
+        // 验证重复 - 指标项
+        if (StringUtils.isNotEmpty(indexWeight.getName())) {
+            boolean hasName = indexWeightDao.hasName(indexWeight.getName(), indexWeight.getId());
+            Assert.isTrue(!hasName, "操作失败!指标项[" + indexWeight.getName() + "]已经存在!");
+        }
+    }
+
+    @Override
+    public PageVo pageQuery(IndexWeightBo bo) {
+        PageVo vo = new PageVo();
+        Long total = indexWeightDao.getTotal(bo);
+        vo.setTotal(total);
+        if (total == null || total == 0) {
+            return vo;
+        }
+        List<IndexWeight> indexWeightList = indexWeightDao.pageQuery(bo);
+        List<IndexWeightVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(indexWeightList, IndexWeightVo.class);
+        vo.setData(vos);
+        return vo;
+    }
+
+
+    @Override
+    public IndexWeightVo findById(String id) {
+        IndexWeight indexWeight = indexWeightDao.findById(id);
+        return BeanWrapBuilder.newInstance()
+                .wrap(indexWeight, IndexWeightVo.class);
+    }
+
+    @Override
+    public void deleteByIds(String[] ids) {
+        if (ids == null || ids.length == 0) {
+            return;
+        }
+        for (String id : ids) {
+            indexWeightDao.deleteById(id);
+        }
+    }
+
+    @Override
+    public List<IndexWeightVo> query(IndexWeightBo bo) {
+        List<IndexWeight> indexWeightList = indexWeightDao.query(bo);
+        List<IndexWeightVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(indexWeightList, IndexWeightVo.class);
+        return vos;
+    }
+
+
+    @Override
+    public void doCallback(IndexWeight indexWeight, IndexWeightVo vo) {
+        ParameterContainer container = ParameterContainer.getInstance();
+
+    }
+}

+ 172 - 0
src/main/java/com/leeroa/core/index/utils/IndexWeightUtils.java

@@ -0,0 +1,172 @@
+package com.leeroa.core.index.utils;
+
+import com.leeroa.core.index.domain.IndexWeight;
+import com.leeroa.core.index.domain.IndexWeightDetail;
+import com.michael.core.hibernate.HibernateUtils;
+import com.michael.utils.string.StringUtils;
+import org.hibernate.Session;
+import org.hibernate.criterion.Order;
+import org.hibernate.criterion.Restrictions;
+import org.springframework.util.Assert;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * @author michael
+ */
+public class IndexWeightUtils {
+    public static final String INDEX_TITLE = "INDEX_TITLE";
+    public static final String INDEX_NOTICE = "INDEX_NOTICE";
+    public static final String INDEX_ITEMS = "INDEX_ITEMS";
+    public static final String INDEX_FIELDS = "INDEX_FIELDS";
+
+    /**
+     * 跳转到对应的权重页面。
+     * Request中可以配置的属性:
+     * INDEX_TITLE  标题
+     * INDEX_NOTICE  注意事项
+     * INDEX_ITEMS   选项的标题
+     * INDEX_FIELDS  选项对应的字段(必须与标题一一对应)
+     * 如果没有配置INDEX_ITEMS ,则默认会配置(名称/公式、值)
+     * 如果没有配置INDEX_FIELDS ,则默认会配置(formula、values)
+     *
+     * @param request
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static String forward(HttpServletRequest request) {
+        String type = (String) request.getAttribute("formulaType");
+        Assert.hasText(type, "formulaType不能为空!");
+        String indexWeightName = (String) request.getAttribute("indexWeightName");
+        Assert.hasText(indexWeightName, "indexWeightName不能为空!");
+        Assert.isTrue(StringUtils.include(type, IndexWeight.TYPE_RANGE, IndexWeight.TYPE_VALUE), "错误的formulaType!" + type);
+        List<String> items = (List<String>) request.getAttribute(INDEX_ITEMS);
+        if (items == null || items.isEmpty()) {
+            items = new ArrayList<>();
+            items.add("名称");
+            items.add("值");
+            request.setAttribute(INDEX_ITEMS, items);
+        }
+        List<String> fields = (List<String>) request.getAttribute(INDEX_FIELDS);
+        if (fields == null || fields.isEmpty()) {
+            fields = new ArrayList<>();
+            fields.add("formula");
+            fields.add("values");
+            request.setAttribute(INDEX_FIELDS, items);
+        }
+        if (request.getAttribute(INDEX_TITLE) == null) {
+            request.setAttribute(INDEX_TITLE, "权重配置-" + indexWeightName);
+        }
+        if (StringUtils.equals(IndexWeight.TYPE_RANGE, type)) {
+            return "core/index/indexWeightDetail/indexWeightDetail_range";
+        }
+        return "core/index/indexWeightDetail/indexWeightDetail_value";
+    }
+
+
+    /**
+     * 获取指定指标名称,指定值所对应的指标配置
+     *
+     * @param weightName 指标项名称
+     * @param value      要进行查找的值
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static IndexWeightDetail getIndex(String weightName, String value) {
+        return getIndexByField("formula", weightName, value);
+    }
+
+    @SuppressWarnings("unchecked")
+    public static IndexWeightDetail getIndexByField(String fieldName, String weightName, String value) {
+        final Session session = HibernateUtils.getSession();
+        List<IndexWeightDetail> details = session.createCriteria(IndexWeightDetail.class)
+                .add(Restrictions.eq("indexWeightName", weightName))
+                .addOrder(Order.asc("levels"))
+                .list();
+        Assert.notEmpty(details, "没有获取到权重配置:" + weightName);
+        String formulaType = details.get(0).getFormulaType();
+        // 如果是值等
+        if (IndexWeight.TYPE_VALUE.equals(formulaType)) {
+            Optional<IndexWeightDetail> option = details.stream().filter(k -> {
+                return k.getFormula().equals(value);
+            }).findFirst();
+            return option.orElse(null);
+        }
+        // 如果是范围
+        if (IndexWeight.TYPE_RANGE.equals(formulaType)) {
+            double doubleValue = Double.parseDouble(value);
+            for (IndexWeightDetail detail : details) {
+                // 公式 (或[开头,)或]结尾,-表示无穷
+                String formula = null;
+                if (StringUtils.equals(fieldName, "formula")) {
+                    formula = detail.getFormula().replaceAll("\\s+", "");
+                }
+                if (StringUtils.equals(fieldName, "c1")) {
+                    formula = detail.getC1().replaceAll("\\s+", "");
+                }
+                if (StringUtils.equals(fieldName, "c2")) {
+                    formula = detail.getC2().replaceAll("\\s+", "");
+                }
+                if (StringUtils.equals(fieldName, "c3")) {
+                    formula = detail.getC3().replaceAll("\\s+", "");
+                }
+                if (StringUtils.equals(fieldName, "c4")) {
+                    formula = detail.getC4().replaceAll("\\s+", "");
+                }
+                Assert.hasText(formula, "没有获取到配置的值!" + fieldName);
+                char startChar = formula.charAt(0);
+                char endChar = formula.charAt(formula.length() - 1);
+
+                // 取出第一个值和第二个值
+                String[] values = formula.substring(1, formula.length() - 1).split(",");
+                Assert.isTrue(values.length == 2, "【" + weightName + "】错误的范围配置:" + formula);
+                String firstValue = values[0];
+                String secondValue = values[1];
+
+                // 默认表示匹配成功
+                boolean flag = true;
+                // 判断当前值是否符合大于第一个数,并且小于第二个数
+
+                // 判断第一个值
+                if (!"-".equals(firstValue)) {
+                    double first = Double.parseDouble(firstValue);
+                    if (startChar == '(') {
+                        flag = first < doubleValue;
+                    } else if (startChar == '[') {
+                        flag = first <= doubleValue;
+                    } else {
+                        Assert.isTrue(false, "不合法的公式符号:" + startChar);
+                    }
+                }
+                // 如果第一个就不匹配,则进行下一轮
+                if (!flag) {
+                    continue;
+                }
+
+                // 判断第二个值
+                if (!"-".equals(secondValue)) {
+                    double second = Double.parseDouble(secondValue);
+                    if (endChar == ')') {
+                        flag = second > doubleValue;
+                    } else if (endChar == ']') {
+                        flag = second >= doubleValue;
+                    } else {
+                        Assert.isTrue(false, "不合法的公式符号:" + endChar);
+                    }
+                }
+
+                // 如果flag为true,表示找到了,直接返回
+                if (flag) {
+                    return detail;
+                }
+
+            }
+            Assert.isTrue(false, "没有找到符合[" + weightName + "]范围的配置项:" + doubleValue);
+        }
+        Assert.isTrue(false, "不支持的类型:" + formulaType);
+        return null;
+    }
+}

+ 59 - 0
src/main/java/com/leeroa/core/index/utils/RegUtils.java

@@ -0,0 +1,59 @@
+package com.leeroa.core.index.utils;
+
+/**
+ * @author michael
+ */
+public class RegUtils {
+    /**
+     * 判断指定字符串是否是整形数字
+     *
+     * @param value
+     * @return
+     */
+    public static boolean isInt(String value) {
+        if (value == null || "".equals(value.trim())) {
+            return false;
+        }
+        return value.matches("-?\\d+");
+    }
+
+    /**
+     * 判断指定字符串是不是double类型的
+     * 支持正负,如果是负数(负号后面不能直接跟.)
+     *
+     * @param value
+     * @return
+     */
+    public static boolean isDouble(String value) {
+        if (value == null || "".equals(value.trim())) {
+            return false;
+        }
+        return value.matches("-?\\d+(\\.\\d+)?") || value.matches("\\.\\d+");
+    }
+
+    /**
+     * 判断指定字符串是否是一个合格的11位手机号
+     *
+     * @param mobile
+     * @return
+     */
+    public static boolean isOneMobile(String mobile) {
+        if (mobile == null || "".equals(mobile.trim())) {
+            return false;
+        }
+        return mobile.matches("1\\d{10}");
+    }
+
+    /**
+     * 判断指定字符串是否是多个11位手机号组成的(用英文逗号分隔)
+     *
+     * @param mobile
+     * @return
+     */
+    public static boolean isMultiMobile(String mobile) {
+        if (mobile == null || "".equals(mobile.trim())) {
+            return false;
+        }
+        return mobile.matches("1\\d{10}(1\\d{10})*");
+    }
+}

+ 10 - 0
src/main/java/com/leeroa/core/index/vo/IndexWeightDetailVo.java

@@ -0,0 +1,10 @@
+package com.leeroa.core.index.vo;
+
+import com.leeroa.core.index.domain.IndexWeightDetail;
+
+/**
+ * @author Michael
+ */
+public class IndexWeightDetailVo extends IndexWeightDetail {
+
+}

+ 10 - 0
src/main/java/com/leeroa/core/index/vo/IndexWeightVo.java

@@ -0,0 +1,10 @@
+package com.leeroa.core.index.vo;
+
+import com.leeroa.core.index.domain.IndexWeight;
+
+/**
+ * @author Michael
+ */
+public class IndexWeightVo extends IndexWeight {
+
+}

+ 113 - 0
src/main/java/com/leeroa/core/index/web/IndexWeightCtrl.java

@@ -0,0 +1,113 @@
+package com.leeroa.core.index.web;
+
+import com.leeroa.core.index.bo.IndexWeightBo;
+import com.leeroa.core.index.domain.IndexWeight;
+import com.leeroa.core.index.service.IndexWeightService;
+import com.leeroa.core.index.vo.IndexWeightVo;
+import com.michael.common.JspAccessType;
+import com.michael.core.pager.PageVo;
+import com.michael.core.web.BaseController;
+import com.michael.utils.gson.GsonUtils;
+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;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * @author Michael
+ */
+@Controller
+@RequestMapping(value = {"/core/index/indexWeight"})
+public class IndexWeightCtrl extends BaseController {
+    @Resource
+    private IndexWeightService indexWeightService;
+
+
+    @RequestMapping(value = {""}, method = RequestMethod.GET)
+    public String toList() {
+        return "core/index/indexWeight/indexWeight_edit";
+    }
+
+    @RequestMapping(value = "/add", method = RequestMethod.GET)
+    public String toAdd(HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.ADD);
+        return "core/index/indexWeight/indexWeight_edit";
+    }
+
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public void save(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeight indexWeight = GsonUtils.wrapDataToEntity(request, IndexWeight.class);
+        indexWeightService.save(indexWeight);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = "/save-batch", method = RequestMethod.POST)
+    @ResponseBody
+    public void batchSave(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeight[] indexWeight = GsonUtils.wrapDataToEntity(request, IndexWeight[].class);
+        indexWeightService.clearAndSave(indexWeight);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = "/modify", params = {"id"}, method = RequestMethod.GET)
+    public String toModify(@RequestParam String id, HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.MODIFY);
+        request.setAttribute("id", id);
+        return "core/index/indexWeight/indexWeight_edit";
+    }
+
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public void update(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeight indexWeight = GsonUtils.wrapDataToEntity(request, IndexWeight.class);
+        indexWeightService.update(indexWeight);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = {"/detail"}, params = {"id"}, method = RequestMethod.GET)
+    public String toDetail(@RequestParam String id, HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.DETAIL);
+        request.setAttribute("id", id);
+        return "core/index/indexWeight/indexWeight_edit";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/get", params = {"id"}, method = RequestMethod.GET)
+    public void findById(@RequestParam String id, HttpServletResponse response) {
+        IndexWeightVo vo = indexWeightService.findById(id);
+        GsonUtils.printData(response, vo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/pageQuery", method = RequestMethod.POST)
+    public void pageQuery(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeightBo bo = GsonUtils.wrapDataToEntity(request, IndexWeightBo.class);
+        PageVo pageVo = indexWeightService.pageQuery(bo);
+        GsonUtils.printData(response, pageVo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/query", method = RequestMethod.POST)
+    public void query(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeightBo bo = GsonUtils.wrapDataToEntity(request, IndexWeightBo.class);
+        List<IndexWeightVo> vos = indexWeightService.query(bo);
+        GsonUtils.printData(response, vos);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public void deleteByIds(HttpServletRequest request, HttpServletResponse response) {
+        String[] ids = GsonUtils.wrapDataToEntity(request, String[].class);
+        indexWeightService.deleteByIds(ids);
+        GsonUtils.printSuccess(response);
+    }
+
+
+}

+ 104 - 0
src/main/java/com/leeroa/core/index/web/IndexWeightDetailCtrl.java

@@ -0,0 +1,104 @@
+package com.leeroa.core.index.web;
+
+import com.leeroa.core.index.bo.IndexWeightDetailBo;
+import com.leeroa.core.index.domain.IndexWeight;
+import com.leeroa.core.index.domain.IndexWeightDetail;
+import com.leeroa.core.index.service.IndexWeightDetailService;
+import com.leeroa.core.index.vo.IndexWeightDetailVo;
+import com.michael.core.pager.PageVo;
+import com.michael.core.web.BaseController;
+import com.michael.utils.gson.GsonUtils;
+import com.michael.utils.string.StringUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.Assert;
+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.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * @author Michael
+ */
+@Controller
+@RequestMapping(value = {"/core/index/indexWeightDetail"})
+public class IndexWeightDetailCtrl extends BaseController {
+    @Resource
+    private IndexWeightDetailService indexWeightDetailService;
+
+
+    @RequestMapping(value = "/add", method = RequestMethod.GET)
+    public String toAdd(HttpServletRequest request) {
+        String type = (String) request.getAttribute("formulaType");
+        Assert.hasText(type, "formulaType不能为空!");
+        String indexWeightName = (String) request.getAttribute("indexWeightName");
+        Assert.hasText(indexWeightName, "indexWeightName不能为空!");
+        Assert.isTrue(StringUtils.include(type, IndexWeight.TYPE_RANGE, IndexWeight.TYPE_VALUE), "错误的formulaType!" + type);
+        if (StringUtils.equals(IndexWeight.TYPE_RANGE, type)) {
+            return "core/index/indexWeightDetail/indexWeightDetail_range";
+        }
+        return "core/index/indexWeightDetail/indexWeightDetail_value";
+    }
+
+
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public void save(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeightDetail indexWeightDetail = GsonUtils.wrapDataToEntity(request, IndexWeightDetail.class);
+        indexWeightDetailService.save(indexWeightDetail);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = "/save-batch", method = RequestMethod.POST)
+    @ResponseBody
+    public void batchSave(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeightDetail[] indexWeightDetail = GsonUtils.wrapDataToEntity(request, IndexWeightDetail[].class);
+        indexWeightDetailService.batchSave(indexWeightDetail);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public void update(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeightDetail indexWeightDetail = GsonUtils.wrapDataToEntity(request, IndexWeightDetail.class);
+        indexWeightDetailService.update(indexWeightDetail);
+        GsonUtils.printSuccess(response);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/get", params = {"id"}, method = RequestMethod.GET)
+    public void findById(@RequestParam String id, HttpServletResponse response) {
+        IndexWeightDetailVo vo = indexWeightDetailService.findById(id);
+        GsonUtils.printData(response, vo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/pageQuery", method = RequestMethod.POST)
+    public void pageQuery(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeightDetailBo bo = GsonUtils.wrapDataToEntity(request, IndexWeightDetailBo.class);
+        PageVo pageVo = indexWeightDetailService.pageQuery(bo);
+        GsonUtils.printData(response, pageVo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/query", method = RequestMethod.POST)
+    public void query(HttpServletRequest request, HttpServletResponse response) {
+        IndexWeightDetailBo bo = GsonUtils.wrapDataToEntity(request, IndexWeightDetailBo.class);
+        List<IndexWeightDetailVo> vos = indexWeightDetailService.query(bo);
+        GsonUtils.printData(response, vos);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public void deleteByIds(HttpServletRequest request, HttpServletResponse response) {
+        String[] ids = GsonUtils.wrapDataToEntity(request, String[].class);
+        indexWeightDetailService.deleteByIds(ids);
+        GsonUtils.printSuccess(response);
+    }
+
+
+}

+ 99 - 0
src/main/java/com/leeroa/core/score/bo/ItemScoreBo.java

@@ -0,0 +1,99 @@
+package com.leeroa.core.score.bo;
+
+import com.michael.core.hibernate.criteria.BO;
+import com.michael.core.hibernate.criteria.Condition;
+import com.michael.core.hibernate.criteria.LikeModel;
+import com.michael.core.hibernate.criteria.MatchModel;
+import com.michael.docs.annotations.ApiField;
+
+import java.util.Date;
+
+/**
+ * @author yluo
+ */
+public class ItemScoreBo implements BO {
+    @ApiField(value = "业务类型")
+    @Condition
+    private String btype;
+
+    @ApiField(value = "考核日期")
+    @Condition(matchMode = MatchModel.DAY_EQ)
+    private Date scoreDate;
+    @Condition(matchMode = MatchModel.DAY_GE, target = "scoreDate")
+    private Date scoreDateGe;
+    @Condition(matchMode = MatchModel.DAY_LT, target = "scoreDate")
+    private Date scoreDateLt;
+
+    @Condition(matchMode = MatchModel.LIKE, likeMode = LikeModel.ANYWHERE)
+    private String itemName;
+    @Condition
+    private String targetName;
+    @Condition(target = "itemName")
+    private String itemNameEq;
+    @Condition(matchMode = MatchModel.LIKE, likeMode = LikeModel.ANYWHERE)
+    private String description;
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(String targetName) {
+        this.targetName = targetName;
+    }
+
+    public Date getScoreDateGe() {
+        return scoreDateGe;
+    }
+
+    public void setScoreDateGe(Date scoreDateGe) {
+        this.scoreDateGe = scoreDateGe;
+    }
+
+    public Date getScoreDateLt() {
+        return scoreDateLt;
+    }
+
+    public void setScoreDateLt(Date scoreDateLt) {
+        this.scoreDateLt = scoreDateLt;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getItemNameEq() {
+        return itemNameEq;
+    }
+
+    public void setItemNameEq(String itemNameEq) {
+        this.itemNameEq = itemNameEq;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getBtype() {
+        return btype;
+    }
+
+    public void setBtype(String btype) {
+        this.btype = btype;
+    }
+
+    public void setScoreDate(Date scoreDate) {
+        this.scoreDate = scoreDate;
+    }
+
+    public Date getScoreDate() {
+        return this.scoreDate;
+    }
+}

+ 60 - 0
src/main/java/com/leeroa/core/score/bo/TargetsBo.java

@@ -0,0 +1,60 @@
+package com.leeroa.core.score.bo;
+
+import com.michael.core.hibernate.criteria.BO;
+import com.michael.core.hibernate.criteria.Condition;
+import com.michael.docs.annotations.ApiField;
+
+import java.util.Date;
+
+/**
+ * @author yluo
+ */
+public class TargetsBo implements BO {
+    @ApiField(value = "业务id")
+    @Condition
+    private String bid;
+
+    @ApiField(value = "开始日期")
+    @Condition
+    private Date startDate;
+
+    @ApiField(value = "结束日期")
+    @Condition
+    private Date endDate;
+
+    @ApiField(value = "目标类型")
+    @Condition
+    private String targetName;
+
+    public void setBid(String bid) {
+        this.bid = bid;
+    }
+
+    public String getBid() {
+        return this.bid;
+    }
+
+    public void setStartDate(Date startDate) {
+        this.startDate = startDate;
+    }
+
+    public Date getStartDate() {
+        return this.startDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Date getEndDate() {
+        return this.endDate;
+    }
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(String targetName) {
+        this.targetName = targetName;
+    }
+}

+ 42 - 0
src/main/java/com/leeroa/core/score/dao/ItemScoreDao.java

@@ -0,0 +1,42 @@
+package com.leeroa.core.score.dao;
+
+import com.leeroa.core.score.bo.ItemScoreBo;
+import com.leeroa.core.score.domain.ItemScore;
+
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+public interface ItemScoreDao {
+
+    String save(ItemScore itemScore);
+
+    void update(ItemScore itemScore);
+
+    /**
+     * 高级查询接口,不使用分页
+     */
+    List<ItemScore> query(ItemScoreBo bo);
+
+    /**
+     * 高级查询接口,使用分页
+     */
+    List<ItemScore> pageQuery(ItemScoreBo bo);
+
+    /**
+     * 查询总记录数
+     */
+    Long getTotal(ItemScoreBo bo);
+
+    ItemScore findById(String id);
+
+    void deleteById(String id);
+
+    /**
+     * 根据实体对象删除
+     * 必须保证该实体是存在的(一般是get或者load得到的对象)
+     */
+    void delete(ItemScore itemScore);
+
+}

+ 42 - 0
src/main/java/com/leeroa/core/score/dao/TargetsDao.java

@@ -0,0 +1,42 @@
+package com.leeroa.core.score.dao;
+
+import com.leeroa.core.score.bo.TargetsBo;
+import com.leeroa.core.score.domain.Targets;
+
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+public interface TargetsDao {
+
+    String save(Targets targets);
+
+    void update(Targets targets);
+
+    /**
+     * 高级查询接口,不使用分页
+     */
+    List<Targets> query(TargetsBo bo);
+
+    /**
+     * 高级查询接口,使用分页
+     */
+    List<Targets> pageQuery(TargetsBo bo);
+
+    /**
+     * 查询总记录数
+     */
+    Long getTotal(TargetsBo bo);
+
+    Targets findById(String id);
+
+    void deleteById(String id);
+
+    /**
+     * 根据实体对象删除
+     * 必须保证该实体是存在的(一般是get或者load得到的对象)
+     */
+    void delete(Targets targets);
+
+}

+ 82 - 0
src/main/java/com/leeroa/core/score/dao/impl/ItemScoreDaoImpl.java

@@ -0,0 +1,82 @@
+package com.leeroa.core.score.dao.impl;
+
+import com.leeroa.core.score.bo.ItemScoreBo;
+import com.leeroa.core.score.dao.ItemScoreDao;
+import com.leeroa.core.score.domain.ItemScore;
+import com.michael.core.hibernate.HibernateDaoHelper;
+import com.michael.core.hibernate.criteria.CriteriaUtils;
+import org.hibernate.Criteria;
+import org.springframework.stereotype.Repository;
+import org.springframework.util.Assert;
+
+import java.util.List;
+
+
+/**
+ * @author yluo
+ */
+@Repository("itemScoreDao")
+public class ItemScoreDaoImpl extends HibernateDaoHelper implements ItemScoreDao {
+
+    @Override
+    public String save(ItemScore itemScore) {
+        return (String) getSession().save(itemScore);
+    }
+
+    @Override
+    public void update(ItemScore itemScore) {
+        getSession().update(itemScore);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<ItemScore> query(ItemScoreBo bo) {
+        Criteria criteria = createCriteria(ItemScore.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<ItemScore> pageQuery(ItemScoreBo bo) {
+        Criteria criteria = createPagerCriteria(ItemScore.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    public Long getTotal(ItemScoreBo bo) {
+        Criteria criteria = createRowCountsCriteria(ItemScore.class);
+        initCriteria(criteria, bo);
+        return (Long) criteria.uniqueResult();
+    }
+
+
+    @Override
+    public void deleteById(String id) {
+        getSession().createQuery("delete from " + ItemScore.class.getName() + " e where e.id=:id")
+                .setParameter("id", id)
+                .executeUpdate();
+    }
+
+    @Override
+    public void delete(ItemScore itemScore) {
+        Assert.notNull(itemScore, "要删除的对象不能为空!");
+        getSession().delete(itemScore);
+    }
+
+    @Override
+    public ItemScore findById(String id) {
+        Assert.hasText(id, "ID不能为空!");
+        return (ItemScore) getSession().get(ItemScore.class, id);
+    }
+
+
+    private void initCriteria(Criteria criteria, ItemScoreBo bo) {
+        Assert.notNull(criteria, "criteria must not be null!");
+        if (bo != null) {
+            CriteriaUtils.addCondition(criteria, bo);
+        }
+    }
+
+}

+ 82 - 0
src/main/java/com/leeroa/core/score/dao/impl/TargetsDaoImpl.java

@@ -0,0 +1,82 @@
+package com.leeroa.core.score.dao.impl;
+
+import com.leeroa.core.score.bo.TargetsBo;
+import com.leeroa.core.score.dao.TargetsDao;
+import com.leeroa.core.score.domain.Targets;
+import com.michael.core.hibernate.HibernateDaoHelper;
+import com.michael.core.hibernate.criteria.CriteriaUtils;
+import org.hibernate.Criteria;
+import org.springframework.stereotype.Repository;
+import org.springframework.util.Assert;
+
+import java.util.List;
+
+
+/**
+ * @author yluo
+ */
+@Repository("targetsDao")
+public class TargetsDaoImpl extends HibernateDaoHelper implements TargetsDao {
+
+    @Override
+    public String save(Targets targets) {
+        return (String) getSession().save(targets);
+    }
+
+    @Override
+    public void update(Targets targets) {
+        getSession().update(targets);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<Targets> query(TargetsBo bo) {
+        Criteria criteria = createCriteria(Targets.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<Targets> pageQuery(TargetsBo bo) {
+        Criteria criteria = createPagerCriteria(Targets.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    public Long getTotal(TargetsBo bo) {
+        Criteria criteria = createRowCountsCriteria(Targets.class);
+        initCriteria(criteria, bo);
+        return (Long) criteria.uniqueResult();
+    }
+
+
+    @Override
+    public void deleteById(String id) {
+        getSession().createQuery("delete from " + Targets.class.getName() + " e where e.id=:id")
+                .setParameter("id", id)
+                .executeUpdate();
+    }
+
+    @Override
+    public void delete(Targets targets) {
+        Assert.notNull(targets, "要删除的对象不能为空!");
+        getSession().delete(targets);
+    }
+
+    @Override
+    public Targets findById(String id) {
+        Assert.hasText(id, "ID不能为空!");
+        return (Targets) getSession().get(Targets.class, id);
+    }
+
+
+    private void initCriteria(Criteria criteria, TargetsBo bo) {
+        Assert.notNull(criteria, "criteria must not be null!");
+        if (bo != null) {
+            CriteriaUtils.addCondition(criteria, bo);
+        }
+    }
+
+}

+ 185 - 0
src/main/java/com/leeroa/core/score/domain/ItemScore.java

@@ -0,0 +1,185 @@
+package com.leeroa.core.score.domain;
+
+import com.leeroa.base.attachment.AttachmentSymbol;
+import com.michael.common.CommonDomain;
+import com.michael.docs.annotations.ApiField;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Index;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * 项目加分表
+ *
+ * @author yluo
+ */
+@Entity
+@Table(name = "base_item_score", indexes = {
+        @Index(name = "index_btype", columnList = "btype"),
+        @Index(name = "index_targetId", columnList = "targetId"),
+        @Index(name = "index_itemName", columnList = "itemName"),
+        @Index(name = "index_scoreDate", columnList = "scoreDate")
+})
+public class ItemScore extends CommonDomain implements AttachmentSymbol {
+    @ApiField(value = "业务类型", desc = "主要用于区分是哪一种加分(属于最大的分类)")
+    @NotNull
+    @Column(name = "btype", nullable = false, length = 32, updatable = false)
+    private String btype;
+
+    @ApiField(value = "加分对象类型", desc = "常见为员工、机构")
+    @Column(length = 20, updatable = false)
+    private String targetType;
+    @ApiField(value = "加分对象ID")
+    @Column(length = 20)
+    private String targetId;
+    @ApiField(value = "加分对象")
+    @NotNull
+    @Column(length = 20)
+    private String targetName;
+
+    @ApiField(value = "加分日期")
+    @Column(name = "scoreDate")
+    private Date scoreDate;
+
+    @ApiField(value = "加分项id")
+    @Column(name = "itemId", length = 20)
+    private String itemId;
+
+    @ApiField(value = "加分项")
+    @NotNull
+    @Column(name = "itemName", nullable = false, length = 100)
+    private String itemName;
+
+    @ApiField(value = "分值")
+    @Column(name = "doubleScore")
+    private Double doubleScore;
+    @ApiField(value = "分值")
+    @Column(length = 20)
+    private String score;
+
+    @ApiField(value = "备注")
+    @Column(name = "description", length = 200)
+    private String description;
+
+    // 预留字段1
+    @Column(length = 32)
+    private String c1;
+    // 预留字段2
+    @Column(length = 32)
+    private String c2;
+    // 预留字段3
+    @Column(length = 32)
+    private String c3;
+
+    public String getC3() {
+        return c3;
+    }
+
+    public void setC3(String c3) {
+        this.c3 = c3;
+    }
+
+    public String getC1() {
+        return c1;
+    }
+
+    public void setC1(String c1) {
+        this.c1 = c1;
+    }
+
+    public String getC2() {
+        return c2;
+    }
+
+    public void setC2(String c2) {
+        this.c2 = c2;
+    }
+
+    public Double getDoubleScore() {
+        return doubleScore;
+    }
+
+    public void setDoubleScore(Double doubleScore) {
+        this.doubleScore = doubleScore;
+    }
+
+    public void setScore(String score) {
+        this.score = score;
+    }
+
+    public void setBtype(String btype) {
+        this.btype = btype;
+    }
+
+    public String getBtype() {
+        return this.btype;
+    }
+
+    public void setScoreDate(Date scoreDate) {
+        this.scoreDate = scoreDate;
+    }
+
+    public Date getScoreDate() {
+        return this.scoreDate;
+    }
+
+    public void setItemId(String itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemId() {
+        return this.itemId;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getItemName() {
+        return this.itemName;
+    }
+
+    public String getScore() {
+        return score;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+    @Override
+    public String businessId() {
+        return getId();
+    }
+
+    public String getTargetType() {
+        return targetType;
+    }
+
+    public void setTargetType(String targetType) {
+        this.targetType = targetType;
+    }
+
+    public String getTargetId() {
+        return targetId;
+    }
+
+    public void setTargetId(String targetId) {
+        this.targetId = targetId;
+    }
+
+    public String getTargetName() {
+        return targetName;
+    }
+
+    public void setTargetName(String targetName) {
+        this.targetName = targetName;
+    }
+}

+ 152 - 0
src/main/java/com/leeroa/core/score/domain/Targets.java

@@ -0,0 +1,152 @@
+package com.leeroa.core.score.domain;
+
+import com.leeroa.base.attachment.AttachmentSymbol;
+import com.michael.common.CommonDomain;
+import com.michael.docs.annotations.ApiField;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Index;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * 目标表
+ *
+ * @author yluo
+ */
+@Entity
+@Table(name = "base_targets", indexes = {
+        @Index(name = "index_bid", columnList = "bid"), @Index(name = "index_btype", columnList = "btype"),
+})
+public class Targets extends CommonDomain implements AttachmentSymbol {
+    @ApiField(value = "业务id")
+    @Column(name = "bid", length = 20)
+    private String bid;
+
+    @ApiField(value = "业务类型")
+    @NotNull
+    @Column(name = "btype", nullable = false, length = 40)
+    private String btype;
+
+    @ApiField(value = "业务名称")
+    @NotNull
+    @Column(name = "bname", nullable = false, length = 100)
+    private String bname;
+
+    @ApiField(value = "目标类型")
+    @Column(name = "targetName", length = 40)
+    private String targetName;
+
+    @ApiField(value = "开始日期")
+    @Column(name = "startDate")
+    private Date startDate;
+
+    @ApiField(value = "结束日期")
+    @Column(name = "endDate")
+    private Date endDate;
+
+    @ApiField(value = "计划产值")
+    @Column(name = "planValue", length = 20)
+    private String planValue;
+
+    @ApiField(value = "实际产值")
+    @Column(name = "actualValue", length = 20)
+    private String actualValue;
+
+    @ApiField(value = "目标说明")
+    @Column(name = "content", length = 100)
+    private String content;
+
+    @ApiField(value = "备注")
+    @Column(name = "description", length = 400)
+    private String description;
+
+
+    public void setBid(String bid) {
+        this.bid = bid;
+    }
+
+    public String getBid() {
+        return this.bid;
+    }
+
+    public void setBtype(String btype) {
+        this.btype = btype;
+    }
+
+    public String getBtype() {
+        return this.btype;
+    }
+
+    public void setBname(String bname) {
+        this.bname = bname;
+    }
+
+    public String getBname() {
+        return this.bname;
+    }
+
+    public void setTargetName(String targetName) {
+        this.targetName = targetName;
+    }
+
+    public String getTargetName() {
+        return this.targetName;
+    }
+
+    public void setStartDate(Date startDate) {
+        this.startDate = startDate;
+    }
+
+    public Date getStartDate() {
+        return this.startDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    public Date getEndDate() {
+        return this.endDate;
+    }
+
+    public void setPlanValue(String planValue) {
+        this.planValue = planValue;
+    }
+
+    public String getPlanValue() {
+        return this.planValue;
+    }
+
+    public void setActualValue(String actualValue) {
+        this.actualValue = actualValue;
+    }
+
+    public String getActualValue() {
+        return this.actualValue;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getContent() {
+        return this.content;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+    @Override
+    public String businessId() {
+        return getId();
+    }
+
+}

+ 46 - 0
src/main/java/com/leeroa/core/score/service/ItemScoreService.java

@@ -0,0 +1,46 @@
+package com.leeroa.core.score.service;
+
+import com.leeroa.core.score.bo.ItemScoreBo;
+import com.leeroa.core.score.domain.ItemScore;
+import com.leeroa.core.score.vo.ItemScoreVo;
+import com.michael.core.pager.PageVo;
+
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+public interface ItemScoreService {
+
+    /**
+     * 保存
+     */
+    String save(ItemScore itemScore);
+
+    /**
+     * 更新
+     */
+    void update(ItemScore itemScore);
+
+    /**
+     * 分页查询
+     */
+    PageVo pageQuery(ItemScoreBo bo);
+
+    /**
+     * 不进行分页,常用于对外提供的查询接口
+     */
+    List<ItemScoreVo> query(ItemScoreBo bo);
+
+    /**
+     * 根据ID查询对象的信息
+     */
+    ItemScoreVo findById(String id);
+
+    /**
+     * 强制删除
+     */
+    void deleteByIds(String[] ids);
+
+
+}

+ 46 - 0
src/main/java/com/leeroa/core/score/service/TargetsService.java

@@ -0,0 +1,46 @@
+package com.leeroa.core.score.service;
+
+import com.leeroa.core.score.bo.TargetsBo;
+import com.leeroa.core.score.domain.Targets;
+import com.leeroa.core.score.vo.TargetsVo;
+import com.michael.core.pager.PageVo;
+
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+public interface TargetsService {
+
+    /**
+     * 保存
+     */
+    String save(Targets targets);
+
+    /**
+     * 更新
+     */
+    void update(Targets targets);
+
+    /**
+     * 分页查询
+     */
+    PageVo pageQuery(TargetsBo bo);
+
+    /**
+     * 不进行分页,常用于对外提供的查询接口
+     */
+    List<TargetsVo> query(TargetsBo bo);
+
+    /**
+     * 根据ID查询对象的信息
+     */
+    TargetsVo findById(String id);
+
+    /**
+     * 强制删除
+     */
+    void deleteByIds(String[] ids);
+
+
+}

+ 97 - 0
src/main/java/com/leeroa/core/score/service/impl/ItemScoreServiceImpl.java

@@ -0,0 +1,97 @@
+package com.leeroa.core.score.service.impl;
+
+import com.leeroa.base.parameter.service.ParameterContainer;
+import com.leeroa.core.score.bo.ItemScoreBo;
+import com.leeroa.core.score.dao.ItemScoreDao;
+import com.leeroa.core.score.domain.ItemScore;
+import com.leeroa.core.score.service.ItemScoreService;
+import com.leeroa.core.score.vo.ItemScoreVo;
+import com.michael.core.beans.BeanWrapBuilder;
+import com.michael.core.beans.BeanWrapCallback;
+import com.michael.core.hibernate.validator.ValidatorUtils;
+import com.michael.core.pager.PageVo;
+import com.michael.utils.string.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+@Service("itemScoreService")
+public class ItemScoreServiceImpl implements ItemScoreService, BeanWrapCallback<ItemScore, ItemScoreVo> {
+    @Resource
+    private ItemScoreDao itemScoreDao;
+
+    @Override
+    public String save(ItemScore itemScore) {
+        if (itemScore.getDoubleScore() == null && StringUtils.isEmpty(itemScore.getScore())) {
+            Assert.isTrue(false, "数值分数与字符分数不能同时为空!");
+        }
+        validate(itemScore);
+        String id = itemScoreDao.save(itemScore);
+        return id;
+    }
+
+    @Override
+    public void update(ItemScore itemScore) {
+        validate(itemScore);
+        itemScoreDao.update(itemScore);
+    }
+
+    private void validate(ItemScore itemScore) {
+        ValidatorUtils.validate(itemScore);
+    }
+
+    @Override
+    public PageVo pageQuery(ItemScoreBo bo) {
+        PageVo vo = new PageVo();
+        Long total = itemScoreDao.getTotal(bo);
+        vo.setTotal(total);
+        if (total == null || total == 0) {
+            return vo;
+        }
+        List<ItemScore> itemScoreList = itemScoreDao.pageQuery(bo);
+        List<ItemScoreVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(itemScoreList, ItemScoreVo.class);
+        vo.setData(vos);
+        return vo;
+    }
+
+
+    @Override
+    public ItemScoreVo findById(String id) {
+        ItemScore itemScore = itemScoreDao.findById(id);
+        return BeanWrapBuilder.newInstance()
+                .wrap(itemScore, ItemScoreVo.class);
+    }
+
+    @Override
+    public void deleteByIds(String[] ids) {
+        if (ids == null || ids.length == 0) {
+            return;
+        }
+        for (String id : ids) {
+            itemScoreDao.deleteById(id);
+        }
+    }
+
+    @Override
+    public List<ItemScoreVo> query(ItemScoreBo bo) {
+        List<ItemScore> itemScoreList = itemScoreDao.query(bo);
+        List<ItemScoreVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(itemScoreList, ItemScoreVo.class);
+        return vos;
+    }
+
+
+    @Override
+    public void doCallback(ItemScore itemScore, ItemScoreVo vo) {
+        ParameterContainer container = ParameterContainer.getInstance();
+
+    }
+}

+ 92 - 0
src/main/java/com/leeroa/core/score/service/impl/TargetsServiceImpl.java

@@ -0,0 +1,92 @@
+package com.leeroa.core.score.service.impl;
+
+import com.leeroa.base.parameter.service.ParameterContainer;
+import com.leeroa.core.score.bo.TargetsBo;
+import com.leeroa.core.score.dao.TargetsDao;
+import com.leeroa.core.score.domain.Targets;
+import com.leeroa.core.score.service.TargetsService;
+import com.leeroa.core.score.vo.TargetsVo;
+import com.michael.core.beans.BeanWrapBuilder;
+import com.michael.core.beans.BeanWrapCallback;
+import com.michael.core.hibernate.validator.ValidatorUtils;
+import com.michael.core.pager.PageVo;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+@Service("targetsService")
+public class TargetsServiceImpl implements TargetsService, BeanWrapCallback<Targets, TargetsVo> {
+    @Resource
+    private TargetsDao targetsDao;
+
+    @Override
+    public String save(Targets targets) {
+        validate(targets);
+        String id = targetsDao.save(targets);
+        return id;
+    }
+
+    @Override
+    public void update(Targets targets) {
+        validate(targets);
+        targetsDao.update(targets);
+    }
+
+    private void validate(Targets targets) {
+        ValidatorUtils.validate(targets);
+    }
+
+    @Override
+    public PageVo pageQuery(TargetsBo bo) {
+        PageVo vo = new PageVo();
+        Long total = targetsDao.getTotal(bo);
+        vo.setTotal(total);
+        if (total == null || total == 0) {
+            return vo;
+        }
+        List<Targets> targetsList = targetsDao.pageQuery(bo);
+        List<TargetsVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(targetsList, TargetsVo.class);
+        vo.setData(vos);
+        return vo;
+    }
+
+
+    @Override
+    public TargetsVo findById(String id) {
+        Targets targets = targetsDao.findById(id);
+        return BeanWrapBuilder.newInstance()
+                .wrap(targets, TargetsVo.class);
+    }
+
+    @Override
+    public void deleteByIds(String[] ids) {
+        if (ids == null || ids.length == 0) {
+            return;
+        }
+        for (String id : ids) {
+            targetsDao.deleteById(id);
+        }
+    }
+
+    @Override
+    public List<TargetsVo> query(TargetsBo bo) {
+        List<Targets> targetsList = targetsDao.query(bo);
+        List<TargetsVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(targetsList, TargetsVo.class);
+        return vos;
+    }
+
+
+    @Override
+    public void doCallback(Targets targets, TargetsVo vo) {
+        ParameterContainer container = ParameterContainer.getInstance();
+
+    }
+}

+ 10 - 0
src/main/java/com/leeroa/core/score/vo/ItemScoreVo.java

@@ -0,0 +1,10 @@
+package com.leeroa.core.score.vo;
+
+import com.leeroa.core.score.domain.ItemScore;
+
+/**
+ * @author yluo
+ */
+public class ItemScoreVo extends ItemScore {
+
+}

+ 10 - 0
src/main/java/com/leeroa/core/score/vo/TargetsVo.java

@@ -0,0 +1,10 @@
+package com.leeroa.core.score.vo;
+
+import com.leeroa.core.score.domain.Targets;
+
+/**
+ * @author yluo
+ */
+public class TargetsVo extends Targets {
+
+}

+ 158 - 0
src/main/java/com/leeroa/core/score/web/ItemScoreCtrl.java

@@ -0,0 +1,158 @@
+package com.leeroa.core.score.web;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.leeroa.base.utils.DownloadResponseWrapper;
+import com.leeroa.base.utils.export.ExcelUtils;
+import com.leeroa.core.score.bo.ItemScoreBo;
+import com.leeroa.core.score.domain.ItemScore;
+import com.leeroa.core.score.service.ItemScoreService;
+import com.leeroa.core.score.vo.ItemScoreVo;
+import com.michael.common.JspAccessType;
+import com.michael.core.pager.PageVo;
+import com.michael.core.web.BaseController;
+import com.michael.poi.exp.ExportEngine;
+import com.michael.utils.gson.DateStringConverter;
+import com.michael.utils.gson.GsonUtils;
+import org.apache.commons.io.IOUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.Assert;
+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.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+@Controller
+@RequestMapping(value = {"/core/score/itemScore"})
+public class ItemScoreCtrl extends BaseController {
+    @Resource
+    private ItemScoreService itemScoreService;
+
+
+    @RequestMapping(value = {""}, method = RequestMethod.GET)
+    public String toList() {
+        return "core/score/itemScore/itemScore_list";
+    }
+
+    @RequestMapping(value = "/add", method = RequestMethod.GET)
+    public String toAdd(HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.ADD);
+        return "core/score/itemScore/itemScore_edit";
+    }
+
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public void save(HttpServletRequest request, HttpServletResponse response) {
+        ItemScore itemScore = GsonUtils.wrapDataToEntity(request, ItemScore.class);
+        itemScoreService.save(itemScore);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = "/modify", params = {"id"}, method = RequestMethod.GET)
+    public String toModify(@RequestParam String id, HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.MODIFY);
+        request.setAttribute("id", id);
+        return "core/score/itemScore/itemScore_edit";
+    }
+
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public void update(HttpServletRequest request, HttpServletResponse response) {
+        ItemScore itemScore = GsonUtils.wrapDataToEntity(request, ItemScore.class);
+        itemScoreService.update(itemScore);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = {"/detail"}, params = {"id"}, method = RequestMethod.GET)
+    public String toDetail(@RequestParam String id, HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.DETAIL);
+        request.setAttribute("id", id);
+        return "core/score/itemScore/itemScore_edit";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/get", params = {"id"}, method = RequestMethod.GET)
+    public void findById(@RequestParam String id, HttpServletResponse response) {
+        ItemScoreVo vo = itemScoreService.findById(id);
+        GsonUtils.printData(response, vo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/pageQuery", method = RequestMethod.POST)
+    public void pageQuery(HttpServletRequest request, HttpServletResponse response) {
+        ItemScoreBo bo = GsonUtils.wrapDataToEntity(request, ItemScoreBo.class);
+        PageVo pageVo = itemScoreService.pageQuery(bo);
+        GsonUtils.printData(response, pageVo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/query", method = RequestMethod.POST)
+    public void query(HttpServletRequest request, HttpServletResponse response) {
+        ItemScoreBo bo = GsonUtils.wrapDataToEntity(request, ItemScoreBo.class);
+        List<ItemScoreVo> vos = itemScoreService.query(bo);
+        GsonUtils.printData(response, vos);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public void deleteByIds(HttpServletRequest request, HttpServletResponse response) {
+        String[] ids = GsonUtils.wrapDataToEntity(request, String[].class);
+        itemScoreService.deleteByIds(ids);
+        GsonUtils.printSuccess(response);
+    }
+
+    // 全部导出
+    @RequestMapping(value = "/export-all", method = RequestMethod.GET)
+    public void exportAll(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        DownloadResponseWrapper.wrap(response, "项目加分表.xlsx");
+        ExcelUtils.export(ItemScore.class, response.getOutputStream());
+    }
+
+    // 导出数据
+    @RequestMapping(value = "/export", method = RequestMethod.GET)
+    public String export(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        Gson gson = new GsonBuilder()
+                .registerTypeAdapter(Date.class, new DateStringConverter("yyyy-MM-dd HH:mm:ss"))
+                .create();
+        ItemScoreBo bo = GsonUtils.wrapDataToEntity(request, ItemScoreBo.class);
+        List<ItemScoreVo> data = itemScoreService.query(bo);
+        String json = gson.toJson(data);
+        JsonElement element = gson.fromJson(json, JsonElement.class);
+        JsonObject o = new JsonObject();
+        o.add("c", element);
+        DownloadResponseWrapper.wrap(response, "项目加分表数据" + new SimpleDateFormat("yyyyMMdd").format(new Date()) + ".xlsx");
+        InputStream inputStream = ItemScoreCtrl.class.getClassLoader().getResourceAsStream("export_itemScore.xlsx");
+        Assert.notNull(inputStream, "数据导出失败!模板文件不存在,请与管理员联系!");
+        new ExportEngine().export(response.getOutputStream(), inputStream, o);
+        return null;
+    }
+
+
+    // 下载模板
+    @RequestMapping(value = "/template", method = RequestMethod.GET)
+    public void downloadTemplate(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        InputStream input = ItemScoreCtrl.class.getClassLoader().getResourceAsStream("import_itemScore.xlsx");
+        if (input == null) {
+            request.setAttribute("javax.servlet.error.message", "模板[import_itemScore.xlsx]不存在!");
+            request.getRequestDispatcher("/app/500.jsp");
+            return;
+        }
+        DownloadResponseWrapper.wrap(response, "项目加分表数据导入模板.xlsx");
+        IOUtils.copy(input, response.getOutputStream());
+    }
+
+}

+ 158 - 0
src/main/java/com/leeroa/core/score/web/TargetsCtrl.java

@@ -0,0 +1,158 @@
+package com.leeroa.core.score.web;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.leeroa.base.utils.DownloadResponseWrapper;
+import com.leeroa.base.utils.export.ExcelUtils;
+import com.leeroa.core.score.bo.TargetsBo;
+import com.leeroa.core.score.domain.Targets;
+import com.leeroa.core.score.service.TargetsService;
+import com.leeroa.core.score.vo.TargetsVo;
+import com.michael.common.JspAccessType;
+import com.michael.core.pager.PageVo;
+import com.michael.core.web.BaseController;
+import com.michael.poi.exp.ExportEngine;
+import com.michael.utils.gson.DateStringConverter;
+import com.michael.utils.gson.GsonUtils;
+import org.apache.commons.io.IOUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.Assert;
+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.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+@Controller
+@RequestMapping(value = {"/core/score/targets"})
+public class TargetsCtrl extends BaseController {
+    @Resource
+    private TargetsService targetsService;
+
+
+    @RequestMapping(value = {""}, method = RequestMethod.GET)
+    public String toList() {
+        return "core/score/targets/targets_list";
+    }
+
+    @RequestMapping(value = "/add", method = RequestMethod.GET)
+    public String toAdd(HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.ADD);
+        return "core/score/targets/targets_edit";
+    }
+
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public void save(HttpServletRequest request, HttpServletResponse response) {
+        Targets targets = GsonUtils.wrapDataToEntity(request, Targets.class);
+        targetsService.save(targets);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = "/modify", params = {"id"}, method = RequestMethod.GET)
+    public String toModify(@RequestParam String id, HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.MODIFY);
+        request.setAttribute("id", id);
+        return "core/score/targets/targets_edit";
+    }
+
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public void update(HttpServletRequest request, HttpServletResponse response) {
+        Targets targets = GsonUtils.wrapDataToEntity(request, Targets.class);
+        targetsService.update(targets);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = {"/detail"}, params = {"id"}, method = RequestMethod.GET)
+    public String toDetail(@RequestParam String id, HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.DETAIL);
+        request.setAttribute("id", id);
+        return "core/score/targets/targets_edit";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/get", params = {"id"}, method = RequestMethod.GET)
+    public void findById(@RequestParam String id, HttpServletResponse response) {
+        TargetsVo vo = targetsService.findById(id);
+        GsonUtils.printData(response, vo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/pageQuery", method = RequestMethod.POST)
+    public void pageQuery(HttpServletRequest request, HttpServletResponse response) {
+        TargetsBo bo = GsonUtils.wrapDataToEntity(request, TargetsBo.class);
+        PageVo pageVo = targetsService.pageQuery(bo);
+        GsonUtils.printData(response, pageVo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/query", method = RequestMethod.POST)
+    public void query(HttpServletRequest request, HttpServletResponse response) {
+        TargetsBo bo = GsonUtils.wrapDataToEntity(request, TargetsBo.class);
+        List<TargetsVo> vos = targetsService.query(bo);
+        GsonUtils.printData(response, vos);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public void deleteByIds(HttpServletRequest request, HttpServletResponse response) {
+        String[] ids = GsonUtils.wrapDataToEntity(request, String[].class);
+        targetsService.deleteByIds(ids);
+        GsonUtils.printSuccess(response);
+    }
+
+    // 全部导出
+    @RequestMapping(value = "/export-all", method = RequestMethod.GET)
+    public void exportAll(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        DownloadResponseWrapper.wrap(response, "目标表.xlsx");
+        ExcelUtils.export(Targets.class, response.getOutputStream());
+    }
+
+    // 导出数据
+    @RequestMapping(value = "/export", method = RequestMethod.GET)
+    public String export(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        Gson gson = new GsonBuilder()
+                .registerTypeAdapter(Date.class, new DateStringConverter("yyyy-MM-dd HH:mm:ss"))
+                .create();
+        TargetsBo bo = GsonUtils.wrapDataToEntity(request, TargetsBo.class);
+        List<TargetsVo> data = targetsService.query(bo);
+        String json = gson.toJson(data);
+        JsonElement element = gson.fromJson(json, JsonElement.class);
+        JsonObject o = new JsonObject();
+        o.add("c", element);
+        DownloadResponseWrapper.wrap(response, "目标表数据" + new SimpleDateFormat("yyyyMMdd").format(new Date()) + ".xlsx");
+        InputStream inputStream = TargetsCtrl.class.getClassLoader().getResourceAsStream("export_targets.xlsx");
+        Assert.notNull(inputStream, "数据导出失败!模板文件不存在,请与管理员联系!");
+        new ExportEngine().export(response.getOutputStream(), inputStream, o);
+        return null;
+    }
+
+
+    // 下载模板
+    @RequestMapping(value = "/template", method = RequestMethod.GET)
+    public void downloadTemplate(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        InputStream input = TargetsCtrl.class.getClassLoader().getResourceAsStream("import_targets.xlsx");
+        if (input == null) {
+            request.setAttribute("javax.servlet.error.message", "模板[import_targets.xlsx]不存在!");
+            request.getRequestDispatcher("/app/500.jsp");
+            return;
+        }
+        DownloadResponseWrapper.wrap(response, "目标表数据导入模板.xlsx");
+        IOUtils.copy(input, response.getOutputStream());
+    }
+
+}

+ 34 - 0
src/main/java/com/leeroa/core/tree/bo/CategoryTreeBo.java

@@ -0,0 +1,34 @@
+package com.leeroa.core.tree.bo;
+
+import com.michael.core.hibernate.criteria.BO;
+import com.michael.core.hibernate.criteria.Condition;
+import com.michael.docs.annotations.ApiField;
+
+/**
+ * @author yluo
+ */
+public class CategoryTreeBo implements BO {
+    @ApiField(value = "分类")
+    @Condition
+    private String type;
+
+    @ApiField(value = "名称")
+    @Condition
+    private String name;
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getType() {
+        return this.type;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+}

+ 42 - 0
src/main/java/com/leeroa/core/tree/dao/CategoryTreeDao.java

@@ -0,0 +1,42 @@
+package com.leeroa.core.tree.dao;
+
+import com.leeroa.core.tree.bo.CategoryTreeBo;
+import com.leeroa.core.tree.domain.CategoryTree;
+
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+public interface CategoryTreeDao {
+
+    String save(CategoryTree categoryTree);
+
+    void update(CategoryTree categoryTree);
+
+    /**
+     * 高级查询接口,不使用分页
+     */
+    List<CategoryTree> query(CategoryTreeBo bo);
+
+    /**
+     * 高级查询接口,使用分页
+     */
+    List<CategoryTree> pageQuery(CategoryTreeBo bo);
+
+    /**
+     * 查询总记录数
+     */
+    Long getTotal(CategoryTreeBo bo);
+
+    CategoryTree findById(String id);
+
+    void deleteById(String id);
+
+    /**
+     * 根据实体对象删除
+     * 必须保证该实体是存在的(一般是get或者load得到的对象)
+     */
+    void delete(CategoryTree categoryTree);
+
+}

+ 82 - 0
src/main/java/com/leeroa/core/tree/dao/impl/CategoryTreeDaoImpl.java

@@ -0,0 +1,82 @@
+package com.leeroa.core.tree.dao.impl;
+
+import com.leeroa.core.tree.bo.CategoryTreeBo;
+import com.leeroa.core.tree.dao.CategoryTreeDao;
+import com.leeroa.core.tree.domain.CategoryTree;
+import com.michael.core.hibernate.HibernateDaoHelper;
+import com.michael.core.hibernate.criteria.CriteriaUtils;
+import org.hibernate.Criteria;
+import org.springframework.stereotype.Repository;
+import org.springframework.util.Assert;
+
+import java.util.List;
+
+
+/**
+ * @author yluo
+ */
+@Repository("categoryTreeDao")
+public class CategoryTreeDaoImpl extends HibernateDaoHelper implements CategoryTreeDao {
+
+    @Override
+    public String save(CategoryTree categoryTree) {
+        return (String) getSession().save(categoryTree);
+    }
+
+    @Override
+    public void update(CategoryTree categoryTree) {
+        getSession().update(categoryTree);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<CategoryTree> query(CategoryTreeBo bo) {
+        Criteria criteria = createCriteria(CategoryTree.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public List<CategoryTree> pageQuery(CategoryTreeBo bo) {
+        Criteria criteria = createPagerCriteria(CategoryTree.class);
+        initCriteria(criteria, bo);
+        return criteria.list();
+    }
+
+    @Override
+    public Long getTotal(CategoryTreeBo bo) {
+        Criteria criteria = createRowCountsCriteria(CategoryTree.class);
+        initCriteria(criteria, bo);
+        return (Long) criteria.uniqueResult();
+    }
+
+
+    @Override
+    public void deleteById(String id) {
+        getSession().createQuery("delete from " + CategoryTree.class.getName() + " e where e.id=:id")
+                .setParameter("id", id)
+                .executeUpdate();
+    }
+
+    @Override
+    public void delete(CategoryTree categoryTree) {
+        Assert.notNull(categoryTree, "要删除的对象不能为空!");
+        getSession().delete(categoryTree);
+    }
+
+    @Override
+    public CategoryTree findById(String id) {
+        Assert.hasText(id, "ID不能为空!");
+        return (CategoryTree) getSession().get(CategoryTree.class, id);
+    }
+
+
+    private void initCriteria(Criteria criteria, CategoryTreeBo bo) {
+        Assert.notNull(criteria, "criteria must not be null!");
+        if (bo != null) {
+            CriteriaUtils.addCondition(criteria, bo);
+        }
+    }
+
+}

+ 138 - 0
src/main/java/com/leeroa/core/tree/domain/CategoryTree.java

@@ -0,0 +1,138 @@
+package com.leeroa.core.tree.domain;
+
+import com.michael.common.CommonDomain;
+import com.michael.docs.annotations.ApiField;
+import com.michael.tree.Tree;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Index;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 分类树
+ *
+ * @author yluo
+ */
+@Entity
+@Table(name = "base_category_tree", indexes = {
+        @Index(name = "index_type", columnList = "type"),
+})
+public class CategoryTree extends CommonDomain implements Tree {
+    //  绩效加分项
+    public final static String TYPE_JX = "JX";
+    // 工作质量和发展潜力考核指标
+    public final static String TYPE_GZFZ = "GZFZ";
+
+    public final static Map<String, String> TYPE_MAP = new HashMap<>();
+
+    static {
+        TYPE_MAP.put(TYPE_JX, "绩效加分项");
+        TYPE_MAP.put(TYPE_GZFZ, "工作质量和发展潜力考核指标");
+    }
+
+    @ApiField(value = "分类")
+    @NotNull
+    @Column(name = "type", nullable = false, length = 20)
+    private String type;
+
+    @ApiField(value = "名称")
+    @NotNull
+    @Column(name = "name", nullable = false, length = 100)
+    private String name;
+
+    @ApiField(value = "备注")
+    @Column(name = "description", length = 400)
+    private String description;
+
+
+    // 上级
+    @Column(length = 40)
+    private String parentId;
+
+    @Column(length = 40)
+    private String parentName;
+
+
+    @ApiField(value = "访问路径")
+    @Column(length = 400)
+    private String path;
+
+    @ApiField(value = "层级", desc = "该值由后台自动设置,最小值为0,表示首层")
+    @Column
+    private Integer level;
+
+
+    @ApiField(value = "排序号")
+    @Column
+    private Integer sequenceNo;
+
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getType() {
+        return this.type;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+
+    public String getParentName() {
+        return parentName;
+    }
+
+    public void setParentName(String parentName) {
+        this.parentName = parentName;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public Integer getSequenceNo() {
+        return sequenceNo;
+    }
+
+    public void setSequenceNo(Integer sequenceNo) {
+        this.sequenceNo = sequenceNo;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+}

+ 46 - 0
src/main/java/com/leeroa/core/tree/service/CategoryTreeService.java

@@ -0,0 +1,46 @@
+package com.leeroa.core.tree.service;
+
+import com.leeroa.core.tree.bo.CategoryTreeBo;
+import com.leeroa.core.tree.domain.CategoryTree;
+import com.leeroa.core.tree.vo.CategoryTreeVo;
+import com.michael.core.pager.PageVo;
+
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+public interface CategoryTreeService {
+
+    /**
+     * 保存
+     */
+    String save(CategoryTree categoryTree);
+
+    /**
+     * 更新
+     */
+    void update(CategoryTree categoryTree);
+
+    /**
+     * 分页查询
+     */
+    PageVo pageQuery(CategoryTreeBo bo);
+
+    /**
+     * 不进行分页,常用于对外提供的查询接口
+     */
+    List<CategoryTreeVo> query(CategoryTreeBo bo);
+
+    /**
+     * 根据ID查询对象的信息
+     */
+    CategoryTreeVo findById(String id);
+
+    /**
+     * 强制删除
+     */
+    void deleteByIds(String[] ids);
+
+
+}

+ 100 - 0
src/main/java/com/leeroa/core/tree/service/impl/CategoryTreeServiceImpl.java

@@ -0,0 +1,100 @@
+package com.leeroa.core.tree.service.impl;
+
+import com.leeroa.base.parameter.service.ParameterContainer;
+import com.leeroa.core.tree.bo.CategoryTreeBo;
+import com.leeroa.core.tree.dao.CategoryTreeDao;
+import com.leeroa.core.tree.domain.CategoryTree;
+import com.leeroa.core.tree.service.CategoryTreeService;
+import com.leeroa.core.tree.vo.CategoryTreeVo;
+import com.michael.core.beans.BeanWrapBuilder;
+import com.michael.core.beans.BeanWrapCallback;
+import com.michael.core.hibernate.validator.ValidatorUtils;
+import com.michael.core.pager.PageVo;
+import com.michael.tree.TreeBuilder;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+@Service("categoryTreeService")
+public class CategoryTreeServiceImpl implements CategoryTreeService, BeanWrapCallback<CategoryTree, CategoryTreeVo> {
+    @Resource
+    private CategoryTreeDao categoryTreeDao;
+
+    @Override
+    public String save(CategoryTree categoryTree) {
+        // 构建树形对象
+        TreeBuilder<CategoryTree> treeBuilder = new TreeBuilder<CategoryTree>();
+        treeBuilder.beforeSave(categoryTree);
+        validate(categoryTree);
+        String id = categoryTreeDao.save(categoryTree);
+        return id;
+    }
+
+    @Override
+    public void update(CategoryTree categoryTree) {
+        validate(categoryTree);
+        // 构建树形对象
+        TreeBuilder<CategoryTree> treeBuilder = new TreeBuilder<CategoryTree>();
+        treeBuilder.beforeUpdate(categoryTree);
+        categoryTreeDao.update(categoryTree);
+    }
+
+    private void validate(CategoryTree categoryTree) {
+        ValidatorUtils.validate(categoryTree);
+    }
+
+    @Override
+    public PageVo pageQuery(CategoryTreeBo bo) {
+        PageVo vo = new PageVo();
+        Long total = categoryTreeDao.getTotal(bo);
+        vo.setTotal(total);
+        if (total == null || total == 0) {
+            return vo;
+        }
+        List<CategoryTree> categoryTreeList = categoryTreeDao.pageQuery(bo);
+        List<CategoryTreeVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(categoryTreeList, CategoryTreeVo.class);
+        vo.setData(vos);
+        return vo;
+    }
+
+
+    @Override
+    public CategoryTreeVo findById(String id) {
+        CategoryTree categoryTree = categoryTreeDao.findById(id);
+        return BeanWrapBuilder.newInstance().setCallback(this)
+                .wrap(categoryTree, CategoryTreeVo.class);
+    }
+
+    @Override
+    public void deleteByIds(String[] ids) {
+        if (ids == null || ids.length == 0) {
+            return;
+        }
+        for (String id : ids) {
+            categoryTreeDao.deleteById(id);
+        }
+    }
+
+    @Override
+    public List<CategoryTreeVo> query(CategoryTreeBo bo) {
+        List<CategoryTree> categoryTreeList = categoryTreeDao.query(bo);
+        List<CategoryTreeVo> vos = BeanWrapBuilder.newInstance()
+                .setCallback(this)
+                .wrapList(categoryTreeList, CategoryTreeVo.class);
+        return vos;
+    }
+
+
+    @Override
+    public void doCallback(CategoryTree categoryTree, CategoryTreeVo vo) {
+        ParameterContainer container = ParameterContainer.getInstance();
+
+        vo.setTypeName(CategoryTree.TYPE_MAP.get(categoryTree.getType()));
+    }
+}

+ 19 - 0
src/main/java/com/leeroa/core/tree/vo/CategoryTreeVo.java

@@ -0,0 +1,19 @@
+package com.leeroa.core.tree.vo;
+
+import com.leeroa.core.tree.domain.CategoryTree;
+
+/**
+ * @author yluo
+ */
+public class CategoryTreeVo extends CategoryTree {
+    // 类型名称--系统参数
+    private String typeName;
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+}

+ 115 - 0
src/main/java/com/leeroa/core/tree/web/CategoryTreeCtrl.java

@@ -0,0 +1,115 @@
+package com.leeroa.core.tree.web;
+
+import com.leeroa.base.utils.DownloadResponseWrapper;
+import com.leeroa.base.utils.export.ExcelUtils;
+import com.leeroa.core.tree.bo.CategoryTreeBo;
+import com.leeroa.core.tree.domain.CategoryTree;
+import com.leeroa.core.tree.service.CategoryTreeService;
+import com.leeroa.core.tree.vo.CategoryTreeVo;
+import com.michael.common.JspAccessType;
+import com.michael.core.pager.PageVo;
+import com.michael.core.web.BaseController;
+import com.michael.utils.gson.GsonUtils;
+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;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @author yluo
+ */
+@Controller
+@RequestMapping(value = {"/core/tree/categoryTree"})
+public class CategoryTreeCtrl extends BaseController {
+    @Resource
+    private CategoryTreeService categoryTreeService;
+
+
+    @RequestMapping(value = {""}, method = RequestMethod.GET)
+    public String toList() {
+        return "core/tree/categoryTree/categoryTree_list";
+    }
+
+    @RequestMapping(value = "/add", method = RequestMethod.GET)
+    public String toAdd(HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.ADD);
+        return "core/tree/categoryTree/categoryTree_edit";
+    }
+
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public void save(HttpServletRequest request, HttpServletResponse response) {
+        CategoryTree categoryTree = GsonUtils.wrapDataToEntity(request, CategoryTree.class);
+        categoryTreeService.save(categoryTree);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = "/modify", params = {"id"}, method = RequestMethod.GET)
+    public String toModify(@RequestParam String id, HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.MODIFY);
+        request.setAttribute("id", id);
+        return "core/tree/categoryTree/categoryTree_edit";
+    }
+
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public void update(HttpServletRequest request, HttpServletResponse response) {
+        CategoryTree categoryTree = GsonUtils.wrapDataToEntity(request, CategoryTree.class);
+        categoryTreeService.update(categoryTree);
+        GsonUtils.printSuccess(response);
+    }
+
+    @RequestMapping(value = {"/detail"}, params = {"id"}, method = RequestMethod.GET)
+    public String toDetail(@RequestParam String id, HttpServletRequest request) {
+        request.setAttribute(JspAccessType.PAGE_TYPE, JspAccessType.DETAIL);
+        request.setAttribute("id", id);
+        return "core/tree/categoryTree/categoryTree_edit";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/get", params = {"id"}, method = RequestMethod.GET)
+    public void findById(@RequestParam String id, HttpServletResponse response) {
+        CategoryTreeVo vo = categoryTreeService.findById(id);
+        GsonUtils.printData(response, vo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/pageQuery", method = RequestMethod.POST)
+    public void pageQuery(HttpServletRequest request, HttpServletResponse response) {
+        CategoryTreeBo bo = GsonUtils.wrapDataToEntity(request, CategoryTreeBo.class);
+        PageVo pageVo = categoryTreeService.pageQuery(bo);
+        GsonUtils.printData(response, pageVo);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/query", method = RequestMethod.POST)
+    public void query(HttpServletRequest request, HttpServletResponse response) {
+        CategoryTreeBo bo = GsonUtils.wrapDataToEntity(request, CategoryTreeBo.class);
+        List<CategoryTreeVo> vos = categoryTreeService.query(bo);
+        GsonUtils.printData(response, vos);
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    public void deleteByIds(HttpServletRequest request, HttpServletResponse response) {
+        String[] ids = GsonUtils.wrapDataToEntity(request, String[].class);
+        categoryTreeService.deleteByIds(ids);
+        GsonUtils.printSuccess(response);
+    }
+
+    // 全部导出
+    @RequestMapping(value = "/export-all", method = RequestMethod.GET)
+    public void exportAll(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        DownloadResponseWrapper.wrap(response, "分类树.xlsx");
+        ExcelUtils.export(CategoryTree.class, response.getOutputStream());
+    }
+
+
+}

+ 162 - 0
src/main/java/com/leeroa/core/utils/sql/DoubleUtils.java

@@ -0,0 +1,162 @@
+package com.leeroa.core.utils.sql;
+
+import org.springframework.util.Assert;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+/**
+ * @author michael
+ */
+public class DoubleUtils {
+
+    public static final int TYPE_ADD = 0x00; // 加法
+    public static final int TYPE_MULTIPLY = 0x01; // 乘法
+    public static final int TYPE_DIVIDE = 0x02; // 除法
+    public static final int TYPE_SUBTRACT = 0x03; // 减法
+
+
+    /**
+     * 多个Double类型的数据相加,如果为空则跳过
+     */
+    public static double add(Double... numbers) {
+        return calc(TYPE_ADD, RoundingMode.HALF_DOWN, -1, numbers);
+    }
+
+    /**
+     * 将制定对象转成double数值
+     * 如果number为null,则返回0
+     *
+     * @param number
+     * @return
+     */
+    public static double parse(Object number) {
+        return parse(number, 0d);
+    }
+
+    public static double parse(Object number, double defaultValue) {
+        if (number == null) {
+            return defaultValue;
+        }
+        if (number instanceof Number) {
+            return ((Number) number).doubleValue();
+        }
+        String nStr = number.toString().replaceAll(",", "");
+        Assert.isTrue(nStr.matches("(-)?\\d*(\\.\\d+)?"), "对象无法被格式化为数字:" + nStr);
+        return Double.parseDouble(nStr);
+    }
+
+
+    public static Double add(Double a, Double b) {
+        return calc(TYPE_ADD, null, -1, a, b);
+    }
+
+    public static Double sub(Double a, Double b) {
+        return calc(TYPE_SUBTRACT, null, -1, a, b);
+    }
+
+    public static Double multiply(Double a, Double b) {
+        return calc(TYPE_MULTIPLY, null, -1, a, b);
+    }
+
+    public static Double divide(Double a, Double b) {
+        return calc(TYPE_DIVIDE, null, -1, a, b);
+    }
+
+    /**
+     * Scale
+     *      是用来对利用BigDecimal对数值进行运算后保留的位数。
+     *
+     * RouningMode
+     *  该参数是BigDecimal是一个枚举类,包含有8个枚举类型,用来说明对经过计算后数值的取舍模式。
+     *
+     *      ROUND_UP:远离零方向舍入。向绝对值最大的方向舍入,只要舍弃位非0即进位。
+     *      ROUND_DOWN:趋向零方向舍入。向绝对值最小的方向输入,所有的位都要舍弃,不存在进位情况。
+     *      ROUND_CEILING:向正无穷方向舍入。向正最大方向靠拢。若是正数,舍入行为类似于ROUND_UP,若为负数,舍入行为类似于ROUND_DOWN。Math.round()方法就是使用的此模式。
+     *      ROUND_FLOOR:向负无穷方向舍入。向负无穷方向靠拢。若是正数,舍入行为类似于ROUND_DOWN;若为负数,舍入行为类似于ROUND_UP。
+     *      HALF_UP:最近数字舍入(5进)。这是我们最经典的四舍五入。
+     *      HALF_DOWN:最近数字舍入(5舍)。在这里5是要舍弃的。
+     *      HAIL_EVEN:银行家舍入法。
+     */
+
+    /**
+     * 乘法
+     *
+     * @param a
+     * @param b
+     * @param scale 小数点后保留的位数
+     * @param mode  保留的模式
+     * @return
+     */
+    public static Double multiply(Double a, Double b, int scale, RoundingMode mode) {
+        return calc(TYPE_MULTIPLY, mode, scale, a, b);
+    }
+
+    /**
+     * 除法
+     *
+     * @param a
+     * @param b
+     * @param scale 小数点后保留的位数
+     * @param mode  保留的模式
+     * @return
+     */
+    public static Double divide(Double a, Double b, int scale, RoundingMode mode) {
+        return calc(TYPE_DIVIDE, mode, scale, a, b);
+    }
+
+    /**
+     * 计算
+     *
+     * @param type    类型(加减乘除)
+     * @param mode    保留模式
+     * @param scale   小数位数
+     * @param numbers 数据
+     * @return
+     */
+    public static Double calc(int type, RoundingMode mode, int scale, Double... numbers) {
+        if (numbers == null || numbers.length == 0) {
+            return 0d;
+        }
+        BigDecimal result = null;
+        for (Double n : numbers) {
+            if (n == null) {
+                continue;
+            }
+            if (result == null) {
+                result = new BigDecimal(String.valueOf(n));
+                continue;
+            }
+            BigDecimal bgA = new BigDecimal(String.valueOf(n));
+            switch (type) {
+                case TYPE_ADD:
+                    result = result.add(bgA);
+                    break;
+                case TYPE_MULTIPLY:
+                    result = result.multiply(bgA);
+                    break;
+                case TYPE_DIVIDE:
+                    try {
+                        result = result.divide(bgA);
+                    } catch (ArithmeticException e) {// 防止无限循环而报错  采用四舍五入保留3位有效数字
+                        result = result.divide(bgA, 3, RoundingMode.HALF_DOWN);
+                    }
+                    break;
+                case TYPE_SUBTRACT:
+                    result = result.subtract(bgA);
+                    break;
+            }
+        }
+
+        // 设置精度
+        if (scale != -1) {
+            if (mode == null) {
+                return result.setScale(scale).doubleValue();
+            }
+            return result.setScale(scale, mode).doubleValue();
+        }
+
+        return result.doubleValue();
+    }
+
+}

+ 105 - 0
src/main/java/com/leeroa/core/utils/sql/SQLUtils.java

@@ -0,0 +1,105 @@
+package com.leeroa.core.utils.sql;
+
+import com.michael.core.hibernate.HibernateUtils;
+import org.hibernate.SQLQuery;
+import org.hibernate.transform.ResultTransformer;
+import org.hibernate.transform.Transformers;
+import org.springframework.util.Assert;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author michael
+ */
+public class SQLUtils {
+    /**
+     * 查询单个对象,并直接返回对象
+     *
+     * @param transformer   转换器
+     * @param sql           sql脚本
+     * @param namedParamMap 命名参数(可以为空)
+     * @return
+     */
+    public static Object entity(ResultTransformer transformer, String sql, Map<String, Object> namedParamMap) {
+        SQLQuery query = initNamedQuery(sql, namedParamMap);
+        return query.setMaxResults(1)
+                .setResultTransformer(transformer)
+                .uniqueResult();
+    }
+
+    /**
+     * 查询单个对象,并直接返回对象
+     *
+     * @param sql           sql脚本
+     * @param namedParamMap 命名参数(可以为空)
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static Object uniqueResult(String sql, Map<String, Object> namedParamMap) {
+        SQLQuery query = initNamedQuery(sql, namedParamMap);
+        Map<String, Object> o = (Map<String, Object>) query.setMaxResults(1)
+                .setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP)
+                .uniqueResult();
+        if (o == null) {
+            return null;
+        }
+        return o.values().stream().findFirst().get();
+    }
+
+
+    /**
+     * 查询当个对象,并直接返回Map
+     *
+     * @param sql           sql脚本
+     * @param namedParamMap 命名参数(可以为空)
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static Map<String, Object> map(String sql, Map<String, Object> namedParamMap) {
+        SQLQuery query = initNamedQuery(sql, namedParamMap);
+        return (Map<String, Object>) query.setMaxResults(1)
+                .setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP)
+                .uniqueResult();
+    }
+
+    /**
+     * 查询多个对象,并返回List集合(值为map)
+     *
+     * @param sql           sql脚本
+     * @param namedParamMap 命名参数
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static List<Map<String, Object>> listMap(String sql, Map<String, Object> namedParamMap) {
+        SQLQuery query = initNamedQuery(sql, namedParamMap);
+        return (List<Map<String, Object>>) query.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP)
+                .list();
+    }
+
+    private static SQLQuery initNamedQuery(String sql, Map<String, Object> namedParamMap) {
+        // sql中不能存在?等符号
+        Assert.isTrue(!sql.contains("?"), "错误的SQL,请勿在命名查询SQL中使用?占位符!" + sql);
+        SQLQuery query = HibernateUtils.getSession().createSQLQuery(sql);
+        // 获取sql中的命名参数
+        Pattern pattern = Pattern.compile(":\\w+");
+        Matcher matcher = pattern.matcher(sql);
+        while (matcher.find()) {
+            String key = matcher.group().substring(1);
+            Assert.notNull(namedParamMap, "执行SQL查询错误,缺少命名参数:" + key);
+            Object value = namedParamMap.get(key);
+            Assert.notNull(value, "执行SQL查询错误,缺少命名参数:" + key);
+            if (value instanceof Collection) {
+                query.setParameterList(key, (Collection) value);
+            } else if (value instanceof String[]) {
+                query.setParameterList(key, (String[]) value);
+            } else {
+                query.setParameter(key, value);
+            }
+        }
+        return query;
+    }
+}

BIN
src/main/java/com/leeroa/dydb/.DS_Store


+ 0 - 0
src/main/java/com/leeroa/dydb/base/bo/LocationBo.java


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác