Bladeren bron

初始化

jz.kai 3 jaren geleden
bovenliggende
commit
d2a3f49e67
100 gewijzigde bestanden met toevoegingen van 7938 en 0 verwijderingen
  1. 31 0
      .gitignore
  2. 221 0
      common/pom.xml
  3. 13 0
      common/src/main/java/com/jpsoft/excellent/config/BaiduConfig.java
  4. 17 0
      common/src/main/java/com/jpsoft/excellent/config/OSSConfig.java
  5. 30 0
      common/src/main/java/com/jpsoft/excellent/config/WechatConfig.java
  6. 19 0
      common/src/main/java/com/jpsoft/excellent/modules/base/dao/IncidentAttachmentDAO.java
  7. 19 0
      common/src/main/java/com/jpsoft/excellent/modules/base/dao/IncidentDAO.java
  8. 20 0
      common/src/main/java/com/jpsoft/excellent/modules/base/dao/IncidentStepDAO.java
  9. 20 0
      common/src/main/java/com/jpsoft/excellent/modules/base/dao/OrganizationDAO.java
  10. 18 0
      common/src/main/java/com/jpsoft/excellent/modules/base/dao/PersonDAO.java
  11. 17 0
      common/src/main/java/com/jpsoft/excellent/modules/base/dto/IncidentAttachmentDTO.java
  12. 99 0
      common/src/main/java/com/jpsoft/excellent/modules/base/entity/Incident.java
  13. 35 0
      common/src/main/java/com/jpsoft/excellent/modules/base/entity/IncidentAttachment.java
  14. 53 0
      common/src/main/java/com/jpsoft/excellent/modules/base/entity/IncidentStep.java
  15. 41 0
      common/src/main/java/com/jpsoft/excellent/modules/base/entity/Organization.java
  16. 43 0
      common/src/main/java/com/jpsoft/excellent/modules/base/entity/Person.java
  17. 18 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/IncidentAttachmentService.java
  18. 18 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/IncidentService.java
  19. 19 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/IncidentStepService.java
  20. 19 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/OrganizationService.java
  21. 17 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/PersonService.java
  22. 75 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/IncidentAttachmentServiceImpl.java
  23. 78 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/IncidentServiceImpl.java
  24. 81 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/IncidentStepServiceImpl.java
  25. 81 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/OrganizationServiceImpl.java
  26. 69 0
      common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/PersonServiceImpl.java
  27. 50 0
      common/src/main/java/com/jpsoft/excellent/modules/common/dto/MessageResult.java
  28. 32 0
      common/src/main/java/com/jpsoft/excellent/modules/common/dto/Sort.java
  29. 21 0
      common/src/main/java/com/jpsoft/excellent/modules/common/service/BaseService.java
  30. 105 0
      common/src/main/java/com/jpsoft/excellent/modules/common/service/IRedisService.java
  31. 37 0
      common/src/main/java/com/jpsoft/excellent/modules/common/service/impl/RedisServiceImpl.java
  32. 130 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/AESUtil.java
  33. 95 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/BASE64DecodedMultipartFile.java
  34. 106 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/BaiduOCR.java
  35. 273 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/Base64.java
  36. 198 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/CheckIdCard.java
  37. 76 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/DES3.java
  38. 72 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/FileUtil.java
  39. 135 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/AbstractCaptchaA.java
  40. 29 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/AbstractGeneratorA.java
  41. 39 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/CaptchaUtilA.java
  42. 55 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/CircleCaptchaA.java
  43. 31 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/RandomGeneratorA.java
  44. 387 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/HttpConnectionUtil.java
  45. 130 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/HttpUtil.java
  46. 24 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/MyX509TrustManager.java
  47. 501 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/OSSUtil.java
  48. 428 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/POIUtils.java
  49. 84 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/PojoUtils.java
  50. 115 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/SMSUtil.java
  51. 70 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/Sign.java
  52. 161 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/StringUtils.java
  53. 93 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/TimeZonesUtil.java
  54. 218 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/WechatMessageUtil.java
  55. 327 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/WeixinUtil.java
  56. 60 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/AesException.java
  57. 26 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/ByteGroup.java
  58. 67 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/PKCS7Encoder.java
  59. 61 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/SHA1.java
  60. 291 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/WXBizMsgCrypt.java
  61. 72 0
      common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/XMLParse.java
  62. 32 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/DataDictionaryDAO.java
  63. 21 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/MenuDAO.java
  64. 21 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/PermissionDAO.java
  65. 18 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/RoleDAO.java
  66. 22 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/RoleMenuDAO.java
  67. 20 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/RolePermissionDAO.java
  68. 19 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/SysLogDAO.java
  69. 22 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/UserDAO.java
  70. 24 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dao/UserRoleDAO.java
  71. 24 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/dto/RoleRelatedDTO.java
  72. 37 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/DataDictionary.java
  73. 199 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/Menu.java
  74. 142 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/Permission.java
  75. 129 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/Role.java
  76. 129 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/RoleMenu.java
  77. 129 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/RolePermission.java
  78. 37 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/SysLog.java
  79. 37 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/User.java
  80. 129 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/entity/UserRole.java
  81. 27 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/DataDictionaryService.java
  82. 21 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/MenuService.java
  83. 19 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/PermissionService.java
  84. 19 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/RoleMenuService.java
  85. 21 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/RolePermissionService.java
  86. 17 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/RoleService.java
  87. 18 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/SysLogService.java
  88. 23 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/UserRoleService.java
  89. 19 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/UserService.java
  90. 118 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/DataDictionaryServiceImpl.java
  91. 83 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/MenuServiceImpl.java
  92. 74 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/PermissionServiceImpl.java
  93. 79 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/RoleMenuServiceImpl.java
  94. 79 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/RolePermissionServiceImpl.java
  95. 69 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/RoleServiceImpl.java
  96. 70 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/SysLogServiceImpl.java
  97. 91 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/UserRoleServiceImpl.java
  98. 81 0
      common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/UserServiceImpl.java
  99. 29 0
      common/src/main/java/com/jpsoft/excellent/modules/wechat/entity/AccessToken.java
  100. 20 0
      common/src/main/java/com/jpsoft/excellent/modules/wechat/vo/UserInfo.java

+ 31 - 0
.gitignore

@@ -0,0 +1,31 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**
+!**/src/test/**
+.mvn
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+
+### VS Code ###
+.vscode/

+ 221 - 0
common/pom.xml

@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>excellent-server</artifactId>
+        <groupId>com.jpsoft.excellent</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>common</artifactId>
+    <name>common</name>
+    <description>荆州市委督查办公平台公共库</description>
+    <packaging>jar</packaging>
+    <properties>
+        <swagger2.version>2.7.0</swagger2.version>
+        <jwts.version>0.10.5</jwts.version>
+        <netty-all.version>4.1.6.Final</netty-all.version>
+        <fastjson.version>1.2.29</fastjson.version>
+        <alipay.version>4.8.10.ALL</alipay.version>
+        <ijpay.version>2.3.2</ijpay.version>
+        <poi.version>4.1.0</poi.version>
+    </properties>
+    <dependencies>
+
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.kie.modules</groupId>
+            <artifactId>org-apache-commons-httpclient</artifactId>
+            <version>6.2.0.CR2</version>
+            <type>pom</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>${poi.version}</version>
+            <scope>compile</scope>
+            <exclusions>
+                <exclusion>
+                    <artifactId>commons-codec</artifactId>
+                    <groupId>commons-codec</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-scratchpad</artifactId>
+            <version>${poi.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>${poi.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml-schemas</artifactId>
+            <version>${poi.version}</version>
+            <!--  <scope>compile</scope>-->
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-codec</groupId>
+                    <artifactId>commons-codec</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>${swagger2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>${swagger2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-codec</groupId>
+                    <artifactId>commons-codec</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-all</artifactId>
+            <version>${netty-all.version}</version>
+        </dependency>
+        <!--json start-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>net.sf.json-lib</groupId>
+            <artifactId>json-lib</artifactId>
+            <version>2.4</version>
+            <type>jar</type>
+            <classifier>jdk15</classifier>
+        </dependency>
+        <!--json end-->
+
+        <dependency>
+            <groupId>com.github.dozermapper</groupId>
+            <artifactId>dozer-core</artifactId>
+            <version>6.4.1</version>
+        </dependency>
+
+        <!-- 数据库相关 start-->
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>LATEST</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <!-- 数据库相关 end-->
+
+        <!--短信相关 start-->
+        <dependency>
+            <groupId>com.taobao</groupId>
+            <artifactId>taobao-sdk-java</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+        <!--短信相关 end-->
+
+
+        <!-- aliyun oss start -->
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+        <!-- aliyun oss end -->
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>3.1.0</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>weixin-java-cp</artifactId>
+            <version>3.7.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk16</artifactId>
+            <version>1.46</version>
+        </dependency>
+
+        <!--rabbmitmq-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
+        <!-- hibernate validator-->
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>5.2.0.Final</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 13 - 0
common/src/main/java/com/jpsoft/excellent/config/BaiduConfig.java

@@ -0,0 +1,13 @@
+package com.jpsoft.excellent.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "baidu")
+@Data
+public class BaiduConfig {
+    private String ak;
+    private String sk;
+}

+ 17 - 0
common/src/main/java/com/jpsoft/excellent/config/OSSConfig.java

@@ -0,0 +1,17 @@
+package com.jpsoft.excellent.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "oss")
+@Data
+public class OSSConfig {
+    private String accessKeyId;
+    private String accessKeySecret;
+    private String endpoint;
+    private String bucketName;
+    private String urlPrefix;
+    private String objectPre;
+}

+ 30 - 0
common/src/main/java/com/jpsoft/excellent/config/WechatConfig.java

@@ -0,0 +1,30 @@
+package com.jpsoft.excellent.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@ConfigurationProperties(prefix = "wechat")
+@Component
+public class WechatConfig {
+    /**
+     * 设置微信公众号或者小程序等的appid
+     */
+    private String appId;
+
+    /**
+     * 设置微信公众号或者小程序等的appSecret
+     */
+    private String appSecret;
+
+    /**
+     * 获取通用token地址
+     */
+    private String tokenUrl;
+
+    /**
+     * 退回通知模板编号
+     */
+    private String backNoticeTemplateId;
+}

+ 19 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/IncidentAttachmentDAO.java

@@ -0,0 +1,19 @@
+package com.jpsoft.excellent.modules.base.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.base.entity.IncidentAttachment;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface IncidentAttachmentDAO {
+	int insert(IncidentAttachment entity);
+	int update(IncidentAttachment entity);
+	int exist(String id);
+	IncidentAttachment get(String id);
+	int delete(String id);
+	List<IncidentAttachment> list();
+	List<IncidentAttachment> search(Map<String,Object> searchParams,List<Sort> sortList);
+	List<IncidentAttachment> findListByIncidentId(String incidentId,String attachmentType);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/IncidentDAO.java

@@ -0,0 +1,19 @@
+package com.jpsoft.excellent.modules.base.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.base.entity.Incident;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface IncidentDAO {
+	int insert(Incident entity);
+	int update(Incident entity);
+	int exist(String id);
+	Incident get(String id);
+	int delete(String id);
+	List<Incident> list();
+	List<Incident> search(Map<String,Object> searchParams,List<Sort> sortList);
+	List<Incident> searchPanding(Map<String,Object> searchParams,List<Sort> sortList);
+}

+ 20 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/IncidentStepDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.excellent.modules.base.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.base.entity.IncidentStep;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface IncidentStepDAO {
+	int insert(IncidentStep entity);
+	int update(IncidentStep entity);
+	int exist(String id);
+	IncidentStep get(String id);
+	int delete(String id);
+	List<IncidentStep> list();
+	List<IncidentStep> search(Map<String,Object> searchParams,List<Sort> sortList);
+	List<IncidentStep> findListByIncidentId(String incidentId);
+	List<IncidentStep> findTodayListByWarnTime(String startTime, String endTime);
+}

+ 20 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/OrganizationDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.excellent.modules.base.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.base.entity.Organization;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface OrganizationDAO {
+	int insert(Organization entity);
+	int update(Organization entity);
+	int exist(String id);
+	Organization get(String id);
+	int delete(String id);
+	List<Organization> list();
+	List<Organization> search(Map<String,Object> searchParams,List<Sort> sortList);
+	String getLevel();
+	Organization findByName(String name);
+}

+ 18 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/PersonDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.excellent.modules.base.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.base.entity.Person;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface PersonDAO {
+	int insert(Person entity);
+	int update(Person entity);
+	int exist(String id);
+	Person get(String id);
+	int delete(String id);
+	List<Person> list();
+	List<Person> search(Map<String,Object> searchParams,List<Sort> sortList);
+}

+ 17 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dto/IncidentAttachmentDTO.java

@@ -0,0 +1,17 @@
+package com.jpsoft.excellent.modules.base.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+  描述:base_incident_attachment的实体类
+ */
+@Data
+@ApiModel(value = "base_incident_attachment的实体类")
+public class IncidentAttachmentDTO {
+        @ApiModelProperty(value = "附件标题")
+    private String name;
+        @ApiModelProperty(value = "附件路径")
+    private String url;
+}

+ 99 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/Incident.java

@@ -0,0 +1,99 @@
+package com.jpsoft.excellent.modules.base.entity;
+
+import java.util.Date;
+import java.util.List;
+
+import com.jpsoft.excellent.modules.base.dto.IncidentAttachmentDTO;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:base_incident的实体类
+ */
+@Data
+@ApiModel(value = "base_incident的实体类")
+public class Incident {
+        @ApiModelProperty(value = "菜单编号")
+    private String id;
+        @ApiModelProperty(value = "标题")
+    private String title;
+        @ApiModelProperty(value = "内容")
+    private String content;
+        @ApiModelProperty(value = "督办类型")
+    private String caseType;
+        @ApiModelProperty(value = "督办类型名称")
+    private String caseTypeName;
+        @ApiModelProperty(value = "领导批示")
+    private String instructions;
+        @ApiModelProperty(value = "领导批示")
+    private String instructionsNumber;
+        @ApiModelProperty(value = "领导批示类型")
+    private String instructionsType;
+    @ApiModelProperty(value = "领导批示名称")
+    private String instructionsName;
+        @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
+	    @ApiModelProperty(value = "领导批示时间")
+    private Date instructionsTime;
+        @ApiModelProperty(value = "事件状态")
+    private String isFinished;
+        @ApiModelProperty(value = "事件状态名称")
+    private String isFinishedName;
+        @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+        @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
+	    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+        @ApiModelProperty(value = "创建人")
+    private String createBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
+	    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+        @ApiModelProperty(value = "更新人")
+    private String updateBy;
+        @ApiModelProperty(value = "附件列表")
+    private List<IncidentAttachmentDTO> attList;
+        @ApiModelProperty(value = "图片列表")
+    private List<IncidentAttachmentDTO> picList;
+        @ApiModelProperty(value = "图片路径列表")
+    private String[] picUrlList;
+        @ApiModelProperty(value = "步进列表")
+    private List<IncidentStep> incidentStepList;
+        @ApiModelProperty(value = "步进条数")
+    private Integer incidentStepSize;
+    @ApiModelProperty(value = "菜单编号")
+    private String stepId;
+    @ApiModelProperty(value = "责任单位")
+    private String stepOrgId;
+    @ApiModelProperty(value = "责任单位名称")
+    private String stepOrgName;
+    @ApiModelProperty(value = "责任人")
+    private String stepPersonId;
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
+    @ApiModelProperty(value = "提醒时间")
+    private Date stepWarnTime;
+    @ApiModelProperty(value = "处置内容")
+    private String stepContent;
+    @ApiModelProperty(value = "办理期限")
+    private Date stepAllotedTime;
+    @ApiModelProperty(value = "提交处置方式")
+    private String subWayType;
+    @ApiModelProperty(value = "处置内容")
+    private String subContent;
+    @ApiModelProperty(value = "责任单位")
+    private String subOrgId;
+    @ApiModelProperty(value = "责任单位")
+    private String subPersonId;
+    @ApiModelProperty(value = "提醒时间")
+    private Date subWarnTime;
+    @ApiModelProperty(value = "办理期限")
+    private Date subAllotedTime;
+    @ApiModelProperty(value = "报警灯")
+    private String warningLight;
+}

+ 35 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/IncidentAttachment.java

@@ -0,0 +1,35 @@
+package com.jpsoft.excellent.modules.base.entity;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:base_incident_attachment的实体类
+ */
+@Data
+@ApiModel(value = "base_incident_attachment的实体类")
+public class IncidentAttachment {
+        @ApiModelProperty(value = "编号")
+    private String id;
+        @ApiModelProperty(value = "督查事件编号")
+    private String incidentId;
+        @ApiModelProperty(value = "附件类型")
+    private String attachmentType;
+        @ApiModelProperty(value = "附件标题")
+    private String attachmentTitle;
+        @ApiModelProperty(value = "附件路径")
+    private String attachmentUrl;
+        @ApiModelProperty(value = "序号")
+    private Integer sortNo;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+        @ApiModelProperty(value = "创建人")
+    private String createBy;
+}

+ 53 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/IncidentStep.java

@@ -0,0 +1,53 @@
+package com.jpsoft.excellent.modules.base.entity;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:base_incident_step的实体类
+ */
+@Data
+@ApiModel(value = "base_incident_step的实体类")
+public class IncidentStep {
+        @ApiModelProperty(value = "菜单编号")
+    private String id;
+        @ApiModelProperty(value = "督查事件编号")
+    private String incidentId;
+        @ApiModelProperty(value = "责任单位")
+    private String orgId;
+        @ApiModelProperty(value = "责任单位名称")
+    private String orgName;
+        @ApiModelProperty(value = "责任人")
+    private String personId;
+        @ApiModelProperty(value = "责任人姓名")
+    private String personName;
+        @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
+	    @ApiModelProperty(value = "提醒时间")
+    private Date warnTime;
+        @ApiModelProperty(value = "提醒状态")
+    private Boolean warnType;
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
+    @ApiModelProperty(value = "办理期限")
+    private Date allotedTime;
+        @ApiModelProperty(value = "处置内容")
+    private String content;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+        @ApiModelProperty(value = "创建人")
+    private String createBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+        @ApiModelProperty(value = "更新人")
+    private String updateBy;
+}

+ 41 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/Organization.java

@@ -0,0 +1,41 @@
+package com.jpsoft.excellent.modules.base.entity;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:base_organization的实体类
+ */
+@Data
+@ApiModel(value = "base_organization的实体类")
+public class Organization {
+        @ApiModelProperty(value = "菜单编号")
+    private String id;
+        @ApiModelProperty(value = "机构名称")
+    private String name;
+        @ApiModelProperty(value = "上级机构")
+    private String parentId;
+        @ApiModelProperty(value = "上级机构")
+    private String parentName;
+        @ApiModelProperty(value = "机构代码")
+    private String code;
+        @ApiModelProperty(value = "")
+    private Boolean delFlag;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "")
+    private Date createTime;
+        @ApiModelProperty(value = "")
+    private String createBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "")
+    private Date updateTime;
+        @ApiModelProperty(value = "")
+    private String updateBy;
+}

+ 43 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/Person.java

@@ -0,0 +1,43 @@
+package com.jpsoft.excellent.modules.base.entity;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:base_person的实体类
+ */
+@Data
+@ApiModel(value = "base_person的实体类")
+public class Person {
+        @ApiModelProperty(value = "编号")
+    private String id;
+        @ApiModelProperty(value = "机构编号")
+    private String orgId;
+        @ApiModelProperty(value = "机构名称")
+    private String orgName;
+        @ApiModelProperty(value = "姓名")
+    private String name;
+        @ApiModelProperty(value = "电话")
+    private String phone;
+        @ApiModelProperty(value = "职务")
+    private String position;
+        @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+        @ApiModelProperty(value = "创建人")
+    private String createBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+        @ApiModelProperty(value = "更新人")
+    private String updateBy;
+}

+ 18 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/IncidentAttachmentService.java

@@ -0,0 +1,18 @@
+package com.jpsoft.excellent.modules.base.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.base.entity.IncidentAttachment;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface IncidentAttachmentService {
+	IncidentAttachment get(String id);
+	boolean exist(String id);
+	int insert(IncidentAttachment model);
+	int update(IncidentAttachment model);
+	int delete(String id);
+	List<IncidentAttachment> list();
+	Page<IncidentAttachment> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+	List<IncidentAttachment> findListByIncidentId(String incidentId,String attachmentType);
+}

+ 18 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/IncidentService.java

@@ -0,0 +1,18 @@
+package com.jpsoft.excellent.modules.base.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.base.entity.Incident;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface IncidentService {
+	Incident get(String id);
+	boolean exist(String id);
+	int insert(Incident model);
+	int update(Incident model);
+	int delete(String id);
+	List<Incident> list();
+	Page<Incident> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+	Page<Incident> pageSearchPanding(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/IncidentStepService.java

@@ -0,0 +1,19 @@
+package com.jpsoft.excellent.modules.base.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.base.entity.IncidentStep;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface IncidentStepService {
+	IncidentStep get(String id);
+	boolean exist(String id);
+	int insert(IncidentStep model);
+	int update(IncidentStep model);
+	int delete(String id);
+	List<IncidentStep> list();
+	Page<IncidentStep> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+	List<IncidentStep> findListByIncidentId(String incidentId);
+	List<IncidentStep> findTodayListByWarnTime(String startTime, String endTime);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/OrganizationService.java

@@ -0,0 +1,19 @@
+package com.jpsoft.excellent.modules.base.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.base.entity.Organization;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface OrganizationService {
+	Organization get(String id);
+	boolean exist(String id);
+	int insert(Organization model);
+	int update(Organization model);
+	int delete(String id);
+	List<Organization> list();
+	Page<Organization> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+	String getLevel();
+	Organization findByName(String name);
+}

+ 17 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/PersonService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.excellent.modules.base.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.base.entity.Person;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface PersonService {
+	Person get(String id);
+	boolean exist(String id);
+	int insert(Person model);
+	int update(Person model);
+	int delete(String id);
+	List<Person> list();
+	Page<Person> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+}

+ 75 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/IncidentAttachmentServiceImpl.java

@@ -0,0 +1,75 @@
+package com.jpsoft.excellent.modules.base.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.base.dao.IncidentAttachmentDAO;
+import com.jpsoft.excellent.modules.base.entity.IncidentAttachment;
+import com.jpsoft.excellent.modules.base.service.IncidentAttachmentService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="incidentAttachmentService")
+public class IncidentAttachmentServiceImpl implements IncidentAttachmentService {
+	@Resource(name="incidentAttachmentDAO")
+	private IncidentAttachmentDAO incidentAttachmentDAO;
+
+	@Override
+	public IncidentAttachment get(String id) {
+		// TODO Auto-generated method stub
+		return incidentAttachmentDAO.get(id);
+	}
+
+	@Override
+	public int insert(IncidentAttachment model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return incidentAttachmentDAO.insert(model);
+	}
+
+	@Override
+	public int update(IncidentAttachment model) {
+		// TODO Auto-generated method stub
+		return incidentAttachmentDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return incidentAttachmentDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = incidentAttachmentDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<IncidentAttachment> list() {
+		// TODO Auto-generated method stub
+		return incidentAttachmentDAO.list();
+	}
+
+	@Override
+	public List<IncidentAttachment> findListByIncidentId(String incidentId,String attachmentType) {
+		// TODO Auto-generated method stub
+		return incidentAttachmentDAO.findListByIncidentId(incidentId,attachmentType);
+	}
+		
+	@Override
+	public Page<IncidentAttachment> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<IncidentAttachment> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            incidentAttachmentDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 78 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/IncidentServiceImpl.java

@@ -0,0 +1,78 @@
+package com.jpsoft.excellent.modules.base.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.base.dao.IncidentDAO;
+import com.jpsoft.excellent.modules.base.entity.Incident;
+import com.jpsoft.excellent.modules.base.service.IncidentService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="incidentService")
+public class IncidentServiceImpl implements IncidentService {
+	@Resource(name="incidentDAO")
+	private IncidentDAO incidentDAO;
+
+	@Override
+	public Incident get(String id) {
+		// TODO Auto-generated method stub
+		return incidentDAO.get(id);
+	}
+
+	@Override
+	public int insert(Incident model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return incidentDAO.insert(model);
+	}
+
+	@Override
+	public int update(Incident model) {
+		// TODO Auto-generated method stub
+		return incidentDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return incidentDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = incidentDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<Incident> list() {
+		// TODO Auto-generated method stub
+		return incidentDAO.list();
+	}
+		
+	@Override
+	public Page<Incident> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<Incident> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            incidentDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public Page<Incident> pageSearchPanding(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+		Page<Incident> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+			incidentDAO.searchPanding(searchParams,sortList);
+		});
+
+		return page;
+	}
+}

+ 81 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/IncidentStepServiceImpl.java

@@ -0,0 +1,81 @@
+package com.jpsoft.excellent.modules.base.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.base.dao.IncidentStepDAO;
+import com.jpsoft.excellent.modules.base.entity.IncidentStep;
+import com.jpsoft.excellent.modules.base.service.IncidentStepService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="incidentStepService")
+public class IncidentStepServiceImpl implements IncidentStepService {
+	@Resource(name="incidentStepDAO")
+	private IncidentStepDAO incidentStepDAO;
+
+	@Override
+	public IncidentStep get(String id) {
+		// TODO Auto-generated method stub
+		return incidentStepDAO.get(id);
+	}
+
+	@Override
+	public int insert(IncidentStep model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return incidentStepDAO.insert(model);
+	}
+
+	@Override
+	public int update(IncidentStep model) {
+		// TODO Auto-generated method stub
+		return incidentStepDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return incidentStepDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = incidentStepDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<IncidentStep> list() {
+		// TODO Auto-generated method stub
+		return incidentStepDAO.list();
+	}
+		
+	@Override
+	public Page<IncidentStep> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<IncidentStep> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            incidentStepDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public List<IncidentStep> findListByIncidentId(String incidentId){
+		// TODO Auto-generated method stub
+		return incidentStepDAO.findListByIncidentId(incidentId);
+	}
+
+	@Override
+	public List<IncidentStep> findTodayListByWarnTime(String startTime, String endTime){
+		// TODO Auto-generated method stub
+		return incidentStepDAO.findTodayListByWarnTime(startTime, endTime);
+	}
+}

+ 81 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/OrganizationServiceImpl.java

@@ -0,0 +1,81 @@
+package com.jpsoft.excellent.modules.base.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.base.dao.OrganizationDAO;
+import com.jpsoft.excellent.modules.base.entity.Organization;
+import com.jpsoft.excellent.modules.base.service.OrganizationService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="organizationService")
+public class OrganizationServiceImpl implements OrganizationService {
+	@Resource(name="organizationDAO")
+	private OrganizationDAO organizationDAO;
+
+	@Override
+	public Organization get(String id) {
+		// TODO Auto-generated method stub
+		return organizationDAO.get(id);
+	}
+
+	@Override
+	public int insert(Organization model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return organizationDAO.insert(model);
+	}
+
+	@Override
+	public int update(Organization model) {
+		// TODO Auto-generated method stub
+		return organizationDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return organizationDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = organizationDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<Organization> list() {
+		// TODO Auto-generated method stub
+		return organizationDAO.list();
+	}
+		
+	@Override
+	public Page<Organization> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<Organization> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            organizationDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public String getLevel() {
+		// TODO Auto-generated method stub
+		return organizationDAO.getLevel();
+	}
+
+	@Override
+	public Organization findByName(String name) {
+		// TODO Auto-generated method stub
+		return organizationDAO.findByName(name);
+	}
+}

+ 69 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/PersonServiceImpl.java

@@ -0,0 +1,69 @@
+package com.jpsoft.excellent.modules.base.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.base.dao.PersonDAO;
+import com.jpsoft.excellent.modules.base.entity.Person;
+import com.jpsoft.excellent.modules.base.service.PersonService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="personService")
+public class PersonServiceImpl implements PersonService {
+	@Resource(name="personDAO")
+	private PersonDAO personDAO;
+
+	@Override
+	public Person get(String id) {
+		// TODO Auto-generated method stub
+		return personDAO.get(id);
+	}
+
+	@Override
+	public int insert(Person model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return personDAO.insert(model);
+	}
+
+	@Override
+	public int update(Person model) {
+		// TODO Auto-generated method stub
+		return personDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return personDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = personDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<Person> list() {
+		// TODO Auto-generated method stub
+		return personDAO.list();
+	}
+		
+	@Override
+	public Page<Person> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<Person> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            personDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 50 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/dto/MessageResult.java

@@ -0,0 +1,50 @@
+package com.jpsoft.excellent.modules.common.dto;
+
+public class MessageResult<T> {
+	private boolean result;
+	private String message;
+	private T data;
+	private int code = 200;
+
+	public MessageResult() {
+	}
+
+	public MessageResult(boolean result, String message, T data, int code) {
+		this.result = result;
+		this.message = message;
+		this.data = data;
+		this.code = code;
+	}
+
+	public boolean isResult() {
+		return result;
+	}
+
+	public void setResult(boolean result) {
+		this.result = result;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	public T getData() {
+		return data;
+	}
+
+	public void setData(T data) {
+		this.data = data;
+	}
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+}

+ 32 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/dto/Sort.java

@@ -0,0 +1,32 @@
+package com.jpsoft.excellent.modules.common.dto;
+
+import java.io.Serializable;
+
+public class Sort implements Serializable {
+    private String name;
+    private String order;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOrder() {
+        return order;
+    }
+
+    public void setOrder(String order) {
+        this.order = order;
+    }
+
+    public Sort() {
+    }
+
+    public Sort(String name, String order) {
+        this.name = name;
+        this.order = order;
+    }
+}

+ 21 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/service/BaseService.java

@@ -0,0 +1,21 @@
+package com.jpsoft.excellent.modules.common.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+public interface BaseService<T> {
+    List<T> selectAll();
+
+    Page<T> pageList(int pageIndex, int pageSize, Map<String, Object> searchParams, List<Sort> orderList);
+
+    T get(String id);
+
+    int insert(T record);
+
+    int update(T record);
+
+    int delete(String id);
+}

+ 105 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/service/IRedisService.java

@@ -0,0 +1,105 @@
+package com.jpsoft.excellent.modules.common.service;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.HashOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+public abstract class IRedisService<T> {
+    @Autowired
+    protected RedisTemplate<String, Object> redisTemplate;
+    @Resource
+    protected HashOperations<String, String, T> hashOperations;
+
+    /**
+     * 存入redis中的key
+     *
+     * @return
+     */
+    protected abstract String getRedisKey(String jpKey);
+
+    /**
+     * 添加
+     *
+     * @param key    key
+     * @param doamin 对象
+     * @param expire 过期时间(单位:秒),传入 -1 时表示不设置过期时间
+     */
+    public void put(String jpKey, String key, T doamin, long expire) {
+        hashOperations.put(getRedisKey(jpKey), key, doamin);
+        if (expire != -1) {
+            redisTemplate.expire(getRedisKey(jpKey), expire, TimeUnit.SECONDS);
+        }
+    }
+
+    /**
+     * 删除
+     *
+     * @param key 传入key的名称
+     */
+    public void remove(String key) {
+        hashOperations.delete(getRedisKey(""), key);
+    }
+
+    /**
+     * 查询
+     *
+     * @param key 查询的key
+     * @return
+     */
+    public T get(String jpKey ,String key) {
+        return hashOperations.get(getRedisKey(jpKey), key);
+    }
+
+    /**
+     * 获取当前redis库下所有对象
+     *
+     * @return
+     */
+    public List<T> getAll(String jpkey) {
+        return hashOperations.values(getRedisKey(jpkey));
+    }
+
+    /**
+     * 查询查询当前redis库下所有key
+     *
+     * @return
+     */
+    public Set<String> getKeys() {
+        return hashOperations.keys(getRedisKey(""));
+    }
+
+    /**
+     * 判断key是否存在redis中
+     *
+     * @param key 传入key的名称
+     * @return
+     */
+    public boolean isKeyExists(String key) {
+        return hashOperations.hasKey(getRedisKey(""), key);
+    }
+
+    /**
+     * 查询当前key下缓存数量
+     *
+     * @return
+     */
+    public long count() {
+        return hashOperations.size(getRedisKey(""));
+    }
+
+    /**
+     * 清空redis
+     */
+    public void empty() {
+        Set<String> set = hashOperations.keys(getRedisKey(""));
+
+        for (String key : set) {
+        	hashOperations.delete(getRedisKey(""), key);
+        }
+    }
+}

+ 37 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/service/impl/RedisServiceImpl.java

@@ -0,0 +1,37 @@
+package com.jpsoft.excellent.modules.common.service.impl;
+
+import com.jpsoft.excellent.modules.common.service.IRedisService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+@Service(value="redisService")
+public class RedisServiceImpl extends IRedisService<Object> {
+    private static final String REDIS_KEY = "JP_HOUSEPROPERTY_REDIS_KEY";
+    private static final String REDIS_KEY1 = "VERIFYCODE_REDIS_KEY";
+    private static final String REDIS_KEY2 = "APITOKEN_REDIS_KEY";
+    private static final String REDIS_KEY3 = "ACCESSTOKEN_REDIS_KEY";
+    private static final String REDIS_KEY4 = "PERSONINFO_REDIS_KEY";
+
+
+    @SuppressWarnings("static-access")
+	@Override
+    protected String getRedisKey(String jpKey) {
+        if (jpKey.equals("code")){
+            return REDIS_KEY1;
+        }
+        if (jpKey.equals("apiToken")){
+            return REDIS_KEY2;
+        }
+        if (jpKey.equals("accessToken")){
+            return REDIS_KEY3;
+        }
+        if (jpKey.equals("personInfo")){
+            return REDIS_KEY4;
+        }
+        if (StringUtils.isBlank(jpKey)){
+            return REDIS_KEY;
+        }
+        return REDIS_KEY;
+
+    }
+}

+ 130 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/AESUtil.java

@@ -0,0 +1,130 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
+import java.io.UnsupportedEncodingException;
+import java.security.Security;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+
+public class AESUtil{
+    private static final String KEY_ALGORITHM = "AES";
+    private static final String DEFAULT_CIPHER_ALGORITHM = "AES/CBC/PKCS7Padding";//默认的加密算法
+
+    static {
+        Security.addProvider(new BouncyCastleProvider());
+    }
+
+    /**
+     * AES 加密操作,注意要先替换jre/lib/security/local_policy.jar和US_export_policy.jar,否则会报keysize不对
+     * @param content 待加密内容
+     * @param key 加密密钥
+     * @return 返回Base64转码后的加密数据
+     */
+    public static String encrypt(String content, String key) {
+        try {
+            Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);// 创建密码器
+
+            byte[] byteContent = content.getBytes("utf-8");
+            IvParameterSpec ivParameterSpec = createIV(key);
+
+            cipher.init(Cipher.ENCRYPT_MODE, getSecretKey(key),ivParameterSpec);// 初始化为加密模式的密码器
+
+            byte[] result = cipher.doFinal(byteContent);// 加密
+
+            System.out.println(cipher.getBlockSize());
+
+            return Base64.encode(result);//通过Base64转码返回
+
+        } catch (Exception ex) {
+            Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex);
+        }
+
+        return null;
+    }
+
+    /**
+     * AES 解密操作
+     *
+     * @param content
+     * @param key
+     * @return
+     */
+    public static String decrypt(String content, String key) {
+
+        try {
+            //实例化
+            Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
+            IvParameterSpec ivParameterSpec = createIV(key);
+
+            //使用密钥初始化,设置为解密模式
+            cipher.init(Cipher.DECRYPT_MODE, getSecretKey(key),ivParameterSpec);
+
+            //执行操作
+            byte[] result = cipher.doFinal(Base64.decode(content));
+
+            return new String(result, "utf-8");
+        } catch (Exception ex) {
+            Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex);
+        }
+
+        return null;
+    }
+
+    // 创建初始化向量, 长度为16bytes, 向量的作用其实就是salt
+    private static IvParameterSpec createIV(String key) throws UnsupportedEncodingException {
+        byte[] src = key.getBytes("UTF-8");
+
+        if (src.length < 16) {
+            throw new RuntimeException("无法从Key中获取偏移量!");
+        }
+
+        byte[] bs = new byte[16];
+        for (int i=0; i<16; i++){
+            bs[i] = src[i];
+        }
+
+        return new IvParameterSpec(bs);
+    }
+
+    /**
+     * 生成加密秘钥
+     *
+     * @return
+     */
+    private static SecretKeySpec getSecretKey(final String key) throws UnsupportedEncodingException {
+        //返回生成指定算法密钥生成器的 KeyGenerator 对象
+//        KeyGenerator kg = null;
+//
+//        try {
+//            kg = KeyGenerator.getInstance(KEY_ALGORITHM);
+//
+//            //AES 要求密钥长度为 256
+//            kg.init(256, new SecureRandom(key.getBytes("UTF-8")));
+//
+//            //生成一个密钥
+//            SecretKey secretKey = kg.generateKey();
+//
+//            return new SecretKeySpec(secretKey.getEncoded(), KEY_ALGORITHM);// 转换为AES专用密钥
+//        } catch (Exception ex) {
+//            Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex);
+//        }
+
+        SecretKeySpec keySpec = new SecretKeySpec(key.getBytes("UTF-8"), KEY_ALGORITHM);
+
+        return keySpec;
+    }
+
+    public static void main(String[] args) {
+        String content = "421002198311131816";
+        String key = "534a33e888b001a246b635b76e42d0dd";
+
+        //g5mIt+8LgfpLWpPOXg1vyl7j1jv+wN3vwIb6wdpir5M=
+        String enc = encrypt(content,key);
+
+        System.out.println(enc);
+    }
+}

+ 95 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/BASE64DecodedMultipartFile.java

@@ -0,0 +1,95 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import org.springframework.web.multipart.MultipartFile;
+import sun.misc.BASE64Decoder;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-3-15 16:06
+ */
+public class BASE64DecodedMultipartFile implements MultipartFile {
+
+    private final byte[] imgContent;
+    private final String header;
+
+    public BASE64DecodedMultipartFile(byte[] imgContent, String header) {
+        this.imgContent = imgContent;
+        this.header = header.split(";")[0];
+    }
+
+
+
+    @Override
+    public String getName() {
+        return null;
+    }
+
+    @Override
+    public String getOriginalFilename() {
+        return null;
+    }
+
+    @Override
+    public String getContentType() {
+        return null;
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return false;
+    }
+
+    @Override
+    public long getSize() {
+        return 0;
+    }
+
+    @Override
+    public byte[] getBytes() throws IOException {
+        return new byte[0];
+    }
+
+    @Override
+    public InputStream getInputStream() throws IOException {
+        return null;
+    }
+
+    @Override
+    public void transferTo(File file) throws IOException, IllegalStateException {
+
+    }
+
+    /**
+     * base64转MultipartFile文件
+     *
+     * @param base64
+     * @return
+     */
+    public static MultipartFile base64ToMultipart(String base64) {
+        try {
+            String[] baseStrs = base64.split(",");
+
+            System.out.println("base64:"+base64);
+            BASE64Decoder decoder = new BASE64Decoder();
+            byte[] b = new byte[0];
+            b = decoder.decodeBuffer(baseStrs[1]);
+
+            for (int i = 0; i < b.length; ++i) {
+                if (b[i] < 0) {
+                    b[i] += 256;
+                }
+            }
+
+            return new BASE64DecodedMultipartFile(b, baseStrs[0]);
+        } catch (IOException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+
+}

+ 106 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/BaiduOCR.java

@@ -0,0 +1,106 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import net.sf.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+
+public class BaiduOCR {
+    /**
+     * 获取API访问token
+     * 该token有一定的有效期,需要自行管理,当失效时需重新获取.
+     * @param ak - 百度云官网获取的 API Key
+     * @param sk - 百度云官网获取的 Securet Key
+     * @return assess_token 示例:
+     * "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
+     */
+    public static JSONObject getAuth(String ak, String sk) {
+        // 获取token地址
+        String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
+        String getAccessTokenUrl = authHost
+                // 1. grant_type为固定参数
+                + "grant_type=client_credentials"
+                // 2. 官网获取的 API Key
+                + "&client_id=" + ak
+                // 3. 官网获取的 Secret Key
+                + "&client_secret=" + sk;
+
+        try {
+            URL realUrl = new URL(getAccessTokenUrl);
+            // 打开和URL之间的连接
+            HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
+            connection.setRequestMethod("GET");
+            connection.connect();
+
+            // 定义 BufferedReader输入流来读取URL的响应
+            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            String result = "";
+            String line;
+
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+
+            System.err.println("result:" + result);
+            JSONObject jsonObject = JSONObject.fromObject(result);
+
+            return jsonObject;
+        } catch (Exception e) {
+            System.err.printf("获取token失败!");
+            e.printStackTrace(System.err);
+        }
+
+        return null;
+    }
+
+    public static JSONObject idcard(String accessToken,String base64Data) {
+        // 请求url
+        String url = "https://aip.baidubce.com/rest/2.0/ocr/v1/idcard";
+
+        try {
+//            byte[] imgData = FileUtil.readFileByBytes(filePath);
+//            String imgStr = Base64.encode(imgData);
+            String imgParam = URLEncoder.encode(base64Data, "UTF-8");
+
+            String param = "id_card_side=" + "front" + "&image=" + imgParam;
+
+            String result = HttpUtil.post(url, accessToken, param);
+            JSONObject jsonObject = JSONObject.fromObject(result);
+
+            System.out.println(result);
+
+            return jsonObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
+    public static JSONObject householdRegister(String accessToken, String base64Data) {
+        // 请求url
+        String url = "https://aip.baidubce.com/rest/2.0/ocr/v1/household_register";
+
+        try {
+            // 本地文件路径
+//            byte[] imgData = FileUtil.readFileByBytes(filePath);
+//            String imgStr = Base64.encode(imgData);
+            String imgParam = URLEncoder.encode(base64Data, "UTF-8");
+
+            String param = "image=" + imgParam;
+
+            String result = HttpUtil.post(url, accessToken, param);
+            JSONObject jsonObject = JSONObject.fromObject(result);
+
+            System.out.println(result);
+
+            return jsonObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

+ 273 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/Base64.java

@@ -0,0 +1,273 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+public final class Base64 {
+
+    static private final int     BASELENGTH           = 128;
+    static private final int     LOOKUPLENGTH         = 64;
+    static private final int     TWENTYFOURBITGROUP   = 24;
+    static private final int     EIGHTBIT             = 8;
+    static private final int     SIXTEENBIT           = 16;
+    static private final int     FOURBYTE             = 4;
+    static private final int     SIGN                 = -128;
+    static private final char    PAD                  = '=';
+    static private final boolean fDebug               = false;
+    static final private byte[]  base64Alphabet       = new byte[BASELENGTH];
+    static final private char[]  lookUpBase64Alphabet = new char[LOOKUPLENGTH];
+
+    static {
+        for (int i = 0; i < BASELENGTH; ++i) {
+            base64Alphabet[i] = -1;
+        }
+        for (int i = 'Z'; i >= 'A'; i--) {
+            base64Alphabet[i] = (byte) (i - 'A');
+        }
+        for (int i = 'z'; i >= 'a'; i--) {
+            base64Alphabet[i] = (byte) (i - 'a' + 26);
+        }
+
+        for (int i = '9'; i >= '0'; i--) {
+            base64Alphabet[i] = (byte) (i - '0' + 52);
+        }
+
+        base64Alphabet['+'] = 62;
+        base64Alphabet['/'] = 63;
+
+        for (int i = 0; i <= 25; i++) {
+            lookUpBase64Alphabet[i] = (char) ('A' + i);
+        }
+
+        for (int i = 26, j = 0; i <= 51; i++, j++) {
+            lookUpBase64Alphabet[i] = (char) ('a' + j);
+        }
+
+        for (int i = 52, j = 0; i <= 61; i++, j++) {
+            lookUpBase64Alphabet[i] = (char) ('0' + j);
+        }
+        lookUpBase64Alphabet[62] = (char) '+';
+        lookUpBase64Alphabet[63] = (char) '/';
+
+    }
+
+    private static boolean isWhiteSpace(char octect) {
+        return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
+    }
+
+    private static boolean isPad(char octect) {
+        return (octect == PAD);
+    }
+
+    private static boolean isData(char octect) {
+        return (octect < BASELENGTH && base64Alphabet[octect] != -1);
+    }
+
+    /**
+     * Encodes hex octects into Base64
+     *
+     * @param binaryData Array containing binaryData
+     * @return Encoded Base64 array
+     */
+    public static String encode(byte[] binaryData) {
+
+        if (binaryData == null) {
+            return null;
+        }
+
+        int lengthDataBits = binaryData.length * EIGHTBIT;
+        if (lengthDataBits == 0) {
+            return "";
+        }
+
+        int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
+        int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
+        int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
+        char encodedData[] = null;
+
+        encodedData = new char[numberQuartet * 4];
+
+        byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
+
+        int encodedIndex = 0;
+        int dataIndex = 0;
+        if (fDebug) {
+            System.out.println("number of triplets = " + numberTriplets);
+        }
+
+        for (int i = 0; i < numberTriplets; i++) {
+            b1 = binaryData[dataIndex++];
+            b2 = binaryData[dataIndex++];
+            b3 = binaryData[dataIndex++];
+
+            if (fDebug) {
+                System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3);
+            }
+
+            l = (byte) (b2 & 0x0f);
+            k = (byte) (b1 & 0x03);
+
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+            byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
+
+            if (fDebug) {
+                System.out.println("val2 = " + val2);
+                System.out.println("k4   = " + (k << 4));
+                System.out.println("vak  = " + (val2 | (k << 4)));
+            }
+
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
+        }
+
+        // form integral number of 6-bit groups
+        if (fewerThan24bits == EIGHTBIT) {
+            b1 = binaryData[dataIndex];
+            k = (byte) (b1 & 0x03);
+            if (fDebug) {
+                System.out.println("b1=" + b1);
+                System.out.println("b1<<2 = " + (b1 >> 2));
+            }
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
+            encodedData[encodedIndex++] = PAD;
+            encodedData[encodedIndex++] = PAD;
+        } else if (fewerThan24bits == SIXTEENBIT) {
+            b1 = binaryData[dataIndex];
+            b2 = binaryData[dataIndex + 1];
+            l = (byte) (b2 & 0x0f);
+            k = (byte) (b1 & 0x03);
+
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
+            encodedData[encodedIndex++] = PAD;
+        }
+
+        return new String(encodedData);
+    }
+
+    /**
+     * Decodes Base64 data into octects
+     *
+     * @param encoded string containing Base64 data
+     * @return Array containind decoded data.
+     */
+    public static byte[] decode(String encoded) {
+
+        if (encoded == null) {
+            return null;
+        }
+
+        char[] base64Data = encoded.toCharArray();
+        // remove white spaces
+        int len = removeWhiteSpace(base64Data);
+
+        if (len % FOURBYTE != 0) {
+            return null;//should be divisible by four
+        }
+
+        int numberQuadruple = (len / FOURBYTE);
+
+        if (numberQuadruple == 0) {
+            return new byte[0];
+        }
+
+        byte decodedData[] = null;
+        byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
+        char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
+
+        int i = 0;
+        int encodedIndex = 0;
+        int dataIndex = 0;
+        decodedData = new byte[(numberQuadruple) * 3];
+
+        for (; i < numberQuadruple - 1; i++) {
+
+            if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
+                    || !isData((d3 = base64Data[dataIndex++]))
+                    || !isData((d4 = base64Data[dataIndex++]))) {
+                return null;
+            }//if found "no data" just return null
+
+            b1 = base64Alphabet[d1];
+            b2 = base64Alphabet[d2];
+            b3 = base64Alphabet[d3];
+            b4 = base64Alphabet[d4];
+
+            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+        }
+
+        if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
+            return null;//if found "no data" just return null
+        }
+
+        b1 = base64Alphabet[d1];
+        b2 = base64Alphabet[d2];
+
+        d3 = base64Data[dataIndex++];
+        d4 = base64Data[dataIndex++];
+        if (!isData((d3)) || !isData((d4))) {//Check if they are PAD characters
+            if (isPad(d3) && isPad(d4)) {
+                if ((b2 & 0xf) != 0)//last 4 bits should be zero
+                {
+                    return null;
+                }
+                byte[] tmp = new byte[i * 3 + 1];
+                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+                tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
+                return tmp;
+            } else if (!isPad(d3) && isPad(d4)) {
+                b3 = base64Alphabet[d3];
+                if ((b3 & 0x3) != 0)//last 2 bits should be zero
+                {
+                    return null;
+                }
+                byte[] tmp = new byte[i * 3 + 2];
+                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+                tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+                tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+                return tmp;
+            } else {
+                return null;
+            }
+        } else { //No PAD e.g 3cQl
+            b3 = base64Alphabet[d3];
+            b4 = base64Alphabet[d4];
+            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+
+        }
+
+        return decodedData;
+    }
+
+    /**
+     * remove WhiteSpace from MIME containing encoded Base64 data.
+     *
+     * @param data  the byte array of base64 data (with WS)
+     * @return      the new length
+     */
+    private static int removeWhiteSpace(char[] data) {
+        if (data == null) {
+            return 0;
+        }
+
+        // count characters that's not whitespace
+        int newSize = 0;
+        int len = data.length;
+        for (int i = 0; i < len; i++) {
+            if (!isWhiteSpace(data[i])) {
+                data[newSize++] = data[i];
+            }
+        }
+        return newSize;
+    }
+}

+ 198 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/CheckIdCard.java

@@ -0,0 +1,198 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+/**
+ * 验证身份证号码 身份证号码, 可以解析身份证号码的各个字段,以及验证身份证号码是否有效; 身份证号码构成:6位地址编码+8位生日+3位顺序码+1位校验码
+ * 
+ * @ClassName: CheckIdCard
+ * @Description: TODO
+ * @author suncy
+ * @date 2013-1-4 上午11:06:09
+ * 
+ */
+public class CheckIdCard {
+	private String cardNumber; // 完整的身份证号码
+	private Boolean cacheValidateResult = null; // 缓存身份证是否有效,因为验证有效性使用频繁且计算复杂
+	private Date cacheBirthDate = null; // 缓存出生日期,因为出生日期使用频繁且计算复杂
+	private final static String BIRTH_DATE_FORMAT = "yyyyMMdd"; // 身份证号码中的出生日期的格式
+	private final static Date MINIMAL_BIRTH_DATE = new Date(-2209017600000L); // 身份证的最小出生日期,1900年1月1日
+	private final static int NEW_CARD_NUMBER_LENGTH = 18;
+	private final static int OLD_CARD_NUMBER_LENGTH = 15;
+	private final static char[] VERIFY_CODE = { '1', '0', 'X', '9', '8', '7',
+			'6', '5', '4', '3', '2' }; // 18位身份证中最后一位校验码
+	private final static int[] VERIFY_CODE_WEIGHT = { 7, 9, 10, 5, 8, 4, 2, 1,
+			6, 3, 7, 9, 10, 5, 8, 4, 2 };// 18位身份证中,各个数字的生成校验码时的权值
+
+	public boolean validate() {
+		if (null == cacheValidateResult) {
+			boolean result = true;
+			result = result && (null != cardNumber); // 身份证号不能为空
+			result = result && NEW_CARD_NUMBER_LENGTH == cardNumber.length(); // 身份证号长度是18(新证)
+			// 身份证号的前17位必须是阿拉伯数字
+			for (int i = 0; result && i < NEW_CARD_NUMBER_LENGTH - 1; i++) {
+				char ch = cardNumber.charAt(i);
+				result = result && ch >= '0' && ch <= '9';
+			}
+			// 身份证号的第18位校验正确
+			result = result
+					&& (calculateVerifyCode(cardNumber) == cardNumber
+							.charAt(NEW_CARD_NUMBER_LENGTH - 1));
+			// 出生日期不能晚于当前时间,并且不能早于1900年
+			try {
+				Date birthDate = this.getBirthDate();
+				result = result && null != birthDate;
+				result = result && birthDate.before(new Date());
+				result = result && birthDate.after(MINIMAL_BIRTH_DATE);
+				/**
+				 * 出生日期中的年、月、日必须正确,比如月份范围是[1,12],日期范围是[1,31],还需要校验闰年、大月、小月的情况时,
+				 * 月份和日期相符合
+				 */
+				String birthdayPart = this.getBirthDayPart();
+				String realBirthdayPart = this.createBirthDateParser().format(
+						birthDate);
+				result = result && (birthdayPart.equals(realBirthdayPart));
+			} catch (Exception e) {
+				result = false;
+			}
+			cacheValidateResult = Boolean.valueOf(result);// TODO
+			// 完整身份证号码的省市县区检验规则
+		}
+		return cacheValidateResult;
+	}
+
+	/**
+	 * 如果是15位身份证号码,则自动转换为18位
+	 * 
+	 * @param cardNumber
+	 * @return
+	 */
+	public CheckIdCard(String cardNumber) {
+		if (null != cardNumber) {
+			cardNumber = cardNumber.trim();
+			if (OLD_CARD_NUMBER_LENGTH == cardNumber.length()) {
+				cardNumber = contertToNewCardNumber(cardNumber);
+			}
+		}
+		this.cardNumber = cardNumber;
+	}
+
+	public String getCardNumber() {
+		return cardNumber;
+	}
+
+	public String getAddressCode() {
+		this.checkIfValid();
+		return this.cardNumber.substring(0, 6);
+	}
+
+	public Date getBirthDate() {
+		if (null == this.cacheBirthDate) {
+			try {
+				this.cacheBirthDate = this.createBirthDateParser().parse(
+						this.getBirthDayPart());
+			} catch (Exception e) {
+				throw new RuntimeException("身份证的出生日期无效");
+			}
+		}
+		return new Date(this.cacheBirthDate.getTime());
+	}
+
+	public boolean isMale() {
+		return 1 == this.getGenderCode();
+	}
+
+	public boolean isFemal() {
+		return false == this.isMale();
+	}
+
+	/**
+	 * 获取身份证的第17位,奇数为男性,偶数为女性
+	 * 
+	 * @return
+	 */
+	private int getGenderCode() {
+		this.checkIfValid();
+		char genderCode = this.cardNumber.charAt(NEW_CARD_NUMBER_LENGTH - 2);
+		return (((int) (genderCode - '0')) & 0x1);
+	}
+
+	private String getBirthDayPart() {
+		return this.cardNumber.substring(6, 14);
+	}
+
+	private SimpleDateFormat createBirthDateParser() {
+		return new SimpleDateFormat(BIRTH_DATE_FORMAT);
+	}
+
+	private void checkIfValid() {
+		if (false == this.validate()) {
+			throw new RuntimeException("身份证号码不正确!");
+		}
+	}
+
+	/**
+	 * 校验码(第十八位数):
+	 * 
+	 * 十七位数字本体码加权求和公式 S = Sum(Ai * Wi), i = 0...16 ,先对前17位数字的权求和;
+	 * Ai:表示第i位置上的身份证号码数字值 Wi:表示第i位置上的加权因子 Wi: 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4
+	 * 2; 计算模 Y = mod(S, 11)< 通过模得到对应的校验码 Y: 0 1 2 3 4 5 6 7 8 9 10 校验码: 1 0 X 9
+	 * 8 7 6 5 4 3 2
+	 * 
+	 * @param cardNumber
+	 * @return
+	 */
+	private static char calculateVerifyCode(CharSequence cardNumber) {
+		int sum = 0;
+		for (int i = 0; i < NEW_CARD_NUMBER_LENGTH - 1; i++) {
+			char ch = cardNumber.charAt(i);
+			sum += ((int) (ch - '0')) * VERIFY_CODE_WEIGHT[i];
+		}
+		return VERIFY_CODE[sum % 11];
+	}
+	
+	/**  
+     * 获取年龄
+     */    
+    public Integer getAge() {    
+        try {    
+            boolean validateAccess = validate();    
+            if (validateAccess) {
+                // 获取出生日期    
+                Date birthdate = getBirthDate();    
+                GregorianCalendar currentDay = new GregorianCalendar();
+                currentDay.setTime(birthdate);    
+                int year = currentDay.get(Calendar.YEAR);
+                //获取年龄  
+                SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy");
+                String nowYear=simpleDateFormat.format(new Date());  
+                return Integer.parseInt(nowYear)-year;     
+            }else{
+            	return null;
+            }
+        } catch (Exception e) {    
+            return null; 
+        }    
+    }    
+
+	/**
+	 * 把15位身份证号码转换到18位身份证号码<br>
+	 * 15位身份证号码与18位身份证号码的区别为:<br>
+	 * 1、15位身份证号码中,"出生年份"字段是2位,转换时需要补入"19",表示20世纪<br>
+	 * 2、15位身份证无最后一位校验码。18位身份证中,校验码根据根据前17位生成
+	 * 
+	 * @param oldCardNumber
+	 * @return
+	 */
+	private static String contertToNewCardNumber(String oldCardNumber) {
+		StringBuilder buf = new StringBuilder(NEW_CARD_NUMBER_LENGTH);
+		buf.append(oldCardNumber.substring(0, 6));
+		buf.append("19");
+		buf.append(oldCardNumber.substring(6));
+		buf.append(CheckIdCard.calculateVerifyCode(buf));
+		return buf.toString();
+	}
+}

+ 76 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/DES3.java

@@ -0,0 +1,76 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESedeKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.security.Key;
+
+public class DES3 {
+	public String encrypt(byte[] key, byte[] data)  throws Exception {
+
+        Key deskey = null;
+        DESedeKeySpec spec = new DESedeKeySpec(key);
+        SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("desede");
+        deskey = keyfactory.generateSecret(spec);
+        Cipher cipher = Cipher.getInstance("desede" + "/ECB/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, deskey);
+        byte[] bOut = cipher.doFinal(data);
+
+        return Base64.encode(bOut);
+    }
+    
+    public String encrypt(String key, String data)  throws Exception {
+    	return encrypt(getKeyByte(key),data.getBytes("UTF-8"));
+    }
+
+    public String decrypt(byte[] key, byte[] data) throws Exception {
+        Key deskey = null;
+        DESedeKeySpec spec = new DESedeKeySpec(key);
+        SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("desede");
+        deskey = keyfactory.generateSecret(spec);
+
+        Cipher cipher = Cipher.getInstance("desede" + "/ECB/PKCS5Padding");
+
+        cipher.init(Cipher.DECRYPT_MODE, deskey);
+
+        byte[] bOut = cipher.doFinal(data);
+
+        return new String(bOut, "UTF-8");
+    }
+    
+    public String decrypt(String key, String data)  throws Exception {
+    	return decrypt(getKeyByte(key), Base64.decode(data));
+    }
+
+    public byte[] getKeyByte(String key) throws UnsupportedEncodingException {
+        if (key == null) {
+            return new byte[0];
+        }
+
+        int length = key.length();
+        if (length >= 24) {
+            return key.substring(0, 24).getBytes("UTF-8");
+        } else {
+            for (int i = 0; i < (24 - length); i++) {
+                key += "0";
+            }
+            
+            return key.getBytes("UTF-8");
+        }
+    }
+    
+    public static void main(String[] args) {
+    	DES3 des3 = new DES3();
+		String appKey = "8ZZAHLlTMeNRCP6X";
+		
+		try {
+			System.out.println(des3.encrypt(appKey, "ac5c629f-068d-4b8d-8700-3c3d362337f0"));
+
+			System.out.println(des3.decrypt(appKey, "Xkb9FDXbmw8tEybl2ItjvomEK0QrL+pn6wt9yO7/vA7G9jIUiDhFLg=="));
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+}

+ 72 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/FileUtil.java

@@ -0,0 +1,72 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import java.io.*;
+
+/**
+ * 文件读取工具类
+ */
+public class FileUtil {
+
+    /**
+     * 读取文件内容,作为字符串返回
+     */
+    public static String readFileAsString(String filePath) throws IOException {
+        File file = new File(filePath);
+        if (!file.exists()) {
+            throw new FileNotFoundException(filePath);
+        } 
+
+        if (file.length() > 1024 * 1024 * 1024) {
+            throw new IOException("File is too large");
+        } 
+
+        StringBuilder sb = new StringBuilder((int) (file.length()));
+        // 创建字节输入流  
+        FileInputStream fis = new FileInputStream(filePath);  
+        // 创建一个长度为10240的Buffer
+        byte[] bbuf = new byte[10240];  
+        // 用于保存实际读取的字节数  
+        int hasRead = 0;  
+        while ( (hasRead = fis.read(bbuf)) > 0 ) {  
+            sb.append(new String(bbuf, 0, hasRead));  
+        }  
+        fis.close();  
+        return sb.toString();
+    }
+
+    /**
+     * 根据文件路径读取byte[] 数组
+     */
+    public static byte[] readFileByBytes(String filePath) throws IOException {
+        File file = new File(filePath);
+        if (!file.exists()) {
+            throw new FileNotFoundException(filePath);
+        } else {
+            ByteArrayOutputStream bos = new ByteArrayOutputStream((int) file.length());
+            BufferedInputStream in = null;
+
+            try {
+                in = new BufferedInputStream(new FileInputStream(file));
+                short bufSize = 1024;
+                byte[] buffer = new byte[bufSize];
+                int len1;
+                while (-1 != (len1 = in.read(buffer, 0, bufSize))) {
+                    bos.write(buffer, 0, len1);
+                }
+
+                byte[] var7 = bos.toByteArray();
+                return var7;
+            } finally {
+                try {
+                    if (in != null) {
+                        in.close();
+                    }
+                } catch (IOException var14) {
+                    var14.printStackTrace();
+                }
+
+                bos.close();
+            }
+        }
+    }
+}

+ 135 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/AbstractCaptchaA.java

@@ -0,0 +1,135 @@
+package com.jpsoft.excellent.modules.common.utils.Generator;
+
+import cn.hutool.captcha.ICaptcha;
+import cn.hutool.captcha.generator.CodeGenerator;
+import cn.hutool.core.codec.Base64;
+import cn.hutool.core.img.ImgUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.io.IORuntimeException;
+import cn.hutool.core.io.IoUtil;
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.*;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-8-8 15:27
+ */
+
+public abstract class AbstractCaptchaA implements ICaptcha {
+    private static final long serialVersionUID = 3180820918087507254L;
+    protected int width;
+    protected int height;
+    protected int interfereCount;
+    protected Font font;
+    protected String code;
+    protected byte[] imageBytes;
+    protected CodeGenerator generator;
+    protected Color background;
+
+    public AbstractCaptchaA(int width, int height, int codeCount, int interfereCount) {
+        this(width, height, new RandomGeneratorA(codeCount), interfereCount);
+    }
+
+    public AbstractCaptchaA(int width, int height, CodeGenerator generator, int interfereCount) {
+        this.width = 100;
+        this.height = 37;
+        this.interfereCount = 15;
+        this.width = width;
+        this.height = height;
+        this.generator = generator;
+        this.interfereCount = interfereCount;
+        this.font = new Font("Courier", 0, (int) ((double) this.height * 0.75D));
+        this.createCode();
+    }
+
+    public void createCode() {
+        this.generateCode();
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        ImgUtil.writePng(this.createImage(this.code), out);
+        this.imageBytes = out.toByteArray();
+    }
+
+    protected void generateCode() {
+        this.code = this.generator.generate();
+    }
+
+    protected abstract Image createImage(String var1);
+
+    public String getCode() {
+        return this.code;
+    }
+
+    public boolean verify(String userInputCode) {
+        return this.generator.verify(this.code, userInputCode);
+    }
+
+    public void write(String path) throws IORuntimeException {
+        this.write(FileUtil.touch(path));
+    }
+
+    public void write(File file) throws IORuntimeException {
+        try {
+            OutputStream out = FileUtil.getOutputStream(file);
+            Throwable var3 = null;
+
+            try {
+                this.write((OutputStream) out);
+            } catch (Throwable var13) {
+                var3 = var13;
+                throw var13;
+            } finally {
+                if (out != null) {
+                    if (var3 != null) {
+                        try {
+                            out.close();
+                        } catch (Throwable var12) {
+                            var3.addSuppressed(var12);
+                        }
+                    } else {
+                        out.close();
+                    }
+                }
+
+            }
+
+        } catch (IOException var15) {
+            throw new IORuntimeException(var15);
+        }
+    }
+
+    public void write(OutputStream out) {
+        IoUtil.write(out, false, this.imageBytes);
+    }
+
+    public BufferedImage getImage() {
+        if (null == this.imageBytes) {
+            this.createCode();
+        }
+
+        return ImgUtil.read(new ByteArrayInputStream(this.imageBytes));
+    }
+
+    public String getImageBase64() {
+        return Base64.encode(this.imageBytes);
+    }
+
+    public void setFont(Font font) {
+        this.font = font;
+    }
+
+    public CodeGenerator getGenerator() {
+        return this.generator;
+    }
+
+    public void setGenerator(CodeGenerator generator) {
+        this.generator = generator;
+        this.createCode();
+    }
+
+    public void setBackground(Color background) {
+        this.background = background;
+    }
+}
+

+ 29 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/AbstractGeneratorA.java

@@ -0,0 +1,29 @@
+package com.jpsoft.excellent.modules.common.utils.Generator;
+
+import cn.hutool.captcha.generator.CodeGenerator;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-8-8 15:21
+ */
+
+
+public abstract class AbstractGeneratorA implements CodeGenerator {
+    private static final long serialVersionUID = 8685744597154953479L;
+    protected String baseStr;
+    protected int length;
+
+    public AbstractGeneratorA(int count) {
+        this("0123456789", count);
+    }
+
+    public AbstractGeneratorA(String baseStr, int length) {
+        this.baseStr = baseStr;
+        this.length = length;
+    }
+
+    public int getLength() {
+        return this.length;
+    }
+}
+

+ 39 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/CaptchaUtilA.java

@@ -0,0 +1,39 @@
+package com.jpsoft.excellent.modules.common.utils.Generator;
+
+import cn.hutool.captcha.CircleCaptcha;
+import cn.hutool.captcha.LineCaptcha;
+import cn.hutool.captcha.ShearCaptcha;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-8-8 15:30
+ */
+public class CaptchaUtilA {
+
+    public CaptchaUtilA() {
+    }
+
+    public static LineCaptcha createLineCaptcha(int width, int height) {
+        return new LineCaptcha(width, height);
+    }
+
+    public static LineCaptcha createLineCaptcha(int width, int height, int codeCount, int lineCount) {
+        return new LineCaptcha(width, height, codeCount, lineCount);
+    }
+
+    public static CircleCaptcha createCircleCaptcha(int width, int height) {
+        return new CircleCaptcha(width, height);
+    }
+
+    public static CircleCaptchaA createCircleCaptcha(int width, int height, int codeCount, int circleCount) {
+        return new CircleCaptchaA(width, height, codeCount, circleCount);
+    }
+
+    public static ShearCaptcha createShearCaptcha(int width, int height) {
+        return new ShearCaptcha(width, height);
+    }
+
+    public static ShearCaptcha createShearCaptcha(int width, int height, int codeCount, int thickness) {
+        return new ShearCaptcha(width, height, codeCount, thickness);
+    }
+}

+ 55 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/CircleCaptchaA.java

@@ -0,0 +1,55 @@
+package com.jpsoft.excellent.modules.common.utils.Generator;
+
+import cn.hutool.core.img.GraphicsUtil;
+import cn.hutool.core.img.ImgUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.RandomUtil;
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.util.concurrent.ThreadLocalRandom;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-8-8 15:29
+ */
+
+    public class CircleCaptchaA extends AbstractCaptchaA {
+        private static final long serialVersionUID = -7096627300356535494L;
+
+        public CircleCaptchaA(int width, int height) {
+            this(width, height, 5);
+        }
+
+        public CircleCaptchaA(int width, int height, int codeCount) {
+            this(width, height, codeCount, 15);
+        }
+
+        public CircleCaptchaA(int width, int height, int codeCount, int interfereCount) {
+            super(width, height, codeCount, interfereCount);
+        }
+
+        public Image createImage(String code) {
+            BufferedImage image = new BufferedImage(this.width, this.height, 1);
+            Graphics2D g = ImgUtil.createGraphics(image, (Color) ObjectUtil.defaultIfNull(this.background, Color.WHITE));
+            this.drawInterfere(g);
+            this.drawString(g, code);
+            return image;
+        }
+
+        private void drawString(Graphics2D g, String code) {
+            g.setComposite(AlphaComposite.getInstance(3, 0.9F));
+            GraphicsUtil.drawStringColourful(g, code, this.font, this.width, this.height);
+        }
+
+        private void drawInterfere(Graphics2D g) {
+            ThreadLocalRandom random = RandomUtil.getRandom();
+
+            for(int i = 0; i < this.interfereCount; ++i) {
+                g.setColor(ImgUtil.randomColor(random));
+                g.drawOval(random.nextInt(this.width), random.nextInt(this.height), random.nextInt(this.height >> 1), random.nextInt(this.height >> 1));
+            }
+
+        }
+    }
+

+ 31 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/Generator/RandomGeneratorA.java

@@ -0,0 +1,31 @@
+package com.jpsoft.excellent.modules.common.utils.Generator;
+
+import cn.hutool.core.util.RandomUtil;
+import cn.hutool.core.util.StrUtil;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-8-8 15:25
+ */
+
+
+    public class RandomGeneratorA extends AbstractGeneratorA {
+        private static final long serialVersionUID = -7802758587765561876L;
+
+        public RandomGeneratorA(int count) {
+            super(count);
+        }
+
+        public RandomGeneratorA(String baseStr, int length) {
+            super(baseStr, length);
+        }
+
+        public String generate() {
+            return RandomUtil.randomString(this.baseStr, this.length);
+        }
+
+        public boolean verify(String code, String userInputCode) {
+            return StrUtil.isNotBlank(userInputCode) ? StrUtil.equalsIgnoreCase(code, userInputCode) : false;
+        }
+    }
+

+ 387 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/HttpConnectionUtil.java

@@ -0,0 +1,387 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import net.sf.json.JSONObject;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
+import org.apache.http.util.EntityUtils;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import java.io.*;
+import java.net.ConnectException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+
+public class HttpConnectionUtil {
+	private static int connectTimeoutMs = 10000;
+	private static int readTimeoutMs = 10000;
+	private static String charSet = "UTF-8";
+
+	public static String getHttpContent(String url) {
+        return getHttpContent(url, "UTF-8");
+    }
+
+    public static String getHttpContent(String url, String charSet) {
+        HttpURLConnection connection = null;
+        String content = "";
+        try {
+            URL address_url = new URL(url);
+            connection = (HttpURLConnection) address_url.openConnection();
+            connection.setRequestMethod("GET");
+            //设置访问超时时间及读取网页流的超市时间,毫秒值
+            System.setProperty("sun.net.client.defaultConnectTimeout","30000");
+            System.setProperty("sun.net.client.defaultReadTimeout", "30000");
+
+            //after JDK 1.5
+//            connection.setConnectTimeout(10000);
+//            connection.setReadTimeout(10000);
+            //得到访问页面的返回值
+            int response_code = connection.getResponseCode();
+            if (response_code == HttpURLConnection.HTTP_OK) {
+                InputStream in = connection.getInputStream();
+//                InputStreamReader reader = new InputStreamReader(in,charSet);
+                BufferedReader reader = new BufferedReader(new InputStreamReader(in, charSet));
+                String line = null;
+                while ((line = reader.readLine()) != null) {
+                    content+=line;
+                }
+                return content;
+            }
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if(connection !=null){
+                connection.disconnect();
+            }
+        }
+        return "";
+    }
+    
+    @SuppressWarnings("rawtypes")
+    public static String getHttpContentByPost(String url, String charSet,Map<String, Object> requestParamsMap) {
+        HttpURLConnection connection = null;
+        DataOutputStream out = null;
+        String content = "";
+        StringBuffer params = new StringBuffer();  
+        try {
+        	
+        	// 组织请求参数  
+            Iterator it = requestParamsMap.entrySet().iterator();  
+            while (it.hasNext()) {  
+				Map.Entry element = (Map.Entry) it.next();  
+                params.append(element.getKey());  
+                params.append("=");  
+                params.append(element.getValue());  
+                params.append("&");  
+            }  
+            if (params.length() > 0) {  
+                params.deleteCharAt(params.length() - 1);  
+            }  
+        	
+            System.out.println("url>>>>>>>>>>" + url);
+            System.out.println("params>>>>>>>>>>" + params);
+            
+            URL address_url = new URL(url);
+            connection = (HttpURLConnection) address_url.openConnection();
+            connection.setRequestMethod("POST");
+            //设置访问超时时间及读取网页流的超市时间,毫秒值
+            System.setProperty("sun.net.client.defaultConnectTimeout","30000");
+            System.setProperty("sun.net.client.defaultReadTimeout", "30000");
+
+         // 设置通用的请求属性  
+            connection.setRequestProperty("accept", "*/*");  
+            connection.setRequestProperty("connection", "Keep-Alive");  
+            connection.setRequestProperty("Content-Length", String.valueOf(params.length()));  
+            // 发送POST请求必须设置如下两行  
+            connection.setDoOutput(true);  
+            connection.setDoInput(true);  
+            // 获取URLConnection对象对应的输出流  
+            out = new DataOutputStream(connection.getOutputStream());
+            // 发送请求参数 
+            out.write(params.toString().getBytes("utf-8"));
+            out.flush();
+            out.close();
+            //得到访问页面的返回值
+            int response_code = connection.getResponseCode();
+            
+            System.out.println("response_code>>>>>" + response_code);
+            
+            if (response_code == HttpURLConnection.HTTP_OK) {
+                InputStream in = connection.getInputStream();
+//                InputStreamReader reader = new InputStreamReader(in,charSet);
+                BufferedReader reader = new BufferedReader(new InputStreamReader(in, charSet));
+                String line = null;
+                while ((line = reader.readLine()) != null) {
+                    content+=line;
+                }
+                
+                System.out.println("content>>>>>" + content);
+                return content;
+            }
+            
+            
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if(connection !=null){
+                connection.disconnect();
+            }
+        }
+        return "";
+    }
+    
+    public static String getHttpContentByPost(String url, String charSet,String params) {
+        HttpURLConnection connection = null;
+        String content = "";
+        PrintWriter printWriter = null;
+        try {
+
+            URL address_url = new URL(url);
+            connection = (HttpURLConnection) address_url.openConnection();
+            connection.setRequestMethod("POST");
+            //设置访问超时时间及读取网页流的超市时间,毫秒值
+            System.setProperty("sun.net.client.defaultConnectTimeout","30000");
+            System.setProperty("sun.net.client.defaultReadTimeout", "30000");
+
+         // 设置通用的请求属性  
+            connection.setRequestProperty("accept", "*/*");  
+            connection.setRequestProperty("connection", "Keep-Alive");  
+            connection.setRequestProperty("Content-Length", String.valueOf(params.length()));  
+            // 发送POST请求必须设置如下两行  
+            connection.setDoOutput(true);  
+            connection.setDoInput(true);  
+            // 获取URLConnection对象对应的输出流  
+            printWriter = new PrintWriter(connection.getOutputStream());  
+            // 发送请求参数  
+            printWriter.write(params);  
+            // flush输出流的缓冲  
+            printWriter.flush();  
+            //得到访问页面的返回值
+            int response_code = connection.getResponseCode();
+            if (response_code == HttpURLConnection.HTTP_OK) {
+                InputStream in = connection.getInputStream();
+//                InputStreamReader reader = new InputStreamReader(in,charSet);
+                BufferedReader reader = new BufferedReader(new InputStreamReader(in, charSet));
+                String line = null;
+                while ((line = reader.readLine()) != null) {
+                    content+=line;
+                }
+                return content;
+            }
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if(connection !=null){
+                connection.disconnect();
+            }
+        }
+        return "";
+    }
+
+	/**
+	 * 以http post方式请求
+	 * @param url 请求地址
+	 * @param data 请求参数
+	 * @return
+	 */
+	public static String requestByPost(String url,String data){
+		return requestByPost(url,charSet,data,connectTimeoutMs,readTimeoutMs);
+	}
+	
+	/**
+	 * 以http get方式请求
+	 * @param url 请求地址
+	 * @return
+	 */
+	public static String requestByGet(String url){
+		return requestByGet(url,charSet,connectTimeoutMs,readTimeoutMs);
+	}
+	
+	/**
+	 * 以http post方式请求
+	 * @param url 请求地址
+	 * @param charSet 字符编码
+	 * @param data 请求参数
+	 * @param connectTimeoutMs 连接超时(毫秒)
+	 * @param readTimeoutMs 数据读取超时(毫秒)
+	 * @return
+	 */
+    public static String requestByPost(String url,String charSet,String data, int connectTimeoutMs, int readTimeoutMs){
+    	try{
+	        BasicHttpClientConnectionManager connManager;
+
+	        connManager = new BasicHttpClientConnectionManager(
+	                RegistryBuilder.<ConnectionSocketFactory>create()
+	                        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+	                        .register("https", SSLConnectionSocketFactory.getSocketFactory())
+	                        .build(),
+	                null,
+	                null,
+	                null
+	        );
+
+	        HttpClient httpClient = HttpClientBuilder.create()
+					//取消HttpClient 设置超时后,若在设定的时间内没有返回数据,httpClient底层会重复请求
+					.setRetryHandler(new DefaultHttpRequestRetryHandler(0, false))
+	                .setConnectionManager(connManager)
+	                .build();
+
+	        HttpPost httpPost = new HttpPost(url);
+
+	        RequestConfig requestConfig = RequestConfig.custom()
+					.setSocketTimeout(readTimeoutMs)
+					.setConnectTimeout(connectTimeoutMs)
+					.build();
+
+	        httpPost.setConfig(requestConfig);
+
+	        StringEntity postEntity = new StringEntity(data, charSet);
+	        httpPost.addHeader("Content-Type", "text/xml");
+	        httpPost.setEntity(postEntity);
+
+	        HttpResponse httpResponse = httpClient.execute(httpPost);
+	        HttpEntity httpEntity = httpResponse.getEntity();
+	        return EntityUtils.toString(httpEntity, "UTF-8");
+    	}catch(Exception e){
+    		e.printStackTrace();
+    	}
+    	
+    	return "";
+
+    }
+    
+    /**
+	 * 以http get方式请求
+	 * @param url 请求地址
+	 * @param charSet 字符编码
+	 * @param connectTimeoutMs 连接超时(毫秒)
+	 * @param readTimeoutMs 数据读取超时(毫秒)
+	 * @return
+	 */
+    public static String requestByGet(String url,String charSet,int connectTimeoutMs, int readTimeoutMs){
+    	try{
+	        BasicHttpClientConnectionManager connManager;
+	        
+	        connManager = new BasicHttpClientConnectionManager(
+	                RegistryBuilder.<ConnectionSocketFactory>create()
+	                        .register("http", PlainConnectionSocketFactory.getSocketFactory())
+	                        .register("https", SSLConnectionSocketFactory.getSocketFactory())
+	                        .build(),
+	                null,
+	                null,
+	                null
+	        );
+	
+	        HttpClient httpClient = HttpClientBuilder.create()
+	                .setConnectionManager(connManager)
+	                .build();
+	        
+	        HttpGet httpGet = new HttpGet(url);
+	        
+	        RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(readTimeoutMs).setConnectTimeout(connectTimeoutMs).build();
+	        httpGet.setConfig(requestConfig);	
+	        httpGet.addHeader("Content-Type", "text/xml");
+	
+	        HttpResponse httpResponse = httpClient.execute(httpGet);
+	        HttpEntity httpEntity = httpResponse.getEntity();
+	        return EntityUtils.toString(httpEntity, "UTF-8");
+    	}catch(Exception e){
+    		e.printStackTrace();
+    	}
+    	
+    	return "";
+
+    }
+    
+    /**
+	 * 发起https请求并获取结果
+	 * 
+	 * @param requestUrl 请求地址
+	 * @param requestMethod 请求方式(GET、POST)
+	 * @param outputStr 提交的数据
+	 * @return JSONObject(通过JSONObject.get(key)的方式获取json对象的属性值)
+	 */
+	public static JSONObject httpRequest(String requestUrl, String requestMethod, String outputStr) {
+		JSONObject jsonObject = null;
+		StringBuffer buffer = new StringBuffer();
+		try {
+			URL url = new URL(requestUrl);
+			HttpURLConnection httpUrlConn = (HttpURLConnection)url.openConnection();
+
+			if (requestUrl.startsWith("https")) {
+				HttpsURLConnection httpsURLConnection = (HttpsURLConnection)httpUrlConn;
+
+				// 创建SSLContext对象,并使用我们指定的信任管理器初始化
+				TrustManager[] tm = { new MyX509TrustManager() };
+				SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+				sslContext.init(null, tm, new java.security.SecureRandom());
+				// 从上述SSLContext对象中得到SSLSocketFactory对象
+				SSLSocketFactory ssf = sslContext.getSocketFactory();
+
+				httpsURLConnection.setSSLSocketFactory(ssf);
+			}
+
+			httpUrlConn.setDoOutput(true);
+			httpUrlConn.setDoInput(true);
+			httpUrlConn.setUseCaches(false);
+			// 设置请求方式(GET/POST)
+			httpUrlConn.setRequestMethod(requestMethod);
+
+			if ("GET".equalsIgnoreCase(requestMethod))
+				httpUrlConn.connect();
+
+			// 当有数据需要提交时
+			if (null != outputStr) {
+				OutputStream outputStream = httpUrlConn.getOutputStream();
+				// 注意编码格式,防止中文乱码
+				outputStream.write(outputStr.getBytes("UTF-8"));
+				outputStream.close();
+			}
+
+			// 将返回的输入流转换成字符串
+			InputStream inputStream = httpUrlConn.getInputStream();
+			InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
+			BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
+
+			String str = null;
+			while ((str = bufferedReader.readLine()) != null) {
+				buffer.append(str);
+			}
+			bufferedReader.close();
+			inputStreamReader.close();
+			// 释放资源
+			inputStream.close();
+			inputStream = null;
+			httpUrlConn.disconnect();
+			jsonObject = JSONObject.fromObject(buffer.toString());
+		} catch (ConnectException ce) {
+			System.out.println("Weixin server connection timed out.");
+		} catch (Exception e) {
+			System.out.println("https request error:" +  e.getMessage());
+		}
+		return jsonObject;
+	}
+}

+ 130 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/HttpUtil.java

@@ -0,0 +1,130 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import lombok.extern.slf4j.Slf4j;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+public class HttpUtil {
+    public final static String getIpAddress(HttpServletRequest request){
+        // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址  
+
+        String ip = request.getHeader("X-Forwarded-For");
+        if (log.isInfoEnabled()) {
+            log.info("getIpAddress(HttpServletRequest) - X-Forwarded-For - String ip=" + ip);
+        }
+
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("Proxy-Client-IP");
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - Proxy-Client-IP - String ip=" + ip);
+                }
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("WL-Proxy-Client-IP");
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - WL-Proxy-Client-IP - String ip=" + ip);
+                }
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_CLIENT_IP");
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - HTTP_CLIENT_IP - String ip=" + ip);
+                }
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - HTTP_X_FORWARDED_FOR - String ip=" + ip);
+                }
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+                if (log.isInfoEnabled()) {
+                    log.info("getIpAddress(HttpServletRequest) - getRemoteAddr - String ip=" + ip);
+                }
+            }
+        } else if (ip.length() > 15) {
+            String[] ips = ip.split(",");
+            for (int index = 0; index < ips.length; index++) {
+                String strIp = (String) ips[index];
+                if (!("unknown".equalsIgnoreCase(strIp))) {
+                    ip = strIp;
+                    break;
+                }
+            }
+        }
+        return ip;
+    }
+
+
+    public static String post(String requestUrl, String accessToken, String params)
+            throws Exception {
+        String contentType = "application/x-www-form-urlencoded";
+        return HttpUtil.post(requestUrl, accessToken, contentType, params);
+    }
+
+    public static String post(String requestUrl, String accessToken, String contentType, String params)
+            throws Exception {
+        String encoding = "UTF-8";
+        if (requestUrl.contains("nlp")) {
+            encoding = "GBK";
+        }
+        return HttpUtil.post(requestUrl, accessToken, contentType, params, encoding);
+    }
+
+    public static String post(String requestUrl, String accessToken, String contentType, String params, String encoding)
+            throws Exception {
+        String url = requestUrl + "?access_token=" + accessToken;
+        return HttpUtil.postGeneralUrl(url, contentType, params, encoding);
+    }
+
+    public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding)
+            throws Exception {
+        URL url = new URL(generalUrl);
+        // 打开和URL之间的连接
+        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        connection.setRequestMethod("POST");
+        // 设置通用的请求属性
+        connection.setRequestProperty("Content-Type", contentType);
+        connection.setRequestProperty("Connection", "Keep-Alive");
+        connection.setUseCaches(false);
+        connection.setDoOutput(true);
+        connection.setDoInput(true);
+
+        // 得到请求的输出流对象
+        DataOutputStream out = new DataOutputStream(connection.getOutputStream());
+        out.write(params.getBytes(encoding));
+        out.flush();
+        out.close();
+
+        // 建立实际的连接
+        connection.connect();
+        // 获取所有响应头字段
+        Map<String, List<String>> headers = connection.getHeaderFields();
+        // 遍历所有的响应头字段
+        for (String key : headers.keySet()) {
+            System.err.println(key + "--->" + headers.get(key));
+        }
+        // 定义 BufferedReader输入流来读取URL的响应
+        BufferedReader in = null;
+        in = new BufferedReader(
+                new InputStreamReader(connection.getInputStream(), encoding));
+        String result = "";
+        String getLine;
+        while ((getLine = in.readLine()) != null) {
+            result += getLine;
+        }
+        in.close();
+        System.err.println("result:" + result);
+        return result;
+    }
+}

+ 24 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/MyX509TrustManager.java

@@ -0,0 +1,24 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+/**
+ * 证书信任管理器(用于https请求)
+ * 
+ * @author lt
+ * @date 2013-08-08
+ */
+public class MyX509TrustManager implements X509TrustManager {
+
+	public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+	}
+
+	public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+	}
+
+	public X509Certificate[] getAcceptedIssuers() {
+		return null;
+	}
+}

+ 501 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/OSSUtil.java

@@ -0,0 +1,501 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import cn.hutool.core.codec.Base64Encoder;
+import cn.hutool.core.date.DateTime;
+import com.aliyun.oss.HttpMethod;
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+import com.aliyun.oss.model.GeneratePresignedUrlRequest;
+import com.aliyun.oss.model.OSSObject;
+import com.aliyun.oss.model.PutObjectResult;
+import com.jpsoft.excellent.config.OSSConfig;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.util.*;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+@Slf4j
+public class OSSUtil {
+    public static String upload(OSSConfig ossConfig,
+                                String subFolder, String fileName,
+                                InputStream fileInputStream,String watermark) {
+        String retUrl = "";
+
+        try {
+            Image srcImage = ImageIO.read(fileInputStream);
+            int imageWidth = srcImage.getWidth(null);
+            int imageHeight = srcImage.getHeight(null);
+
+            int fontHeight = imageHeight / 20;
+
+            fontHeight = Math.min(30, fontHeight);
+
+            Color color = new Color(128, 128, 128, 200);   // 水印颜色
+            Font font = new Font("宋体", Font.ITALIC, fontHeight);  //水印字体
+
+            BufferedImage bufferedImage = new BufferedImage(
+                    srcImage.getWidth(null), srcImage.getHeight(null),
+                    BufferedImage.TYPE_INT_RGB);
+
+            Graphics2D g = bufferedImage.createGraphics();
+
+            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+            g.drawImage(srcImage.getScaledInstance(imageWidth, imageHeight, Image.SCALE_SMOOTH), 0,
+                    0, null);
+
+            g.setColor(color); //水印颜色
+            g.setFont(font); //水印字体
+
+            int markWidth = g.getFontMetrics(g.getFont()).charsWidth(watermark.toCharArray(), 0, watermark.length());
+
+            g.rotate(Math.toRadians(-45), imageWidth / 2, imageHeight / 2);
+
+            for (int i=0;i<imageHeight/3;i++) {
+                g.drawString(watermark, (imageWidth - markWidth) / 2, imageHeight*i/3); //水印位置
+            }
+
+            g.dispose(); //释放资源
+
+            ByteArrayOutputStream outImgStream = new ByteArrayOutputStream();
+            ImageIO.write(bufferedImage, "jpg", outImgStream);
+
+            byte[] outImg = outImgStream.toByteArray();
+
+            ByteArrayInputStream inputImgStream = new ByteArrayInputStream(outImg);
+
+            retUrl = upload(ossConfig,subFolder,fileName,inputImgStream);
+        }
+        catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+        }
+
+        return retUrl;
+    }
+
+    public static String upload(OSSConfig ossConfig,
+                                   String subFolder, String fileName,
+                                   InputStream fileInputStream) {
+        Date now = new Date();
+
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(now);
+
+        String savePath = ossConfig.getObjectPre();
+
+        if (!subFolder.startsWith("/")) {
+            savePath += "/";
+        }
+
+        savePath += subFolder;
+
+        savePath = savePath + "/" + cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH) + 1) + "/";
+
+        OSS ossClient = new OSSClientBuilder().build(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
+
+        int index = fileName.indexOf(".");
+
+//        String prefix = fileName.substring(0,index);
+
+        String ext = fileName.substring(index);
+
+        String newFileName = DateTime.now().toString("ddHHmmssSSS") + ext;
+
+        String retFileUrl = savePath + newFileName;
+
+        // 上传文件流
+        PutObjectResult result = ossClient.putObject(ossConfig.getBucketName(), retFileUrl, fileInputStream);
+
+        // 关闭OSSClient
+        ossClient.shutdown();
+
+        return ossConfig.getUrlPrefix() + "/" + retFileUrl;
+    }
+
+    public static boolean download(String fileUrl,String filePath){
+        boolean result;
+
+        try {
+            FileOutputStream output = new FileOutputStream(filePath);
+
+            URL url = new URL(encodeFileName(fileUrl));
+            URLConnection conn = url.openConnection();
+            InputStream input = conn.getInputStream();
+
+            byte[] buffs = new byte[1024 * 10];
+
+            BufferedInputStream bis = new BufferedInputStream(input, 1024 * 10);
+
+            int read;
+            while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
+                output.write(buffs, 0, read);
+            }
+
+            input.close();
+            output.close();
+
+            result = true;
+        } catch (Exception e) {
+            result = false;
+            log.error(e.getMessage(),e);
+        }
+
+        return result;
+    }
+    public static String  downloadToBase64(String fileUrl){
+            ByteArrayOutputStream data = new ByteArrayOutputStream();;
+        try {
+       //     FileOutputStream output = new FileOutputStream();
+       //     OutputStream outputStream =null;
+
+
+
+            URL url = new URL(encodeFileName(fileUrl));
+        //    URLConnection conn = url.openConnection();
+        //    InputStream input = conn.getInputStream();
+
+            byte[] buffs = new byte[1024 * 10];
+            //创建连接
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            conn.setRequestMethod("GET");
+            conn.setConnectTimeout(5000);
+            InputStream input = conn.getInputStream();
+            //将内容读到内存中
+            int len = -1;
+            while ((len =input.read(buffs))!=-1){
+                data.write(buffs,0,len);
+            }
+            input.close();
+
+
+
+        } catch (Exception e) {
+
+            log.error(e.getMessage(),e);
+        }
+
+
+        return Base64Encoder.encode(data.toByteArray());
+    }
+
+    public static boolean deleteFile(OSSConfig ossConfig,String filePath) {
+        OSS ossClient = new OSSClientBuilder().build(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
+
+        String key = "";
+
+        if (filePath.startsWith(ossConfig.getUrlPrefix())) {
+            key = filePath.substring(ossConfig.getUrlPrefix().length());
+        }
+
+        if (key.startsWith("/")) {
+            key = key.substring(1);
+        }
+
+        boolean exist = ossClient.doesObjectExist(ossConfig.getBucketName(), key);
+
+        if (!exist) {
+            log.error("文件不存在,key={}", key);
+            return false;
+        }
+
+        log.info("删除文件,key={}", key);
+        ossClient.deleteObject(ossConfig.getBucketName(), key);
+
+        ossClient.shutdown();
+
+        return true;
+    }
+
+    public static void batchDownload(List<Map<String,Object>> fileList, OutputStream output){
+        try{
+            ZipOutputStream zos = new ZipOutputStream(output);
+
+            for (Map<String,Object> map : fileList) {
+                String fileUrl = (String)map.get("fileUrl");
+                String filePath = (String)map.get("filePath");
+                String fileName = (String)map.get("fileName");
+
+                try {
+                    if (StringUtils.isEmpty(fileName)) {
+                        fileName = fileUrl;
+                    }
+
+                    if (fileName.indexOf("?") != -1) {
+                        fileName = fileName.substring(0, fileName.indexOf("?"));
+                    }
+
+                    fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
+
+                    String zipFile = fileName;
+
+                    if(StringUtils.isNotEmpty(filePath)){
+                        zipFile = filePath + fileName;
+                    }
+
+                    if(StringUtils.isNotEmpty(fileUrl)) {
+                        ZipEntry zipEntry = new ZipEntry(zipFile);
+                        zos.putNextEntry(zipEntry);
+
+                        URL url = new URL(encodeFileName(fileUrl));
+
+                        HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+                        // 设置连接主机超时(单位:毫秒)
+                        conn.setConnectTimeout(5000);
+                        // 设置从主机读取数据超时(单位:毫秒)
+                        conn.setReadTimeout(5000);
+
+                        if(conn.getResponseCode()==200) {
+                            InputStream inputStream = conn.getInputStream();
+
+                            byte[] buffs = new byte[1024 * 10];
+
+                            BufferedInputStream bis = new BufferedInputStream(inputStream, 1024 * 10);
+
+                            int read;
+                            while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
+                                zos.write(buffs, 0, read);
+                            }
+
+                            bis.close();
+                        }
+                    }
+                    else if(map.containsKey("localPath")){
+                        ZipEntry zipEntry = new ZipEntry(zipFile);
+                        zos.putNextEntry(zipEntry);
+
+                        String localPath = (String)map.get("localPath");
+                        byte[] buffs = new byte[1024 * 10];
+
+                        InputStream bis = new BufferedInputStream(new FileInputStream(localPath));
+
+                        int read;
+                        while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
+                            zos.write(buffs, 0, read);
+                        }
+
+                        bis.close();
+                    }
+                    else if(map.containsKey("fileData")){
+                        ZipEntry zipEntry = new ZipEntry(zipFile);
+                        zos.putNextEntry(zipEntry);
+
+                        byte[] data = (byte[])map.get("fileData");
+
+                        zos.write(data, 0, data.length);
+                    }
+                }
+                catch(Exception ex){
+                    log.error(ex.getMessage(),ex);
+                }
+            }
+
+            zos.close();
+        }
+        catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+        }
+    }
+
+    private static String encodeFileName(String fileUrl) throws Exception{
+        String[] segements = fileUrl.split("\\?");
+
+        String[] arr = segements[0].split("/");
+
+        //文件名可能是中文,用utf-8编码
+        arr[arr.length - 1] = URLEncoder.encode(arr[arr.length - 1],"UTF-8");
+
+        String encFileUrl = Arrays.stream(arr).collect(Collectors.joining("/"));
+
+        if (segements.length>1){
+            encFileUrl += "?" + segements[1];
+        }
+
+        return encFileUrl;
+    }
+
+    public static String generatePresignedUrl(OSSConfig ossConfig, String imageUrl,int expireSeconds,int maxSize){
+        OSS ossClient = new OSSClientBuilder().build(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
+        Date expiration = new Date(System.currentTimeMillis() + expireSeconds * 1000);
+
+        if (imageUrl.startsWith(ossConfig.getUrlPrefix())) {
+            imageUrl = imageUrl.substring(ossConfig.getUrlPrefix().length());
+        }
+
+        if (imageUrl.indexOf("?") != -1) {
+            imageUrl = imageUrl.substring(0, imageUrl.indexOf("?"));
+        }
+
+        if (imageUrl.startsWith("/")) {
+            imageUrl = imageUrl.substring(1);
+        }
+
+        GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(ossConfig.getBucketName(), imageUrl, HttpMethod.GET);
+
+        // 设置过期时间。
+        request.setExpiration(expiration);
+
+        //设置缩放
+        request.setProcess("image/resize,l_" + maxSize + ",limit_1");
+
+        // 生成签名URL(HTTP GET请求)。
+        URL signedUrl = ossClient.generatePresignedUrl(request);
+
+        return signedUrl.toString();
+    }
+
+    public static void presignedDownload(OSSConfig ossConfig, List<Map> fileList, OutputStream output){
+        BufferedInputStream bis = null;
+
+        try{
+            ZipOutputStream zos = new ZipOutputStream(output);
+
+            OSS ossClient = new OSSClientBuilder().build(ossConfig.getEndpoint(), ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
+
+            for (Map<String,String> map : fileList) {
+                try {
+                    String fileUrl = map.get("fileUrl");
+                    String filePath = map.get("filePath");
+
+                    Date expiration = new Date(System.currentTimeMillis() + 3600 * 1000);
+
+                    if (fileUrl.startsWith(ossConfig.getUrlPrefix())) {
+                        fileUrl = fileUrl.substring(ossConfig.getUrlPrefix().length());
+                    }
+
+                    if (fileUrl.indexOf("?") != -1) {
+                        fileUrl = fileUrl.substring(0, fileUrl.indexOf("?"));
+                    }
+
+                    if (fileUrl.startsWith("/")) {
+                        fileUrl = fileUrl.substring(1);
+                    }
+
+                    GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(ossConfig.getBucketName(), fileUrl, HttpMethod.GET);
+
+                    // 设置过期时间。
+                    request.setExpiration(expiration);
+
+                    //设置缩放
+                    request.setProcess("image/resize,l_1024,limit_1");
+
+                    // 生成签名URL(HTTP GET请求)。
+                    URL signedUrl = ossClient.generatePresignedUrl(request);
+
+                    // 使用签名URL发送请求。
+                    OSSObject ossObject = ossClient.getObject(signedUrl, new HashMap<>());
+
+                    if (ossObject != null) {
+                        InputStream inputStream = ossObject.getObjectContent();
+                        byte[] buffs = new byte[1024 * 10];
+                        String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
+                        String zipFile = fileName;
+
+                        if (StringUtils.isNotEmpty(filePath)){
+                            zipFile = filePath + fileName;
+                        }
+
+                        ZipEntry zipEntry = new ZipEntry(zipFile);
+                        zos.putNextEntry(zipEntry);
+                        bis = new BufferedInputStream(inputStream, 1024 * 10);
+
+                        int read;
+                        while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
+                            zos.write(buffs, 0, read);
+                        }
+
+                        ossObject.close();
+                    }
+                }
+                catch(Exception ex){
+                    log.error(ex.getMessage(),ex);
+                }
+            }
+
+            zos.close();
+            ossClient.shutdown();
+        }
+        catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+        }
+        finally {
+            if(bis!=null){
+                try {
+                    bis.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+
+
+    public static String uploadOfferImg(OSSConfig ossConfig,
+                                String subFolder, String fileName,
+                                String outImgUrl,String offerCode,String personName,
+                                        String userName,String schoolName) {
+        String retUrl = "";
+
+        try {
+            File _file = new File(outImgUrl);
+            Image srcImage = ImageIO.read(_file);
+            int imageWidth = srcImage.getWidth(null);
+            int imageHeight = srcImage.getHeight(null);
+
+            int fontHeight = imageHeight / 20;
+
+            fontHeight = Math.min(30, fontHeight);
+
+            Color color = new Color(128, 128, 128, 200);   // 水印颜色
+            Font font = new Font("宋体", Font.ITALIC, fontHeight);  //水印字体
+
+            BufferedImage bufferedImage = new BufferedImage(
+                    srcImage.getWidth(null), srcImage.getHeight(null),
+                    BufferedImage.TYPE_INT_RGB);
+
+            Graphics2D g = bufferedImage.createGraphics();
+
+            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+            g.drawImage(srcImage.getScaledInstance(imageWidth, imageHeight, Image.SCALE_SMOOTH), 0,
+                    0, null);
+
+            g.setColor(color); //水印颜色
+            g.setFont(font); //水印字体
+
+            int markWidth = g.getFontMetrics(g.getFont()).charsWidth(offerCode.toCharArray(), 0, offerCode.length());
+
+            g.rotate(Math.toRadians(-45), imageWidth / 2, imageHeight / 2);
+
+            for (int i=0;i<imageHeight/3;i++) {
+                g.drawString(offerCode, (imageWidth - markWidth) / 2, imageHeight*i/3); //水印位置
+            }
+
+            g.dispose(); //释放资源
+
+            ByteArrayOutputStream outImgStream = new ByteArrayOutputStream();
+            ImageIO.write(bufferedImage, "jpg", outImgStream);
+
+            byte[] outImg = outImgStream.toByteArray();
+
+            ByteArrayInputStream inputImgStream = new ByteArrayInputStream(outImg);
+
+            retUrl = upload(ossConfig,subFolder,fileName,inputImgStream);
+        }
+        catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+        }
+
+        return retUrl;
+    }
+}

+ 428 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/POIUtils.java

@@ -0,0 +1,428 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.converter.ExcelToHtmlConverter;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.w3c.dom.Document;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.*;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Description:POI解析Excel获取所有数据(支持xls/xlsx)
+ *
+ * @author zhjun 2015-11-5
+ */
+public class POIUtils {
+    InputStream ins = null;
+    Workbook wb = null;
+    List<Object[]> dataList = new ArrayList<Object[]>(100);
+
+    public static void CreateBorder(CellStyle cellStyle) {
+        if (cellStyle != null) {
+            cellStyle.setBorderTop(BorderStyle.THIN);
+            cellStyle.setBorderBottom(BorderStyle.THIN);
+            cellStyle.setBorderLeft(BorderStyle.THIN);
+            cellStyle.setBorderRight(BorderStyle.THIN);
+        }
+    }
+
+    public static Cell setCellValue(Row row, int i, String value) {
+        // TODO Auto-generated method stub
+        Cell cell = row.createCell(i);
+        cell.setCellValue(value);
+
+        return cell;
+    }
+
+    public static Cell setCellValue(Row row, int i, int value) {
+        // TODO Auto-generated method stub
+        Cell cell = row.createCell(i);
+        cell.setCellValue(value);
+
+        return cell;
+    }
+
+    public static Cell setCellValue(Row row, int cellIndex, CellStyle cellStyle, Object value) {
+        Cell cell = row.createCell(cellIndex);
+        cell.setCellStyle(cellStyle);
+
+        if (value != null) {
+            if (value instanceof BigDecimal) {
+                cell.setCellValue(((BigDecimal) value).doubleValue());
+            } else if (value instanceof String) {
+                cell.setCellValue(value.toString());
+            } else if (value instanceof Integer) {
+                cell.setCellValue(Double.valueOf(value.toString()));
+            } else if (value instanceof Long) {
+                cell.setCellValue(Double.valueOf(value.toString()));
+            }
+        }
+
+        return cell;
+    }
+
+    public static String xls2html(HSSFWorkbook wb) {
+        String result = "";
+
+        try {
+            ExcelToHtmlConverter converter = new ExcelToHtmlConverter(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument());
+            converter.setOutputColumnHeaders(false);
+            converter.setOutputRowNumbers(false);
+
+            converter.processWorkbook(wb);
+
+            Document htmlDocument = converter.getDocument();
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            DOMSource domSource = new DOMSource(htmlDocument);
+            StreamResult streamResult = new StreamResult(out);
+            TransformerFactory tf = TransformerFactory.newInstance();
+            Transformer serializer = tf.newTransformer();
+            serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+            serializer.setOutputProperty(OutputKeys.INDENT, "yes");
+            serializer.setOutputProperty(OutputKeys.METHOD, "html");
+            serializer.transform(domSource, streamResult);
+            out.close();
+
+            result = new String(out.toByteArray(), "UTF-8");
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过流读取
+     *
+     * @param ins
+     */
+    public POIUtils(InputStream ins) {
+        try {
+            wb = WorkbookFactory.create(ins);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (ins != null) {
+                try {
+                    ins.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    public POIUtils() {
+        wb = new HSSFWorkbook();
+    }
+
+    public Sheet getSheetAt(int sheetIndex){
+        return wb.getSheetAt(sheetIndex);
+    }
+
+    public Workbook getWorkbook(){
+        return wb;
+    }
+
+    /**
+     * 通过文件读取
+     *
+     * @param file
+     */
+    public POIUtils(File file) {
+        try {
+            ins = new FileInputStream(file);
+            wb = WorkbookFactory.create(ins);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (ins != null) {
+                try {
+                    ins.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * 通过文件路径读取
+     *
+     * @param path
+     */
+    public POIUtils(String path) {
+        try {
+            ins = new FileInputStream(path);
+            wb = WorkbookFactory.create(ins);
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (ins != null) {
+                try {
+                    ins.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * 取Excel所有数据,包含header
+     *
+     * @return List<Object   [   ]>
+     */
+    public List<Object[]> getAllData(int sheetIndex) {
+        int columnNum = 0;
+        Sheet sheet = wb.getSheetAt(sheetIndex);
+        if (sheet.getRow(0) != null) {
+            columnNum = sheet.getRow(0).getLastCellNum() - sheet.getRow(0).getFirstCellNum();
+        }
+        if (columnNum > 0) {
+            for (Row row : sheet) {
+                Object[] singleRow = new Object[columnNum];
+                int n = 0;
+
+                for (int i = 0; i < columnNum; i++) {
+                    Cell cell = row.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+                    singleRow[n] = getCellValue(cell);
+                    n++;
+                }
+
+                //在后续方法中校验
+//				if("".equals(singleRow[0])){continue;}//如果第一列为空,跳过
+
+                dataList.add(singleRow);
+            }
+        }
+        return dataList;
+    }
+
+    public List<Object[]> getAllData(int sheetIndex, int firstRowNum) {
+        int columnNum = 0;
+        Sheet sheet = wb.getSheetAt(sheetIndex);
+        if (sheet.getRow(0) != null) {
+            columnNum = sheet.getRow(firstRowNum).getLastCellNum();
+        }
+        if (columnNum > 0) {
+            for (Row row : sheet) {
+                Object[] singleRow = new Object[columnNum];
+                int n = 0;
+                for (int i = 0; i < columnNum; i++) {
+                    Cell cell = row.getCell(i, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+                    singleRow[n] = getCellValue(cell);
+                    n++;
+                }
+                if ("".equals(singleRow[0])) {
+                    continue;
+                }//如果第一行为空,跳过
+                dataList.add(singleRow);
+            }
+        }
+        return dataList;
+    }
+
+    public Object getCellValue(int sheetIndex,int rowIndex,int colIndex){
+        Row row = wb.getSheetAt(sheetIndex).getRow(rowIndex);
+        Cell cell = row.getCell(colIndex, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+
+        return getCellValue(cell);
+    }
+
+    /**
+     * 获取列的数据信息
+     *
+     * @param cell
+     * @return
+     */
+    private Object getCellValue(Cell cell) {
+        Object cellValue = null;
+        FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
+
+        switch (cell.getCellType()) {
+            case BLANK:
+                cellValue = "";
+                break;
+            case BOOLEAN:
+                cellValue = Boolean.toString(cell.getBooleanCellValue());
+                break;
+            //数值
+            case NUMERIC:
+                DecimalFormat df = new DecimalFormat("0");
+                double value = cell.getNumericCellValue();
+
+                if (value > Math.floor(value)) {
+                    df = new DecimalFormat("0.00");
+                }
+
+                cellValue = df.format(value);
+                break;
+            case STRING:
+                cellValue = cell.getStringCellValue().trim();
+                break;
+            case ERROR:
+                cellValue = "";
+                break;
+            case FORMULA:
+                CellValue cv = evaluator.evaluate(cell);
+
+                if (cv.getCellType() == CellType.STRING) {
+                    cellValue = cv.getStringValue();
+                } else if (cv.getCellType() == CellType.NUMERIC) {
+                    cellValue = cv.getNumberValue();
+                } else {
+                    cellValue = cell.getCellFormula();
+                }
+
+                break;
+            default:
+                cellValue = "";
+        }
+
+        return cellValue;
+    }
+
+
+    /**
+     * 返回Excel最大行index值,实际行数要加1
+     *
+     * @return
+     */
+    public int getRowNum(int sheetIndex) {
+        Sheet sheet = wb.getSheetAt(sheetIndex);
+        return sheet.getLastRowNum();
+    }
+
+    /**
+     * 返回数据的列数
+     *
+     * @param sheetIndex
+     * @return
+     */
+    public int getColumnNum(int sheetIndex) {
+        Sheet sheet = wb.getSheetAt(sheetIndex);
+        Row row = sheet.getRow(0);
+        if (row != null && row.getLastCellNum() > 0) {
+            return row.getLastCellNum();
+        }
+        return 0;
+    }
+
+    /**
+     * 获取某一行数据
+     *
+     * @param rowIndex 计数从0开始,rowIndex为0代表header行
+     * @return
+     */
+    public Object[] getRowData(int sheetIndex, int rowIndex) {
+        Object[] dataArray = null;
+        if (rowIndex > this.getColumnNum(sheetIndex)) {
+            return dataArray;
+        } else {
+//			dataArray = new Object[this.getColumnNum(sheetIndex)];
+            return this.dataList.get(rowIndex);
+        }
+    }
+
+
+    /**
+     * 获取某一列数据
+     *
+     * @param colIndex
+     * @return
+     */
+    public Object[] getColumnData(int sheetIndex, int colIndex) {
+        Object[] dataArray = null;
+        if (colIndex > this.getColumnNum(sheetIndex)) {
+            return dataArray;
+        } else {
+            if (this.dataList != null && this.dataList.size() > 0) {
+                dataArray = new Object[this.getRowNum(sheetIndex) + 1];
+                int index = 0;
+                for (Object[] rowData : dataList) {
+                    if (rowData != null) {
+                        dataArray[index] = rowData[colIndex];
+                        index++;
+                    }
+                }
+            }
+        }
+
+        return dataArray;
+    }
+
+    public static void main(String[] args) {
+        POIUtils re = new POIUtils("D:\\fpb.xlsx");
+
+        List<Object[]> objList = re.getAllData(0);
+
+        for (int i = 0; i < objList.size(); i++) {
+            String result = "";
+            for (int j = 0; j < objList.get(i).length; j++) {
+                result += objList.get(i)[j] + "_";
+            }
+
+            System.out.println(result);
+        }
+    }
+
+    public Workbook exportErrorXls(int sheetIndex,int validateColIndex, int rowNum) {
+        Workbook destBook = new HSSFWorkbook();
+        Sheet destSheet = destBook.createSheet();
+
+        //复制列头
+        Sheet srcSheet = wb.getSheetAt(sheetIndex);
+        Row srcHeaderRow = wb.getSheetAt(sheetIndex).getRow(0);
+        Row destHeaderRow = destSheet.createRow(0);
+
+        for (int i=0;i<srcHeaderRow.getLastCellNum();i++){
+            if (srcHeaderRow.getCell(i)!=null) {
+                destHeaderRow.createCell(i).setCellValue(srcHeaderRow.getCell(i).getStringCellValue());
+            }
+            else{
+                break;
+            }
+        }
+
+        int srcRowIndex = 1;
+        int destRowIndex = 1;
+
+        while(srcRowIndex<= rowNum){
+            Row dataRow1 = srcSheet.getRow(srcRowIndex);
+
+            if(dataRow1!=null) {
+                Cell cell = dataRow1.getCell(validateColIndex);
+
+                if (cell != null && StringUtils.isNotEmpty(cell.getStringCellValue())) {
+                    Row dataRow2 = destSheet.createRow(destRowIndex);
+
+                    int lastCellNum = Math.min(dataRow1.getLastCellNum(),100);
+
+                    for (int i = 0; i < lastCellNum; i++) {
+                        if (dataRow1.getCell(i) != null) {
+                            dataRow2.createCell(i).setCellValue((String) getCellValue(0, srcRowIndex, i));
+                        }
+                    }
+
+                    destRowIndex++;
+                }
+            }
+
+            srcRowIndex++;
+        }
+
+        return destBook;
+    }
+}

+ 84 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/PojoUtils.java

@@ -0,0 +1,84 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import com.github.dozermapper.core.DozerBeanMapperBuilder;
+import com.github.dozermapper.core.Mapper;
+import com.github.pagehelper.Page;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.util.HashMap;
+import java.util.Map;
+
+public class PojoUtils {
+    private static Logger logger = LoggerFactory.getLogger("root");
+    private static Mapper MAPPER = DozerBeanMapperBuilder.buildDefault();
+
+    public static <T> T map(Object source, Class<T> destinationClass) {
+        if (source == null) {
+            return null;
+        }
+        return MAPPER.map(source, destinationClass);
+    }
+
+    public static void map(Object source, Object destination) {
+        MAPPER.map(source, destination);
+    }
+
+    public static <T> Map<String, Object> pojo2map(T t) {
+        // TODO Auto-generated method stub
+        Map<String,Object> map = new HashMap<String,Object>();
+
+        try{
+            BeanInfo beanInfo  = Introspector.getBeanInfo(t.getClass());
+            PropertyDescriptor[] props = beanInfo.getPropertyDescriptors();
+
+            for (PropertyDescriptor pd : props) {
+                if (pd.getReadMethod()!=null) {
+                    try {
+                        Object srcValue = pd.getReadMethod().invoke(t);
+                        map.put(pd.getName(), srcValue);
+                    }
+                    catch (Exception ex){
+                        logger.error(ex.getMessage(),ex);
+                    }
+                }
+            }
+        }
+        catch(Exception ex){
+            ex.printStackTrace();
+        }
+
+        return map;
+    }
+
+    public static Map pageWrapper(Page page){
+        Map<String,Object> pageMap = new HashMap<>();
+
+        pageMap.put("recordsTotal",page.getTotal());
+        pageMap.put("recordsFiltered",page.getTotal());
+        pageMap.put("totalPage",page.getPages());
+        pageMap.put("pageNumber",page.getPageNum());
+        pageMap.put("pageSize",page.getPageSize());
+        pageMap.put("data", page.getResult());
+
+        return pageMap;
+    }
+
+    public static <T> Page<T> convertPage(Page page, Class<T> destinationClass){
+        Page newPage = new Page();
+
+        newPage.setPageNum(page.getPageNum());
+        newPage.setPageSize(page.getPageSize());
+        newPage.setPages(page.getPages());
+        newPage.setTotal(page.getTotal());
+
+        for (Object obj: page) {
+            newPage.add(map(obj,destinationClass));
+        }
+
+        return newPage;
+    }
+}

+ 115 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/SMSUtil.java

@@ -0,0 +1,115 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import com.jpsoft.excellent.modules.common.dto.MessageResult;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+
+import java.util.*;
+
+
+public class SMSUtil {
+	private final static String SpCode = "216290";
+	private final static String LoginName = "jz_zg";
+	private final static String Password = "zzbs+8468418";
+
+	//发送短信
+	public static MessageResult sendSMS(String MessageContent, String UserNumber, String templateId, String SerialNumber, String ScheduleTime){
+		MessageResult retMessage = new MessageResult();
+
+		try{
+			HttpClient httpclient = new HttpClient();//方法调用
+			PostMethod post = new PostMethod("https://api.ums86.com:9600/sms/Api/Send.do");//接口地址
+			post.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"gbk");//格式转换
+			post.addParameter("SpCode", SpCode);//企业编号
+			post.addParameter("LoginName", LoginName);//用户名
+			post.addParameter("Password", Password);//接口密钥
+			post.addParameter("MessageContent", MessageContent);//短信内容
+			post.addParameter("UserNumber", UserNumber);//要发送短信的手机号,可多个手机号,用逗号隔开。
+			post.addParameter("templateId", templateId);//模板编号
+			post.addParameter("SerialNumber", SerialNumber);//流水号
+			post.addParameter("ScheduleTime", ScheduleTime);//预约发送时间,格式:yyyyMMddHHmmss
+			post.addParameter("f", "1");
+			httpclient.executeMethod(post);
+
+			//result=0&description=发送短信成功&taskid=2431729077612&faillist=&task_id=2431729077612
+			String res = new String(post.getResponseBody(),"gbk");
+
+			//取返回数据
+			Map map = new HashMap();
+			String[] rows = res.split("&");
+			for(String row : rows){
+				String[] cells = row.split("=");
+				if(cells.length < 2) {
+					map.put(cells[0], null);
+				}
+				else {
+					map.put(cells[0], cells[1]);
+				}
+			}
+
+			retMessage.setResult(true);
+			retMessage.setCode(200);
+			retMessage.setMessage("接口调用成功。");
+			retMessage.setData(map);
+		}
+		catch (Exception e){
+			e.printStackTrace();
+
+			retMessage.setResult(false);
+			retMessage.setCode(400);
+			retMessage.setMessage(e.getMessage());
+		}
+
+		return retMessage;
+	}
+
+	//查询回执
+	public static MessageResult queryReceipt(){
+		MessageResult retMessage = new MessageResult();
+
+		try{
+			HttpClient httpclient = new HttpClient();//方法调用
+			PostMethod post = new PostMethod("https://api.ums86.com:9600/sms/Api/report.do");//接口地址
+			post.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"gbk");//格式转换
+			post.addParameter("SpCode", SpCode);//企业编号
+			post.addParameter("LoginName", LoginName);//用户名
+			post.addParameter("Password", Password);//接口密钥
+			httpclient.executeMethod(post);
+
+			//result=0&out=20210609000000000001,19972671252,0;20210609000000000001,19972671252,0;20210609000000000002,18107167836,0;20210609000000000002,19972671252,0;
+			String res = new String(post.getResponseBody(),"gbk");
+
+			//取返回数据
+			res = res.substring(res.indexOf("out=")+4);
+			List<Map> mapList = new ArrayList<>();
+			if(StringUtils.isNotBlank(res)){
+				String[] rows = res.split(";");
+				for(int i=0; i<rows.length-1; i++){
+					String[] cells = rows[i].split(",");
+
+					Map map = new HashMap();
+					map.put("SerialNumber", cells[0]);
+					map.put("UserNumber", cells[1]);
+					map.put("Value", cells[2]);
+					mapList.add(map);
+				}
+			}
+
+			retMessage.setResult(true);
+			retMessage.setCode(200);
+			retMessage.setMessage("回执接收成功。");
+			retMessage.setData(mapList);
+		}
+		catch (Exception e){
+			e.printStackTrace();
+
+			retMessage.setResult(false);
+			retMessage.setCode(400);
+			retMessage.setMessage(e.getMessage());
+		}
+
+
+		return retMessage;
+	}
+}

+ 70 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/Sign.java

@@ -0,0 +1,70 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Formatter;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+public class Sign {
+
+    public static Map<String, String> sign(String jsapi_ticket, String url) {
+        Map<String, String> ret = new HashMap<String, String>();
+        String nonce_str = create_nonce_str();
+        String timestamp = create_timestamp();
+        String string1;
+        String signature = "";
+
+        //注意这里参数名必须全部小写,且必须有序
+        string1 = "jsapi_ticket=" + jsapi_ticket +
+                  "&noncestr=" + nonce_str +
+                  "&timestamp=" + timestamp +
+                  "&url=" + url;
+        System.out.println(string1);
+
+        try
+        {
+            MessageDigest crypt = MessageDigest.getInstance("SHA-1");
+            crypt.reset();
+            crypt.update(string1.getBytes("UTF-8"));
+            signature = byteToHex(crypt.digest());
+        }
+        catch (NoSuchAlgorithmException e)
+        {
+            e.printStackTrace();
+        }
+        catch (UnsupportedEncodingException e)
+        {
+            e.printStackTrace();
+        }
+
+        ret.put("url", url);
+        ret.put("jsapi_ticket", jsapi_ticket);
+        ret.put("nonceStr", nonce_str);
+        ret.put("timestamp", timestamp);
+        ret.put("signature", signature);
+
+        return ret;
+    }
+
+    private static String byteToHex(final byte[] hash) {
+        Formatter formatter = new Formatter();
+        for (byte b : hash)
+        {
+            formatter.format("%02x", b);
+        }
+        String result = formatter.toString();
+        formatter.close();
+        return result;
+    }
+
+    private static String create_nonce_str() {
+        return UUID.randomUUID().toString();
+    }
+
+    private static String create_timestamp() {
+        return Long.toString(System.currentTimeMillis() / 1000);
+    }
+}

+ 161 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/StringUtils.java

@@ -0,0 +1,161 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * 字符串工具类,继承lang3字符串工具类
+ * @author L.com
+ */
+public final class StringUtils extends org.apache.commons.lang3.StringUtils {
+
+	public static String encode(String str){
+		String encode=null;
+		try {
+			encode = URLEncoder.encode(str, "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		return encode;
+	}
+
+	/**
+	 * 获取UUID,去掉`-`的
+	 * @return {String}
+	 *
+	 */
+	public static String generateStr () {
+		return UUID.randomUUID().toString().replace("-", "");
+	}
+
+
+	/**
+	 * 要求外部订单号必须唯一。
+	 * @return {String}
+	 */
+	public synchronized static String getOutTradeNo() {
+		SimpleDateFormat format = new SimpleDateFormat("MMddHHmmss", Locale.getDefault());
+		Date date = new Date();
+		String key = format.format(date);
+		Integer ran = (int)((Math.random()*9+1)*100000);
+		key = key +ran.toString();
+	//	key = key.substring(0, 24);
+		return key;
+	}
+
+
+	/**
+	 * 审批编号生成。
+	 * @return {String}
+	 */
+	public synchronized static String getApprovalNo() {
+		SimpleDateFormat format = new SimpleDateFormat("MMddHHmmss", Locale.getDefault());
+		Date date = new Date();
+		String key = format.format(date);
+		Integer ran = (int)((Math.random()*9+1)*100000);
+		key = ran.toString() + key;
+		//	key = key.substring(0, 24);
+		return key;
+	}
+
+	/**
+	 * 字符串格式化
+	 *
+	 * use: format("my name is {0}, and i like {1}!", "L.cm", "java")
+	 *
+	 * int long use {0,number,#}
+	 *
+	 * @param s
+	 * @param args
+	 * @return {String}转换后的字符串
+	 */
+	public static String format(String s, Object... args) {
+		return MessageFormat.format(s, args);
+	}
+
+	/**
+	 * 替换某个字符
+	 * @param str
+	 * @param regex
+	 * @param args
+	 * @return {String}
+	 */
+	public static String replace(String str,String regex,String... args){
+		int length = args.length;
+		for (int i = 0; i < length; i++) {
+			str=str.replaceFirst(regex, args[i]);
+		}
+		return str;
+	}
+
+	/**
+	 * 清理字符串,清理出某些不可见字符
+	 * @param txt
+	 * @return {String}
+	 */
+	public static String cleanChars(String txt) {
+		return txt.replaceAll("[  	`·•�\\f\\t\\v]", "");
+	}
+
+	/**
+	 *  随机字符串
+	 */
+	private static final String INT_TEMP = "0123456789";
+	private static final String STR_TEMP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+	private static final String ALL_TEMP = INT_TEMP + STR_TEMP;
+
+	private static final Random RANDOM = new Random();
+
+	/**
+	 * 生成的随机数类型
+	 */
+	public enum RandomType {
+		/**
+		 * 整数
+		 */
+		INT,
+		/**
+		 * 字符串
+		 */
+		STRING,
+		/**
+		 * 所有类型
+		 */
+		ALL
+	}
+
+	/**
+	 * 随机数生成
+	 * @param count
+	 * @return {String}
+	 */
+	public static String random(int count, RandomType randomType) {
+		if (count == 0) {
+			return "";
+		}
+		if (count < 0) {
+			throw new IllegalArgumentException("Requested random string length " + count + " is less than 0.");
+		}
+		char[] buffer = new char[count];
+		for (int i = 0; i < count; i++) {
+			if (randomType.equals(RandomType.INT)) {
+				buffer[i] = INT_TEMP.charAt(RANDOM.nextInt(INT_TEMP.length()));
+			} else if (randomType.equals(RandomType.STRING)) {
+				buffer[i] = STR_TEMP.charAt(RANDOM.nextInt(STR_TEMP.length()));
+			}else {
+				buffer[i] = ALL_TEMP.charAt(RANDOM.nextInt(ALL_TEMP.length()));
+			}
+		}
+		return new String(buffer);
+	}
+
+	public static void main(String[] args) {
+		System.out.println(random(32, RandomType.INT));
+	}
+}

+ 93 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/TimeZonesUtil.java

@@ -0,0 +1,93 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-4-1 13:14
+ */
+public class TimeZonesUtil {
+    public static String getUpperTimeZone(String timeZones){
+        String timeZoneStr = timeZones.substring(0,timeZones.lastIndexOf("-")+1);
+        String minStr = timeZones.substring(timeZones.lastIndexOf("-")+1,timeZones.length());
+        String s = minStr.replace("",".");
+        Double minDou = Double.valueOf(s.substring(1,s.length()-1));
+        Double timeZoneMinDou = minDou;
+        String resultTimeZoneMinStr = "";
+        /*String timZoneMinStr = String.valueOf(timeZoneMinDou*10);
+        String resultTimeZoneMinStr = timZoneMinStr.substring(0,timZoneMinStr.indexOf("."));
+        if ("0".equals(resultTimeZoneMinStr)){
+            resultTimeZoneMinStr = resultTimeZoneMinStr+"0";
+        }*/
+        if (timeZoneMinDou.compareTo(0.5) ==-1){
+            resultTimeZoneMinStr ="00";
+        }
+        if (timeZoneMinDou.compareTo(0.5) !=-1 && timeZoneMinDou.compareTo(1.0) ==-1){
+            resultTimeZoneMinStr = "05";
+        }
+        if (timeZoneMinDou.compareTo(1.0) !=-1 && timeZoneMinDou.compareTo(1.5) ==-1){
+            resultTimeZoneMinStr = "10";
+        }
+        if (timeZoneMinDou.compareTo(1.5) !=-1 && timeZoneMinDou.compareTo(2.0) ==-1){
+            resultTimeZoneMinStr = "15";
+        }
+        if (timeZoneMinDou.compareTo(2.0) !=-1 && timeZoneMinDou.compareTo(2.5) ==-1){
+            resultTimeZoneMinStr = "20";
+        }
+        if (timeZoneMinDou.compareTo(2.5) !=-1 && timeZoneMinDou.compareTo(3.0) ==-1){
+            resultTimeZoneMinStr = "25";
+        }
+        if (timeZoneMinDou.compareTo(3.0) !=-1 && timeZoneMinDou.compareTo(3.5) ==-1){
+            resultTimeZoneMinStr = "30";
+        }
+        if (timeZoneMinDou.compareTo(3.5) !=-1 && timeZoneMinDou.compareTo(4.0) ==-1){
+            resultTimeZoneMinStr = "35";
+        }
+        if (timeZoneMinDou.compareTo(4.0) !=-1 && timeZoneMinDou.compareTo(4.5) ==-1){
+            resultTimeZoneMinStr = "40";
+        }
+        if (timeZoneMinDou.compareTo(4.5) !=-1 && timeZoneMinDou.compareTo(5.0) ==-1){
+            resultTimeZoneMinStr = "45";
+        }
+        if (timeZoneMinDou.compareTo(5.0) !=-1 && timeZoneMinDou.compareTo(5.5) ==-1){
+            resultTimeZoneMinStr = "50";
+        }
+        if (timeZoneMinDou.compareTo(5.5) !=-1 && timeZoneMinDou.compareTo(6.0) ==-1){
+            resultTimeZoneMinStr = "55";
+        }
+
+        String resultTimeZone = timeZoneStr + resultTimeZoneMinStr;
+
+        return resultTimeZone;
+    }
+
+    public static String parseSecond(Long second){
+        int h= Math.toIntExact(second / 3600);
+        int m= Math.toIntExact((second % 3600) / 60);
+        int s= Math.toIntExact((second % 3600) % 60);
+
+
+        return h+"时"+m+"分"+s+"秒";
+    }
+
+    public static String friendlyTimeFormat(long time){
+        long sec = 1000;
+        long min = 60*sec;
+
+        StringBuilder sb = new StringBuilder();
+
+        if (time>min) {
+            sb.append(String.format("%d分",time/min));
+        }
+
+        long remainder = time % min;
+
+        if (remainder>sec){
+            sb.append(String.format("%d秒",remainder/sec));
+        }
+
+        remainder = remainder % sec;
+
+        sb.append(String.format("%d毫秒",remainder));
+
+        return sb.toString();
+    }
+}

+ 218 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/WechatMessageUtil.java

@@ -0,0 +1,218 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import com.jpsoft.excellent.modules.wechat.entity.AccessToken;
+import lombok.extern.slf4j.Slf4j;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+@Slf4j
+public class WechatMessageUtil {
+    public static final String send_template = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN";
+
+    /**
+     * 微信发送模版
+     *
+     * @param sendData   发送数据
+     * @param templateId 模版Id
+     * @param openId     发送人
+     * @param url        详情跳转地址
+     * @return
+     */
+    public static boolean sendTemplate(JSONObject sendData,String tokenUrl, String appId, String appSecret, String templateId, String openId, String url) {
+        boolean result = false;
+
+        AccessToken accessToken = WeixinUtil.getCommonAccessToken(tokenUrl, appId, appSecret);
+
+        if (accessToken != null) {
+            //发送模版内容
+            String sendTemplateUrl = send_template.replace("ACCESS_TOKEN", accessToken.getToken());
+
+            JSONObject sendTemplateData = new JSONObject();
+
+            sendTemplateData.put("touser", openId);
+            sendTemplateData.put("template_id", templateId);
+            sendTemplateData.put("url", url);
+            sendTemplateData.put("data", sendData);
+
+            log.warn("模版发送Id>>>>" + templateId + ">>>模版发送数据>>>>>" + sendTemplateData.toString());
+
+            String sendTemplateRet = HttpConnectionUtil.requestByPost(sendTemplateUrl, sendTemplateData.toString());
+
+            log.warn("模版发送返回数据>>>>>" + sendTemplateRet);
+
+            if (StringUtils.isNotBlank(sendTemplateRet)) {
+                JSONObject sendTemplateJson = JSONObject.fromObject(sendTemplateRet);
+
+                if ("0".equals(sendTemplateJson.getString("errcode"))) {
+                    //发送成功
+                    result = true;
+                }
+            }
+        }
+
+        return result;
+    }
+
+    public static String sendNativeTemplate(String tokenUrl,String appId,String appSecret,String templateId, String openId,JSONObject sendData,String urlPath) {
+        String result = "";
+
+        try {
+            AccessToken accessToken = WeixinUtil.getCommonAccessToken(tokenUrl,appId, appSecret);
+
+            if (accessToken == null) {
+                throw new Exception("token无法获取");
+            }
+
+            //发送模版内容
+            String sendTemplateUrl = send_template.replace("ACCESS_TOKEN", accessToken.getToken());
+
+            JSONObject sendTemplateData = new JSONObject();
+
+            sendTemplateData.put("touser", openId);
+            sendTemplateData.put("template_id", templateId);
+            sendTemplateData.put("url", urlPath);
+            sendTemplateData.put("data", sendData);
+
+            URL url = new URL(sendTemplateUrl);
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            conn.setRequestMethod("POST");
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            conn.setUseCaches(false);
+            conn.setRequestProperty("Connection", "Keep-Alive");
+            conn.setRequestProperty("Charset", "UTF-8");
+
+            // 设置文件类型:
+            conn.setRequestProperty("Content-Type","application/json; charset=UTF-8");
+
+            // 设置接收类型否则返回415错误
+            //conn.setRequestProperty("accept","*/*")此处为暴力方法设置接受所有类型,以此来防范返回415;
+            conn.setRequestProperty("accept","application/json");
+            conn.setConnectTimeout(5000);
+            conn.setReadTimeout(5000);
+
+            String dataStr = sendTemplateData.toString();
+
+            log.warn("发送数据:" + dataStr);
+            // 往服务器里面发送数据
+            byte[] buffer = dataStr.getBytes("UTF-8");
+
+            // 设置文件长度
+            conn.setRequestProperty("Content-Length", String.valueOf(buffer.length));
+            OutputStream output = conn.getOutputStream();
+            output.write(buffer);
+            output.flush();
+            output.close();
+
+            if (conn.getResponseCode() == 200) {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
+
+                StringBuilder sb = new StringBuilder();
+                String line = "";
+
+                while ((line = reader.readLine()) != null) {
+                    sb.append(line);
+                }
+
+                result = sb.toString();
+
+                log.warn("接收数据:" + result);
+
+                reader.close();
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+        }
+
+        return result;
+    }
+
+    public static String getContent(String content) {
+        String finallyContent = content;
+        String regex = "<p.*?>(.*?)</p>";
+        Pattern p = Pattern.compile(regex);
+        Matcher m = p.matcher(content);
+        while (m.find()) {
+            finallyContent = m.group(1);
+        }
+
+
+        return finallyContent;
+    }
+
+    /**
+     * 微信发送模版
+     * @return
+     */
+    public static boolean sendMessageTemplate(String userName,String content,
+                                           String sendRemark,
+                                           String sendDate,
+                                           String openId, String templateId,String tokenUrl, String appId, String appSecret) {
+        JSONObject sendData = new JSONObject();
+
+        JSONObject first = new JSONObject();
+        first.put("value", "审核结果通知");
+        first.put("color", "#FF0000");
+
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", userName);
+        keyword1.put("color", "#173177");
+
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", content);
+        keyword2.put("color", "#173177");
+
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", sendDate);
+        keyword3.put("color", "#173177");
+
+        JSONObject remark = new JSONObject();
+        remark.put("value", sendRemark);
+        remark.put("color", "#173177");
+
+        sendData.put("first", first);
+        sendData.put("keyword1", keyword1);
+        sendData.put("keyword2", keyword2);
+        sendData.put("keyword3", keyword3);
+        sendData.put("remark", remark);
+
+        //w8Zk_VQMFIEVSIBPZid7zSrvHmBdrgnqF76u8PLCZEs cs
+        boolean ret = sendTemplate(sendData,tokenUrl, appId, appSecret, templateId, openId, "");
+
+        return ret;
+    }
+
+
+    public static void main(String[] args) {
+		/*AccessToken at = WeixinUtil.getCommonAccessToken(APP_ID, APP_SECRET,"061iw9gy1sZ1dg09dqhy1ae3gy1iw9gq");
+
+		System.out.println(at.getOpenid());*/
+
+		/*for (int i = 0; i < 1; i++) {
+			doorMessage("1111", 2,"2018-09-22 09:00-12:00", 1, "2222222", "3333333", "oiFbN0p9jKphExeGIa3HtyL9HjqM");
+		}*/
+
+        //orderConfirmMessage("12312321312", 1111, DEFAULT_OPEN_ID);
+        //sendBillInfo("测试", "测sendNoticeMessage试", "荆鹏创业", "张三", new BigDecimal(1), "o64fbt6TTUcqLC_tyVJ60I5kzWVc", "1111", new Date());
+        //sendBillPayedMessage("测试", "荆鹏创业", "张三", new BigDecimal(1), "o64fbt6TTUcqLC_tyVJ60I5kzWVc", "11111", new Date());
+        //sendScanPayedMessage("测试", "荆鹏创业", "张三11111", new BigDecimal(1), "o64fbt6TTUcqLC_tyVJ60I5kzWVc", "11111", new Date());
+//sendNoticeMessage("测试", "sdfsdfasfasdfafasdfasdf", "oHjCawgwCGen5k1-hAsimdEX5lZo", "2222","9JKu9t9uTPHL1siIm7WatOJ1KXGolzEPlnmqIbckTUM","wx41ac6791b9dbcf52","3e3d47c5f132d4b47636a536d503fbd4");
+
+	/*	sendBillInfo("1栋-1单元-101",new BigDecimal("0.01"),"oOlFd1BUR6Fi2ayBWUeou81G8ZD4",
+				"物业费","小鹏物业","测试","9e52c923-2179-4526-a108-32becc9aa1d0","vVraOPl4OyNVWDGz6XYlJqRb7qGjjcyJdnVi5HWmFRI","wx41ac6791b9dbcf52","3e3d47c5f132d4b47636a536d503fbd4");*/
+
+        /*sendBillPayedMessage("1栋-1单元-101","物业费",new Date(),new BigDecimal("0.01"),"oOlFd1BUR6Fi2ayBWUeou81G8ZD4","33e7e5e6-5b38-45f5-9ccf-c7ef21978a5b","kbx5u70nzo7PklTVl4B1xvRffksrUtXxnDll8ggEKlo","wx41ac6791b9dbcf52","3e3d47c5f132d4b47636a536d503fbd4");*/
+
+        //sendAlarmNoticeMessage("周界入侵警报", "周界入侵,目标ID:1419,区域范围:(0.327,0.698)(0.674,0.936)(0.67,0.985)(0.352,0.973)", "oHjCawgwCGen5k1-hAsimdEX5lZo", "","8dpP8XM1XaiiIByXiuAeFIZeNjEow1AleG_h8O2xyVA","wx7e70eb62a8459869","909d17e353268da57c4f18cc09798049");
+        //sendNoticeMessage("测试", "sdfsdfasfasdfafasdfasdf", "oHjCawgwCGen5k1-hAsimdEX5lZo", "2222","vsw6sb9lMA3bcsE8MdeaGENvI1HSUy2ht9B8hS3jEzA","wx7e70eb62a8459869","909d17e353268da57c4f18cc09798049");
+//        sendTemperatureAlarmInfo("oLowyuOQ9ULF3LUGt6h3fTrsnbVE", "荆鹏软件_门房考勤机", "wx0b3c41a903053808", "43557bd62f77b0c3d6670e991872f0e7", "Mg9Ldk_kaoHAUwXFHEatrGugTlOz3yrMmMk7VoBca4M");
+//        getContent("<p>内容</p>");
+    }
+}

+ 327 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/WeixinUtil.java

@@ -0,0 +1,327 @@
+package com.jpsoft.excellent.modules.common.utils;
+
+import cn.hutool.core.date.DateTime;
+import com.jpsoft.excellent.modules.wechat.entity.AccessToken;
+import com.jpsoft.excellent.modules.wechat.vo.UserInfo;
+import net.sf.json.JSONArray;
+import net.sf.json.JSONException;
+import net.sf.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.stream.Collectors;
+
+/**
+ * 公众平台通用接口工具类
+ *
+ * @author lt
+ * @date 2013-08-09
+ */
+public class WeixinUtil {
+	private static Logger log = LoggerFactory.getLogger(WeixinUtil.class);
+
+	// 获取access_token的接口地址(GET) https://api.weixin.qq.com/cgi-bin/token 限2000(次/天)
+//	public final static String access_token_url = "http://ykt.xiaoxinda.com/weixin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
+//	public final static String access_token_url = "http://192.168.0.1:8080/weixin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
+
+	//获取微信的code
+	public static String code = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect";
+	public static String getCodeRequest(String appid, String url,String scope){
+        String result = null;
+        String url_encode = "";
+        try {
+			url_encode = java.net.URLEncoder.encode(url, "utf-8");
+		} catch (UnsupportedEncodingException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        result  = code.replace("APPID", appid).replace("REDIRECT_URI",url_encode).replace("SCOPE", scope);
+        return result;
+    }
+
+	//通过code换取网页授权access_token
+	public static String accessTokenurl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
+	public static AccessToken getAccessToken(String appid, String appsecret,String code) throws Exception {
+        AccessToken accessToken = null;
+        String formatUrl = accessTokenurl.replace("APPID", appid).replace("SECRET",appsecret).replace("CODE", code);
+        JSONObject json  = HttpConnectionUtil.httpRequest(formatUrl, "GET", null);
+        if (!json.isNullObject() && !json.isEmpty()) {
+			try {
+				accessToken = new AccessToken();
+				accessToken.setToken(json.getString("access_token"));
+				accessToken.setExpiresIn(json.getInt("expires_in"));
+				accessToken.setOpenid(json.getString("openid"));
+				accessToken.setScope(json.getString("scope"));
+			} catch (Exception e) {
+
+				// 获取token失败
+				log.error("获取token失败,返回结果result={}", json);
+				if (json.getString("errcode").equals("40163")){
+					throw new Exception("请重新扫码");
+
+				}
+
+			}
+		}
+        return accessToken;
+    }
+
+	public static String jsAccessTokenUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi";
+	public static String getJsAPI(String accessToken){
+		String formatUrl = jsAccessTokenUrl.replace("ACCESS_TOKEN", accessToken);
+        JSONObject json  = HttpConnectionUtil.httpRequest(formatUrl, "GET", null);
+
+        if (!json.isNullObject() && !json.isEmpty()) {
+			try {
+				return json.getString("ticket");
+			} catch (Exception e) {
+				// 获取token失败
+				log.error("获取jsAPI失败,返回结果result={}", json);
+			}
+		}
+
+        return null;
+	}
+
+	/**
+	 * 获取access_token
+	 *
+	 * @param appid 凭证
+	 * @param appsecret 密钥
+	 * @return
+	 */
+	public static AccessToken getCommonAccessToken(String tokenUrl,String appid, String appsecret) {
+		AccessToken accessToken = null;
+
+		String requestUrl = tokenUrl.replace("APPID", appid).replace("APPSECRET", appsecret);
+//			String commonAccessTokenUrl = "http://ykt.xiaoxinda.com/weixin/token"
+//			String requestUrl = commonAccessTokenUrl
+//					+ "?grant_type=client_credential"
+//					+ "&appid=" + appid
+//					+ "&secret=" + appsecret;
+		JSONObject jsonObject =HttpConnectionUtil.httpRequest(requestUrl, "GET", null);
+		// 如果请求成功
+		if (null != jsonObject) {
+			try {
+				accessToken = new AccessToken();
+				accessToken.setToken(jsonObject.getString("access_token"));
+				accessToken.setExpiresIn(jsonObject.getInt("expires_in"));
+				//accessToken.setOpenid(jsonObject.getString("openid"));
+			} catch (JSONException e) {
+				accessToken = null;
+				// 获取token失败
+				log.error("获取token失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
+			}
+		}
+
+
+		return accessToken;
+	}
+
+	// 获取用户信息
+	public static String user_info_url = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";
+	public static String subscribe_user_info_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN ";
+
+	public static UserInfo getUserInfo(String openid, String accessToken) {
+		// 拼装url
+		String url = user_info_url.replace("ACCESS_TOKEN", accessToken).replace("OPENID", openid);;
+
+		JSONObject jsonObject = HttpConnectionUtil.httpRequest(url, "GET", null);
+
+		UserInfo userInfo = null;
+		 if (null != jsonObject) {
+				try {
+					userInfo = new UserInfo();
+					userInfo.setOpenid(jsonObject.getString("openid").replaceAll("\"", ""));
+
+					userInfo.setNickname(jsonObject.getString("nickname").replaceAll("\"", ""));
+					userInfo.setCity(jsonObject.getString("city").replaceAll("\"", ""));
+					userInfo.setProvince(jsonObject.getString("province").replaceAll("\"", ""));
+					userInfo.setCountry(jsonObject.getString("country").replaceAll("\"", ""));
+					userInfo.setHeadimgurl(jsonObject.getString("headimgurl").replaceAll("\"", ""));
+				} catch (JSONException e) {
+					// 获取token失败
+					log.error("获取token失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
+				}
+			}
+		return userInfo;
+	}
+
+	public static boolean checkSignature(String token,String signature, String timestamp, String nonce) {
+		String[] arr = new String[] { token, timestamp, nonce };
+
+		String content = Arrays.stream(arr)
+				.sorted(Comparator.naturalOrder())
+				.collect(Collectors.joining());
+
+		MessageDigest md = null;
+		String tmpStr = null;
+
+		try {
+			md = MessageDigest.getInstance("SHA-1");
+			// 将三个参数字符串拼接成一个字符串进行sha1加密
+			byte[] digest = md.digest(content.getBytes("UTF-8"));
+
+			StringBuffer hexstr = new StringBuffer();
+
+			String shaHex = "";
+
+			for (int i = 0; i < digest.length; i++) {
+				shaHex = Integer.toHexString(digest[i] & 0xFF);
+				if (shaHex.length() < 2) {
+					hexstr.append(0);
+				}
+				hexstr.append(shaHex);
+			}
+
+			tmpStr = hexstr.toString();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		// 将sha1加密后的字符串可与signature对比,标识该请求来源于微信
+		return signature.equals(tmpStr);
+	}
+
+	public static cn.hutool.json.JSONObject xmlToJson(ServletInputStream inputStream) throws Exception {
+		cn.hutool.json.JSONObject jsonObject = new cn.hutool.json.JSONObject();
+
+		// 创建sax解析工厂
+		SAXParserFactory factory = SAXParserFactory.newInstance();
+		// 创建sax转换工具
+		SAXParser saxParser = factory.newSAXParser();
+
+		saxParser.parse(inputStream,new DefaultHandler(){
+			private String tagName;
+
+			@Override
+			public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+				tagName = qName;
+			}
+
+			@Override
+			public void endElement(String uri, String localName, String qName) throws SAXException {
+				tagName = null;
+			}
+
+			@Override
+			public void characters(char[] ch, int start, int length) throws SAXException {
+				if(tagName!=null){
+					String content = new String(ch,start,length);
+					jsonObject.put(tagName,content);
+				}
+			}
+		});
+
+		return jsonObject;
+	}
+	public static void replyTextMessage(HttpServletResponse response, String fromUserName, String toUserName, String content){
+		StringBuilder sb = new StringBuilder();
+
+		sb.append("<xml>");
+		sb.append("<ToUserName><![CDATA[" + toUserName + "]]></ToUserName>");
+		sb.append("<FromUserName><![CDATA["+ fromUserName + "]]></FromUserName>");
+		sb.append("<CreateTime>" + DateTime.now().getTime() + "</CreateTime>");
+		sb.append("<MsgType><![CDATA[text]]></MsgType>");
+		sb.append("<Content><![CDATA[" + content + "]]></Content>");
+		sb.append("</xml>");
+
+		try {
+			response.getWriter().print(sb.toString());
+			response.getWriter().close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public static void replyArticlesMessage(HttpServletResponse response, String fromUserName, String toUserName, String title,String description,String picurl,String url){
+		StringBuilder sb = new StringBuilder();
+		sb.append("<xml>");
+		sb.append("<ToUserName><![CDATA[" + toUserName + "]]></ToUserName>");
+		sb.append("<FromUserName><![CDATA["+ fromUserName + "]]></FromUserName>");
+		sb.append("<CreateTime>" + DateTime.now().getTime() + "</CreateTime>");
+		sb.append("<MsgType><![CDATA[news]]></MsgType>");
+		sb.append("<ArticleCount>" + 1 + "</ArticleCount>");
+		sb.append("<Articles>");
+		sb.append("<item>");
+		sb.append("<Title><![CDATA["+title+"]]></Title> ");
+		sb.append("<Description><![CDATA["+description+"]]></Description>");
+		sb.append("<PicUrl><![CDATA["+picurl+"]]></PicUrl>");
+		sb.append("<Url><![CDATA["+url+"]]></Url>");
+		sb.append("</item>");
+		sb.append("</Articles>");
+		sb.append("</xml>");
+
+		try {
+			response.getWriter().print(sb.toString());
+			response.getWriter().close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+
+	/**
+	 * 创建微信菜单
+	 * @param appid
+	 * @param appSecret
+	 * @return
+	 */
+	public static String createMenu(String tokenUrl,String appid,String appSecret){
+		AccessToken token = WeixinUtil.getCommonAccessToken(tokenUrl,appid, appSecret);
+
+		System.out.println(token.getToken());
+
+		JSONObject data = new JSONObject();
+		JSONArray buttonArray = new JSONArray();
+
+		JSONObject button1 = new JSONObject();
+		button1.put("type", "view");
+		button1.put("name", "疫情监管");
+		button1.put("url", "http://wisdomhousewechat.sudaonline.net/prevention/");
+		buttonArray.add(button1);
+
+		JSONObject button2 = new JSONObject();
+		button2.put("type","view");
+		button2.put("name","智慧物业");
+		button2.put("url","http://wisdomhousewechat.sudaonline.net/#/home/?id=1");
+		buttonArray.add(button2);
+
+		JSONObject button3 = new JSONObject();
+		button3.put("type","click");
+		button3.put("name","关于系统");
+		button3.put("key","文章");
+		buttonArray.add(button3);
+
+		data.put("button", buttonArray);
+		data.put("action_name", "QR_LIMIT_STR_SCENE");
+
+		JSONObject actionInfo = new JSONObject();
+		JSONObject scene = new JSONObject();
+
+		scene.put("scene_str", "6");
+
+		actionInfo.put("scene", scene);
+
+		data.put("action_info", actionInfo);
+		System.out.println(data.toString());
+		//创建菜单
+		String result = HttpConnectionUtil.getHttpContentByPost(" https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + token.getToken(), "utf-8", data.toString());
+
+		return result;
+	}
+
+
+}

+ 60 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/AesException.java

@@ -0,0 +1,60 @@
+package com.jpsoft.excellent.modules.common.utils.enterprise;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-4-1 11:52
+ */
+public class AesException extends Exception{
+    public final static int OK = 0;
+    public final static int ValidateSignatureError = -40001;
+    public final static int ParseXmlError = -40002;
+    public final static int ComputeSignatureError = -40003;
+    public final static int IllegalAesKey = -40004;
+    public final static int ValidateCorpidError = -40005;
+    public final static int EncryptAESError = -40006;
+    public final static int DecryptAESError = -40007;
+    public final static int IllegalBuffer = -40008;
+    //public final static int EncodeBase64Error = -40009;
+    //public final static int DecodeBase64Error = -40010;
+    //public final static int GenReturnXmlError = -40011;
+
+    private int code;
+
+    private static String getMessage(int code) {
+        switch (code) {
+            case ValidateSignatureError:
+                return "签名验证错误";
+            case ParseXmlError:
+                return "xml解析失败";
+            case ComputeSignatureError:
+                return "sha加密生成签名失败";
+            case IllegalAesKey:
+                return "SymmetricKey非法";
+            case ValidateCorpidError:
+                return "corpid校验失败";
+            case EncryptAESError:
+                return "aes加密失败";
+            case DecryptAESError:
+                return "aes解密失败";
+            case IllegalBuffer:
+                return "解密后得到的buffer非法";
+//		case EncodeBase64Error:
+//			return "base64加密错误";
+//		case DecodeBase64Error:
+//			return "base64解密错误";
+//		case GenReturnXmlError:
+//			return "xml生成失败";
+            default:
+                return null; // cannot be
+        }
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    AesException(int code) {
+        super(getMessage(code));
+        this.code = code;
+    }
+}

+ 26 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/ByteGroup.java

@@ -0,0 +1,26 @@
+package com.jpsoft.excellent.modules.common.utils.enterprise;
+
+import java.util.ArrayList;
+
+class ByteGroup {
+	ArrayList<Byte> byteContainer = new ArrayList<Byte>();
+
+	public byte[] toBytes() {
+		byte[] bytes = new byte[byteContainer.size()];
+		for (int i = 0; i < byteContainer.size(); i++) {
+			bytes[i] = byteContainer.get(i);
+		}
+		return bytes;
+	}
+
+	public ByteGroup addBytes(byte[] bytes) {
+		for (byte b : bytes) {
+			byteContainer.add(b);
+		}
+		return this;
+	}
+
+	public int size() {
+		return byteContainer.size();
+	}
+}

+ 67 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/PKCS7Encoder.java

@@ -0,0 +1,67 @@
+/**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ *
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+package com.jpsoft.excellent.modules.common.utils.enterprise;
+
+import java.nio.charset.Charset;
+import java.util.Arrays;
+
+/**
+ * 提供基于PKCS7算法的加解密接口.
+ */
+class PKCS7Encoder {
+	static Charset CHARSET = Charset.forName("utf-8");
+	static int BLOCK_SIZE = 32;
+
+	/**
+	 * 获得对明文进行补位填充的字节.
+	 *
+	 * @param count 需要进行填充补位操作的明文字节个数
+	 * @return 补齐用的字节数组
+	 */
+	static byte[] encode(int count) {
+		// 计算需要填充的位数
+		int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE);
+		if (amountToPad == 0) {
+			amountToPad = BLOCK_SIZE;
+		}
+		// 获得补位所用的字符
+		char padChr = chr(amountToPad);
+		String tmp = new String();
+		for (int index = 0; index < amountToPad; index++) {
+			tmp += padChr;
+		}
+		return tmp.getBytes(CHARSET);
+	}
+
+	/**
+	 * 删除解密后明文的补位字符
+	 *
+	 * @param decrypted 解密后的明文
+	 * @return 删除补位字符后的明文
+	 */
+	static byte[] decode(byte[] decrypted) {
+		int pad = (int) decrypted[decrypted.length - 1];
+		if (pad < 1 || pad > 32) {
+			pad = 0;
+		}
+		return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad);
+	}
+
+	/**
+	 * 将数字转化成ASCII码对应的字符,用于对明文进行补码
+	 *
+	 * @param a 需要转化的数字
+	 * @return 转化得到的字符
+	 */
+	static char chr(int a) {
+		byte target = (byte) (a & 0xFF);
+		return (char) target;
+	}
+
+}

+ 61 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/SHA1.java

@@ -0,0 +1,61 @@
+/**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ *
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+package com.jpsoft.excellent.modules.common.utils.enterprise;
+
+import java.security.MessageDigest;
+import java.util.Arrays;
+
+/**
+ * SHA1 class
+ *
+ * 计算公众平台的消息签名接口.
+ */
+class SHA1 {
+
+	/**
+	 * 用SHA1算法生成安全签名
+	 * @param token 票据
+	 * @param timestamp 时间戳
+	 * @param nonce 随机字符串
+	 * @param encrypt 密文
+	 * @return 安全签名
+	 * @throws AesException
+	 */
+	public static String getSHA1(String token, String timestamp, String nonce, String encrypt) throws AesException
+			  {
+		try {
+			String[] array = new String[] { token, timestamp, nonce, encrypt };
+			StringBuffer sb = new StringBuffer();
+			// 字符串排序
+			Arrays.sort(array);
+			for (int i = 0; i < 4; i++) {
+				sb.append(array[i]);
+			}
+			String str = sb.toString();
+			// SHA1签名生成
+			MessageDigest md = MessageDigest.getInstance("SHA-1");
+			md.update(str.getBytes());
+			byte[] digest = md.digest();
+
+			StringBuffer hexstr = new StringBuffer();
+			String shaHex = "";
+			for (int i = 0; i < digest.length; i++) {
+				shaHex = Integer.toHexString(digest[i] & 0xFF);
+				if (shaHex.length() < 2) {
+					hexstr.append(0);
+				}
+				hexstr.append(shaHex);
+			}
+			return hexstr.toString();
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AesException(AesException.ComputeSignatureError);
+		}
+	}
+}

+ 291 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/WXBizMsgCrypt.java

@@ -0,0 +1,291 @@
+package com.jpsoft.excellent.modules.common.utils.enterprise; /**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ *
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * 针对org.apache.commons.codec.binary.Base64,
+ * 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本)
+ * 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi
+ */
+
+
+
+import org.apache.commons.codec.binary.Base64;
+
+import java.nio.charset.Charset;
+import java.util.Arrays;
+import java.util.Random;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+
+
+/**
+ * 提供接收和推送给公众平台消息的加解密接口(UTF8编码的字符串).
+ * <ol>
+ * 	<li>第三方回复加密消息给公众平台</li>
+ * 	<li>第三方收到公众平台发送的消息,验证消息的安全性,并对消息进行解密。</li>
+ * </ol>
+ * 说明:异常java.security.InvalidKeyException:illegal Key Size的解决方案
+ * <ol>
+ * 	<li>在官方网站下载JCE无限制权限策略文件(JDK7的下载地址:
+ *      http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html</li>
+ * 	<li>下载后解压,可以看到local_policy.jar和US_export_policy.jar以及readme.txt</li>
+ * 	<li>如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件</li>
+ * 	<li>如果安装了JDK,将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件</li>
+ * </ol>
+ */
+public class WXBizMsgCrypt {
+    static Charset CHARSET = Charset.forName("utf-8");
+    Base64 base64 = new Base64();
+    byte[] aesKey;
+    String token;
+    String corpId;
+
+    /**
+     * 构造函数
+     * @param token 公众平台上,开发者设置的token
+     * @param encodingAesKey 公众平台上,开发者设置的EncodingAESKey
+     * @param corpId 企业的corpid
+     *
+     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
+     */
+    public WXBizMsgCrypt(String token, String encodingAesKey, String corpId) throws AesException {
+        if (encodingAesKey.length() != 43) {
+            throw new AesException(AesException.IllegalAesKey);
+        }
+
+        this.token = token;
+        this.corpId = corpId;
+        aesKey = Base64.decodeBase64(encodingAesKey);
+    }
+
+    // 生成4个字节的网络字节序
+    byte[] getNetworkBytesOrder(int sourceNumber) {
+        byte[] orderBytes = new byte[4];
+        orderBytes[3] = (byte) (sourceNumber & 0xFF);
+        orderBytes[2] = (byte) (sourceNumber >> 8 & 0xFF);
+        orderBytes[1] = (byte) (sourceNumber >> 16 & 0xFF);
+        orderBytes[0] = (byte) (sourceNumber >> 24 & 0xFF);
+        return orderBytes;
+    }
+
+    // 还原4个字节的网络字节序
+    int recoverNetworkBytesOrder(byte[] orderBytes) {
+        int sourceNumber = 0;
+        for (int i = 0; i < 4; i++) {
+            sourceNumber <<= 8;
+            sourceNumber |= orderBytes[i] & 0xff;
+        }
+        return sourceNumber;
+    }
+
+    // 随机生成16位字符串
+    String getRandomStr() {
+        String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+        Random random = new Random();
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < 16; i++) {
+            int number = random.nextInt(base.length());
+            sb.append(base.charAt(number));
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 对明文进行加密.
+     *
+     * @param text 需要加密的明文
+     * @return 加密后base64编码的字符串
+     * @throws AesException aes加密失败
+     */
+    String encrypt(String randomStr, String text) throws AesException {
+        ByteGroup byteCollector = new ByteGroup();
+        byte[] randomStrBytes = randomStr.getBytes(CHARSET);
+        byte[] textBytes = text.getBytes(CHARSET);
+        byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length);
+        byte[] corpidBytes = corpId.getBytes(CHARSET);
+
+        // randomStr + networkBytesOrder + text + corpid
+        byteCollector.addBytes(randomStrBytes);
+        byteCollector.addBytes(networkBytesOrder);
+        byteCollector.addBytes(textBytes);
+        byteCollector.addBytes(corpidBytes);
+
+        // ... + pad: 使用自定义的填充方式对明文进行补位填充
+        byte[] padBytes = PKCS7Encoder.encode(byteCollector.size());
+        byteCollector.addBytes(padBytes);
+
+        // 获得最终的字节流, 未加密
+        byte[] unencrypted = byteCollector.toBytes();
+
+        try {
+            // 设置加密模式为AES的CBC模式
+            Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
+            SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES");
+            IvParameterSpec iv = new IvParameterSpec(aesKey, 0, 16);
+            cipher.init(Cipher.ENCRYPT_MODE, keySpec, iv);
+
+            // 加密
+            byte[] encrypted = cipher.doFinal(unencrypted);
+
+            // 使用BASE64对加密后的字符串进行编码
+            String base64Encrypted = base64.encodeToString(encrypted);
+
+            return base64Encrypted;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new AesException(AesException.EncryptAESError);
+        }
+    }
+
+    /**
+     * 对密文进行解密.
+     *
+     * @param text 需要解密的密文
+     * @return 解密得到的明文
+     * @throws AesException aes解密失败
+     */
+    String decrypt(String text) throws AesException {
+        byte[] original;
+        try {
+            // 设置解密模式为AES的CBC模式
+            Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
+            SecretKeySpec key_spec = new SecretKeySpec(aesKey, "AES");
+            IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16));
+            cipher.init(Cipher.DECRYPT_MODE, key_spec, iv);
+
+            // 使用BASE64对密文进行解码
+            byte[] encrypted = Base64.decodeBase64(text);
+
+            // 解密
+            original = cipher.doFinal(encrypted);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new AesException(AesException.DecryptAESError);
+        }
+
+        String xmlContent, from_corpid;
+        try {
+            // 去除补位字符
+            byte[] bytes = PKCS7Encoder.decode(original);
+
+            // 分离16位随机字符串,网络字节序和corpId
+            byte[] networkOrder = Arrays.copyOfRange(bytes, 16, 20);
+
+            int xmlLength = recoverNetworkBytesOrder(networkOrder);
+
+            xmlContent = new String(Arrays.copyOfRange(bytes, 20, 20 + xmlLength), CHARSET);
+            from_corpid = new String(Arrays.copyOfRange(bytes, 20 + xmlLength, bytes.length),
+                    CHARSET);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new AesException(AesException.IllegalBuffer);
+        }
+
+        // corpid不相同的情况
+        if (!from_corpid.equals(corpId)) {
+            throw new AesException(AesException.ValidateCorpidError);
+        }
+        return xmlContent;
+
+    }
+
+    /**
+     * 将公众平台回复用户的消息加密打包.
+     * <ol>
+     * 	<li>对要发送的消息进行AES-CBC加密</li>
+     * 	<li>生成安全签名</li>
+     * 	<li>将消息密文和安全签名打包成xml格式</li>
+     * </ol>
+     *
+     * @param replyMsg 公众平台待回复用户的消息,xml格式的字符串
+     * @param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
+     * @param nonce 随机串,可以自己生成,也可以用URL参数的nonce
+     *
+     * @return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串
+     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
+     */
+    public String EncryptMsg(String replyMsg, String timeStamp, String nonce) throws AesException {
+        // 加密
+        String encrypt = encrypt(getRandomStr(), replyMsg);
+
+        // 生成安全签名
+        if (timeStamp == "") {
+            timeStamp = Long.toString(System.currentTimeMillis());
+        }
+
+        String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt);
+
+        // System.out.println("发送给平台的签名是: " + signature[1].toString());
+        // 生成发送的xml
+        String result = XMLParse.generate(encrypt, signature, timeStamp, nonce);
+        return result;
+    }
+
+    /**
+     * 检验消息的真实性,并且获取解密后的明文.
+     * <ol>
+     * 	<li>利用收到的密文生成安全签名,进行签名验证</li>
+     * 	<li>若验证通过,则提取xml中的加密消息</li>
+     * 	<li>对消息进行解密</li>
+     * </ol>
+     *
+     * @param msgSignature 签名串,对应URL参数的msg_signature
+     * @param timeStamp 时间戳,对应URL参数的timestamp
+     * @param nonce 随机串,对应URL参数的nonce
+     * @param postData 密文,对应POST请求的数据
+     *
+     * @return 解密后的原文
+     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
+     */
+    public String DecryptMsg(String msgSignature, String timeStamp, String nonce, String postData)
+            throws AesException {
+
+        // 密钥,公众账号的app secret
+        // 提取密文
+        Object[] encrypt = XMLParse.extract(postData);
+
+        // 验证安全签名
+        String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt[1].toString());
+
+        // 和URL中的签名比较是否相等
+        // System.out.println("第三方收到URL中的签名:" + msg_sign);
+        // System.out.println("第三方校验签名:" + signature);
+        if (!signature.equals(msgSignature)) {
+            throw new AesException(AesException.ValidateSignatureError);
+        }
+
+        // 解密
+        String result = decrypt(encrypt[1].toString());
+        return result;
+    }
+
+    /**
+     * 验证URL
+     * @param msgSignature 签名串,对应URL参数的msg_signature
+     * @param timeStamp 时间戳,对应URL参数的timestamp
+     * @param nonce 随机串,对应URL参数的nonce
+     * @param echoStr 随机串,对应URL参数的echostr
+     *
+     * @return 解密之后的echostr
+     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
+     */
+    public String VerifyURL(String msgSignature, String timeStamp, String nonce, String echoStr)
+            throws AesException {
+        String signature = SHA1.getSHA1(token, timeStamp, nonce, echoStr);
+
+        if (!signature.equals(msgSignature)) {
+            throw new AesException(AesException.ValidateSignatureError);
+        }
+
+        String result = decrypt(echoStr);
+        return result;
+    }
+
+}

+ 72 - 0
common/src/main/java/com/jpsoft/excellent/modules/common/utils/enterprise/XMLParse.java

@@ -0,0 +1,72 @@
+/**
+ * 对公众平台发送给公众账号的消息加解密示例代码.
+ *
+ * @copyright Copyright (c) 1998-2014 Tencent Inc.
+ */
+
+// ------------------------------------------------------------------------
+
+package com.jpsoft.excellent.modules.common.utils.enterprise;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+/**
+ * XMLParse class
+ *
+ * 提供提取消息格式中的密文及生成回复消息格式的接口.
+ */
+class XMLParse {
+
+	/**
+	 * 提取出xml数据包中的加密消息
+	 * @param xmltext 待提取的xml字符串
+	 * @return 提取出的加密消息字符串
+	 * @throws AesException
+	 */
+	public static Object[] extract(String xmltext) throws AesException     {
+		Object[] result = new Object[3];
+		try {
+			DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+			DocumentBuilder db = dbf.newDocumentBuilder();
+			StringReader sr = new StringReader(xmltext);
+			InputSource is = new InputSource(sr);
+			Document document = db.parse(is);
+
+			Element root = document.getDocumentElement();
+			NodeList nodelist1 = root.getElementsByTagName("Encrypt");
+			NodeList nodelist2 = root.getElementsByTagName("ToUserName");
+			result[0] = 0;
+			result[1] = nodelist1.item(0).getTextContent();
+			result[2] = nodelist2.item(0).getTextContent();
+			return result;
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new AesException(AesException.ParseXmlError);
+		}
+	}
+
+	/**
+	 * 生成xml消息
+	 * @param encrypt 加密后的消息密文
+	 * @param signature 安全签名
+	 * @param timestamp 时间戳
+	 * @param nonce 随机字符串
+	 * @return 生成的xml字符串
+	 */
+	public static String generate(String encrypt, String signature, String timestamp, String nonce) {
+
+		String format = "<xml>\n" + "<Encrypt><![CDATA[%1$s]]></Encrypt>\n"
+				+ "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n"
+				+ "<TimeStamp>%3$s</TimeStamp>\n" + "<Nonce><![CDATA[%4$s]]></Nonce>\n" + "</xml>";
+		return String.format(format, encrypt, signature, timestamp, nonce);
+
+	}
+}

+ 32 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/DataDictionaryDAO.java

@@ -0,0 +1,32 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.jpsoft.excellent.modules.sys.entity.DataDictionary;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Repository
+public interface DataDictionaryDAO {
+	int insert(DataDictionary entity);
+	int update(DataDictionary entity);
+	int exist(String id);
+	DataDictionary get(String id);
+	int delete(String id);
+	String getName(String id);
+	String getValue(String id);
+	List<DataDictionary> list();
+	List<DataDictionary> findByParentId(String parentId);
+	DataDictionary findByParentIdAndValue(String parentId,String value);
+	List<Map<String, Object>> queryChildren(String parentId);
+	List<DataDictionary> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+	List<DataDictionary> findByCatalogName(String catalogName);
+
+	String findNameByCatalogNameAndValue(String catalogName,String value);
+	DataDictionary findByCatalogNameAndValue(String catalogName,String value);
+
+    DataDictionary findByName(String name);
+}

+ 21 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/MenuDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.sys.entity.Menu;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface MenuDAO {
+	int insert(Menu entity);
+	int update(Menu entity);
+	int exist(String id);
+	Menu get(String id);
+	int delete(String id);
+	List<Menu> list();
+	List<Menu> search(Map<String,Object> searchParams,List<Sort> sortList);
+    List<Menu> findAllocMenu(@Param("userId") String userId,@Param("parentId") String parentId);
+}

+ 21 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/PermissionDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.sys.entity.Permission;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface PermissionDAO {
+	int insert(Permission entity);
+	int update(Permission entity);
+	int exist(@Param("path") String path,@Param("method") String method);
+	Permission get(String id);
+	int delete(String id);
+	List<Permission> list();
+	List<Permission> search(Map<String,Object> searchParams,List<Sort> sortList);
+    int hasPermitted(@Param("userId") String userId,@Param("path") String path,@Param("method") String method);
+}

+ 18 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/RoleDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.sys.entity.Role;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface RoleDAO {
+	int insert(Role entity);
+	int update(Role entity);
+	int exist(String id);
+	Role get(String id);
+	int delete(String id);
+	List<Role> list();
+	List<Role> search(Map<String,Object> searchParams,List<Sort> sortList);
+}

+ 22 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/RoleMenuDAO.java

@@ -0,0 +1,22 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.sys.entity.RoleMenu;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface RoleMenuDAO {
+	int insert(RoleMenu entity);
+	int update(RoleMenu entity);
+	int exist(String id);
+	RoleMenu get(String id);
+	int delete(String id);
+	List<RoleMenu> list();
+	List<RoleMenu> search(Map<String,Object> searchParams,List<Sort> sortList);
+
+	List<RoleMenu> findByRoleId(String roleId);
+
+	int deleteByRoleId(String roleId);
+}

+ 20 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/RolePermissionDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.sys.entity.RolePermission;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface RolePermissionDAO {
+	int insert(RolePermission entity);
+	int update(RolePermission entity);
+	int exist(String id);
+	RolePermission get(String id);
+	int delete(String id);
+	List<RolePermission> list();
+	List<RolePermission> search(Map<String,Object> searchParams,List<Sort> sortList);
+    List<RolePermission> findByRoleId(String roleId);
+	int deleteByRoleId(String roleId);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/SysLogDAO.java

@@ -0,0 +1,19 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.jpsoft.excellent.modules.sys.entity.SysLog;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface SysLogDAO {
+	int insert(SysLog entity);
+	int update(SysLog entity);
+	int exist(Long id);
+	SysLog get(Long id);
+	int delete(Long id);
+	List<SysLog> list();
+	List<SysLog> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 22 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/UserDAO.java

@@ -0,0 +1,22 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.sys.entity.User;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface UserDAO {
+	int insert(User entity);
+	int update(User entity);
+	int exist(String id);
+	User get(String id);
+	int delete(String id);
+	List<User> list();
+	List<User> search(Map<String,Object> searchParams,List<Sort> sortList);
+	User findByUserName(@Param("userName") String userName);
+    long hasRole(@Param("userId") String userId,@Param("roleName") String roleName);
+}

+ 24 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/UserRoleDAO.java

@@ -0,0 +1,24 @@
+package com.jpsoft.excellent.modules.sys.dao;
+
+import java.util.List;
+
+import com.jpsoft.excellent.modules.sys.entity.Role;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.sys.entity.UserRole;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface UserRoleDAO {
+	int insert(UserRole entity);
+	int update(UserRole entity);
+	int exist(String id);
+	UserRole get(String id);
+	int delete(String id);
+	List<UserRole> list();
+	List<UserRole> search(Map<String,Object> searchParams,List<Sort> sortList);
+    List<Role> findRoleByUserId(String userId);
+	List<String> findRoleNameByUserId(String userId);
+	int findCountByAIdAndRName(String userId,String roleName);
+	int deleteByUserId(String userId);
+}

+ 24 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dto/RoleRelatedDTO.java

@@ -0,0 +1,24 @@
+package com.jpsoft.excellent.modules.sys.dto;
+
+import java.util.List;
+
+public class RoleRelatedDTO {
+    private String roleId;
+    private List<String> relatedList;
+
+    public String getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(String roleId) {
+        this.roleId = roleId;
+    }
+
+    public List<String> getRelatedList() {
+        return relatedList;
+    }
+
+    public void setRelatedList(List<String> relatedList) {
+        this.relatedList = relatedList;
+    }
+}

+ 37 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/DataDictionary.java

@@ -0,0 +1,37 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import java.util.Date;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+  描述:sys_data_dictionary的实体类
+ */
+@Data
+public class DataDictionary {
+	/**
+	 * 学生相关证明
+	 */
+	public static final String STUDENT_RELATED_CERT_ID = "f63a5ca8-ec0e-4987-ac9c-a8787f6026c4";
+
+	private String id;
+	private String name;
+	private String value;
+	private Integer sortNo;
+	private String parentName;
+	private String parentId;
+	private String dataType;
+	private String createBy;
+	private Date createDate;
+	private String updateBy;
+	private Date updateDate;
+	private Boolean activated;
+	private Boolean delFlag;
+	@ApiModelProperty(value = "扩展字段1")
+	private String extended1;
+	@ApiModelProperty(value = "扩展字段2")
+	private String extended2;
+	@ApiModelProperty(value = "扩展字段3")
+	private String extended3;
+}

+ 199 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/Menu.java

@@ -0,0 +1,199 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:sys_menu的实体类
+ */
+public class Menu {
+	private String id;
+	private String menuName;
+	private String parentId;
+	private Integer sortNo;
+	private String menuUrl;
+	private String menuType;
+	private Date createTime;
+	private String createBy;
+	private Date updateTime;
+	private String updateBy;
+	private Boolean delFlag;
+	private String parentName;
+	private List<Menu> children;
+	private String icon;
+
+		/**
+	 *获取菜单编号
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置菜单编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取菜单名称
+	 */
+	public String getMenuName(){
+		return menuName;
+	}
+	
+	/**
+	 *设置菜单名称
+	 */
+	public void setMenuName(String menuName){
+		this.menuName = menuName;
+	}
+		/**
+	 *获取上级菜单
+	 */
+	public String getParentId(){
+		return parentId;
+	}
+	
+	/**
+	 *设置上级菜单
+	 */
+	public void setParentId(String parentId){
+		this.parentId = parentId;
+	}
+		/**
+	 *获取排序号
+	 */
+	public Integer getSortNo(){
+		return sortNo;
+	}
+	
+	/**
+	 *设置排序号
+	 */
+	public void setSortNo(Integer sortNo){
+		this.sortNo = sortNo;
+	}
+		/**
+	 *获取菜单地址
+	 */
+	public String getMenuUrl(){
+		return menuUrl;
+	}
+	
+	/**
+	 *设置菜单地址
+	 */
+	public void setMenuUrl(String menuUrl){
+		this.menuUrl = menuUrl;
+	}
+		/**
+	 *获取菜单类型(1-后端、2-前端)
+	 */
+	public String getMenuType(){
+		return menuType;
+	}
+	
+	/**
+	 *设置菜单类型(1-后端、2-前端)
+	 */
+	public void setMenuType(String menuType){
+		this.menuType = menuType;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		/**
+	 *获取
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		/**
+	 *获取
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+
+	public String getParentName() {
+		return parentName;
+	}
+
+	public void setParentName(String parentName) {
+		this.parentName = parentName;
+	}
+
+	public List<Menu> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<Menu> children) {
+		this.children = children;
+	}
+
+	public String getIcon() {
+		return icon;
+	}
+
+	public void setIcon(String icon) {
+		this.icon = icon;
+	}
+}

+ 142 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/Permission.java

@@ -0,0 +1,142 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import java.util.Date;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+ 描述:sys_permission的实体类
+ */
+public class Permission {
+	private String id;
+	private String path;
+	private String method;
+	private String summary;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private Date createTime;
+	private Date updateTime;
+
+	/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+	/**
+	 *获取访问路径
+	 */
+	public String getPath(){
+		return path;
+	}
+
+	/**
+	 *设置访问路径
+	 */
+	public void setPath(String path){
+		this.path = path;
+	}
+	/**
+	 *获取访问方式
+	 */
+	public String getMethod(){
+		return method;
+	}
+
+	/**
+	 *设置访问方式
+	 */
+	public void setMethod(String method){
+		this.method = method;
+	}
+	/**
+	 *获取简介
+	 */
+	public String getSummary(){
+		return summary;
+	}
+
+	/**
+	 *设置简介
+	 */
+	public void setSummary(String summary){
+		this.summary = summary;
+	}
+	/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+	/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+	/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+}

+ 129 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/Role.java

@@ -0,0 +1,129 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:sys_role的实体类
+ */
+public class Role {
+	private String id;
+	private String name;
+	private String description;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	
+		/**
+	 *获取角色编号
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置角色编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取角色名称
+	 */
+	public String getName(){
+		return name;
+	}
+	
+	/**
+	 *设置角色名称
+	 */
+	public void setName(String name){
+		this.name = name;
+	}
+		/**
+	 *获取角色描述
+	 */
+	public String getDescription(){
+		return description;
+	}
+	
+	/**
+	 *设置角色描述
+	 */
+	public void setDescription(String description){
+		this.description = description;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取删除标示
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置删除标示
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+}

+ 129 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/RoleMenu.java

@@ -0,0 +1,129 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:sys_role_menu的实体类
+ */
+public class RoleMenu {
+	private String id;
+	private String roleId;
+	private String menuId;
+	private Boolean delFlag;
+	private String createBy;
+	private Date createTime;
+	private String updateBy;
+	private Date updateTime;
+	
+		/**
+	 *获取
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取
+	 */
+	public String getRoleId(){
+		return roleId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setRoleId(String roleId){
+		this.roleId = roleId;
+	}
+		/**
+	 *获取
+	 */
+	public String getMenuId(){
+		return menuId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setMenuId(String menuId){
+		this.menuId = menuId;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+}

+ 129 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/RolePermission.java

@@ -0,0 +1,129 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:sys_role_permission的实体类
+ */
+public class RolePermission {
+	private String id;
+	private String permId;
+	private String roleId;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private Date createTime;
+	private Date updateTime;
+	
+		/**
+	 *获取
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取
+	 */
+	public String getPermId(){
+		return permId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setPermId(String permId){
+		this.permId = permId;
+	}
+		/**
+	 *获取
+	 */
+	public String getRoleId(){
+		return roleId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setRoleId(String roleId){
+		this.roleId = roleId;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+}

+ 37 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/SysLog.java

@@ -0,0 +1,37 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:sys_log的实体类
+ */
+@Data
+@ApiModel(value = "sys_log的实体类")
+public class SysLog {
+    @ApiModelProperty(value = "日志编号")
+	private Long id;
+    @ApiModelProperty(value = "客户端IP")
+	private String remoteIp;
+    @ApiModelProperty(value = "访问url")
+	private String url;
+    @ApiModelProperty(value = "提交参数")
+	private String data;
+    @ApiModelProperty(value = "用户编号")
+	private String userId;
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    @ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	@ApiModelProperty(value = "备注")
+	private String remark;
+	@ApiModelProperty(value = "耗时(毫秒)")
+	private Long elapse;
+	@ApiModelProperty(value = "入口")
+	private String pointcut;
+}

+ 37 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/User.java

@@ -0,0 +1,37 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import java.util.Date;
+import java.util.List;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+
+@Data
+@ApiModel(value = "sys_user的实体类")
+public class User {
+	private String id;
+	private String userName;
+	private String password;
+	private String realName;
+
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+	@ApiModelProperty(value = "更新时间")
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private List<String> roles;
+	private String orgId;
+	private String orgName;
+	private String phone;
+}

+ 129 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/UserRole.java

@@ -0,0 +1,129 @@
+package com.jpsoft.excellent.modules.sys.entity;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:sys_user_role的实体类
+ */
+public class UserRole {
+	private String id;
+	private String roleId;
+	private String userId;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private Date createTime;
+	private Date updateTime;
+	
+		/**
+	 *获取用户角色关联编号
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置用户角色关联编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取角色编号
+	 */
+	public String getRoleId(){
+		return roleId;
+	}
+	
+	/**
+	 *设置角色编号
+	 */
+	public void setRoleId(String roleId){
+		this.roleId = roleId;
+	}
+		/**
+	 *获取用户编号
+	 */
+	public String getUserId(){
+		return userId;
+	}
+	
+	/**
+	 *设置用户编号
+	 */
+	public void setUserId(String userId){
+		this.userId = userId;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+}

+ 27 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/DataDictionaryService.java

@@ -0,0 +1,27 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.sys.entity.DataDictionary;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+public interface DataDictionaryService {
+	DataDictionary get(String id);
+	boolean exist(String id);
+	int insert(DataDictionary model);
+	int update(DataDictionary model);
+	int delete(String id);
+	String getName(String id);
+	String getValue(String id);
+	List<DataDictionary> list();
+	List<DataDictionary> findByParentId(String parentId);
+	DataDictionary findByParentIdAndValue(String parentId,String value);
+	List<Map<String, Object>> queryChildren(String parentId);
+	Page<DataDictionary> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, List<Sort> sortList);
+	List<DataDictionary> findByCatalogName(String catalogName);
+	String findNameByCatalogNameAndValue(String catalogName,String value);
+	DataDictionary findByCatalogNameAndValue(String catalogName,String value);
+    DataDictionary findByName(String name);
+}

+ 21 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/MenuService.java

@@ -0,0 +1,21 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.sys.entity.Menu;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface MenuService {
+	Menu get(String id);
+	boolean exist(String id);
+	int insert(Menu model);
+	int update(Menu model);
+	int delete(String id);
+	List<Menu> list();
+	Page<Menu> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
+
+    List<Menu> query(Map<String, Object> searchParams, int limit, List<Sort> sortList);
+
+    List<Menu> findAllocMenu(String subject, String parentId);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/PermissionService.java

@@ -0,0 +1,19 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.sys.entity.Permission;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface PermissionService {
+	Permission get(String id);
+	boolean exist(String path, String method);
+	int insert(Permission model);
+	int update(Permission model);
+	int delete(String id);
+	List<Permission> list();
+	Page<Permission> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
+
+    boolean hasPermitted(String userId, String path, String method);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/RoleMenuService.java

@@ -0,0 +1,19 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.sys.entity.RoleMenu;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface RoleMenuService {
+	RoleMenu get(String id);
+	boolean exist(String id);
+	int insert(RoleMenu model);
+	int update(RoleMenu model);
+	int delete(String id);
+	List<RoleMenu> list();
+	Page<RoleMenu> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
+    List<RoleMenu> findByRoleId(String roleId);
+	int deleteByRoleId(String roleId);
+}

+ 21 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/RolePermissionService.java

@@ -0,0 +1,21 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.sys.entity.RolePermission;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface RolePermissionService {
+	RolePermission get(String id);
+	boolean exist(String id);
+	int insert(RolePermission model);
+	int update(RolePermission model);
+	int delete(String id);
+	List<RolePermission> list();
+	Page<RolePermission> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
+
+    List<RolePermission> findByRoleId(String roleId);
+
+	int deleteByRoleId(String roleId);
+}

+ 17 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/RoleService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.sys.entity.Role;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface RoleService {
+	Role get(String id);
+	boolean exist(String id);
+	int insert(Role model);
+	int update(Role model);
+	int delete(String id);
+	List<Role> list();
+	Page<Role> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
+}

+ 18 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/SysLogService.java

@@ -0,0 +1,18 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.jpsoft.excellent.modules.sys.entity.SysLog;
+
+import java.util.List;
+import java.util.Map;
+
+public interface SysLogService {
+	SysLog get(Long id);
+	boolean exist(Long id);
+	int insert(SysLog model);
+	int update(SysLog model);
+	int delete(Long id);
+	List<SysLog> list();
+	Page<SysLog> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, List<Sort> sortList);
+}

+ 23 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/UserRoleService.java

@@ -0,0 +1,23 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.jpsoft.excellent.modules.sys.entity.Role;
+import com.jpsoft.excellent.modules.sys.entity.UserRole;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface UserRoleService {
+	UserRole get(String id);
+	boolean exist(String id);
+	int insert(UserRole model);
+	int update(UserRole model);
+	int delete(String id);
+	List<UserRole> list();
+	Page<UserRole> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
+    List<Role> findRoleByUserId(String userId);
+	List<String> findRoleNameByUserId(String userId);
+	int findCountByAIdAndRName(String userId,String roleName);
+	int deleteByUserId(String userId);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/UserService.java

@@ -0,0 +1,19 @@
+package com.jpsoft.excellent.modules.sys.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.sys.entity.User;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface UserService {
+	User get(String id);
+	boolean exist(String id);
+	int insert(User model);
+	int update(User model);
+	int delete(String id);
+	List<User> list();
+	Page<User> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
+	User findByUserName(String userName);
+	boolean hasRole(String userId, String roleName) ;
+}

+ 118 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/DataDictionaryServiceImpl.java

@@ -0,0 +1,118 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.jpsoft.excellent.modules.sys.dao.DataDictionaryDAO;
+import com.jpsoft.excellent.modules.sys.entity.DataDictionary;
+import com.jpsoft.excellent.modules.sys.service.DataDictionaryService;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Transactional
+@Component(value="dataDictionaryService")
+public class DataDictionaryServiceImpl implements DataDictionaryService {
+	@Resource(name="dataDictionaryDAO")
+	private DataDictionaryDAO dataDictionaryDAO;
+
+	@Override
+	public DataDictionary get(String id) {
+		// TODO Auto-generated method stub
+		return dataDictionaryDAO.get(id);
+	}
+
+	@Override
+	public int insert(DataDictionary model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+
+		return dataDictionaryDAO.insert(model);
+	}
+
+	@Override
+	public int update(DataDictionary model) {
+		// TODO Auto-generated method stub
+		return dataDictionaryDAO.update(model);
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return dataDictionaryDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = dataDictionaryDAO.exist(id);
+
+		return count > 0 ? true : false;
+	}
+
+	@Override
+	public String getName(String id){
+		return dataDictionaryDAO.getName(id);
+	}
+	@Override
+	public String getValue(String id){
+		return dataDictionaryDAO.getValue(id);
+	}
+
+	@Override
+	public List<DataDictionary> findByParentId(String parentId){
+		return dataDictionaryDAO.findByParentId(parentId);
+	}
+
+	@Override
+	public DataDictionary findByParentIdAndValue(String parentId,String value){
+		return dataDictionaryDAO.findByParentIdAndValue(parentId,value);
+	}
+
+	@Override
+	public List<DataDictionary> list() {
+		// TODO Auto-generated method stub
+		return dataDictionaryDAO.list();
+	}
+
+	@Override
+	public List<Map<String, Object>> queryChildren(String parentId){
+		return dataDictionaryDAO.queryChildren(parentId);
+	}
+
+	@Override
+	public Page<DataDictionary> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+		Page<DataDictionary> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+			dataDictionaryDAO.search(searchParams,sortList);
+		});
+
+		return page;
+	}
+
+	@Override
+	public List<DataDictionary> findByCatalogName(String catalogName) {
+		return dataDictionaryDAO.findByCatalogName(catalogName);
+	}
+
+	@Override
+	public String findNameByCatalogNameAndValue(String catalogName,String value) {
+//		Map<String,Object> map = new HashMap<>();
+//		map.put("catalogName",catalogName);
+//		map.put("value",value);
+
+		return dataDictionaryDAO.findNameByCatalogNameAndValue(catalogName,value);
+	}
+
+	@Override
+	public DataDictionary findByCatalogNameAndValue(String catalogName,String value) {
+		return dataDictionaryDAO.findByCatalogNameAndValue(catalogName,value);
+	}
+
+	@Override
+	public DataDictionary findByName(String name) {
+		return dataDictionaryDAO.findByName(name);
+	}
+}

+ 83 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/MenuServiceImpl.java

@@ -0,0 +1,83 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.sys.dao.MenuDAO;
+import com.jpsoft.excellent.modules.sys.entity.Menu;
+import com.jpsoft.excellent.modules.sys.service.MenuService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="menuService")
+public class MenuServiceImpl implements MenuService {
+	@Resource(name="menuDAO")
+	private MenuDAO menuDAO;
+
+	@Override
+	public Menu get(String id) {
+		// TODO Auto-generated method stub
+		return menuDAO.get(id);
+	}
+
+	@Override
+	public int insert(Menu model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return menuDAO.insert(model);
+	}
+
+	@Override
+	public int update(Menu model) {
+		// TODO Auto-generated method stub
+		return menuDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return menuDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = menuDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<Menu> list() {
+		// TODO Auto-generated method stub
+		return menuDAO.list();
+	}
+		
+	@Override
+	public Page<Menu> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<Menu> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            menuDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public List<Menu> query(Map<String, Object> searchParams, int limit, List<Sort> sortList) {
+		Page<Menu> page = PageHelper.startPage(1,limit,false).doSelectPage(()->{
+			menuDAO.search(searchParams,sortList);
+		});
+
+		return page.getResult();
+	}
+
+	@Override
+	public List<Menu> findAllocMenu(String subject, String parentId) {
+		return menuDAO.findAllocMenu(subject, parentId);
+	}
+}

+ 74 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/PermissionServiceImpl.java

@@ -0,0 +1,74 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.sys.dao.PermissionDAO;
+import com.jpsoft.excellent.modules.sys.entity.Permission;
+import com.jpsoft.excellent.modules.sys.service.PermissionService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="permissionService")
+public class PermissionServiceImpl implements PermissionService {
+	@Resource(name="permissionDAO")
+	private PermissionDAO permissionDAO;
+
+	@Override
+	public Permission get(String id) {
+		// TODO Auto-generated method stub
+		return permissionDAO.get(id);
+	}
+
+	@Override
+	public int insert(Permission model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return permissionDAO.insert(model);
+	}
+
+	@Override
+	public int update(Permission model) {
+		// TODO Auto-generated method stub
+		return permissionDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return permissionDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String path, String method) {
+		// TODO Auto-generated method stub
+		int count = permissionDAO.exist(path,method);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<Permission> list() {
+		// TODO Auto-generated method stub
+		return permissionDAO.list();
+	}
+		
+	@Override
+	public Page<Permission> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<Permission> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            permissionDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public boolean hasPermitted(String userId, String path, String method) {
+		return permissionDAO.hasPermitted(userId,path,method)>0 ? true : false;
+	}
+}

+ 79 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/RoleMenuServiceImpl.java

@@ -0,0 +1,79 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.sys.dao.RoleMenuDAO;
+import com.jpsoft.excellent.modules.sys.entity.RoleMenu;
+import com.jpsoft.excellent.modules.sys.service.RoleMenuService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="roleMenuService")
+public class RoleMenuServiceImpl implements RoleMenuService {
+	@Resource(name="roleMenuDAO")
+	private RoleMenuDAO roleMenuDAO;
+
+	@Override
+	public RoleMenu get(String id) {
+		// TODO Auto-generated method stub
+		return roleMenuDAO.get(id);
+	}
+
+	@Override
+	public int insert(RoleMenu model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return roleMenuDAO.insert(model);
+	}
+
+	@Override
+	public int update(RoleMenu model) {
+		// TODO Auto-generated method stub
+		return roleMenuDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return roleMenuDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = roleMenuDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<RoleMenu> list() {
+		// TODO Auto-generated method stub
+		return roleMenuDAO.list();
+	}
+		
+	@Override
+	public Page<RoleMenu> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<RoleMenu> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            roleMenuDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public List<RoleMenu> findByRoleId(String roleId) {
+		return roleMenuDAO.findByRoleId(roleId);
+	}
+
+	@Override
+	public int deleteByRoleId(String roleId) {
+		return roleMenuDAO.deleteByRoleId(roleId);
+	}
+}

+ 79 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/RolePermissionServiceImpl.java

@@ -0,0 +1,79 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.sys.dao.RolePermissionDAO;
+import com.jpsoft.excellent.modules.sys.entity.RolePermission;
+import com.jpsoft.excellent.modules.sys.service.RolePermissionService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="rolePermissionService")
+public class RolePermissionServiceImpl implements RolePermissionService {
+	@Resource(name="rolePermissionDAO")
+	private RolePermissionDAO rolePermissionDAO;
+
+	@Override
+	public RolePermission get(String id) {
+		// TODO Auto-generated method stub
+		return rolePermissionDAO.get(id);
+	}
+
+	@Override
+	public int insert(RolePermission model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return rolePermissionDAO.insert(model);
+	}
+
+	@Override
+	public int update(RolePermission model) {
+		// TODO Auto-generated method stub
+		return rolePermissionDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return rolePermissionDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = rolePermissionDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<RolePermission> list() {
+		// TODO Auto-generated method stub
+		return rolePermissionDAO.list();
+	}
+		
+	@Override
+	public Page<RolePermission> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<RolePermission> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            rolePermissionDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public List<RolePermission> findByRoleId(String roleId) {
+		return rolePermissionDAO.findByRoleId(roleId);
+	}
+
+	@Override
+	public int deleteByRoleId(String roleId) {
+		return rolePermissionDAO.deleteByRoleId(roleId);
+	}
+}

+ 69 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/RoleServiceImpl.java

@@ -0,0 +1,69 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.sys.dao.RoleDAO;
+import com.jpsoft.excellent.modules.sys.entity.Role;
+import com.jpsoft.excellent.modules.sys.service.RoleService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="roleService")
+public class RoleServiceImpl implements RoleService {
+	@Resource(name="roleDAO")
+	private RoleDAO roleDAO;
+
+	@Override
+	public Role get(String id) {
+		// TODO Auto-generated method stub
+		return roleDAO.get(id);
+	}
+
+	@Override
+	public int insert(Role model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return roleDAO.insert(model);
+	}
+
+	@Override
+	public int update(Role model) {
+		// TODO Auto-generated method stub
+		return roleDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return roleDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = roleDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<Role> list() {
+		// TODO Auto-generated method stub
+		return roleDAO.list();
+	}
+		
+	@Override
+	public Page<Role> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<Role> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            roleDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 70 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/SysLogServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.jpsoft.excellent.modules.sys.dao.SysLogDAO;
+import com.jpsoft.excellent.modules.sys.entity.SysLog;
+import com.jpsoft.excellent.modules.sys.service.SysLogService;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Transactional
+@Component(value="sysLogService")
+public class SysLogServiceImpl implements SysLogService {
+	@Resource(name="sysLogDAO")
+	private SysLogDAO sysLogDAO;
+
+	@Override
+	public SysLog get(Long id) {
+		// TODO Auto-generated method stub
+		return sysLogDAO.get(id);
+	}
+
+	@Override
+	public int insert(SysLog model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return sysLogDAO.insert(model);
+	}
+
+	@Override
+	public int update(SysLog model) {
+		// TODO Auto-generated method stub
+		return sysLogDAO.update(model);		
+	}
+
+	@Override
+	public int delete(Long id) {
+		// TODO Auto-generated method stub
+		return sysLogDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(Long id) {
+		// TODO Auto-generated method stub
+		int count = sysLogDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<SysLog> list() {
+		// TODO Auto-generated method stub
+		return sysLogDAO.list();
+	}
+		
+	@Override
+	public Page<SysLog> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<SysLog> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            sysLogDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 91 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/UserRoleServiceImpl.java

@@ -0,0 +1,91 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+
+import com.jpsoft.excellent.modules.sys.entity.Role;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.sys.dao.UserRoleDAO;
+import com.jpsoft.excellent.modules.sys.entity.UserRole;
+import com.jpsoft.excellent.modules.sys.service.UserRoleService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="userRoleService")
+public class UserRoleServiceImpl implements UserRoleService {
+	@Resource(name="userRoleDAO")
+	private UserRoleDAO userRoleDAO;
+
+	@Override
+	public UserRole get(String id) {
+		// TODO Auto-generated method stub
+		return userRoleDAO.get(id);
+	}
+
+	@Override
+	public int insert(UserRole model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return userRoleDAO.insert(model);
+	}
+
+	@Override
+	public int update(UserRole model) {
+		// TODO Auto-generated method stub
+		return userRoleDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return userRoleDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = userRoleDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<UserRole> list() {
+		// TODO Auto-generated method stub
+		return userRoleDAO.list();
+	}
+		
+	@Override
+	public Page<UserRole> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<UserRole> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            userRoleDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public List<Role> findRoleByUserId(String userId) {
+		return userRoleDAO.findRoleByUserId(userId);
+	}
+
+	@Override
+	public List<String> findRoleNameByUserId(String userId){
+		return userRoleDAO.findRoleNameByUserId(userId);
+	}
+
+	@Override
+	public int findCountByAIdAndRName(String userId,String roleName){
+		return userRoleDAO.findCountByAIdAndRName(userId,roleName);
+	}
+
+	@Override
+	public int deleteByUserId(String userId) {
+		return userRoleDAO.deleteByUserId(userId);
+	}
+}

+ 81 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/UserServiceImpl.java

@@ -0,0 +1,81 @@
+package com.jpsoft.excellent.modules.sys.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.sys.dao.UserDAO;
+import com.jpsoft.excellent.modules.sys.entity.User;
+import com.jpsoft.excellent.modules.sys.service.UserService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="userService")
+public class UserServiceImpl implements UserService {
+	@Resource(name="userDAO")
+	private UserDAO userDAO;
+
+	@Override
+	public User get(String id) {
+		// TODO Auto-generated method stub
+		return userDAO.get(id);
+	}
+
+	@Override
+	public int insert(User model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return userDAO.insert(model);
+	}
+
+	@Override
+	public int update(User model) {
+		// TODO Auto-generated method stub
+		return userDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return userDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = userDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<User> list() {
+		// TODO Auto-generated method stub
+		return userDAO.list();
+	}
+		
+	@Override
+	public Page<User> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<User> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            userDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public User findByUserName(String userName) {
+		return userDAO.findByUserName(userName);
+	}
+
+	@Override
+	public boolean hasRole(String userId, String roleName) {
+		long count = userDAO.hasRole(userId,roleName);
+
+		return count>0;
+	}
+}

+ 29 - 0
common/src/main/java/com/jpsoft/excellent/modules/wechat/entity/AccessToken.java

@@ -0,0 +1,29 @@
+package com.jpsoft.excellent.modules.wechat.entity;
+
+import lombok.Data;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-12-11 15:29
+ */
+@Data
+public class AccessToken {
+
+    /**
+     * 获取到的凭证
+     */
+    private String token;
+    /**
+     * 凭证有效时间,单位:秒
+     */
+    private int expiresIn;
+    /**
+     * 用户唯一标识
+     */
+    private String openid;
+
+    /**
+     * 类型
+     */
+    private String scope;
+}

+ 20 - 0
common/src/main/java/com/jpsoft/excellent/modules/wechat/vo/UserInfo.java

@@ -0,0 +1,20 @@
+package com.jpsoft.excellent.modules.wechat.vo;
+
+import lombok.Data;
+
+/**
+ * 微信通用接口凭证
+ * 
+ * @author lt
+ * @date 2013-08-08
+ */
+@Data
+public class UserInfo {
+	private String openid;
+	private String nickname;
+	private String city;
+	private String country;
+	private String province;
+	private String headimgurl;
+
+}

Some files were not shown because too many files changed in this diff