白小东 %!s(int64=7) %!d(string=hai) anos
achega
60415b5854
Modificáronse 100 ficheiros con 54219 adicións e 0 borrados
  1. 175 0
      bk-wd-web/bk-wd-web.iml
  2. 77 0
      bk-wd-web/pom.xml
  3. 16 0
      bk-wd-web/src/main/java/com/bk/wd/web/base/BaseController.java
  4. 31 0
      bk-wd-web/src/main/java/com/bk/wd/web/config/WebConfig.java
  5. 16 0
      bk-wd-web/src/main/java/com/bk/wd/web/constant/SheetConstant.java
  6. 200 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/cll/CllApplicationController.java
  7. 158 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/cll/CllCustomerEntranceController.java
  8. 90 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/oa/UserLocationController.java
  9. 475 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/open/ApplitionController.java
  10. 270 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sm/SmElementController.java
  11. 147 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sm/SmModelController.java
  12. 103 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/AreaController.java
  13. 94 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/ConfigurationController.java
  14. 126 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/DictController.java
  15. 74 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/GlobalSettingController.java
  16. 283 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/GroupController.java
  17. 213 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/LoginController.java
  18. 89 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/MenuController.java
  19. 303 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/OfficeController.java
  20. 291 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/RoleController.java
  21. 111 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/SysCarDealerController.java
  22. 111 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/SysLandAgentController.java
  23. 50 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/TagController.java
  24. 404 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/UserController.java
  25. 114 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/VersionController.java
  26. 107 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/BusinessElementController.java
  27. 262 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/CommonModuleController.java
  28. 1075 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/CustomerController.java
  29. 267 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/CustomerTypeController.java
  30. 199 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/MessageController.java
  31. 180 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/PersonController.java
  32. 99 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/PhotoSettingController.java
  33. 430 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/ProductController.java
  34. 264 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/SelectItemController.java
  35. 174 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/SimpleModuleController.java
  36. 272 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppCreditController.java
  37. 1148 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppDetaiController.java
  38. 689 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppPrintController.java
  39. 88 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppReviewController.java
  40. 2944 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppSurveyController.java
  41. 395 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/ApplicationController.java
  42. 196 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/FzApplicationController.java
  43. 604 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/StatisticsController.java
  44. 234 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/loaned/LoanedController.java
  45. 86 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlCallbackPolicyController.java
  46. 131 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlOriginalDataFuzhouController.java
  47. 219 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlOriginalDataLuoyangController.java
  48. 76 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlPolicyController.java
  49. 101 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlRiskInquiryPolicyController.java
  50. 117 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/wx/feedbackController.java
  51. 378 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/xcx/CustomerEntranceController.java
  52. 166 0
      bk-wd-web/src/main/java/com/bk/wd/web/controller/xcx/CustomerServerController.java
  53. 103 0
      bk-wd-web/src/main/java/com/bk/wd/web/utils/BufferedImageLuminanceSource.java
  54. 118 0
      bk-wd-web/src/main/java/com/bk/wd/web/utils/ExcelUtils.java
  55. 33 0
      bk-wd-web/src/main/java/com/bk/wd/web/utils/HexUtils.java
  56. 134 0
      bk-wd-web/src/main/java/com/bk/wd/web/utils/HttpPostUploadUtil.java
  57. 53 0
      bk-wd-web/src/main/java/com/bk/wd/web/utils/MatrixToImageWriter.java
  58. 242 0
      bk-wd-web/src/main/java/com/bk/wd/web/utils/TestHttpClient.java
  59. 63 0
      bk-wd-web/src/main/java/com/bk/wd/web/utils/WordGenerator.java
  60. 74 0
      bk-wd-web/src/main/resources/META-INF/spring/context-jdbc.xml
  61. 30 0
      bk-wd-web/src/main/resources/META-INF/spring/context-mybatis.xml
  62. 51 0
      bk-wd-web/src/main/resources/META-INF/spring/context-transaction.xml
  63. 31 0
      bk-wd-web/src/main/resources/META-INF/spring/context.xml
  64. 1596 0
      bk-wd-web/src/main/resources/META-INF/template/meeting_luoshan.ftl
  65. 1074 0
      bk-wd-web/src/main/resources/META-INF/template/modules/app_overview.ftl
  66. 118 0
      bk-wd-web/src/main/resources/META-INF/template/modules/app_shixin_court.ftl
  67. 94 0
      bk-wd-web/src/main/resources/META-INF/template/modules/app_zhixin_court.ftl
  68. 3870 0
      bk-wd-web/src/main/resources/META-INF/template/resolution_luoshan.ftl
  69. 5566 0
      bk-wd-web/src/main/resources/META-INF/template/resolution_qingyuan.ftl
  70. 3952 0
      bk-wd-web/src/main/resources/META-INF/template/resolution_xuanhua.ftl
  71. 2720 0
      bk-wd-web/src/main/resources/META-INF/template/review_report_luoshan.ftl
  72. 32 0
      bk-wd-web/src/main/resources/db.properties
  73. 36 0
      bk-wd-web/src/main/resources/log4j.properties
  74. 60 0
      bk-wd-web/src/main/resources/logback.xml
  75. 42 0
      bk-wd-web/src/main/resources/mybatis-configuration.xml
  76. 29 0
      bk-wd-web/src/main/resources/web.properties
  77. 74 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/spring/context-jdbc.xml
  78. 30 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/spring/context-mybatis.xml
  79. 51 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/spring/context-transaction.xml
  80. 31 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/spring/context.xml
  81. 1596 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/meeting_luoshan.ftl
  82. 1074 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/modules/app_overview.ftl
  83. 118 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/modules/app_shixin_court.ftl
  84. 94 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/modules/app_zhixin_court.ftl
  85. 3870 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/resolution_luoshan.ftl
  86. 5566 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/resolution_qingyuan.ftl
  87. 3952 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/resolution_xuanhua.ftl
  88. 2720 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/review_report_luoshan.ftl
  89. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/base/BaseController.class
  90. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/config/WebConfig.class
  91. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/constant/SheetConstant.class
  92. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/cll/CllApplicationController.class
  93. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/cll/CllCustomerEntranceController.class
  94. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/oa/UserLocationController.class
  95. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/open/ApplitionController.class
  96. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sm/SmElementController.class
  97. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sm/SmModelController.class
  98. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sys/AreaController.class
  99. BIN=BIN
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sys/ConfigurationController.class
  100. 0 0
      bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sys/DictController.class

+ 175 - 0
bk-wd-web/bk-wd-web.iml

@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
+    <facet type="web" name="Web">
+      <configuration>
+        <descriptors>
+          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+        </descriptors>
+        <webroots>
+          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+        </webroots>
+        <sourceRoots>
+          <root url="file://$MODULE_DIR$/src/main/java" />
+          <root url="file://$MODULE_DIR$/src/main/resources" />
+        </sourceRoots>
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+    <output url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/classes" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="bk-sys-cas" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-cas:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.jasig.cas.client:cas-client-core:3.2.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-ehcache:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.5.0" level="project" />
+    <orderEntry type="module" module-name="bk-sys-service" />
+    <orderEntry type="module" module-name="bk-sys-api" />
+    <orderEntry type="module" module-name="bk-wd-service" />
+    <orderEntry type="module" module-name="bk-common" />
+    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-web:2.0.4" level="project" />
+    <orderEntry type="library" name="Maven: redis.clients:jedis:2.5.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.0" level="project" />
+    <orderEntry type="library" name="Maven: org.csource:fastdfs:1.24" level="project" />
+    <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.47" level="project" />
+    <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.1" level="project" />
+    <orderEntry type="library" name="Maven: com.mpatric:mp3agic:0.9.0" level="project" />
+    <orderEntry type="library" name="Maven: cn.jpush.api:jpush-client:3.2.17" level="project" />
+    <orderEntry type="library" name="Maven: cn.jpush.api:jiguang-common:1.0.3" level="project" />
+    <orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.3.1" level="project" />
+    <orderEntry type="library" name="Maven: com.squareup.okio:okio:1.8.0" level="project" />
+    <orderEntry type="library" name="Maven: io.netty:netty-all:4.1.6.Final" level="project" />
+    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.23" level="project" />
+    <orderEntry type="library" name="Maven: com.itextpdf:itextpdf:5.5.12" level="project" />
+    <orderEntry type="library" name="Maven: com.itextpdf.tool:xmlworker:5.5.12" level="project" />
+    <orderEntry type="library" name="Maven: org.xhtmlrenderer:flying-saucer-pdf:9.1.7" level="project" />
+    <orderEntry type="library" name="Maven: com.lowagie:itext:2.1.7" level="project" />
+    <orderEntry type="library" name="Maven: org.bouncycastle:bcmail-jdk14:1.38" level="project" />
+    <orderEntry type="library" name="Maven: org.bouncycastle:bctsp-jdk14:1.38" level="project" />
+    <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk14:1.38" level="project" />
+    <orderEntry type="library" name="Maven: org.xhtmlrenderer:flying-saucer-core:9.1.7" level="project" />
+    <orderEntry type="library" name="Maven: org.xhtmlrenderer:flying-saucer-pdf-itext5:9.1.7" level="project" />
+    <orderEntry type="module-library">
+      <library name="Maven: com.zmxy:zmxy-sdk-java:1.0.0">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../bk-common/lib/zmxy-sdk-java-20180116212729.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.4" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.7" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.4" level="project" />
+    <orderEntry type="module" module-name="bk-wd-pl-service" />
+    <orderEntry type="module" module-name="bk-bi-service" />
+    <orderEntry type="module" module-name="bk-oa-service" />
+    <orderEntry type="module" module-name="bk-sm-service" />
+    <orderEntry type="module" module-name="bk-cll-service" />
+    <orderEntry type="library" name="Maven: org.jsoup:jsoup:1.10.1" level="project" />
+    <orderEntry type="library" name="Maven: jmimemagic:jmimemagic:0.1.2" level="project" />
+    <orderEntry type="library" name="Maven: oro:oro:2.0.8" level="project" />
+    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+    <orderEntry type="library" name="Maven: log4j:log4j:1.2.8" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: xerces:xercesImpl:2.7.1" level="project" />
+    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
+    <orderEntry type="library" name="Maven: xml-apis:xmlParserAPIs:2.0.2" level="project" />
+    <orderEntry type="library" name="Maven: com.google.zxing:core:3.3.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-orm:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-oxm:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-test:4.0.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.7.4" level="project" />
+    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.7.4" level="project" />
+    <orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" />
+    <orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.1.1.Final" level="project" />
+    <orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.3.GA" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.0.0" level="project" />
+    <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.1" level="project" />
+    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.5" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
+    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.2.3" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.2.3" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.2.3" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.2.3" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.1.40" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.7" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.7" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.7" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.0.7" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.0.7" level="project" />
+    <orderEntry type="library" name="Maven: taglibs:standard:1.1.2" level="project" />
+    <orderEntry type="library" name="Maven: javax.servlet:jstl:1.2" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet.jsp:jsp-api:2.1" level="project" />
+    <orderEntry type="library" name="Maven: opensymphony:sitemesh:2.4.2" level="project" />
+    <orderEntry type="library" name="Maven: com.google.guava:guava:17.0" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi:3.15" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.15" level="project" />
+    <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.15" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
+    <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.2.8" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.2.2" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:druid:1.0.11" level="project" />
+    <orderEntry type="module-library">
+      <library name="Maven: com.alibaba:jconsole:1.8.0">
+        <CLASSES>
+          <root url="jar://D:/Program Files/Java/jdk1.8.0_161/lib/jconsole.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="Maven: com.alibaba:tools:1.8.0">
+        <CLASSES>
+          <root url="jar://D:/Program Files/Java/jdk1.8.0_161/lib/tools.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.41" level="project" />
+    <orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.7" level="project" />
+    <orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
+    <orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
+    <orderEntry type="library" name="Maven: junit:junit:4.11" level="project" />
+    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
+    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+    <orderEntry type="library" name="Maven: joda-time:joda-time:2.9.6" level="project" />
+  </component>
+</module>

+ 77 - 0
bk-wd-web/pom.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>com.bk</groupId>
+		<artifactId>bk-parent</artifactId>
+		<version>0.0.1</version>
+		<relativePath>../bk-parent/pom.xml</relativePath> 
+	</parent>
+	
+	<groupId>com.bk.wd.web</groupId>
+	<artifactId>bk-wd-web</artifactId>
+	<packaging>war</packaging>
+	
+	<dependencies>
+		<dependency>
+			<groupId>com.bk.sys.cas</groupId>
+			<artifactId>bk-sys-cas</artifactId>
+			<version>0.0.1</version>
+		</dependency>
+		<dependency>
+			<groupId>com.bk.wd</groupId>
+			<artifactId>bk-wd-service</artifactId>
+			<version>0.0.1</version>
+		</dependency>
+		<dependency>
+			  <groupId>com.bk.wd.pl.service</groupId>
+			  <artifactId>bk-wd-pl-service</artifactId>
+			  <version>0.0.1</version>
+		</dependency>
+		<dependency>
+			<groupId>com.bk.bi</groupId>
+			<artifactId>bk-bi-service</artifactId>
+			<version>0.0.1</version>
+		</dependency>
+		<dependency>
+			<groupId>com.oa.service</groupId>
+			<artifactId>bk-oa-service</artifactId>
+			<version>0.0.1</version>
+		</dependency>
+		<dependency>
+			<groupId>com.bk.sm</groupId>
+			<artifactId>bk-sm-service</artifactId>
+			<version>0.0.1</version>
+		</dependency>
+		
+		<dependency>
+			<groupId>com.bk.cll.service</groupId>
+	  		<artifactId>bk-cll-service</artifactId>
+			<version>0.0.1</version>
+		</dependency>
+	    
+    	<dependency>
+            <groupId>org.jsoup</groupId>
+            <artifactId>jsoup</artifactId>
+            <version>1.10.1</version>
+        </dependency>
+		
+		<dependency>
+		    <groupId>jmimemagic</groupId>
+		    <artifactId>jmimemagic</artifactId>
+		    <version>0.1.2</version>
+		</dependency>
+		
+		<dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+            <version>3.3.0</version>
+        </dependency>
+        
+	</dependencies>
+	<build>
+		<finalName>bk-wd-admin</finalName>
+	</build>
+</project>

+ 16 - 0
bk-wd-web/src/main/java/com/bk/wd/web/base/BaseController.java

@@ -0,0 +1,16 @@
+package com.bk.wd.web.base;
+
+import org.apache.shiro.authc.AuthenticationException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+
+
+public class BaseController extends com.bk.common.web.BaseController {
+	
+	/**
+	 * 授权登录异常
+	 */
+	@ExceptionHandler({AuthenticationException.class})
+    public String authenticationException() {  
+        return "error/403";
+    }
+}

+ 31 - 0
bk-wd-web/src/main/java/com/bk/wd/web/config/WebConfig.java

@@ -0,0 +1,31 @@
+package com.bk.wd.web.config;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration("webConfig")
+public class WebConfig {
+
+    @Value("${static.resources.url}")
+    private String staticResourcesUrl;
+    
+    @Value("${dfs.http.server}")
+    private String dfsHttpServer;
+
+    public String getStaticResourcesUrl() {
+        return staticResourcesUrl;
+    }
+
+    public void setStaticResourcesUrl(String staticResourcesUrl) {
+        this.staticResourcesUrl = staticResourcesUrl;
+    }
+
+    public String getDfsHttpServer() {
+        return dfsHttpServer;
+    }
+
+    public void setDfsHttpServer(String dfsHttpServer) {
+        this.dfsHttpServer = dfsHttpServer;
+    }
+    
+}

+ 16 - 0
bk-wd-web/src/main/java/com/bk/wd/web/constant/SheetConstant.java

@@ -0,0 +1,16 @@
+package com.bk.wd.web.constant;
+
+public class SheetConstant {
+
+	public static final String SHEET_3 = "信贷历史"; //信贷历史
+	public static final String SHEET_4 = "侧面调查"; //侧面调查
+	public static final String SHEET_5 = "应收账款"; //应收账款
+	public static final String SHEET_6 = "预付账款"; //预付账款
+	public static final String SHEET_7 = "存货"; //存货
+	public static final String SHEET_8 = "固定资产"; //固定资产
+	public static final String SHEET_9 = "毛利检验"; //毛利检验
+	public static final String SHEET_10 = "损益表"; //损益表
+	public static final String SHEET_11 = "逻辑检验"; //逻辑检验
+	public static final String SHEET_12 = "还款计划表"; //还款计划表
+	public static final String SHEET_VERSION = "版本记录"; //版本记录
+}

+ 200 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/cll/CllApplicationController.java

@@ -0,0 +1,200 @@
+package com.bk.wd.web.controller.cll;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.bk.cll.Constant;
+import com.bk.cll.model.CllApplication;
+import com.bk.cll.model.CllApplicationTask;
+import com.bk.cll.model.CllCustomer;
+import com.bk.cll.model.CllCustomerComprehensiveQuality;
+import com.bk.cll.service.CllApplicationService;
+import com.bk.cll.service.CllApplicationTaskService;
+import com.bk.cll.service.CllCustomerComprehensiveQualityService;
+import com.bk.cll.service.CllCustomerService;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.model.WdRwBkScore;
+import com.bk.wd.model.WdRwZmScore;
+import com.bk.wd.service.WdCourtQueryService;
+import com.bk.wd.service.WdRwBkScoreService;
+import com.bk.wd.service.WdRwEmaySinowayCreditService;
+import com.bk.wd.service.WdRwTdBodyguardService;
+import com.bk.wd.service.WdRwTxCreditAntifraudVerifyService;
+import com.bk.wd.service.WdRwZmCreditAntifraudVerifyService;
+import com.bk.wd.service.WdRwZmScoreService;
+
+@RequestMapping(value = "/cll/application")
+@Controller
+public class CllApplicationController {
+	
+	@Autowired
+	private CllApplicationService cllApplicationService;
+	
+	@Autowired
+	private CllCustomerService customerService;
+	
+	@Autowired
+	private CllCustomerComprehensiveQualityService cllCustomerComprehensiveQualityService;
+	
+	@Autowired
+	private WdCourtQueryService cllCourtQueryService;
+	
+	@Autowired
+	private WdRwZmCreditAntifraudVerifyService cllRwZmCreditAntifraudVerifyService;
+	
+	@Autowired
+	private WdRwTxCreditAntifraudVerifyService cllRwTxCreditAntifraudVerifyService;
+	
+	@Autowired
+	private WdRwEmaySinowayCreditService cllRwEmaySinowayCreditService;
+	
+	@Autowired
+	private SysUserService sysUserService;
+	
+	@Autowired 
+	private CllApplicationTaskService cllApplicationTaskService;
+	
+	@Autowired
+	private WdRwZmScoreService cllRwZmScoreService;
+	
+	@Autowired
+	private WdRwBkScoreService cllRwBkScoreService;
+	
+	@Autowired
+	private WdRwTdBodyguardService tdBodyguardService;
+	
+	@RequestMapping(value = "list")
+	public String loanInfo(CllApplication cllApplication, Model model, Pagination pagination) {
+		cllApplicationService.selectByPagination(pagination, cllApplication);
+		model.addAttribute("statusCount", count(cllApplication));
+		model.addAttribute("pagination", pagination);
+		model.addAttribute("cllApplication", cllApplication);
+		return "modules/cll/app/managerList";
+	}
+	
+	public Map<String, Long> count(CllApplication application) {
+        List<Map<String, Object>> statusList = cllApplicationService.countApplicationStatus(application);
+        long all = 0, appling = 0, preview = 0, credit = 0, survey = 0, review = 0, preSign = 0, preLoan = 0, repayments = 0, closeAcount = 0, reject = 0;
+        for (Map<String, Object> map : statusList) {
+        	if (null != map.get("status") && null != map.get("count")) {
+        		int count = Integer.parseInt(String.valueOf(map.get("count")));
+	            switch (Integer.parseInt(String.valueOf(map.get("status")))) {
+	                case 0:
+	                    all = count;
+	                    break;
+	                case 1:
+	                    appling = count;
+	                    break;
+	                case 2:
+	                    preview = count;
+	                    break;
+	                case 4:
+	                    credit = count;
+	                    break;
+	                case 8:
+	                    survey = count;
+	                    break;
+	                case 16:
+	                    review = count;
+	                    break;
+	                case 32:
+	                    preSign = count;
+	                    break;
+	                case 64:
+	                    preLoan = count;
+	                    break;
+	                case 128:
+	                    repayments = count;
+	                    break;
+	                case 4096:
+	                    closeAcount = count;
+	                    break;
+	                case 8192:
+	                    reject = count;
+	                    break;
+	                default:
+	                    break;
+	            }
+        	}
+        }
+        Map<String, Long> statusMap = new HashMap<>();
+        statusMap.put("all", all);
+        statusMap.put("appling", appling);
+        statusMap.put("preview", preview);
+        statusMap.put("credit", credit);
+        statusMap.put("survey", survey);
+        statusMap.put("review", review);
+        statusMap.put("preSign", preSign);
+        statusMap.put("preLoan", preLoan);
+        statusMap.put("repayments", repayments);
+        statusMap.put("closeAcount", closeAcount);
+        statusMap.put("reject", reject);
+        return statusMap;
+    }
+	
+	@RequestMapping(value = "detail")
+	public String detail(String applicationId, Model model){
+		CllApplication cllApplication = cllApplicationService.selectByPrimaryKey(applicationId);
+		CllCustomer customer = customerService.selectByPrimaryKey(cllApplication.getCustomerId());
+		
+        CllCustomerComprehensiveQuality cllCustomerComprehensiveQuality = cllCustomerComprehensiveQualityService.selectByApplicationId(applicationId);
+        if (null != cllCustomerComprehensiveQuality && StringUtils.isNotEmpty(cllCustomerComprehensiveQuality.getCreateBy())) {
+        	cllCustomerComprehensiveQuality.setCreateByName(sysUserService.selectByPrimaryKey(cllCustomerComprehensiveQuality.getCreateBy()).getName()); 
+        }
+        cllApplication.setComprehensiveQuality(cllCustomerComprehensiveQuality);
+        cllApplication.setCllApplicationTask(cllApplicationTaskService.selectLastTask(applicationId));
+        
+        List<CllApplicationTask> cllApplicationTaskList = cllApplicationTaskService.selectByApplication(applicationId);
+		Map<String, Object> task = new HashMap<>();
+		for (CllApplicationTask cllApplicationTask : cllApplicationTaskList) {
+			String title = "";
+			switch (cllApplicationTask.getTitle()) {
+			case Constant.ApplicationTaskSubcategory.Approval:
+				title = "approval";
+				break;
+			case Constant.ApplicationTaskSubcategory.Preapproval:
+				title = "preapproval";
+				break;
+			case Constant.ApplicationTaskSubcategory.GetCreditReport:
+				title = "getCreditReport";
+				break;
+			case Constant.ApplicationTaskSubcategory.Investigation:
+				title = "investigation";
+				break;
+			default:
+				break;
+			}
+
+			if (StringUtils.isNotBlank(title)) {
+				task.put(title, cllApplicationTask);
+			}
+		}
+		cllApplication.setTaskMap(task);
+        
+        model.addAttribute("cllApplication", cllApplication);
+        
+        
+        WdRwZmScore zmScore = cllRwZmScoreService.selectLastestByPersonId(customer.getWdPersonId(), cllApplication.getId());
+		WdRwBkScore bkScore = cllRwBkScoreService.selectLastestByPersonId(customer.getWdPersonId(), cllApplication.getId());
+        
+        model.addAttribute("bkScore", bkScore);
+        model.addAttribute("zmScore", zmScore);
+        
+        model.addAttribute("zhixinList", cllCourtQueryService.selectByPersonIdAndSite(customer.getWdPersonId(), "zhixin", cllApplication.getId()));
+        model.addAttribute("shixinList", cllCourtQueryService.selectByPersonIdAndSite(customer.getWdPersonId(), "shixin", cllApplication.getId()));
+        model.addAttribute("cllRwZmCreditAntifraudVerifyList", cllRwZmCreditAntifraudVerifyService.selectByPerson(customer.getWdPersonId()));
+        model.addAttribute("cllRwTxCreditAntifraudVerifyList", cllRwTxCreditAntifraudVerifyService.selectByPersonId(customer.getWdPersonId(), cllApplication.getId()));
+        model.addAttribute("cllRwEmaySinowayCreditList", cllRwEmaySinowayCreditService.selectByPersonId(customer.getWdPersonId(), cllApplication.getId()));
+        model.addAttribute("cllRwTdBodyguardList", tdBodyguardService.selectByPersonId(customer.getWdPersonId(), cllApplication.getId()));
+        return "modules/cll/app/detail";
+	}
+
+}

+ 158 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/cll/CllCustomerEntranceController.java

@@ -0,0 +1,158 @@
+package com.bk.wd.web.controller.cll;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.bk.cll.model.CllCeFrom;
+import com.bk.cll.service.CllCeFromService;
+import com.bk.cll.service.CllCustomerService;
+import com.bk.wd.web.utils.MatrixToImageWriter;
+import com.bk.common.utils.EntityUtils;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.utils.UserUtils;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+
+@Controller
+@RequestMapping(value = "/cll/customerEntrance")
+public class CllCustomerEntranceController {
+
+	private static final Logger LOGGER = LoggerFactory.getLogger(CllCustomerEntranceController.class);
+
+	@Autowired
+	private CllCeFromService cefromService;
+	
+	@Autowired
+	private CllCustomerService cllCustomerService;
+
+	@Value("${static.resources.url}")
+	private String static_resources_url;
+	
+	@Value("${app.wap.download.url}")
+	private String app_wap_download_url;
+
+	@RequestMapping(value = { "/list" })
+	public String fromList(Model model, HttpServletRequest request) {
+
+		String referer = request.getHeader("Referer");
+		request.getSession().setAttribute("from_back_url", referer);
+
+		SysUser currentUser = UserUtils.getUser();
+		List<CllCeFrom> froms = cefromService.selectByCompanyId(currentUser.getCompanyId());
+		List<Map<String, Object>> list = EntityUtils.convertToListMap(froms, "id", "fromA", "fromB", "createDate");
+		for (Map<String, Object> map : list) {
+			String fromA = map.get("fromA").toString();
+			Integer count = cllCustomerService.countByFromA(fromA);
+			map.put("count", count);
+		}
+
+		model.addAttribute("list", list);
+		return "modules/cll/customerEntrance/list";
+	}
+
+	@RequestMapping(value = { "/DRCode" })
+	public void fromQRCode(String id, HttpServletRequest request, HttpServletResponse response) {
+		if (StringUtils.isBlank(id)) {
+			return;
+		}
+
+		CllCeFrom from = cefromService.selectByPrimaryKey(id);
+		if (null == from) {
+			return;
+		}
+
+		if (StringUtils.isBlank(from.getFromA())) {
+			return;
+		}
+
+		String url = static_resources_url + app_wap_download_url + "/?fromA="+ from.getFromA();
+
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("application/octet-stream");
+
+		String fileName = from.getFromA() + ".png";
+		try {
+			fileName = new String(fileName.getBytes(), "ISO-8859-1");
+		} catch (UnsupportedEncodingException e1) {
+			LOGGER.error(e1.getMessage(), e1);
+			fileName = "DRCode.png";
+		}
+
+		response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
+
+		try (ServletOutputStream outputStream = response.getOutputStream();) {
+
+			Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
+			hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
+			BitMatrix bitMatrix = new MultiFormatWriter().encode(url, BarcodeFormat.QR_CODE, 520, 520, hints);
+			MatrixToImageWriter.writeToStream(bitMatrix, "png", outputStream);
+
+		} catch (IOException | WriterException e) {
+			LOGGER.error(e.getMessage(), e);
+		}
+	}
+
+	@RequestMapping(value = { "/form" }, method = { RequestMethod.GET })
+	public String editFrom(Model model) {
+
+		SysUser currentUser = UserUtils.getUser();
+		CllCeFrom from = new CllCeFrom();
+		from.setCompanyId(currentUser.getCompanyId());
+
+		model.addAttribute("from", from);
+		return "modules/cll/customerEntrance/editForm";
+	}
+
+	@RequestMapping(value = { "/form" }, method = { RequestMethod.POST })
+	public String saveFrom(CllCeFrom model) {
+		SysUser currentUser = UserUtils.getUser();
+
+		String fromA = model.getFromA();
+		if (StringUtils.isBlank(fromA)) {
+			return "modules/cll/customerEntrance/editForm";
+		}
+
+		String companyId = model.getCompanyId();
+		if (StringUtils.isBlank(companyId)) {
+			companyId = currentUser.getCompanyId();
+		}
+
+		CllCeFrom oldFrom = cefromService.selectByCompanyIdAndFromA(companyId, fromA);
+		if (null != oldFrom) {
+			return "modules/cll/customerEntrance/editForm";
+		}
+
+		model.setId(UidUtil.uuid());
+		model.setCompanyId(companyId);
+		model.setCreateBy(currentUser.getId());
+		model.setCreateDate(new Date());
+		model.setUpdateBy(currentUser.getId());
+		model.setUpdateDate(new Date());
+
+		cefromService.insertSelective(model);
+
+		return "modules/cll/customerEntrance/editForm";
+	}
+}

+ 90 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/oa/UserLocationController.java

@@ -0,0 +1,90 @@
+package com.bk.wd.web.controller.oa;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.alibaba.fastjson.JSON;
+import com.bk.common.utils.UidUtil;
+import com.bk.oa.model.OaLocationConfig;
+import com.bk.oa.model.OaLocationConfigTimeQuantum;
+import com.bk.oa.service.OaLocationConfigService;
+import com.bk.oa.service.OaLocationConfigTimeQuantumService;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysUserService;
+
+/**
+ * 用户实时定位
+ * @Project Name:bk-wd-web 
+ * @Date:2017年8月29日上午11:02:08 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/oa/location")
+public class UserLocationController {
+    
+    @Autowired
+    private OaLocationConfigService oaLocationConfigService;
+    
+    @Autowired
+    private OaLocationConfigTimeQuantumService oaLocationConfigTimeQuantumService;
+    
+    @Autowired
+    private SysUserService sysUserService;
+
+    @RequiresPermissions("oa:location:config:edit")
+    @RequestMapping(value = { "/config/form" })
+    public String configForm(Model model) {
+        SysUser sysUser = sysUserService.selectByPrimaryKey(UserUtils.getUser().getId());
+        OaLocationConfig oaLocationConfig = oaLocationConfigService.selectByCompanyId(sysUser.getCompanyId());
+        if (null != oaLocationConfig) {
+            oaLocationConfig.setConfigTimeQuantumList(oaLocationConfigTimeQuantumService.selectByConfigId(oaLocationConfig.getId()));
+            model.addAttribute("oaLocationConfig", oaLocationConfig);
+        }
+        return "modules/oa/location/configForm";
+    }
+    
+    @RequiresPermissions("oa:location:config:edit")
+    @RequestMapping(value = "/config/save")
+    public String save(OaLocationConfig oaLocationConfig, String timeQuantums, Model model) {
+        oaLocationConfig.setCompanyId(UserUtils.getUser().getCompanyId());
+        if (oaLocationConfig.getEnable() == null) {
+            oaLocationConfig.setEnable(false);
+        }
+        if (StringUtils.isEmpty(oaLocationConfig.getId())) {
+            oaLocationConfig.setId(UidUtil.uuid());
+            oaLocationConfig.setCreateBy(UserUtils.getUser().getId());
+            oaLocationConfig.setCreateDate(new Date());
+            oaLocationConfig.setUpdateBy(UserUtils.getUser().getId());
+            oaLocationConfig.setUpdateDate(new Date());
+            oaLocationConfigService.insertSelective(oaLocationConfig);
+        } else {
+            oaLocationConfigTimeQuantumService.deleteByConfigId(oaLocationConfig.getId());
+            oaLocationConfig.setUpdateBy(UserUtils.getUser().getId());
+            oaLocationConfig.setUpdateDate(new Date());
+            oaLocationConfigService.updateByPrimaryKeySelective(oaLocationConfig);
+        }
+        if (StringUtils.isNotEmpty(timeQuantums)) {
+            OaLocationConfigTimeQuantum[] oaLocationConfigTimeQuantumArrary = JSON.parseObject(StringEscapeUtils.unescapeHtml4(timeQuantums), OaLocationConfigTimeQuantum[].class);
+            for (OaLocationConfigTimeQuantum oaLocationConfigTimeQuantum : oaLocationConfigTimeQuantumArrary) {
+                oaLocationConfigTimeQuantum.setId(UidUtil.uuid());
+                oaLocationConfigTimeQuantum.setConfigId(oaLocationConfig.getId());
+                oaLocationConfigTimeQuantum.setCreateBy(UserUtils.getUser().getId());
+                oaLocationConfigTimeQuantum.setCreateDate(new Date());
+                oaLocationConfigTimeQuantum.setUpdateBy(UserUtils.getUser().getId());
+                oaLocationConfigTimeQuantum.setUpdateDate(new Date());
+                oaLocationConfigTimeQuantumService.insertSelective(oaLocationConfigTimeQuantum);
+            }
+        }
+        return "redirect:/oa/location/config/form";
+    }
+    
+}

+ 475 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/open/ApplitionController.java

@@ -0,0 +1,475 @@
+package com.bk.wd.web.controller.open;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.bk.sys.model.SysUser;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.model.WdApplication;
+import com.bk.wd.model.WdBusinessElement;
+import com.bk.wd.model.WdCommonSimpleModule;
+import com.bk.wd.model.WdCustomer;
+import com.bk.wd.model.WdCustomerTypeSetting;
+import com.bk.wd.model.WdPerson;
+import com.bk.wd.model.WdPersonRelation;
+import com.bk.wd.model.WdProductComplexModule;
+import com.bk.wd.model.WdProductSimpleModule;
+import com.bk.wd.service.WdApplicationAssetsBuildingService;
+import com.bk.wd.service.WdApplicationAssetsCarService;
+import com.bk.wd.service.WdApplicationBalanceSheetService;
+import com.bk.wd.service.WdApplicationBuildingMortgageService;
+import com.bk.wd.service.WdApplicationBusinessIncomeStatementDetailsService;
+import com.bk.wd.service.WdApplicationBusinessIncomeStatementService;
+import com.bk.wd.service.WdApplicationBusinessService;
+import com.bk.wd.service.WdApplicationCarLoanMortgageService;
+import com.bk.wd.service.WdApplicationCoborrowerService;
+import com.bk.wd.service.WdApplicationCreditCardInfoService;
+import com.bk.wd.service.WdApplicationCreditHistoryDetailService;
+import com.bk.wd.service.WdApplicationCreditHistoryService;
+import com.bk.wd.service.WdApplicationCreditInvestigationService;
+import com.bk.wd.service.WdApplicationDualNoteService;
+import com.bk.wd.service.WdApplicationExtendInfoService;
+import com.bk.wd.service.WdApplicationFixAssetsService;
+import com.bk.wd.service.WdApplicationGoodsService;
+import com.bk.wd.service.WdApplicationIndirectInvestigationService;
+import com.bk.wd.service.WdApplicationIndustryDemandFundUseSheetService;
+import com.bk.wd.service.WdApplicationInfoDeviationAnalysisService;
+import com.bk.wd.service.WdApplicationMonthlyIncomeStatementService;
+import com.bk.wd.service.WdApplicationNetProfitLogicService;
+import com.bk.wd.service.WdApplicationOperatingBalanceSheetAdditionalService;
+import com.bk.wd.service.WdApplicationOperatingBalanceSheetCheckService;
+import com.bk.wd.service.WdApplicationOperatingBalanceSheetDetailService;
+import com.bk.wd.service.WdApplicationOperatingBalanceSheetService;
+import com.bk.wd.service.WdApplicationOutstandingAccountDetailService;
+import com.bk.wd.service.WdApplicationOutstandingAccountService;
+import com.bk.wd.service.WdApplicationPersonRelationService;
+import com.bk.wd.service.WdApplicationPersonService;
+import com.bk.wd.service.WdApplicationPhotoService;
+import com.bk.wd.service.WdApplicationProfitLogicService;
+import com.bk.wd.service.WdApplicationProfitService;
+import com.bk.wd.service.WdApplicationRecognizorService;
+import com.bk.wd.service.WdApplicationRefundPlanService;
+import com.bk.wd.service.WdApplicationService;
+import com.bk.wd.service.WdApplicationSurveySiteService;
+import com.bk.wd.service.WdApplicationTaskService;
+import com.bk.wd.service.WdApplicationYearlyIncomeStatementService;
+import com.bk.wd.service.WdBusinessElementService;
+import com.bk.wd.service.WdCommonSimpleModuleService;
+import com.bk.wd.service.WdCommonSimpleModuleSettingService;
+import com.bk.wd.service.WdCourtQueryService;
+import com.bk.wd.service.WdCustomerBacklistService;
+import com.bk.wd.service.WdCustomerService;
+import com.bk.wd.service.WdCustomerTrackService;
+import com.bk.wd.service.WdCustomerTypeService;
+import com.bk.wd.service.WdCustomerTypeSettingService;
+import com.bk.wd.service.WdDefaultSimpleModuleSettingService;
+import com.bk.wd.service.WdPersonAssetsBuildingService;
+import com.bk.wd.service.WdPersonAssetsCarService;
+import com.bk.wd.service.WdPersonRelationService;
+import com.bk.wd.service.WdPersonService;
+import com.bk.wd.service.WdProductComplexModuleService;
+import com.bk.wd.service.WdProductProcessService;
+import com.bk.wd.service.WdProductService;
+import com.bk.wd.service.WdProductSimpleModuleService;
+import com.bk.wd.service.WdProductSimpleModuleSettingService;
+import com.bk.wd.service.WdRwEmaySinowayCreditService;
+import com.bk.wd.service.WdRwTxCreditAntifraudVerifyService;
+import com.bk.wd.service.WdRwZmCreditAntifraudVerifyService;
+import com.bk.wd.util.BusinessConsts;
+import com.bk.wd.util.ProcessHandle;
+import com.bk.wd.util.process.EngineHandler;
+
+@Controller
+@RequestMapping(value = "/open/application/")
+public class ApplitionController {
+    
+    // 客户关系
+    private static final String customer_relation = "客户关系人";
+
+    // 车产
+    private static final String customer_car = "家庭主要资产(车辆)";
+
+    // 房产
+    private static final String customer_building = "家庭主要资产(房产)";
+
+    @Autowired
+    private WdApplicationService wdApplicationService;
+
+    @Autowired
+    private WdCustomerService wdCustomerService;
+
+    @Autowired
+    private WdApplicationPersonService wdApplicationPersonService;
+
+    @Autowired
+    private WdPersonService wdPersonService;
+
+    @Autowired
+    private WdApplicationCreditInvestigationService wdApplicationCreditInvestigationService;
+
+    @Autowired
+    private WdPersonAssetsCarService wdPersonAssetsCarService;
+
+    @Autowired
+    private WdApplicationAssetsCarService wdApplicationAssetsCarService;
+
+    @Autowired
+    private WdPersonAssetsBuildingService wdPersonAssetsBuildingService;
+
+    @Autowired
+    private WdApplicationAssetsBuildingService wdApplicationAssetsBuildingService;
+
+    @Autowired
+    private WdApplicationBuildingMortgageService wdApplicationBuildingMortgageService;
+
+    @Autowired
+    private WdApplicationRecognizorService wdApplicationRecognizorService;
+
+    @Autowired
+    private WdApplicationExtendInfoService wdApplicationExtendInfoService;
+
+    @Autowired
+    private WdApplicationMonthlyIncomeStatementService wdApplicationMonthlyIncomeStatementService;
+
+    @Autowired
+    private WdApplicationYearlyIncomeStatementService wdApplicationYearlyIncomeStatementService;
+
+    @Autowired
+    private WdApplicationBalanceSheetService wdApplicationBalanceSheetService;
+
+    @Autowired
+    private WdApplicationPhotoService wdApplicationPhotoService;
+
+    @Autowired
+    private WdApplicationBusinessService wdApplicationBusinessService;
+
+    @Autowired
+    private WdProductService wdProductService;
+
+    @Autowired
+    private WdProductSimpleModuleService wdProductSimpleModuleService;
+
+    @Autowired
+    private WdProductComplexModuleService wdProductComplexModuleService;
+
+    @Autowired
+    private WdProductSimpleModuleSettingService wdProductSimpleModuleSettingService;
+
+    @Autowired
+    private WdCustomerTypeService wdCustomerTypeService;
+
+    @Autowired
+    private WdCustomerTypeSettingService wdCustomerTypeSettingService;
+
+    @Autowired
+    private WdCommonSimpleModuleService wdCommonSimpleModuleService;
+
+    @Autowired
+    private WdCommonSimpleModuleSettingService wdCommonSimpleModuleSettingService;
+
+    @Autowired
+    private WdApplicationPersonRelationService wdApplicationPersonRelationService;
+
+    @Autowired
+    private WdApplicationInfoDeviationAnalysisService wdApplicationInfoDeviationAnalysisService;
+
+    @Autowired
+    private WdApplicationOperatingBalanceSheetService wdApplicationOperatingBalanceSheetService;
+
+    @Autowired
+    private WdApplicationOperatingBalanceSheetCheckService wdApplicationOperatingBalanceSheetCheckService;
+
+    @Autowired
+    private WdApplicationOperatingBalanceSheetDetailService wdApplicationOperatingBalanceSheetDetailService;
+
+    @Autowired
+    private WdApplicationOperatingBalanceSheetAdditionalService wdApplicationOperatingBalanceSheetAdditionalService;
+
+    @Autowired
+    private WdApplicationCreditHistoryService wdApplicationCreditHistoryService;
+
+    @Autowired
+    private WdApplicationCreditHistoryDetailService wdApplicationCreditHistoryDetailService;
+
+    @Autowired
+    private WdApplicationFixAssetsService wdApplicationFixAssetsService;
+
+    @Autowired
+    private WdApplicationGoodsService wdApplicationGoodsService;
+
+    @Autowired
+    private WdApplicationIndirectInvestigationService wdApplicationIndirectInvestigationService;
+
+    @Autowired
+    private WdApplicationOutstandingAccountService wdApplicationOutstandingAccountService;
+
+    @Autowired
+    private WdApplicationOutstandingAccountDetailService wdApplicationOutstandingAccountDetailService;
+
+    @Autowired
+    private WdApplicationProfitService wdApplicationProfitService;
+
+    @Autowired
+    private WdApplicationProfitLogicService wdApplicationProfitLogicService;
+
+    @Autowired
+    private WdApplicationRefundPlanService wdApplicationRefundPlanService;
+
+    @Autowired
+    private WdApplicationBusinessIncomeStatementService wdApplicationBusinessIncomeStatementService;
+
+    @Autowired
+    private WdApplicationBusinessIncomeStatementDetailsService wdApplicationBusinessIncomeStatementDetailsService;
+
+    @Autowired
+    private WdApplicationTaskService wdApplicationTaskService;
+
+    @Autowired
+    private WdApplicationCarLoanMortgageService wdApplicationCarLoanMortgageService;
+
+    @Autowired
+    private WdBusinessElementService wdBusinessElementService;
+
+    @Autowired
+    private ProcessHandle processHandle;
+
+    @Autowired
+    private WdProductProcessService wdProductProcessService;
+
+    @Autowired
+    private WdApplicationCoborrowerService wdApplicationCoborrowerService;
+
+    @Autowired
+    private WdDefaultSimpleModuleSettingService wdDefaultSimpleModuleSettingService;
+
+    @Autowired
+    private WdCustomerTrackService wdCustomerTrackService;
+
+    @Autowired
+    private WdApplicationSurveySiteService wdApplicationSurveySiteService;
+
+    @Autowired
+    private WdCourtQueryService wdCourtQueryService;
+
+    @Autowired
+    private WdRwZmCreditAntifraudVerifyService wdRwZmCreditAntifraudVerifyService;
+
+    @Autowired
+    private WdCustomerBacklistService wdCustomerBacklistService;
+
+    @Autowired
+    private WdPersonRelationService wdPersonRelationService;
+
+    @Autowired
+    private SysUserService sysUserService;
+
+    @Autowired
+    private WdApplicationDualNoteService wdApplicationDualNoteService;
+
+    @Autowired
+    private WdRwTxCreditAntifraudVerifyService wdRwTxCreditAntifraudVerifyService;
+
+    @Autowired
+    private EngineHandler processEngine;
+    
+    @Autowired
+    private WdApplicationCreditCardInfoService wdApplicationCreditCardInfoService;
+    
+    @Autowired
+    private WdApplicationNetProfitLogicService wdApplicationNetProfitLogicService;
+    
+    @Autowired
+    private WdRwEmaySinowayCreditService wdRwEmaySinowayCreditService;
+    
+    @Autowired
+    private WdApplicationIndustryDemandFundUseSheetService wdApplicationIndustryDemandFundUseSheetService;
+    
+    @RequestMapping(value = { "index" })
+    public String detail(Model model, String applicationId, String token) {
+        
+        model.addAttribute("applicationId", applicationId);
+        WdApplication wdApplication = wdApplicationService.selectByPrimaryKey(applicationId);
+        
+        SysUser currentUser = sysUserService.selectByPrimaryKey(wdApplication.getOwnerId());
+        // 申请信息
+        model.addAttribute("wdApplication", wdApplication);
+        // 产品配置
+        String productVersoin = wdApplication.getProductVersion();
+        if (StringUtils.isEmpty(productVersoin)) {
+            productVersoin = wdProductService.selectByPrimaryKey(wdApplication.getProductId()).getProductVersion();
+        }
+        Map<String, Object> productConfig = new HashMap<>();
+        List<WdProductSimpleModule> wdProductSimpleModuleList = wdProductSimpleModuleService.selectByProductVersion(wdApplication.getProductId(), productVersoin, null);
+        for (WdProductSimpleModule wdProductSimpleModule : wdProductSimpleModuleList) {
+            productConfig.put(wdProductSimpleModule.getDefaultSimpleModuleId(), wdProductSimpleModuleSettingService.selectByProductSimpleModuleId(wdProductSimpleModule.getId()));
+        }
+        model.addAttribute("productConfig", productConfig);
+
+        Map<String, Object> complexProductConfig = new HashMap<>();
+        List<WdProductComplexModule> wdProductComplexModuleList = wdProductComplexModuleService.selectByProductVersion(wdApplication.getProductId(), productVersoin, null);
+        for (WdProductComplexModule wdProductComplexModule : wdProductComplexModuleList) {
+            complexProductConfig.put(wdProductComplexModule.getDefaultComplexModuleId(), wdProductComplexModule);
+        }
+        if (!complexProductConfig.isEmpty()) { // 经营类配置
+            productConfig.put(BusinessConsts.ModuleID.BusinessInfo, wdBusinessElementService.selectByModule(BusinessConsts.ModuleID.BusinessInfo));
+        }
+        model.addAttribute("complexProductConfig", complexProductConfig);
+
+        // 客户信息
+        WdCustomer wdCustomer = wdCustomerService.selectByPrimaryKey(wdApplication.getCustomerId());
+        model.addAttribute("wdCustomer", wdCustomer);
+        // 客户配置
+        String customerTypeVersion = wdApplication.getCustomerTypeVersion();
+        if (StringUtils.isEmpty(customerTypeVersion)) {
+            customerTypeVersion = wdCustomerTypeService.selectByPrimaryKey(wdCustomer.getCustomerTypeId()).getSettingVersion();
+        }
+        List<WdCustomerTypeSetting> wdCustomerTypeSettingList = wdCustomerTypeSettingService.selectByCustomerTypeIdAndCategory(wdCustomer.getCustomerTypeId(), null, customerTypeVersion);
+        model.addAttribute("customerTypeConfigList", wdCustomerTypeSettingList);
+
+        // 其他配置
+        // 客户关系
+        /*WdCommonSimpleModule wdCommonSimpleModuleRelation = wdCommonSimpleModuleService.selectByModuleName(customer_relation, UserUtils.getUser().getCompanyId());
+        if (null != wdCommonSimpleModuleRelation) {
+            String relatedPersonVersion = wdApplication.getRelatedPersonVersion();
+            if (StringUtils.isEmpty(relatedPersonVersion)) {
+                relatedPersonVersion = wdCommonSimpleModuleRelation.getSettingVersion();
+            }
+            model.addAttribute("customerRelationConfigList", wdCommonSimpleModuleSettingService.selectByModuleVersion(wdCommonSimpleModuleRelation.getDefaultSimpleModuleId(), relatedPersonVersion));
+        }*/
+        // 车
+        WdCommonSimpleModule wdCommonSimpleModuleCar = wdCommonSimpleModuleService.selectByModuleName(customer_car, currentUser.getCompanyId());
+        if (null != wdCommonSimpleModuleCar) {
+            String assetsCarVersion = wdApplication.getAssetsCarVersion();
+            if (StringUtils.isEmpty(assetsCarVersion)) {
+                assetsCarVersion = wdCommonSimpleModuleCar.getSettingVersion();
+            }
+            model.addAttribute("customerCarConfigList", wdCommonSimpleModuleSettingService.selectByModuleVersion(wdCommonSimpleModuleCar.getDefaultSimpleModuleId(), assetsCarVersion));
+        }
+        // 房
+        WdCommonSimpleModule wdCommonSimpleModuleBuilding = wdCommonSimpleModuleService.selectByModuleName(customer_building, currentUser.getCompanyId());
+        if (null != wdCommonSimpleModuleBuilding) {
+            String assetsBuildingVersion = wdApplication.getAssetsBuildingVersion();
+            if (StringUtils.isEmpty(assetsBuildingVersion)) {
+                assetsBuildingVersion = wdCommonSimpleModuleBuilding.getSettingVersion();
+            }
+            model.addAttribute("customerBuildingConfigList", wdCommonSimpleModuleSettingService.selectByModuleVersion(wdCommonSimpleModuleBuilding.getDefaultSimpleModuleId(), assetsBuildingVersion));
+        }
+
+        model.addAttribute("wdPerson", wdApplicationPersonService.selectByApplicationId(applicationId));
+        /*model.addAttribute("customerRelationList", wdApplicationPersonRelationService.selectByApplicationId(applicationId));*/
+        model.addAttribute("customerCarList", wdApplicationAssetsCarService.selectByApplicationId(applicationId));
+        model.addAttribute("customerBuildingList", wdApplicationAssetsBuildingService.selectByFamilyAssets(applicationId));
+
+        // 经营信息
+        model.addAttribute("wdApplicationBusinesList", wdApplicationBusinessService.selectByApplicationId(applicationId));
+        // 征信信息
+        model.addAttribute("applicationCreditInvestigationList", wdApplicationCreditInvestigationService.selectByApplicationId(applicationId));
+        // 侧面调查
+        model.addAttribute("wdApplicationIndirectInvestigationList", wdApplicationIndirectInvestigationService.selectByApplicationId(applicationId));
+
+        // 房产抵押
+        model.addAttribute("applicationBuildingMortgageList", wdApplicationBuildingMortgageService.selectByApplicationId(applicationId));
+        // 车辆抵押
+        model.addAttribute("applicationCarLoanMortgageList", wdApplicationCarLoanMortgageService.selectByApplicationId(applicationId));
+        
+        model.addAttribute("wdApplicationCreditCardInfo", wdApplicationCreditCardInfoService.selectByApplicationId(applicationId));
+
+       /* // 担保人
+        model.addAttribute("wdApplicationRecognizorList", wdApplicationRecognizorService.selectByApplicationId(applicationId));
+        // 共同借款人
+        model.addAttribute("wdApplicationCoborrowerList", wdApplicationCoborrowerService.selectByApplicationId(applicationId));*/
+        // 辅助信息
+        model.addAttribute("wdApplicationExtendInfo", wdApplicationExtendInfoService.selectByApplicationId(applicationId));
+        // 收入损益表
+        model.addAttribute("applicationMonthlyIncomeStatement", wdApplicationMonthlyIncomeStatementService.selectByApplicationId(applicationId));
+        model.addAttribute("applicationYearlyIncomeStatement", wdApplicationYearlyIncomeStatementService.selectByApplicationId(applicationId));
+        // 家庭资产负债表
+        model.addAttribute("applicationBalanceSheet", wdApplicationBalanceSheetService.selectByApplicationId(applicationId));
+        // 信贷历史
+        model.addAttribute("wdApplicationCreditHistoryList", wdApplicationCreditHistoryService.selectByApplicationId(applicationId));
+        model.addAttribute("wdApplicationCreditHistoryDetailList", wdApplicationCreditHistoryDetailService.selectByApplicationId(applicationId));
+        // 软信息不对称偏差分析
+        model.addAttribute("applicationInfoDeviationAnalysis", wdApplicationInfoDeviationAnalysisService.selectByApplicationId(applicationId));
+        model.addAttribute("softInfoSheet", wdApplicationService.selectSoftInfoSheet(applicationId));
+        // 资产负债表
+        model.addAttribute("wdApplicationOperatingBalanceSheet", wdApplicationOperatingBalanceSheetService.selectByApplicationId(applicationId));
+        // 本期
+        model.addAttribute("currentPeriod", wdApplicationOperatingBalanceSheetDetailService.selectByApplicationIdAndCategory(applicationId, "1"));
+        // 上期
+        model.addAttribute("priorPeriod", wdApplicationOperatingBalanceSheetDetailService.selectByApplicationIdAndCategory(applicationId, "2"));
+        // 资产
+        model.addAttribute("assetAdditionals", wdApplicationOperatingBalanceSheetAdditionalService.selectByApplicationId(applicationId, "1"));
+        // 负债
+        model.addAttribute("debtsAdditionals", wdApplicationOperatingBalanceSheetAdditionalService.selectByApplicationId(applicationId, "2"));
+        // 对外担保情况
+        model.addAttribute("assureAdditionals", wdApplicationOperatingBalanceSheetAdditionalService.selectByApplicationId(applicationId, "3"));
+        // 权益检查
+        model.addAttribute("wdApplicationOperatingBalanceSheetCheck", wdApplicationOperatingBalanceSheetCheckService.selectByApplicationId(applicationId, null));
+        // 贷款任务
+        model.addAttribute("wdApplicationTaskList", wdApplicationTaskService.selectByApplicationId(applicationId));
+        // 车贷抵押
+        model.addAttribute("wdApplicationCarLoanMortgageList", wdApplicationCarLoanMortgageService.selectByApplicationId(applicationId));
+        
+        // 毛利率和逻辑检验
+        model.addAttribute("wdApplicationProfitList", wdApplicationProfitService.selectByApplicationId(applicationId));
+        model.addAttribute("wdApplicationNetProfitLogic", wdApplicationNetProfitLogicService.selectByApplicationId(applicationId));
+        model.addAttribute("wdApplicationProfitLogicList", wdApplicationProfitLogicService.selectByApplicationId(applicationId));
+        
+        //损益表
+        model.addAttribute("wdApplicationBusinessIncomeStatement", wdApplicationBusinessIncomeStatementService.selectByApplicationId(applicationId));
+        model.addAttribute("wdApplicationOperatingBalanceSheet", wdApplicationOperatingBalanceSheetService.selectByApplicationId(applicationId));
+
+        List<WdBusinessElement> allElementList = wdBusinessElementService.selectAll();
+        Map<String, Object> wdBusinessElementConfig = new HashMap<>();
+        for (WdBusinessElement wdBusinessElement : new ArrayList<>(allElementList)) {
+            wdBusinessElementConfig.put(wdBusinessElement.getId(), wdBusinessElement);
+            allElementList.remove(wdBusinessElement);
+        }
+        model.addAttribute("wdBusinessElementConfig", wdBusinessElementConfig);
+
+        // 申请基本信息
+        model.addAttribute("applyAuditInfoConfig", wdDefaultSimpleModuleSettingService.selectByModuleId(BusinessConsts.ModuleID.ApplyAuditInfo));
+
+        // 关系人列表
+        List<WdPersonRelation> personRelationList = new ArrayList<WdPersonRelation>();
+        WdPersonRelation wdPersonRelation = new WdPersonRelation();
+        WdPerson wdPerson = wdPersonService.selectByPrimaryKey(wdCustomer.getPersonId());
+        wdPersonRelation.setWdPerson(wdPerson);
+        wdPersonRelation.setRelationType("本人");
+        personRelationList.add(wdPersonRelation);
+        personRelationList.addAll(wdPersonRelationService.selectByApplictionId(applicationId));
+
+        model.addAttribute("personRelationList", personRelationList);
+        
+        // 调查图片
+        model.addAttribute("surveyPhotoList", wdApplicationPhotoService.selectByApplicationId(applicationId));
+        
+        model.addAttribute("wdApplicationBusinessIncomeStatement", wdApplicationBusinessIncomeStatementService.selectByApplicationId(applicationId));
+        model.addAttribute("detailsList", wdApplicationBusinessIncomeStatementDetailsService.selectByApplicationId(applicationId));
+        
+        model.addAttribute("wdApplicationOutstandingAccount", wdApplicationOutstandingAccountService.selectByApplicationId(applicationId));
+        model.addAttribute("receivableList", wdApplicationOutstandingAccountDetailService.selectByApplicationIdAndCategory(applicationId, "1"));
+        model.addAttribute("paymentList", wdApplicationOutstandingAccountDetailService.selectByApplicationIdAndCategory(applicationId, "2"));
+        model.addAttribute("wdApplicationGoodsList", wdApplicationGoodsService.selectByApplicationId(applicationId));
+        model.addAttribute("wdApplicationFixAssetsList", wdApplicationFixAssetsService.selectByApplicationId(applicationId));
+        model.addAttribute("wdApplicationRefundPlanList", wdApplicationRefundPlanService.selectByApplicationId(applicationId));
+        
+        model.addAttribute("industryDemandFundUseSheetInfo", wdApplicationIndustryDemandFundUseSheetService.selectByApplicationId(applicationId));
+
+        return "modules/wd/application/openApi/index";
+    }
+    
+    @RequestMapping(value = { "openIframe" })
+    public String getApplicationInfo() {
+        return "modules/wd/application/openApi/iframe";
+    }
+    
+}

+ 270 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sm/SmElementController.java

@@ -0,0 +1,270 @@
+package com.bk.wd.web.controller.sm;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.alibaba.fastjson.JSON;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sm.model.SmElement;
+import com.bk.sm.model.SmElementDataConfig;
+import com.bk.sm.model.SmElementDataConfigItem;
+import com.bk.sm.service.SmElementDataConfigItemService;
+import com.bk.sm.service.SmElementDataConfigService;
+import com.bk.sm.service.SmElementService;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdBusinessElement;
+import com.bk.wd.model.WdDefaultSimpleModule;
+import com.bk.wd.model.WdSelectItem;
+import com.bk.wd.model.WdSelectList;
+import com.bk.wd.service.WdBusinessElementService;
+import com.bk.wd.service.WdDefaultSimpleModuleService;
+import com.bk.wd.service.WdSelectItemService;
+import com.bk.wd.service.WdSelectListService;
+import com.bk.wd.util.BusinessConsts;
+import com.bk.wd.vo.ModuleSettingVo;
+
+/**
+ * 评分元素设置
+ * @Project Name:bk-wd-web 
+ * @Date:2017年11月12日下午5:54:00 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sm/element")
+public class SmElementController {
+    
+    @Autowired
+    private SmElementService smElementService;
+    
+    @Autowired
+    private SmElementDataConfigItemService smElementDataConfigItemService;
+    
+    @Autowired
+    private SmElementDataConfigService smElementDataConfigService;
+    
+    @Autowired
+    private WdBusinessElementService wdBusinessElementService;
+    
+    @Autowired
+    private WdSelectListService selectListService;
+    
+    @Autowired
+    private WdSelectItemService wdSelectItemService;
+    
+    @Autowired
+    private WdDefaultSimpleModuleService wdDefaultSimpleModuleService;
+    
+    @RequestMapping(value = "/form")
+    public String form() {
+        return "modules/sm/element/elementForm";
+    }
+    @RequestMapping(value = "dataRange_configPanel")
+    public String dataRange_configPanel() {
+        return "modules/sm/element/dataRange_configPanel";
+    }
+    @RequestMapping(value = "/dataRange-add-group")
+    public String dataRangeaddgroup() {
+        return "modules/sm/element/dataRange-add-group";
+    }
+    @RequestMapping(value = "/dataRange-add-list")
+    public String dataRangeaddlist() {
+        return "modules/sm/element/dataRange-add-list";
+    }
+    @RequestMapping(value = "/dataRange-list")
+    public String dataRangelist() {
+        return "modules/sm/element/dataRange-list";
+    }
+    
+    @RequestMapping(value = "/list")
+    @ResponseBody
+    public JsonResult findElementList() {
+        List<SmElement> smElementList = smElementService.selectByCondition(null);
+        for (SmElement smElement : smElementList) {
+            switch (smElement.getElementType()) {
+                case 1:
+                    List<SmElementDataConfig> smElementDataConfigList = smElementDataConfigService.selectByElementId(smElement.getId());
+                    for (SmElementDataConfig smElementDataConfig : smElementDataConfigList) {
+                        smElementDataConfig.setItemList(smElementDataConfigItemService.selectByConfigId(smElementDataConfig.getId()));
+                    }
+                    smElement.setDataConfigList(smElementDataConfigList);
+                case 2:
+                    WdBusinessElement wdBusinessElement = wdBusinessElementService.selectByPrimaryKey(smElement.getSourceId());
+                    List<WdSelectList> selectListList = selectListService.selectByGroupId(wdBusinessElement.getSelectGroupId());
+                    for (WdSelectList wdSelectList : selectListList) {
+                        wdSelectList.setItemList(wdSelectItemService.selectByListId(wdSelectList.getId()));
+                    }
+                    smElement.setSelectList(selectListList);
+                    break;
+                default:
+                    break;
+            }
+        }
+        
+        return new JsonResult(smElementList);
+    }
+    
+    @RequestMapping(value = "/moduleList")
+    @ResponseBody
+    public JsonResult findModuleList() {
+        String[] moduleIdArray = {
+                BusinessConsts.ModuleID.PersonInfo, 
+                BusinessConsts.ModuleID.ExtendInfo,
+                BusinessConsts.ModuleID.YearlyIncomeStatement,
+                BusinessConsts.ModuleID.MonthlyIncomeStatement,
+                BusinessConsts.ModuleID.BalanceSheet
+            };
+        List<Map<String, Object>> moduleList = new ArrayList<>();
+        for (String moduleId : moduleIdArray) {
+            WdDefaultSimpleModule wdDefaultSimpleModule = wdDefaultSimpleModuleService.selectByPrimaryKey(moduleId);
+            Map<String, Object> module = new HashMap<>();
+            module.put("moduleId", moduleId);
+            module.put("moduleName", wdDefaultSimpleModule.getName());
+            List<ModuleSettingVo> elementList = wdBusinessElementService.selectByModule(moduleId);
+            for (ModuleSettingVo moduleSettingVo : elementList) {
+                if (StringUtils.isNotEmpty(moduleSettingVo.getSelectGroupId())) {
+                    List<WdSelectList> selectListList = selectListService.selectByGroupId(moduleSettingVo.getSelectGroupId());
+                    for (WdSelectList wdSelectList : selectListList) {
+                        wdSelectList.setItemList(wdSelectItemService.selectByListId(wdSelectList.getId()));
+                    }
+                    moduleSettingVo.setSelectList(selectListList);
+                }
+            }
+            module.put("elementList", elementList);
+            moduleList.add(module);
+        }
+        return new JsonResult(moduleList);
+    }
+    
+    @RequestMapping(value = "/saveSmElement")
+    @ResponseBody
+    public JsonResult saveSmElement(SmElement smElement, String elementId) {
+        Date now = new Date();
+        
+        WdBusinessElement wdBusinessElement = wdBusinessElementService.selectByPrimaryKey(smElement.getSourceId());
+        smElement.setElementKey(wdBusinessElement.getKey());
+        smElement.setElementName(wdBusinessElement.getName());
+        smElement.setElementType(1);
+        if (StringUtils.isNotEmpty(wdBusinessElement.getSelectGroupId())) {
+            smElement.setElementType(2);
+        }
+        
+        if (StringUtils.isEmpty(elementId)) {
+            smElement.setId(UidUtil.uuid());
+            smElement.setCreateBy(UserUtils.getUser().getId());
+            smElement.setCreateDate(now);
+            smElement.setUpdateDate(now);
+            smElement.setUpdateBy(UserUtils.getUser().getId());
+            smElementService.insertSelective(smElement);
+        } else {
+            smElement.setId(elementId);
+            smElement.setUpdateDate(now);
+            smElement.setUpdateBy(UserUtils.getUser().getId());
+            smElementService.updateByPrimaryKeySelective(smElement);
+        }
+        return new JsonResult(smElement);
+    }
+    
+    @RequestMapping(value = "/deleteSmElement")
+    @ResponseBody
+    public JsonResult deleteSmElement(String elementId) {
+        smElementService.deleteByPrimaryKey(elementId);
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "/saveDataConfig")
+    @ResponseBody
+    public JsonResult saveDataConfig(SmElementDataConfig smElementDataConfig, String dataConfigId) {
+        Date now = new Date();
+        if (StringUtils.isEmpty(dataConfigId)) {
+            smElementDataConfig.setId(UidUtil.uuid());
+            smElementDataConfig.setCreateBy(UserUtils.getUser().getId());
+            smElementDataConfig.setCreateDate(now);
+            smElementDataConfig.setUpdateDate(now);
+            smElementDataConfig.setUpdateBy(UserUtils.getUser().getId());
+            smElementDataConfigService.insertSelective(smElementDataConfig);
+        } else {
+            smElementDataConfig.setId(dataConfigId);
+            smElementDataConfig.setUpdateDate(now);
+            smElementDataConfig.setUpdateBy(UserUtils.getUser().getId());
+            smElementDataConfigService.updateByPrimaryKeySelective(smElementDataConfig);
+        }
+        return new JsonResult(smElementDataConfig);
+    }
+    
+    @RequestMapping(value = "/deleteDataConfig")
+    @ResponseBody
+    public JsonResult deleteDataConfig(String dataConfigId) {
+        smElementDataConfigService.deleteByPrimaryKey(dataConfigId);
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "/saveDataConfigItem")
+    @ResponseBody
+    public JsonResult saveDataConfigItem(SmElementDataConfigItem smElementDataConfigItem, String dataConfigItemId) {
+        Date now = new Date();
+        if (StringUtils.isEmpty(dataConfigItemId)) {
+            smElementDataConfigItem.setId(UidUtil.uuid());
+            smElementDataConfigItem.setCreateBy(UserUtils.getUser().getId());
+            smElementDataConfigItem.setCreateDate(now);
+            smElementDataConfigItem.setUpdateDate(now);
+            smElementDataConfigItem.setUpdateBy(UserUtils.getUser().getId());
+            smElementDataConfigItemService.insertSelective(smElementDataConfigItem);
+        } else {
+            smElementDataConfigItem.setId(dataConfigItemId);
+            smElementDataConfigItem.setUpdateDate(now);
+            smElementDataConfigItem.setUpdateBy(UserUtils.getUser().getId());
+            smElementDataConfigItemService.updateByPrimaryKeySelective(smElementDataConfigItem);
+        }
+        return new JsonResult(smElementDataConfigItem);
+    }
+    
+    @RequestMapping(value = "/saveDataConfigItems")
+    @ResponseBody
+    public JsonResult saveDataConfigItems(String itemData, String dataConfigId) {
+        Date now = new Date();
+        smElementDataConfigItemService.deleteByConfigId(dataConfigId);
+        SmElementDataConfigItem[] smElementDataConfigItemArray = JSON.parseObject(itemData, SmElementDataConfigItem[].class);
+        for (SmElementDataConfigItem smElementDataConfigItem : smElementDataConfigItemArray) {
+            smElementDataConfigItem.setId(UidUtil.uuid());
+            smElementDataConfigItem.setDataConfigId(dataConfigId);
+            smElementDataConfigItem.setCreateBy(UserUtils.getUser().getId());
+            smElementDataConfigItem.setCreateDate(now);
+            smElementDataConfigItem.setUpdateDate(now);
+            smElementDataConfigItem.setUpdateBy(UserUtils.getUser().getId());
+            smElementDataConfigItemService.insertSelective(smElementDataConfigItem);
+        }
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "/saveSelectItems")
+    @ResponseBody
+    public JsonResult saveSelectItems(String itemData) {
+        Date now = new Date();
+        WdSelectItem[] selectItemArray = JSON.parseObject(itemData, WdSelectItem[].class);
+        for (WdSelectItem wdSelectItem : selectItemArray) {
+            wdSelectItem.setUpdateDate(now);
+            wdSelectItem.setUpdateBy(UserUtils.getUser().getId());
+            wdSelectItemService.updateByPrimaryKeySelective(wdSelectItem);
+        }
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "/deleteDataConfigItem")
+    @ResponseBody
+    public JsonResult deleteDataConfigItem(String dataConfigItemId) {
+        smElementDataConfigItemService.deleteByPrimaryKey(dataConfigItemId);
+        return new JsonResult();
+    }
+    
+}

+ 147 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sm/SmModelController.java

@@ -0,0 +1,147 @@
+package com.bk.wd.web.controller.sm;
+
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.alibaba.fastjson.JSON;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sm.model.SmModel;
+import com.bk.sm.model.SmModelElementConfig;
+import com.bk.sm.model.SmModelElementConfigItem;
+import com.bk.sm.service.SmModelElementConfigItemService;
+import com.bk.sm.service.SmModelElementConfigService;
+import com.bk.sm.service.SmModelService;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdSelectItem;
+import com.bk.wd.service.WdSelectItemService;
+
+/**
+ * 评分模型设置
+ * @Project Name:bk-wd-web 
+ * @Date:2017年11月12日下午3:34:12 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sm/model")
+public class SmModelController {
+    
+    @Autowired
+    private SmModelService smModelService;
+    
+    @Autowired
+    private SmModelElementConfigService smModelElementConfigService;
+    
+    @Autowired
+    private SmModelElementConfigItemService smModelElementConfigItemService;
+    
+    @Autowired
+    private WdSelectItemService wdSelectItemService;
+    
+    @RequestMapping(value = "/list")
+    public String findList(Model model, Pagination pagination) {
+        smModelService.selectByPagination(pagination, null);
+        model.addAttribute("pagination", pagination);
+        return "modules/sm/model/modelList";
+    }
+    
+    @RequestMapping(value = "/form")
+    public String form(Model model, String id) {
+        model.addAttribute("id", id);
+        return "modules/sm/model/modelForm";
+    }
+    
+    @RequestMapping(value = "/detail")
+    @ResponseBody
+    public JsonResult getModelInfo(String modelId) {
+        if (StringUtils.isEmpty(modelId)) {
+           return new JsonResult();
+        }
+        SmModel smModel = smModelService.selectByPrimaryKey(modelId);
+        List<SmModelElementConfig> elementConfigList = smModelElementConfigService.selectByModelId(modelId);
+        for (SmModelElementConfig smModelElementConfig : elementConfigList) {
+            smModelElementConfig.setElementConfigItemList(smModelElementConfigItemService.selectByElementConfigId(smModelElementConfig.getId()));
+        }
+        smModel.setElementConfigList(elementConfigList);
+        return new JsonResult(smModel);
+    }
+    
+    @RequestMapping(value = "/save")
+    @ResponseBody
+    public JsonResult save(SmModel smModel, String elementConfigs) {
+        Date now = new Date();
+        if (StringUtils.isEmpty(smModel.getId())) {
+            smModel.setId(UidUtil.uuid());
+            smModel.setCreateBy(UserUtils.getUser().getId());
+            smModel.setCreateDate(now);
+            smModel.setUpdateDate(now);
+            smModel.setUpdateBy(UserUtils.getUser().getId());
+            smModelService.insertSelective(smModel);
+        } else {
+            smModelElementConfigService.deleteByModelId(smModel.getId());
+            
+            SmModel smModel1 = smModelService.selectByPrimaryKey(smModel.getId());
+            smModel.setCreateBy(smModel1.getCreateBy());
+            smModel.setCreateDate(smModel1.getCreateDate());
+            smModel.setUpdateDate(now);
+            smModel.setUpdateBy(UserUtils.getUser().getId());
+            smModelService.updateByPrimaryKey(smModel);
+        }
+        
+        if (StringUtils.isNotEmpty(elementConfigs)) {
+            SmModelElementConfig[] smModelElementConfigArray = JSON.parseObject(elementConfigs, SmModelElementConfig[].class);
+            for (SmModelElementConfig smModelElementConfig : smModelElementConfigArray) {
+                smModelElementConfig.setId(UidUtil.uuid());
+                smModelElementConfig.setCreateDate(now);
+                smModelElementConfig.setCreateBy(UserUtils.getUser().getId());
+                smModelElementConfig.setModelId(smModel.getId());
+                if (null != smModelElementConfig.getElementConfigItemList()) {
+                    for (SmModelElementConfigItem smModelElementConfigItem : smModelElementConfig.getElementConfigItemList()) {
+                        smModelElementConfigItem.setId(UidUtil.uuid());
+                        smModelElementConfigItem.setCreateDate(now);
+                        smModelElementConfigItem.setCreateBy(UserUtils.getUser().getId());
+                        if (StringUtils.isNotEmpty(smModelElementConfigItem.getSelectItemId())) {
+                            WdSelectItem wdSelectItem = wdSelectItemService.selectByPrimaryKey(smModelElementConfigItem.getSelectItemId());
+                            smModelElementConfigItem.setSelectListId(wdSelectItem.getSelectListId());
+                        }
+                        smModelElementConfigItem.setUpdateBy(UserUtils.getUser().getId());
+                        smModelElementConfigItem.setUpdateDate(now);
+                        smModelElementConfigItem.setElementConfigId(smModelElementConfig.getId());
+                        smModelElementConfigItemService.insertSelective(smModelElementConfigItem);
+                    }
+                }
+                smModelElementConfigService.insertSelective(smModelElementConfig);
+            }
+        }
+        return new JsonResult(smModel);
+    }
+    
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(SmModel smModel) {
+        smModel.setUpdateBy(UserUtils.getUser().getId());
+        smModel.setUpdateDate(new Date());
+        smModel.setDelFlag(true);
+        smModelService.updateByPrimaryKeySelective(smModel);
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "enable")
+    @ResponseBody
+    public JsonResult disable(SmModel smModel) {
+        smModel.setUpdateBy(UserUtils.getUser().getId());
+        smModel.setUpdateDate(new Date());
+        smModelService.updateByPrimaryKeySelective(smModel);
+        return new JsonResult();
+    }
+
+}

+ 103 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/AreaController.java

@@ -0,0 +1,103 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysArea;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysAreaService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 区域管理
+ * @Project Name:bk-wd-web 
+ * @Date:2017年3月7日下午2:30:11 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/area")
+public class AreaController extends BaseController {
+
+	@Autowired
+	private SysAreaService areaService;
+	
+	@ModelAttribute("sysArea")
+	public SysArea get(@RequestParam(required=false) String id) {
+		if (StringUtils.isNotBlank(id)){
+			return areaService.selectByPrimaryKey(id);
+		}else{
+			return new SysArea();
+		}
+	}
+
+	@RequestMapping(value = {"list", ""})
+	public String list(SysArea sysArea, Model model) {
+		model.addAttribute("list", areaService.queryAll());
+		return "modules/sys/area/areaList";
+	}
+
+	@RequestMapping(value = "form")
+	public String form(SysArea sysArea, Model model) {
+		model.addAttribute("areaParent", areaService.selectByPrimaryKey(sysArea.getParentId()));
+		model.addAttribute("sysArea", sysArea);
+		return "modules/sys/area/areaForm";
+	}
+	
+	@RequestMapping(value = "save")
+	@ResponseBody
+	public JsonResult save(SysArea sysArea, Model model) {
+	    if (StringUtils.isEmpty(sysArea.getId())) {
+	        sysArea.setId(IdGen.uuid());
+	        sysArea.setCreateBy(UserUtils.getUser().getId());
+            sysArea.setCreateDate(new Date());
+            sysArea.setUpdateBy(UserUtils.getUser().getId());
+            sysArea.setUpdateDate(new Date());
+            areaService.insertSelective(sysArea);
+        } else {
+            sysArea.setUpdateBy(UserUtils.getUser().getId());
+            sysArea.setUpdateDate(new Date());
+            areaService.updateByPrimaryKeySelective(sysArea);
+        }
+	    return new JsonResult();
+	}
+	
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public JsonResult delete(SysArea sysArea) {
+	    sysArea.setUpdateBy(UserUtils.getUser().getId());
+        sysArea.setUpdateDate(new Date());
+        sysArea.setDelFlag(true);
+        areaService.updateByPrimaryKeySelective(sysArea);
+		return new JsonResult();
+	}
+/*
+	@RequiresPermissions("user")
+	@ResponseBody
+	@RequestMapping(value = "treeData")
+	public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId, HttpServletResponse response) {
+		List<Map<String, Object>> mapList = Lists.newArrayList();
+		List<Area> list = areaService.findAll();
+		for (int i=0; i<list.size(); i++){
+			Area e = list.get(i);
+			if (StringUtils.isBlank(extId) || (extId!=null && !extId.equals(e.getId()) && e.getParentIds().indexOf(","+extId+",")==-1)){
+				Map<String, Object> map = Maps.newHashMap();
+				map.put("id", e.getId());
+				map.put("pId", e.getParentId());
+				map.put("name", e.getName());
+				mapList.add(map);
+			}
+		}
+		return mapList;
+	}*/
+}

+ 94 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/ConfigurationController.java

@@ -0,0 +1,94 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.model.SysConfiguration;
+import com.bk.sys.model.SysDict;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysConfigurationService;
+import com.bk.sys.service.SysOfficeService;
+import com.bk.sys.utils.DictUtils;
+import com.bk.wd.web.base.BaseController;
+
+@RequestMapping({ "/wd/configuration" })
+@Controller
+public class ConfigurationController extends BaseController {
+
+    @Autowired
+    private SysConfigurationService configurationService;
+
+    @Autowired
+    private SysOfficeService officeService;
+
+    @RequiresPermissions("wd:configuration:edit")
+    @RequestMapping(value = { "/list" })
+    public String list(Model model) {
+        SysUser currentUser = UserUtils.getUser();
+        SysOffice company = officeService.selectByPrimaryKey(currentUser.getCompanyId());
+
+        List<SysConfiguration> configList = configurationService.selectByOffice(currentUser.getCompanyId());
+        List<SysDict> dictList = DictUtils.getDictList("系统启禁用可控模块");
+
+        for (SysDict sysDict : dictList) {
+            boolean hasSetted = false;
+            for (SysConfiguration config : configList) {
+                if (config.getKey().equals(sysDict.getValue())) {
+                    hasSetted = true;
+                    config.setDescription(sysDict.getDescription());
+                    break;
+                }
+            }
+            if (!hasSetted) {
+                SysConfiguration configuration = new SysConfiguration();
+                configuration.setId(UidUtil.uuid());
+                configuration.setOfficeId(currentUser.getCompanyId());
+                if (null != company) 
+                    configuration.setOfficeName(company.getName());
+                configuration.setKey(sysDict.getValue());
+                configuration.setValue("disable");
+                configuration.setRemarks(sysDict.getLabel());
+                configuration.setCreateBy(currentUser.getId());
+                configuration.setCreateDate(new Date());
+                configuration.setUpdateBy(currentUser.getId());
+                configuration.setUpdateDate(new Date());
+                configuration.setDescription(sysDict.getDescription());
+                
+                configurationService.insertSelective(configuration);
+
+                configList.add(configuration);
+            }
+        }
+
+        model.addAttribute("Configurations", configList);
+        return "modules/sys/configuration/list";
+    }
+
+    @RequiresPermissions("wd:configuration:edit")
+    @RequestMapping(value = { "/enable" })
+    @ResponseBody
+    public JsonResult enable(String id, String enable) {
+        SysConfiguration configuration = configurationService.selectByPrimaryKey(id);
+        if (null == configuration) {
+            return new JsonResult(false, "找不到对应的配置项");
+        }
+
+        configuration.setValue(enable);
+        configuration.setUpdateBy(UserUtils.getUser().getId());
+        configuration.setUpdateDate(new Date());
+        configurationService.updateByPrimaryKeySelective(configuration);
+
+        return new JsonResult(configurationService);
+    }
+}

+ 126 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/DictController.java

@@ -0,0 +1,126 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.Date;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysDict;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysDictService;
+import com.bk.sys.utils.DictUtils;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 字典管理
+ * @Project Name:bk-wd-web 
+ * @Date:2017年3月7日下午2:30:18 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/dict")
+public class DictController extends BaseController {
+
+	@Autowired
+	private SysDictService dictService;
+	
+	@ModelAttribute
+	public SysDict get(@RequestParam(required=false) String id) {
+		if (StringUtils.isNotBlank(id)){
+			return dictService.selectByPrimaryKey(id);
+		}else{
+			return new SysDict();
+		}
+	}
+	
+	@RequiresPermissions("sys:dict:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(SysDict sysDict, Pagination pagination, HttpServletRequest request, HttpServletResponse response, Model model) {
+        dictService.findByPage(pagination, sysDict);
+        model.addAttribute("pagination", pagination);
+		return "modules/sys/dict/dictList";
+	}
+	
+	@RequiresPermissions("sys:dict:view")
+    @RequestMapping(value = "form")
+    public String form(SysDict sysDict, Model model) {
+        model.addAttribute("sysDict", sysDict);
+        return "modules/sys/dict/dictForm";
+    }
+	
+	@RequiresPermissions("sys:dict:edit")
+    @RequestMapping(value = "save")
+	@ResponseBody
+    public JsonResult save(SysDict sysDict, Model model, RedirectAttributes redirectAttributes) {
+	    if (StringUtils.isEmpty(sysDict.getId())) {
+	        sysDict.setId(IdGen.uuid());
+	        sysDict.setCreateBy(UserUtils.getUser().getId());
+	        sysDict.setCreateDate(new Date());
+	        sysDict.setUpdateBy(UserUtils.getUser().getId());
+	        sysDict.setUpdateDate(new Date());
+            dictService.insertSelective(sysDict);
+        } else {
+            sysDict.setUpdateBy(UserUtils.getUser().getId());
+            sysDict.setUpdateDate(new Date());
+            dictService.updateByPrimaryKeySelective(sysDict);
+        }
+	    DictUtils.clearDictCache();
+	    return new JsonResult();
+    }
+	
+	@RequiresPermissions("sys:dict:del")
+    @RequestMapping(value = "delete")
+	@ResponseBody
+    public JsonResult delete(SysDict sysDict, RedirectAttributes redirectAttributes) {
+	    sysDict.setDelFlag(true);
+	    sysDict.setUpdateBy(UserUtils.getUser().getId());
+	    sysDict.setUpdateDate(new Date());
+	    dictService.updateByPrimaryKeySelective(sysDict);
+	    DictUtils.clearDictCache();
+        return new JsonResult();
+    }
+
+/*	
+	@RequiresPermissions("user")
+	@ResponseBody
+	@RequestMapping(value = "treeData")
+	public List<Map<String, Object>> treeData(@RequestParam(required=false) String type, HttpServletResponse response) {
+		List<Map<String, Object>> mapList = Lists.newArrayList();
+		Dict dict = new Dict();
+		dict.setType(type);
+		List<Dict> list = dictService.findList(dict);
+		for (int i=0; i<list.size(); i++){
+			Dict e = list.get(i);
+			Map<String, Object> map = Maps.newHashMap();
+			map.put("id", e.getId());
+			map.put("pId", e.getParentId());
+			map.put("name", StringUtils.replace(e.getLabel(), " ", ""));
+			mapList.add(map);
+		}
+		return mapList;
+	}
+	
+	@ResponseBody
+	@RequestMapping(value = "listData")
+	public List<Dict> listData(@RequestParam(required=false) String type) {
+		Dict dict = new Dict();
+		dict.setType(type);
+		return dictService.findList(dict);
+	}
+*/
+}

+ 74 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/GlobalSettingController.java

@@ -0,0 +1,74 @@
+package com.bk.wd.web.controller.sys;
+
+import java.io.IOException;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import com.bk.common.service.DfsService;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysGlobalSettingService;
+import com.bk.sys.model.SysGlobalSetting;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 系统全局设置
+ * @Project Name:bk-wd-web 
+ * @Date:2017年3月17日下午1:40:16 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/globalSetting")
+public class GlobalSettingController extends BaseController {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(GlobalSettingController.class);
+    
+    @Autowired
+    private SystemService systemService;
+    
+    @Autowired
+    private SysGlobalSettingService sysGlobalSettingService;
+    
+    @Autowired
+    private DfsService dfsService;
+    
+    @RequiresPermissions("sys:globalsetting:edit")
+    @RequestMapping(value = "form")
+    public String form(Model model) {
+        model.addAttribute("sysGlobalSetting", sysGlobalSettingService.selectByCompany(UserUtils.getUser().getCompanyId()));
+        return "modules/sys/globalsetting/form";
+    }
+    
+    @RequiresPermissions("sys:globalsetting:edit")
+    @RequestMapping(value = "save")
+    public String save(SysGlobalSetting sysGlobalSetting, Model model, @RequestParam(value = "loginPhotoFile", required = false)CommonsMultipartFile loginPhotoFile,
+            @RequestParam(value = "systemLogoFile", required = false)CommonsMultipartFile systemLogoFile,
+            @RequestParam(value = "systemIcoFile", required = false)CommonsMultipartFile systemIcoFile) {
+        try {
+            if (null != loginPhotoFile && !loginPhotoFile.isEmpty() && loginPhotoFile.getSize() > 0) {
+                sysGlobalSetting.setLoginPhoto(dfsService.uploadFile(loginPhotoFile.getBytes(), loginPhotoFile.getOriginalFilename()));
+            }
+            if (null != systemLogoFile && !systemLogoFile.isEmpty() && systemLogoFile.getSize() > 0) {
+                sysGlobalSetting.setSystemLogo(dfsService.uploadFile(systemLogoFile.getBytes(), systemLogoFile.getOriginalFilename()));
+            }
+            if (null != systemIcoFile && !systemIcoFile.isEmpty() && systemIcoFile.getSize() > 0) {
+                sysGlobalSetting.setSystemIco(dfsService.uploadFile(systemIcoFile.getBytes(), systemIcoFile.getOriginalFilename()));
+            }
+        } catch (IOException e) {
+            LOGGER.error("上传照片失败", e);
+        }
+        sysGlobalSetting.setCompanyId(UserUtils.getUser().getCompanyId());
+        systemService.saveGlobalSetting(sysGlobalSetting);
+        return "redirect:/sys/globalSetting/form";
+    }
+    
+}

+ 283 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/GroupController.java

@@ -0,0 +1,283 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.model.SysDict;
+import com.bk.sys.model.SysGroup;
+import com.bk.sys.model.SysGroupUser;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysDictService;
+import com.bk.sys.service.SysGroupService;
+import com.bk.sys.service.SysGroupUserService;
+import com.bk.sys.service.SysOfficeService;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 分组管理
+ * @Project Name:bk-wd-web 
+ * @Date:2017年4月28日下午4:46:02 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/group")
+public class GroupController extends BaseController {
+    
+    @Autowired
+    private SysGroupService sysGroupService;
+    
+    @Autowired
+    private SysUserService sysUserService;
+    
+    @Autowired
+    private SysOfficeService sysOfficeService;
+    
+    @Autowired
+    private SysGroupUserService sysGroupUserService;
+    
+    @Autowired
+    private SystemService systemService;
+    
+    @Autowired
+    private SysDictService sysDictService;
+
+    @ModelAttribute()
+    public SysGroup get(@RequestParam(required=false) String id) {
+        if (StringUtils.isNotBlank(id)){
+            return sysGroupService.selectByPrimaryKey(id);
+        }else{
+            return new SysGroup();
+        }
+    }
+    
+    /**
+     * 分组列表
+     * date: 2017年5月4日 下午7:49:54 <br/> 
+     * @author Liam 
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:group:view")
+    @RequestMapping(value = {"list", ""})
+    public String list(Model model) {
+        model.addAttribute("list", sysGroupService.selectBaseGroupByUser(UserUtils.getUser()));
+        return "modules/sys/group/groupList";
+    }
+    
+    /**
+     * 流程节点列表
+     * date: 2017年5月4日 下午7:49:54 <br/> 
+     * @author Liam 
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:group:view")
+    @RequestMapping(value = {"cllList"})
+    public String cllList(Model model) {
+        model.addAttribute("list", sysGroupService.selectOnlineGroupByUser(UserUtils.getUser()));
+        return "modules/sys/group/cllGroupList";
+    }
+    
+    /**
+     * 初始化线上贷款流程节点配置
+     * @return
+     */
+    @RequiresPermissions("sys:group:init:online:config")
+    @RequestMapping(value = {"initOnlineUserGroupCategory"})
+    @ResponseBody
+    public JsonResult initOnlineUserGroupCategory() {
+    	List<SysDict> sysDictList = sysDictService.selectByType(SysGroup.ONLINE_GOURP_CATEGORY);
+    	for (SysDict sysDict : sysDictList) {
+    		List<SysGroup> sysGroupList = sysGroupService.selectByCategory(sysDict.getValue(), UserUtils.getUser());
+    		if (sysGroupList.isEmpty()) {
+    			SysGroup sysGroup = new SysGroup();
+    			sysGroup.setId(UidUtil.uuid());
+    			sysGroup.setCompanyId(UserUtils.getUser().getCompanyId());
+    			sysGroup.setCreateBy(UserUtils.getUser().getId());
+                sysGroup.setCreateDate(new Date());
+                sysGroup.setUpdateBy(UserUtils.getUser().getId());
+                sysGroup.setUpdateDate(new Date());
+                
+                sysGroup.setName(sysDict.getLabel());
+                sysGroup.setCategory(sysDict.getValue());
+                sysGroupService.insertSelective(sysGroup);
+    		}
+    	}
+    	return new JsonResult();
+    }
+
+    /**
+     * 用户分组列表
+     * date: 2017年5月4日 下午7:49:29 <br/> 
+     * @author Liam 
+     * @param request
+     * @param response
+     * @param pagination
+     * @param sysGroup
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequestMapping(value = {"userList"})
+    @RequiresPermissions("sys:group:view")
+    public String userList(HttpServletRequest request, HttpServletResponse response, Pagination pagination, SysGroup sysGroup,
+            Model model) {
+        if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+            sysGroup.setUserId(UserUtils.getUser().getId());
+        }
+        sysUserService.selectByGroupPagination(pagination, sysGroup);
+        model.addAttribute("pagination", pagination);
+        return "modules/sys/group/userList";
+    }
+
+    /**
+     * 编辑分组
+     * date: 2017年5月3日 下午9:08:51 <br/> 
+     * @author Liam 
+     * @param sysRole
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:group:edit")
+    @RequestMapping(value = "form")
+    public String form(SysGroup sysGroup, Model model) {
+        model.addAttribute("sysGroup", sysGroup);
+        return "modules/sys/group/groupForm";
+    }
+    
+    /**
+     * 保存分组
+     * date: 2017年5月4日 下午8:32:59 <br/> 
+     * @author Liam 
+     * @param sysGroup
+     * @param menuIds
+     * @param model
+     * @param redirectAttributes
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:group:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(SysGroup sysGroup, String menuIds, Model model, RedirectAttributes redirectAttributes) {
+        if (StringUtils.isBlank(sysGroup.getId())) {
+            sysGroup.setId(IdGen.uuid());
+            sysGroup.setCreateBy(UserUtils.getUser().getId());
+            sysGroup.setCreateDate(new Date());
+            sysGroup.setCompanyId(UserUtils.getUser().getCompanyId());
+            sysGroup.setUpdateBy(UserUtils.getUser().getId());
+            sysGroup.setUpdateDate(new Date());
+            sysGroupService.insertSelective(sysGroup);
+        } else {
+            sysGroup.setUpdateBy(UserUtils.getUser().getId());
+            sysGroup.setUpdateDate(new Date());
+            sysGroupService.updateByPrimaryKeySelective(sysGroup);
+        }
+        return new JsonResult(sysGroup);
+    }
+    
+    /**
+     * 分配用户组页面
+     * @param role
+     * @param model
+     * @return
+     */
+    @RequiresPermissions("sys:group:assignment")
+    @RequestMapping(value = "groupUserForm")
+    public String groupUserForm(SysGroup sysGroup, Model model) {
+        model.addAttribute("sysGroup", sysGroup);
+        if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+            sysGroup.setUserId(UserUtils.getUser().getId());
+        }
+        model.addAttribute("userList", sysUserService.selectByGroup(sysGroup));
+        model.addAttribute("officeList", sysOfficeService.treeData(systemService.findAllOffice(), SysOffice.HeadCompany));
+        return "modules/sys/group/groupUserForm";
+    }
+    
+    /**
+     * 保存用户分配组
+     * @param role
+     * @param idsArr
+     * @return
+     */
+    @RequiresPermissions("sys:group:assignment")
+    @RequestMapping(value = "saveGroupUser")
+    @ResponseBody
+    public JsonResult saveRoleUser(SysGroup sysGroup, String userIds) {
+        sysGroupUserService.deleteByGroupAndUser(null, sysGroup.getId());
+        if (StringUtils.isNotEmpty(userIds)) {
+            String[] userIdArray = userIds.split(",");
+            for (String userId : userIdArray) {
+                SysGroupUser sysGroupUser = new SysGroupUser();
+                sysGroupUser.setId(IdGen.uuid());
+                //sysUserRole.setCompanyId(user.getCompanyId());
+                sysGroupUser.setGroupId(sysGroup.getId());
+                sysGroupUser.setUserId(userId);
+                sysGroupUserService.insertSelective(sysGroupUser);
+            }
+        }
+        return new JsonResult();
+    }
+    
+    /**
+     * 角色用户组
+     * date: 2017年5月3日 下午7:01:41 <br/> 
+     * @author Liam 
+     * @param sysRole
+     * @param redirectAttributes
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:group:del")
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(SysGroup sysGroup) {
+        sysGroup.setUpdateBy(UserUtils.getUser().getId());
+        sysGroup.setUpdateDate(new Date());
+        sysGroup.setDelFlag(true);
+        sysGroupService.updateByPrimaryKeySelective(sysGroup);
+        return new JsonResult(true, "删除用户组");
+    }
+    
+    /**
+     * 删除用户組的用戶
+     * date: 2017年5月3日 下午7:01:41 <br/> 
+     * @author Liam 
+     * @param sysRole
+     * @param redirectAttributes
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:group:assignment")
+    @RequestMapping(value = "deleteGroupUser")
+    @ResponseBody
+    public JsonResult deleteGroupUser(SysGroup sysGroup, String userId) {
+        sysGroupUserService.deleteByGroupAndUser(userId, sysGroup.getId());
+        return new JsonResult(true, "移除用户组的用戶");
+    }
+}

+ 213 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/LoginController.java

@@ -0,0 +1,213 @@
+/**
+ * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.bk.wd.web.controller.sys;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.UnauthorizedException;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.apache.shiro.web.util.WebUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.google.common.collect.Maps;
+import com.bk.common.config.Global;
+import com.bk.common.servlet.ValidateCodeServlet;
+import com.bk.common.utils.CacheUtils;
+import com.bk.common.utils.CookieUtils;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.security.FormAuthenticationFilter;
+import com.bk.sys.security.SystemAuthorizingRealm.Principal;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.shiro.session.SessionDAO;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 
+ * @Project Name:bk-wd-web
+ * @Date:2017年3月7日下午2:29:59
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+public class LoginController extends BaseController {
+
+	@Autowired
+	private SessionDAO sessionDAO;
+	
+	@Autowired
+	private SystemService systemService;
+
+	/**
+	 * 管理登录
+	 */
+	@RequestMapping(value = "/login", method = RequestMethod.GET)
+	public String login(HttpServletRequest request, HttpServletResponse response, Model model) {
+		Principal principal = UserUtils.getPrincipal();
+		
+		if (logger.isDebugEnabled()) {
+			logger.debug("login, active session size: {}", sessionDAO.getActiveSessions(false).size());
+		}
+
+		// 如果已登录,再次访问主页,则退出原账号。
+		if (Global.TRUE.equals(Global.getConfig("notAllowRefreshIndex"))) {
+			CookieUtils.setCookie(response, "LOGINED", "false");
+		}
+
+		settingTheme(request, model);
+		// 如果已经登录,则跳转到管理首页
+		if (principal != null && !principal.isMobileLogin()) {
+			return "redirect:/";
+		}
+		return "modules/login/login";
+	}
+
+	/**
+	 * 登录失败,真正登录的POST请求由Filter完成
+	 */
+	@RequestMapping(value = "/login", method = RequestMethod.POST)
+	public String loginFail(HttpServletRequest request, HttpServletResponse response, Model model) {
+		Principal principal = UserUtils.getPrincipal();
+
+		// 如果已经登录,则跳转到管理首页
+		if (principal != null) {
+			return "redirect:";
+		}
+
+		String username = WebUtils.getCleanParam(request, FormAuthenticationFilter.DEFAULT_USERNAME_PARAM);
+		boolean rememberMe = WebUtils.isTrue(request, FormAuthenticationFilter.DEFAULT_REMEMBER_ME_PARAM);
+		boolean mobile = WebUtils.isTrue(request, FormAuthenticationFilter.DEFAULT_MOBILE_PARAM);
+		String exception = (String) request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
+		String message = (String) request.getAttribute(FormAuthenticationFilter.DEFAULT_MESSAGE_PARAM);
+
+		if (StringUtils.isBlank(message) || StringUtils.equals(message, "null")) {
+			message = "用户或密码错误, 请重试.";
+		}
+
+		model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM, username);
+		model.addAttribute(FormAuthenticationFilter.DEFAULT_REMEMBER_ME_PARAM, rememberMe);
+		model.addAttribute(FormAuthenticationFilter.DEFAULT_MOBILE_PARAM, mobile);
+		model.addAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME, exception);
+		model.addAttribute(FormAuthenticationFilter.DEFAULT_MESSAGE_PARAM, message);
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("login fail, active session size: {}, message: {}, exception: {}",
+					sessionDAO.getActiveSessions(false).size(), message, exception);
+		}
+
+		// 非授权异常,登录失败,验证码加1。
+		if (!UnauthorizedException.class.getName().equals(exception)) {
+			model.addAttribute("isValidateCodeLogin", isValidateCodeLogin(username, true, false));
+		}
+
+		// 验证失败清空验证码
+		request.getSession().setAttribute(ValidateCodeServlet.VALIDATE_CODE, IdGen.uuid());
+
+		// 如果是手机登录,则返回JSON字符串
+		if (mobile) {
+			return renderString(response, model);
+		}
+
+		settingTheme(request, model);
+		return "modules/login/login";
+	}
+	
+	private void settingTheme(HttpServletRequest request, Model model) {
+	    String themeCompanyId = SysOffice.HeadCompany;
+        if (request.getServerName().equals("jingu.bakejinfu.com")) {
+            themeCompanyId = "2";
+        } else if (request.getServerName().equals("qingyuan.bakejinfu.com")) {
+            themeCompanyId = "7";
+        } else if (request.getServerName().equals("taishan.bakejinfu.com")) {
+            themeCompanyId = "4";
+        }
+        model.addAttribute("sysGlobalSetting", systemService.getGlobalSetting(themeCompanyId));
+	}
+
+	/**
+	 * 登录成功,进入管理首页
+	 */
+	@RequiresPermissions("user")
+	@RequestMapping(value = "")
+	public String index(HttpServletRequest request, HttpServletResponse response) {
+        CookieUtils.setCookie(response, "_csrf", (String) UserUtils.getSession().getAttribute("_csrf")); //CSRF
+	    
+		Principal principal = UserUtils.getPrincipal();
+
+		// 登录成功后,验证码计算器清零
+		isValidateCodeLogin(principal.getLoginName(), false, true);
+
+		if (logger.isDebugEnabled()) {
+			logger.debug("show index, active session size: {}", sessionDAO.getActiveSessions(false).size());
+		}
+
+		// 如果已登录,再次访问主页,则退出原账号。
+		if (Global.TRUE.equals(Global.getConfig("notAllowRefreshIndex"))) {
+			String logined = CookieUtils.getCookie(request, "LOGINED");
+			if (StringUtils.isBlank(logined) || "false".equals(logined)) {
+				CookieUtils.setCookie(response, "LOGINED", "true");
+			} else if (StringUtils.equals(logined, "true")) {
+				UserUtils.getSubject().logout();
+				return "redirect:login";
+			}
+		}
+
+		return "modules/login/index";
+	}
+	
+	/**
+     * 欢迎界面
+     */
+    @RequestMapping(value = "welcome")
+    public String welcome(HttpServletRequest request, HttpServletResponse response) {
+        return "modules/login/welcome";
+    }
+
+	/**
+	 * 是否是验证码登录
+	 * 
+	 * @param useruame
+	 *            用户名
+	 * @param isFail
+	 *            计数加1
+	 * @param clean
+	 *            计数清零
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public static boolean isValidateCodeLogin(String useruame, boolean isFail, boolean clean) {
+		Map<String, Integer> loginFailMap = (Map<String, Integer>) CacheUtils.get("loginFailMap");
+		if (loginFailMap == null) {
+			loginFailMap = Maps.newHashMap();
+			CacheUtils.put("loginFailMap", loginFailMap);
+		}
+		Integer loginFailNum = loginFailMap.get(useruame);
+		if (loginFailNum == null) {
+			loginFailNum = 0;
+		}
+		if (isFail) {
+			loginFailNum++;
+			loginFailMap.put(useruame, loginFailNum);
+		}
+		if (clean) {
+			loginFailMap.remove(useruame);
+		}
+		return loginFailNum >= 3;
+	}
+
+	@RequiresPermissions("user")
+	@RequestMapping(value = "subMenu")
+	public String tree() {
+		return "modules/login/subMenu";
+	}
+}

+ 89 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/MenuController.java

@@ -0,0 +1,89 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.List;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysMenu;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysMenuService;
+import com.bk.wd.web.base.BaseController;
+import com.google.common.collect.Lists;
+
+/**
+ * 菜单
+ * @Project Name:bk-wd-web 
+ * @Date:2017年3月7日下午2:29:51 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/menu")
+public class MenuController extends BaseController {
+    
+	@Autowired
+	private SystemService systemService;
+	
+	@Autowired
+	private SysMenuService sysMenuService;
+
+	@RequiresPermissions("sys:menu:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(Model model) {
+		List<SysMenu> list = Lists.newArrayList();
+		List<SysMenu> sourcelist = systemService.findAllMenu();
+		try {
+			SysMenu.sortList(list, sourcelist, null, true);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+        model.addAttribute("list", list);
+		return "modules/sys/menu/menuList";
+	}
+	
+	@RequiresPermissions("sys:menu:del")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public JsonResult delete(String menuId, RedirectAttributes redirectAttributes) {
+		systemService.deleteMenu(menuId);
+		return new JsonResult(true, "删除菜单成功");
+	}
+	
+	@RequiresPermissions("sys:menu:view")
+    @RequestMapping(value = "form")
+    public String form(SysMenu sysMenu, Model model) {
+	    if (StringUtils.isNotEmpty(sysMenu.getId())) {
+	        sysMenu = sysMenuService.selectByPrimaryKey(sysMenu.getId());
+	    }
+	    if (StringUtils.isNotEmpty(sysMenu.getParentId())) {
+	        sysMenu.setParent(sysMenuService.selectByPrimaryKey(sysMenu.getParentId()));
+	    }
+        // 获取排序号,最末节点排序号+30
+        if (null == sysMenu.getSort()){
+            sysMenu.setSort(sysMenuService.getMaxSort(sysMenu.getParentId()) + 30);
+        }
+        model.addAttribute("menu", sysMenu);
+        return "modules/sys/menu/menuForm";
+    }
+    
+    @RequiresPermissions("sys:menu:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(SysMenu sysMenu, Model model, RedirectAttributes redirectAttributes) {
+        if(!UserUtils.getUser().isAdmin()){
+            return new JsonResult("越权操作,只有超级管理员才能添加或修改数据!");
+        }
+        systemService.saveMenu(sysMenu);
+        return new JsonResult();
+    }
+	
+}

+ 303 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/OfficeController.java

@@ -0,0 +1,303 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.Arrays;
+import java.util.Date;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysOfficeService;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 机构管理
+ * @Project Name:智微云
+ * @Date:2017年3月7日上午9:50:08 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/office")
+public class OfficeController extends BaseController {
+
+    @Autowired
+    private SysOfficeService officeService;
+    
+    @Autowired
+    private SysUserService sysUserService;
+    
+    @Autowired
+    private SystemService systemService;
+
+    @ModelAttribute()
+    public SysOffice get(@RequestParam(required = false) String id) {
+        if (StringUtils.isNotBlank(id)) {
+            return officeService.selectByPrimaryKey(id);
+        } else {
+            return new SysOffice();
+        }
+    }
+
+    /**
+     * 组织机构页面
+     * date: 2017年5月1日 下午3:23:02 <br/> 
+     * @author Liam 
+     * @param office
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:office:view")
+    @RequestMapping(value = {"", "list"})
+    public String list(SysOffice office, Model model) {
+        model.addAttribute("officeList", officeService.treeData(systemService.findAllOffice(), SysOffice.HeadCompany));
+        return "modules/sys/office/officeList";
+    }
+    
+    /**
+     * 用户列表
+     * date: 2017年5月1日 下午3:22:40 <br/> 
+     * @author Liam 
+     * @param request
+     * @param response
+     * @param pagination
+     * @param sysOffice 
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:office:view")
+    @RequestMapping(value = {"userList"})
+    public String userList(HttpServletRequest request, HttpServletResponse response, Pagination pagination, SysOffice sysOffice, String searchName, Model model) {
+        model.addAttribute("sysOffice", sysOffice);
+        model.addAttribute("officeName", sysOffice.getName());
+        sysOffice.setName(searchName);
+        if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+            sysOffice.setUserId(UserUtils.getUser().getId());
+        }
+        sysUserService.selectByOfficePagination(pagination, sysOffice);
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("searchName", searchName);
+        return "modules/sys/office/userList";
+    }
+    
+    /**
+     * 根据机构获取用户列表
+     * date: 2017年5月4日 下午3:26:43 <br/> 
+     * @author Liam 
+     * @param sysOffice
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:office:view")
+    @RequestMapping(value = {"queryUserList"})
+    @ResponseBody
+    public JsonResult userList(SysOffice sysOffice) {
+        return new JsonResult(sysUserService.selectByOffice(sysOffice));
+    }
+    
+    /**
+     * 编辑机构页面
+     * date: 2017年5月1日 下午3:23:19 <br/> 
+     * @author Liam 
+     * @param office
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:office:edit")
+    @RequestMapping(value = "form")
+    public String form(SysOffice office, Model model) {
+        if (StringUtils.isEmpty(office.getParentId())) { //默认选择本人的所在部门
+            office.setParentId(UserUtils.getUser().getOffice().getId());
+        }
+        model.addAttribute("officeParent", officeService.selectByPrimaryKey(office.getParentId()));
+        model.addAttribute("office", office);
+        return "modules/sys/office/officeForm";
+    }
+    
+    /**
+     * 编辑机构页面
+     * date: 2017年5月4日 下午2:21:11 <br/> 
+     * @author Liam 
+     * @param office
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:office:edit")
+    @RequestMapping(value = "editForm")
+    public String editForm(SysOffice office, Model model) {
+        model.addAttribute("sysOffice", office);
+        model.addAttribute("officeList", officeService.treeData(systemService.findAllOffice(), SysOffice.HeadCompany));
+        return "modules/sys/office/officeEditForm";
+    }
+
+    /**
+     * 保存机构页面
+     * date: 2017年5月1日 下午3:23:55 <br/> 
+     * @author Liam 
+     * @param office
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:office:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(SysOffice office, Model model, String newParentId) {
+        if (StringUtils.isEmpty(office.getName())) {
+            return new JsonResult("请输入机构名称");
+        }
+        boolean modifyParent = false;
+        if (!office.getParentId().equals(newParentId) && StringUtils.isNotEmpty(newParentId)) {
+            modifyParent = true;
+            office.setParentId(newParentId);
+            office.setParentIds(officeService.getParentIds(newParentId) + "," + newParentId);
+        }
+        
+        office.setParentIds(officeService.getParentIds(office.getParentId()));
+        office.setType(2);
+        if (StringUtils.isEmpty(office.getId())) {
+            office.setId(IdGen.uuid());
+            office.setCreateBy(UserUtils.getUser().getId());
+            office.setCreateDate(new Date());
+            office.setUpdateBy(UserUtils.getUser().getId());
+            office.setUpdateDate(new Date());
+            officeService.insertSelective(office);
+        } else {
+            office.setUpdateBy(UserUtils.getUser().getId());
+            office.setUpdateDate(new Date());
+            officeService.updateByPrimaryKeySelective(office);
+        }
+        
+        if (modifyParent) {
+            if (office.getId().equals(office.getParentId())) {
+                return new JsonResult("父级机构不能选择当前机构");
+            }
+            
+            SysOffice parentOffice = officeService.selectByPrimaryKey(office.getParentId());
+            if (StringUtils.isNotEmpty(parentOffice.getParentIds())) {
+                if (Arrays.asList(parentOffice.getParentIds().split(",")).contains(office.getId())) {
+                    return new JsonResult("不能将当前组归属到下级组中");
+                }
+            }
+            // 父级机构迁移后,子级机构也要迁移
+            officeService.updateChildOfParentIds(office.getId(), UserUtils.getUser().getId());
+        }
+        return new JsonResult(office);
+    }
+    
+    /**
+     * 机构选择器
+     * date: 2017年5月1日 下午8:23:44 <br/> 
+     * @author Liam 
+     * @param userId
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:user:edit")
+    @RequestMapping(value = "selectOffice")
+    public String selectOffice(Model model, String officeIds) {
+        model.addAttribute("officeIds", officeIds);
+        model.addAttribute("officeList", officeService.treeData(systemService.findAllOffice(), SysOffice.HeadCompany));
+        return "modules/sys/office/officeSelect";
+    }
+    
+    /**
+     * 角色选择器
+     * date: 2017年5月1日 下午8:23:56 <br/> 
+     * @author Liam 
+     * @param userId
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:user:edit")
+    @RequestMapping(value = "selectRole")
+    public String selectRole(Model model, String roleIds) {
+        model.addAttribute("roleIds", roleIds);
+        model.addAttribute("roleList", systemService.findAllRole());
+        return "modules/sys/office/roleSelect";
+    }
+    
+    /**
+     * 删除机构确认页面
+     * date: 2017年5月1日 下午3:43:28 <br/> 
+     * @author Liam 
+     * @param sysUserOffice
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:office:del")
+    @RequestMapping(value = "removeView")
+    public String removeView(SysOffice office, Model model) {
+        model.addAttribute("office", office);
+        return "modules/sys/office/officeRemove";
+    }
+    
+    /**
+     * 机构删除
+     * date: 2017年5月4日 上午9:50:51 <br/> 
+     * @author Liam 
+     * @param office
+     * @param password
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:office:del")
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(SysOffice office, String password) {
+        if (StringUtils.isEmpty(password)) {
+            return new JsonResult("请输入密码");
+        }
+        if (!SystemService.validatePassword(password, UserUtils.getUser().getPassword())) {
+            return new JsonResult("密码不正确");
+        }
+        office.setUpdateBy(UserUtils.getUser().getId());
+        office.setUpdateDate(new Date());
+        office.setDelFlag(true);
+        officeService.updateByPrimaryKeySelective(office);
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "companyList")
+    public String companyList(Model model) {
+        model.addAttribute("companyList", officeService.selectChildList(SysOffice.HeadCompany));
+        return "modules/sys/office/companyList";
+    }
+    
+    /**
+     * 编辑公司页面
+     * date: 2017年5月4日 下午2:21:11 <br/> 
+     * @author Liam 
+     * @param office
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequestMapping(value = "companyForm")
+    public String companyForm(SysOffice office, Model model) {
+        model.addAttribute("sysOffice", office);
+        return "modules/sys/office/companyForm";
+    }
+
+}

+ 291 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/RoleController.java

@@ -0,0 +1,291 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.EntityUtils;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.model.SysRole;
+import com.bk.sys.model.SysRoleExample;
+import com.bk.sys.model.SysRoleMenu;
+import com.bk.sys.model.SysUserExample;
+import com.bk.sys.model.SysUserRole;
+import com.bk.sys.model.SysUserRoleExample;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysMenuService;
+import com.bk.sys.service.SysOfficeService;
+import com.bk.sys.service.SysRoleMenuService;
+import com.bk.sys.service.SysRoleService;
+import com.bk.sys.service.SysUserRoleService;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 角色管理
+ * @Project Name:bk-wd-web 
+ * @Date:2017年3月9日下午4:08:34 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/role")
+public class RoleController extends BaseController {
+
+	@Autowired
+	private SystemService systemService;
+	
+	@Autowired
+    private SysRoleService sysRoleService;
+	
+	@Autowired
+	private SysRoleMenuService sysRoleMenuService;
+	
+	@Autowired
+	private SysUserRoleService sysUserRoleService;
+	
+	@Autowired
+	private SysUserService sysUserService;
+	
+	@Autowired
+	private SysOfficeService sysOfficeService;
+	
+	@Autowired
+	private SysMenuService sysMenuService;
+	
+	@ModelAttribute()
+	public SysRole get(@RequestParam(required=false) String id) {
+		if (StringUtils.isNotBlank(id)){
+			return sysRoleService.selectByPrimaryKey(id);
+		}else{
+			return new SysRole();
+		}
+	}
+	
+	/**
+	 * 角色列表
+	 * date: 2017年5月3日 下午9:08:25 <br/> 
+	 * @author Liam 
+	 * @param model
+	 * @return 
+	 * @since JDK 1.8
+	 */
+	@RequiresPermissions("sys:role:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(Model model) {
+		model.addAttribute("list", systemService.findAllRole());
+		return "modules/sys/role/roleList";
+	}
+
+	/**
+	 * 编辑角色
+	 * date: 2017年5月3日 下午9:08:51 <br/> 
+	 * @author Liam 
+	 * @param sysRole
+	 * @param model
+	 * @return 
+	 * @since JDK 1.8
+	 */
+	@RequiresPermissions("sys:role:view")
+	@RequestMapping(value = "form")
+	public String form(SysRole sysRole, Model model) {
+	    model.addAttribute("list", systemService.findAllRole());
+ 	    if (StringUtils.isNotEmpty(sysRole.getId())) {
+	        model.addAttribute("roleMenuList", sysRoleMenuService.selectByRole(sysRole.getId()));
+	    }
+		model.addAttribute("role", sysRole);
+		model.addAttribute("menuList", sysMenuService.treeData(systemService.findAllMenu(), null));
+		return "modules/sys/role/roleForm";
+	}
+	
+	/**
+	 * 角色用户列表
+	 * date: 2017年5月3日 下午9:09:26 <br/> 
+	 * @author Liam 
+	 * @param request
+	 * @param response
+	 * @param pagination
+	 * @param sysRole
+	 * @param model
+	 * @return 
+	 * @since JDK 1.8
+	 */
+	@RequiresPermissions("sys:role:view")
+    @RequestMapping(value = {"userList"})
+    public String userList(HttpServletRequest request, HttpServletResponse response, Pagination pagination, SysRole sysRole,
+            Model model) {
+	    if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+            sysRole.setUserId(UserUtils.getUser().getId());
+        }
+        sysUserService.selectByRolePagination(pagination, sysRole);
+        model.addAttribute("pagination", pagination);
+        return "modules/sys/role/userList";
+    }
+	
+	/**
+	 * 角色保存
+	 * date: 2017年5月3日 下午7:01:29 <br/> 
+	 * @author Liam 
+	 * @param sysRole
+	 * @param menuIds
+	 * @param model
+	 * @param redirectAttributes
+	 * @return 
+	 * @since JDK 1.8
+	 */
+	@RequiresPermissions("sys:role:edit")
+	@RequestMapping(value = "save")
+	@ResponseBody
+	public JsonResult save(SysRole sysRole, String menuIds, Model model, RedirectAttributes redirectAttributes) {
+		if (!checkName(sysRole.getId(), sysRole.getName())){
+		    return new JsonResult(false, "保存角色'" + sysRole.getName() + "'失败, 角色名已存在");
+		}
+		systemService.saveRole(sysRole);
+		
+		sysRoleMenuService.deleteByRole(sysRole.getId());
+		if (StringUtils.isNotEmpty(menuIds)) {
+            String[] menuIdArray = menuIds.split(",");
+            for (String menuId : menuIdArray) {
+                SysRoleMenu sysRoleMenu = new SysRoleMenu();
+                sysRoleMenu.setId(IdGen.uuid());
+                sysRoleMenu.setMenuId(menuId);
+                sysRoleMenu.setRoleId(sysRole.getId());
+                sysRoleMenuService.insertSelective(sysRoleMenu);
+            }
+		}
+		
+		return new JsonResult(true, "保存角色'" + sysRole.getName() + "'成功");
+	}
+	
+	/**
+	 * 角色删除
+	 * date: 2017年5月3日 下午7:01:41 <br/> 
+	 * @author Liam 
+	 * @param sysRole
+	 * @param redirectAttributes
+	 * @return 
+	 * @since JDK 1.8
+	 */
+	@RequiresPermissions("sys:role:del")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public JsonResult delete(SysRole sysRole, RedirectAttributes redirectAttributes) {
+		systemService.deleteRole(sysRole);
+		return new JsonResult(true, "删除角色成功");
+	}
+	
+	/**
+     * 删除用户的角色
+     * date: 2017年5月3日 下午7:01:41 <br/> 
+     * @author Liam 
+     * @param sysRole
+     * @param redirectAttributes
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:role:assignment")
+    @RequestMapping(value = "deleteRoleUser")
+    @ResponseBody
+    public JsonResult deleteRoleUser(SysRole sysRole, String userId, RedirectAttributes redirectAttributes) {
+        sysUserRoleService.deleteByRoleAndUser(sysRole.getId(), userId);
+        return new JsonResult(true, "删除角色成功");
+    }
+	
+	/**
+	 * 角色分配用户页面
+	 * @param role
+	 * @param model
+	 * @return
+	 */
+	@RequiresPermissions("sys:role:assignment")
+	@RequestMapping(value = "roleUserForm")
+	public String roleUserForm(SysRole sysRole, Model model) {
+	    model.addAttribute("sysRole", sysRole);
+	    if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+	        sysRole.setUserId(UserUtils.getUser().getId());
+	    }
+	    model.addAttribute("userList", sysUserService.selectByRole(sysRole));
+	    model.addAttribute("officeList", sysOfficeService.treeData(systemService.findAllOffice(), SysOffice.HeadCompany));
+		return "modules/sys/role/roleUserForm";
+	}
+	
+	/**
+	 * 角色分配
+	 * @param role
+	 * @param idsArr
+	 * @param redirectAttributes
+	 * @return
+	 */
+	@RequiresPermissions("sys:role:assignment")
+	@RequestMapping(value = "saveRoleUser")
+	@ResponseBody
+	public JsonResult saveRoleUser(SysRole role, String userIds) {
+	    if (SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+	        sysUserRoleService.deleteByRole(role.getId());
+	    } else {
+	        SysUserExample sysUserExample = new SysUserExample();
+	        sysUserExample.createCriteria().andCompanyIdEqualTo(UserUtils.getUser().getCompanyId());
+	        
+	        List<String> userIdList = EntityUtils.convertEntityToString(sysUserService.selectByExample(sysUserExample), "id");
+	        if (!userIdList.isEmpty()) {
+	            SysUserRoleExample sysUserRoleExample = new SysUserRoleExample();
+	            sysUserRoleExample.createCriteria().andRoleIdEqualTo(role.getId()).andUserIdIn(userIdList);
+	            sysUserRoleService.deleteByExample(sysUserRoleExample);
+	        }
+	    }
+	    
+	    if (StringUtils.isNotEmpty(userIds)) {
+            String[] userIdArray = userIds.split(",");
+            for (String userId : userIdArray) {
+                SysUserRole sysUserRole = new SysUserRole();
+                sysUserRole.setId(IdGen.uuid());
+                //sysUserRole.setCompanyId(user.getCompanyId());
+                sysUserRole.setRoleId(role.getId());
+                sysUserRole.setUserId(userId);
+                sysUserRoleService.insertSelective(sysUserRole);
+            }
+        }
+	    return new JsonResult();
+	}
+
+	/**
+	 * 验证角色名是否有效
+	 * @param oldName
+	 * @param name
+	 * @return
+	 */
+	@RequiresPermissions("user")
+	@ResponseBody
+	@RequestMapping(value = "checkName")
+	public boolean checkName(String id, String name) {
+	    SysRoleExample sysRoleExample = new SysRoleExample();
+	    SysRoleExample.Criteria criteria = sysRoleExample.createCriteria();
+	    criteria.andDelFlagEqualTo(false);
+	    criteria.andNameEqualTo(name);
+	    if (StringUtils.isNotEmpty(id)){
+	        criteria.andIdNotEqualTo(id);
+	    }
+	    List<SysRole> sysRoleList = sysRoleService.selectByExample(sysRoleExample);
+	    if (sysRoleList.isEmpty()) {
+	        return true;
+	    } else {
+	        return false;
+	    }
+	}
+}

+ 111 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/SysCarDealerController.java

@@ -0,0 +1,111 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.alibaba.fastjson.JSON;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.model.SysCarDealer;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysCarDealerService;
+
+/**
+ * 车辆经销商
+ * @Project Name:bk-wd-web 
+ * @Date:2017年12月25日下午3:48:53 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/cardealer")
+public class SysCarDealerController {
+    
+    @Autowired
+    private SysCarDealerService sysCarDealerService;
+    
+    @RequestMapping(value = {"index"})
+    public String index() {
+        return "modules/sys/carDealer/index";
+    }
+    
+    @RequestMapping(value = {"list"})
+    @ResponseBody
+    public JsonResult list() {
+        List<SysCarDealer> sysCarDealerList = sysCarDealerService.selectByCompanyId(UserUtils.getUser().getCompanyId());
+        return new JsonResult(treeData(sysCarDealerList, null));
+    }
+    
+    public List<SysCarDealer> treeData(List<SysCarDealer> carDealerList, String parentId) {
+        List<SysCarDealer> list = new ArrayList<>();
+        if (!carDealerList.isEmpty()) {
+            for (SysCarDealer sysCarDealer : carDealerList) {
+                System.out.println(parentId + "-- " +sysCarDealer.getParentId());
+                if ((null == parentId &&  StringUtils.isEmpty(sysCarDealer.getParentId())) ||  (parentId != null && parentId.equals(sysCarDealer.getParentId()))) {
+                    sysCarDealer.setItemList(treeData(carDealerList, sysCarDealer.getId()));
+                    list.add(sysCarDealer);
+                }
+            }
+        }
+        return list;
+    }
+    
+    @RequestMapping(value = {"del"})
+    @ResponseBody
+    public JsonResult del(String id) {
+        sysCarDealerService.deleteByPrimaryKey(id);
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = {"getChild"})
+    @ResponseBody
+    public JsonResult getChild(String parentId) {
+        return new JsonResult(sysCarDealerService.selectByParentId(parentId));
+    }
+    
+    @RequestMapping(value = {"save"})
+    @ResponseBody
+    public JsonResult save(SysCarDealer sysCarDealer) {
+        SysUser user = UserUtils.getUser();
+        
+        if (StringUtils.isEmpty(sysCarDealer.getId())) {
+            sysCarDealer.setId(UidUtil.uuid());
+            sysCarDealer.setCompanyId(user.getCompanyId());
+            sysCarDealer.setDelFlag(false);
+            sysCarDealer.setCreateBy(user.getId());
+            sysCarDealer.setCreateDate(new Date());
+            sysCarDealer.setUpdateBy(user.getId());
+            sysCarDealer.setUpdateDate(new Date());
+            sysCarDealer.setSort(sysCarDealerService.countByCompanyId(user.getCompanyId()));
+            sysCarDealerService.insertSelective(sysCarDealer);
+        } else {
+            sysCarDealer.setUpdateBy(user.getId());
+            sysCarDealer.setUpdateDate(new Date());
+            sysCarDealerService.updateByPrimaryKeySelective(sysCarDealer);
+        }
+        return new JsonResult(sysCarDealer);
+    }
+    
+    @RequestMapping(value = {"sort"})
+    @ResponseBody
+    public JsonResult sort(String ids) {
+        if (StringUtils.isNotEmpty(ids)) {
+            String[] idArray = JSON.parseObject(StringEscapeUtils.unescapeHtml4(ids), String[].class);
+            for (int i = 0; i < idArray.length; i++) {
+                SysCarDealer sysCarDealer = sysCarDealerService.selectByPrimaryKey(idArray[i]);
+                sysCarDealer.setSort(i);
+                sysCarDealerService.updateByPrimaryKey(sysCarDealer);
+            }
+        }
+        return new JsonResult();
+    }
+}

+ 111 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/SysLandAgentController.java

@@ -0,0 +1,111 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.alibaba.fastjson.JSON;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.model.SysLandAgent;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysLandAgentService;
+
+/**
+ * 房产开发商
+ * @Project Name:bk-wd-web 
+ * @Date:2017年12月25日下午3:49:12 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/landagent")
+public class SysLandAgentController {
+    
+    @Autowired
+    private SysLandAgentService sysLandAgentService;
+    
+    @RequestMapping(value = {"index"})
+    public String index() {
+        return "modules/sys/landAgent/index";
+    }
+    
+    @RequestMapping(value = {"list"})
+    @ResponseBody
+    public JsonResult list() {
+        List<SysLandAgent> sysLandAgentList = sysLandAgentService.selectByCompanyId(UserUtils.getUser().getCompanyId());
+        return new JsonResult(treeData(sysLandAgentList, null));
+    }
+    
+    public List<SysLandAgent> treeData(List<SysLandAgent> sysLandAgentList, String parentId) {
+        List<SysLandAgent> list = new ArrayList<>();
+        if (!sysLandAgentList.isEmpty()) {
+            for (SysLandAgent sysLandAgent : sysLandAgentList) {
+                if ((null == parentId && StringUtils.isEmpty(sysLandAgent.getParentId())) || (parentId != null && parentId.equals(sysLandAgent.getParentId()))) {
+                    sysLandAgent.setItemList(treeData(sysLandAgentList, sysLandAgent.getId()));
+                    list.add(sysLandAgent);
+                }
+            }
+        }
+        return list;
+    }
+    
+    @RequestMapping(value = {"del"})
+    @ResponseBody
+    public JsonResult del(String id) {
+        sysLandAgentService.deleteByPrimaryKey(id);
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = {"getChild"})
+    @ResponseBody
+    public JsonResult getChild(String parentId) {
+        return new JsonResult(sysLandAgentService.selectByParentId(parentId));
+    }
+    
+    @RequestMapping(value = {"save"})
+    @ResponseBody
+    public JsonResult save(SysLandAgent sysLandAgent) {
+        SysUser user = UserUtils.getUser();
+        
+        if (StringUtils.isEmpty(sysLandAgent.getId())) {
+            sysLandAgent.setId(UidUtil.uuid());
+            sysLandAgent.setCompanyId(user.getCompanyId());
+            sysLandAgent.setDelFlag(false);
+            sysLandAgent.setCreateBy(user.getId());
+            sysLandAgent.setCreateDate(new Date());
+            sysLandAgent.setUpdateBy(user.getId());
+            sysLandAgent.setUpdateDate(new Date());
+            sysLandAgent.setSort(sysLandAgentService.countByCompanyId(user.getCompanyId()));
+            sysLandAgentService.insertSelective(sysLandAgent);
+        } else {
+            sysLandAgent.setUpdateBy(user.getId());
+            sysLandAgent.setUpdateDate(new Date());
+            sysLandAgentService.updateByPrimaryKeySelective(sysLandAgent);
+        }
+        return new JsonResult(sysLandAgent);
+    }
+    
+    @RequestMapping(value = {"sort"})
+    @ResponseBody
+    public JsonResult sort(String ids) {
+        if (StringUtils.isNotEmpty(ids)) {
+            String[] idArray = JSON.parseObject(StringEscapeUtils.unescapeHtml4(ids), String[].class);
+            for (int i = 0; i < idArray.length; i++) {
+                SysLandAgent sysLandAgent = sysLandAgentService.selectByPrimaryKey(idArray[i]);
+                sysLandAgent.setSort(i);
+                sysLandAgentService.updateByPrimaryKey(sysLandAgent);
+            }
+        }
+        return new JsonResult();
+    }
+
+}

+ 50 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/TagController.java

@@ -0,0 +1,50 @@
+/**
+ * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.bk.wd.web.controller.sys;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.bk.wd.web.base.BaseController;
+
+
+/**
+ * 标签Controller
+ * @author ThinkGem
+ * @version 2013-3-23
+ */
+@Controller
+@RequestMapping(value = "/sys/tag")
+public class TagController extends BaseController {
+	
+	/**
+	 * 树结构选择标签(treeselect.tag)
+	 */
+	@RequiresPermissions("user")
+	@RequestMapping(value = "treeselect")
+	public String treeselect(HttpServletRequest request, Model model) {
+		model.addAttribute("url", request.getParameter("url")); 	// 树结构数据URL
+		model.addAttribute("extId", request.getParameter("extId")); // 排除的编号ID
+		model.addAttribute("checked", request.getParameter("checked")); // 是否可复选
+		model.addAttribute("selectIds", request.getParameter("selectIds")); // 指定默认选中的ID
+		model.addAttribute("isAll", request.getParameter("isAll")); 	// 是否读取全部数据,不进行权限过滤
+		model.addAttribute("module", request.getParameter("module"));	// 过滤栏目模型(仅针对CMS的Category树)
+		return "modules/sys/tag/tagTreeselect";
+	}
+	
+	/**
+	 * 图标选择标签(iconselect.tag)
+	 */
+	@RequiresPermissions("user")
+	@RequestMapping(value = "iconselect")
+	public String iconselect(HttpServletRequest request, Model model) {
+		model.addAttribute("value", request.getParameter("value"));
+		return "modules/sys/tag/tagIconselect";
+	}
+	
+}

+ 404 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/UserController.java

@@ -0,0 +1,404 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+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 org.springframework.web.multipart.commons.CommonsMultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.dto.SysUserSearchParamsDto;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.model.SysRole;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.model.SysUserOffice;
+import com.bk.sys.model.SysUserRole;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysOfficeService;
+import com.bk.sys.service.SysRoleService;
+import com.bk.sys.service.SysUserOfficeService;
+import com.bk.sys.service.SysUserRoleService;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 用户管理
+ * @Project Name:bk-wd-web
+ * @Date:2017年3月7日下午2:29:40
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/user")
+public class UserController extends BaseController {
+
+    @Autowired
+    private SysUserService sysUserService;
+
+    @Autowired
+    private SystemService systemService;
+
+    @Autowired
+    private SysUserRoleService sysUserRoleService;
+
+    @Autowired
+    private SysUserOfficeService sysUserOfficeService;
+
+    @Autowired
+    private SysOfficeService sysOfficeService;
+
+    @Autowired
+    private SysRoleService sysRoleService;
+
+    @ModelAttribute()
+    public SysUser get(@RequestParam(required = false) String id) {
+        if (StringUtils.isNotBlank(id)) {
+            return sysUserService.selectByPrimaryKey(id);
+        } else {
+            return new SysUser();
+        }
+    }
+
+    /**
+     * 用戶編輯頁面 date: 2017年5月8日 下午8:40:21 <br/>
+     * @author Liam
+     * @param request
+     * @param response
+     * @param pagination
+     * @param sysUser
+     * @param model
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:user:edit")
+    @RequestMapping(value = { "userForm" })
+    public String userForm(HttpServletRequest request, HttpServletResponse response, Pagination pagination, SysUser sysUser, Model model) {
+        if (StringUtils.isNotEmpty(sysUser.getId())) {
+            List<SysOffice> officeList = sysOfficeService.findByUser(sysUser.getId());
+            model.addAttribute("officeList", officeList);
+            List<SysRole> roleLst = sysRoleService.findByUser(sysUser.getId());
+            model.addAttribute("roleLst", roleLst);
+        }
+        sysUser.setOffice(sysOfficeService.selectByPrimaryKey(sysUser.getOfficeId()));
+        model.addAttribute("sysUser", sysUser);
+        return "modules/sys/office/userForm";
+    }
+
+    /**
+     * 用戶保存 date: 2017年5月8日 下午8:40:35 <br/>
+     * @author Liam
+     * @param user
+     * @param newPassword
+     * @param roleIds
+     * @param officeIds
+     * @param request
+     * @param model
+     * @param autoPhoto
+     * @param redirectAttributes
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:user:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(SysUser user, String newPassword, String roleIds, String officeIds, HttpServletRequest request, Model model, @RequestParam(value = "autoPhoto", required = false) CommonsMultipartFile autoPhoto,
+            RedirectAttributes redirectAttributes) {
+
+        // 如果新密码为空,则不更换密码
+        if (StringUtils.isNotBlank(newPassword)) {
+            user.setLastPassword(user.getPassword());
+            user.setPassword(SystemService.entryptPassword(newPassword));
+        }
+
+        // 判断登录名是否重复
+        String oldName = null;
+        if (StringUtils.isNoneBlank(user.getId())) {
+            oldName = sysUserService.selectByPrimaryKey(user.getId()).getLoginName();
+        }
+        if (!"true".equals(checkLoginName(oldName, user.getLoginName()))) {
+            return new JsonResult("保存用户'" + user.getLoginName() + "'失败,登录名已存在");
+        }
+        if (StringUtils.isEmpty(user.getId()) && StringUtils.isEmpty(user.getPassword())) {
+            return new JsonResult("请设置初始化密码!");
+        }
+
+        user.setCompanyId(sysOfficeService.getCompanyByOfficeId(user.getOfficeId()).getId());
+
+        // 保存用户信息
+        systemService.saveUser(user);
+
+        // 数据范围
+        sysUserOfficeService.deleteUserOffice(user.getId(), user.getCompanyId());
+        if (StringUtils.isNotEmpty(officeIds)) {
+            String[] officeIdArray = officeIds.split(",");
+            for (String officeId : officeIdArray) {
+                if (StringUtils.isEmpty(officeId))
+                    continue;
+                SysUserOffice sysUserOffice = new SysUserOffice();
+                sysUserOffice.setId(IdGen.uuid());
+                sysUserOffice.setCompanyId(user.getCompanyId());
+                sysUserOffice.setOfficeId(officeId);
+                sysUserOffice.setUserId(user.getId());
+                sysUserOfficeService.insertSelective(sysUserOffice);
+            }
+        }
+
+        // 角色
+        sysUserService.deleteUserRole(user);
+        if (StringUtils.isNotEmpty(roleIds)) {
+            String[] roleIdArray = roleIds.split(",");
+            for (String roleId : roleIdArray) {
+                if (StringUtils.isEmpty(roleId))
+                    continue;
+                SysUserRole sysUserRole = new SysUserRole();
+                sysUserRole.setId(IdGen.uuid());
+                // sysUserRole.setCompanyId(user.getCompanyId());
+                sysUserRole.setRoleId(roleId);
+                sysUserRole.setUserId(user.getId());
+                sysUserRoleService.insertSelective(sysUserRole);
+            }
+        }
+        return new JsonResult();
+    }
+
+    @RequiresPermissions("sys:user:edit")
+    @RequestMapping(value = "userOfficeSelect")
+    public String userOfficeSelect(Model model, String officeId) {
+        model.addAttribute("officeId", officeId);
+        model.addAttribute("officeList", sysOfficeService.treeData(systemService.findAllOffice(), SysOffice.HeadCompany));
+        return "modules/sys/office/userOfficeSelect";
+    }
+
+    /**
+     * 用戶刪除 date: 2017年5月8日 下午8:42:13 <br/>
+     * @author Liam
+     * @param sysUser
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("sys:user:del")
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(SysUser sysUser) {
+        sysUser.setUpdateBy(UserUtils.getUser().getId());
+        sysUser.setUpdateDate(new Date());
+        sysUser.setDelFlag(true);
+        sysUserService.updateByPrimaryKeySelective(sysUser);
+        return new JsonResult();
+    }
+
+    /**
+     * 修改密碼頁面 date: 2017年5月8日 下午8:38:19 <br/>
+     * @author Liam
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("user")
+    @RequestMapping(value = "modifyPwd", method = RequestMethod.GET)
+    public String modifyPwd() {
+        return "modules/sys/user/modifyPassword";
+    }
+
+    /**
+     * 修改个人用户密码
+     * @param oldPassword
+     * @param newPassword
+     * @param model
+     * @return
+     */
+    @RequiresPermissions("user")
+    @RequestMapping(value = "modifyPwd", method = RequestMethod.POST)
+    public String modifyPwd(String oldPassword, String newPassword, String newPassword2, HttpServletResponse response, Model model) {
+
+        SysUser user = UserUtils.getUser();
+        boolean changeSuccess = false;
+        if (StringUtils.isBlank(oldPassword) || StringUtils.isBlank(newPassword) || StringUtils.isBlank(newPassword2)) {
+            model.addAttribute("message", "缺少必填");
+        } else if (newPassword.compareTo(newPassword2) != 0) {
+            model.addAttribute("para", "newPassword2");
+            model.addAttribute("message", "两次输入的新密码不相同");
+        } else if (!SystemService.validatePassword(oldPassword, user.getPassword())) {
+            model.addAttribute("para", "oldPassword");
+            model.addAttribute("message", "原始密码不正确");
+        } else {
+            systemService.updatePasswordById(user.getId(), user.getLoginName(), newPassword);
+            changeSuccess = true;
+            model.addAttribute("message", "修改密码成功");
+        }
+
+        model.addAttribute("result", changeSuccess);
+        return renderString(response, model);
+    }
+
+    /**
+     * 用户选择项 date: 2017年5月6日 下午1:07:54 <br/>
+     * @author Liam
+     * @param model
+     * @param pagination
+     * @param sysUserSearchParamsDto
+     * @return
+     * @since JDK 1.8
+     */
+    @RequestMapping(value = { "userSelect" })
+    public String userSelect(Model model, Pagination pagination, SysUserSearchParamsDto sysUserSearchParamsDto) {
+        sysUserSearchParamsDto.setDataScope("office");
+        sysUserSearchParamsDto.setUserId(UserUtils.getUser().getId());
+        model.addAttribute("userList", sysUserService.selectByDataScope(sysUserSearchParamsDto));
+        model.addAttribute("params", sysUserSearchParamsDto);
+        return "modules/sys/user/userSelect";
+    }
+
+    /**
+     * 验证登录名是否有效
+     * @param oldLoginName
+     * @param loginName
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "checkLoginName")
+    public String checkLoginName(String oldLoginName, String loginName) {
+        if (null != oldLoginName && oldLoginName.equals(loginName)) {
+            return "true";
+        }
+        if (systemService.getUserByLoginName(loginName) == null) {
+            return "true";
+        }
+        return "false";
+    }
+    
+    @ResponseBody
+    @RequestMapping(value = "callbackpassword")
+    public JsonResult callbackpassword(String userId) {
+        SysUser user = sysUserService.selectByPrimaryKey(userId);
+        if (null != user && StringUtils.isNotEmpty(user.getLastPassword())) {
+            user.setPassword(user.getLastPassword());
+            user.setUpdateBy(UserUtils.getUser().getId());
+            user.setUpdateDate(new Date());
+            user.setLastPassword(null);
+            sysUserService.updateByPrimaryKey(user);
+        }
+        return new JsonResult();
+    }
+
+    /**
+     * 导出用户数据
+     * @param user
+     * @param request
+     * @param response
+     * @param redirectAttributes
+     * @return
+     */
+    /*@RequiresPermissions("sys:user:view")
+    @RequestMapping(value = "export", method=RequestMethod.POST)
+    public String exportFile(User user, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        try {
+            String fileName = "用户数据"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            Page<User> page = systemService.findUser(new Page<User>(request, response, -1), user);
+            new ExportExcel("用户数据", User.class).setDataList(page.getList()).write(response, fileName).dispose();
+            return null;
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "导出用户失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:" + adminPath + "/sys/user/list?repage";
+    }*/
+
+    /**
+     * 导入用户数据
+     * @param file
+     * @param redirectAttributes
+     * @return
+     */
+    /* @RequiresPermissions("sys:user:edit")
+    @RequestMapping(value = "import", method=RequestMethod.POST)
+    public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+        if(Global.isDemoMode()){
+            addMessage(redirectAttributes, "演示模式,不允许操作!");
+            return "redirect:" + adminPath + "/sys/user/list?repage";
+        }
+        try {
+            int successNum = 0;
+            int failureNum = 0;
+            StringBuilder failureMsg = new StringBuilder();
+            ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<User> list = ei.getDataList(User.class);
+            for (User user : list){
+                try{
+                    String str1 = user.getLoginName();
+                    if(StringUtils.isNotBlank(str1) && str1.contains("E")) {
+                        String str2 = str1.substring(0, str1.indexOf("E"));
+                        str1 = str2.replace(".", "");
+                        user.setLoginName(str1);
+                    }
+                    String strTell1 = user.getPhone();
+                    if(StringUtils.isNotBlank(strTell1) && strTell1.contains("E")) {
+                        String strTell2 = strTell1.substring(0, strTell1.indexOf("E"));
+                        strTell1 = strTell2.replace(".", "");
+                        user.setPhone(strTell1);
+                    }
+                    if ("true".equals(checkLoginName("", user.getLoginName()))){
+                        user.setMobile(str1);
+                        user.setPassword(SystemService.entryptPassword("123456"));
+                        BeanValidators.validateWithException(validator, user);
+                        systemService.saveUser(user);
+                        successNum++;
+                    }else{
+                        failureMsg.append("<br/>登录名 "+user.getLoginName()+" 已存在; ");
+                        failureNum++;
+                    }
+                }catch(ConstraintViolationException ex){
+                    failureMsg.append("<br/>登录名 "+user.getLoginName()+" 导入失败:");
+                    List<String> messageList = BeanValidators.extractPropertyAndMessageAsList(ex, ": ");
+                    for (String message : messageList){
+                        failureMsg.append(message+"; ");
+                        failureNum++;
+                    }
+                }catch (Exception ex) {
+                    failureMsg.append("<br/>登录名 "+user.getLoginName()+" 导入失败:"+ex.getMessage());
+                }
+            }
+            if (failureNum>0){
+                failureMsg.insert(0, ",失败 "+failureNum+" 条用户,导入信息如下:");
+            }
+            addMessage(redirectAttributes, "已成功导入 "+successNum+" 条用户"+failureMsg);
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "导入用户失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:" + adminPath + "/sys/user/list?repage";
+    }*/
+
+    /**
+     * 下载导入用户数据模板
+     * @param response
+     * @param redirectAttributes
+     * @return
+     */
+    /*@RequiresPermissions("sys:user:view")
+    @RequestMapping(value = "import/template")
+    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        try {
+            String fileName = "用户数据导入模板.xlsx";
+            List<User> list = Lists.newArrayList(); list.add(UserUtils.getUser());
+            new ExportExcel("用户数据", User.class, 2).setDataList(list).write(response, fileName).dispose();
+            return null;
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:" + adminPath + "/sys/user/list?repage";
+    }*/
+}

+ 114 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/sys/VersionController.java

@@ -0,0 +1,114 @@
+package com.bk.wd.web.controller.sys;
+
+import java.util.Date;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysVersion;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysVersionService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 版本管理
+ * 
+ * @Project Name:bk-wd-web
+ * @Date:2017年3月9日下午1:50:29
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/sys/version")
+public class VersionController extends BaseController {
+
+	@Autowired
+	private SysVersionService sysVersionService;
+
+	@ModelAttribute()
+	public SysVersion get(@RequestParam(required = false) String id) {
+		if (StringUtils.isNotBlank(id)) {
+			return sysVersionService.selectByPrimaryKey(id);
+		} else {
+			return new SysVersion();
+		}
+	}
+
+	@RequiresPermissions("sys:sysVersion:view")
+	@RequestMapping(value = "")
+	public String index(SysVersion sysVersion, Pagination pagination, HttpServletRequest request,
+			HttpServletResponse response, Model model) {
+		
+		if (sysVersion.getPlatform() == null) { // 设置默认页面
+			sysVersion.setPlatform("iOS");
+		}
+		sysVersion.setCompanyId(UserUtils.getUser().getCompanyId());
+		sysVersionService.findByPage(pagination, sysVersion);
+		model.addAttribute("page", pagination);
+		model.addAttribute("sysVersion", sysVersion);
+		
+		return "modules/sys/version/versionList";
+	}
+
+	@RequiresPermissions("sys:sysVersion:edit") 
+	@RequestMapping(value = "/form")
+	public String form(SysVersion sysVersion, Model model) {
+		model.addAttribute("sysVersion", sysVersion);
+		return "modules/sys/version/versionForm";
+	}
+
+	@RequiresPermissions("sys:sysVersion:edit") 
+	@RequestMapping(value = "/save")
+	@ResponseBody
+	public JsonResult save(SysVersion sysVersion, Model model) {
+		if (StringUtils.isEmpty(sysVersion.getId())) {
+
+//			SysVersion lastestVersion = sysVersionService.selectLastestVersion(sysVersion.getPlatform());
+//			short versionCode = 1;
+//			if (null != lastestVersion && lastestVersion.getVersionCode() > 0) {
+//				versionCode = lastestVersion.getVersionCode();
+//				versionCode += 1;
+//			}
+
+			sysVersion.setId(IdGen.uuid());
+//			sysVersion.setVersionCode(versionCode);
+			sysVersion.setCompanyId(UserUtils.getUser().getCompanyId());
+			sysVersion.setCreateBy(UserUtils.getUser().getId());
+			sysVersion.setCreateDate(new Date());
+			sysVersion.setUpdateBy(UserUtils.getUser().getId());
+			sysVersion.setUpdateDate(new Date());
+			sysVersionService.insertSelective(sysVersion);
+		} else {
+		    sysVersion.setCompanyId(UserUtils.getUser().getCompanyId());
+			sysVersion.setUpdateBy(UserUtils.getUser().getId());
+			sysVersion.setUpdateDate(new Date());
+			sysVersionService.updateByPrimaryKeySelective(sysVersion);
+		}
+		return new JsonResult(true, "保存成功");
+	}
+
+	@RequiresPermissions("sys:sysVersion:edit") 
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public JsonResult delete(SysVersion sysVersion, RedirectAttributes redirectAttributes) {
+		sysVersion.setDelFlag(true);
+		sysVersion.setUpdateBy(UserUtils.getUser().getId());
+		sysVersion.setUpdateDate(new Date());
+		sysVersionService.updateByPrimaryKeySelective(sysVersion);
+		return new JsonResult(true, "删除成功");
+	}
+}

+ 107 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/BusinessElementController.java

@@ -0,0 +1,107 @@
+package com.bk.wd.web.controller.wd;
+
+import java.util.Date;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdBusinessElement;
+import com.bk.wd.model.WdDefaultSimpleModuleSetting;
+import com.bk.wd.service.WdBusinessElementService;
+import com.bk.wd.service.WdDefaultSimpleModuleSettingService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 元件管理
+ * @Project Name:bk-wd-web 
+ * @Date:2017年3月9日下午2:31:22 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/element")
+public class BusinessElementController extends BaseController {
+    
+    @Autowired
+    private WdBusinessElementService wdBusinessElementService;
+    
+    @Autowired
+    private WdDefaultSimpleModuleSettingService wdDefaultSimpleModuleSettingService;
+    
+    @ModelAttribute
+    public WdBusinessElement get(@RequestParam(required=false) String id) {
+        if (StringUtils.isNotBlank(id)){
+            return wdBusinessElementService.selectByPrimaryKey(id);
+        }else{
+            return new WdBusinessElement();
+        }
+    }
+    
+    @RequiresPermissions("wd:element:view")
+    @RequestMapping(value = {"list", ""})
+    public String list(Model model, Pagination pagination, WdBusinessElement wdBusinessElement) {
+        wdBusinessElementService.findByPage(pagination, wdBusinessElement);
+        model.addAttribute("pagination", pagination);
+        return "modules/wd/element/elementList";
+    }
+
+    @RequiresPermissions("wd:element:edit")
+    @RequestMapping(value = "form")
+    public String form(String id, Model model, String defaultSimpleModuleId) {
+        model.addAttribute("defaultSimpleModuleId", defaultSimpleModuleId);
+        model.addAttribute("wdBusinessElement", wdBusinessElementService.selectByPrimaryKey(id));
+        return "modules/wd/element/elementForm";
+    }
+    
+    @RequiresPermissions("wd:element:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(WdBusinessElement wdBusinessElement, String defaultSimpleModuleId, Model model) {
+        if (StringUtils.isEmpty(wdBusinessElement.getId())) {
+            
+            // 根据key去找对应的元素,如果能找到,则不创建新元素
+            WdBusinessElement element =  wdBusinessElementService.selectBykey(wdBusinessElement.getKey());
+            if (null == element) {
+                wdBusinessElement.setId(UidUtil.uuid());
+                wdBusinessElement.setCreateBy(UserUtils.getUser().getId());
+                wdBusinessElement.setCreateDate(new Date());
+                wdBusinessElement.setUpdateBy(UserUtils.getUser().getId());
+                wdBusinessElement.setUpdateDate(new Date());
+                wdBusinessElementService.insertSelective(wdBusinessElement);
+            } else {
+                wdBusinessElement.setId(element.getId());
+                wdBusinessElement.setUpdateBy(UserUtils.getUser().getId());
+                wdBusinessElement.setUpdateDate(new Date());
+                wdBusinessElementService.updateByPrimaryKeySelective(wdBusinessElement);
+            }
+            
+            WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting = new WdDefaultSimpleModuleSetting();
+            wdDefaultSimpleModuleSetting.setId(UidUtil.uuid());
+            wdDefaultSimpleModuleSetting.setBusinessElementId(wdBusinessElement.getId());
+            wdDefaultSimpleModuleSetting.setDefaultSimpleModuleId(defaultSimpleModuleId);
+            wdDefaultSimpleModuleSetting.setCreateBy(UserUtils.getUser().getId());
+            wdDefaultSimpleModuleSetting.setCreateDate(new Date());
+            wdDefaultSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+            wdDefaultSimpleModuleSetting.setUpdateDate(new Date());
+            wdDefaultSimpleModuleSettingService.insertSelective(wdDefaultSimpleModuleSetting);
+        } else {
+            wdBusinessElement.setUpdateBy(UserUtils.getUser().getId());
+            wdBusinessElement.setUpdateDate(new Date());
+            wdBusinessElementService.updateByPrimaryKeySelective(wdBusinessElement);
+        }
+        
+        return new JsonResult();
+    }
+    
+}

+ 262 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/CommonModuleController.java

@@ -0,0 +1,262 @@
+package com.bk.wd.web.controller.wd;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdBusinessElement;
+import com.bk.wd.model.WdCommonSimpleModule;
+import com.bk.wd.model.WdCommonSimpleModuleSetting;
+import com.bk.wd.model.WdCommonSimpleModuleSettingExample;
+import com.bk.wd.model.WdDefaultSimpleModuleSetting;
+import com.bk.wd.service.WdBusinessElementService;
+import com.bk.wd.service.WdCommonSimpleModuleService;
+import com.bk.wd.service.WdCommonSimpleModuleSettingService;
+import com.bk.wd.service.WdDefaultSimpleModuleService;
+import com.bk.wd.service.WdDefaultSimpleModuleSettingService;
+import com.bk.wd.service.WdSelectGroupService;
+
+/**
+ * 公用模块
+ * @Project Name:bk-wd-web 
+ * @Date:2017年4月4日下午8:33:12 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/commonModule")
+public class CommonModuleController {
+    
+    @Autowired
+    private WdCommonSimpleModuleService wdCommonSimpleModuleService;
+    
+    @Autowired
+    private WdCommonSimpleModuleSettingService wdCommonSimpleModuleSettingService;
+    
+    @Autowired
+    private WdSelectGroupService wdSelectGroupService;
+    
+    @Autowired
+    private WdBusinessElementService wdBusinessElementService;
+    
+    @Autowired
+    private WdDefaultSimpleModuleSettingService wdDefaultSimpleModuleSettingService;
+    
+    @Autowired
+    private WdDefaultSimpleModuleService wdDefaultSimpleModuleService;
+    
+    @ModelAttribute
+    public WdCommonSimpleModule get(@RequestParam(required=false) String id) {
+        if (StringUtils.isNotBlank(id)){
+            return wdCommonSimpleModuleService.selectByPrimaryKey(id);
+        }else{
+            return new WdCommonSimpleModule();
+        }
+    }
+    
+    @RequiresPermissions("wd:commonModule:view")
+    @RequestMapping(value = {"list", ""})
+    public String list(Model model, Pagination pagination, WdCommonSimpleModule wdCommonSimpleModule) {
+        if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+            wdCommonSimpleModule.setCompanyId(UserUtils.getUser().getCompanyId());
+        }
+        wdCommonSimpleModuleService.selectByPagination(pagination, wdCommonSimpleModule);
+        model.addAttribute("pagination", pagination);
+        return "modules/wd/commonModule/commonModuleList";
+    }
+    
+    @RequiresPermissions("wd:commonModule:edit")
+    @RequestMapping(value = "form")
+    public String form(WdCommonSimpleModule wdCommonSimpleModule, Model model) {
+        model.addAttribute("wdCommonSimpleModule", wdCommonSimpleModule);
+        return "modules/wd/commonModule/commonModuleForm";
+    }
+    
+    @RequiresPermissions("wd:commonModule:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(WdCommonSimpleModule wdCommonSimpleModule, Model model) {
+        if (StringUtils.isEmpty(wdCommonSimpleModule.getId())) {
+            wdCommonSimpleModule.setId(IdGen.uuid());
+            wdCommonSimpleModule.setCreateBy(UserUtils.getUser().getId());
+            wdCommonSimpleModule.setCreateDate(new Date());
+            wdCommonSimpleModule.setCompanyId(UserUtils.getUser().getCompanyId());
+            wdCommonSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+            wdCommonSimpleModule.setUpdateDate(new Date());
+            wdCommonSimpleModule.setSettingVersion("0");
+            wdCommonSimpleModuleService.insertSelective(wdCommonSimpleModule);
+        } else {
+            wdCommonSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+            wdCommonSimpleModule.setUpdateDate(new Date());
+            wdCommonSimpleModuleService.updateByPrimaryKeySelective(wdCommonSimpleModule);
+        }
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:commonModule:del")
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(WdCommonSimpleModule wdCommonSimpleModule) {
+        wdCommonSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+        wdCommonSimpleModule.setUpdateDate(new Date());
+        wdCommonSimpleModule.setDelFlag(true);
+        wdCommonSimpleModuleService.updateByPrimaryKeySelective(wdCommonSimpleModule);
+        return new JsonResult();
+    }
+    
+    /**
+     *配置列表
+     * date: 2017年3月17日 下午4:11:58 <br/> 
+     * @author Liam 
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:commonModule:edit")
+    @RequestMapping(value = {"settingForm"})
+    public String settingForm(Model model, WdCommonSimpleModule wdCommonSimpleModule) {
+        String newVersion = "temp" + new Date().getTime();
+        List<WdCommonSimpleModuleSetting> wdCommonSimpleModuleSettingList = wdCommonSimpleModuleSettingService.selectByModuleVersion(wdCommonSimpleModule.getDefaultSimpleModuleId(), wdCommonSimpleModule.getSettingVersion());
+        if (!wdCommonSimpleModuleSettingList.isEmpty()) {
+            for (WdCommonSimpleModuleSetting wdCommonSimpleModuleSetting : wdCommonSimpleModuleSettingList) {
+                wdCommonSimpleModuleSetting.setId(IdGen.uuid());
+                wdCommonSimpleModuleSetting.setCreateBy(UserUtils.getUser().getId());
+                wdCommonSimpleModuleSetting.setCreateDate(new Date());
+                wdCommonSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+                wdCommonSimpleModuleSetting.setUpdateDate(new Date());
+                wdCommonSimpleModuleSetting.setVersion(newVersion);
+                wdCommonSimpleModuleSettingService.insertSelective(wdCommonSimpleModuleSetting);
+            }
+        }
+        
+        // 生成必选项的值
+        List<WdDefaultSimpleModuleSetting> wdDefaultSimpleModuleSettingList = wdDefaultSimpleModuleSettingService.selectByModuleId(wdCommonSimpleModule.getDefaultSimpleModuleId());
+        for (WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting : wdDefaultSimpleModuleSettingList) {
+            if ("1".equals(wdDefaultSimpleModuleSetting.getRequired())) {
+                WdCommonSimpleModuleSetting wdCommonSimpleModuleSetting = new WdCommonSimpleModuleSetting();
+                wdCommonSimpleModuleSetting.setDefaultSimpleModuleSettingId(wdDefaultSimpleModuleSetting.getId());
+                wdCommonSimpleModuleSetting.setRequired("1");
+                wdCommonSimpleModuleSetting.setVersion(newVersion);
+                settingSave(wdCommonSimpleModuleSetting);
+            }
+        }
+        
+        model.addAttribute("wdCommonSimpleModule", wdCommonSimpleModule);
+        model.addAttribute("newVersion", newVersion);
+        model.addAttribute("defaultModule", wdDefaultSimpleModuleService.selectByPrimaryKey(wdCommonSimpleModule.getDefaultSimpleModuleId()));
+        Map<String, Object> params = new HashMap<>();
+        params.put("moduleId", wdCommonSimpleModule.getDefaultSimpleModuleId());
+        params.put("version", newVersion);
+        model.addAttribute("commonModuleSettingList", wdBusinessElementService.selectCommonLeftModule(params));
+        return "modules/wd/commonModule/commonModuleSettingForm";
+    }
+    
+    @RequiresPermissions("wd:commonModule:edit")
+    @RequestMapping(value = {"settingList"})
+    public String settingList(Model model, String version, String moduleId) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("moduleId", moduleId);
+        params.put("version", version);
+        model.addAttribute("commonModuleSettingList",
+                wdBusinessElementService.selectCommonLeftModule(params));
+        return "modules/wd/commonModule/commonModuleSettingList";
+    }
+    
+    @RequiresPermissions("wd:commonModule:edit")
+    @RequestMapping(value = {"settingSave"})
+    @ResponseBody
+    public JsonResult settingSave(WdCommonSimpleModuleSetting wdCommonSimpleModuleSetting) {
+        WdCommonSimpleModuleSetting wdCommonSimpleModuleSettingMain = wdCommonSimpleModuleSettingService.selectByModuleSettingVersion(wdCommonSimpleModuleSetting.getDefaultSimpleModuleSettingId(), wdCommonSimpleModuleSetting.getVersion());
+        if (null == wdCommonSimpleModuleSettingMain) {
+            wdCommonSimpleModuleSetting.getDefaultSimpleModuleSettingId();
+            WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting = wdDefaultSimpleModuleSettingService.selectByPrimaryKey(wdCommonSimpleModuleSetting.getDefaultSimpleModuleSettingId());
+            wdCommonSimpleModuleSetting.setDefaultSimpleModuleId(wdDefaultSimpleModuleSetting.getDefaultSimpleModuleId());
+            WdBusinessElement wdBusinessElement = wdBusinessElementService.selectByPrimaryKey(wdDefaultSimpleModuleSetting.getBusinessElementId());
+            wdCommonSimpleModuleSetting.setElementHeight(wdBusinessElement.getHeight());
+            wdCommonSimpleModuleSetting.setBusinessElementId(wdBusinessElement.getId());
+            wdCommonSimpleModuleSetting.setElementName(wdBusinessElement.getName());
+            wdCommonSimpleModuleSetting.setElementPlaceholder(wdBusinessElement.getPlaceholder());
+            wdCommonSimpleModuleSetting.setElementErrorMessage(wdBusinessElement.getErrorMessage());
+            if (StringUtils.isNoneEmpty(wdBusinessElement.getSelectGroupId())) {
+                wdCommonSimpleModuleSetting.setElementSelectListId(wdSelectGroupService.getSelectGroupDefault(wdBusinessElement.getSelectGroupId()));
+            }
+            wdCommonSimpleModuleSetting.setId(IdGen.uuid());
+            wdCommonSimpleModuleSetting.setCreateBy(UserUtils.getUser().getId());
+            wdCommonSimpleModuleSetting.setCreateDate(new Date());
+            wdCommonSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+            wdCommonSimpleModuleSetting.setUpdateDate(new Date());
+            wdCommonSimpleModuleSetting.setSortMobile(99); //默认在最后
+            wdCommonSimpleModuleSettingService.insertSelective(wdCommonSimpleModuleSetting);
+        } else {
+            wdCommonSimpleModuleSetting.setId(wdCommonSimpleModuleSettingMain.getId());
+            wdCommonSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+            wdCommonSimpleModuleSetting.setUpdateDate(new Date());
+            wdCommonSimpleModuleSettingService.updateByPrimaryKeySelective(wdCommonSimpleModuleSetting);
+        }
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:commonModule:edit")
+    @RequestMapping(value = {"settingDelete"})
+    @ResponseBody
+    public JsonResult settingDelete(String version, String defaultSimpleModuleSettingId) {
+        WdCommonSimpleModuleSettingExample wdCommonSimpleModuleSettingExample = new WdCommonSimpleModuleSettingExample();
+        wdCommonSimpleModuleSettingExample.createCriteria().andDefaultSimpleModuleSettingIdEqualTo(defaultSimpleModuleSettingId).andVersionEqualTo(version);
+        wdCommonSimpleModuleSettingService.deleteByExample(wdCommonSimpleModuleSettingExample);
+        return new JsonResult();
+    }
+    
+    /**
+     * 发布配置
+     * date: 2017年3月17日 下午5:34:38 <br/> 
+     * @author Liam 
+     * @param data
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:commonModule:edit")
+    @RequestMapping(value = {"settingIssue"})
+    @ResponseBody
+    public JsonResult settingIssue( WdCommonSimpleModule wdCommonSimpleModule, String version) {
+        wdCommonSimpleModule.setSettingVersion(version);
+        wdCommonSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+        wdCommonSimpleModule.setUpdateDate(new Date());
+        wdCommonSimpleModuleService.updateByPrimaryKeySelective(wdCommonSimpleModule);
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:commonModule:edit")
+    @RequestMapping(value = {"settingSorts"})
+    @ResponseBody
+    public JsonResult settingSorts(String ids) {
+        if (StringUtils.isNoneEmpty(ids)) {
+            String[] idArray = ids.split(",");
+            for (int i = 0; i < idArray.length; i++) {
+                if (StringUtils.isNoneEmpty(idArray[i])) {
+                    WdCommonSimpleModuleSetting wdCommonSimpleModuleSetting = wdCommonSimpleModuleSettingService.selectByPrimaryKey(idArray[i]);
+                    wdCommonSimpleModuleSetting.setSortMobile(i);
+                    wdCommonSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+                    wdCommonSimpleModuleSetting.setUpdateDate(new Date());
+                    wdCommonSimpleModuleSettingService.updateByPrimaryKeySelective(wdCommonSimpleModuleSetting);
+                }
+            }
+        }
+        return new JsonResult();
+    }
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1075 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/CustomerController.java


+ 267 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/CustomerTypeController.java

@@ -0,0 +1,267 @@
+package com.bk.wd.web.controller.wd;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdBusinessElement;
+import com.bk.wd.model.WdCustomerType;
+import com.bk.wd.model.WdCustomerTypeSetting;
+import com.bk.wd.model.WdCustomerTypeSettingExample;
+import com.bk.wd.service.WdBusinessElementService;
+import com.bk.wd.service.WdCustomerTypeService;
+import com.bk.wd.service.WdCustomerTypeSettingService;
+import com.bk.wd.service.WdSelectGroupService;
+import com.bk.wd.util.BusinessConsts.TrueOrFalseAsInt;
+import com.bk.wd.util.BusinessConsts.TrueOrFalseAsString;
+import com.bk.wd.web.base.BaseController;
+import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
+
+/**
+ * 客戶類型
+ * @Project Name:bk-wd-web
+ * @Date:2017年3月15日下午4:31:34
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/customerType")
+public class CustomerTypeController extends BaseController {
+
+    @Autowired
+    private WdCustomerTypeService wdCustomerTypeService;
+
+    @Autowired
+    private WdCustomerTypeSettingService wdCustomerTypeSettingService;
+
+    @Autowired
+    private WdBusinessElementService wdBusinessElementService;
+
+    @Autowired
+    private WdSelectGroupService wdSelectGroupService;
+
+    @ModelAttribute
+    public WdCustomerType get(@RequestParam(required = false) String id) {
+        if (StringUtils.isNotBlank(id)) {
+            return wdCustomerTypeService.selectByPrimaryKey(id);
+        } else {
+            return new WdCustomerType();
+        }
+    }
+
+    @RequiresPermissions("wd:customerType:view")
+    @RequestMapping(value = { "list", "" })
+    public String list(Model model, Pagination pagination, WdCustomerType wdCustomerType) {
+        if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+            wdCustomerType.setRegion(UserUtils.getUser().getCompanyId());
+        }
+        wdCustomerTypeService.findByPage(pagination, wdCustomerType);
+        model.addAttribute("pagination", pagination);
+        return "modules/wd/customerType/customerTypeList";
+    }
+
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = "form")
+    public String form(String id, Model model) {
+        model.addAttribute("wdCustomerType", wdCustomerTypeService.selectByPrimaryKey(id));
+        return "modules/wd/customerType/customerTypeForm";
+    }
+
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(WdCustomerType wdCustomerType, Model model) {
+        if (null == wdCustomerType) {
+            return new JsonResult(false, "未能接收表单数据");
+        }
+
+        if (StringUtils.isBlank(wdCustomerType.getNewable())) {
+            wdCustomerType.setNewable(TrueOrFalseAsString.False);
+        }
+
+        if (StringUtils.isEmpty(wdCustomerType.getId())) {
+            wdCustomerType.setId(IdGen.uuid());
+            wdCustomerType.setCreateBy(UserUtils.getUser().getId());
+            wdCustomerType.setCreateDate(new Date());
+            wdCustomerType.setRegion(UserUtils.getUser().getCompanyId());
+            wdCustomerType.setUpdateBy(UserUtils.getUser().getId());
+            wdCustomerType.setUpdateDate(new Date());
+            wdCustomerTypeService.insertSelective(wdCustomerType);
+        } else {
+            wdCustomerType.setUpdateBy(UserUtils.getUser().getId());
+            wdCustomerType.setUpdateDate(new Date());
+            wdCustomerTypeService.updateByPrimaryKeySelective(wdCustomerType);
+        }
+        return new JsonResult();
+    }
+
+    @RequiresPermissions("wd:customerType:del")
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(WdCustomerType wdCustomerType) {
+        wdCustomerType.setUpdateBy(UserUtils.getUser().getId());
+        wdCustomerType.setUpdateDate(new Date());
+        wdCustomerType.setDelFlag(true);
+        wdCustomerTypeService.updateByPrimaryKeySelective(wdCustomerType);
+        return new JsonResult();
+    }
+
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = { "sorts" })
+    @ResponseBody
+    public JsonResult sorts(String ids) {
+        if (StringUtils.isNoneEmpty(ids)) {
+            String[] idArray = ids.split(",");
+            for (int i = 0; i < idArray.length; i++) {
+                if (StringUtils.isNoneEmpty(idArray[i])) {
+                    WdCustomerType wdCustomerType = wdCustomerTypeService.selectByPrimaryKey(idArray[i]);
+                    wdCustomerType.setSort(i);
+                    wdCustomerType.setUpdateBy(UserUtils.getUser().getId());
+                    wdCustomerType.setUpdateDate(new Date());
+                    wdCustomerTypeService.updateByPrimaryKeySelective(wdCustomerType);
+                }
+            }
+        }
+        return new JsonResult();
+    }
+
+    /**
+     * 客户类型配置列表 date: 2017年3月17日 下午4:11:58 <br/>
+     * @author Liam
+     * @param model
+     * @param category
+     * @param wdCustomerType
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = { "settingForm" })
+    public String settingForm(Model model, WdCustomerType wdCustomerType) {
+        String newVersion = "temp" + new Date().getTime();
+        List<WdCustomerTypeSetting> customerTypeSettingList = wdCustomerTypeSettingService.selectByCustomerTypeIdAndCategory(wdCustomerType.getId(), null, wdCustomerType.getSettingVersion());
+        if (!customerTypeSettingList.isEmpty()) {
+            for (WdCustomerTypeSetting wdCustomerTypeSetting : customerTypeSettingList) {
+                wdCustomerTypeSetting.setId(IdGen.uuid());
+                wdCustomerTypeSetting.setCreateBy(UserUtils.getUser().getId());
+                wdCustomerTypeSetting.setCreateDate(new Date());
+                wdCustomerTypeSetting.setUpdateBy(UserUtils.getUser().getId());
+                wdCustomerTypeSetting.setUpdateDate(new Date());
+                wdCustomerTypeSetting.setVersion(newVersion);
+                wdCustomerTypeSettingService.insertSelective(wdCustomerTypeSetting);
+            }
+        }
+
+        model.addAttribute("customerTypeSettingList", customerTypeSettingList);
+        model.addAttribute("wdCustomerType", wdCustomerType);
+        model.addAttribute("newVersion", newVersion);
+        model.addAttribute("customerTypeLeftModules", wdBusinessElementService.selectCustomerTypeLeftModule(wdCustomerType.getId(), null));
+        return "modules/wd/customerType/customerTypeSettingForm";
+    }
+
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = { "settingList" })
+    public String settingList(Model model, WdCustomerType wdCustomerType, String category) {
+        model.addAttribute("customerTypeSettingList", wdCustomerTypeSettingService.selectByCustomerTypeIdAndCategory(wdCustomerType.getId(), category, wdCustomerType.getSettingVersion()));
+        return "modules/wd/customerType/customerTypeSettingList";
+    }
+
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = { "settingSave" })
+    @ResponseBody
+    public JsonResult settingSave(WdCustomerTypeSetting customerTypeSetting) {
+        if (StringUtils.isEmpty(customerTypeSetting.getId())) {
+            WdBusinessElement wdBusinessElement = wdBusinessElementService.selectByPrimaryKey(customerTypeSetting.getBusinessElementId());
+            customerTypeSetting.setElementHeight(wdBusinessElement.getHeight());
+            customerTypeSetting.setElementName(wdBusinessElement.getName());
+            customerTypeSetting.setElementPlaceholder(wdBusinessElement.getPlaceholder());
+            customerTypeSetting.setElementErrorMessage(wdBusinessElement.getErrorMessage());
+            if (StringUtils.isNoneEmpty(wdBusinessElement.getSelectGroupId())) {
+                customerTypeSetting.setElementSelectListId(wdSelectGroupService.getSelectGroupDefault(wdBusinessElement.getSelectGroupId()));
+            }
+            customerTypeSetting.setId(IdGen.uuid());
+            customerTypeSetting.setCreateBy(UserUtils.getUser().getId());
+            customerTypeSetting.setCreateDate(new Date());
+            customerTypeSetting.setUpdateBy(UserUtils.getUser().getId());
+            customerTypeSetting.setUpdateDate(new Date());
+            customerTypeSetting.setSortMobile(99); // 默认在最后
+            wdCustomerTypeSettingService.insertSelective(customerTypeSetting);
+        } else {
+            customerTypeSetting.setUpdateBy(UserUtils.getUser().getId());
+            customerTypeSetting.setUpdateDate(new Date());
+            wdCustomerTypeSettingService.updateByPrimaryKeySelective(customerTypeSetting);
+        }
+        return new JsonResult();
+    }
+
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = { "settingDelete" })
+    @ResponseBody
+    public JsonResult settingDelete(WdCustomerTypeSetting customerTypeSetting) {
+        if (StringUtils.isEmpty(customerTypeSetting.getId())) {
+            WdCustomerTypeSettingExample wdCustomerTypeSettingExample = new WdCustomerTypeSettingExample();
+            wdCustomerTypeSettingExample.createCriteria().andBusinessElementIdEqualTo(customerTypeSetting.getBusinessElementId()).andVersionEqualTo(customerTypeSetting.getVersion())
+                    .andDefaultSimpleModuleIdEqualTo(customerTypeSetting.getDefaultSimpleModuleId()).andCustomerTypeIdEqualTo(customerTypeSetting.getCustomerTypeId());
+            wdCustomerTypeSettingService.deleteByExample(wdCustomerTypeSettingExample);
+        } else {
+            wdCustomerTypeSettingService.deleteByPrimaryKey(customerTypeSetting.getId());
+        }
+        return new JsonResult();
+    }
+
+    /**
+     * 修改客户类型配置列表 date: 2017年3月17日 下午5:34:38 <br/>
+     * @author Liam
+     * @param category
+     * @param customerTypeId
+     * @param data
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = { "settingIssue" })
+    @ResponseBody
+    public JsonResult settingIssue(String customerTypeId, String version, String portraitCol, String titleCol, String subtitleCol) {
+        WdCustomerType wdCustomerType = wdCustomerTypeService.selectByPrimaryKey(customerTypeId);
+        wdCustomerType.setPortraitCol(portraitCol);
+        wdCustomerType.setTitleCol(titleCol);
+        wdCustomerType.setSubtitleCol(subtitleCol);
+        wdCustomerType.setSettingVersion(version);
+        wdCustomerType.setUpdateBy(UserUtils.getUser().getId());
+        wdCustomerType.setUpdateDate(new Date());
+        wdCustomerTypeService.updateByPrimaryKeySelective(wdCustomerType);
+        return new JsonResult();
+    }
+
+    @RequiresPermissions("wd:customerType:edit")
+    @RequestMapping(value = { "settingSorts" })
+    @ResponseBody
+    public JsonResult settingSorts(String ids) {
+        if (StringUtils.isNoneEmpty(ids)) {
+            String[] idArray = ids.split(",");
+            for (int i = 0; i < idArray.length; i++) {
+                if (StringUtils.isNoneEmpty(idArray[i])) {
+                    WdCustomerTypeSetting wdCustomerTypeSetting = wdCustomerTypeSettingService.selectByPrimaryKey(idArray[i]);
+                    wdCustomerTypeSetting.setSortMobile(i);
+                    wdCustomerTypeSetting.setUpdateBy(UserUtils.getUser().getId());
+                    wdCustomerTypeSetting.setUpdateDate(new Date());
+                    wdCustomerTypeSettingService.updateByPrimaryKeySelective(wdCustomerTypeSetting);
+                }
+            }
+        }
+        return new JsonResult();
+    }
+}

+ 199 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/MessageController.java

@@ -0,0 +1,199 @@
+package com.bk.wd.web.controller.wd;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.JGMessageUtils;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdMessage;
+import com.bk.wd.model.WdMessageJpush;
+import com.bk.wd.model.WdMessageJpushExample;
+import com.bk.wd.model.WdMessageReceiver;
+import com.bk.wd.service.WdMessageJpushService;
+import com.bk.wd.service.WdMessageReceiverService;
+import com.bk.wd.service.WdMessageService;
+
+@Controller
+@RequestMapping(value = "/wd/message")
+public class MessageController {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(MessageController.class);
+
+    @Autowired
+    private WdMessageService wdMessageService;
+    @Autowired
+    private SystemService systemService;
+    @Autowired
+    private WdMessageReceiverService wdMessageReceiverService;
+    @Autowired
+    private WdMessageJpushService wdMessageJpushService;
+    @Autowired
+    private JGMessageUtils jgMessageUtils;
+
+    @RequiresPermissions("wd:message:view")
+    @RequestMapping(value = "list/mine")
+    public String mineList(Model model, Pagination pagination, String userId) {
+        WdMessage message = new WdMessage();
+        message.setCreateBy(userId);
+        message.setCategory("通知");
+
+        wdMessageService.findByPage(pagination, message);
+
+        model.addAttribute("pagination", pagination);
+        return "modules/wd/message/list";
+    }
+
+    @RequiresPermissions("wd:message:del")
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(String id) {
+
+        WdMessageJpushExample example = new WdMessageJpushExample();
+        example.createCriteria().andMessageIdEqualTo(id);
+        List<WdMessageJpush> jpushs = wdMessageJpushService.selectByExample(example);
+        for (WdMessageJpush jpush : jpushs) {
+            if (jgMessageUtils.deleteMessageSchedule(jpush.getScheduleId())) {
+                wdMessageJpushService.deleteByPrimaryKey(jpush.getId());
+            }
+        }
+        
+        wdMessageService.deleteByPrimaryKey(id);
+
+        return new JsonResult(true, "");
+    }
+
+    @RequiresPermissions("wd:message:edit")
+    @RequestMapping(value = "edit")
+    public String edit(Model model, String id) {
+        WdMessage message = wdMessageService.selectByPrimaryKey(id);
+        model.addAttribute("message", message);
+        return "modules/wd/message/edit";
+    }
+
+    @RequiresPermissions("wd:message:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(String id, String title, String messageDate, String content, HttpServletRequest request) {
+        if (StringUtils.isBlank(title)) {
+            return new JsonResult(false, "标题不能为空");
+        }
+        if (StringUtils.isBlank(content)) {
+            return new JsonResult(false, "内容不能为空");
+        }
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.SECOND, 10);
+        Date sendDate = calendar.getTime();
+
+        if (StringUtils.isNotBlank(messageDate)) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+            try {
+                Date date = sdf.parse(messageDate);
+                if (date.after(sendDate)) {
+                    sendDate = date;
+                }
+            } catch (ParseException e) {
+                LOGGER.error(e.getMessage(), e);
+            }
+        }
+
+        WdMessage wdMessage = new WdMessage();
+        wdMessage.setCategory("通知");
+        wdMessage.setTitle(title);
+        wdMessage.setContent(content);
+        wdMessage.setMessageDate(sendDate);
+
+        Collection<String> schedules = new ArrayList<String>();
+        List<String> officeIds = new ArrayList<String>();
+
+        if (StringUtils.isBlank(id)) {
+            wdMessage.setId(UidUtil.uuid());
+            wdMessage.setCreateBy(UserUtils.getUser().getId());
+            wdMessage.setCreateDate(new Date());
+            wdMessage.setUpdateBy(UserUtils.getUser().getId());
+            wdMessage.setUpdateDate(new Date());
+            wdMessageService.insertSelective(wdMessage);
+
+            List<SysOffice> offices = systemService.findAllOffice();
+            for (SysOffice office : offices) {
+                officeIds.add(office.getId());
+
+                WdMessageReceiver receiver = new WdMessageReceiver();
+                receiver.setId(UidUtil.uuid());
+                receiver.setMessageDate(sendDate);
+                receiver.setMessageId(wdMessage.getId());
+                receiver.setReceiverOfficeId(office.getId());
+                receiver.setDelFlag(false);
+
+                wdMessageReceiverService.insertSelective(receiver);
+            }
+
+        } else {
+            wdMessage.setId(id);
+            wdMessage.setUpdateBy(UserUtils.getUser().getId());
+            wdMessage.setUpdateDate(new Date());
+            wdMessageService.updateByPrimaryKeySelective(wdMessage);
+
+            WdMessageJpushExample example = new WdMessageJpushExample();
+            example.createCriteria().andMessageIdEqualTo(id);
+            List<WdMessageJpush> jpushs = wdMessageJpushService.selectByExample(example);
+            for (WdMessageJpush jpush : jpushs) {
+                if (jgMessageUtils.deleteMessageSchedule(jpush.getScheduleId())) {
+                    wdMessageJpushService.deleteByPrimaryKey(jpush.getId());
+                }
+            }
+        }
+
+        Map<String, String> extraInfo = new HashMap<>();
+        extraInfo.put("category", "通知");
+        extraInfo.put("messageId", wdMessage.getId());
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String[] strings = new String[officeIds.size()];
+        schedules = jgMessageUtils.messageScheduleByTags(
+                officeIds.toArray(strings), title, content, extraInfo, sdf.format(sendDate)
+        );
+
+        for (String scheduleId : schedules) {
+            WdMessageJpush jpush = new WdMessageJpush();
+            jpush.setId(UidUtil.uuid());
+            jpush.setMessageId(wdMessage.getId());
+            jpush.setScheduleId(scheduleId);
+            wdMessageJpushService.insertSelective(jpush);
+        }
+
+        return new JsonResult(true, "");
+    }
+
+    @RequiresPermissions("wd:message:view")
+    @RequestMapping(value = "show")
+    public String show(Model model, String id) {
+        WdMessage message = wdMessageService.selectByPrimaryKey(id);
+        model.addAttribute("message", message);
+        return "modules/wd/message/show";
+    }
+}

+ 180 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/PersonController.java

@@ -0,0 +1,180 @@
+package com.bk.wd.web.controller.wd;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.model.WdBusinessElement;
+import com.bk.wd.model.WdCommonSimpleModule;
+import com.bk.wd.model.WdPerson;
+import com.bk.wd.service.WdBusinessElementService;
+import com.bk.wd.service.WdCommonSimpleModuleService;
+import com.bk.wd.service.WdCommonSimpleModuleSettingService;
+import com.bk.wd.service.WdCourtQueryService;
+import com.bk.wd.service.WdCustomerBacklistService;
+import com.bk.wd.service.WdPersonAssetsBuildingService;
+import com.bk.wd.service.WdPersonAssetsCarService;
+import com.bk.wd.service.WdPersonService;
+import com.bk.wd.service.WdRwEmaySinowayCreditService;
+import com.bk.wd.service.WdRwTxCreditAntifraudVerifyService;
+import com.bk.wd.service.WdRwZmCreditAntifraudVerifyService;
+
+/**
+ * 人员
+ * @Project Name:bk-wd-web 
+ * @Date:2017年7月21日下午1:55:14 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/person")
+public class PersonController {
+    
+    // 客户关系
+    private static final String customer_relation = "客户关系人";
+
+    // 车产
+    private static final String customer_car = "家庭主要资产(车辆)";
+
+    // 房产
+    private static final String customer_building = "家庭主要资产(房产)";
+    
+    @Autowired
+    private WdPersonService wdPersonService;
+    
+    @Autowired
+    private WdCommonSimpleModuleSettingService wdCommonSimpleModuleSettingService;
+    
+    @Autowired
+    private WdCommonSimpleModuleService wdCommonSimpleModuleService;
+    
+    @Autowired
+    private WdPersonAssetsCarService wdPersonAssetsCarService;
+    
+    @Autowired
+    private WdPersonAssetsBuildingService wdPersonAssetsBuildingService;
+    
+    @Autowired
+    private WdBusinessElementService wdBusinessElementService;
+    
+    @Autowired
+    private WdCustomerBacklistService wdCustomerBacklistService;
+    
+    @Autowired
+    private WdCourtQueryService wdCourtQueryService;
+    
+    @Autowired
+    private WdRwZmCreditAntifraudVerifyService wdRwZmCreditAntifraudVerifyService;
+    
+    @Autowired
+    private WdRwTxCreditAntifraudVerifyService wdRwTxCreditAntifraudVerifyService;
+    
+    @Autowired
+    private WdRwEmaySinowayCreditService wdRwEmaySinowayCreditService;
+    
+    @Autowired
+    private SysUserService sysUserService;
+    
+    /**
+     * 人员详情
+     * date: 2017年7月21日 下午1:52:38 <br/> 
+     * @author Liam 
+     * @param model
+     * @param request
+     * @param personId
+     * @param target
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequestMapping(value = { "/detail" })
+    public String detail(Model model, HttpServletRequest request, String personId, String target, String targetType) {
+        String referer = request.getHeader("Referer");
+        request.getSession().setAttribute("person_detail_back_url", referer);
+        model.addAttribute("personId", personId);
+        if (StringUtils.isEmpty(target)) {
+            target = "index";
+        }
+        model.addAttribute("targetType", targetType);
+        return "redirect:/wd/person/detail/" + target;
+    }
+    
+    @RequestMapping(value = { "/detail/index" })
+    public String detailIndex(Model model, HttpServletRequest request, String personId, String targetType) {
+        model.addAttribute("targetType", targetType);
+        
+        // 客户信息
+        WdPerson wdPerson = wdPersonService.selectByPrimaryKey(personId);
+        SysUser currentUser = sysUserService.selectByPrimaryKey(wdPerson.getCreateBy());
+        
+        model.addAttribute("wdPerson", wdPerson);
+        
+        model.addAttribute("personId", personId);
+        
+        Map<String, Object> config = new HashMap<>();
+
+        WdCommonSimpleModule wdCommonSimpleModuleRelation = wdCommonSimpleModuleService.selectByModuleName(customer_relation, currentUser.getCompanyId());
+        if (null != wdCommonSimpleModuleRelation) {
+            config.put("customerRelation",
+                    wdCommonSimpleModuleSettingService.selectByModuleVersion(
+                            wdCommonSimpleModuleRelation.getDefaultSimpleModuleId(),
+                            wdCommonSimpleModuleRelation.getSettingVersion()));
+        }
+        WdCommonSimpleModule wdCommonSimpleModuleCar = wdCommonSimpleModuleService.selectByModuleName(customer_car, currentUser.getCompanyId());
+        if (null != wdCommonSimpleModuleCar) {
+            config.put("customerCar", wdCommonSimpleModuleSettingService.selectByModuleVersion(
+                    wdCommonSimpleModuleCar.getDefaultSimpleModuleId(), wdCommonSimpleModuleCar.getSettingVersion()));
+        }
+        WdCommonSimpleModule wdCommonSimpleModuleBuilding = wdCommonSimpleModuleService
+                .selectByModuleName(customer_building, currentUser.getCompanyId());
+        if (null != wdCommonSimpleModuleBuilding) {
+            config.put("customerBuilding",
+                    wdCommonSimpleModuleSettingService.selectByModuleVersion(
+                            wdCommonSimpleModuleBuilding.getDefaultSimpleModuleId(),
+                            wdCommonSimpleModuleBuilding.getSettingVersion()));
+        }
+        model.addAttribute("config", config);
+        model.addAttribute("customerRelationList", wdPersonService.selectRelationerByPersonId(personId, currentUser.getId()));
+        model.addAttribute("customerCarList", wdPersonAssetsCarService.selectByPersonId(personId));
+        model.addAttribute("customerBuildingList", wdPersonAssetsBuildingService.selectByPersonId(personId));
+
+        List<WdBusinessElement> allElementList = wdBusinessElementService.selectAll();
+        Map<String, Object> wdBusinessElementConfig = new HashMap<>();
+        for (WdBusinessElement wdBusinessElement : new ArrayList<>(allElementList)) {
+            wdBusinessElementConfig.put(wdBusinessElement.getId(), wdBusinessElement);
+            allElementList.remove(wdBusinessElement);
+        }
+        model.addAttribute("wdBusinessElementConfig", wdBusinessElementConfig);
+
+        Map<String, Object> params = new HashMap<>();
+        params.put("userId", currentUser.getId());
+        return "modules/wd/person/detail/index";
+    }
+    
+    @RequestMapping(value = { "/detail/risk" })
+    public String risk(Model model, HttpServletRequest request, String personId, String targetType) {
+        model.addAttribute("targetType", targetType);
+        
+        model.addAttribute("wdCustomerBacklist", wdCustomerBacklistService.selectByCustomerId(personId));
+        model.addAttribute("zhixinList", wdCourtQueryService.selectByPersonIdAndSite(personId, "zhixin", null));
+        model.addAttribute("shixinList", wdCourtQueryService.selectByPersonIdAndSite(personId, "shixin", null));
+        model.addAttribute("wdRwZmCreditAntifraudVerifyList", wdRwZmCreditAntifraudVerifyService.selectByPerson(personId));
+        model.addAttribute("wdRwTxCreditAntifraudVerifyList", wdRwTxCreditAntifraudVerifyService.selectByPersonId(personId, null));
+        model.addAttribute("wdRwEmaySinowayCreditList", wdRwEmaySinowayCreditService.selectByPersonId(personId, null));
+        
+        model.addAttribute("wdPerson", wdPersonService.selectByPrimaryKey(personId));
+        model.addAttribute("personId", personId);
+        return "modules/wd/person/detail/riskWarning";
+    }
+
+}

+ 99 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/PhotoSettingController.java

@@ -0,0 +1,99 @@
+package com.bk.wd.web.controller.wd;
+
+import java.util.Date;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdDefaultPhotoSetting;
+import com.bk.wd.service.WdDefaultPhotoSettingService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 调查组照片配置
+ * @Project Name:bk-wd-web 
+ * @Date:2017年3月9日下午10:31:26 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/photoSetting")
+public class PhotoSettingController extends BaseController {
+    
+    @Autowired
+    private WdDefaultPhotoSettingService wdDefaultPhotoSettingService;
+    
+    @RequiresPermissions("wd:photoSetting:view")
+    @RequestMapping(value = {"list", ""})
+    public String list(Model model, Pagination pagination, WdDefaultPhotoSetting wdDefaultPhotoSetting) {
+        wdDefaultPhotoSettingService.findByPage(pagination, wdDefaultPhotoSetting);
+        model.addAttribute("pagination", pagination);
+        return "modules/wd/photoSetting/photoSettingList";
+    }
+
+    @RequiresPermissions("wd:photoSetting:view")
+    @RequestMapping(value = "form")
+    public String form(String id, Model model) {
+        model.addAttribute("wdDefaultPhotoSetting", wdDefaultPhotoSettingService.selectByPrimaryKey(id));
+        return "modules/wd/photoSetting/photoSettingForm";
+    }
+    
+    @RequiresPermissions("wd:photoSetting:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(WdDefaultPhotoSetting wdDefaultPhotoSetting, Model model) {
+        if (StringUtils.isEmpty(wdDefaultPhotoSetting.getId())) {
+            wdDefaultPhotoSetting.setId(IdGen.uuid());
+            wdDefaultPhotoSetting.setCreateBy(UserUtils.getUser().getId());
+            wdDefaultPhotoSetting.setCreateDate(new Date());
+            wdDefaultPhotoSetting.setUpdateBy(UserUtils.getUser().getId());
+            wdDefaultPhotoSetting.setUpdateDate(new Date());
+            wdDefaultPhotoSettingService.insertSelective(wdDefaultPhotoSetting);
+        } else {
+            wdDefaultPhotoSetting.setUpdateBy(UserUtils.getUser().getId());
+            wdDefaultPhotoSetting.setUpdateDate(new Date());
+            wdDefaultPhotoSettingService.updateByPrimaryKeySelective(wdDefaultPhotoSetting);
+        }
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:photoSetting:edit")
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(WdDefaultPhotoSetting wdDefaultPhotoSetting) {
+        wdDefaultPhotoSetting.setUpdateBy(UserUtils.getUser().getId());
+        wdDefaultPhotoSetting.setUpdateDate(new Date());
+        wdDefaultPhotoSetting.setDelFlag(true);
+        wdDefaultPhotoSettingService.updateByPrimaryKeySelective(wdDefaultPhotoSetting);
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:photoSetting:edit")
+    @RequestMapping(value = {"sorts"})
+    @ResponseBody
+    public JsonResult sorts(String photoSettingIds) {
+        if (StringUtils.isNoneEmpty(photoSettingIds)) {
+            String[] photoSettingIdArray = photoSettingIds.split(",");
+            for (int i = 0; i < photoSettingIdArray.length; i++) {
+                if (StringUtils.isNoneEmpty(photoSettingIdArray[i])) {
+                    WdDefaultPhotoSetting wdDefaultPhotoSetting = wdDefaultPhotoSettingService.selectByPrimaryKey(photoSettingIdArray[i]);
+                    wdDefaultPhotoSetting.setSort(i);
+                    wdDefaultPhotoSetting.setUpdateBy(UserUtils.getUser().getId());
+                    wdDefaultPhotoSetting.setUpdateDate(new Date());
+                    wdDefaultPhotoSettingService.updateByPrimaryKeySelective(wdDefaultPhotoSetting);
+                }
+            }
+        }
+        return new JsonResult();
+    }
+
+}

+ 430 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/ProductController.java

@@ -0,0 +1,430 @@
+package com.bk.wd.web.controller.wd;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.bk.common.entity.GeneralException;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sm.model.SmModel;
+import com.bk.sm.service.SmModelService;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.*;
+import com.bk.wd.service.*;
+import com.bk.wd.util.process.TemplateAnalysis;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 产品管理
+ * @Project Name:bk-wd-web
+ * @Date:2017年3月15日下午9:24:06
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/product")
+public class ProductController extends BaseController {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(ProductController.class);
+
+	public static final String product_simple_module_survey = "survey";
+	public static final String product_simple_module_audit = "audit";
+	public static final String product_simple_module_loan = "loan";
+
+	public final static String module_photo_id = "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF";
+
+	@Autowired
+	private WdProductService wdProductService;
+
+	@Autowired
+	private WdProductProcessService wdProductProcessService;
+
+	@Autowired
+	private WdProductSimpleModuleSettingService wdProductSimpleModuleSettingService;
+
+	@Autowired
+	private WdProductSimpleModuleService wdProductSimpleModuleService;
+
+	@Autowired
+	private WdBusinessElementService wdBusinessElementService;
+
+	@Autowired
+	private WdProductComplexModuleService wdProductComplexModuleService;
+
+	@Autowired
+	private WdDefaultSimpleModuleSettingService wdDefaultSimpleModuleSettingService;
+
+	@Autowired
+	private TemplateAnalysis templateAnalysis;
+	
+	@Autowired
+	private WdProductSmModelService wdProductSmModelService;
+	
+	@Autowired
+	private SmModelService smModelService;
+	
+	@Autowired
+	private WdProductCreditInvestigationService wdProductCreditInvestigationService;
+
+	@ModelAttribute
+	public WdProduct get(@RequestParam(required = false) String id) {
+		if (StringUtils.isNotBlank(id)) {
+			return wdProductService.selectByPrimaryKey(id);
+		} else {
+			return new WdProduct();
+		}
+	}
+
+	@RequiresPermissions("wd:product:view")
+	@RequestMapping(value = { "list", "" })
+	public String list(Model model, Pagination pagination, WdProduct wdProduct) {
+	    pagination.setBegin(0);
+	    if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+	        wdProduct.setRegion(UserUtils.getUser().getCompanyId());
+        }
+		wdProductService.findByPage(pagination, wdProduct);
+		model.addAttribute("pagination", pagination);
+		return "modules/wd/product/productList";
+	}
+
+	@RequiresPermissions("wd:product:edit")
+	@RequestMapping(value = "form")
+	public String form(WdProduct wdProduct, Model model) {
+		model.addAttribute("newVersion", "temp" + new Date().getTime());
+		model.addAttribute("wdProduct", wdProduct);
+		return "modules/wd/product/productForm";
+	}
+
+	@RequiresPermissions("wd:product:edit")
+	@RequestMapping(value = "form_info")
+	public String form_info(String productId, Model model) {
+		model.addAttribute("wdProduct", wdProductService.selectByPrimaryKey(productId));
+		return "modules/wd/product/productInfoForm";
+	}
+
+	@RequiresPermissions("wd:product:edit")
+	@RequestMapping(value = "form_process")
+	public String form_process(String productId, Model model) {
+	    WdProduct wdProduct = wdProductService.selectByPrimaryKey(productId);
+        String version = wdProduct != null ? wdProduct.getProductVersion() : "";
+        WdProductProcess wdProductProcess = wdProductProcessService.selectByProductIdAndVersion(productId, version);
+        if (null != wdProductProcess) {
+            model.addAttribute("processXml", templateAnalysis.getProcessXml(wdProductProcess.getProcessTemplate()));
+        }
+        model.addAttribute("productId", productId);
+		return "modules/wd/product/productProcessForm";
+	}
+	
+	@RequiresPermissions("wd:product:edit")
+	@RequestMapping(value = "form_survey")
+	public String form_survey(String productId, Model model) {
+	    WdProduct wdProduct = wdProductService.selectByPrimaryKey(productId);
+	    String version = wdProduct != null ? wdProduct.getProductVersion() : "";
+		model.addAttribute("simpleModuleList",
+				wdProductSimpleModuleService.selectByProductVersion(productId, version, product_simple_module_survey));
+		model.addAttribute("complexModuleList",
+				wdProductComplexModuleService.selectByProductVersion(productId, version, product_simple_module_survey));
+		model.addAttribute("wdProductCreditInvestigation",
+		        wdProductCreditInvestigationService.selectByProductId(productId, version));
+		model.addAttribute("productId", productId);
+		return "modules/wd/product/productSurveyForm";
+	}
+
+	@RequiresPermissions("wd:product:edit")
+	@RequestMapping(value = "form_alternative")
+	public String form_alternative(String productId, String moduleId, Model model) {
+	    WdProduct wdProduct = wdProductService.selectByPrimaryKey(productId);
+        String version = wdProduct != null ? wdProduct.getProductVersion() : "";
+		Map<String, Object> params = new HashMap<>();
+		params.put("moduleId", moduleId);
+        params.put("version", version);
+        params.put("productId", productId);
+		model.addAttribute("elementList", wdBusinessElementService.selectProductLeftModule(params));
+		model.addAttribute("productId", productId);
+		return "modules/wd/product/productSurveyAlternative";
+	}
+
+	@RequiresPermissions("wd:product:edit") 
+	@RequestMapping(value = "form_setting")
+	public String form_setting(String productId, String moduleId, Model model) {
+	    WdProduct wdProduct = wdProductService.selectByPrimaryKey(productId);
+        String version = wdProduct != null ? wdProduct.getProductVersion() : "";
+        Map<String, Object> params = new HashMap<>();
+        params.put("moduleId", moduleId);
+        params.put("version", version);
+        params.put("productId", productId);
+		model.addAttribute("elementList", wdBusinessElementService.selectProductLeftModule(params));
+		model.addAttribute("productId", productId);
+		if (module_photo_id.equals(moduleId)) {
+			return "modules/wd/product/productSurveySettingPhoto";
+		}
+		return "modules/wd/product/productSurveySetting";
+	}
+	
+	@RequiresPermissions("wd:product:edit")
+    @RequestMapping(value = "form_audit")
+    public String form_audit(String productId, Model model) {
+	    WdProduct wdProduct = wdProductService.selectByPrimaryKey(productId);
+        String version = wdProduct != null ? wdProduct.getProductVersion() : "";
+        model.addAttribute("simpleModuleList",
+                wdProductSimpleModuleService.selectByProductVersion(productId, version, product_simple_module_audit));
+        model.addAttribute("productId", productId);
+        return "modules/wd/product/productAuditForm";
+    }
+	
+	
+	@RequiresPermissions("wd:product:edit")
+	@RequestMapping(value = "save_product")
+    @ResponseBody
+	public JsonResult save_product(WdProduct wdProduct, String newVersion, String productId, Model model,
+	        String surveySimpleModules, String surveyComplexModules, String auditSimpleModules, String productProcessXml, String wdProductCreditInvestigation) {
+	    // 默认设置为当前公司
+        if (StringUtils.isBlank(wdProduct.getRegion())) {
+            wdProduct.setRegion(UserUtils.getUser().getCompanyId());
+        }
+        
+        WdProductProcess wdProductProcess = new WdProductProcess();
+        try {
+            if (StringUtils.isNotEmpty(productProcessXml)) {
+                productProcessXml = StringEscapeUtils.unescapeHtml4(StringEscapeUtils.unescapeXml(productProcessXml)).replaceAll(" ", " ");
+            }
+            String remplateId = templateAnalysis.readProcessTemplate( productProcessXml, UserUtils.getUser().getId());
+            wdProductProcess.setId(UidUtil.uuid());
+            wdProductProcess.setProcessTemplate(remplateId);
+            wdProductProcess.setVersion(newVersion);
+            wdProductProcess.setCreateBy(UserUtils.getUser().getId());
+            wdProductProcess.setCreateDate(new Date());
+            wdProductProcess.setUpdateBy(UserUtils.getUser().getId());
+            wdProductProcess.setUpdateDate(new Date());
+        } catch (GeneralException e) {
+            LOGGER.error(e.getMessage(), e);
+            return new JsonResult(e.getMessage());
+        }
+        
+        // 设置为最新版本号
+        wdProduct.setProductVersion(newVersion);
+        if (StringUtils.isEmpty(productId)) {
+            productId = UidUtil.uuid();
+            wdProduct.setId(productId);
+            wdProduct.setCreateBy(UserUtils.getUser().getId());
+            wdProduct.setCreateDate(new Date());
+            wdProduct.setUpdateBy(UserUtils.getUser().getId());
+            wdProduct.setUpdateDate(new Date());
+            wdProductService.insertSelective(wdProduct);
+        } else {
+            wdProduct.setId(productId);
+            wdProduct.setUpdateBy(UserUtils.getUser().getId());
+            wdProduct.setUpdateDate(new Date());
+            wdProductService.updateByPrimaryKeySelective(wdProduct);
+        }
+        
+        if (StringUtils.isNotEmpty(auditSimpleModules)) { // 审批流程配置
+            JSONArray jsonArray = JSON.parseArray(StringEscapeUtils.unescapeHtml4(auditSimpleModules));
+            for (Object object : jsonArray) {
+                JSONObject json = (JSONObject) object;
+                WdProductSimpleModule wdProductSimpleModule = new WdProductSimpleModule();
+                wdProductSimpleModule.setId(UidUtil.uuid());
+                wdProductSimpleModule.setVersion(newVersion);
+                wdProductSimpleModule.setProductId(productId);
+                wdProductSimpleModule.setCreateBy(UserUtils.getUser().getId());
+                wdProductSimpleModule.setCreateDate(new Date());
+                wdProductSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+                wdProductSimpleModule.setUpdateDate(new Date());
+                wdProductSimpleModule.setBelongTo(product_simple_module_audit);
+                wdProductSimpleModule.setDefaultSimpleModuleId(json.getString("default_simple_module_id"));
+                wdProductSimpleModule.setModuleName(json.getString("module_name"));
+                wdProductSimpleModuleService.insertSelective(wdProductSimpleModule);
+
+                JSONArray moduleSettingArray = json.getJSONArray("product_simple_module_setting");
+                for (int i = 0; i < moduleSettingArray.size(); i++) {
+                    JSONObject json2 = (JSONObject) moduleSettingArray.get(i);
+                    WdProductSimpleModuleSetting wdProductSimpleModuleSetting = new WdProductSimpleModuleSetting();
+                    wdProductSimpleModuleSetting.setId(IdGen.uuid());
+                    wdProductSimpleModuleSetting.setProductSimpleModuleId(wdProductSimpleModule.getId());
+                    wdProductSimpleModuleSetting.setSortMobile(i);
+                    String required = (json2.getBoolean("required") != null && json2.getBoolean("required")) ? "1"
+                            : "0";
+                    wdProductSimpleModuleSetting.setRequired(required);
+                    WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting = wdDefaultSimpleModuleSettingService
+                            .selectByPrimaryKey(json2.getString("default_simple_module_setting_id"));
+                    wdProductSimpleModuleSetting.setDefaultSimpleModuleSettingId(wdDefaultSimpleModuleSetting.getId());
+                    wdProductSimpleModuleSetting
+                            .setBusinessElementId(wdDefaultSimpleModuleSetting.getBusinessElementId());
+                    WdBusinessElement wdBusinessElement = wdBusinessElementService
+                            .selectByPrimaryKey(wdDefaultSimpleModuleSetting.getBusinessElementId());
+                    wdProductSimpleModuleSetting.setElementName(wdBusinessElement.getName());
+                    wdProductSimpleModuleSetting.setElementSelectListId(json2.getString("element_select_list_id"));
+                    wdProductSimpleModuleSetting.setCreateBy(UserUtils.getUser().getId());
+                    wdProductSimpleModuleSetting.setCreateDate(new Date());
+                    wdProductSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+                    wdProductSimpleModuleSetting.setUpdateDate(new Date());
+                    wdProductSimpleModuleSettingService.insertSelective(wdProductSimpleModuleSetting);
+                }
+            }
+        }
+        
+        if (StringUtils.isNotEmpty(surveySimpleModules)) { // 简单组件
+            JSONArray jsonArray = JSON.parseArray(StringEscapeUtils.unescapeHtml4(surveySimpleModules));
+            for (Object object : jsonArray) {
+                JSONObject json = (JSONObject) object;
+                WdProductSimpleModule wdProductSimpleModule = new WdProductSimpleModule();
+                wdProductSimpleModule.setId(IdGen.uuid());
+                wdProductSimpleModule.setVersion(newVersion);
+                wdProductSimpleModule.setProductId(productId);
+                wdProductSimpleModule.setCreateBy(UserUtils.getUser().getId());
+                wdProductSimpleModule.setCreateDate(new Date());
+                wdProductSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+                wdProductSimpleModule.setUpdateDate(new Date());
+                wdProductSimpleModule.setBelongTo(product_simple_module_survey);
+                wdProductSimpleModule.setDefaultSimpleModuleId(json.getString("default_simple_module_id"));
+                wdProductSimpleModule.setModuleName(json.getString("module_name"));
+                wdProductSimpleModuleService.insertSelective(wdProductSimpleModule);
+
+                JSONArray moduleSettingArray = json.getJSONArray("product_simple_module_setting");
+                for (int i = 0; i < moduleSettingArray.size(); i++) {
+                    JSONObject json2 = (JSONObject) moduleSettingArray.get(i);
+                    WdProductSimpleModuleSetting wdProductSimpleModuleSetting = new WdProductSimpleModuleSetting();
+                    wdProductSimpleModuleSetting.setId(IdGen.uuid());
+                    wdProductSimpleModuleSetting.setProductSimpleModuleId(wdProductSimpleModule.getId());
+                    wdProductSimpleModuleSetting.setSortMobile(i);
+                    String required = (json2.getBoolean("required") != null && json2.getBoolean("required")) ? "1" : "0";
+                    wdProductSimpleModuleSetting.setRequired(required);
+                    WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting = wdDefaultSimpleModuleSettingService .selectByPrimaryKey(json2.getString("default_simple_module_setting_id"));
+                    wdProductSimpleModuleSetting.setDefaultSimpleModuleSettingId(wdDefaultSimpleModuleSetting.getId());
+                    wdProductSimpleModuleSetting .setBusinessElementId(wdDefaultSimpleModuleSetting.getBusinessElementId());
+                    WdBusinessElement wdBusinessElement = wdBusinessElementService.selectByPrimaryKey(wdDefaultSimpleModuleSetting.getBusinessElementId());
+                    wdProductSimpleModuleSetting.setElementName(wdBusinessElement.getName());
+                    wdProductSimpleModuleSetting.setElementSelectListId(json2.getString("element_select_list_id"));
+                    wdProductSimpleModuleSetting.setCreateBy(UserUtils.getUser().getId());
+                    wdProductSimpleModuleSetting.setCreateDate(new Date());
+                    wdProductSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+                    wdProductSimpleModuleSetting.setUpdateDate(new Date());
+                    String album = (json2.getBoolean("album") != null && json2.getBoolean("album")) ? "1" : "0";
+                    wdProductSimpleModuleSetting.setAlbum(album);
+                    if (null != json2.get("max_length")) {
+                        wdProductSimpleModuleSetting
+                                .setMaxLength(Integer.valueOf(json2.getString("max_length").trim()));
+                    }
+                    wdProductSimpleModuleSettingService.insertSelective(wdProductSimpleModuleSetting);
+                }
+            }
+        }
+
+        if (StringUtils.isNotEmpty(surveyComplexModules)) { // 复杂组件
+            JSONArray jsonArray = JSON.parseArray(StringEscapeUtils.unescapeHtml4(surveyComplexModules));
+            for (Object object : jsonArray) {
+                JSONObject json = (JSONObject) object;
+                WdProductComplexModule wdProductComplexModule = new WdProductComplexModule();
+                wdProductComplexModule.setId(IdGen.uuid());
+                wdProductComplexModule.setProductId(productId);
+                wdProductComplexModule.setVersion(newVersion);
+                wdProductComplexModule.setCreateBy(UserUtils.getUser().getId());
+                wdProductComplexModule.setCreateDate(new Date());
+                wdProductComplexModule.setUpdateBy(UserUtils.getUser().getId());
+                wdProductComplexModule.setUpdateDate(new Date());
+                wdProductComplexModule.setBelongTo(product_simple_module_survey);
+                wdProductComplexModule.setDefaultComplexModuleId(json.getString("default_complex_module_id"));
+                wdProductComplexModule.setModuleName(json.getString("module_name"));
+                wdProductComplexModuleService.insertSelective(wdProductComplexModule);
+            }
+        }
+        
+        if (StringUtils.isNotEmpty(wdProductCreditInvestigation)) {
+            WdProductCreditInvestigation productCreditInvestigation = JSON.parseObject(StringEscapeUtils.unescapeHtml4(wdProductCreditInvestigation), WdProductCreditInvestigation.class);
+            productCreditInvestigation.setId(IdGen.uuid());
+            productCreditInvestigation.setProductId(productId);
+            productCreditInvestigation.setVersion(newVersion);
+            productCreditInvestigation.setCreateBy(UserUtils.getUser().getId());
+            productCreditInvestigation.setCreateDate(new Date());
+            productCreditInvestigation.setUpdateBy(UserUtils.getUser().getId());
+            productCreditInvestigation.setUpdateDate(new Date());
+            wdProductCreditInvestigationService.insertSelective(productCreditInvestigation);
+        }
+        wdProductProcess.setProductId(wdProduct.getId());
+        wdProductProcessService.insertSelective(wdProductProcess);
+	    return new JsonResult();
+	}
+	
+	@RequiresPermissions("wd:product:del")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public JsonResult delete(WdProduct wdProduct) {
+		wdProduct.setUpdateBy(UserUtils.getUser().getId());
+		wdProduct.setUpdateDate(new Date());
+		wdProduct.setDelFlag(true);
+		wdProductService.updateByPrimaryKeySelective(wdProduct);
+		return new JsonResult();
+	}
+
+	@RequiresPermissions("wd:product:edit")
+	@RequestMapping(value = "disable")
+	@ResponseBody
+	public JsonResult disable(WdProduct wdProduct) {
+		wdProduct.setUpdateBy(UserUtils.getUser().getId());
+		wdProduct.setUpdateDate(new Date());
+		wdProductService.updateByPrimaryKeySelective(wdProduct);
+		return new JsonResult();
+	}
+	
+	@RequestMapping(value = "smList")
+	public String scoreModel(Pagination pagination) {
+	    SmModel smModel = new SmModel();
+	    smModel.setEnable("1"); //启用
+	    smModelService.selectByPagination(pagination, smModel);
+	    return "modules/wd/product/scoreModelConfig";
+	}
+	
+	/**
+	 * 使用评分模型
+	 * date: 2017年11月13日 上午10:34:46 <br/> 
+	 * @author Liam 
+	 * @return 
+	 * @since JDK 1.8
+	 */
+    @RequestMapping(value = "useSmModel")
+    @ResponseBody
+    public JsonResult useSmModel(String modelKey, String productIds) {
+        if (StringUtils.isEmpty(modelKey)) {
+            return new JsonResult("请选择评分模型");
+        }
+        wdProductSmModelService.deleteByModelKey(modelKey);
+        
+        if (StringUtils.isNotEmpty(productIds)) {
+            String[] productIdArray = JSON.parseObject(StringEscapeUtils.unescapeHtml4(productIds), String[].class);
+            for (String productId : productIdArray) {
+                WdProductSmModel wdProductSmModel = new WdProductSmModel();
+                wdProductSmModel.setId(UidUtil.uuid());
+                wdProductSmModel.setModelKey(modelKey);
+                wdProductSmModel.setProductId(productId);
+                WdProduct wdProduct = wdProductService.selectByPrimaryKey(productId);
+                wdProductSmModel.setProductName(wdProduct.getName());
+                wdProductSmModel.setCreateBy(UserUtils.getUser().getId());
+                wdProductSmModel.setCreateDate(new Date());
+                wdProductSmModel.setUpdateBy(UserUtils.getUser().getId());
+                wdProductSmModel.setUpdateDate(new Date());
+                wdProductSmModelService.insertSelective(wdProductSmModel);
+            }
+        }
+        return new JsonResult();
+    }
+}

+ 264 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/SelectItemController.java

@@ -0,0 +1,264 @@
+package com.bk.wd.web.controller.wd;
+
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdSelectGroup;
+import com.bk.wd.model.WdSelectGroupExample;
+import com.bk.wd.model.WdSelectItem;
+import com.bk.wd.model.WdSelectItemExample;
+import com.bk.wd.model.WdSelectList;
+import com.bk.wd.model.WdSelectListExample;
+import com.bk.wd.service.WdSelectGroupService;
+import com.bk.wd.service.WdSelectItemService;
+import com.bk.wd.service.WdSelectListService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 选择项Controller
+ * @Project Name:智微云
+ * @Date:2017年3月7日下午2:29:23 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/selectItem")
+public class SelectItemController extends BaseController {
+    
+    @Autowired
+    private WdSelectItemService wdSelectItemService;
+    
+    @Autowired
+    private WdSelectListService wdSelectListService;
+    
+    @Autowired
+    private WdSelectGroupService wdSelectGroupService;
+    
+    @RequiresPermissions("wd:selectitem:view")
+    @RequestMapping(value = {"", "index"})
+    public String index(Model model, Pagination pagination){
+    	List<WdSelectGroup> data =  wdSelectGroupService.selectAll();
+        model.addAttribute("dataList", data);
+        return "modules/wd/selectItem/selectGroupList";
+    }
+    
+    @RequiresPermissions("wd:selectitem:view")
+    @RequestMapping(value = {"selectGroupForm"})
+    public String newSelectGroup(Model model, String groupId){
+        model.addAttribute("wdSelectGroup", wdSelectGroupService.selectByPrimaryKey(groupId));
+        return "modules/wd/selectItem/selectGroupForm";
+    }
+    
+    @RequiresPermissions("wd:selectitem:edit")
+    @RequestMapping(value = {"editSelectGroup"})
+    @ResponseBody
+    public JsonResult editSelectGroup(WdSelectGroup wdSelectGroup) {
+        // 判断是否重复
+        WdSelectGroupExample wdSelectGroupExample = new WdSelectGroupExample();
+        WdSelectGroupExample.Criteria criteria = wdSelectGroupExample.createCriteria();
+        criteria.andCodeEqualTo(wdSelectGroup.getCode());
+        if (StringUtils.isNotEmpty(wdSelectGroup.getId())) {
+            criteria.andIdNotEqualTo(wdSelectGroup.getId());
+        }
+        List<WdSelectGroup> wdSelectGroupList = wdSelectGroupService.selectByExample(wdSelectGroupExample);
+        if (!wdSelectGroupList.isEmpty()) {
+            return new JsonResult(false, "选项组的键重复");
+        }
+        
+        if (StringUtils.isEmpty(wdSelectGroup.getId())) {
+            wdSelectGroup.setId(IdGen.uuid());
+            wdSelectGroup.setCreateBy(UserUtils.getUser().getId());
+            wdSelectGroup.setCreateDate(new Date());
+            wdSelectGroup.setUpdateBy(UserUtils.getUser().getId());
+            wdSelectGroup.setUpdateDate(new Date());
+            wdSelectGroupService.insertSelective(wdSelectGroup);
+        } else {
+            wdSelectGroup.setUpdateBy(UserUtils.getUser().getId());
+            wdSelectGroup.setUpdateDate(new Date());
+            wdSelectGroupService.updateByPrimaryKeySelective(wdSelectGroup);
+        }
+        return new JsonResult(wdSelectGroup);
+    }
+    
+    @RequiresPermissions("wd:selectitem:edit")
+    @RequestMapping(value = {"delSelectGroup"})
+    @ResponseBody
+    public JsonResult delSelectGroup(String groupId) {
+        WdSelectGroup wdSelectGroup = wdSelectGroupService.selectByPrimaryKey(groupId);
+        wdSelectGroup.setDelFlag(true);
+        wdSelectGroup.setUpdateBy(UserUtils.getUser().getId());
+        wdSelectGroup.setUpdateDate(new Date());
+        wdSelectGroupService.updateByPrimaryKeySelective(wdSelectGroup);
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:selectitem:view")
+    @RequestMapping(value = {"selectListForm"})
+    public String selectListForm(Model model, String listId, String selectGroupId){
+        WdSelectList wdSelectList = new WdSelectList();
+        if (StringUtils.isEmpty(listId)) {
+            wdSelectList.setSelectGroupId(selectGroupId);
+        } else {
+            wdSelectList = wdSelectListService.selectByPrimaryKey(listId);
+        }
+        model.addAttribute("wdSelectList", wdSelectList);
+        return "modules/wd/selectItem/selectListForm";
+    }
+    
+    @RequiresPermissions("wd:selectitem:view")
+    @RequestMapping(value = {"showSelectList"})
+    public String showSelectList(String groupId, Model model) {
+        List<WdSelectList> wdSelectLists = wdSelectListService.selectByGroupId(groupId);
+        if (!wdSelectLists.isEmpty()) {
+            for (WdSelectList wdSelectList : wdSelectLists) {
+                wdSelectList.setItemList(wdSelectItemService.selectByListId(wdSelectList.getId()));
+            }
+        }
+        model.addAttribute("selectGroupId", groupId);
+        model.addAttribute("wdSelectLists", wdSelectLists);
+        return "modules/wd/selectItem/selectListList";
+    }
+    
+    @RequiresPermissions("wd:selectitem:edit")
+    @RequestMapping(value = {"editSelectList"})
+    @ResponseBody
+    public JsonResult editSelectList(WdSelectList wdSelectList) {
+        // 判断是否重复
+        WdSelectListExample wdSelectListExample = new WdSelectListExample();
+        WdSelectListExample.Criteria criteria = wdSelectListExample.createCriteria();
+        criteria.andCodeEqualTo(wdSelectList.getCode());
+        criteria.andSelectGroupIdEqualTo(wdSelectList.getSelectGroupId());
+        criteria.andDefaultFlagEqualTo("0");
+        if (StringUtils.isNotEmpty(wdSelectList.getId())) {
+            criteria.andIdNotEqualTo(wdSelectList.getId());
+        }
+        List<WdSelectList> wdSelectListList = wdSelectListService.selectByExample(wdSelectListExample);
+        if (!wdSelectListList.isEmpty()) {
+            return new JsonResult(false, "选择项的键重复");
+        }
+        
+        //设置默认选项小组
+        if (StringUtils.isEmpty(wdSelectList.getId())) {
+            wdSelectList.setId(IdGen.uuid());
+            wdSelectList.setCreateBy(UserUtils.getUser().getId());
+            wdSelectList.setCreateDate(new Date());
+            wdSelectList.setDelFlag(false);
+            wdSelectList.setUpdateBy(UserUtils.getUser().getId());
+            wdSelectList.setUpdateDate(new Date());
+            wdSelectListService.insertSelective(wdSelectList);
+        } else {
+            wdSelectList.setUpdateBy(UserUtils.getUser().getId());
+            wdSelectList.setUpdateDate(new Date());
+            wdSelectListService.updateByPrimaryKeySelective(wdSelectList);
+        }
+        return new JsonResult(wdSelectList);
+    }
+    
+    @RequiresPermissions("wd:selectitem:edit")
+    @RequestMapping(value = {"delSelectList"})
+    @ResponseBody
+    public JsonResult delSelectList(String listId) {
+        WdSelectList wdSelectList = wdSelectListService.selectByPrimaryKey(listId);
+        wdSelectList.setDelFlag(true);
+        wdSelectList.setUpdateBy(UserUtils.getUser().getId());
+        wdSelectList.setUpdateDate(new Date());
+        wdSelectListService.updateByPrimaryKeySelective(wdSelectList);
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:selectitem:edit")
+    @RequestMapping(value = {"selectItemForm"})
+    public String selectItemForm(Model model, String listId, String itemId, Integer sort){
+        WdSelectItem wdSelectItem = new WdSelectItem();
+        if (StringUtils.isEmpty(itemId)) {
+            wdSelectItem.setSelectListId(listId);
+            wdSelectItem.setSort(sort);
+        } else {
+            wdSelectItem = wdSelectItemService.selectByPrimaryKey(itemId);
+        }
+        model.addAttribute("wdSelectItem", wdSelectItem);
+        return "modules/wd/selectItem/selectItemForm";
+    }
+    
+    @RequiresPermissions("wd:selectitem:edit")
+    @RequestMapping(value = {"editSelectItem"})
+    @ResponseBody
+    public JsonResult editSelectItem(WdSelectItem wdSelectItem) {
+        // 判断是否重复
+        WdSelectItemExample wdSelectItemExample = new WdSelectItemExample();
+        WdSelectItemExample.Criteria criteria = wdSelectItemExample.createCriteria();
+        criteria.andCodeEqualTo(wdSelectItem.getCode());
+        criteria.andSelectListIdEqualTo(wdSelectItem.getSelectListId());
+        criteria.andDelFlagEqualTo(false);
+        if (StringUtils.isNotEmpty(wdSelectItem.getId())) {
+            criteria.andIdNotEqualTo(wdSelectItem.getId());
+        }
+        List<WdSelectItem> wdSelectItemList = wdSelectItemService.selectByExample(wdSelectItemExample);
+        if (!wdSelectItemList.isEmpty()) {
+            return new JsonResult(false, "选择项的键重复");
+        }
+        
+        if (StringUtils.isEmpty(wdSelectItem.getId())) {
+            wdSelectItem.setId(IdGen.uuid());
+            wdSelectItem.setCreateBy(UserUtils.getUser().getId());
+            wdSelectItem.setCreateDate(new Date());
+            wdSelectItem.setDelFlag(false);
+            wdSelectItem.setUpdateBy(UserUtils.getUser().getId());
+            wdSelectItem.setUpdateDate(new Date());
+            wdSelectItemService.insertSelective(wdSelectItem);
+        } else {
+            wdSelectItem.setUpdateBy(UserUtils.getUser().getId());
+            wdSelectItem.setUpdateDate(new Date());
+            wdSelectItemService.updateByPrimaryKeySelective(wdSelectItem);
+        }
+        return new JsonResult(wdSelectItem);
+    }
+    
+    @RequiresPermissions("wd:selectitem:edit")
+    @RequestMapping(value = {"delSelectItem"})
+    @ResponseBody
+    public JsonResult delSelectItem(String itemId) {
+        WdSelectItem wdSelectItem = wdSelectItemService.selectByPrimaryKey(itemId);
+        wdSelectItem.setDelFlag(true);
+        wdSelectItem.setUpdateBy(UserUtils.getUser().getId());
+        wdSelectItem.setUpdateDate(new Date());
+        wdSelectItemService.updateByPrimaryKey(wdSelectItem);
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:selectitem:edit")
+    @ResponseBody
+    @RequestMapping(value = {"itemSort"})
+    public JsonResult itemSort(String itemData) {
+        if (StringUtils.isNoneEmpty(itemData)) {
+            JSONArray dataList = JSON.parseArray(StringEscapeUtils.unescapeHtml4(itemData));
+            Iterator<Object> iterator = dataList.iterator();
+            while(iterator.hasNext())  {
+                JSONObject object = JSON.parseObject(iterator.next().toString());
+                WdSelectItem wdSelectItem = wdSelectItemService.selectByPrimaryKey(object.get("id").toString());
+                wdSelectItem.setSort(Integer.valueOf(object.get("sort").toString()));
+                wdSelectItem.setUpdateBy(UserUtils.getUser().getId());
+                wdSelectItem.setUpdateDate(new Date());
+                wdSelectItemService.updateByPrimaryKey(wdSelectItem);
+            }
+        }
+        return new JsonResult();
+    }
+}

+ 174 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/SimpleModuleController.java

@@ -0,0 +1,174 @@
+package com.bk.wd.web.controller.wd;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdBusinessElement;
+import com.bk.wd.model.WdDefaultSimpleModule;
+import com.bk.wd.model.WdDefaultSimpleModuleExample;
+import com.bk.wd.model.WdDefaultSimpleModuleSetting;
+import com.bk.wd.model.WdDefaultSimpleModuleSettingExample;
+import com.bk.wd.service.WdBusinessElementService;
+import com.bk.wd.service.WdDefaultSimpleModuleService;
+import com.bk.wd.service.WdDefaultSimpleModuleSettingService;
+import com.bk.wd.web.base.BaseController;
+
+/**
+ * 模板容器管理
+ * @Project Name:bk-wd-web 
+ * @Date:2017年3月9日下午2:33:22 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/simlpeModule")
+public class SimpleModuleController extends BaseController {
+    
+    @Autowired
+    private WdDefaultSimpleModuleService wdDefaultSimpleModuleService;
+    
+    @Autowired
+    private WdDefaultSimpleModuleSettingService wdDefaultSimpleModuleSettingService;
+    
+    @Autowired
+    private WdBusinessElementService wdBusinessElementService;
+
+    @RequiresPermissions("wd:simlpeModule:view")
+    @RequestMapping(value = {"list", ""})
+    public String list(Model model, String id) {
+        if (StringUtils.isNotEmpty(id)) {
+            WdDefaultSimpleModule wdDefaultSimpleModule = wdDefaultSimpleModuleService.selectByPrimaryKey(id);
+            model.addAttribute("wdDefaultSimpleModule", wdDefaultSimpleModule);
+        }
+        WdDefaultSimpleModuleExample defaultSimpleModuleExample = new WdDefaultSimpleModuleExample();
+        defaultSimpleModuleExample.createCriteria().andDelFlagEqualTo(false);
+        defaultSimpleModuleExample.setOrderByClause("sort");
+        model.addAttribute("list", wdDefaultSimpleModuleService.selectByExample(defaultSimpleModuleExample));
+        return "modules/wd/simlpeModule/simlpeModuleList";
+    }
+
+    @RequiresPermissions("wd:simlpeModule:edit")
+    @RequestMapping(value = "form")
+    public String form(WdDefaultSimpleModule wdDefaultSimpleModule, Model model) {
+        model.addAttribute("wdDefaultsimlpeModule", wdDefaultSimpleModule);
+        return "modules/wd/simlpeModule/simlpeModuleForm";
+    }
+    
+    @RequiresPermissions("wd:simlpeModule:edit")
+    @RequestMapping(value = "save")
+    @ResponseBody
+    public JsonResult save(WdDefaultSimpleModule wdDefaultSimpleModule, Model model) {
+        if (StringUtils.isEmpty(wdDefaultSimpleModule.getId())) {
+            wdDefaultSimpleModule.setId(IdGen.uuid());
+            wdDefaultSimpleModule.setCreateBy(UserUtils.getUser().getId());
+            wdDefaultSimpleModule.setCreateDate(new Date());
+            wdDefaultSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+            wdDefaultSimpleModule.setUpdateDate(new Date());
+            wdDefaultSimpleModuleService.insertSelective(wdDefaultSimpleModule);
+        } else {
+            wdDefaultSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+            wdDefaultSimpleModule.setUpdateDate(new Date());
+            wdDefaultSimpleModuleService.updateByPrimaryKeySelective(wdDefaultSimpleModule);
+        }
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:simlpeModule:edit")
+    @RequestMapping(value = "delete")
+    @ResponseBody
+    public JsonResult delete(WdDefaultSimpleModule wdDefaultSimpleModule) {
+        wdDefaultSimpleModule.setUpdateBy(UserUtils.getUser().getId());
+        wdDefaultSimpleModule.setUpdateDate(new Date());
+        wdDefaultSimpleModule.setDelFlag(true);
+        wdDefaultSimpleModuleService.updateByPrimaryKeySelective(wdDefaultSimpleModule);
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:simlpeModule:view")
+    @RequestMapping(value = "itemList")
+    public String itemList(WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting, String defaultSimpleModuleCode, Model model) {
+        if (org.apache.commons.lang3.StringUtils.isNotEmpty(defaultSimpleModuleCode)) {
+            WdDefaultSimpleModule wdDefaultSimpleModule = wdDefaultSimpleModuleService.selectByCode(defaultSimpleModuleCode);
+            model.addAttribute("wdDefaultSimpleModule", wdDefaultSimpleModule);
+            model.addAttribute("dataList", wdBusinessElementService.selectByModule(wdDefaultSimpleModule.getId()));
+        }
+        return "modules/wd/simlpeModule/simlpeModuleSettingList";
+    }
+    
+    @RequiresPermissions("wd:simlpeModule:edit")
+    @RequestMapping(value = "itemForm")
+    public String form(WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting, String defaultSimpleModuleCode, Model model) {
+        if (null != defaultSimpleModuleCode) {
+            WdDefaultSimpleModule wdDefaultSimpleModule = wdDefaultSimpleModuleService.selectByCode(defaultSimpleModuleCode);
+            model.addAttribute("wdDefaultSimpleModule", wdDefaultSimpleModule);
+            model.addAttribute("elementList", wdBusinessElementService.selectByModule(wdDefaultSimpleModule.getId()));
+        }
+        return "modules/wd/simlpeModule/simlpeModuleSettingForm";
+    }
+    
+    @RequiresPermissions("wd:simlpeModule:edit")
+    @RequestMapping(value = "setItemRequired")
+    @ResponseBody
+    public JsonResult setRequired(WdDefaultSimpleModuleSetting WdDefaultSimpleModuleSetting, Model model) {
+        WdDefaultSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+        WdDefaultSimpleModuleSetting.setUpdateDate(new Date());
+        wdDefaultSimpleModuleSettingService.updateByPrimaryKeySelective(WdDefaultSimpleModuleSetting);
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:simlpeModule:edit")
+    @RequestMapping(value = "saveItem")
+    @ResponseBody
+    public JsonResult saveItem(String newBussinessElementIds, String delBussinessElementIds, String simpleModuleId, Model model) {
+        if (StringUtils.isNotEmpty(delBussinessElementIds)) {
+            List<String> delBussinessElementIdList = Arrays.asList(delBussinessElementIds.split(","));
+            WdDefaultSimpleModuleSettingExample wdDefaultSimpleModuleSettingExample = new WdDefaultSimpleModuleSettingExample();
+            wdDefaultSimpleModuleSettingExample.createCriteria().andDefaultSimpleModuleIdEqualTo(simpleModuleId).andBusinessElementIdIn(delBussinessElementIdList);
+            wdDefaultSimpleModuleSettingService.deleteByExample(wdDefaultSimpleModuleSettingExample);
+        }
+        
+        if (StringUtils.isNotEmpty(newBussinessElementIds)) {
+            List<String> newBussinessElementIdList = Arrays.asList(newBussinessElementIds.split(","));
+            for (String businessElementId : newBussinessElementIdList) {
+                WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting = new WdDefaultSimpleModuleSetting();
+                wdDefaultSimpleModuleSetting.setId(IdGen.uuid());
+                wdDefaultSimpleModuleSetting.setDefaultSimpleModuleId(simpleModuleId);
+                wdDefaultSimpleModuleSetting.setElementName(wdBusinessElementService.selectByPrimaryKey(businessElementId).getName());
+                wdDefaultSimpleModuleSetting.setBusinessElementId(businessElementId);
+                wdDefaultSimpleModuleSetting.setCreateBy(UserUtils.getUser().getId());
+                wdDefaultSimpleModuleSetting.setCreateDate(new Date());
+                wdDefaultSimpleModuleSetting.setUpdateBy(UserUtils.getUser().getId());
+                wdDefaultSimpleModuleSetting.setUpdateDate(new Date());
+                wdDefaultSimpleModuleSettingService.insertSelective(wdDefaultSimpleModuleSetting);
+            }
+        }
+        return new JsonResult();
+    }
+    
+    @RequiresPermissions("wd:simlpeModule:del")
+    @RequestMapping(value = "deleteItem")
+    @ResponseBody
+    public JsonResult deleteItem(String moduleSettingId) {
+        WdDefaultSimpleModuleSetting wdDefaultSimpleModuleSetting = wdDefaultSimpleModuleSettingService.selectByPrimaryKey(moduleSettingId);
+        WdBusinessElement wdBusinessElement = new WdBusinessElement();
+        wdBusinessElement.setId(wdDefaultSimpleModuleSetting.getBusinessElementId());
+        wdBusinessElement.setUpdateBy(UserUtils.getUser().getId());
+        wdBusinessElement.setUpdateDate(new Date());
+        wdBusinessElementService.updateByPrimaryKeySelective(wdBusinessElement);
+        wdDefaultSimpleModuleSettingService.deleteByPrimaryKey(moduleSettingId);
+        return new JsonResult();
+    }
+    
+}

+ 272 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppCreditController.java

@@ -0,0 +1,272 @@
+package com.bk.wd.web.controller.wd.app;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import com.alibaba.fastjson.JSON;
+import com.bk.common.entity.GeneralException;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.service.DfsService;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.model.WdApplication;
+import com.bk.wd.model.WdApplicationCreditInvestigation;
+import com.bk.wd.model.WdProductCreditInvestigation;
+import com.bk.wd.model.WdProductSimpleModule;
+import com.bk.wd.service.WdApplicationCreditInvestigationCommentService;
+import com.bk.wd.service.WdApplicationCreditInvestigationPhotoService;
+import com.bk.wd.service.WdApplicationCreditInvestigationService;
+import com.bk.wd.service.WdApplicationService;
+import com.bk.wd.service.WdProductCreditInvestigationService;
+import com.bk.wd.service.WdProductSimpleModuleService;
+import com.bk.wd.service.WdProductSimpleModuleSettingService;
+import com.bk.wd.util.BusinessConsts;
+import com.bk.wd.util.ProcessHandle4CreditInvestigation;
+
+@Controller
+@RequestMapping(value = "/wd/application/credit")
+public class AppCreditController {
+
+	private static final Logger LOGGER = LoggerFactory.getLogger(AppCreditController.class);
+
+	@Autowired
+	private WdApplicationCreditInvestigationService wdApplicationCreditInvestigationService;
+
+	@Autowired
+	private WdApplicationCreditInvestigationPhotoService wdApplicationCreditInvestigationPhotoService;
+
+	@Autowired
+	private WdApplicationCreditInvestigationCommentService wdApplicationCreditInvestigationCommentService;
+
+	@Autowired
+	private SysUserService userService;
+
+	@Autowired
+	private DfsService dfsService;
+
+	@Autowired
+	private WdApplicationService wdApplicationService;
+
+	@Autowired
+	private WdProductCreditInvestigationService wdProductCreditInvestigationService;
+
+	@Autowired
+	private WdProductSimpleModuleService wdProductSimpleModuleService;
+
+	@Autowired
+	private WdProductSimpleModuleSettingService wdProductSimpleModuleSettingService;
+
+	@Autowired
+	private ProcessHandle4CreditInvestigation processHandle4CreditInvestigation;
+
+	@RequestMapping(value = { "detail" })
+	@RequiresPermissions("wd:application:view")
+	public String detail(String creditId, Model model, String errorMess) {
+		WdApplicationCreditInvestigation wdApplicationCreditInvestigation = wdApplicationCreditInvestigationService.selectByPrimaryKey(creditId);
+		model.addAttribute("wdApplicationCreditInvestigation", wdApplicationCreditInvestigation);
+		model.addAttribute("lastestComment", wdApplicationCreditInvestigationCommentService.selectLastestComment(creditId));
+		if (StringUtils.isNotEmpty(wdApplicationCreditInvestigation.getPersonId())) {
+			model.addAttribute("currentDateResult", wdApplicationCreditInvestigationService.selectCurrentDateResultByPerson(wdApplicationCreditInvestigation.getPersonId()));
+		}
+
+		WdApplication wdApplication = wdApplicationService.selectByPrimaryKey(wdApplicationCreditInvestigation.getApplicationId());
+		WdProductCreditInvestigation wdProductCreditInvestigation = wdProductCreditInvestigationService.selectByProductId(wdApplication.getProductId(), wdApplication.getProductVersion());
+		model.addAttribute("wdProductCreditInvestigation", wdProductCreditInvestigation);
+
+		WdProductSimpleModule wdProductSimpleModule = wdProductSimpleModuleService.selectByVersionAndModuleId(wdApplication.getProductId(), wdApplication.getProductVersion(), BusinessConsts.ModuleID.CreditInvestigationResult);
+		if (null != wdProductSimpleModule) {
+			model.addAttribute("configList", wdProductSimpleModuleSettingService.selectByProductSimpleModuleId(wdProductSimpleModule.getId()));
+		}
+		model.addAttribute("wdApplicationCreditInvestigationPhotoList", wdApplicationCreditInvestigationPhotoService.selectByCreditId(creditId));
+
+		model.addAttribute("errorMess", errorMess);
+		return "modules/wd/application/credit/creditDetail";
+	}
+
+	@RequestMapping(value = { "form" })
+	@RequiresPermissions("wd:application:credit")
+	public String form(String creditId, String taskId, Model model, String errorMess) {
+		WdApplicationCreditInvestigation wdApplicationCreditInvestigation = wdApplicationCreditInvestigationService.selectByPrimaryKey(creditId);
+		model.addAttribute("wdApplicationCreditInvestigation", wdApplicationCreditInvestigation);
+		model.addAttribute("taskId", taskId);
+		model.addAttribute("lastestComment", wdApplicationCreditInvestigationCommentService.selectLastestComment(creditId));
+		if (StringUtils.isNotEmpty(wdApplicationCreditInvestigation.getPersonId())) {
+			model.addAttribute("currentDateResult", wdApplicationCreditInvestigationService.selectCurrentDateResultByPerson(wdApplicationCreditInvestigation.getPersonId()));
+		}
+
+		WdApplication wdApplication = wdApplicationService.selectByPrimaryKey(wdApplicationCreditInvestigation.getApplicationId());
+
+		WdProductCreditInvestigation wdProductCreditInvestigation = wdProductCreditInvestigationService.selectByProductId(wdApplication.getProductId(), wdApplication.getProductVersion());
+		model.addAttribute("wdProductCreditInvestigation", wdProductCreditInvestigation);
+
+		WdProductSimpleModule wdProductSimpleModule = wdProductSimpleModuleService.selectByVersionAndModuleId(wdApplication.getProductId(), wdApplication.getProductVersion(), BusinessConsts.ModuleID.CreditInvestigationResult);
+		if (null != wdProductSimpleModule) {
+			model.addAttribute("configList", wdProductSimpleModuleSettingService.selectByProductSimpleModuleId(wdProductSimpleModule.getId()));
+		}
+
+		model.addAttribute("wdApplicationCreditInvestigationPhotoList", wdApplicationCreditInvestigationPhotoService.selectByCreditId(creditId));
+
+		model.addAttribute("errorMess", errorMess);
+		return "modules/wd/application/credit/creditForm";
+	}
+
+	@RequestMapping(value = { "returnForm" })
+	public String reject(String creditId, String taskId, Model model) {
+		model.addAttribute("creditId", creditId);
+		model.addAttribute("taskId", taskId);
+		return "modules/wd/application/credit/returnForm";
+	}
+
+	@RequestMapping(value = { "cancelForm" })
+	public String cancel(String creditId, String taskId, Model model) {
+		model.addAttribute("creditId", creditId);
+		model.addAttribute("taskId", taskId);
+		return "modules/wd/application/credit/cancelForm";
+	}
+
+	@RequestMapping(value = { "/return" })
+	@ResponseBody
+	public JsonResult taskReturn(String creditId, String reason, String remarks, HttpServletRequest request) {
+		WdApplicationCreditInvestigation creditInvestigation = wdApplicationCreditInvestigationService.selectByPrimaryKey(creditId);
+		if (null == creditInvestigation) {
+			return new JsonResult(false, "请求失败,该征信任务被删除");
+		}
+		if (!"征信查询中".equals(creditInvestigation.getRemarks())) {
+			return new JsonResult(false, "请求失败,该征信任务取消");
+		}
+
+		try {
+			processHandle4CreditInvestigation.back(creditInvestigation, UserUtils.getUser().getId(), reason, remarks);
+		} catch (GeneralException e) {
+			LOGGER.error(e.getMessage(), e);
+		}
+
+		return new JsonResult(creditInvestigation);
+
+	}
+
+	@RequestMapping(value = { "/cancel" })
+	@ResponseBody
+	public JsonResult cancel(String creditId, String reason, String remarks, HttpServletRequest request) {
+		WdApplicationCreditInvestigation creditInvestigation = wdApplicationCreditInvestigationService.selectByPrimaryKey(creditId);
+		if (null == creditInvestigation) {
+			return new JsonResult(false, "请求失败,该征信任务被删除");
+		}
+		if (!"征信查询中".equals(creditInvestigation.getRemarks())) {
+			return new JsonResult(false, "请求失败,该征信任务取消");
+		}
+
+		try {
+			processHandle4CreditInvestigation.cancel(creditInvestigation, UserUtils.getUser().getId(), reason, remarks);
+		} catch (GeneralException e) {
+			LOGGER.error(e.getMessage(), e);
+		}
+
+		return new JsonResult(creditInvestigation);
+
+	}
+
+	@RequiresPermissions("wd:application:credit")
+	@RequestMapping(value = "save")
+	@Transactional
+	public String save(@RequestParam("otherPhotos") CommonsMultipartFile[] otherPhotos, @RequestParam(value = "autoPhoto", required = false) CommonsMultipartFile autoPhoto, WdApplicationCreditInvestigation wdApplicationCreditInvestigation, String taskId, Model model) {
+
+		WdApplicationCreditInvestigation orgCredit = wdApplicationCreditInvestigationService.selectByPrimaryKey(wdApplicationCreditInvestigation.getId());
+
+		String errorMess = "";
+		if (null == orgCredit) {
+			errorMess = "请求失败,该征信任务被删除";
+			try {
+				errorMess = URLEncoder.encode(errorMess, "UTF-8");
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+			return "redirect:/wd/application/credit/detail?errorMess=" + errorMess + "&creditId=" + wdApplicationCreditInvestigation.getId();
+
+			// return new JsonResult(false, "请求失败,该征信任务被删除");
+		}
+		if (!"征信查询中".equals(orgCredit.getRemarks())) {
+			errorMess = "请求失败,该征信任务取消";
+			try {
+				errorMess = URLEncoder.encode(errorMess, "UTF-8");
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+			return "redirect:/wd/application/credit/detail?errorMess=" + errorMess + "&creditId=" + wdApplicationCreditInvestigation.getId();
+			// return new JsonResult(false, "请求失败,该征信任务取消");
+		}
+
+		try {
+			List<String> resultFile = new ArrayList<>();
+			if (otherPhotos != null && otherPhotos.length > 0) {
+				for (int i = 0; i < otherPhotos.length; i++) {
+					CommonsMultipartFile file = otherPhotos[i];
+					if (StringUtils.isNoneBlank(file.getOriginalFilename())) {
+						String fileId = dfsService.uploadFile(file.getBytes(), file.getOriginalFilename());
+						resultFile.add(fileId);
+					}
+				}
+			}
+			orgCredit.setResultFile(JSON.toJSONString(resultFile));
+		} catch (IOException e) {
+			LOGGER.error("图片上传失败", e);
+			errorMess = "征信报告提交失败";
+		}
+
+		orgCredit.setCreditCardRecord(wdApplicationCreditInvestigation.getCreditCardRecord());
+		orgCredit.setLoanRecord(wdApplicationCreditInvestigation.getLoanRecord());
+		orgCredit.setPersonalCreditSystem(wdApplicationCreditInvestigation.getPersonalCreditSystem());
+		orgCredit.setCreditRecord(wdApplicationCreditInvestigation.getCreditRecord());
+		orgCredit.setCreditRecordOurBank(wdApplicationCreditInvestigation.getCreditRecordOurBank());
+		orgCredit.setResult(wdApplicationCreditInvestigation.getResult());
+		if (null != wdApplicationCreditInvestigation.getCreditDetail() && StringUtils.isNotEmpty(wdApplicationCreditInvestigation.getCreditDetail().toString())) {
+			orgCredit.setCreditDetail(wdApplicationCreditInvestigation.getCreditDetail().toString());
+		}
+		orgCredit.setCreditDate(new Date());
+		SysUser creditUser = userService.selectByPrimaryKey(UserUtils.getUser().getId());
+		orgCredit.setCreditBy(creditUser.getId());
+		orgCredit.setCreditByName(creditUser.getName());
+
+		wdApplicationCreditInvestigationService.updateByPrimaryKey(orgCredit);
+
+		// 流程处理
+		try {
+			processHandle4CreditInvestigation.pass(orgCredit, UserUtils.getUser().getId());
+		} catch (GeneralException e) {
+			LOGGER.error(e.getMessage(), e);
+			errorMess = e.getMessage();
+		}
+
+		if (StringUtils.isBlank(errorMess)) {
+			return "redirect:/wd/application/creditList?repage=1";
+		} else {
+			try {
+				errorMess = URLEncoder.encode(errorMess, "UTF-8");
+			} catch (UnsupportedEncodingException e) {
+				e.printStackTrace();
+			}
+			return "redirect:/wd/application/credit/form?errorMess=" + errorMess + "&creditId=" + wdApplicationCreditInvestigation.getId();
+		}
+	}
+
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1148 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppDetaiController.java


+ 689 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppPrintController.java

@@ -0,0 +1,689 @@
+package com.bk.wd.web.controller.wd.app;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.bk.common.entity.GeneralException;
+import com.bk.common.utils.IDCard;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.service.SysOfficeService;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.model.WdApplication;
+import com.bk.wd.model.WdApplicationAssetsBuilding;
+import com.bk.wd.model.WdApplicationBuildingMortgage;
+import com.bk.wd.model.WdApplicationCoborrower;
+import com.bk.wd.model.WdApplicationPerson;
+import com.bk.wd.model.WdApplicationPersonRelation;
+import com.bk.wd.model.WdApplicationRecognizor;
+import com.bk.wd.model.WdApplicationTask;
+import com.bk.wd.model.view.ViewMeeting;
+import com.bk.wd.model.view.ViewMortgage;
+import com.bk.wd.model.view.ViewPerson;
+import com.bk.wd.model.view.ViewResolution;
+import com.bk.wd.model.view.ViewReviewReport;
+import com.bk.wd.service.WdApplicationAssetsBuildingService;
+import com.bk.wd.service.WdApplicationBuildingMortgageService;
+import com.bk.wd.service.WdApplicationCoborrowerService;
+import com.bk.wd.service.WdApplicationPersonRelationService;
+import com.bk.wd.service.WdApplicationPersonService;
+import com.bk.wd.service.WdApplicationRecognizorService;
+import com.bk.wd.service.WdApplicationService;
+import com.bk.wd.service.WdApplicationTaskService;
+import com.bk.wd.util.BusinessConsts;
+import com.bk.wd.util.DataUtils;
+import com.bk.wd.web.utils.WordGenerator;
+
+@Controller
+@RequestMapping(value = "/wd/application/print")
+public class AppPrintController {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(AppCreditController.class);
+
+    @Autowired
+    private SysUserService sysUserService;
+    @Autowired
+    private SysOfficeService sysOfficeService;
+    @Autowired
+    private WdApplicationTaskService wdApplicationTaskService;
+    @Autowired
+    private WdApplicationService wdApplicationService;
+    @Autowired
+    private WdApplicationPersonService wdApplicationPersonService;
+    @Autowired
+    private WdApplicationCoborrowerService wdApplicationCoborrowerService;
+    @Autowired
+    private WdApplicationPersonRelationService wdApplicationPersonRelationService;
+    @Autowired
+    private WdApplicationAssetsBuildingService wdApplicationAssetsBuildingService;
+    @Autowired
+    private WdApplicationBuildingMortgageService wdApplicationBuildingMortgageService;
+    @Autowired
+    private WdApplicationRecognizorService wdApplicationRecognizorService;
+
+    /**
+     * 打印预览
+     * @param applicationId
+     * @return
+     */
+    @RequestMapping(value = { "printPreview" })
+    public String printPreview(Model model, String applicationId) {
+        model.addAttribute("applicationId", applicationId);
+        return "modules/wd/application/print/print_preview";
+    }
+
+    /**
+     * 决议表 - 镇江
+     * @param applicationId 申请id
+     * @return
+     */
+    @RequestMapping(value = { "resolution" })
+    public String resolution(Model model, String applicationId) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+        model.addAttribute("resolution", resultMaps.get("resolution"));
+        model.addAttribute("approvedInfoRowSpan", resultMaps.get("approvedInfoRowSpan"));
+        model.addAttribute("applicationId", applicationId);
+        return "modules/wd/application/print/resolution_zhenjiang";
+    }
+
+    @RequestMapping(value = { "resolutionWordExport" })
+    public void resolutionWordExport(Model model, String applicationId, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/msword");
+
+        // 否则Freemarker的模板殷勤在处理时可能会因为找不到值而报错 这里暂时忽略这个步骤了
+        File file = WordGenerator.createDoc("resolution_zhenjiang", resultMaps);
+        try (ServletOutputStream outputStream = response.getOutputStream(); InputStream fin = new FileInputStream(file);) {
+            response.addHeader("Content-Disposition", "attachment;filename=" + new String("贷审会决议表".getBytes(), "iso-8859-1") + ".doc");
+            byte[] buffer = new byte[512]; // 缓冲区
+            int bytesToRead = -1;
+            // 通过循环将读入的Word文件的内容输出到浏览器中
+            while ((bytesToRead = fin.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, bytesToRead);
+            }
+        } catch (IOException e) {
+            LOGGER.error(e.getMessage(), e);
+        } finally {
+            if (file != null)
+                file.delete(); // 删除临时文件
+        }
+    }
+
+    /**
+     * 大石桥决议表
+     * @param applicationId 申请id
+     * @return
+     */
+    @RequestMapping(value = { "resolutionDashiqiao" })
+    public String resolutionDashiqiao(Model model, String applicationId) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+        model.addAttribute("resolution", resultMaps.get("resolution"));
+        model.addAttribute("approvedInfoRowSpan", resultMaps.get("approvedInfoRowSpan"));
+        model.addAttribute("applicationId", applicationId);
+        return "modules/wd/application/print/resolution_dashiqiao";
+    }
+    
+    /**
+     * 决议表 - 洛阳
+     * @param applicationId 申请id
+     * @return
+     */
+    @RequestMapping(value = { "resolutionLuoyang" })
+    public String resolutionLuoyang(Model model, String applicationId) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+        model.addAttribute("resolution", resultMaps.get("resolution"));
+        model.addAttribute("approvedInfoRowSpan", resultMaps.get("approvedInfoRowSpan"));
+        model.addAttribute("applicationId", applicationId);
+        return "modules/wd/application/print/resolution_luoyang";
+    }
+
+    /**
+     * 决议表-- 罗山
+     * @param applicationId
+     * @return
+     */
+    @RequestMapping(value = { "resolutionLuosan" })
+    public String resolutionLuosan(Model model, String applicationId) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+        model.addAttribute("resolution", resultMaps.get("resolution"));
+        model.addAttribute("approvedInfoRowSpan", resultMaps.get("approvedInfoRowSpan"));
+        model.addAttribute("applicationId", applicationId);
+        return "modules/wd/application/print/resolution_luoshan";
+    }
+
+    @RequestMapping(value = { "resolutionLuosanWordExport" })
+    public void resolutionLuosanWordExport(Model model, String applicationId, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/msword");
+
+        // 否则Freemarker的模板殷勤在处理时可能会因为找不到值而报错 这里暂时忽略这个步骤了
+        File file = WordGenerator.createDoc("resolution_luoshan", resultMaps);
+        try (ServletOutputStream outputStream = response.getOutputStream(); InputStream fin = new FileInputStream(file);) {
+            response.addHeader("Content-Disposition", "attachment;filename=" + new String("贷审会决议表".getBytes(), "iso-8859-1") + ".doc");
+            byte[] buffer = new byte[512]; // 缓冲区
+            int bytesToRead = -1;
+            // 通过循环将读入的Word文件的内容输出到浏览器中
+            while ((bytesToRead = fin.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, bytesToRead);
+            }
+        } catch (IOException e) {
+            LOGGER.error(e.getMessage(), e);
+        } finally {
+            if (file != null)
+                file.delete(); // 删除临时文件
+        }
+    }
+
+    /**
+     * 决议表-- 宣化
+     * @param applicationId
+     * @return
+     */
+    @RequestMapping(value = { "resolutionXuanhua" })
+    public String resolutionXuanhua(Model model, String applicationId) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+        model.addAttribute("resolution", resultMaps.get("resolution"));
+        model.addAttribute("approvedInfoRowSpan", resultMaps.get("approvedInfoRowSpan"));
+        model.addAttribute("applicationId", applicationId);
+        return "modules/wd/application/print/resolution_xuanhua";
+    }
+
+    @RequestMapping(value = { "resolutionXuanhuaWordExport" })
+    public void resolutionXuanhuaWordExport(Model model, String applicationId, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/msword");
+
+        // 否则Freemarker的模板殷勤在处理时可能会因为找不到值而报错 这里暂时忽略这个步骤了
+        File file = WordGenerator.createDoc("resolution_xuanhua", resultMaps);
+        try (ServletOutputStream outputStream = response.getOutputStream(); InputStream fin = new FileInputStream(file);) {
+            response.addHeader("Content-Disposition", "attachment;filename=" + new String("贷审会决议表".getBytes(), "iso-8859-1") + ".doc");
+            byte[] buffer = new byte[512]; // 缓冲区
+            int bytesToRead = -1;
+            // 通过循环将读入的Word文件的内容输出到浏览器中
+            while ((bytesToRead = fin.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, bytesToRead);
+            }
+        } catch (IOException e) {
+            LOGGER.error(e.getMessage(), e);
+        } finally {
+            if (file != null)
+                file.delete(); // 删除临时文件
+        }
+    }
+
+    /**
+     * 决议表-- 清远
+     * @param applicationId
+     * @return
+     */
+    @RequestMapping(value = { "resolutionQingyuan" })
+    public String resolutionQingyuan(Model model, String applicationId) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+        model.addAttribute("resolution", resultMaps.get("resolution"));
+        model.addAttribute("approvedInfoRowSpan", resultMaps.get("approvedInfoRowSpan"));
+        model.addAttribute("customerManagerCommentRowSpan", resultMaps.get("customerManagerCommentRowSpan"));
+        model.addAttribute("applicationId", applicationId);
+
+        return "modules/wd/application/print/resolution_qingyuan";
+    }
+
+    @RequestMapping(value = { "resolutionQingyuanWordExport" })
+    public void resolutionQingyuanWordExport(Model model, String applicationId, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> resultMaps = getResolutionInfo(applicationId);
+
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/msword");
+
+        // 否则Freemarker的模板殷勤在处理时可能会因为找不到值而报错 这里暂时忽略这个步骤了
+        File file = WordGenerator.createDoc("resolution_qingyuan", resultMaps);
+        try (ServletOutputStream outputStream = response.getOutputStream(); InputStream fin = new FileInputStream(file);) {
+            response.addHeader("Content-Disposition", "attachment;filename=" + new String("贷审会决议表".getBytes(), "iso-8859-1") + ".doc");
+            byte[] buffer = new byte[512]; // 缓冲区
+            int bytesToRead = -1;
+            // 通过循环将读入的Word文件的内容输出到浏览器中
+            while ((bytesToRead = fin.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, bytesToRead);
+            }
+        } catch (IOException e) {
+            LOGGER.error(e.getMessage(), e);
+        } finally {
+            if (file != null)
+                file.delete(); // 删除临时文件
+        }
+    }
+
+    private Map<String, Object> getResolutionInfo(String applicationId) {
+        ViewResolution resolution = new ViewResolution();
+
+        WdApplication application = wdApplicationService.selectByPrimaryKey(applicationId);
+        WdApplicationPerson person = wdApplicationPersonService.selectByApplicationId(applicationId);
+
+        SysUser loanOfficer = sysUserService.selectByPrimaryKey(application.getCreateBy());
+        SysOffice loanOfficerOffice = sysOfficeService.selectByPrimaryKey(loanOfficer.getOfficeId());
+
+        resolution.setPost(loanOfficerOffice.getName());
+        resolution.setLoanOfficer(loanOfficer.getName());
+        resolution.setContractNo(application.getContractCode());
+        resolution.setApplicationNo(application.getCode());
+        resolution.setBorrower(DataUtils.getValueAsString(person.getJsonData(), "base_info_name"));
+        resolution.setBorrowerIdCardNo(DataUtils.getValueAsString(person.getJsonData(), "base_info_idcard"));
+        resolution.setAccountantSubject(DataUtils.getValueAsString(person.getJsonData(), "base_info_accountant_subject"));
+
+        resolution.setProduct(application.getProductName());
+        String amount = DataUtils.getValueAsString(application.getApplyInfoJson(), "loan_check_fund");
+        if (StringUtils.isNotBlank(amount)) {
+            resolution.setApplyAmount(new BigDecimal(amount));
+        }
+        resolution.setApplyLimit(DataUtils.getValueAsString(application.getApplyInfoJson(), "apply_limit"));
+
+        amount = DataUtils.getValueAsString(application.getAuditConclusionJson(), "loan_check_fund");
+        if (StringUtils.isNotBlank(amount)) {
+            resolution.setLoanOfficerAmount(new BigDecimal(amount));
+        }
+        resolution.setLoanOfficerLimit(DataUtils.getValueAsString(application.getAuditConclusionJson(), "survey_limit"));
+        resolution.setLoanOfficerRate(DataUtils.getValueAsString(application.getAuditConclusionJson(), "loan_check_interest_rate"));
+        resolution.setLoanOfficerRepayment(DataUtils.getValueAsString(application.getAuditConclusionJson(), "loan_check_repayment_category"));
+        resolution.setLoanOfficerGuaranteeCategory(DataUtils.getValueAsString(application.getAuditConclusionJson(), "loan_check_guarantee_category"));
+
+        List<ViewPerson> borrowers = new ArrayList<>();
+        ViewPerson borrower = new ViewPerson();
+        borrower.setName(DataUtils.getValueAsString(person.getJsonData(), "base_info_name"));
+        borrower.setIdCardNo(DataUtils.getValueAsString(person.getJsonData(), "base_info_idcard"));
+        borrowers.add(borrower);
+        resolution.setBorrowers(borrowers);
+
+        List<ViewPerson> coborrowers = new ArrayList<>();
+        List<WdApplicationCoborrower> applicationCoborrowers = wdApplicationCoborrowerService.selectByApplicationId(applicationId);
+        for (WdApplicationCoborrower wdApplicationCoborrower : applicationCoborrowers) {
+            WdApplicationPersonRelation coborrowerInfo = wdApplicationPersonRelationService.selectByApplicationIdAndOriginalId(applicationId, wdApplicationCoborrower.getOriginalId());
+            ViewPerson coborrower = new ViewPerson();
+            coborrower.setName(DataUtils.getValueAsString(coborrowerInfo.getJsonData(), "base_info_name"));
+            coborrower.setIdCardNo(DataUtils.getValueAsString(coborrowerInfo.getJsonData(), "base_info_idcard"));
+            coborrowers.add(coborrower);
+        }
+        resolution.setCoborrowers(coborrowers);
+
+        List<ViewPerson> recognizors = new ArrayList<>();
+        List<WdApplicationRecognizor> applicationRecognizors = wdApplicationRecognizorService.selectByApplicationId(applicationId);
+        for (WdApplicationRecognizor wdApplicationRecognizor : applicationRecognizors) {
+            WdApplicationPersonRelation recognizorInfo = wdApplicationPersonRelationService.selectByApplicationIdAndOriginalId(applicationId, wdApplicationRecognizor.getOriginalId());
+            ViewPerson recognizor = new ViewPerson();
+            recognizor.setName(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_name"));
+            recognizor.setIdCardNo(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_idcard"));
+            recognizors.add(recognizor);
+        }
+        resolution.setRecognizors(recognizors);
+
+        amount = DataUtils.getValueAsString(application.getFinalConclusionJson(), "loan_check_fund");
+        if (StringUtils.isNotBlank(amount)) {
+            resolution.setFinalAmount(new BigDecimal(amount));
+        }
+        String finalLimit = DataUtils.getValueAsString(application.getFinalConclusionJson(), "overlimit_limit");
+        if (StringUtils.isBlank(finalLimit)) {
+            finalLimit = DataUtils.getValueAsString(application.getFinalConclusionJson(), "risk_limit");
+        }
+        resolution.setFinalLimit(finalLimit);
+        resolution.setFinalRate(DataUtils.getValueAsString(application.getFinalConclusionJson(), "loan_check_interest_rate"));
+        resolution.setFinalRepayment(DataUtils.getValueAsString(application.getFinalConclusionJson(), "loan_check_repayment_category"));
+
+        BigDecimal totalMortgages = new BigDecimal(0);
+        List<ViewMortgage> mortgages = new ArrayList<>();
+        List<WdApplicationBuildingMortgage> applicationBuildingMortgages = wdApplicationBuildingMortgageService.selectByApplicationId(applicationId);
+        for (WdApplicationBuildingMortgage wdApplicationBuildingMortgage : applicationBuildingMortgages) {
+            WdApplicationAssetsBuilding mortgageInfo = wdApplicationAssetsBuildingService.selectByApplicationIdAndOriginalId(applicationId, wdApplicationBuildingMortgage.getOriginalId());
+            ViewMortgage mortgage = new ViewMortgage();
+            mortgage.setCategory("房产");
+            String buildingOwners = "";
+            for (Map<String, Object> ownerData : mortgageInfo.getOwnerData()) {
+                buildingOwners += ("," + ownerData.get("name").toString());
+            }
+            while (buildingOwners.startsWith(",")) {
+                buildingOwners = buildingOwners.substring(1);
+            }
+            mortgage.setOwner(buildingOwners == "" ? wdApplicationBuildingMortgage.getPersonName() : buildingOwners);
+            mortgage.setAddress(DataUtils.getValueAsString(mortgageInfo.getJsonData(), "assets_building_street"));
+            mortgage.setValuation(DataUtils.getValueAsString(mortgageInfo.getJsonData(), "assets_building_worth"));
+            mortgage.setAppraisalAgency(DataUtils.getValueAsString(mortgageInfo.getJsonData(), "assets_building_appraisal_agency"));
+            mortgage.setLicense(DataUtils.getValueAsString(mortgageInfo.getJsonData(), "assets_building_license"));
+
+            BigDecimal worthDecimal = new BigDecimal(0);
+            amount = DataUtils.getValueAsString(mortgageInfo.getJsonData(), "assets_building_worth");
+            if (StringUtils.isNotBlank(amount)) {
+                worthDecimal = new BigDecimal(amount);
+            }
+            totalMortgages = totalMortgages.add(worthDecimal);
+
+            if (worthDecimal.compareTo(new BigDecimal(0)) > 0) {
+                mortgage.setDiyalv1(resolution.getApplyAmount().multiply(new BigDecimal(100)).divide(worthDecimal, 2, BigDecimal.ROUND_HALF_UP));
+                mortgage.setDiyalv2(resolution.getFinalAmount().multiply(new BigDecimal(100)).divide(worthDecimal, 2, BigDecimal.ROUND_HALF_UP));
+            }
+            mortgages.add(mortgage);
+        }
+        resolution.setMortgages(mortgages);
+
+        resolution.setTotalMortgages(totalMortgages);
+        if (totalMortgages.compareTo(new BigDecimal(0)) > 0) {
+            resolution.setDiyalv1(resolution.getApplyAmount().multiply(new BigDecimal(100)).divide(totalMortgages, 2, BigDecimal.ROUND_HALF_UP));
+            resolution.setDiyalv2(resolution.getFinalAmount().multiply(new BigDecimal(100)).divide(totalMortgages, 2, BigDecimal.ROUND_HALF_UP));
+        }
+
+        resolution.setUse(DataUtils.getValueAsString(application.getApplyInfoJson(), "apply_use"));
+
+        String loanCondition = DataUtils.getValueAsString(application.getFinalConclusionJson(), "overlimit_terms_of_loan");
+        if (StringUtils.isBlank(loanCondition)) {
+            loanCondition = DataUtils.getValueAsString(application.getFinalConclusionJson(), "risk_terms_of_loan");
+        }
+        resolution.setLoanCondition(loanCondition);
+
+        String monitoringCondition = DataUtils.getValueAsString(application.getFinalConclusionJson(), "overlimit_monitoring");
+        if (StringUtils.isBlank(monitoringCondition)) {
+            monitoringCondition = DataUtils.getValueAsString(application.getFinalConclusionJson(), "risk_monitoring");
+        }
+        resolution.setMonitoringCondition(monitoringCondition);
+
+        // 备注,审批人,审批结果日期
+        Date lastestApprovedDate = application.getCreateDate();
+        String lastestApprovedRemark = "";
+        String approvedMangers = "";
+        WdApplicationTask task = wdApplicationTaskService.selectLastestDoneTaskByApplicationIdAndStatus(applicationId, BusinessConsts.Activity.TableReview);
+        if (null != task) {
+            approvedMangers += ("," + task.getDonerName());
+
+            lastestApprovedDate = task.getDoneDate();
+            lastestApprovedRemark = task.getComment();
+        }
+        task = wdApplicationTaskService.selectLastestDoneTaskByApplicationIdAndStatus(applicationId, BusinessConsts.Activity.OfflineReview);
+        if (null != task) {
+            approvedMangers += ("," + task.getDonerName());
+            if (task.getDoneDate().after(lastestApprovedDate)) {
+                lastestApprovedDate = task.getDoneDate();
+                lastestApprovedRemark = task.getComment();
+            }
+
+            resolution.setZhiliaoComment(task.getComment());
+        }
+        task = wdApplicationTaskService.selectLastestDoneTaskByApplicationIdAndStatus(applicationId, BusinessConsts.Activity.RiskControl);
+        if (null != task) {
+            approvedMangers += ("," + task.getDonerName());
+            if (task.getDoneDate().after(lastestApprovedDate)) {
+                lastestApprovedDate = task.getDoneDate();
+                lastestApprovedRemark = task.getComment();
+            }
+        }
+        task = wdApplicationTaskService.selectLastestDoneTaskByApplicationIdAndStatus(applicationId, BusinessConsts.Activity.ExtendReview);
+        if (null != task) {
+            approvedMangers += ("," + task.getDonerName());
+            if (task.getDoneDate().after(lastestApprovedDate)) {
+                lastestApprovedDate = task.getDoneDate();
+                lastestApprovedRemark = task.getComment();
+            }
+        }
+
+        if (approvedMangers.length() > 0) {
+            approvedMangers = approvedMangers.substring(1);
+        }
+
+        resolution.setRemark(lastestApprovedRemark);
+        resolution.setApprovedDate(lastestApprovedDate);
+        resolution.setManagers(approvedMangers);
+
+        int approvedInfoRowSpan = 0;
+        approvedInfoRowSpan += (resolution.getBorrowers().size() == 0 ? 2 : (resolution.getBorrowers().size() + 1));
+        approvedInfoRowSpan += (resolution.getCoborrowers().size() == 0 ? 1 : resolution.getCoborrowers().size());
+        approvedInfoRowSpan += (resolution.getRecognizors().size() == 0 ? 1 : resolution.getRecognizors().size());
+        approvedInfoRowSpan += (resolution.getMortgages().size() == 0 ? 2 : (resolution.getMortgages().size() + 1));
+
+        int customerManagerCommentRowSpan = 0;
+        customerManagerCommentRowSpan += (resolution.getMortgages().size() == 0 ? 2 : (resolution.getMortgages().size() + 1));
+
+        Map<String, Object> resultMap = new HashMap<>();
+        resultMap.put("resolution", resolution);
+        resultMap.put("applicationId", applicationId);
+        resultMap.put("approvedInfoRowSpan", approvedInfoRowSpan);
+        resultMap.put("customerManagerCommentRowSpan", customerManagerCommentRowSpan);
+        return resultMap;
+    }
+
+    @RequestMapping(value = { "review_report" })
+    public String reviewReport(Model model, String applicationId) {
+        model.addAttribute("reviewReport", getReviewReportInfo(applicationId));
+        model.addAttribute("applicationId", applicationId);
+        return "modules/wd/application/print/review_report_luoshan";
+    }
+
+    @RequestMapping(value = { "review_report_excel_export" })
+    public void reviewReportExcelExport(Model model, String applicationId, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> resultMaps = new HashMap<>();
+        resultMaps.put("reviewReport", getReviewReportInfo(applicationId));
+
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/msword");
+
+        // 否则Freemarker的模板殷勤在处理时可能会因为找不到值而报错 这里暂时忽略这个步骤了
+        File file = WordGenerator.createDoc("review_report_luoshan", resultMaps);
+        try (ServletOutputStream outputStream = response.getOutputStream(); InputStream fin = new FileInputStream(file);) {
+            response.addHeader("Content-Disposition", "attachment;filename=" + new String("罗山农商银行小微贷中心贷款审查报告".getBytes(), "iso-8859-1") + ".doc");
+            byte[] buffer = new byte[512]; // 缓冲区
+            int bytesToRead = -1;
+            // 通过循环将读入的Word文件的内容输出到浏览器中
+            while ((bytesToRead = fin.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, bytesToRead);
+            }
+        } catch (IOException e) {
+            LOGGER.error(e.getMessage(), e);
+        } finally {
+            if (file != null)
+                file.delete(); // 删除临时文件
+        }
+    }
+
+    private ViewReviewReport getReviewReportInfo(String applicationId) {
+        ViewReviewReport report = new ViewReviewReport();
+
+        WdApplication application = wdApplicationService.selectByPrimaryKey(applicationId);
+        WdApplicationPerson person = wdApplicationPersonService.selectByApplicationId(applicationId);
+
+        report.setApplyAmount(new BigDecimal(DataUtils.getValueAsString(application.getApplyInfoJson(), "loan_check_fund")));
+        report.setApplyLimit(DataUtils.getValueAsString(application.getApplyInfoJson(), "apply_limit"));
+        report.setApplyRate(DataUtils.getValueAsString(application.getApplyInfoJson(), "loan_check_interest_rate"));
+        report.setApplyRepayment(DataUtils.getValueAsString(application.getApplyInfoJson(), "loan_check_repayment_category"));
+        report.setGuaranteeMode(DataUtils.getValueAsString(application.getApplyInfoJson(), "loan_check_guarantee_category"));
+
+        report.setUse(DataUtils.getValueAsString(application.getApplyInfoJson(), "apply_use"));
+
+        List<ViewPerson> recognizors = new ArrayList<>();
+        List<WdApplicationRecognizor> applicationRecognizors = wdApplicationRecognizorService.selectByApplicationId(applicationId);
+        for (WdApplicationRecognizor wdApplicationRecognizor : applicationRecognizors) {
+            WdApplicationPersonRelation recognizorInfo = wdApplicationPersonRelationService.selectByApplicationIdAndOriginalId(applicationId, wdApplicationRecognizor.getOriginalId());
+            ViewPerson recognizor = new ViewPerson();
+            recognizor.setName(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_name"));
+            recognizor.setIdCardNo(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_idcard"));
+            recognizor.setGender(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_gender"));
+            try {
+                IDCard.IDCardValidate(recognizor.getIdCardNo());
+                recognizor.setAge(IDCard.IdNOToAge(recognizor.getIdCardNo()));
+            } catch (ParseException | GeneralException e) {
+                recognizor.setAge(null);
+            }
+            recognizor.setPost(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_position"));
+            recognizor.setMarriage(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_marriage"));
+            recognizor.setCensus(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_native_place"));
+            recognizor.setAddress(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_home_addr"));
+
+            recognizors.add(recognizor);
+        }
+        report.setRecognizors(recognizors);
+
+        ViewPerson borrower = new ViewPerson();
+        borrower.setName(DataUtils.getValueAsString(person.getJsonData(), "base_info_name"));
+        borrower.setIdCardNo(DataUtils.getValueAsString(person.getJsonData(), "base_info_idcard"));
+        borrower.setGender(DataUtils.getValueAsString(person.getJsonData(), "base_info_gender"));
+        try {
+            IDCard.IDCardValidate(borrower.getIdCardNo());
+            borrower.setAge(IDCard.IdNOToAge(borrower.getIdCardNo()));
+        } catch (ParseException | GeneralException e) {
+            borrower.setAge(null);
+        }
+        borrower.setPost(DataUtils.getValueAsString(person.getJsonData(), "base_info_position"));
+        borrower.setMarriage(DataUtils.getValueAsString(person.getJsonData(), "base_info_marriage"));
+        borrower.setCensus(DataUtils.getValueAsString(person.getJsonData(), "base_info_native_place"));
+        borrower.setAddress(DataUtils.getValueAsString(person.getJsonData(), "base_info_home_addr"));
+        report.setBorrower(borrower);
+        return report;
+    }
+
+    /**
+     * 会议记录-罗山 date: 2017年8月7日 下午4:30:19 <br/>
+     * @author Liam
+     * @param model
+     * @param applicationId
+     * @return
+     * @since JDK 1.8
+     */
+    @RequestMapping(value = { "meeting" })
+    public String meeting(Model model, String applicationId) {
+        model.addAttribute("applicationId", applicationId);
+        model.addAttribute("meeting", getMettingInfo(applicationId));
+        return "modules/wd/application/print/meeting_luoshan";
+    }
+
+    @RequestMapping(value = { "meetingLuoshanExport" })
+    public void meetingLuoshanExport(Model model, String applicationId, HttpServletRequest request, HttpServletResponse response) {
+        Map<String, Object> resultMaps = new HashMap<>();
+        resultMaps.put("meeting", getMettingInfo(applicationId));
+
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/msword");
+
+        // 否则Freemarker的模板殷勤在处理时可能会因为找不到值而报错 这里暂时忽略这个步骤了
+        File file = WordGenerator.createDoc("meeting_luoshan", resultMaps);
+        try (ServletOutputStream outputStream = response.getOutputStream(); InputStream fin = new FileInputStream(file);) {
+            response.addHeader("Content-Disposition", "attachment;filename=" + new String("罗山农商银行小微贷中心会议记录".getBytes(), "iso-8859-1") + ".doc");
+            byte[] buffer = new byte[512]; // 缓冲区
+            int bytesToRead = -1;
+            // 通过循环将读入的Word文件的内容输出到浏览器中
+            while ((bytesToRead = fin.read(buffer)) != -1) {
+                outputStream.write(buffer, 0, bytesToRead);
+            }
+        } catch (IOException e) {
+            LOGGER.error(e.getMessage(), e);
+        } finally {
+            if (file != null)
+                file.delete(); // 删除临时文件
+        }
+    }
+
+    private ViewMeeting getMettingInfo(String applicationId) {
+        ViewMeeting meeting = new ViewMeeting();
+
+        WdApplication application = wdApplicationService.selectByPrimaryKey(applicationId);
+        WdApplicationPerson person = wdApplicationPersonService.selectByApplicationId(applicationId);
+
+        SysUser loanOfficer = sysUserService.selectByPrimaryKey(application.getCreateBy());
+
+        meeting.setLoanOfficer(loanOfficer.getName());
+
+        meeting.setApplyAmount(new BigDecimal(DataUtils.getValueAsString(application.getApplyInfoJson(), "loan_check_fund")));
+        meeting.setApplyLimit(DataUtils.getValueAsString(application.getApplyInfoJson(), "apply_limit"));
+        meeting.setApplyRate(DataUtils.getValueAsString(application.getApplyInfoJson(), "loan_check_interest_rate"));
+        meeting.setApplyRepayment(DataUtils.getValueAsString(application.getApplyInfoJson(), "loan_check_repayment_category"));
+
+        meeting.setUse(DataUtils.getValueAsString(application.getApplyInfoJson(), "apply_use"));
+
+        meeting.setFamilyNum(DataUtils.getValueAsString(application.getApplyInfoJson(), "extend_family_members"));
+        meeting.setFosterNum(DataUtils.getValueAsString(application.getApplyInfoJson(), "extend_foster_count"));
+
+        List<ViewPerson> recognizors = new ArrayList<>();
+        List<WdApplicationRecognizor> applicationRecognizors = wdApplicationRecognizorService.selectByApplicationId(applicationId);
+        for (WdApplicationRecognizor wdApplicationRecognizor : applicationRecognizors) {
+            WdApplicationPersonRelation recognizorInfo = wdApplicationPersonRelationService.selectByApplicationIdAndOriginalId(applicationId, wdApplicationRecognizor.getOriginalId());
+            ViewPerson recognizor = new ViewPerson();
+            recognizor.setName(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_name"));
+            recognizor.setIdCardNo(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_idcard"));
+            recognizor.setGender(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_gender"));
+            try {
+                IDCard.IDCardValidate(recognizor.getIdCardNo());
+                recognizor.setAge(IDCard.IdNOToAge(recognizor.getIdCardNo()));
+            } catch (ParseException | GeneralException e) {
+                recognizor.setAge(null);
+            }
+            recognizor.setPost(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_position"));
+            recognizor.setMarriage(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_marriage"));
+            recognizor.setCensus(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_native_place"));
+            recognizor.setAddress(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_home_addr"));
+
+            recognizor.setShopAddr(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_shop_addr"));
+            recognizor.setShopName(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_shop_name"));
+            recognizor.setCompanyName(DataUtils.getValueAsString(recognizorInfo.getJsonData(), "base_info_company_name"));
+
+            recognizors.add(recognizor);
+        }
+        meeting.setRecognizors(recognizors);
+
+        ViewPerson borrower = new ViewPerson();
+        borrower.setName(DataUtils.getValueAsString(person.getJsonData(), "base_info_name"));
+        borrower.setIdCardNo(DataUtils.getValueAsString(person.getJsonData(), "base_info_idcard"));
+        borrower.setGender(DataUtils.getValueAsString(person.getJsonData(), "base_info_gender"));
+        try {
+            IDCard.IDCardValidate(borrower.getIdCardNo());
+            borrower.setAge(IDCard.IdNOToAge(borrower.getIdCardNo()));
+        } catch (ParseException | GeneralException e) {
+            borrower.setAge(null);
+        }
+        borrower.setPost(DataUtils.getValueAsString(person.getJsonData(), "base_info_position"));
+        borrower.setMarriage(DataUtils.getValueAsString(person.getJsonData(), "base_info_marriage"));
+        borrower.setCensus(DataUtils.getValueAsString(person.getJsonData(), "base_info_native_place"));
+        borrower.setAddress(DataUtils.getValueAsString(person.getJsonData(), "base_info_home_addr"));
+        borrower.setShopAddr(DataUtils.getValueAsString(person.getJsonData(), "base_info_shop_addr"));
+        borrower.setShopName(DataUtils.getValueAsString(person.getJsonData(), "base_info_shop_name"));
+        borrower.setCompanyName(DataUtils.getValueAsString(person.getJsonData(), "base_info_company_name"));
+
+        meeting.setBorrower(borrower);
+
+        List<WdApplicationPersonRelation> spouses = wdApplicationPersonRelationService.selectByApplicationIdAndType(applicationId, "配偶");
+        if (spouses.isEmpty()) {
+            meeting.setSpouse(null);
+        } else {
+            ViewPerson spouse = new ViewPerson();
+            spouse.setName(DataUtils.getValueAsString(spouses.get(0).getJsonData(), "base_info_name"));
+            spouse.setIdCardNo(DataUtils.getValueAsString(spouses.get(0).getJsonData(), "base_info_idcard"));
+            meeting.setSpouse(spouse);
+        }
+        return meeting;
+    }
+    
+    @RequestMapping(value = { "printIdcard" })
+    public String printIdcard(Model model, String idcard1, String idcard2) {
+        model.addAttribute("idcard1", idcard1);
+        model.addAttribute("idcard2", idcard2);
+        return "modules/wd/application/print/print_idcard";
+    }
+
+}

+ 88 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppReviewController.java

@@ -0,0 +1,88 @@
+package com.bk.wd.web.controller.wd.app;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.GeneralException;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.util.BusinessConsts.Action;
+import com.bk.wd.util.process.EngineHandler;
+import com.bk.wd.model.WdApplication;
+import com.bk.wd.model.WdApplicationTask;
+import com.bk.wd.service.WdApplicationService;
+import com.bk.wd.service.WdApplicationTaskService;
+import com.bk.wd.util.ProcessHandle;
+
+@Controller
+@RequestMapping(value = "/wd/application/review")
+public class AppReviewController {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(AppReviewController.class);
+
+    @Autowired
+    private WdApplicationService wdApplicationService;
+
+    @Autowired
+    private WdApplicationTaskService taskService;
+
+    @Autowired
+    private ProcessHandle processHandle;
+
+    @Autowired
+    private EngineHandler processEngine;
+
+    /**
+     * 申請單分配 date: 2017年5月8日 下午7:53:35 <br/>
+     * @author Liam
+     * @param model
+     * @param request
+     * @param taskId
+     * @param userId
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:assignment")
+    @RequestMapping(value = { "assignment" })
+    @ResponseBody
+    public JsonResult assignment(Model model, HttpServletRequest request, String taskId, String userId) {
+
+        WdApplicationTask task = taskService.selectByPrimaryKey(taskId);
+        WdApplication application = wdApplicationService.selectByPrimaryKey(task.getApplicationId());
+
+        if (StringUtils.isBlank(application.getName())) {
+            try {
+                processHandle.dealTask(taskId, Action.Submit, userId, null, null, UserUtils.getUser().getId(), false);
+            } catch (GeneralException e) {
+                LOGGER.error("分配错误", e);
+                return new JsonResult(e.getMessage());
+            }
+        } else {
+            Map<String, Object> variables = new HashMap<>();
+            variables.put("owner", userId);
+
+            try {
+                processEngine.setInstanceVariable(application.getName(), variables, UserUtils.getUser().getId());
+                processEngine.dealTask(taskId, Action.Submit, UserUtils.getUser().getId());
+
+            } catch (GeneralException e) {
+                LOGGER.error("分配错误", e);
+                return new JsonResult(e.getMessage());
+            }
+        }
+        return new JsonResult();
+    }
+
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2944 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/AppSurveyController.java


+ 395 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/ApplicationController.java

@@ -0,0 +1,395 @@
+package com.bk.wd.web.controller.wd.app;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.dto.AppSearchParamsDto;
+import com.bk.wd.model.WdApplication;
+import com.bk.wd.service.WdApplicationService;
+import com.bk.wd.util.ProcessHandle;
+
+@Controller
+@RequestMapping(value = "/wd/application")
+public class ApplicationController {
+
+    @Autowired
+    private WdApplicationService wdApplicationService;
+
+    @Autowired
+    private ProcessHandle ProcessHandle;
+
+    /**
+     * 我的贷款 date: 2017年4月8日 下午5:46:24 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequestMapping(value = { "mineList" })
+    @RequiresPermissions("wd:application:view")
+    public String mineList(Model model, AppSearchParamsDto searchParamsDto, HttpServletRequest request) {
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(null);
+        model.addAttribute("auditList", selectByStatus(searchParamsDto, 6));
+        model.addAttribute("reviewList", selectByStatus(searchParamsDto, 504));
+        model.addAttribute("laonList", selectByStatus(searchParamsDto, 512));
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/mineList";
+    }
+
+    private List<WdApplication> selectByStatus(AppSearchParamsDto searchParamsDto, int status) {
+        searchParamsDto.setStatus(status);
+        return wdApplicationService.selectMineList(searchParamsDto);
+    }
+
+    @RequestMapping(value = { "allList" })
+    @RequiresPermissions("wd:application:view")
+    public String mineList(Model model, AppSearchParamsDto searchParamsDto, Pagination pagination, Integer status, HttpServletRequest request) {
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setDataScope("office");
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineList(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineList(searchParamsDto));
+
+        Map<String, Object> analyzeMap = new HashMap<>();
+        searchParamsDto.setStatus(null);
+        analyzeMap.put("all", wdApplicationService.countMineList(searchParamsDto));
+        searchParamsDto.setStatus(1);
+        analyzeMap.put("assigned", wdApplicationService.countMineList(searchParamsDto));
+        searchParamsDto.setStatus(2);
+        analyzeMap.put("survey", wdApplicationService.countMineList(searchParamsDto));
+        searchParamsDto.setStatus(8);
+        analyzeMap.put("offlineReview", wdApplicationService.countMineList(searchParamsDto));
+        searchParamsDto.setStatus(16);
+        analyzeMap.put("tableReview", wdApplicationService.countMineList(searchParamsDto));
+        searchParamsDto.setStatus(32);
+        analyzeMap.put("riskControl", wdApplicationService.countMineList(searchParamsDto));
+        searchParamsDto.setStatus(256);
+        analyzeMap.put("extendReview", wdApplicationService.countMineList(searchParamsDto));
+        searchParamsDto.setStatus(512);
+        analyzeMap.put("loanReview", wdApplicationService.countMineList(searchParamsDto));
+        model.addAttribute("analyzeData", analyzeMap);
+
+        searchParamsDto.setStatus(status);
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/allList";
+    }
+
+    /**
+     * 待分配 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:assignment")
+    @RequestMapping(value = { "assignmentList" })
+    public String assignmentList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setTaskStatus(1);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineListByTast(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/assignmentList";
+    }
+
+    /**
+     * 待征信 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:credit")
+    @RequestMapping(value = { "creditList" })
+    public String creditList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        if (null == searchParamsDto.getCreditStatus()) {
+            searchParamsDto.setCreditStatus(1);
+        }
+        searchParamsDto.setPagination(pagination);
+        wdApplicationService.selectCreditListByPagination(pagination, searchParamsDto);
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/creditList";
+    }
+
+    /**
+     * 资料审核 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:offlinereview")
+    @RequestMapping(value = { "offlineList" })
+    public String offlineList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setTaskStatus(8);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineListByTast(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/offlineList";
+    }
+
+    /**
+     * 资料初审 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:offlinereview")
+    @RequestMapping(value = { "offlineFirstList" })
+    public String offlineFirstList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setTaskStatus(64);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineListByTast(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/offlineFirstList";
+    }
+
+    /**
+     * 风险调查 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequestMapping(value = { "fenxiandaiocha" })
+    public String fenxiandaiocha(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setTaskStatus(128);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineListByTast(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/fenxiandaiocha";
+    }
+
+    /**
+     * 表格审批 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:tablereview")
+    @RequestMapping(value = { "tableList" })
+    public String tableList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setTaskStatus(16);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineListByTast(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/tableList";
+    }
+
+    /**
+     * 风控审核 date: 2017年4月8日 下午5:48:41 <br/>
+     * @author Liam
+     * @param model
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:riskcontrol")
+    @RequestMapping(value = { "riskControlList" })
+    public String riskControlList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setTaskStatus(32);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineListByTast(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/riskControlList";
+    }
+
+    /**
+     * 超额待批 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:extendreview")
+    @RequestMapping(value = { "extendList" })
+    public String extendList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setTaskStatus(256);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineListByTast(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/extendList";
+    }
+
+    /**
+     * 放款待批 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:loanreview")
+    @RequestMapping(value = { "loanReviewList" })
+    public String loanReviewList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setTaskStatus(512);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        searchParamsDto.setPagination(pagination);
+        pagination.setDataList(wdApplicationService.selectMineListByTast(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/loanReviewList";
+    }
+
+    /**
+     * 待签约(视频双录) date: 2017年4月8日 下午5:46:24 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequestMapping(value = { "presignedList" })
+    @RequiresPermissions("wd:application:presigned")
+    public String presignedList(Model model, AppSearchParamsDto searchParamsDto, Pagination pagination, HttpServletRequest request) {
+        searchParamsDto.setStatus(512);
+        searchParamsDto.setPagination(pagination);
+        if (!SysOffice.HeadCompany.equals(UserUtils.getUser().getCompanyId())) {
+            searchParamsDto.setCompanyId(UserUtils.getUser().getCompanyId());
+        }
+        pagination.setTotal(wdApplicationService.countMineList(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineList(searchParamsDto));
+        model.addAttribute("params", searchParamsDto);
+        model.addAttribute("pagination", pagination);
+        return "modules/wd/application/presignedList";
+    }
+
+    /**
+     * 已终止 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:canceledList")
+    @RequestMapping(value = { "canceledList" })
+    public String canceledList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setStatus(8192);
+        searchParamsDto.setDataScope("office");
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineList(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineList(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/canceledList";
+    }
+
+    /**
+     * 被拒绝 date: 2017年5月6日 下午9:18:41 <br/>
+     * @author Liam
+     * @param model
+     * @param pagination
+     * @param searchParamsDto
+     * @return
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:rejectList")
+    @RequestMapping(value = { "rejectList" })
+    public String rejectList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setStatus(16384);
+        searchParamsDto.setDataScope("office");
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineList(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineList(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/rejectList";
+    }
+
+    /**
+     * 贷款总控 date: 2017年4月8日 下午5:46:49 <br/>
+     * @author Liam
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:manager")
+    @RequestMapping(value = { "managerList" })
+    public String managerList(Model model, AppSearchParamsDto searchParamsDto, Integer status, Pagination pagination) {
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setDataScope("office");
+        searchParamsDto.setPagination(pagination);
+        searchParamsDto.setTaskStatus(status);
+        pagination.setTotal(wdApplicationService.countMineListByTast(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectManagerListByTast(searchParamsDto));
+        searchParamsDto.setTaskStatus(null);
+
+        Map<String, Object> analyzeMap = new HashMap<>();
+        searchParamsDto.setStatus(null);
+        analyzeMap.put("all", wdApplicationService.countMineListByTast(searchParamsDto));
+        searchParamsDto.setStatus(1);
+        analyzeMap.put("assigned", wdApplicationService.countMineListByTast(searchParamsDto));
+        searchParamsDto.setStatus(2);
+        analyzeMap.put("survey", wdApplicationService.countMineListByTast(searchParamsDto));
+        searchParamsDto.setStatus(8);
+        analyzeMap.put("offlineReview", wdApplicationService.countMineListByTast(searchParamsDto));
+        searchParamsDto.setStatus(16);
+        analyzeMap.put("tableReview", wdApplicationService.countMineListByTast(searchParamsDto));
+        searchParamsDto.setStatus(32);
+        analyzeMap.put("riskControl", wdApplicationService.countMineListByTast(searchParamsDto));
+
+        searchParamsDto.setStatus(64);
+        analyzeMap.put("offlineFirstReview", wdApplicationService.countMineListByTast(searchParamsDto));
+        searchParamsDto.setStatus(128);
+        analyzeMap.put("riskHeshi", wdApplicationService.countMineListByTast(searchParamsDto));
+
+        searchParamsDto.setStatus(256);
+        analyzeMap.put("extendReview", wdApplicationService.countMineListByTast(searchParamsDto));
+        searchParamsDto.setStatus(512);
+        analyzeMap.put("loanReview", wdApplicationService.countMineListByTast(searchParamsDto));
+        /*searchParamsDto.setStatus(16384);
+        analyzeMap.put("rejected", wdApplicationService.countMineList(searchParamsDto));*/
+        model.addAttribute("analyzeData", analyzeMap);
+
+        searchParamsDto.setStatus(status);
+        model.addAttribute("params", searchParamsDto);
+        model.addAttribute("pagination", pagination);
+        return "modules/wd/application/managerList";
+    }
+
+    @RequiresPermissions("wd:application:delete")
+    @RequestMapping(value = { "/del" })
+    @ResponseBody
+    public JsonResult delApplication(String applicationId) {
+        if (StringUtils.isBlank(applicationId)) {
+            return new JsonResult(false, "Application ID不能为空");
+        }
+
+        // 检查是否符合修改的条件
+        WdApplication application = wdApplicationService.selectByPrimaryKey(applicationId);
+        if (null == application) {
+            return new JsonResult(false, "Application ID有误");
+        }
+
+        if ((application.getStatus() & 16384) != 0) {
+            return new JsonResult(false, "申请已经被拒,不可删除");
+        }
+        if ((application.getStatus() & 4096) != 0) {
+            return new JsonResult(false, "申请已经入档,不可删除");
+        }
+        if ((application.getStatus() & 3072) != 0) {
+            return new JsonResult(false, "申请已经放款,不可删除");
+        }
+        
+        ProcessHandle.delApplication(application);
+        
+        return new JsonResult(true, applicationId);
+    }
+}

+ 196 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/FzApplicationController.java

@@ -0,0 +1,196 @@
+package com.bk.wd.web.controller.wd.app;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.GeneralException;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.DateUtils;
+import com.bk.common.utils.JGMessageUtils;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdApplication;
+import com.bk.wd.model.WdApplicationTask;
+import com.bk.wd.model.WdProcessSubinstance;
+import com.bk.wd.model.WdProcessTask;
+import com.bk.wd.service.WdApplicationService;
+import com.bk.wd.service.WdApplicationTaskService;
+import com.bk.wd.service.WdProcessSubinstanceService;
+import com.bk.wd.service.WdProcessTaskService;
+import com.bk.wd.util.ProcessHandle;
+import com.bk.wd.util.process.EngineHandler;
+
+@Controller
+@RequestMapping(value = "/wd/application/fz")
+public class FzApplicationController {
+
+    @Autowired
+    private WdProcessTaskService taskService;
+
+    @Autowired
+    private WdProcessSubinstanceService subinstanceService;
+
+    @Autowired
+    private WdApplicationService applicationService;
+
+    @Autowired
+    private WdApplicationTaskService commentService;
+
+    @Autowired
+    private EngineHandler processEngine;
+
+    @Autowired
+    private ProcessHandle processHandle;
+
+    @Autowired
+    private JGMessageUtils jgMessageUtils;
+
+    private List<WdApplication> getApplications(Integer activiy) {
+        List<WdApplication> applications = new ArrayList<>();
+
+        List<WdProcessTask> tasks = taskService.selectUnclosedByActivityAndOwner(activiy, UserUtils.getUser().getId());
+        for (WdProcessTask task : tasks) {
+            WdProcessSubinstance subinstance = subinstanceService.selectBySubinstance(task.getInstanceId());
+            if (subinstance == null) {
+                continue;
+            }
+
+            WdApplication application = applicationService.selectByName(subinstance.getInstanceId());
+            if (null == application) {
+                continue;
+            }
+
+            WdApplicationTask appTask = new WdApplicationTask();
+            appTask.setId(task.getId());
+            appTask.setApplicationId(application.getId());
+            appTask.setStatus(task.getActivity());
+            appTask.setStatusName(task.getActivityName());
+            appTask.setOwnerId(task.getOwnerId());
+            appTask.setOwnerName(task.getOwnerName());
+            appTask.setCreateBy(task.getCreateBy());
+            appTask.setCreateDate(task.getCreateDate());
+            appTask.setUpdateBy(task.getUpdateBy());
+            appTask.setUpdateDate(task.getUpdateDate());
+
+            application.setWdApplicationTask(appTask);
+            applications.add(application);
+        }
+
+        return applications;
+    }
+
+    @RequestMapping(value = { "comment" }, method = { RequestMethod.GET })
+    @RequiresPermissions("wd:application:view")
+    public String showComment(Model model, HttpServletRequest request, String taskId) {
+        model.addAttribute("taskId", taskId);
+        return "modules/wd/application/fz/comments";
+    }
+
+    @RequestMapping(value = { "deal" }, method = { RequestMethod.POST })
+    @RequiresPermissions("wd:application:view")
+    @ResponseBody
+    public JsonResult dealTask(String taskId, String action, String comment) {
+        WdProcessTask task = taskService.selectByPrimaryKey(taskId);
+        if (task == null) {
+            return new JsonResult(false, "Task ID有误【" + taskId + "】");
+        }
+        WdProcessSubinstance subinstance = subinstanceService.selectBySubinstance(task.getInstanceId());
+        if (subinstance == null) {
+            return new JsonResult(false, "Task ID有误【" + taskId + "】");
+        }
+
+        WdApplication application = applicationService.selectByName(subinstance.getInstanceId());
+        if (null == application) {
+            return new JsonResult(false, "Task ID有误【" + taskId + "】");
+        }
+
+        String errorMessage = "";
+        try {
+            errorMessage = processEngine.dealTask(taskId, action, UserUtils.getUser().getId());
+        } catch (GeneralException e) {
+            return new JsonResult(false, e.getMessage());
+        }
+        if (StringUtils.isNotBlank(errorMessage)) {
+            return new JsonResult(false, errorMessage);
+        }
+
+        task = taskService.selectByPrimaryKey(taskId);
+        WdApplicationTask taskComment = new WdApplicationTask();
+        taskComment.setId(task.getId());
+        taskComment.setApplicationId(application.getId());
+        taskComment.setStatus(task.getActivity());
+        taskComment.setStatusName(task.getActivityName());
+        taskComment.setOwnerId(task.getOwnerId());
+        taskComment.setOwnerName(task.getOwnerName());
+        taskComment.setClose(task.getClose());
+        taskComment.setCloseDate(task.getCloseDate());
+        taskComment.setDone(task.getDone());
+        taskComment.setDonerId(task.getDonerId());
+        taskComment.setDonerName(task.getDonerName());
+        taskComment.setDoneDate(task.getDoneDate());
+        taskComment.setAction(task.getAction());
+        taskComment.setActionName(task.getActionName());
+        taskComment.setCreateBy(task.getCreateBy());
+        taskComment.setCreateDate(task.getCreateDate());
+        taskComment.setUpdateBy(task.getUpdateBy());
+        taskComment.setUpdateDate(task.getUpdateDate());
+
+        taskComment.setComment(comment);
+        commentService.insertSelective(taskComment);
+
+        processHandle.delWithOldProcessAndNewProcess(application);
+
+        // 发送风险核实任务消息
+        List<WdProcessTask> unclosedTasks = taskService.selectUnclosedByInstance(task.getInstanceId());
+        for (WdProcessTask unclosedTask : unclosedTasks) {
+            if (unclosedTask.getActivity().equals(128)) {
+
+                String[] alias = new String[] { task.getOwnerId() };
+                String taskTime = DateUtils.formatDateTime(unclosedTask.getCreateDate());
+                
+                Map<String, String> extraInfo = new HashMap<>();
+                extraInfo.put("category", "风险核实");
+                extraInfo.put("applicationId", application.getId());
+                extraInfo.put("taskId", unclosedTask.getId());
+                extraInfo.put("custoemrName", application.getCustomerName());
+                extraInfo.put("appliatonCode", application.getCode());
+                extraInfo.put("taskTime", taskTime);
+                extraInfo.put("product", application.getProductName());
+
+                jgMessageUtils.sendMessageByAlias(alias, "您有一个任务需要处理", "请您尽快对客户【" + application.getCustomerName() +"】先生(女士)进行风险核实", extraInfo);
+            }
+        }
+
+        return new JsonResult(true, errorMessage);
+    }
+
+    @RequestMapping(value = { "ziliaochushen" }, method = { RequestMethod.GET })
+    public String ziliaochushen(Model model, HttpServletRequest request) {
+        List<WdApplication> applications = getApplications(64);
+        model.addAttribute("data", applications);
+
+        return "modules/wd/application/fz/ziliaochushen";
+    }
+
+    @RequestMapping(value = { "fenxiandiaocha" }, method = { RequestMethod.GET })
+    @RequiresPermissions("wd:application:fenxiandiaocha")
+    public String fenxiandaiocha(Model model, HttpServletRequest request) {
+        List<WdApplication> applications = getApplications(128);
+        model.addAttribute("data", applications);
+
+        return "modules/wd/application/fz/fengxiandiaocha";
+    }
+
+}

+ 604 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/StatisticsController.java

@@ -0,0 +1,604 @@
+package com.bk.wd.web.controller.wd.app;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import com.bk.bi.wd.service.BiUserStatisticsService;
+import com.bk.bi.wd.utils.StatisticsUtils;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.model.SysOffice;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.service.SystemService;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.sys.service.SysOfficeService;
+import com.bk.sys.service.SysUserService;
+import com.bk.wd.model.WdProduct;
+import com.bk.wd.service.WdProductService;
+
+@Controller
+@RequestMapping(value = "/wd/statistics")
+public class StatisticsController {
+
+	@Autowired
+	private WdProductService wdProductService;
+
+	@Autowired
+	private StatisticsUtils statisticsUtils;
+
+	@Autowired
+	private SysOfficeService sysOfficeService;
+
+	@Autowired
+	private SysUserService sysUserService;
+
+	@Autowired
+	private SystemService systemService;
+
+	@Autowired
+	private BiUserStatisticsService biUserStatisticsService;
+
+	@RequiresPermissions("wd:statistics:product:view")
+	@RequestMapping(value = { "product" })
+	public String productIndex(Model model) {
+	    statisticsUtils.count();
+	    
+	    List<WdProduct> products = wdProductService.selectByRegion(UserUtils.getUser().getCompanyId());
+	    
+	    // MARK:后期采用字典
+	    String[] productArray = {"车贷", "房贷", "消费贷", "经营贷", "信用卡"};
+	    
+	    List<Map<String, Object>> productList = new ArrayList<>();
+	    for (String category : productArray) {
+	        Map<String, Object> wdProductCategoryMap = new HashMap<>();
+	        List<WdProduct> wdProductList = wdProductService.selectByCategory(products, category);
+	        if (!wdProductList.isEmpty()) {
+	            wdProductCategoryMap.put("productList", wdProductList);
+	            wdProductCategoryMap.put("category", category);
+	            productList.add(wdProductCategoryMap);
+	        }
+        }
+	    model.addAttribute("productList", productList);
+	    return "modules/wd/statistics/product/index";
+	}
+	
+	@RequestMapping(value = { "product/charts" })
+	public String productCharts(Model model, HttpServletRequest request, String productId, String productCategory, String dateType) {
+	    
+	    productCategory = StringUtils.toUTF8(productCategory);
+	    
+		Date endDate = new Date();
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(endDate);
+		switch (dateType) {
+		case "2":
+			calendar.add(Calendar.DATE, -7);
+			break;
+		case "3":
+			calendar.add(Calendar.DATE, -45);
+			break;
+		case "4":
+			calendar.add(Calendar.MONTH, -6);
+			calendar.set(Calendar.DATE, 1);
+			break;
+		case "5":
+			calendar.add(Calendar.MONTH, -12);
+			calendar.set(Calendar.DATE, 1);
+			break;
+
+		default:
+			break;
+		}
+
+		Date startDate = calendar.getTime();
+
+		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+		String startDateString = formatter.format(startDate);
+		String endDateString = formatter.format(endDate);
+
+		model.addAttribute("dateString", startDateString + " ~ " + endDateString);
+
+		List<Map<String, Object>> statisticses = statisticsUtils.getProductStatistics(productId, productCategory, startDate, endDate);
+
+		List<Map<String, String>> statisticsData = new ArrayList<>();
+		BigDecimal totalAmount = new BigDecimal(0);
+		Integer totalIntention = 0;
+		Integer totalPassing = 0;
+		Integer totalLoan = 0;
+
+		if (!statisticses.isEmpty()) {
+			BigDecimal temp = new BigDecimal("10000");
+			if ((int) ((endDate.getTime() - startDate.getTime()) / 86400000) > 60) {
+
+				SimpleDateFormat formatterMonth = new SimpleDateFormat("yyyy-MM");
+				BigDecimal amount = new BigDecimal(0);
+				Integer intention = 0;
+				Integer passing = 0;
+				Integer loan = 0;
+
+				while (startDate.before(endDate)) {
+					String date = formatterMonth.format(startDate);
+
+					for (Map<String, Object> statistics : statisticses) {
+						String date2 = formatterMonth.format(((Date) statistics.get("date_point")));
+						if (!date.equals(date2)) {
+							continue;
+						}
+
+						amount = amount.add(new BigDecimal(statistics.get("credit_amount").toString()));
+						intention = intention + Integer.parseInt(statistics.get("intention_num").toString());
+						passing = passing + Integer.parseInt(statistics.get("passing_num").toString());
+						loan = loan + Integer.parseInt(statistics.get("loan_num").toString());
+
+						totalAmount = totalAmount.add(new BigDecimal(statistics.get("credit_amount").toString()));
+						totalIntention = totalIntention + Integer.parseInt(statistics.get("intention_num").toString());
+						totalPassing = totalPassing + Integer.parseInt(statistics.get("passing_num").toString());
+						totalLoan = totalLoan + Integer.parseInt(statistics.get("loan_num").toString());
+					}
+
+					Map<String, String> data = new HashMap<>();
+					data.put("date", date);
+					data.put("amount", amount.divide(temp, 2).toString());
+					data.put("intention", intention.toString());
+					data.put("passing", passing.toString());
+					data.put("loan", loan.toString());
+					statisticsData.add(data);
+
+					amount = new BigDecimal(0);
+					intention = 0;
+					passing = 0;
+					loan = 0;
+
+					calendar.setTime(startDate);
+					calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + 1);
+					startDate = calendar.getTime();
+				}
+
+			} else {
+
+				while (startDate.before(endDate)) {
+					String date = formatter.format(startDate);
+					for (Map<String, Object> statistics : statisticses) {
+						String date2 = formatter.format(((Date) statistics.get("date_point")));
+						if (date.equals(date2)) {
+
+							Map<String, String> data = new HashMap<>();
+							data.put("date", date2);
+							data.put("amount", new BigDecimal(statistics.get("credit_amount").toString()).divide(temp, 2).toString());
+							data.put("intention", statistics.get("intention_num").toString());
+							data.put("passing", statistics.get("passing_num").toString());
+							data.put("loan", statistics.get("loan_num").toString());
+							statisticsData.add(data);
+
+							totalAmount = totalAmount.add(new BigDecimal(statistics.get("credit_amount").toString()));
+							totalIntention = totalIntention + Integer.parseInt(statistics.get("intention_num").toString());
+							totalPassing = totalPassing + Integer.parseInt(statistics.get("passing_num").toString());
+							totalLoan = totalLoan + Integer.parseInt(statistics.get("loan_num").toString());
+
+							break;
+						}
+					}
+
+					calendar.setTime(startDate);
+					calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + 1);
+					startDate = calendar.getTime();
+				}
+			}
+		}
+		model.addAttribute("data", statisticsData);
+		model.addAttribute("productId", productId);
+		model.addAttribute("productCategory", productCategory);
+		model.addAttribute("dateType", dateType);
+
+		model.addAttribute("totalAmount", totalAmount.divide(new BigDecimal("10000"), 2).toString());
+		model.addAttribute("totalIntention", totalIntention.toString());
+		model.addAttribute("totalPassing", totalPassing.toString());
+		model.addAttribute("totalLoan", totalLoan.toString());
+
+		return "modules/wd/statistics/product/charts";
+	}
+
+	@RequiresPermissions("wd:statistics:ratio:view")
+	@RequestMapping(value = { "ratio" })
+	public String retioIndex(Model model) {
+	    statisticsUtils.count();
+	    return "modules/wd/statistics/ratio/index";
+	}
+	
+	@RequestMapping(value = { "ratio/charts" })
+	public String ratioCharts(Model model, HttpServletRequest request, String ratioType, String dateType) {
+		Date endDate = new Date();
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(endDate);
+		switch (dateType) {
+		case "2":
+			calendar.add(Calendar.DATE, -7);
+			break;
+		case "3":
+			calendar.add(Calendar.DATE, -45);
+			break;
+		case "4":
+			calendar.add(Calendar.MONTH, -6);
+			calendar.set(Calendar.DATE, 1);
+			break;
+		case "5":
+			calendar.add(Calendar.MONTH, -12);
+			calendar.set(Calendar.DATE, 1);
+			break;
+
+		default:
+			break;
+		}
+
+		Date startDate = calendar.getTime();
+		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+		String startDateString = formatter.format(startDate);
+		String endDateString = formatter.format(endDate);
+
+		model.addAttribute("dateString", startDateString + " ~ " + endDateString);
+
+		List<Map<String, Object>> list = new ArrayList<>();
+		if (ratioType.equals("customer")) {
+			list = statisticsUtils.getCustomerStatistics(startDate, endDate);
+		} else if (ratioType.equals("guarantee")) {
+			list = statisticsUtils.getGuaranteeStatistics(startDate, endDate);
+		}
+
+		List<Map<String, String>> statisticsData = new ArrayList<>();
+		BigDecimal temp = new BigDecimal("10000");
+		BigDecimal temp2 = new BigDecimal("100");
+		for (Map<String, Object> map : list) {
+			Map<String, String> data = new HashMap<>();
+			data.put("key", map.get("key").toString());
+			data.put("name", map.get("name").toString());
+			data.put("amount", ((BigDecimal) map.get("amount")).divide(temp, 2).toString());
+			data.put("percentage", ((BigDecimal) map.get("percentage")).multiply(temp2).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
+			statisticsData.add(data);
+		}
+
+		model.addAttribute("data", statisticsData);
+		model.addAttribute("ratioType", ratioType);
+		model.addAttribute("dateType", dateType);
+		return "modules/wd/statistics/ratio/charts";
+	}
+
+	@RequiresPermissions("wd:statistics:team:view")
+	@RequestMapping(value = { "team" })
+	public String team_index(Model model) {
+	    statisticsUtils.count();
+	    
+	    List<SysOffice> officeLsit = sysOfficeService.treeData(systemService.findAllOffice(), SysOffice.HeadCompany);
+	    
+        model.addAttribute("officeList", officeLsit);
+        return "modules/wd/statistics/team/index";
+	}
+	
+	@RequestMapping(value = { "team_charts" })
+	public String team_charts(Model model, HttpServletRequest request, String officeId, String dateType) {
+        Date endDate = new Date();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(endDate);
+        switch (dateType) {
+        case "2":
+            calendar.add(Calendar.DATE, -7);
+            break;
+        case "3":
+            calendar.add(Calendar.DATE, -45);
+            break;
+        case "4":
+            calendar.add(Calendar.MONTH, -6);
+            calendar.set(Calendar.DATE, 1);
+            break;
+        case "5":
+            calendar.add(Calendar.MONTH, -12);
+            calendar.set(Calendar.DATE, 1);
+            break;
+
+        default:
+            break;
+        }
+        
+        Date startDate = calendar.getTime();
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+        String startDateString = formatter.format(startDate);
+        String endDateString = formatter.format(endDate);
+
+        model.addAttribute("dateString", startDateString + " ~ " + endDateString);
+
+        List<SysOffice> childrenOffice = sysOfficeService.selectChildList(officeId);
+        if (childrenOffice.isEmpty()) {
+            SysOffice sysOffice = new SysOffice();
+            sysOffice.setId(officeId);
+            List<SysUser> officeUsers = sysUserService.selectByOffice(sysOffice);
+            return userCompare(model, request, officeUsers, dateType, startDate, endDate);
+        } else {
+            return teamCompare(model, request, childrenOffice, dateType, startDate, endDate);
+        }
+	}
+
+	public String teamCompare(Model model, HttpServletRequest request, List<SysOffice> teamIds, String dateType, Date startDate, Date endDate) {
+		List<Map<String, Object>> list = new ArrayList<>();
+
+		BigDecimal totalAmount = new BigDecimal(0);
+		Integer totalVisit = 0;
+		Integer totalIntention = 0;
+		Integer totalSubmit = 0;
+		Integer totalPassing = 0;
+		Integer totalLoan = 0;
+
+		for (SysOffice sysOffice : teamIds) {
+
+			String officeId = sysOffice.getId();
+			String officeName = sysOffice.getName();
+
+			SysOffice selectOption = new SysOffice();
+			selectOption.setId(officeId);
+
+			List<SysUser> officeUsers = sysUserService.selectByOffice(selectOption);
+			List<String> userIds = new ArrayList<>();
+			for (SysUser sysUser : officeUsers) {
+				userIds.add(sysUser.getId());
+			}
+			List<Map<String, Object>> sumList = biUserStatisticsService.selectSumByDateRange(userIds, startDate, endDate);
+
+			Map<String, Object> sumObject = new HashMap<>();
+			if (sumList.isEmpty() || sumList.get(0) == null) {
+				sumObject.put("amount", new BigDecimal("0"));
+				sumObject.put("visit", 0);
+				sumObject.put("intention", 0);
+				sumObject.put("submit", 0);
+				sumObject.put("passing", 0);
+				sumObject.put("loan", 0);
+			} else {
+				sumObject = sumList.get(0);
+				sumObject.replace("amount", (new BigDecimal(sumObject.get("amount").toString())).divide(new BigDecimal("10000"), 2).toString());
+			}
+
+			sumObject.put("officeId", officeId);
+			sumObject.put("officeName", officeName);
+			list.add(sumObject);
+
+			totalAmount = totalAmount.add(new BigDecimal(sumObject.get("amount").toString()));
+			totalVisit = totalVisit + Integer.parseInt(sumObject.get("visit").toString());
+			totalIntention = totalIntention + Integer.parseInt(sumObject.get("intention").toString());
+			totalSubmit = totalSubmit + Integer.parseInt(sumObject.get("submit").toString());
+			totalPassing = totalPassing + Integer.parseInt(sumObject.get("passing").toString());
+			totalLoan = totalLoan + Integer.parseInt(sumObject.get("loan").toString());
+		}
+
+		// model.addAttribute("totalAmount", totalAmount.divide(new BigDecimal("10000"), 2).toString());
+		model.addAttribute("totalAmount", totalAmount.divide(new BigDecimal("1"), 2).toString());
+		model.addAttribute("totalVisit", totalVisit.toString());
+        model.addAttribute("totalIntention", totalIntention.toString());
+        model.addAttribute("totalSubmit", totalSubmit.toString());
+		model.addAttribute("totalPassing", totalPassing.toString());
+		model.addAttribute("totalLoan", totalLoan.toString());
+
+		Integer size = list.size();
+		// BigDecimal avgAmount = totalAmount.divide(new BigDecimal(10000 * size), 2);
+		BigDecimal avgAmount = totalAmount.divide(new BigDecimal(size), 2);
+		model.addAttribute("avgAmount", avgAmount);
+		Integer avgVisit = (totalVisit / size);
+		model.addAttribute("avgVisit", avgVisit);
+        Integer avgIntention = (totalIntention / size);
+        model.addAttribute("avgIntention", avgIntention);
+        Integer avgSubmit = (totalSubmit / size);
+        model.addAttribute("avgSubmit", avgSubmit);
+		Integer avgPassing = (totalPassing / size);
+		model.addAttribute("avgPassing", avgPassing);
+		Integer avgLoan = (totalLoan / size);
+		model.addAttribute("avgLoan", avgLoan);
+
+		model.addAttribute("data", list);
+		return "modules/wd/statistics/team/team_office_charts";
+	}
+
+	public String userCompare(Model model, HttpServletRequest request, List<SysUser> users, String dateType, Date startDate, Date endDate) {
+		List<String> userIds = new ArrayList<>();
+		for (SysUser sysUser : users) {
+			userIds.add(sysUser.getId());
+		}
+		List<Map<String, Object>> list = biUserStatisticsService.selectUserSumByDateRange(userIds, startDate, endDate);
+
+		BigDecimal totalAmount = new BigDecimal(0);
+		Integer totalVisit = 0;
+		Integer totalIntention = 0;
+        Integer totalSubmit = 0;
+		Integer totalPassing = 0;
+		Integer totalLoan = 0;
+
+		for (Map<String, Object> sumObject : list) {
+
+			totalAmount = totalAmount.add(new BigDecimal(sumObject.get("amount").toString()));
+			totalVisit = totalVisit + Integer.parseInt(sumObject.get("visit").toString());
+			totalIntention = totalIntention + Integer.parseInt(sumObject.get("intention").toString());
+			totalSubmit = totalSubmit + Integer.parseInt(sumObject.get("submit").toString());
+			totalPassing = totalPassing + Integer.parseInt(sumObject.get("passing").toString());
+			totalLoan = totalLoan + Integer.parseInt(sumObject.get("loan").toString());
+
+			BigDecimal amount = new BigDecimal(sumObject.get("amount").toString());
+			sumObject.replace("amount", amount.divide(new BigDecimal("10000"), 2).toString());
+
+			userIds.remove(sumObject.get("user_id"));
+		}
+
+		for (String userId : userIds) {
+			Map<String, Object> sumObject = new HashMap<>();
+			sumObject.put("amount", new BigDecimal("0"));
+			sumObject.put("visit", 0);
+			sumObject.put("intention", 0);
+			sumObject.put("passing", 0);
+            sumObject.put("submit", 0);
+			sumObject.put("loan", 0);
+			sumObject.put("user_id", userId);
+			sumObject.put("user_name", sysUserService.selectByPrimaryKey(userId).getName());
+
+			list.add(sumObject);
+		}
+
+		model.addAttribute("totalAmount", totalAmount.divide(new BigDecimal("10000"), 2).toString());
+		model.addAttribute("totalVisit", totalVisit.toString());
+        model.addAttribute("totalIntention", totalIntention.toString());
+        model.addAttribute("totalSubmit", totalSubmit.toString());
+		model.addAttribute("totalPassing", totalPassing.toString());
+		model.addAttribute("totalLoan", totalLoan.toString());
+
+		Integer size = list.size();
+		BigDecimal avgAmount = totalAmount.divide(new BigDecimal(10000 * size), 2);
+		model.addAttribute("avgAmount", avgAmount);
+		Integer avgVisit = (totalVisit / size);
+		model.addAttribute("avgVisit", avgVisit);
+		Integer avgIntention = (totalIntention / size);
+		model.addAttribute("avgIntention", avgIntention);
+        Integer avgSubmit = (totalSubmit / size);
+        model.addAttribute("avgSubmit", avgSubmit);
+		Integer avgPassing = (totalPassing / size);
+		model.addAttribute("avgPassing", avgPassing);
+		Integer avgLoan = (totalLoan / size);
+		model.addAttribute("avgLoan", avgLoan);
+
+		model.addAttribute("data", list);
+
+		return "modules/wd/statistics/team/team_user_charts";
+	}
+
+	@RequestMapping(value = { "team_user_detail" })
+	public String team_user_detail(Model model, HttpServletRequest request, String userId, String dateType) {
+
+		if (StringUtils.isBlank(dateType)) {
+			dateType = "1";
+		}
+
+		Date endDate = new Date();
+
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(endDate);
+		switch (dateType) {
+		case "2":
+			calendar.add(Calendar.DATE, -7);
+			break;
+		case "3":
+			calendar.add(Calendar.DATE, -45);
+			break;
+		case "4":
+			calendar.add(Calendar.MONTH, -6);
+			calendar.set(Calendar.DATE, 1);
+			break;
+		case "5":
+			calendar.add(Calendar.MONTH, -12);
+			calendar.set(Calendar.DATE, 1);
+			break;
+
+		default:
+			break;
+		}
+
+		Date startDate = calendar.getTime();
+
+		System.out.println(startDate);
+		System.out.println(endDate);
+
+		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+		String startDateString = formatter.format(startDate);
+		String endDateString = formatter.format(endDate);
+		model.addAttribute("dateString", startDateString + " ~ " + endDateString);
+
+		List<Map<String, Object>> statisticses = statisticsUtils.getUserStatistics(userId, startDate, endDate);
+
+		List<Map<String, String>> statisticsData = new ArrayList<>();
+
+		if (!statisticses.isEmpty()) {
+			BigDecimal temp = new BigDecimal("10000");
+			if ((int) ((endDate.getTime() - startDate.getTime()) / 86400000) > 60) {
+
+				SimpleDateFormat formatterMonth = new SimpleDateFormat("yyyy-MM");
+				while (startDate.before(endDate)) {
+					String date = formatterMonth.format(startDate);
+
+					BigDecimal amount = new BigDecimal(0);
+					Integer visit = 0;
+					Integer intention = 0;
+					Integer submit = 0;
+					Integer passing = 0;
+					Integer loan = 0;
+
+					for (Map<String, Object> statistics : statisticses) {
+						String date2 = formatterMonth.format(((Date) statistics.get("date_point")));
+
+						if (!date.equals(date2)) {
+							continue;
+						}
+
+						amount = amount.add(new BigDecimal(statistics.get("credit_amount").toString()));
+						visit = visit + Integer.parseInt(statistics.get("visit_num").toString());
+						intention = intention + Integer.parseInt(statistics.get("intention_num").toString());
+						submit = submit + Integer.parseInt(statistics.get("submit_num").toString());
+						passing = passing + Integer.parseInt(statistics.get("passing_num").toString());
+						loan = loan + Integer.parseInt(statistics.get("loan_num").toString());
+					}
+
+					Map<String, String> data = new HashMap<>();
+					data.put("date", date);
+					data.put("amount", amount.divide(temp, 2).toString());
+					data.put("visit", visit.toString());
+                    data.put("intention", intention.toString());
+                    data.put("submit", submit.toString());
+					data.put("passing", passing.toString());
+					data.put("loan", loan.toString());
+					statisticsData.add(data);
+
+					amount = new BigDecimal(0);
+					visit = 0;
+					intention = 0;
+					passing = 0;
+					loan = 0;
+
+					calendar.setTime(startDate);
+					calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + 1);
+					startDate = calendar.getTime();
+				}
+
+			} else {
+				while (startDate.before(endDate)) {
+					String date = formatter.format(startDate);
+					for (Map<String, Object> statistics : statisticses) {
+						String date2 = formatter.format(((Date) statistics.get("date_point")));
+						if (date.equals(date2)) {
+							Map<String, String> data = new HashMap<>();
+							data.put("date", date);
+							data.put("amount", new BigDecimal(statistics.get("credit_amount").toString()).divide(temp, 2).toString());
+							data.put("visit", statistics.get("visit_num").toString());
+                            data.put("intention", statistics.get("intention_num").toString());
+                            data.put("submit", statistics.get("submit_num").toString());
+							data.put("passing", statistics.get("passing_num").toString());
+							data.put("loan", statistics.get("loan_num").toString());
+							statisticsData.add(data);
+
+							break;
+						}
+					}
+					calendar.setTime(startDate);
+					calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + 1);
+					startDate = calendar.getTime();
+				}
+			}
+		}
+		model.addAttribute("data", statisticsData);
+
+		return "modules/wd/statistics/team/team_user_detail_charts";
+	}
+}

+ 234 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wd/app/loaned/LoanedController.java

@@ -0,0 +1,234 @@
+package com.bk.wd.web.controller.wd.app.loaned;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.ZipOutputStream;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.entity.Pagination;
+import com.bk.common.service.DfsService;
+import com.bk.common.utils.DateUtils;
+import com.bk.common.utils.FileUtil;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.common.utils.ZipUtil;
+import com.bk.common.web.BaseController;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.dto.AppSearchParamsDto;
+import com.bk.wd.model.WdApplication;
+import com.bk.wd.model.WdApplicationTask;
+import com.bk.wd.service.WdApplicationService;
+import com.bk.wd.service.WdApplicationTaskService;
+import com.bk.wd.util.BusinessConsts;
+
+/**
+ * 贷后管理列表
+ * @Project Name:bk-wd-web 
+ * @Date:2017年9月12日下午1:56:13 
+ * @author Liam
+ * @Copyright (c) 2017, lizhenxing@bakejinfu.com All Rights Reserved.
+ */
+@Controller
+@RequestMapping(value = "/wd/application/loaned")
+public class LoanedController extends BaseController {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(LoanedController.class);
+    
+    @Autowired
+    private WdApplicationService wdApplicationService;
+    
+    @Autowired
+    private DfsService dfsService;
+    
+    @Autowired
+    private WdApplicationTaskService wdApplicationTaskService;
+ 
+    /**
+     * 我的贷后
+     * date: 2017年4月8日 下午5:46:49 <br/> 
+     * @author Liam 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:loaned:mine:view")
+    @RequestMapping(value = { "mineList"})
+    public String mineList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        if (null == searchParamsDto.getStatus()) {
+            searchParamsDto.setStatus(2048); // 默认为还款中
+        }
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        searchParamsDto.setPagination(pagination);
+        pagination.setTotal(wdApplicationService.countMineList(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineList(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/loaned/mineList";
+    }
+    
+    /**
+     * 下载归档资料
+     * date: 2017年9月4日 上午10:22:52 <br/> 
+     * @author Liam 
+     * @param applicationId
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:loaned:manager:archivefile")
+    @RequestMapping(value = { "downloadAllArchiveFile"})
+    public void downloadAllArchiveFile(HttpServletResponse response, AppSearchParamsDto searchParamsDto) {
+        searchParamsDto.setDataScope("office");
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        List<WdApplication> appList = wdApplicationService.selectMineList(searchParamsDto);
+        List<String> fileIdList = new ArrayList<>();
+        for (WdApplication wdApplication : appList) {
+            if (StringUtils.isNotEmpty(wdApplication.getArchiveFile())) {
+                fileIdList.add(wdApplication.getArchiveFile());
+            }
+        }
+        
+        try (ZipOutputStream out = new ZipOutputStream(response.getOutputStream());) {
+            response.setContentType("application/x-download");// 设置response内容的类
+            response.setHeader("Content-disposition", "attachment;filename="+ URLEncoder.encode(DateUtils.formatDate(new Date(), "yyyy_MM_dd") + ".zip", "UTF-8"));// 设置头部信息
+            
+            if (!fileIdList.isEmpty()) {
+                String basePath = "/app/file/" + DateUtils.formatDate(new Date(), "yyyy_MM_dd_HH_MM_ss");
+                Map<String, byte[]> fileMap = dfsService.downloadFile(fileIdList);
+                for (WdApplication wdApplication : appList) {
+                    if (StringUtils.isNotEmpty(wdApplication.getArchiveFile())) {
+                        String fileName = wdApplication.getCustomerName() + "_" + wdApplication.getCode() + wdApplication.getArchiveFile().substring(wdApplication.getArchiveFile().lastIndexOf("."));
+                        String path = basePath + "/" + wdApplication.getOwnerName();
+                        FileUtil.createDir (path);
+                        FileUtil.byte2File(fileMap.get(wdApplication.getArchiveFile()), path, fileName);
+                    }
+                }
+                ZipUtil.doCompress(new File(basePath), out);
+                response.flushBuffer();
+                FileUtil.delDir(basePath);
+            }
+        } catch (IOException e) {
+            LOGGER.error("归档下载失败", e);
+        }
+    }
+    
+    /**
+     * 重新归档资料
+     * date: 2017年9月4日 上午10:22:52 <br/> 
+     * @author Liam 
+     * @param applicationId
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:loaned:manager:resetAllArchiveFile")
+    @RequestMapping(value = { "resetAllArchiveFile"})
+    @ResponseBody
+    public String resetAllArchiveFile(HttpServletResponse response, AppSearchParamsDto searchParamsDto) {
+        if (null == searchParamsDto.getStatus()) {
+            searchParamsDto.setStatus(2048); // 默认为还款中
+        }
+        searchParamsDto.setDataScope("office");
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        List<WdApplication> appList = wdApplicationService.selectMineList(searchParamsDto);
+        Thread t = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    for (WdApplication wdApplication : appList) {
+                        LOGGER.info("申请单:" + wdApplication.getCode() + " 归档中,请稍候");
+                        String zipFile = wdApplicationService.applicationArchiveFile(wdApplication.getId());
+                        WdApplication wdApplication1 = wdApplicationService.selectByPrimaryKey(wdApplication.getId());
+                        wdApplication1.setArchiveFile(zipFile);
+                        wdApplicationService.updateByPrimaryKeySelective(wdApplication1);
+                    }
+                } catch (IOException e) {
+                    LOGGER.error("贷款信息归档失败", e);
+                }
+            }
+        });
+        t.start();
+        return "true";
+    }
+    
+    /**
+     * 贷后管理
+     * date: 2017年4月27日 上午9:28:28 <br/> 
+     * @author Liam 
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:loaned:manager:view")
+    @RequestMapping(value = { "managerList"})
+    public String managerList(Model model, Pagination pagination, AppSearchParamsDto searchParamsDto) {
+        if (null == searchParamsDto.getStatus()) {
+            searchParamsDto.setStatus(2048); // 默认为还款中
+        }
+        searchParamsDto.setDataScope("office");
+        searchParamsDto.setPagination(pagination);
+        searchParamsDto.setUserId(UserUtils.getUser().getId());
+        pagination.setTotal(wdApplicationService.countMineList(searchParamsDto));
+        pagination.setDataList(wdApplicationService.selectMineList(searchParamsDto));
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("params", searchParamsDto);
+        return "modules/wd/application/loaned/managerList";
+    }
+    
+    /**
+     * 终止申请
+     * date: 2017年4月27日 上午9:28:28 <br/> 
+     * @author Liam 
+     * @param model
+     * @return 
+     * @since JDK 1.8
+     */
+    @RequiresPermissions("wd:application:settlement")
+    @RequestMapping(value = { "settlement"})
+    @ResponseBody
+    public JsonResult settlement(Model model, String applicationId) {
+        WdApplication wdApplication = wdApplicationService.selectByPrimaryKey(applicationId);
+        if (null == wdApplication || wdApplication.getStatus() != 2048) {
+        	return new JsonResult("该笔单子尚未到达还款阶段,暂不能直接还清");
+        }
+        wdApplication.setUpdateDate(new Date());
+        wdApplication.setStatus(4096);
+        wdApplicationService.updateByPrimaryKeySelective(wdApplication);
+        
+        WdApplicationTask ctask = new WdApplicationTask();
+        ctask.setId(UidUtil.uuid());
+        ctask.setStatus(4096);
+        ctask.setStatusName("已还清");
+        ctask.setApplicationId(applicationId);
+        ctask.setOwnerId(UserUtils.getUser().getId());
+        ctask.setOwnerName(UserUtils.getUser().getName());
+        ctask.setClose(BusinessConsts.TrueOrFalseAsString.True);
+        ctask.setCloseDate(new Date());
+        ctask.setDone(BusinessConsts.TrueOrFalseAsString.True);
+        ctask.setDonerId(UserUtils.getUser().getId());
+        ctask.setDonerName(UserUtils.getUser().getName());
+        ctask.setDoneDate(new Date());
+        ctask.setAction(BusinessConsts.Action.Pass);
+        ctask.setActionName(BusinessConsts.ACTIONS.get(BusinessConsts.Action.Pass));
+        ctask.setCreateBy(UserUtils.getUser().getId());
+        ctask.setCreateDate(new Date());
+        ctask.setUpdateBy(UserUtils.getUser().getId());
+        ctask.setUpdateDate(new Date());
+        wdApplicationTaskService.insertSelective(ctask);
+        
+        return new JsonResult();
+    }
+    
+}

+ 86 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlCallbackPolicyController.java

@@ -0,0 +1,86 @@
+package com.bk.wd.web.controller.wdpl;
+
+import java.util.Date;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.pl.model.WdPlCallbackPolicy;
+import com.bk.wd.pl.service.WdPlCallbackPolicyService;
+
+@Controller
+@RequestMapping(value = "/wdpl/callback/policy")
+public class WdPlCallbackPolicyController {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(WdPlCallbackPolicyController.class);
+
+    @Autowired
+    private WdPlCallbackPolicyService wdPlCallbackPolicyService;
+    
+    @ModelAttribute("wdPlCallbackPolicy")
+    public WdPlCallbackPolicy get(@RequestParam(required=false) String id) {
+        if (StringUtils.isNotBlank(id)){
+            return wdPlCallbackPolicyService.selectByPrimaryKey(id);
+        }else{
+            return new WdPlCallbackPolicy();
+        }
+    }
+
+    @RequestMapping(value = "/form")
+    public String form(WdPlCallbackPolicy wdPlCallbackPolicy, Model model) {
+        if (null != wdPlCallbackPolicy && null == wdPlCallbackPolicy.getCallbackType()) {
+            wdPlCallbackPolicy.setCallbackType(1); //首次回访
+        }
+        model.addAttribute("wdPlCallbackPolicy", wdPlCallbackPolicy);
+        return "modules/wdpl/callback/policyForm";
+    }
+    
+    @RequestMapping(value = "/save")
+    @ResponseBody
+    public JsonResult save(WdPlCallbackPolicy wdPlCallbackPolicy, Model model) {
+        if (StringUtils.isEmpty(wdPlCallbackPolicy.getId())) {
+            wdPlCallbackPolicy.setId(IdGen.uuid());
+            wdPlCallbackPolicy.setCompanyId(UserUtils.getUser().getCompanyId());
+            wdPlCallbackPolicy.setCreateBy(UserUtils.getUser().getId());
+            wdPlCallbackPolicy.setCreateDate(new Date());
+            wdPlCallbackPolicy.setUpdateBy(UserUtils.getUser().getId());
+            wdPlCallbackPolicy.setUpdateDate(new Date());
+            wdPlCallbackPolicyService.insertSelective(wdPlCallbackPolicy);
+        } else {
+            wdPlCallbackPolicy.setUpdateBy(UserUtils.getUser().getId());
+            wdPlCallbackPolicy.setUpdateDate(new Date());
+            wdPlCallbackPolicyService.updateByPrimaryKeySelective(wdPlCallbackPolicy);
+        }
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "/del")
+    @ResponseBody
+    public JsonResult del(WdPlCallbackPolicy wdPlCallbackPolicy, Model model) {
+        wdPlCallbackPolicy.setDelFlag(true);
+        wdPlCallbackPolicy.setUpdateBy(UserUtils.getUser().getId());
+        wdPlCallbackPolicy.setUpdateDate(new Date());
+        wdPlCallbackPolicyService.updateByPrimaryKeySelective(wdPlCallbackPolicy);
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "enable")
+    @ResponseBody
+    public JsonResult disable(WdPlCallbackPolicy wdPlCallbackPolicy) {
+        wdPlCallbackPolicy.setUpdateBy(UserUtils.getUser().getId());
+        wdPlCallbackPolicy.setUpdateDate(new Date());
+        wdPlCallbackPolicyService.updateByPrimaryKeySelective(wdPlCallbackPolicy);
+        return new JsonResult();
+    }
+}

+ 131 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlOriginalDataFuzhouController.java

@@ -0,0 +1,131 @@
+package com.bk.wd.web.controller.wdpl;
+
+import java.io.IOException;
+import java.util.Date;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.poi.EncryptedDocumentException;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.WorkbookFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.pl.model.WdPlOriginalDataFuzhou;
+import com.bk.wd.pl.service.WdPlOriginalDataFuzhouService;
+import com.bk.wd.pl.util.InitCardInfo;
+import com.bk.wd.pl.util.InitCardInfo4Fuzhou;
+import com.bk.wd.web.utils.ExcelUtils;
+
+@Controller
+@RequestMapping(value = "/wdpl/originaldatafuzhou/")
+public class WdPlOriginalDataFuzhouController {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(WdPlOriginalDataFuzhouController.class);
+    
+    @Autowired
+    private WdPlOriginalDataFuzhouService wdPlOriginalDataFuzhouService;
+    
+    /**
+     * 福州放款的台账数据导入
+     * @param excelFile
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/implExcelData" )
+    @ResponseBody
+    @Transactional
+    public JsonResult implExcelData(@RequestParam(value = "excelFile", required = false)MultipartFile excelFile, HttpServletRequest request) {
+        String fileName = excelFile.getOriginalFilename();
+        String fileType = fileName.substring(fileName.lastIndexOf("."), fileName.length());
+        if (!(fileType.equals(".xlsx") || fileType.equals(".xls"))) {
+            return new JsonResult(false, "上传的文件不是Excel文件");
+        }
+
+        Workbook workbook = null;
+        try {
+            workbook = WorkbookFactory.create(excelFile.getInputStream());
+        } catch (EncryptedDocumentException | InvalidFormatException | IOException e) {
+            LOGGER.error("上传excel", e);
+            return new JsonResult(false, "当前模板不是最新,请下载最新的调查模板");
+        }
+
+        Date now = new Date();
+        Sheet sheet = workbook.getSheetAt(0);
+        for (int rowNumber = 1; rowNumber <= sheet.getLastRowNum(); rowNumber++) {
+            Row row= sheet.getRow(rowNumber);
+            WdPlOriginalDataFuzhou wdPlOriginalDataFuzhou = new WdPlOriginalDataFuzhou();
+            wdPlOriginalDataFuzhou.setId(UidUtil.uuid());
+            wdPlOriginalDataFuzhou.setCreateDate(now);
+            wdPlOriginalDataFuzhou.setKaHao(ExcelUtils.getValue(row.getCell(0)));
+            wdPlOriginalDataFuzhou.setKaPianChanPinZhongLei(ExcelUtils.getValue(row.getCell(1)));
+            wdPlOriginalDataFuzhou.setKaiHuRiQi(ExcelUtils.getValue(row.getCell(2)));
+            wdPlOriginalDataFuzhou.setKeHuMingChen(ExcelUtils.getValue(row.getCell(3)));
+            wdPlOriginalDataFuzhou.setKaPianDaoQiRi(ExcelUtils.getValue(row.getCell(4)));
+            wdPlOriginalDataFuzhou.setZhengJianLeiXing(ExcelUtils.getValue(row.getCell(5)));
+            wdPlOriginalDataFuzhou.setZhengJianHaoMa(ExcelUtils.getValue(row.getCell(6)));
+            wdPlOriginalDataFuzhou.setXinYongEDu(ExcelUtils.getValue(row.getCell(7)));
+            wdPlOriginalDataFuzhou.setFenQiFuKuanXinYongEDu(ExcelUtils.getValue(row.getCell(8)));
+            wdPlOriginalDataFuzhou.setZongYuE(ExcelUtils.getValue(row.getCell(9)));
+            wdPlOriginalDataFuzhou.setTouZhiBenJin(ExcelUtils.getValue(row.getCell(10)));
+            wdPlOriginalDataFuzhou.setZhengChangTouZhiBenJin(ExcelUtils.getValue(row.getCell(11)));
+            wdPlOriginalDataFuzhou.setYuQiTouZhiBenJin(ExcelUtils.getValue(row.getCell(12)));
+            wdPlOriginalDataFuzhou.setDaiZhiTouZhiBenJin(ExcelUtils.getValue(row.getCell(13)));
+            wdPlOriginalDataFuzhou.setDaiZhangTouZhiBenJin(ExcelUtils.getValue(row.getCell(14)));
+            wdPlOriginalDataFuzhou.setTouZhiBiaoNeiLiXi(ExcelUtils.getValue(row.getCell(15)));
+            wdPlOriginalDataFuzhou.setTouZhiBiaoWaiLiXi(ExcelUtils.getValue(row.getCell(16)));
+            wdPlOriginalDataFuzhou.setFenQiFuKuanShengYuBenJin(ExcelUtils.getValue(row.getCell(17)));
+            wdPlOriginalDataFuzhou.setZhangHuZhuangTai(ExcelUtils.getValue(row.getCell(18)));
+            wdPlOriginalDataFuzhou.setHaiKuanJieZhiRiQi(ExcelUtils.getValue(row.getCell(19)));
+            wdPlOriginalDataFuzhou.setYuQiRiQi(ExcelUtils.getValue(row.getCell(20)));
+            wdPlOriginalDataFuzhou.setZhuanTouZhiRiQi(ExcelUtils.getValue(row.getCell(21)));
+            wdPlOriginalDataFuzhou.setYuQiBiaoZhi(ExcelUtils.getValue(row.getCell(22)));
+            wdPlOriginalDataFuzhou.setShangQiWuJiFenLeiBiaoZhi(ExcelUtils.getValue(row.getCell(23)));
+            wdPlOriginalDataFuzhou.setWuJiFenLeiZhuangTai(ExcelUtils.getValue(row.getCell(24)));
+            wdPlOriginalDataFuzhou.setZhuGuanKeHuJingLi(ExcelUtils.getValue(row.getCell(25)));
+            wdPlOriginalDataFuzhou.setZhangWuJiGou(ExcelUtils.getValue(row.getCell(26)));
+            wdPlOriginalDataFuzhou.setZhuGuanJiGou(ExcelUtils.getValue(row.getCell(27)));
+            wdPlOriginalDataFuzhou.setDanBaoRenZhengJianHaoMa(ExcelUtils.getValue(row.getCell(28)));
+            wdPlOriginalDataFuzhou.setDanBaoRenMingChen(ExcelUtils.getValue(row.getCell(29)));
+            wdPlOriginalDataFuzhou.setDanBaoRenShouJi(ExcelUtils.getValue(row.getCell(30)));
+            wdPlOriginalDataFuzhou.setKeHuHangYe(ExcelUtils.getValue(row.getCell(31)));
+            wdPlOriginalDataFuzhou.setDanBaoFangShi(ExcelUtils.getValue(row.getCell(32)));
+            wdPlOriginalDataFuzhou.setXingBie(ExcelUtils.getValue(row.getCell(33)));
+            wdPlOriginalDataFuzhou.setChuShengRiQi(ExcelUtils.getValue(row.getCell(34)));
+            wdPlOriginalDataFuzhou.setLianXiDianHua(ExcelUtils.getValue(row.getCell(35)));
+            wdPlOriginalDataFuzhou.setLianXiDiZhi(ExcelUtils.getValue(row.getCell(36)));
+            wdPlOriginalDataFuzhou.setQiXian(ExcelUtils.getValue(row.getCell(37)));
+            wdPlOriginalDataFuzhou.setLiLvLeiXing(ExcelUtils.getValue(row.getCell(38)));
+            wdPlOriginalDataFuzhou.setYingZiEDu(ExcelUtils.getValue(row.getCell(39)));
+            wdPlOriginalDataFuzhou.setBenQiFeiYongZongE(ExcelUtils.getValue(row.getCell(40)));
+            wdPlOriginalDataFuzhou.setBenQiBiaoNeiYingShouFeiYong(ExcelUtils.getValue(row.getCell(41)));
+            wdPlOriginalDataFuzhou.setBiaoWaiYingShouFeiYong(ExcelUtils.getValue(row.getCell(42)));
+            wdPlOriginalDataFuzhou.setZuiDiHaiKuanEWeiHaiBuFen(ExcelUtils.getValue(row.getCell(43)));
+            wdPlOriginalDataFuzhou.setDanWeiShuXing(ExcelUtils.getValue(row.getCell(44)));
+            wdPlOriginalDataFuzhou.setShiFouHeXiaoKaPian(ExcelUtils.getValue(row.getCell(45)));
+            wdPlOriginalDataFuzhou.setTuiJianRenDaiHao(ExcelUtils.getValue(row.getCell(46)));
+            
+            wdPlOriginalDataFuzhou.setCreateBy(UserUtils.getUser().getId());
+            wdPlOriginalDataFuzhouService.insertSelective(wdPlOriginalDataFuzhou);
+        }
+        //清洗福州数据
+        InitCardInfo initCardInfo = new InitCardInfo4Fuzhou();
+        initCardInfo.init();
+        return new JsonResult();
+    }
+    
+    
+}

+ 219 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlOriginalDataLuoyangController.java

@@ -0,0 +1,219 @@
+package com.bk.wd.web.controller.wdpl;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson.JSONObject;
+import com.antgroup.zmxy.openplatform.api.internal.mapping.ApiField;
+import com.bk.common.utils.DateUtils;
+import com.bk.wd.model.WdApplication;
+import com.bk.wd.pl.model.WdPlOriginalDataLuoyangLog;
+import com.bk.wd.pl.service.WdPlOriginalDataLuoyangLogService;
+import com.bk.wd.service.WdApplicationService;
+import org.apache.commons.collections.list.CursorableLinkedList;
+import org.apache.poi.EncryptedDocumentException;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.WorkbookFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.pl.model.WdPlOriginalDataLuoyang;
+import com.bk.wd.pl.service.WdPlOriginalDataLuoyangService;
+import com.bk.wd.web.utils.ExcelUtils;
+
+@Controller
+@RequestMapping(value = "/wdpl/originaldataluoyang/")
+public class WdPlOriginalDataLuoyangController {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(WdPlOriginalDataLuoyangController.class);
+    
+    @Autowired
+    private WdPlOriginalDataLuoyangService wdPlOriginalDataLuoyangService;
+
+    @Autowired
+    private WdApplicationService wdApplicationService;
+
+    @Autowired
+    private WdPlOriginalDataLuoyangLogService wdPlOriginalDataLuoyangLogService;
+    
+    /**
+     * 洛阳放款的台账数据导入
+     * @param excelFile
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/implExcelData" )
+    @ResponseBody
+    @Transactional
+    public JsonResult implExcelData(@RequestParam(value = "excelFile", required = false)MultipartFile excelFile, HttpServletRequest request) {
+        String fileName = excelFile.getOriginalFilename();
+        String fileType = fileName.substring(fileName.lastIndexOf("."), fileName.length());
+        if (!(fileType.equals(".xlsx") || fileType.equals(".xls"))) {
+            return new JsonResult(false, "上传的文件不是Excel文件");
+        }
+
+        Workbook workbook = null;
+        try {
+            workbook = WorkbookFactory.create(excelFile.getInputStream());
+        } catch (EncryptedDocumentException | InvalidFormatException | IOException e) {
+            LOGGER.error("上传excel", e);
+            return new JsonResult(false, "当前模板不是最新,请下载最新的调查模板");
+        }
+
+        Date now = new Date();
+        Sheet sheet = workbook.getSheetAt(0);
+        List<Map<String,Object>> applicationList = wdApplicationService.queryApplicationInfoListStatus();
+        Map<String,Object> resultErrorMap1 = new HashMap<>();//统计重复数据
+        Map<String,Object> resultErrorMap2 = new HashMap<>();//统计重复数据结果
+        List<Map<String,Object>> applicationList2048 = new ArrayList<>();
+        List<WdPlOriginalDataLuoyang> wdPlOriginalDataLuoyangList = new ArrayList<>();
+        List<WdPlOriginalDataLuoyang> wdPlOriginalDataLuoyangList512 = new ArrayList<>();
+        int rowNumber = 4;
+        for (; rowNumber <= sheet.getLastRowNum(); rowNumber++) {
+            Row row= sheet.getRow(rowNumber);
+            WdPlOriginalDataLuoyang wdPlOriginalDataLuoyang = new WdPlOriginalDataLuoyang();
+            wdPlOriginalDataLuoyang.setId(UidUtil.uuid());
+            wdPlOriginalDataLuoyang.setCreateDate(now);
+            wdPlOriginalDataLuoyang.setCreateBy(UserUtils.getUser().getId());
+            
+            wdPlOriginalDataLuoyang.setPipeProtectionMechanism(ExcelUtils.getValue(row.getCell(0)));
+            wdPlOriginalDataLuoyang.setEntryAgency(ExcelUtils.getValue(row.getCell(1)));
+            wdPlOriginalDataLuoyang.setCustomerCode(ExcelUtils.getValue(row.getCell(2)));
+            wdPlOriginalDataLuoyang.setCustomerName(ExcelUtils.getValue(row.getCell(3)));
+            wdPlOriginalDataLuoyang.setContactAddress(ExcelUtils.getValue(row.getCell(4)));
+            wdPlOriginalDataLuoyang.setContactPhone(ExcelUtils.getValue(row.getCell(5)));
+            wdPlOriginalDataLuoyang.setLoanVariety(ExcelUtils.getValue(row.getCell(6)));
+            wdPlOriginalDataLuoyang.setLoanInvestment(ExcelUtils.getValue(row.getCell(7)));
+            wdPlOriginalDataLuoyang.setLoanUse(ExcelUtils.getValue(row.getCell(8)));
+            wdPlOriginalDataLuoyang.setLoanAccount(ExcelUtils.getValue(row.getCell(9)));
+            wdPlOriginalDataLuoyang.setContractCode(ExcelUtils.getValue(row.getCell(10)));
+            wdPlOriginalDataLuoyang.setIouCode(ExcelUtils.getValue(row.getCell(11)));
+            wdPlOriginalDataLuoyang.setGuaranteeMethod(ExcelUtils.getValue(row.getCell(12)));
+            wdPlOriginalDataLuoyang.setFiveLevelClassification(ExcelUtils.getValue(row.getCell(13)));
+            wdPlOriginalDataLuoyang.setIouAmount(ExcelUtils.stringToBig(ExcelUtils.getValue(row.getCell(14))));
+            wdPlOriginalDataLuoyang.setLoanAmount(ExcelUtils.stringToBig(ExcelUtils.getValue(row.getCell(15))));
+            wdPlOriginalDataLuoyang.setLoanBalance(ExcelUtils.stringToBig(ExcelUtils.getValue(row.getCell(16))));
+            wdPlOriginalDataLuoyang.setStartDay(ExcelUtils.getValue(row.getCell(17)));
+            wdPlOriginalDataLuoyang.setDueDate(ExcelUtils.getValue(row.getCell(18)));
+            wdPlOriginalDataLuoyang.setInterestRate(ExcelUtils.stringToBig(ExcelUtils.getValue(row.getCell(19))));
+            wdPlOriginalDataLuoyang.setLoanMethod(ExcelUtils.getValue(row.getCell(20)));
+            wdPlOriginalDataLuoyang.setCustomerManager(ExcelUtils.getValue(row.getCell(21)));
+            
+            wdPlOriginalDataLuoyangService.insertSelective(wdPlOriginalDataLuoyang);
+
+            wdPlOriginalDataLuoyangList.add(wdPlOriginalDataLuoyang);
+            //找出已结清的数据
+            for (Map<String,Object> app:applicationList){
+                if (app.get("phone").equals(wdPlOriginalDataLuoyang.getContactPhone()) && app.get("cuName").equals(wdPlOriginalDataLuoyang.getCustomerName()) && wdPlOriginalDataLuoyang.getLoanAmount().compareTo(new BigDecimal(app.get("amount").toString()))==0 ) {
+                    //把Excel和数据中能够对应上的数据保存下来
+                    if(app.get("status").equals(512)){
+                        wdPlOriginalDataLuoyangList512.add(wdPlOriginalDataLuoyang);
+                    }
+                    if(app.get("status").equals(2048)){//保存还款中状态的记录
+                        applicationList2048.add(app);
+                    }
+                    String contractCode = wdPlOriginalDataLuoyang.getContractCode();
+                    if(!resultErrorMap1.containsKey(contractCode)){
+                        resultErrorMap1.put(contractCode,1);
+                    }else{
+                        resultErrorMap1.put(contractCode,((Integer)resultErrorMap1.get(contractCode)+1));
+                    }
+                    if(((Integer)resultErrorMap1.get(contractCode)>=2)){
+                        applicationList2048.remove(app);
+                        resultErrorMap2.put(contractCode,resultErrorMap1.get(contractCode));
+                    }
+                }
+            }
+        }
+        //删除相同的元素,保留未匹配到的元素
+        wdPlOriginalDataLuoyangList.removeAll(applicationList);
+
+        //执行数据处理任务
+        Thread thread = new Thread(new ApplicationStatusWith(wdPlOriginalDataLuoyangList512,applicationList2048));
+        thread.start();
+
+        // TODO: 暂时不做贷后任务
+
+        //保存数据
+        WdPlOriginalDataLuoyangLog luoyangLog = new WdPlOriginalDataLuoyangLog();
+        boolean isSuccess = true;
+        Map<String,Object> map = new HashMap<>();
+        map.put("resultMsg","导入成功!");
+        map.put("resultErrorMap",resultErrorMap2);//重复数据
+        map.put("notInMap",wdPlOriginalDataLuoyangList);//不存在的数据
+        if(resultErrorMap2.size()>0||wdPlOriginalDataLuoyangList.size()>0){
+            //保存错误信息
+            map.put("resultMsg","导入出错!");
+            isSuccess = false;
+        }
+        luoyangLog.setId(UidUtil.uuid());
+        luoyangLog.setResult(isSuccess);
+        luoyangLog.setResultJson(JSONObject.toJSONString(map));
+        luoyangLog.setCreateDate(new Date());
+        luoyangLog.setCreateBy(UserUtils.getUser().getId());
+        wdPlOriginalDataLuoyangLogService.insertSelective(luoyangLog);
+        return new JsonResult();
+    }
+
+    @RequestMapping(value = "/dataInput" )
+    public String dataInput(Model model, HttpServletRequest request, HttpServletResponse response){
+        WdPlOriginalDataLuoyangLog dataLuoyangLog = wdPlOriginalDataLuoyangLogService.selectLastOneByUserId(UserUtils.getUser().getId());
+        if(dataLuoyangLog!=null){
+            Map<String,Object> map = new  HashMap<String,Object>();
+            model.addAttribute("resultSuccess",dataLuoyangLog.getResult());
+            model.addAttribute("inputResult",JSONObject.parseObject(dataLuoyangLog.getResultJson(),map.getClass()));
+            model.addAttribute("upTime", DateUtils.formatDate(dataLuoyangLog.getCreateDate(),"yyyy-MM-dd HH:mm:ss"));
+        }
+
+        return "/modules/wd/dataManager/dataInput";
+    }
+
+    /***
+     * 处理数据
+     */
+    class ApplicationStatusWith implements Runnable{
+
+        private List<WdPlOriginalDataLuoyang> wdPlOriginalDataLuoyangList;
+
+        private List<Map<String,Object>> applicationList;
+
+        public ApplicationStatusWith(List<WdPlOriginalDataLuoyang> wdPlOriginalDataLuoyangList, List<Map<String, Object>> applicationList) {
+            this.wdPlOriginalDataLuoyangList = wdPlOriginalDataLuoyangList;
+            this.applicationList = applicationList;
+        }
+
+        @Override
+        public void run() {
+            wdPlOriginalDataLuoyangList.forEach(l->{
+                String amount = l.getLoanAmount()==null?"0":l.getLoanAmount().toString();
+                wdApplicationService.updateApplicationInfoListStatus512(l.getContractCode(),l.getContactPhone(),l.getCustomerName(),amount);
+            });
+            applicationList.forEach(l->{
+                WdApplication app = new WdApplication();
+                app.setId(l.get("applicationId").toString());
+                app.setStatus(4096);
+                app.setStatusName("贷款完结");
+                wdApplicationService.updateByPrimaryKeySelective(app);
+            });
+        }
+    }
+
+}

+ 76 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlPolicyController.java

@@ -0,0 +1,76 @@
+package com.bk.wd.web.controller.wdpl;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.wd.pl.service.WdPlCallbackPolicyService;
+import com.bk.wd.pl.service.WdPlRiskInquiryPolicyService;
+import com.bk.wd.pl.util.TimingPolicyHandle;
+
+@Controller
+@RequestMapping(value = "/wdpl/policy")
+public class WdPlPolicyController {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(WdPlPolicyController.class);
+
+    @Autowired
+    private WdPlCallbackPolicyService wdPlCallbackPolicyService;
+
+    @Autowired
+    private WdPlRiskInquiryPolicyService wdPlRiskInquiryPolicyService;
+
+    @Autowired
+    private TimingPolicyHandle timingPolicyHandle;
+
+    @RequestMapping(value = "/list")
+    public String list(Integer policyType, Model model) {
+        if (null == policyType) {
+            policyType = 1;
+        }
+
+        if (policyType == 4) {
+            model.addAttribute("policyList", wdPlRiskInquiryPolicyService.selectByParams(null));
+        } else {
+            model.addAttribute("policyList", wdPlCallbackPolicyService.selectByType(policyType));
+        }
+        model.addAttribute("policyType", policyType);
+        return "/modules/wdpl/policyList";
+    }
+
+    @RequestMapping(value = "/test")
+    public String test(Model model) {
+        return "/modules/wdpl/policyTest";
+    }
+
+    @RequestMapping(value = "/test/review")
+    @ResponseBody
+    public JsonResult testReview() {
+        // try {
+        timingPolicyHandle.runCallbackPolicy();
+        // } catch (Exception e) {
+        // System.out.println(e);
+        // return new JsonResult(false, e.getMessage());
+        // }
+        return new JsonResult(true, "回访策略运行完成");
+    }
+
+    @RequestMapping(value = "/test/risk")
+    @ResponseBody
+    public JsonResult testRisk() {
+        // try {
+        timingPolicyHandle.runRiskPolicy();
+        // } catch (Exception e) {
+        // System.out.println(e);
+        // return new JsonResult(false, e.getMessage());
+        // }
+
+        return new JsonResult(true, "风险策略运行完成");
+    }
+
+}

+ 101 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wdpl/WdPlRiskInquiryPolicyController.java

@@ -0,0 +1,101 @@
+package com.bk.wd.web.controller.wdpl;
+
+import java.util.Date;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.alibaba.fastjson.JSON;
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.StringUtils;
+import com.bk.sys.security.utils.IdGen;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.pl.model.WdPlRiskInquiryPolicy;
+import com.bk.wd.pl.model.WdPlRiskInquiryPolicyItem;
+import com.bk.wd.pl.service.WdPlRiskInquiryPolicyItemService;
+import com.bk.wd.pl.service.WdPlRiskInquiryPolicyService;
+
+@Controller
+@RequestMapping(value = "/wdpl/riskInquiry/policy")
+public class WdPlRiskInquiryPolicyController {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(WdPlRiskInquiryPolicyController.class);
+    
+    @Autowired
+    private WdPlRiskInquiryPolicyService wdPlRiskInquiryPolicyService;
+    
+    @Autowired
+    private WdPlRiskInquiryPolicyItemService wdPlRiskInquiryPolicyItemService;
+    
+    @ModelAttribute("wdPlRiskInquiryPolicy")
+    public WdPlRiskInquiryPolicy get(@RequestParam(required=false) String id) {
+        if (StringUtils.isNotBlank(id)){
+            return wdPlRiskInquiryPolicyService.selectByPrimaryKey(id);
+        }else{
+            return new WdPlRiskInquiryPolicy();
+        }
+    }
+
+    @RequestMapping(value = "/form")
+    public String form(WdPlRiskInquiryPolicy wdPlRiskInquiryPolicy, Model model) {
+        if (null != wdPlRiskInquiryPolicy && StringUtils.isNotEmpty(wdPlRiskInquiryPolicy.getId())) {
+            wdPlRiskInquiryPolicy.setPolicyItemList(wdPlRiskInquiryPolicyItemService.selectByRiskInquiryPolicyId(wdPlRiskInquiryPolicy.getId()));
+        }
+        model.addAttribute("wdPlRiskInquiryPolicy", wdPlRiskInquiryPolicy);
+        return "modules/wdpl/riskInquiry/policyForm";
+    }
+    
+    @RequestMapping(value = "/save")
+    @ResponseBody
+    public JsonResult save(WdPlRiskInquiryPolicy wdPlRiskInquiryPolicy, String policyItems, Model model) {
+        if (StringUtils.isEmpty(wdPlRiskInquiryPolicy.getId())) {
+            wdPlRiskInquiryPolicy.setId(IdGen.uuid());
+            wdPlRiskInquiryPolicy.setCompanyId(UserUtils.getUser().getCompanyId());
+            wdPlRiskInquiryPolicy.setCreateBy(UserUtils.getUser().getId());
+            wdPlRiskInquiryPolicy.setCreateDate(new Date());
+            wdPlRiskInquiryPolicy.setUpdateBy(UserUtils.getUser().getId());
+            wdPlRiskInquiryPolicy.setUpdateDate(new Date());
+            wdPlRiskInquiryPolicyService.insertSelective(wdPlRiskInquiryPolicy);
+        } else {
+            wdPlRiskInquiryPolicy.setUpdateBy(UserUtils.getUser().getId());
+            wdPlRiskInquiryPolicy.setUpdateDate(new Date());
+            wdPlRiskInquiryPolicyService.updateByPrimaryKeySelective(wdPlRiskInquiryPolicy);
+            wdPlRiskInquiryPolicyItemService.deleteByRiskInquiryPolicyId(wdPlRiskInquiryPolicy.getId());
+        }
+        
+        WdPlRiskInquiryPolicyItem[] WdPlRiskInquiryPolicyItemArray = JSON.parseObject(policyItems, WdPlRiskInquiryPolicyItem[].class);
+        for (WdPlRiskInquiryPolicyItem wdPlRiskInquiryPolicyItem : WdPlRiskInquiryPolicyItemArray) {
+            wdPlRiskInquiryPolicyItem.setId(IdGen.uuid());
+            wdPlRiskInquiryPolicyItem.setRiskInquiryPolicyId(wdPlRiskInquiryPolicy.getId());
+            wdPlRiskInquiryPolicyItemService.insert(wdPlRiskInquiryPolicyItem);
+        }
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "/del")
+    @ResponseBody
+    public JsonResult del(WdPlRiskInquiryPolicy wdPlRiskInquiryPolicy, Model model) {
+        wdPlRiskInquiryPolicy.setDelFlag(true);
+        wdPlRiskInquiryPolicy.setUpdateBy(UserUtils.getUser().getId());
+        wdPlRiskInquiryPolicy.setUpdateDate(new Date());
+        wdPlRiskInquiryPolicyService.updateByPrimaryKeySelective(wdPlRiskInquiryPolicy);
+        return new JsonResult();
+    }
+    
+    @RequestMapping(value = "enable")
+    @ResponseBody
+    public JsonResult disable(WdPlRiskInquiryPolicy wdPlRiskInquiryPolicy) {
+        wdPlRiskInquiryPolicy.setUpdateBy(UserUtils.getUser().getId());
+        wdPlRiskInquiryPolicy.setUpdateDate(new Date());
+        wdPlRiskInquiryPolicyService.updateByPrimaryKeySelective(wdPlRiskInquiryPolicy);
+        return new JsonResult();
+    }
+
+}

+ 117 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/wx/feedbackController.java

@@ -0,0 +1,117 @@
+package com.bk.wd.web.controller.wx;
+
+import java.io.UnsupportedEncodingException;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.Pagination;
+import com.bk.common.utils.StringUtils;
+import com.bk.wd.model.WdFdComplaint;
+import com.bk.wd.model.WdFdScore;
+import com.bk.wd.service.WdFdComplaintService;
+import com.bk.wd.service.WdFdScoreService;
+import com.bk.wd.web.base.BaseController;
+
+@Controller
+@RequestMapping(value = "/wx/feedback")
+public class feedbackController extends BaseController {
+
+    @Autowired
+    private WdFdScoreService wdFdScoreService;
+
+    @Autowired
+    private WdFdComplaintService wdFdComplaintService;
+
+    @RequestMapping(value = "/score/list")
+    public String scoreList(Model model, HttpServletRequest request, Pagination pagination, String manager) {
+        wdFdScoreService.selectByManager(manager, pagination);
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("manager", manager);
+
+        return "modules/wx/scoreList";
+    }
+
+    @RequestMapping(value = "/complaint/list")
+    public String complaintList(Model model, Pagination pagination, String manager) {
+        wdFdComplaintService.selectByManager(manager, pagination);
+        model.addAttribute("pagination", pagination);
+        model.addAttribute("manager", manager);
+
+        return "modules/wx/complaintList";
+    }
+
+    @RequestMapping(value = "/score/detail")
+    public String scoreDetail(Model model, HttpServletRequest request, String current, String manager) {
+        model.addAttribute("list", wdFdScoreService.selectAvg(null));
+        model.addAttribute("current", current);
+        model.addAttribute("manager", manager);
+
+        return "modules/wx/scoreDetail";
+    }
+
+    @RequestMapping(value = "/score/user")
+    public String userScoreList(Model model, String userId) {
+        List<Map<String, String>> result = new ArrayList<>();
+        List<WdFdScore> list = wdFdScoreService.selectByUserId(userId);
+
+        if (!list.isEmpty() && list.get(0) != null) {
+
+            model.addAttribute("userName", list.get(0).getUserName());
+            
+            SimpleDateFormat formatterMonth = new SimpleDateFormat("yyyy-MM");
+            DecimalFormat df = new DecimalFormat("0.0");
+            String date = formatterMonth.format(list.get(0).getCreateDate());
+            float scoreService = 0;
+            float scoreEfficiency = 0;
+            float scoreProbity = 0;
+            float size = 0;
+
+            for (WdFdScore score : list) {
+                String date2 = formatterMonth.format(score.getCreateDate());
+                if (!date.equals(date2)) {
+                    Map<String, String> map = new HashMap<>();
+                    map.put("month", date);
+                    map.put("scoreService", df.format(scoreService / size));
+                    map.put("scoreEfficiency", df.format(scoreEfficiency / size));
+                    map.put("scoreProbity", df.format(scoreProbity / size));
+                    map.put("scoreAvg", df.format((scoreService + scoreEfficiency + scoreProbity) / size / 3));
+                    result.add(map);
+                    
+                    date = date2;
+                    scoreService = 0;
+                    scoreEfficiency = 0;
+                    scoreProbity = 0;
+                    size = 0;
+                }
+
+                scoreService += score.getScoreService();
+                scoreEfficiency += score.getScoreEfficiency();
+                scoreProbity += score.getScoreProbity();
+                size += 1;
+            }
+            Map<String, String> map = new HashMap<>();
+            map.put("month", date);
+            map.put("scoreService", df.format(scoreService / size));
+            map.put("scoreEfficiency", df.format(scoreEfficiency / size));
+            map.put("scoreProbity", df.format(scoreProbity / size));
+            map.put("scoreAvg", df.format((scoreService + scoreEfficiency + scoreProbity) / size / 3));
+            result.add(map);
+        }
+
+        model.addAttribute("list", result);
+        return "modules/wx/scoreDetailUser";
+    }
+}

+ 378 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/xcx/CustomerEntranceController.java

@@ -0,0 +1,378 @@
+package com.bk.wd.web.controller.xcx;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.Date;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import javax.imageio.ImageIO;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+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 org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.service.DfsService;
+import com.bk.common.utils.EntityUtils;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdCeFrom;
+import com.bk.wd.model.WdCeProductWithBLOBs;
+import com.bk.wd.model.WdCustomerType;
+import com.bk.wd.service.WdCeCustomerService;
+import com.bk.wd.service.WdCeFromService;
+import com.bk.wd.service.WdCeProductService;
+import com.bk.wd.util.BusinessConsts.TrueOrFalseAsString;
+import com.bk.wd.web.base.BaseController;
+import com.bk.wd.web.utils.MatrixToImageWriter;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+
+@Controller
+@RequestMapping(value = "/customer4c")
+public class CustomerEntranceController extends BaseController {
+
+	private static final Logger LOGGER = LoggerFactory.getLogger(CustomerEntranceController.class);
+
+	@Autowired
+	private WdCeProductService ceProductService;
+
+	@Autowired
+	private WdCeCustomerService ceCustomerService;
+
+	@Autowired
+	private DfsService dfsService;
+
+	@Autowired
+	private WdCeFromService cefromService;
+
+	@Value("${app.api.url}")
+	private String app_api_url;
+
+	@Value("${wxstatic.resources.url}")
+	private String wsstatic_resources_url;
+
+	@RequestMapping(value = { "/from/list" })
+	public String fromList(Model model, HttpServletRequest request) {
+
+		String referer = request.getHeader("Referer");
+		request.getSession().setAttribute("from_back_url", referer);
+
+		SysUser currentUser = UserUtils.getUser();
+		List<WdCeFrom> froms = cefromService.selectByCompanyId(currentUser.getCompanyId());
+		List<Map<String, Object>> list = EntityUtils.convertToListMap(froms, "id", "fromA", "fromB", "createDate");
+		for (Map<String, Object> map : list) {
+			String fromA = map.get("fromA").toString();
+			Integer count = ceCustomerService.countByFromA(currentUser.getCompanyId(), fromA);
+			map.put("count", count);
+		}
+
+		model.addAttribute("list", list);
+
+		return "modules/xcx/fromList";
+	}
+
+	@RequestMapping(value = { "/from/DRCode" })
+	public void fromQRCode(String id, HttpServletRequest request, HttpServletResponse response) {
+		if (StringUtils.isBlank(id)) {
+			return;
+		}
+
+		WdCeFrom from = cefromService.selectByPrimaryKey(id);
+		if (null == from) {
+			return;
+		}
+
+		if (StringUtils.isBlank(from.getFromA())) {
+			return;
+		}
+
+		String url = wsstatic_resources_url + "wap_wd/html/index.html?site=" + URLEncoder.encode(app_api_url)
+				+ "&companyId=" + from.getCompanyId() + "&fromA=" + from.getFromA();
+
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("application/octet-stream");
+
+		String fileName = from.getFromA() + ".png";
+		try {
+			fileName = new String(fileName.getBytes(), "ISO-8859-1");
+		} catch (UnsupportedEncodingException e1) {
+			LOGGER.error(e1.getMessage(), e1);
+			fileName = "DRCode.png";
+		}
+
+		response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
+
+		try (ServletOutputStream outputStream = response.getOutputStream();) {
+
+			Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
+			hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
+			BitMatrix bitMatrix = new MultiFormatWriter().encode(url, BarcodeFormat.QR_CODE, 520, 520, hints);
+			MatrixToImageWriter.writeToStream(bitMatrix, "png", outputStream);
+
+		} catch (IOException | WriterException e) {
+			LOGGER.error(e.getMessage(), e);
+		} finally {
+
+		}
+	}
+
+	@RequestMapping(value = { "/from/form" }, method = { RequestMethod.GET })
+	public String editFrom(Model model) {
+
+		SysUser currentUser = UserUtils.getUser();
+		WdCeFrom from = new WdCeFrom();
+		from.setCompanyId(currentUser.getCompanyId());
+
+		model.addAttribute("from", from);
+		return "modules/xcx/fromForm";
+	}
+
+	@RequestMapping(value = { "/from/form" }, method = { RequestMethod.POST })
+	public String saveFrom(WdCeFrom model) {
+		SysUser currentUser = UserUtils.getUser();
+
+		String fromA = model.getFromA();
+		if (StringUtils.isBlank(fromA)) {
+			return "modules/xcx/fromForm";
+		}
+
+		String companyId = model.getCompanyId();
+		if (StringUtils.isBlank(companyId)) {
+			companyId = currentUser.getCompanyId();
+		}
+
+		WdCeFrom oldFrom = cefromService.selectByCompanyIdAndFromA(companyId, fromA);
+		if (null != oldFrom) {
+			return "modules/xcx/fromForm";
+		}
+
+		model.setId(UidUtil.uuid());
+		model.setCompanyId(companyId);
+		model.setCreateBy(currentUser.getId());
+		model.setCreateDate(new Date());
+		model.setUpdateBy(currentUser.getId());
+		model.setUpdateDate(new Date());
+
+		cefromService.insertSelective(model);
+
+		return "modules/xcx/fromForm";
+	}
+
+	@RequestMapping(value = { "/product/list" })
+	public String listProduct(Model model) {
+		SysUser currentUser = UserUtils.getUser();
+
+		List<WdCeProductWithBLOBs> list = ceProductService.selectByCompanyId(currentUser.getCompanyId());
+		model.addAttribute("products", list);
+
+		return "modules/xcx/productList";
+	}
+
+	@RequestMapping(value = { "/product" }, method = { RequestMethod.DELETE })
+	@ResponseBody
+	public JsonResult deleteProduct(String id) {
+		SysUser currentUser = UserUtils.getUser();
+
+		WdCeProductWithBLOBs product = ceProductService.selectByPrimaryKey(id);
+		product.setEnable(TrueOrFalseAsString.False);
+		product.setDelFlag(true);
+		product.setUpdateBy(currentUser.getId());
+		product.setUpdateDate(new Date());
+
+		ceProductService.updateByPrimaryKeySelective(product);
+
+		return new JsonResult();
+	}
+
+	@RequestMapping(value = { "/product" }, method = { RequestMethod.PUT })
+	@ResponseBody
+	public JsonResult enableProduct(String id, String enable) {
+		SysUser currentUser = UserUtils.getUser();
+
+		WdCeProductWithBLOBs product = ceProductService.selectByPrimaryKey(id);
+		product.setEnable(enable);
+		product.setUpdateBy(currentUser.getId());
+		product.setUpdateDate(new Date());
+
+		ceProductService.updateByPrimaryKeySelective(product);
+
+		return new JsonResult();
+	}
+
+	@RequestMapping(value = { "/product/form" }, method = { RequestMethod.GET })
+	public String editProduct(Model model, String id) {
+
+		WdCeProductWithBLOBs product = ceProductService.selectByPrimaryKey(id);
+		if (null == product) {
+			product = new WdCeProductWithBLOBs();
+			product.setBelongCompanyId(UserUtils.getUser().getCompanyId());
+		}
+
+		model.addAttribute("product", product);
+
+		return "modules/xcx/productForm";
+	}
+
+	@RequestMapping(value = { "/product/form" }, method = { RequestMethod.POST })
+	public String saveProduct(@RequestParam(value = "logoImg", required = false) CommonsMultipartFile logoImg,
+			@RequestParam(value = "backgroundImg", required = false) CommonsMultipartFile backgroundImg,
+			WdCeProductWithBLOBs product, HttpServletRequest request) {
+
+		try {
+			if (null != backgroundImg && !backgroundImg.isEmpty() && backgroundImg.getSize() > 0) {
+				product.setBackgroundUrl(
+						dfsService.uploadFile(backgroundImg.getBytes(), backgroundImg.getOriginalFilename()));
+			}
+
+			if (null != logoImg && !logoImg.isEmpty() && logoImg.getSize() > 0) {
+				product.setLogoUrl(dfsService.uploadFile(logoImg.getBytes(), logoImg.getOriginalFilename()));
+			}
+		} catch (IOException e) {
+			LOGGER.error("照片上传失败");
+		}
+
+		if (StringUtils.isBlank(product.getId())) {
+			product.setId(UidUtil.uuid());
+			product.setBelongCompanyId(UserUtils.getUser().getCompanyId());
+			product.setSort(999);
+			product.setCreateBy(UserUtils.getUser().getId());
+			product.setCreateDate(new Date());
+			product.setUpdateBy(UserUtils.getUser().getId());
+			product.setUpdateDate(new Date());
+
+			product.setDelFlag(false);
+
+			ceProductService.insertSelective(product);
+
+		} else {
+
+			product.setUpdateBy(UserUtils.getUser().getId());
+			product.setUpdateDate(new Date());
+
+			product.setDelFlag(false);
+
+			ceProductService.updateByPrimaryKeySelective(product);
+		}
+
+		return "modules/xcx/productList";
+	}
+
+	@RequestMapping(value = { "/product/sorts" })
+	@ResponseBody
+	public JsonResult sorts(String ids) {
+		if (StringUtils.isNoneEmpty(ids)) {
+			String[] idArray = ids.split(",");
+			for (int i = 0; i < idArray.length; i++) {
+				if (StringUtils.isNoneEmpty(idArray[i])) {
+					WdCeProductWithBLOBs product = ceProductService.selectByPrimaryKey(idArray[i]);
+					product.setSort(i);
+					product.setUpdateBy(UserUtils.getUser().getId());
+					product.setUpdateDate(new Date());
+					ceProductService.updateByPrimaryKeySelective(product);
+				}
+			}
+		}
+		return new JsonResult();
+	}
+
+	@RequestMapping(value = { "/product/uploadImg" }, method = { RequestMethod.POST })
+	@ResponseBody
+	public JsonResult uploadImg(@RequestParam MultipartFile imgFile, HttpServletRequest request, String id,
+			String imgType) {
+
+		if (imgFile.getSize() == 0) {
+			return new JsonResult(false, "图片读取失败");
+		}
+
+		String filePath = "";
+		String fileName = imgFile.getOriginalFilename();
+		String fileType = fileName.substring(fileName.lastIndexOf("."), fileName.length()).toLowerCase();
+
+		if (!(fileType.equals(".jpeg") || fileType.equals(".jpg") || fileType.equals(".bmp")
+				|| fileType.equals(".png"))) {
+			return new JsonResult(false, "目前只支持.jpg,.jpeg,.png,.bmp类型");
+		}
+
+		try {
+			BufferedImage sourceImg = ImageIO.read(imgFile.getInputStream());
+			System.out.println(sourceImg.getWidth());
+			System.out.println(sourceImg.getHeight());
+
+			if ("bg".equals(imgType) && (sourceImg.getWidth() != 1095 || sourceImg.getHeight() != 420)) {
+				return new JsonResult(false, "图片尺寸只能是1095*420");
+			}
+
+		} catch (IOException e1) {
+			e1.printStackTrace();
+
+			return new JsonResult(false, "图片读取失败");
+		}
+
+		try {
+			filePath = dfsService.uploadFile(imgFile.getBytes(), UidUtil.uuid() + imgFile.getOriginalFilename());
+		} catch (IOException e) {
+			LOGGER.error(e.getMessage(), e);
+			return new JsonResult(false, "图片上传失败");
+		}
+
+		WdCeProductWithBLOBs product = ceProductService.selectByPrimaryKey(id);
+		if (null == product || StringUtils.isBlank(product.getId())) {
+			product = new WdCeProductWithBLOBs();
+			if ("logo".equals(imgType)) {
+				product.setLogoUrl(filePath);
+			} else if ("bg".equals(imgType)) {
+				product.setBackgroundUrl(filePath);
+			}
+			product.setId(UidUtil.uuid());
+			product.setBelongCompanyId(UserUtils.getUser().getCompanyId());
+			product.setCreateBy(UserUtils.getUser().getId());
+			product.setCreateDate(new Date());
+			product.setUpdateBy(UserUtils.getUser().getId());
+			product.setUpdateDate(new Date());
+
+			product.setDelFlag(true);
+
+			ceProductService.insertSelective(product);
+		} else {
+
+			if ("logo".equals(imgType)) {
+				product.setLogoUrl(filePath);
+			} else if ("bg".equals(imgType)) {
+				product.setBackgroundUrl(filePath);
+			}
+			product.setUpdateBy(UserUtils.getUser().getId());
+			product.setUpdateDate(new Date());
+
+			ceProductService.updateByPrimaryKeySelective(product);
+		}
+
+		return new JsonResult(true, product.getId());
+	}
+}

+ 166 - 0
bk-wd-web/src/main/java/com/bk/wd/web/controller/xcx/CustomerServerController.java

@@ -0,0 +1,166 @@
+package com.bk.wd.web.controller.xcx;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.bk.common.entity.JsonResult;
+import com.bk.common.utils.JGMessageUtils;
+import com.bk.common.utils.StringUtils;
+import com.bk.common.utils.UidUtil;
+import com.bk.sys.model.SysUser;
+import com.bk.sys.security.utils.UserUtils;
+import com.bk.wd.model.WdCeCustomer;
+import com.bk.wd.model.WdCeCustomerTrack;
+import com.bk.wd.model.WdCeProductWithBLOBs;
+import com.bk.wd.model.WdMessage;
+import com.bk.wd.model.WdMessageReceiver;
+import com.bk.wd.service.WdCeCustomerService;
+import com.bk.wd.service.WdCeCustomerTrackService;
+import com.bk.wd.service.WdCeProductService;
+import com.bk.wd.service.WdMessageReceiverService;
+import com.bk.wd.service.WdMessageService;
+import com.bk.wd.util.BusinessConsts;
+import com.bk.wd.util.BusinessConsts.TrueOrFalseAsString;
+import com.bk.wd.web.base.BaseController;
+
+@Controller
+@RequestMapping(value = "/customer4c/server")
+public class CustomerServerController extends BaseController {
+
+	@Autowired
+	private WdCeCustomerService ceCustomerService;
+	@Autowired
+	private WdCeCustomerTrackService ceCustomerTrackService;
+	@Autowired
+	private WdCeProductService ceProductService;
+	@Autowired
+	private WdMessageService wdMessageService;
+	@Autowired
+	private WdMessageReceiverService wdMessageReceiverService;
+	@Autowired
+	private JGMessageUtils jgMessageUtils;
+
+	@RequiresPermissions("wd:4customer:view")
+	@RequestMapping(value = { "/list" })
+	public String list(Model model, WdCeCustomer ceCustomer, String target) {
+		SysUser currentUser = UserUtils.getUser();
+		ceCustomer.setBelongCompanyId(currentUser.getCompanyId());
+		if (StringUtils.isBlank(ceCustomer.getStatus()) || ceCustomer.getStatus().equals("0")) {
+			if (target.equals("assign")) {
+				ceCustomer.setStatus("待分配");
+			}
+			if (target.equals("result")) {
+				ceCustomer.setStatus("待处理,无效客户,已接收");
+			}
+		}
+		if (null == ceCustomer.getCeProductId() || ceCustomer.getCeProductId().equals("0")) {
+			ceCustomer.setCeProductId("");
+		}
+
+		List<WdCeCustomer> customers = ceCustomerService.selectByConditions(ceCustomer);
+		for (WdCeCustomer wdCeCustomer : customers) {
+			WdCeCustomerTrack ceCustomerTrack = ceCustomerTrackService
+					.selectLastestOwnerByCustomerId(wdCeCustomer.getId());
+			if (null != ceCustomerTrack) {
+				wdCeCustomer.setOwnerId(ceCustomerTrack.getOwnerId());
+				wdCeCustomer.setOwnerName(ceCustomerTrack.getOwnerName());
+			}
+		}
+
+		List<WdCeProductWithBLOBs> products = ceProductService.selectEnabledByCompanyId(currentUser.getCompanyId());
+
+		if (StringUtils.isBlank(ceCustomer.getCeProductId())) {
+			ceCustomer.setCeProductId("0");
+		}
+		if (ceCustomer.getStatus().equals("待处理,无效客户,已接收")) {
+			ceCustomer.setStatus("0");
+		}
+
+		model.addAttribute("searchParms", ceCustomer);
+		model.addAttribute("customers", customers);
+		model.addAttribute("products", products);
+
+		model.addAttribute("target", target);
+
+		return "modules/xcx/customerList";
+	}
+
+	@RequiresPermissions("wd:4customer:assign")
+	@RequestMapping(value = { "/assign" })
+	@ResponseBody
+	public JsonResult assign(String userId, String ceCustomerIds) {
+		SysUser user = UserUtils.get(userId);
+		SysUser currentUser = UserUtils.getUser();
+		for (String customerId : ceCustomerIds.split(",")) {
+			WdCeCustomer ceCustomer = ceCustomerService.selectByPrimaryKey(customerId);
+			ceCustomer.setStatus("待处理");
+			ceCustomer.setUpdateBy(currentUser.getId());
+			ceCustomer.setUpdateDate(new Date());
+			ceCustomerService.updateByPrimaryKeySelective(ceCustomer);
+
+			WdCeCustomerTrack track = new WdCeCustomerTrack();
+			track.setId(UidUtil.uuid());
+			track.setCeCustomerId(customerId);
+			track.setOwnerId(user.getId());
+			track.setOwnerName(user.getName());
+			track.setStatus("待处理");
+			track.setDisable(TrueOrFalseAsString.False);
+			track.setDelFlag(false);
+			track.setCreateBy(currentUser.getId());
+			track.setCreateDate(new Date());
+			track.setUpdateBy(currentUser.getId());
+			track.setUpdateDate(new Date());
+			ceCustomerTrackService.insertSelective(track);
+
+			WdMessage message = new WdMessage();
+			message.setId(UidUtil.uuid());
+			message.setCategory("获客");
+			message.setTitle(ceCustomer.getName());
+			message.setSubtitle(ceCustomer.getTelphone());
+			message.setContent("有一个新的客户任务");
+			message.setMessageDate(new Date());
+			message.setRelationId(ceCustomer.getId());
+			message.setReadFlag(BusinessConsts.TrueOrFalseAsString.False);
+			message.setDelFlag(false);
+			message.setCreateBy(currentUser.getId());
+			message.setCreateDate(new Date());
+			message.setUpdateBy(currentUser.getId());
+			message.setUpdateDate(new Date());
+
+			WdMessageReceiver receiver = new WdMessageReceiver();
+			receiver.setId(UidUtil.uuid());
+			receiver.setMessageId(message.getId());
+			receiver.setMessageDate(new Date());
+			receiver.setReceiverId(user.getId());
+
+			wdMessageService.insertSelective(message);
+			wdMessageReceiverService.insertSelective(receiver);
+
+			Map<String, String> extraInfo = new HashMap<>();
+			extraInfo.put("category", "获客");
+			extraInfo.put("relationId", message.getRelationId());
+
+			String[] alias = new String[] { user.getId() };
+			jgMessageUtils.sendMessageByAlias(alias, message.getTitle(), message.getContent(), extraInfo);
+		}
+
+		return new JsonResult();
+	}
+
+	@RequiresPermissions("wd:4customer:view")
+	@RequestMapping(value = { "/track" })
+	public String track(Model model, String customerId) {
+		List<WdCeCustomerTrack> customerTracks = ceCustomerTrackService.selectByCeCustomerAndStatus(customerId, "无效客户");
+		model.addAttribute("customerTracks", customerTracks);
+		return "modules/xcx/customerTrackList";
+	}
+}

+ 103 - 0
bk-wd-web/src/main/java/com/bk/wd/web/utils/BufferedImageLuminanceSource.java

@@ -0,0 +1,103 @@
+package com.bk.wd.web.utils;
+
+import com.google.zxing.LuminanceSource;
+
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+
+/**
+ * 用于二维码的解析,由Google提供。
+ *
+ * Created by Eric on 2017/2/15.
+ */
+public final class BufferedImageLuminanceSource extends LuminanceSource {
+
+    private final BufferedImage image;
+    private final int left;
+    private final int top;
+
+    public BufferedImageLuminanceSource(BufferedImage image) {
+        this(image, 0, 0, image.getWidth(), image.getHeight());
+    }
+
+    public BufferedImageLuminanceSource(BufferedImage image, int left, int top, int width, int height) {
+        super(width, height);
+
+        int sourceWidth = image.getWidth();
+        int sourceHeight = image.getHeight();
+        if (left + width > sourceWidth || top + height > sourceHeight) {
+            throw new IllegalArgumentException("Crop rectangle does not fit within image data.");
+        }
+
+        for (int y = top; y < top + height; y++) {
+            for (int x = left; x < left + width; x++) {
+                if ((image.getRGB(x, y) & 0xFF000000) == 0) {
+                    image.setRGB(x, y, 0xFFFFFFFF); // = white
+                }
+            }
+        }
+
+        this.image = new BufferedImage(sourceWidth, sourceHeight, BufferedImage.TYPE_BYTE_GRAY);
+        this.image.getGraphics().drawImage(image, 0, 0, null);
+        this.left = left;
+        this.top = top;
+    }
+
+    @Override
+    public byte[] getRow(int y, byte[] row) {
+        if (y < 0 || y >= getHeight()) {
+            throw new IllegalArgumentException("Requested row is outside the image: " + y);
+        }
+        int width = getWidth();
+        if (row == null || row.length < width) {
+            row = new byte[width];
+        }
+        image.getRaster().getDataElements(left, top + y, width, 1, row);
+        return row;
+    }
+
+    @Override
+    public byte[] getMatrix() {
+        int width = getWidth();
+        int height = getHeight();
+        int area = width * height;
+        byte[] matrix = new byte[area];
+        image.getRaster().getDataElements(left, top, width, height, matrix);
+        return matrix;
+    }
+
+    @Override
+    public boolean isCropSupported() {
+        return true;
+    }
+
+    @Override
+    public LuminanceSource crop(int left, int top, int width, int height) {
+        return new BufferedImageLuminanceSource(image, this.left + left, this.top + top, width, height);
+    }
+
+    @Override
+    public boolean isRotateSupported() {
+        return true;
+    }
+
+    @Override
+    public LuminanceSource rotateCounterClockwise() {
+
+        int sourceWidth = image.getWidth();
+        int sourceHeight = image.getHeight();
+
+        AffineTransform transform = new AffineTransform(0.0, -1.0, 1.0, 0.0, 0.0, sourceWidth);
+
+        BufferedImage rotatedImage = new BufferedImage(sourceHeight, sourceWidth, BufferedImage.TYPE_BYTE_GRAY);
+
+        Graphics2D g = rotatedImage.createGraphics();
+        g.drawImage(image, transform, null);
+        g.dispose();
+
+        int width = getWidth();
+        return new BufferedImageLuminanceSource(rotatedImage, top, sourceWidth - (left + width), getHeight(), width);
+    }
+
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 118 - 0
bk-wd-web/src/main/java/com/bk/wd/web/utils/ExcelUtils.java


+ 33 - 0
bk-wd-web/src/main/java/com/bk/wd/web/utils/HexUtils.java

@@ -0,0 +1,33 @@
+package com.bk.wd.web.utils;
+
+/**
+ * 各进制相关处理工具
+ * Created by wangweijun on 2018/03/05.
+ */
+public class HexUtils {
+
+    /**
+     * 用于判断两个值的二进制数是否相包含
+     * 24 & 8 = 8
+     * @param num1
+     * @param num2
+     * @return
+     */
+    public static boolean checkHexIntegerEq(Integer num1, Integer num2){
+        return (num1 & num2) == num2;
+    }
+
+    public static boolean checkHexIntegerEqArr(Integer num1, Integer[] numArr){
+        for (Integer n : numArr){
+            if(checkHexIntegerEq(num1, n)){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static void main(String args[]){
+        System.out.println(HexUtils.checkHexIntegerEq(24, 8));
+        System.out.println(HexUtils.checkHexIntegerEqArr(24, new Integer[]{8,16,32}));
+    }
+}

+ 134 - 0
bk-wd-web/src/main/java/com/bk/wd/web/utils/HttpPostUploadUtil.java

@@ -0,0 +1,134 @@
+package com.bk.wd.web.utils;
+
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import net.sf.jmimemagic.Magic;
+import net.sf.jmimemagic.MagicMatch;
+
+public class HttpPostUploadUtil {
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+       
+    }
+
+    /**
+     * 上传图片
+     * @param urlStr
+     * @param textMap
+     * @param fileMap
+     * @return
+     */
+    public static String formUpload(String urlStr, Map<String, String> textMap, Map<String, String> fileMap, String cookie) {
+        String res = "";
+        HttpURLConnection conn = null;
+        String BOUNDARY = "---------------------------123821742118716"; // boundary就是request头和上传文件内容的分隔符
+        try {
+            URL url = new URL(urlStr);
+            conn = (HttpURLConnection) url.openConnection();
+            conn.setConnectTimeout(5000);
+            conn.setReadTimeout(30000);
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            conn.setUseCaches(false);
+            conn.setRequestMethod("POST");
+            conn.setRequestProperty("Connection", "Keep-Alive");
+            conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.6)");
+            conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
+            conn.setRequestProperty("Cookie", cookie);
+/*
+            OutputStream out = new DataOutputStream(conn.getOutputStream());
+            // text
+            if (textMap != null) {
+                StringBuffer strBuf = new StringBuffer();
+                Iterator<Map.Entry<String, String>> iter = textMap.entrySet().iterator();
+                while (iter.hasNext()) {
+                    Map.Entry<String, String> entry = iter.next();
+                    String inputName = (String) entry.getKey();
+                    String inputValue = (String) entry.getValue();
+                    if (inputValue == null) {
+                        continue;
+                    }
+                    strBuf.append("\r\n").append("--").append(BOUNDARY).append("\r\n");
+                    strBuf.append("Content-Disposition: form-data; name=\"" + inputName + "\"\r\n\r\n");
+                    strBuf.append(inputValue);
+                }
+                out.write(strBuf.toString().getBytes());
+            }
+
+            // file
+            if (fileMap != null) {
+                Iterator<Map.Entry<String, String>> iter = fileMap.entrySet().iterator();
+                while (iter.hasNext()) {
+                    Map.Entry<String, String> entry = iter.next();
+                    String inputName = (String) entry.getKey();
+                    String inputValue = (String) entry.getValue();
+                    if (inputValue == null) {
+                        continue;
+                    }
+                    File file = new File(inputValue);
+                    String filename = file.getName();
+                    MagicMatch match = Magic.getMagicMatch(file, false, true);
+                    String contentType = match.getMimeType();
+
+                    StringBuffer strBuf = new StringBuffer();
+                    strBuf.append("\r\n").append("--").append(BOUNDARY).append("\r\n");
+                    strBuf.append(
+                            "Content-Disposition: form-data; name=\"" + inputName + "\"; filename=\"" + filename
+                                    + "\"\r\n"
+                    );
+                    strBuf.append("Content-Type:" + contentType + "\r\n\r\n");
+
+                    out.write(strBuf.toString().getBytes());
+
+                    DataInputStream in = new DataInputStream(new FileInputStream(file));
+                    int bytes = 0;
+                    byte[] bufferOut = new byte[1024];
+                    while ((bytes = in.read(bufferOut)) != -1) {
+                        out.write(bufferOut, 0, bytes);
+                    }
+                    in.close();
+                }
+            }
+
+            byte[] endData = ("\r\n--" + BOUNDARY + "--\r\n").getBytes();
+            out.write(endData);
+            out.flush();
+            out.close();*/
+
+            // 读取返回数据
+            StringBuffer strBuf = new StringBuffer();
+            BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+            String line = null;
+            while ((line = reader.readLine()) != null) {
+                strBuf.append(line).append("\n");
+            }
+            res = strBuf.toString();
+            reader.close();
+            reader = null;
+        } catch (Exception e) {
+            System.out.println("发送POST请求出错。" + urlStr);
+            e.printStackTrace();
+        } finally {
+            if (conn != null) {
+                conn.disconnect();
+                conn = null;
+            }
+        }
+        return res;
+    }
+
+}

+ 53 - 0
bk-wd-web/src/main/java/com/bk/wd/web/utils/MatrixToImageWriter.java

@@ -0,0 +1,53 @@
+package com.bk.wd.web.utils;
+
+import com.google.zxing.common.BitMatrix;
+
+import javax.imageio.ImageIO;
+import java.io.File;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.awt.image.BufferedImage;
+
+/**
+ *  用于二维码的生成,由Google提供。
+ *
+ * Created by Eric on 2017/2/15.
+ */
+public final class MatrixToImageWriter {
+
+    private static final int BLACK = 0xFF000000;
+    private static final int WHITE = 0xFFFFFFFF;
+
+    private MatrixToImageWriter() {}
+
+
+    public static BufferedImage toBufferedImage(BitMatrix matrix) {
+        int width = matrix.getWidth();
+        int height = matrix.getHeight();
+        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+        for (int x = 0; x < width; x++) {
+            for (int y = 0; y < height; y++) {
+                image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
+            }
+        }
+        return image;
+    }
+
+
+    public static void writeToFile(BitMatrix matrix, String format, File file)
+            throws IOException {
+        BufferedImage image = toBufferedImage(matrix);
+        if (!ImageIO.write(image, format, file)) {
+            throw new IOException("Could not write an image of format " + format + " to " + file);
+        }
+    }
+
+
+    public static void writeToStream(BitMatrix matrix, String format, OutputStream stream)
+            throws IOException {
+        BufferedImage image = toBufferedImage(matrix);
+        if (!ImageIO.write(image, format, stream)) {
+            throw new IOException("Could not write an image of format " + format);
+        }
+    }
+}

+ 242 - 0
bk-wd-web/src/main/java/com/bk/wd/web/utils/TestHttpClient.java

@@ -0,0 +1,242 @@
+package com.bk.wd.web.utils;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.http.HeaderIterator;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.ParseException;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.CookieStore;
+import org.apache.http.client.config.CookieSpecs;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.cookie.CookieSpecProvider;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.cookie.BasicClientCookie;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.mime.MultipartEntityBuilder;  
+import org.apache.http.entity.mime.content.FileBody;  
+import org.apache.http.entity.mime.content.StringBody;
+
+import org.apache.http.impl.cookie.BestMatchSpecFactory;
+import org.apache.http.impl.cookie.BrowserCompatSpecFactory;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+public class TestHttpClient {
+
+    // 创建CookieStore实例
+    static CookieStore cookieStore = null;
+    static HttpClientContext context = null;
+    static String loginUrl = "http://localhost/login";
+    static String testUrl = "http://localhost/sm/model/detail?modelId=517e893350844256892912b7f1730a82";
+    static String uploadUrl = "http://localhost/sys/globalSetting/save";
+    
+    static String loginErrorUrl = "http://localhost/";
+
+    public static void testLogin() throws Exception {
+        System.out.println("----testLogin");
+        HttpPost httpPost = new HttpPost(loginUrl);
+        Map<String, String> parameterMap = new HashMap<>();
+        parameterMap.put("username", "admin1");
+        parameterMap.put("password", "admin");
+        UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(getParam(parameterMap), "UTF-8");
+        httpPost.setEntity(postEntity);
+        System.out.println("request line:" + httpPost.getRequestLine());
+        try (CloseableHttpClient client = HttpClients.createDefault()) {
+            // 执行post请求
+            HttpResponse httpResponse = client.execute(httpPost);
+            System.out.println(httpResponse.getAllHeaders().toString());
+            if ( null != httpResponse.getFirstHeader("Location")) {
+                String location = httpResponse.getFirstHeader("Location").getValue();
+                if (location != null && location.startsWith(loginErrorUrl)) {
+                    System.out.println("----loginError");
+                }
+            }
+            
+            printResponse(httpResponse);
+
+            // 执行get请求
+            System.out.println("----the same client");
+            HttpGet httpGet = new HttpGet(testUrl);
+            System.out.println("request line:" + httpGet.getRequestLine());
+            HttpResponse httpResponse1 = client.execute(httpGet);
+            printResponse(httpResponse1);
+
+            // cookie store
+            setCookieStore(httpResponse);
+            // context
+            setContext();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+    
+    public static void main(String[] args) {
+        
+        try {
+            testLogin();
+            upload();
+           /* testContext();
+            testCookieStore();*/
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        
+    }
+
+    public static void testContext() throws Exception {
+        System.out.println("----testContext");
+        // 使用context方式
+        CloseableHttpClient client = HttpClients.createDefault();
+        HttpGet httpGet = new HttpGet(testUrl);
+        System.out.println("request line:" + httpGet.getRequestLine());
+        try {
+            // 执行get请求
+            HttpResponse httpResponse = client.execute(httpGet, context);
+            System.out.println("context cookies:" + context.getCookieStore().getCookies());
+            printResponse(httpResponse);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                // 关闭流并释放资源
+                client.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public static void testCookieStore() throws Exception {
+        System.out.println("----testCookieStore");
+        // 使用cookieStore方式
+        CloseableHttpClient client = HttpClients.custom().setDefaultCookieStore(cookieStore).build();
+        HttpGet httpGet = new HttpGet(testUrl);
+        System.out.println("request line:" + httpGet.getRequestLine());
+        try {
+            // 执行get请求
+            HttpResponse httpResponse = client.execute(httpGet);
+            System.out.println("cookie store:" + cookieStore.getCookies());
+            printResponse(httpResponse);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                // 关闭流并释放资源
+                client.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+    
+    
+    public static void printResponse(HttpResponse httpResponse) throws ParseException, IOException {
+        // 获取响应消息实体
+        HttpEntity entity = httpResponse.getEntity();
+        // 响应状态
+        System.out.println("status:" + httpResponse.getStatusLine());
+        System.out.println("headers:");
+        HeaderIterator iterator = httpResponse.headerIterator();
+        while (iterator.hasNext()) {
+            System.out.println("\t" + iterator.next());
+        }
+        // 判断响应实体是否为空
+        if (entity != null) {
+            String responseString = EntityUtils.toString(entity);
+            System.out.println("response length:" + responseString.length());
+            System.out.println("response content:" + responseString.replace("\r\n", ""));
+        }
+    }
+    
+    public static void setCookieStore(HttpResponse httpResponse) {
+        System.out.println("----setCookieStore");
+        cookieStore = new BasicCookieStore();
+        // JSESSIONID
+        String setCookie = httpResponse.getFirstHeader("Set-Cookie").getValue();
+        String JSESSIONID = setCookie.substring("JSESSIONID=".length(), setCookie.indexOf(";"));
+        System.out.println("JSESSIONID:" + JSESSIONID);
+        // 新建一个Cookie
+        BasicClientCookie cookie = new BasicClientCookie("JSESSIONID", JSESSIONID);
+        cookie.setVersion(0);
+        cookie.setDomain("127.0.0.1");
+        cookie.setPath("/CwlProClient");
+        // cookie.setAttribute(ClientCookie.VERSION_ATTR, "0");
+        // cookie.setAttribute(ClientCookie.DOMAIN_ATTR, "127.0.0.1");
+        // cookie.setAttribute(ClientCookie.PORT_ATTR, "8080");
+        // cookie.setAttribute(ClientCookie.PATH_ATTR, "/CwlProWeb");
+        cookieStore.addCookie(cookie);
+    }
+    
+    public static void setContext() {
+        System.out.println("----setContext");
+        context = HttpClientContext.create();
+        Registry<CookieSpecProvider> registry = RegistryBuilder.<CookieSpecProvider>create()
+                .register(CookieSpecs.BEST_MATCH, new BestMatchSpecFactory())
+                .register(CookieSpecs.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory()).build();
+        context.setCookieSpecRegistry(registry);
+        context.setCookieStore(cookieStore);
+    }
+    
+    
+    public static List<NameValuePair> getParam(Map parameterMap) {
+        List<NameValuePair> param = new ArrayList<NameValuePair>();
+        Iterator it = parameterMap.entrySet().iterator();
+        while (it.hasNext()) {
+            Entry parmEntry = (Entry) it.next();
+            param.add(new BasicNameValuePair((String) parmEntry.getKey(), (String) parmEntry.getValue()));
+        }
+        return param;
+    }
+    
+    
+    /** 
+     * 上传文件 
+     */  
+    public static void upload() {  
+        try (CloseableHttpClient httpclient = HttpClients.createDefault()) {  
+            HttpPost httppost = new HttpPost(uploadUrl);  
+  
+            FileBody bin = new FileBody(new File("D:\\2.jpg"));  
+            StringBody comment = new StringBody("A binary file of some kind", ContentType.TEXT_PLAIN);  
+            HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("loginPhotoFile", bin).addPart("comment", comment).build();  
+  
+            httppost.setEntity(reqEntity);  
+  
+            System.out.println("executing request " + httppost.getRequestLine());  
+            CloseableHttpResponse response = httpclient.execute(httppost);  
+            try  {  
+                System.out.println("----------------------------------------");  
+                System.out.println(response.getStatusLine());  
+                HttpEntity resEntity = response.getEntity();  
+                if (resEntity != null) {  
+                    System.out.println("Response content length: " + resEntity.getContentLength());  
+                }  
+                EntityUtils.consume(resEntity);  
+            } finally {  
+                response.close();  
+            }  
+        } catch (ClientProtocolException e) {  
+            e.printStackTrace();  
+        } catch (IOException e) {  
+            e.printStackTrace();  
+        }
+    }  
+}

+ 63 - 0
bk-wd-web/src/main/java/com/bk/wd/web/utils/WordGenerator.java

@@ -0,0 +1,63 @@
+package com.bk.wd.web.utils;
+import java.io.File;
+import java.io.FileOutputStream;  
+import java.io.IOException;  
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.bk.wd.model.view.ViewResolution;
+
+import freemarker.template.Configuration;  
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+
+public class WordGenerator {
+    
+    private static final Logger LOGGER = LoggerFactory.getLogger(WordGenerator.class);
+    
+    public static Template getTemplate(String template) {
+        Configuration configuration = new Configuration(Configuration.VERSION_2_3_22);
+        configuration.setDefaultEncoding("utf-8");
+        try {
+            configuration.setDirectoryForTemplateLoading(new File(System.getProperty("sys.root") + "WEB-INF/classes/META-INF/template"));
+            return configuration.getTemplate(template +  ".ftl");
+        } catch (IOException e) {
+            LOGGER.error(e.getMessage(), e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    private WordGenerator() {
+        throw new AssertionError();
+    }
+
+    public static File createDoc(String template, Map<?, ?> dataMap) {
+        String name = "/temp" + (int) (Math.random() * 100000) + ".doc";
+        File f = new File(name);
+        Template t = getTemplate(template);
+        // 这个地方不能使用FileWriter因为需要指定编码类型否则生成的Word文档会因为有无法识别的编码而无法打开
+        Writer w;
+        try {
+            w = new OutputStreamWriter(new FileOutputStream(f), "utf-8");
+            t.process(dataMap, w);
+            w.close();
+        } catch (TemplateException | IOException e) {
+            LOGGER.error(e.getMessage(), e);
+        }
+        return f;
+    }
+    
+    public static void main(String[] args) throws IOException, TemplateException {
+        ViewResolution resolution = new ViewResolution();
+        resolution.setPost("测试科目");
+        Map<String, Object> params = new HashMap<>();
+        params.put("resolution", resolution);
+        createDoc("resolution", params);
+    }
+
+}

+ 74 - 0
bk-wd-web/src/main/resources/META-INF/spring/context-jdbc.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/aop
+        http://www.springframework.org/schema/aop/spring-aop.xsd
+        http://www.springframework.org/schema/tx
+        http://www.springframework.org/schema/tx/spring-tx.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    
+    <!-- 加载配置属性文件 -->
+	<context:property-placeholder ignore-unresolvable="true" location="classpath*:/db.properties" />
+	
+	<bean id="log-filter" class="com.alibaba.druid.filter.logging.Slf4jLogFilter">
+	    <property name="resultSetLogEnabled" value="false" />
+	</bean>
+	
+	<bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter">
+		<property name="slowSqlMillis" value="10000" />
+		<property name="logSlowSql" value="true" />
+	</bean>
+		
+   	<!-- 数据源配置, 使用 BoneCP 数据库连接池 -->
+	<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> 
+	    <!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass -->
+	    <property name="driverClassName" value="${jdbc.driver}" />
+	    
+		<!-- 基本属性 url、user、password -->
+		<property name="url" value="${jdbc.url}" />
+		<property name="username" value="${jdbc.username}" />
+		<property name="password" value="${jdbc.password}" />
+		
+		<!-- 配置初始化大小、最小、最大 -->
+		<property name="initialSize" value="${jdbc.pool.init}" />
+		<property name="minIdle" value="${jdbc.pool.minIdle}" /> 
+		<property name="maxActive" value="${jdbc.pool.maxActive}" />
+		
+		<!-- 配置获取连接等待超时的时间 -->
+		<property name="maxWait" value="60000" />
+		
+		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
+		<property name="timeBetweenEvictionRunsMillis" value="60000" />
+		
+		<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
+		<property name="minEvictableIdleTimeMillis" value="300000" />
+		
+		<property name="validationQuery" value="${jdbc.testSql}" />
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+		
+		<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
+        <property name="poolPreparedStatements" value="true" />
+        <property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
+		
+		<!-- 配置监控统计拦截的filters -->
+	    <property name="filters" value="stat,slf4j" />
+	    <property name="connectionProperties" value="druid.stat.slowSqlMillis=5000" />
+	    <property name="proxyFilters">
+	        <list>
+	            <ref bean="log-filter"/>
+	            <ref bean="stat-filter" />
+	        </list>
+	    </property>
+	</bean>
+</beans>

+ 30 - 0
bk-wd-web/src/main/resources/META-INF/spring/context-mybatis.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/aop
+        http://www.springframework.org/schema/aop/spring-aop.xsd
+        http://www.springframework.org/schema/tx
+        http://www.springframework.org/schema/tx/spring-tx.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+
+	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
+		<property name="configLocation" value="classpath:mybatis-configuration.xml" />
+		<property name="mapperLocations" value="classpath*:com/bk/**/mapper/**/*.xml" />
+		<property name="dataSource" ref="dataSource" />
+		<property name="typeAliasesPackage" value="com.bk.*.model" />
+	</bean>
+
+	<!-- scan for mappers and let them be autowired -->
+	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
+		<property name="basePackage" value="com.bk.**.mapper;" />
+		<!-- <property name="basePackage" value="com.bk.*.mapper;" /> -->
+	</bean>
+
+</beans>

+ 51 - 0
bk-wd-web/src/main/resources/META-INF/spring/context-transaction.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/aop
+        http://www.springframework.org/schema/aop/spring-aop.xsd
+        http://www.springframework.org/schema/tx
+        http://www.springframework.org/schema/tx/spring-tx.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+
+	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
+		<property name="dataSource" ref="dataSource" />
+	</bean>
+
+	<!-- 配置 Annotation 驱动,扫描@Transactional注解的类定义事务  -->
+	<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
+
+	<tx:advice id="txAdvice" transaction-manager="transactionManager">
+		<tx:attributes>
+			<tx:method name="load*" read-only="true" />
+			<tx:method name="find*" read-only="true" />
+			<tx:method name="query*" read-only="true" />
+			<tx:method name="select*" read-only="true" />
+			<tx:method name="validate*" read-only="true" />
+
+			<tx:method name="add*" propagation="REQUIRED" />
+			<tx:method name="insert*" propagation="REQUIRED"/>
+			<tx:method name="create*" propagation="REQUIRED" />
+			<tx:method name="save*" propagation="REQUIRED" />
+			<tx:method name="update*" propagation="REQUIRED"/>
+			<tx:method name="modify*" propagation="REQUIRED" />
+			<tx:method name="delete*" propagation="REQUIRED"/>
+			<tx:method name="remove*" propagation="REQUIRED" />
+			<tx:method name="do*" propagation="REQUIRED" />
+			<tx:method name="del*" propagation="REQUIRED" />
+
+			<tx:method name="*" propagation="SUPPORTS" rollback-for="Throwable" />
+		</tx:attributes>
+	</tx:advice>
+
+	<aop:config>
+		<aop:pointcut id="interceptorPointCuts" expression="execution(* com.bk..*.service..*.*(..));execution(* com.bk..*.util..*.*(..));" />
+		<aop:advisor advice-ref="txAdvice" pointcut-ref="interceptorPointCuts" />
+	</aop:config>
+	
+</beans>

+ 31 - 0
bk-wd-web/src/main/resources/META-INF/spring/context.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/aop
+        http://www.springframework.org/schema/aop/spring-aop.xsd
+        http://www.springframework.org/schema/tx
+        http://www.springframework.org/schema/tx/spring-tx.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+        
+    <!-- 加载配置属性文件 -->
+	<context:property-placeholder ignore-unresolvable="true" location="classpath:web.properties" />
+
+	<context:component-scan base-package="com.bk.sys" />
+	<context:component-scan base-package="com.bk.wd" >
+		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
+	</context:component-scan>
+	<context:component-scan base-package="com.bk.wd.pl" />
+	<context:component-scan base-package="com.bk.bi" />
+	<context:component-scan base-package="com.bk.oa" />
+	<context:component-scan base-package="com.bk.sm" />
+	<context:component-scan base-package="com.bk.cll" />
+</beans>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1596 - 0
bk-wd-web/src/main/resources/META-INF/template/meeting_luoshan.ftl


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1074 - 0
bk-wd-web/src/main/resources/META-INF/template/modules/app_overview.ftl


+ 118 - 0
bk-wd-web/src/main/resources/META-INF/template/modules/app_shixin_court.ftl

@@ -0,0 +1,118 @@
+<html lang="en">
+<head style="background-color: rgb(240,240,240)">
+<title>总览</title>
+<style type="text/css">
+html body {
+	width:100%;	
+	font-size:12px;
+	box-sizing:content-box;
+	overflow-x:hidden;
+    font-family:SimHei !important;
+}
+.table_center td {
+	text-align:center;	
+}
+table {
+	border-collapse:collapse;
+	width:100%;
+    font-size: 12px;
+	margin:0 auto;
+	left:0;
+	right:0;
+}
+table td, table th {
+	border:1px solid #ddd;	
+	padding:10px;
+}
+.td_padding {
+	border:2px solid #103050;
+}
+table td {
+	color : #103050;
+}
+table.soft_info_table td {
+	color : #708090;
+}
+
+table th {
+	font-weight : 100;
+	color : #000000;
+}
+
+.width48p {
+	width: 48%;
+	float: left;
+}
+.clear_both {
+	clear: both;
+}
+</style>
+</head>
+<body>
+    <#list shixinList as wdCourtQuery>
+        <#if wdCourtQuery.getJsonListData()?size gt 0>
+            <table cellspacing="0">
+                <tr>
+                    <td colspan="4" class="td_padding">
+                    </td>
+                </tr>
+                <tr>
+                    <th width="12%">查询时间</th>
+                    <th width="25%">${(wdCourtQuery.createDate)?string("yyyy-MM-dd HH:mm:ss")}</th>
+                    <th width="12%">查询信息</th>
+                    <th>${wdCourtQuery.targetName }(${wdCourtQuery.targetIdcard })</th>
+                </tr>
+            </table>
+            <#list wdCourtQuery.getJsonListData() as data>
+                <table cellspacing="0">
+                    <tr>
+                        <td colspan="2" class="td_padding">
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>发布时间</th>
+                        <td>${data.publishDate }</td>
+                    </tr>
+                    <tr>
+                        <th>执行法院</th>
+                        <td>${data.courtName }</td>
+                    </tr>
+                    <tr>
+                        <th>省份</th>
+                        <td>${data.areaName }</td>
+                    </tr>
+                    <tr>
+                        <th>执行依据文号</th>
+                        <td>${data.gistId }</td>
+                    </tr>
+                    <tr>
+                        <th>立案时间</th>
+                        <td>${data.regDate }</td>
+                    </tr>
+                    <tr>
+                        <th>案号</th>
+                        <td>${data.caseCode }</td>
+                    </tr>
+                    <tr>
+                        <th>做出执行依据单位</th>
+                        <td>${data.gistUnit }</td>
+                    </tr>
+                    <tr>
+                        <th>生效法律文书确定的义务</th>
+                        <td>${data.duty }</td>
+                    </tr>
+                    <tr>
+                        <th>失信被执行人行为具体情形</th>
+                        <td>${data.disruptTypeName }</td>
+                    </tr>
+                    <tr>
+                        <th>被执行人的履行情况</th>
+                        <td>${data.performance }</td>
+                    </tr>
+                </table>
+            </#list>
+            <br></br>
+        </#if>
+    </#list>
+</body>
+</html>

+ 94 - 0
bk-wd-web/src/main/resources/META-INF/template/modules/app_zhixin_court.ftl

@@ -0,0 +1,94 @@
+<html lang="en">
+<head style="background-color: rgb(240,240,240)">
+<title>总览</title>
+<style type="text/css">
+html body {
+	width:100%;	
+	font-size:12px;
+	box-sizing:content-box;
+	overflow-x:hidden;
+    font-family:SimHei !important;
+}
+.table_center td {
+	text-align:center;	
+}
+table {
+	border-collapse:collapse;
+	width:100%;
+    font-size: 12px;
+	margin:0 auto;
+	left:0;
+	right:0;
+}
+table td, table th {
+	border:1px solid #ddd;	
+	padding:10px;
+}
+.td_padding {
+	border:2px solid #103050;
+}
+table td {
+	color : #103050;
+}
+table.soft_info_table td {
+	color : #708090;
+}
+
+table th {
+	font-weight : 100;
+	color : #000000;
+}
+
+.width48p {
+	width: 48%;
+	float: left;
+}
+.clear_both {
+	clear: both;
+}
+</style>
+</head>
+<body>
+    <#list zhixinList as wdCourtQuery>
+        <#if wdCourtQuery.getJsonListData()?size gt 0>
+            <table cellspacing="0">
+                <tr>
+                    <td colspan="4" class="td_padding">
+                    </td>
+                </tr>
+                <tr>
+                    <th width="12%">查询时间</th>
+                    <th width="25%">${(wdCourtQuery.createDate)?string("yyyy-MM-dd HH:mm:ss")}</th>
+                    <th width="12%">查询信息</th>
+                    <th>${wdCourtQuery.targetName }(${wdCourtQuery.targetIdcard })</th>
+                </tr>
+            </table>
+            <#list wdCourtQuery.getJsonListData() as data>
+    			<table cellspacing="0">
+    				<tr>
+						<td colspan="2" class="td_padding">
+						</td>
+					</tr>
+					<tr>
+                        <th>立案时间</th>
+                        <td>${data.publishDate }</td>
+                    </tr>
+                    <tr>
+                        <th>执行法院</th>
+                        <td>${data.courtName }</td>
+                    </tr>
+                    <tr>
+                        <th>案号</th>
+                        <td>${data.areaName }</td>
+                    </tr>
+                    <tr>
+                        <th>执行标的</th>
+                        <td>${data.gistId }</td>
+                    </tr>
+    			</table>
+    		</#list>
+    		<br></br>
+        </#if>
+    </#list>
+</body>
+</html>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3870 - 0
bk-wd-web/src/main/resources/META-INF/template/resolution_luoshan.ftl


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5566 - 0
bk-wd-web/src/main/resources/META-INF/template/resolution_qingyuan.ftl


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3952 - 0
bk-wd-web/src/main/resources/META-INF/template/resolution_xuanhua.ftl


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2720 - 0
bk-wd-web/src/main/resources/META-INF/template/review_report_luoshan.ftl


+ 32 - 0
bk-wd-web/src/main/resources/db.properties

@@ -0,0 +1,32 @@
+#============================#
+#===== Database sttings =====#
+#============================#
+
+#mysql database setting
+jdbc.type=mysql
+jdbc.driver=com.mysql.jdbc.Driver
+
+#test
+#jdbc.url=jdbc:mysql://101.37.91.131:3306/bk?useUnicode=true&characterEncoding=utf-8
+#jdbc.username=weidai
+#jdbc.password=weidai@2016
+
+jdbc.url=jdbc:mysql://101.37.78.253:3306/bk?characterEncoding=utf-8
+jdbc.username=sys
+jdbc.password=123456
+
+#jdbc.url=${jdbc.url}&useSSL=false
+#jdbc.username=${jdbc.username}
+#jdbc.password=${jdbc.password}
+
+#jdbc.url=jdbc:mysql://localhost:3306/bk_bakejinfu?characterEncoding=utf-8
+#jdbc.username=root
+#jdbc.password=123456
+
+#pool settings
+jdbc.pool.init=1
+jdbc.pool.minIdle=3
+jdbc.pool.maxActive=20
+
+#jdbc.testSql=SELECT 'x'
+jdbc.testSql=SELECT 'id' FROM sys_user

+ 36 - 0
bk-wd-web/src/main/resources/log4j.properties

@@ -0,0 +1,36 @@
+# Output pattern : date [thread] priority category - message   FATAL 0  ERROR 3  WARN 4  INFO 6  DEBUG 7 
+log4j.rootLogger=ERROR, Console
+
+#Console
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%d %-5p [%c{5}] - %m%n
+
+#RollingFile
+#log4j.appender.RollingFile=org.apache.log4j.DailyRollingFileAppender
+#log4j.appender.RollingFile.File=../logs/bk.log
+#log4j.appender.RollingFile.layout=org.apache.log4j.PatternLayout
+#og4j.appender.RollingFile.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n
+
+# logstash\u914D\u7F6E
+#log4j.appender.logstash=org.apache.log4j.net.SocketAppender
+#log4j.appender.logstash.port=9600
+#log4j.appender.logstash.remoteHost=101.37.78.253
+
+#log4j.rootLogger=Console,RollingFile,logstash
+
+#log4j.logger.java.sql=DEBUG
+
+#Springframework level
+#log4j.logger.org.springframework=ERROR
+
+#Hibernate level
+#log4j.logger.org.hibernate=ERROR
+#log4j.logger.org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory=ERROR
+#log4j.logger.org.hibernate.search.impl.ConfigContext=ERROR
+#log4j.logger.net.sf.ehcache.config.CacheConfiguration=ERROR
+
+#Project defalult level
+#log4j.logger.org.activiti.engine.impl.persistence=DEBUG
+#log4j.logger.org.apache.shiro=DEBUG
+#log4j.logger.com.bk.sys=WARN

+ 60 - 0
bk-wd-web/src/main/resources/logback.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+	<!--======================================= 本地变量 ========================================-->
+	<!--在没有定义${LOG_HOME}系统变量的时候,可以设置此本地变量。
+    <property name="LOG_HOME" value="E:/log/nm-web" />-->
+    <property name="LOG_HOME" value="/app/log" />
+    <!-- <property name="LOG_HOME" value="/home/conan/Projects/Bake_Log" /> -->
+	
+	<!-- 应用名称:和统一配置中的项目代码保持一致(小写) -->
+	<property name="APP_NAME" value="wd-admin" />
+	<!--日志文件保留天数-->
+	<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
+	<property name="LOG_MAX_HISTORY" value="30" />
+	<!--应用日志文件保存路径-->
+	<property name="LOG_APP_HOME" value="${LOG_HOME}/app" />
+	<!--系统日志文件保存路径-->
+	<property name="LOG_SYS_HOME" value="${LOG_HOME}/sys" />
+
+	<!--=========================== 按照每天生成日志文件:默认配置===================================-->
+	<!-- 控制台输出 -->
+	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+			<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度,%logger:日志名,%line:日志打印行号,%msg:日志消息,%n:是换行符-->
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{100}[%line] - %msg%n</pattern>
+		</encoder>
+	</appender>
+	<!-- 按照每天生成日志文件:应用日志 -->
+	<appender name="APP"  class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<!--日志文件输出的文件名-->
+			<FileNamePattern>${LOG_APP_HOME}/${APP_NAME}.log.%d{yyyy-MM-dd}</FileNamePattern>
+			<!--日志文件保留天数-->
+			<MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+		</rollingPolicy>
+		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+			<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度,%logger:日志名,%line:日志打印行号,%msg:日志消息,%n:是换行符-->
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{100}[%line] - %msg%n</pattern>
+		</encoder>
+	</appender>
+	<!-- 按照每天生成日志文件:SYS日志-->
+	<appender name="SYS" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<!--日志文件输出的文件名-->
+			<FileNamePattern>${LOG_SYS_HOME}/${APP_NAME}-sys.log.%d{yyyy-MM-dd}</FileNamePattern>
+			<!--日志文件保留天数-->
+			<MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+		</rollingPolicy>
+		<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+			<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度,%logger:日志名,%line:日志打印行号,%msg:日志消息,%n:是换行符-->
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{100}[%line] - %msg%n</pattern>
+		</encoder>
+	</appender>
+	<!--===============================  日志输出: 默认系统日志 ======================================-->
+	<root level="warn">
+		<!--本地调试时去掉注释 -->
+		<appender-ref ref="STDOUT" />
+		<appender-ref ref="APP" />
+		<appender-ref ref="SYS" />	
+	</root>
+</configuration>

+ 42 - 0
bk-wd-web/src/main/resources/mybatis-configuration.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
+<configuration>
+
+	<!-- 全局参数 -->
+	<settings>
+		<!-- 使全局的映射器启用或禁用缓存。 -->
+		<setting name="cacheEnabled" value="true"/>
+		
+		<!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载。 -->
+		<setting name="lazyLoadingEnabled" value="true"/>
+		
+		<!-- 当启用时,有延迟加载属性的对象在被调用时将会完全加载任意属性。否则,每种属性将会按需要加载。 -->
+		<setting name="aggressiveLazyLoading" value="true"/>
+		
+		<!-- 是否允许单条sql 返回多个数据集  (取决于驱动的兼容性) default:true -->
+		<setting name="multipleResultSetsEnabled" value="true"/>
+		
+		<!-- 是否可以使用列的别名 (取决于驱动的兼容性) default:true -->
+		<setting name="useColumnLabel" value="true"/>
+		
+		<!-- 允许JDBC 生成主键。需要驱动器支持。如果设为了true,这个设置将强制使用被生成的主键,有一些驱动器不兼容不过仍然可以执行。  default:false  -->
+		<setting name="useGeneratedKeys" value="false"/>
+		
+		<!-- 指定 MyBatis 如何自动映射 数据基表的列 NONE:不隐射 PARTIAL:部分  FULL:全部  -->  
+		<setting name="autoMappingBehavior" value="PARTIAL"/>
+		
+		<!-- 这是默认的执行类型  (SIMPLE: 简单; REUSE: 执行器可能重复使用prepared statements语句;BATCH: 执行器可以重复执行语句和批量更新)  -->
+		<setting name="defaultExecutorType" value="SIMPLE"/>
+		
+		<!-- 使用驼峰命名法转换字段。 -->
+		<setting name="mapUnderscoreToCamelCase" value="true"/>
+		
+		<!-- 设置本地缓存范围 session:就会有数据的共享  statement:语句范围 (这样就不会有数据的共享 ) defalut:session -->
+        <setting name="localCacheScope" value="SESSION"/>
+		
+        <!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER,插入空值时不需要指定类型 -->
+        <setting name="jdbcTypeForNull" value="NULL"/>
+        
+       <!--  <setting name="logImpl" value="STDOUT_LOGGING"/> -->
+	</settings>
+</configuration>

+ 29 - 0
bk-wd-web/src/main/resources/web.properties

@@ -0,0 +1,29 @@
+#\u89c6\u56fe\u6587\u4ef6\u5b58\u653e\u8def\u5f84
+web.view.prefix=/jsp/
+web.view.suffix=.jsp
+
+web.view.index=/
+
+#\u6700\u5927\u6587\u4ef6\u4e0a\u4f20\u9650\u5236\uff0c\u5355\u4f4d\u5b57\u8282. 10M=10*1024*1024(B)=10485760 bytes\uff0c\u9700\u540c\u6b65\u4fee\u6539\uff1ackfinder.xml
+web.maxUploadSize=10485760
+
+#\u56FE\u7247\u670D\u52A1\u5668\u5730\u5740
+#static.resources.url=http://localhost:8081/ui/gentelella-master/
+static.resources.url=${static.resources.url}
+dfs.http.server=${dfs.http.server}
+
+wxstatic.resources.url=${wxstatic.resources.url}
+app.api.url=${app.api.url}
+app.wap.download.url=${app.wap.download.url}
+
+print.template=${print.template}
+print.template.resolution=${print.template.resolution}
+
+# SMS URL
+sms_url=${dataservice.url}/sms/send
+
+# Tencent Anti Fraud URL
+af_tencent_url=${dataservice.url}/af/tencent
+# Emay URL
+# af_emay_url=http://172.16.100.180/data/af/emay
+af_emay_url=${dataservice.url}/af/emay

+ 74 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/spring/context-jdbc.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/aop
+        http://www.springframework.org/schema/aop/spring-aop.xsd
+        http://www.springframework.org/schema/tx
+        http://www.springframework.org/schema/tx/spring-tx.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    
+    <!-- 加载配置属性文件 -->
+	<context:property-placeholder ignore-unresolvable="true" location="classpath*:/db.properties" />
+	
+	<bean id="log-filter" class="com.alibaba.druid.filter.logging.Slf4jLogFilter">
+	    <property name="resultSetLogEnabled" value="false" />
+	</bean>
+	
+	<bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter">
+		<property name="slowSqlMillis" value="10000" />
+		<property name="logSlowSql" value="true" />
+	</bean>
+		
+   	<!-- 数据源配置, 使用 BoneCP 数据库连接池 -->
+	<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> 
+	    <!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass -->
+	    <property name="driverClassName" value="${jdbc.driver}" />
+	    
+		<!-- 基本属性 url、user、password -->
+		<property name="url" value="${jdbc.url}" />
+		<property name="username" value="${jdbc.username}" />
+		<property name="password" value="${jdbc.password}" />
+		
+		<!-- 配置初始化大小、最小、最大 -->
+		<property name="initialSize" value="${jdbc.pool.init}" />
+		<property name="minIdle" value="${jdbc.pool.minIdle}" /> 
+		<property name="maxActive" value="${jdbc.pool.maxActive}" />
+		
+		<!-- 配置获取连接等待超时的时间 -->
+		<property name="maxWait" value="60000" />
+		
+		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
+		<property name="timeBetweenEvictionRunsMillis" value="60000" />
+		
+		<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
+		<property name="minEvictableIdleTimeMillis" value="300000" />
+		
+		<property name="validationQuery" value="${jdbc.testSql}" />
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+		
+		<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
+        <property name="poolPreparedStatements" value="true" />
+        <property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
+		
+		<!-- 配置监控统计拦截的filters -->
+	    <property name="filters" value="stat,slf4j" />
+	    <property name="connectionProperties" value="druid.stat.slowSqlMillis=5000" />
+	    <property name="proxyFilters">
+	        <list>
+	            <ref bean="log-filter"/>
+	            <ref bean="stat-filter" />
+	        </list>
+	    </property>
+	</bean>
+</beans>

+ 30 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/spring/context-mybatis.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns:util="http://www.springframework.org/schema/util"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/aop
+        http://www.springframework.org/schema/aop/spring-aop.xsd
+        http://www.springframework.org/schema/tx
+        http://www.springframework.org/schema/tx/spring-tx.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+
+	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
+		<property name="configLocation" value="classpath:mybatis-configuration.xml" />
+		<property name="mapperLocations" value="classpath*:com/bk/**/mapper/**/*.xml" />
+		<property name="dataSource" ref="dataSource" />
+		<property name="typeAliasesPackage" value="com.bk.*.model" />
+	</bean>
+
+	<!-- scan for mappers and let them be autowired -->
+	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
+		<property name="basePackage" value="com.bk.**.mapper;" />
+		<!-- <property name="basePackage" value="com.bk.*.mapper;" /> -->
+	</bean>
+
+</beans>

+ 51 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/spring/context-transaction.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/aop
+        http://www.springframework.org/schema/aop/spring-aop.xsd
+        http://www.springframework.org/schema/tx
+        http://www.springframework.org/schema/tx/spring-tx.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+
+	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
+		<property name="dataSource" ref="dataSource" />
+	</bean>
+
+	<!-- 配置 Annotation 驱动,扫描@Transactional注解的类定义事务  -->
+	<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
+
+	<tx:advice id="txAdvice" transaction-manager="transactionManager">
+		<tx:attributes>
+			<tx:method name="load*" read-only="true" />
+			<tx:method name="find*" read-only="true" />
+			<tx:method name="query*" read-only="true" />
+			<tx:method name="select*" read-only="true" />
+			<tx:method name="validate*" read-only="true" />
+
+			<tx:method name="add*" propagation="REQUIRED" />
+			<tx:method name="insert*" propagation="REQUIRED"/>
+			<tx:method name="create*" propagation="REQUIRED" />
+			<tx:method name="save*" propagation="REQUIRED" />
+			<tx:method name="update*" propagation="REQUIRED"/>
+			<tx:method name="modify*" propagation="REQUIRED" />
+			<tx:method name="delete*" propagation="REQUIRED"/>
+			<tx:method name="remove*" propagation="REQUIRED" />
+			<tx:method name="do*" propagation="REQUIRED" />
+			<tx:method name="del*" propagation="REQUIRED" />
+
+			<tx:method name="*" propagation="SUPPORTS" rollback-for="Throwable" />
+		</tx:attributes>
+	</tx:advice>
+
+	<aop:config>
+		<aop:pointcut id="interceptorPointCuts" expression="execution(* com.bk..*.service..*.*(..));execution(* com.bk..*.util..*.*(..));" />
+		<aop:advisor advice-ref="txAdvice" pointcut-ref="interceptorPointCuts" />
+	</aop:config>
+	
+</beans>

+ 31 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/spring/context.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/context 
+        http://www.springframework.org/schema/context/spring-context.xsd
+        http://www.springframework.org/schema/aop
+        http://www.springframework.org/schema/aop/spring-aop.xsd
+        http://www.springframework.org/schema/tx
+        http://www.springframework.org/schema/tx/spring-tx.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+        
+    <!-- 加载配置属性文件 -->
+	<context:property-placeholder ignore-unresolvable="true" location="classpath:web.properties" />
+
+	<context:component-scan base-package="com.bk.sys" />
+	<context:component-scan base-package="com.bk.wd" >
+		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
+	</context:component-scan>
+	<context:component-scan base-package="com.bk.wd.pl" />
+	<context:component-scan base-package="com.bk.bi" />
+	<context:component-scan base-package="com.bk.oa" />
+	<context:component-scan base-package="com.bk.sm" />
+	<context:component-scan base-package="com.bk.cll" />
+</beans>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1596 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/meeting_luoshan.ftl


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1074 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/modules/app_overview.ftl


+ 118 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/modules/app_shixin_court.ftl

@@ -0,0 +1,118 @@
+<html lang="en">
+<head style="background-color: rgb(240,240,240)">
+<title>总览</title>
+<style type="text/css">
+html body {
+	width:100%;	
+	font-size:12px;
+	box-sizing:content-box;
+	overflow-x:hidden;
+    font-family:SimHei !important;
+}
+.table_center td {
+	text-align:center;	
+}
+table {
+	border-collapse:collapse;
+	width:100%;
+    font-size: 12px;
+	margin:0 auto;
+	left:0;
+	right:0;
+}
+table td, table th {
+	border:1px solid #ddd;	
+	padding:10px;
+}
+.td_padding {
+	border:2px solid #103050;
+}
+table td {
+	color : #103050;
+}
+table.soft_info_table td {
+	color : #708090;
+}
+
+table th {
+	font-weight : 100;
+	color : #000000;
+}
+
+.width48p {
+	width: 48%;
+	float: left;
+}
+.clear_both {
+	clear: both;
+}
+</style>
+</head>
+<body>
+    <#list shixinList as wdCourtQuery>
+        <#if wdCourtQuery.getJsonListData()?size gt 0>
+            <table cellspacing="0">
+                <tr>
+                    <td colspan="4" class="td_padding">
+                    </td>
+                </tr>
+                <tr>
+                    <th width="12%">查询时间</th>
+                    <th width="25%">${(wdCourtQuery.createDate)?string("yyyy-MM-dd HH:mm:ss")}</th>
+                    <th width="12%">查询信息</th>
+                    <th>${wdCourtQuery.targetName }(${wdCourtQuery.targetIdcard })</th>
+                </tr>
+            </table>
+            <#list wdCourtQuery.getJsonListData() as data>
+                <table cellspacing="0">
+                    <tr>
+                        <td colspan="2" class="td_padding">
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>发布时间</th>
+                        <td>${data.publishDate }</td>
+                    </tr>
+                    <tr>
+                        <th>执行法院</th>
+                        <td>${data.courtName }</td>
+                    </tr>
+                    <tr>
+                        <th>省份</th>
+                        <td>${data.areaName }</td>
+                    </tr>
+                    <tr>
+                        <th>执行依据文号</th>
+                        <td>${data.gistId }</td>
+                    </tr>
+                    <tr>
+                        <th>立案时间</th>
+                        <td>${data.regDate }</td>
+                    </tr>
+                    <tr>
+                        <th>案号</th>
+                        <td>${data.caseCode }</td>
+                    </tr>
+                    <tr>
+                        <th>做出执行依据单位</th>
+                        <td>${data.gistUnit }</td>
+                    </tr>
+                    <tr>
+                        <th>生效法律文书确定的义务</th>
+                        <td>${data.duty }</td>
+                    </tr>
+                    <tr>
+                        <th>失信被执行人行为具体情形</th>
+                        <td>${data.disruptTypeName }</td>
+                    </tr>
+                    <tr>
+                        <th>被执行人的履行情况</th>
+                        <td>${data.performance }</td>
+                    </tr>
+                </table>
+            </#list>
+            <br></br>
+        </#if>
+    </#list>
+</body>
+</html>

+ 94 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/modules/app_zhixin_court.ftl

@@ -0,0 +1,94 @@
+<html lang="en">
+<head style="background-color: rgb(240,240,240)">
+<title>总览</title>
+<style type="text/css">
+html body {
+	width:100%;	
+	font-size:12px;
+	box-sizing:content-box;
+	overflow-x:hidden;
+    font-family:SimHei !important;
+}
+.table_center td {
+	text-align:center;	
+}
+table {
+	border-collapse:collapse;
+	width:100%;
+    font-size: 12px;
+	margin:0 auto;
+	left:0;
+	right:0;
+}
+table td, table th {
+	border:1px solid #ddd;	
+	padding:10px;
+}
+.td_padding {
+	border:2px solid #103050;
+}
+table td {
+	color : #103050;
+}
+table.soft_info_table td {
+	color : #708090;
+}
+
+table th {
+	font-weight : 100;
+	color : #000000;
+}
+
+.width48p {
+	width: 48%;
+	float: left;
+}
+.clear_both {
+	clear: both;
+}
+</style>
+</head>
+<body>
+    <#list zhixinList as wdCourtQuery>
+        <#if wdCourtQuery.getJsonListData()?size gt 0>
+            <table cellspacing="0">
+                <tr>
+                    <td colspan="4" class="td_padding">
+                    </td>
+                </tr>
+                <tr>
+                    <th width="12%">查询时间</th>
+                    <th width="25%">${(wdCourtQuery.createDate)?string("yyyy-MM-dd HH:mm:ss")}</th>
+                    <th width="12%">查询信息</th>
+                    <th>${wdCourtQuery.targetName }(${wdCourtQuery.targetIdcard })</th>
+                </tr>
+            </table>
+            <#list wdCourtQuery.getJsonListData() as data>
+    			<table cellspacing="0">
+    				<tr>
+						<td colspan="2" class="td_padding">
+						</td>
+					</tr>
+					<tr>
+                        <th>立案时间</th>
+                        <td>${data.publishDate }</td>
+                    </tr>
+                    <tr>
+                        <th>执行法院</th>
+                        <td>${data.courtName }</td>
+                    </tr>
+                    <tr>
+                        <th>案号</th>
+                        <td>${data.areaName }</td>
+                    </tr>
+                    <tr>
+                        <th>执行标的</th>
+                        <td>${data.gistId }</td>
+                    </tr>
+    			</table>
+    		</#list>
+    		<br></br>
+        </#if>
+    </#list>
+</body>
+</html>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3870 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/resolution_luoshan.ftl


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5566 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/resolution_qingyuan.ftl


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3952 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/resolution_xuanhua.ftl


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2720 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/META-INF/template/review_report_luoshan.ftl


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/base/BaseController.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/config/WebConfig.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/constant/SheetConstant.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/cll/CllApplicationController.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/cll/CllCustomerEntranceController.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/oa/UserLocationController.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/open/ApplitionController.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sm/SmElementController.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sm/SmModelController.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sys/AreaController.class


BIN=BIN
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sys/ConfigurationController.class


+ 0 - 0
bk-wd-web/src/main/webapp/WEB-INF/classes/com/bk/wd/web/controller/sys/DictController.class


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio