Browse Source

创建项目

fllmoyu 4 years ago
commit
9c5d921c98
100 changed files with 9196 additions and 0 deletions
  1. 33 0
      .gitignore
  2. 118 0
      .mvn/wrapper/MavenWrapperDownloader.java
  3. BIN
      .mvn/wrapper/maven-wrapper.jar
  4. 2 0
      .mvn/wrapper/maven-wrapper.properties
  5. 254 0
      common/pom.xml
  6. 67 0
      common/src/main/java/com/jpsoft/bus/config/AliPayConfig.java
  7. 17 0
      common/src/main/java/com/jpsoft/bus/config/OSSConfig.java
  8. 80 0
      common/src/main/java/com/jpsoft/bus/config/WxJpsoftConfig.java
  9. 23 0
      common/src/main/java/com/jpsoft/bus/config/WxTransferConfig.java
  10. 50 0
      common/src/main/java/com/jpsoft/bus/modules/common/dto/MessageResult.java
  11. 32 0
      common/src/main/java/com/jpsoft/bus/modules/common/dto/Sort.java
  12. 79 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/AESUtil.java
  13. 95 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/BASE64DecodedMultipartFile.java
  14. 273 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/Base64.java
  15. 198 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/CheckIdCard.java
  16. 29 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/CommonUtil.java
  17. 79 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/DES3.java
  18. 423 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/HttpConnectionUtil.java
  19. 60 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/HttpUtil.java
  20. 63 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/IdCardGenerate.java
  21. 35 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/IdCardUtils.java
  22. 95 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/JwtUtil.java
  23. 24 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/MyX509TrustManager.java
  24. 140 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/NumberUtil.java
  25. 375 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/OSSUtil.java
  26. 37 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/ObjectCodec.java
  27. 61 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/ObjectSerializerUtils.java
  28. 438 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/POIUtils.java
  29. 89 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/PojoUtils.java
  30. 154 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/SMSUtil.java
  31. 70 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/Sign.java
  32. 208 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/StringUtils.java
  33. 31 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/TTSSessionUtil.java
  34. 387 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/WechatMessageUtil.java
  35. 352 0
      common/src/main/java/com/jpsoft/bus/modules/common/utils/WeixinUtil.java
  36. 32 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/DataDictionaryDAO.java
  37. 21 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/MenuDAO.java
  38. 21 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/PermissionDAO.java
  39. 19 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/RoleDAO.java
  40. 23 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/RoleMenuDAO.java
  41. 21 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/RolePermissionDAO.java
  42. 19 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/SysLogDAO.java
  43. 23 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/UserDAO.java
  44. 23 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dao/UserRoleDAO.java
  45. 24 0
      common/src/main/java/com/jpsoft/bus/modules/sys/dto/RoleRelatedDTO.java
  46. 46 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/DataDictionary.java
  47. 199 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/Menu.java
  48. 143 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/Permission.java
  49. 129 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/Role.java
  50. 129 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/RoleMenu.java
  51. 129 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/RolePermission.java
  52. 37 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/SysLog.java
  53. 191 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/User.java
  54. 129 0
      common/src/main/java/com/jpsoft/bus/modules/sys/entity/UserRole.java
  55. 27 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/DataDictionaryService.java
  56. 22 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/MenuService.java
  57. 20 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/PermissionService.java
  58. 20 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/RoleMenuService.java
  59. 22 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/RolePermissionService.java
  60. 18 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/RoleService.java
  61. 18 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/SysLogService.java
  62. 23 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/UserRoleService.java
  63. 21 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/UserService.java
  64. 126 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/DataDictionaryServiceImpl.java
  65. 84 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/MenuServiceImpl.java
  66. 75 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/PermissionServiceImpl.java
  67. 80 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/RoleMenuServiceImpl.java
  68. 80 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/RolePermissionServiceImpl.java
  69. 70 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/RoleServiceImpl.java
  70. 80 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/SysLogServiceImpl.java
  71. 86 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/UserRoleServiceImpl.java
  72. 87 0
      common/src/main/java/com/jpsoft/bus/modules/sys/service/impl/UserServiceImpl.java
  73. 20 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/dao/AccessContorlDAO.java
  74. 23 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/dao/ReplyMessageDAO.java
  75. 62 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/entity/AccessControl.java
  76. 29 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/entity/AccessToken.java
  77. 51 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/entity/ReplyMessage.java
  78. 36 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/service/IAccessControlService.java
  79. 19 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/service/ReplyMessageService.java
  80. 44 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/service/impl/AccessControlServiceImpl.java
  81. 75 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/service/impl/ReplyMessageServiceImpl.java
  82. 65 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/vo/AccessControlVo.java
  83. 15 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/vo/BindFaceVo.java
  84. 39 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/vo/BindPhoneVo.java
  85. 17 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/vo/RepairsVo.java
  86. 20 0
      common/src/main/java/com/jpsoft/bus/modules/wechat/vo/UserInfo.java
  87. 211 0
      common/src/main/resources/mapper/sys/DataDictionary.xml
  88. 143 0
      common/src/main/resources/mapper/sys/Menu.xml
  89. 108 0
      common/src/main/resources/mapper/sys/Permission.xml
  90. 93 0
      common/src/main/resources/mapper/sys/Role.xml
  91. 97 0
      common/src/main/resources/mapper/sys/RoleMenu.xml
  92. 96 0
      common/src/main/resources/mapper/sys/RolePermission.xml
  93. 115 0
      common/src/main/resources/mapper/sys/SysLog.xml
  94. 129 0
      common/src/main/resources/mapper/sys/User.xml
  95. 106 0
      common/src/main/resources/mapper/sys/UserRole.xml
  96. 310 0
      mvnw
  97. 182 0
      mvnw.cmd
  98. 92 0
      pom.xml
  99. 190 0
      web/pom.xml
  100. 21 0
      web/src/main/java/com/jpsoft/bus/SmartBusServerApplication.java

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### 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/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

+ 118 - 0
.mvn/wrapper/MavenWrapperDownloader.java

@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    private static final String WRAPPER_VERSION = "0.5.6";
+    /**
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+     */
+    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+    /**
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+     * use instead of the default one.
+     */
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+            ".mvn/wrapper/maven-wrapper.properties";
+
+    /**
+     * Path where the maven-wrapper.jar will be saved to.
+     */
+    private static final String MAVEN_WRAPPER_JAR_PATH =
+            ".mvn/wrapper/maven-wrapper.jar";
+
+    /**
+     * Name of the property which should be used to override the default download url for the wrapper.
+     */
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+    public static void main(String args[]) {
+        System.out.println("- Downloader started");
+        File baseDirectory = new File(args[0]);
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
+        // wrapperUrl parameter.
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+        String url = DEFAULT_DOWNLOAD_URL;
+        if (mavenWrapperPropertyFile.exists()) {
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
+            try {
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+                Properties mavenWrapperProperties = new Properties();
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+            } catch (IOException e) {
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+            } finally {
+                try {
+                    if (mavenWrapperPropertyFileInputStream != null) {
+                        mavenWrapperPropertyFileInputStream.close();
+                    }
+                } catch (IOException e) {
+                    // Ignore ...
+                }
+            }
+        }
+        System.out.println("- Downloading from: " + url);
+
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+        if (!outputFile.getParentFile().exists()) {
+            if (!outputFile.getParentFile().mkdirs()) {
+                System.out.println(
+                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+            }
+        }
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+        try {
+            downloadFileFromURL(url, outputFile);
+            System.out.println("Done");
+            System.exit(0);
+        } catch (Throwable e) {
+            System.out.println("- Error downloading");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+            String username = System.getenv("MVNW_USERNAME");
+            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+        }
+        URL website = new URL(urlString);
+        ReadableByteChannel rbc;
+        rbc = Channels.newChannel(website.openStream());
+        FileOutputStream fos = new FileOutputStream(destination);
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+        fos.close();
+        rbc.close();
+    }
+
+}

BIN
.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 254 - 0
common/pom.xml

@@ -0,0 +1,254 @@
+<?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>parent</artifactId>
+        <groupId>com.jpsoft.bus</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.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>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-api</artifactId>
+            <version>0.10.5</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-impl</artifactId>
+            <version>${jwts.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-jackson</artifactId>
+            <version>${jwts.version}</version>
+            <scope>runtime</scope>
+        </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 -->
+
+        <!-- aliyun live start -->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-live</artifactId>
+            <version>3.7.5</version>
+        </dependency>
+        <!-- aliyun live 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>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>
+
+        <dependency>
+            <groupId>com.github.javen205</groupId>
+            <artifactId>IJPay-All</artifactId>
+            <version>${ijpay.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alipay.sdk</groupId>
+            <artifactId>alipay-sdk-java</artifactId>
+            <version>${alipay.version}</version>
+        </dependency>
+
+        <!-- hibernate validator-->
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>5.2.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.6</version>
+        </dependency>
+    </dependencies>
+
+
+</project>

+ 67 - 0
common/src/main/java/com/jpsoft/bus/config/AliPayConfig.java

@@ -0,0 +1,67 @@
+package com.jpsoft.bus.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-11-26 9:37
+ */
+
+@Data
+@ConfigurationProperties(prefix = "alipay")
+@Component
+public class AliPayConfig {
+
+
+    /**
+     * 支付宝网关
+     */
+    private String serviceUrl;
+
+    /**
+     * 应用appid
+     */
+    private String appId;
+
+    /**
+     * 应用私钥
+     */
+    private String privateKey;
+
+    /**
+     * 支付宝公钥
+     */
+    private String zfbPublicKey;
+
+    /**
+     * 编码
+     */
+    private String inputCharset;
+
+    /**
+     * 服务商id
+     */
+    private String mchId;
+
+    /**
+     * 授权token
+     */
+    private String appAuthToken;
+
+    /**
+     * 加密方式
+     */
+    private String signType;
+
+    /**
+     * 支付回调地址
+     */
+    private String notifyUrl;
+
+    /**
+     * 商品描述
+     */
+    private String body;
+}

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

@@ -0,0 +1,17 @@
+package com.jpsoft.bus.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;
+}

+ 80 - 0
common/src/main/java/com/jpsoft/bus/config/WxJpsoftConfig.java

@@ -0,0 +1,80 @@
+package com.jpsoft.bus.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-11-26 9:35
+ */
+
+@Data
+@ConfigurationProperties(prefix = "wx.jpsoft")
+@Component
+public class WxJpsoftConfig {
+
+    /**
+     * 设置微信公众号或者小程序等的appid
+     */
+    private String appId;
+
+    /**
+     * 设置微信公众号或者小程序等的appSecret
+     */
+    private String appSecret;
+
+    /**
+     * 微信支付商户号
+     */
+    private String mchId;
+
+    /**
+     * 微信支付商户密钥
+     */
+    private String mchKey;
+
+    /**
+     * 服务商模式下的子商户公众账号ID,普通模式请不要配置,请在配置文件中将对应项删除
+     */
+    private String subAppId;
+
+    /**
+     * 服务商模式下的子商户号,普通模式请不要配置,最好是请在配置文件中将对应项删除
+     */
+    private String subMchId;
+
+    /**
+     * apiclient_cert.p12文件的绝对路径,或者如果放在项目中,请以classpath:开头指定
+     */
+    private String keyPath;
+
+    /**
+     * 回调地址
+     */
+    private String notifyUrl;
+
+    /**
+     * 退款回调
+     */
+    private String refundUrl;
+
+    /**
+     * 发起ip
+     */
+    private String ip;
+
+    /**
+     * 商品描述
+     */
+    private String body;
+
+    /**
+     * 证书地址
+     */
+    private String certPath;
+
+    private String temporaryUrl;
+
+    private String urlKey;
+}

+ 23 - 0
common/src/main/java/com/jpsoft/bus/config/WxTransferConfig.java

@@ -0,0 +1,23 @@
+package com.jpsoft.bus.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-6-1 9:07
+ */
+@Data
+@ConfigurationProperties(prefix = "wx.transfer")
+@Component
+public class WxTransferConfig {
+
+    private String mchId;
+
+    private String key;
+
+    private String certPath;
+
+    private String ip;
+}

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

@@ -0,0 +1,50 @@
+package com.jpsoft.bus.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/bus/modules/common/dto/Sort.java

@@ -0,0 +1,32 @@
+package com.jpsoft.bus.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;
+    }
+}

+ 79 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/AESUtil.java

@@ -0,0 +1,79 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import lombok.extern.slf4j.Slf4j;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import java.util.Arrays;
+
+@Slf4j
+public class AESUtil {
+    /**
+     * mysql默认取秘钥的ascii编码前16位
+     */
+    public static String MYSQL_ENC_KEY = "jpsoft8121234888";
+
+    /**
+     * AES加密字符串
+     * @param content 需要被加密的字符串
+     * @param strKey 秘钥
+     * @return 密文
+     */
+    public static String encrypt(String content, String strKey) {
+        String encStr = null;
+
+        try {
+            byte[] keyBytes = Arrays.copyOf(strKey.getBytes("ASCII"), 16);
+
+            SecretKey key = new SecretKeySpec(keyBytes, "AES");
+            Cipher cipher = Cipher.getInstance("AES");
+            cipher.init(Cipher.ENCRYPT_MODE, key);
+
+            byte[] data = content.getBytes("UTF-8");
+            byte[] encBytes = cipher.doFinal(data);
+
+            encStr = Base64.encode(encBytes);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+        }
+
+        return encStr;
+    }
+
+    /**
+     * 解密AES加密过的字符串
+     * @param encStr AES加密过过的内容
+     * @param strKey 秘钥
+     * @return 明文
+     */
+    public static String decrypt(String encStr, String strKey) {
+        String plainText = "";
+
+        try {
+            byte[] keyBytes = Arrays.copyOf(strKey.getBytes("ASCII"), 16);
+
+            SecretKey key = new SecretKeySpec(keyBytes, "AES");
+            Cipher cipher = Cipher.getInstance("AES");
+
+            cipher.init(Cipher.DECRYPT_MODE, key);// 初始化为解密模式的密码器
+
+            byte[] data = Base64.decode(encStr);
+            byte[] result = cipher.doFinal(data);
+
+            plainText = new String(result,"UTF-8");
+        } catch (Exception ex) {
+            log.error(encStr + "," + ex.getMessage());
+        }
+
+        return plainText;
+    }
+
+    public static void main(String[] args) {
+        String encStr = AESUtil.encrypt("421002198311131816",AESUtil.MYSQL_ENC_KEY);
+        System.out.println(encStr);
+
+        String plainText = AESUtil.decrypt(encStr,AESUtil.MYSQL_ENC_KEY);
+        System.out.println(plainText);
+    }
+}

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

@@ -0,0 +1,95 @@
+package com.jpsoft.bus.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;
+        }
+    }
+
+
+}

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

@@ -0,0 +1,273 @@
+package com.jpsoft.bus.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/bus/modules/common/utils/CheckIdCard.java

@@ -0,0 +1,198 @@
+package com.jpsoft.bus.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();
+	}
+}

+ 29 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/CommonUtil.java

@@ -0,0 +1,29 @@
+package com.jpsoft.bus.modules.common.utils;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-8-4 17:17
+ */
+public class CommonUtil {
+
+    public static String getGoodTypeName(String type){
+        String goodTypeName ="";
+       if ("1".equals(type)){
+           goodTypeName = "校车服务";
+       }
+       if ("2".equals(type)){
+           goodTypeName = "学平险";
+       }
+       if ("3".equals(type)){
+           goodTypeName = "虹膜";
+       }
+       if ("4".equals(type)){
+           goodTypeName = "人工智能";
+       }
+       if ("5".equals(type)){
+           goodTypeName = "移动充值";
+       }
+
+        return goodTypeName;
+    }
+}

+ 79 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/DES3.java

@@ -0,0 +1,79 @@
+package com.jpsoft.bus.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 = "WJgLLiAktNj/vCNEoz6mfAmE0btwluCTk/TnJiZOIkQ=";
+
+		try {
+            System.out.println(des3.encrypt("zq1983","123456"));
+//			System.out.println(des3.decrypt(appKey,"x4QGmJs1iRMoR61/E25QrFynwAspKvBP"));
+//            System.out.println(Base64.encode("421002198311131816".getBytes("UTF-8")));
+			//System.out.println(des3.decrypt(appKey, "Xkb9FDXbmw8tEybl2ItjvomEK0QrL+pn6wt9yO7/vA7G9jIUiDhFLg=="));
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+}

+ 423 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/HttpConnectionUtil.java

@@ -0,0 +1,423 @@
+package com.jpsoft.bus.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 "";
+
+	}
+
+	public static InputStream downloadStream(String requestUrl){
+		InputStream inputStream = null;
+
+		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);
+			httpUrlConn.setRequestMethod("GET");
+			httpUrlConn.connect();
+
+			inputStream = httpUrlConn.getInputStream();
+		}
+		catch (Exception ex){
+			System.out.println(ex.getMessage());
+		}
+
+		return inputStream;
+	}
+
+	/**
+	 * 发起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);
+			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();
+
+			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;
+	}
+}

+ 60 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/HttpUtil.java

@@ -0,0 +1,60 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import lombok.extern.slf4j.Slf4j;
+
+import javax.servlet.http.HttpServletRequest;
+
+@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;
+    }
+}

+ 63 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/IdCardGenerate.java

@@ -0,0 +1,63 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+public class IdCardGenerate {
+    private static final int[] calcC = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };
+    private static final char[] calcR = { '1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2' };
+
+    private static char calcTrailingNumber(StringBuilder sb) {
+        int[] n = new int[17];
+        int result = 0;
+
+        for (int i = 0; i < n.length; i++) {
+            n[i] = Integer.parseInt(String.valueOf(sb.charAt(i)));
+        }
+
+        for (int i = 0; i < n.length; i++) {
+            result += calcC[i] * n[i];
+        }
+
+        return calcR[result % 11];
+    }
+
+    public static String generate(String prefix){
+        StringBuilder idCard = new StringBuilder();
+
+        //如88XXXX
+        //  421002 19831113 1816
+        idCard.append(prefix);
+        Date now = new Date();
+        SimpleDateFormat sdf1 = new SimpleDateFormat("HHmm");
+        idCard.append(sdf1.format(now));
+
+        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMdd");
+        idCard.append(sdf2.format(now));
+
+        SimpleDateFormat sdf3 = new SimpleDateFormat("ss");
+        idCard.append(sdf3.format(now));
+
+        Random rnd = new Random();
+        idCard.append(rnd.nextInt(10));
+
+        char num = calcTrailingNumber(idCard);
+
+        idCard.append(num);
+
+        return idCard.toString();
+    }
+
+    public static void main(String[] args){
+        String idCard = IdCardGenerate.generate("88");
+
+        CheckIdCard cic = new CheckIdCard(idCard);
+
+        if (cic.validate()){
+            System.out.println("身份证通过验证!");
+        }
+
+        System.out.println(idCard);
+    }
+}

+ 35 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/IdCardUtils.java

@@ -0,0 +1,35 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+@Slf4j
+public class IdCardUtils {
+    public static String decrypt(String idCard){
+        String data = idCard;
+
+        if (StringUtils.isNotBlank(idCard) && idCard.length() > 18) {
+            try {
+                data = AESUtil.decrypt(idCard,AESUtil.MYSQL_ENC_KEY);
+            } catch (Exception ex) {
+               log.error(ex.getMessage(),ex);
+            }
+        }
+
+        return data;
+    }
+
+    public static String encrypt(String idCard) {
+        String result = idCard;
+
+        try {
+            if(StringUtils.isNotBlank(idCard) && idCard.length()<=18){
+                result = AESUtil.encrypt(idCard.trim(),AESUtil.MYSQL_ENC_KEY);
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+        }
+
+        return result;
+    }
+}

+ 95 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/JwtUtil.java

@@ -0,0 +1,95 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.security.Keys;
+
+import java.security.Key;
+import java.util.Base64;
+import java.util.Date;
+
+
+public class JwtUtil {
+    public static String createToken(String jwtSecret, String subject, Date expiration) {
+        //token有效时间天
+        byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+        Key key = Keys.hmacShaKeyFor(privateKey);
+
+        String token = Jwts.builder()
+                    .setSubject(subject)
+                //设置自定义claims后,setSubject值将失效
+//               .setClaims(extraInfo)
+                    .signWith(key)
+                    .setExpiration(expiration)
+                    .compact();
+
+        return "Bearer " + token;
+    }
+
+    public static String decodeToken(String jwtSecret,String token) throws Exception{
+        String prefix = "Bearer ";
+
+        if (token==null || token.length() < prefix.length()){
+            throw new Exception("未传递令牌或未带前缀Bearer!");
+        }
+
+        token = token.substring(prefix.length());
+
+        byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+        Key key = Keys.hmacShaKeyFor(privateKey);
+
+        Claims claims = Jwts.parser()
+                .setSigningKey(key)
+                .parseClaimsJws(token)
+                .getBody();
+
+        String subject = claims.getSubject();
+
+        return subject;
+    }
+
+    public static String decodeVerifyToken(String jwtSecret,String token) throws Exception{
+        String prefix = "Bearer ";
+
+        if (token==null || token.length() < prefix.length()){
+            throw new Exception("未传递令牌或未带前缀Bearer!");
+        }
+
+        try{
+            token = token.substring(prefix.length());
+
+            byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+            Key key = Keys.hmacShaKeyFor(privateKey);
+
+            Claims claims = Jwts.parser()
+                    .setSigningKey(key)
+                    .parseClaimsJws(token)
+                    .getBody();
+
+            String subject = claims.getSubject();
+
+            return subject;
+        }catch (Exception e){
+            throw new Exception("二维码已过期!");
+        }
+
+    }
+
+    public static void main(String[] args) {
+        try {
+            String jwtSecret = "WJgLLiAktNj/vCNEoz6mfAmE0btwluCTk/TnJiZOIkQ=";
+//            String encJwtSecret = Base64.getEncoder().encodeToString(jwtSecret.getBytes("UTF-8"));
+
+//            String token = JwtUtil.createToken(encJwtSecret, "123456", DateTime.now().plusDays(1).toDate());
+            String plainText = JwtUtil.decodeToken(jwtSecret, "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzIiwiZXhwIjoxNTk4NjA5MDg5fQ.N4TYVSMlgOMb8xIHHuTnsQzjXRCKyLgdbdYG7PImf1c");
+
+            System.out.println(plainText);
+        }
+        catch (Exception ex){
+            ex.printStackTrace();
+        }
+    }
+}

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

@@ -0,0 +1,24 @@
+package com.jpsoft.bus.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;
+	}
+}

+ 140 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/NumberUtil.java

@@ -0,0 +1,140 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.text.DecimalFormat;
+
+
+public class NumberUtil {
+    public static String ToChinese(int Number){
+        String ans="";
+        String source=String.valueOf(Number);
+
+        return ans;
+    }
+
+    public static String ToBig(int num){
+        String str[]={"壹","贰","叁","肆","伍","陆","柒","捌","玖","十"};
+        return str[num-1];
+    }
+
+    public static String Test2(double x){
+        DecimalFormat format = new DecimalFormat("#.00");
+        String str = format.format(x);
+        System.out.println(str);
+        String s[]=str.split("\\.");
+        String temp="";
+        int ling=0;
+        int shu=0;
+        int pos=0;
+        for(int j=0;j<s[0].length();++j){
+            int num=s[0].charAt(j)-'0';
+            if(num==0){
+                ling++;
+                if(ling==s[0].length()){
+                    temp="零";
+                }
+                else if(s[0].length()-j-1==4){
+                    if(shu==1&&(s[0].length()-pos-1)>=5&&(s[0].length()-pos-1)<=7){
+                        temp+="万";
+                    }
+                }
+                else if(s[0].length()-j-1==8){
+                    if(shu==1&&(s[0].length()-pos-1)>=9&&(s[0].length()-pos-1)<=11){
+                        temp+="亿";
+                    }
+                }
+            }
+            else{
+                shu++;
+                int flag=0;
+                if(shu==1){
+                    ling=0;
+                    pos=j;
+                }
+                if(shu==2){
+                    flag=1;
+                    if(ling>0){
+                        temp+="零";
+                    }
+                    shu=1;
+                    pos=j;
+                    ling=0;
+                }
+                if(s[0].length()-j-1==11){
+                    temp+=ToBig(num)+"千";
+                }
+                else if(s[0].length()-j-1==10){
+                    temp+=ToBig(num)+"百";
+                }
+                else if(s[0].length()-j-1==9){
+                    if(num==1&&flag!=1)
+                        temp+="十";
+                    else
+                        temp+=ToBig(num)+"十";
+                }
+                else if(s[0].length()-j-1==8){
+                    temp+=ToBig(num)+"亿";
+                }
+                else if(s[0].length()-j-1==7){
+                    temp+=ToBig(num)+"千";
+                }
+                else if(s[0].length()-j-1==6){
+                    temp+=ToBig(num)+"百";
+                }
+                else if(s[0].length()-j-1==5){
+                    if(num==1&&flag!=1)
+                        temp+="十";
+                    else
+                        temp+=ToBig(num)+"十";
+                }
+                else if(s[0].length()-j-1==4){
+                    temp+=ToBig(num)+"万";
+                }
+                else if(s[0].length()-j-1==3){
+                    temp+=ToBig(num)+"千";
+                }
+                else if(s[0].length()-j-1==2){
+                    temp+=ToBig(num)+"百";
+                }
+                else if(s[0].length()-j-1==1){
+                    if(num==1&&flag!=1)
+                        temp+="十";
+                    else
+                        temp+=ToBig(num)+"十";
+                }
+                else{
+                    temp+=ToBig(num);
+                }
+            }
+//            System.out.println(temp);
+        }
+
+        if(StringUtils.isBlank(temp)) {
+        	temp = "零";
+        }
+
+        temp+="元";
+        for(int j=0;j<s[1].length();++j){
+            int num=s[1].charAt(j)-'0';
+            if(j==0){
+                if(num!=0)
+                temp+=ToBig(num)+"角";
+                else if(num==0&&1<s[1].length()&&s[1].charAt(1)!='0'){
+                    temp+="零";
+                }
+            }
+            else if(j==1){
+                if(num!=0)
+                temp+=ToBig(num)+"分";
+            }
+        }
+        System.out.println(temp);
+        return temp;
+}
+    public static void main(String[] args) {
+
+        Test2(0.01);
+    }
+
+}

+ 375 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/OSSUtil.java

@@ -0,0 +1,375 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import cn.hutool.core.codec.Base64Encoder;
+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.bus.config.OSSConfig;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+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.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) {
+        Date now = new Date();
+
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(now);
+
+        String savePath = ossConfig.getObjectPre();
+
+        if (!subFolder.startsWith("/")) {
+            savePath += "/";
+        }
+
+        savePath += subFolder;
+
+        //增加一级uuid目录
+        savePath += "/" + cal.get(Calendar.YEAR)
+                + "/" + (cal.get(Calendar.MONTH) + 1)
+                + "/" + cal.get(Calendar.DAY_OF_MONTH)
+                + "/" + UUID.randomUUID().toString() + "/";
+
+        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 newFileName = UUID.randomUUID().toString() + ext;
+
+        String retFileUrl = savePath + fileName;
+
+        int fileLen = 0;
+
+        try{
+            fileLen = fileInputStream.available();
+        }
+        catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+        }
+
+        log.warn("上传地址:{},上传文件大小:{}", retFileUrl, fileLen);
+
+        // 上传文件流
+        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 = "";
+
+        //endpoint: http://oss-cn-hangzhou.aliyuncs.com
+        //bucketName: rccs
+        String ossPrefix = "http://" + ossConfig.getBucketName() + "." + ossConfig.getEndpoint().substring(7);
+
+        if (filePath.startsWith(ossPrefix)) {
+            key = filePath.substring(ossPrefix.length());
+        }
+        else if (filePath.startsWith(ossConfig.getUrlPrefix())) {
+            key = filePath.substring(ossConfig.getUrlPrefix().length());
+        }
+
+        if (key.startsWith("/")) {
+            key = key.substring(1);
+        }
+
+        if (StringUtils.isEmpty(filePath)){
+            log.error("{}前缀不正确", filePath);
+            return false;
+        }
+
+        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 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();
+                }
+            }
+        }
+    }
+}

+ 37 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/ObjectCodec.java

@@ -0,0 +1,37 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.handler.codec.MessageToMessageCodec;
+
+import java.util.List;
+
+/**
+ */
+public class ObjectCodec extends MessageToMessageCodec<ByteBuf, Object> {
+
+    @Override
+    protected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception {
+        //byte[] data = ObjectSerializerUtils.serilizer(msg);
+        byte[] data = msg.toString().getBytes("GBK");
+
+        ByteBuf buf = Unpooled.buffer();
+        buf.writeBytes(data);
+        out.add(buf);
+    	//out.add(msg);
+    }
+
+    @Override
+    protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) {
+
+        byte[] bytes = new byte[msg.readableBytes()];
+
+        msg.readBytes(bytes);
+
+        byte[] data = ObjectSerializerUtils.serilizer(new String(bytes));
+
+        Object deSerilizer = ObjectSerializerUtils.deSerilizer(data);
+        out.add(deSerilizer);
+    }
+}

+ 61 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/ObjectSerializerUtils.java

@@ -0,0 +1,61 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.*;
+
+/**
+ * 对象序列化工具
+ */
+public class ObjectSerializerUtils {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(ObjectSerializerUtils.class);
+
+    /**
+     * 反序列化
+     *
+     * @param data
+     * @return
+     */
+    public static Object deSerilizer(byte[] data) {
+        if (data != null && data.length > 0) {
+            try {
+                ByteArrayInputStream bis = new ByteArrayInputStream(data);
+                ObjectInputStream ois = new ObjectInputStream(bis);
+                return ois.readObject();
+            } catch (Exception e) {
+                LOGGER.info("[异常信息] {}", e.getMessage());
+                e.printStackTrace();
+            }
+            return null;
+        } else {
+            LOGGER.info("[反序列化] 入参为空");
+            return null;
+        }
+    }
+
+    /**
+     * 序列化对象
+     *
+     * @param obj
+     * @return
+     */
+    public static byte[] serilizer(Object obj) {
+        if (obj != null) {
+            try {
+                ByteArrayOutputStream bos = new ByteArrayOutputStream();
+                ObjectOutputStream oos = new ObjectOutputStream(bos);
+                oos.writeObject(obj);
+                oos.flush();
+                oos.close();
+                return bos.toByteArray();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            return null;
+        } else {
+            return null;
+        }
+    }
+}

+ 438 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/POIUtils.java

@@ -0,0 +1,438 @@
+package com.jpsoft.bus.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);
+
+        if (row!=null) {
+            Cell cell = row.getCell(colIndex, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+            return getCellValue(cell);
+        }
+        else{
+            return null;
+        }
+    }
+
+    /**
+     * 获取列的数据信息
+     *
+     * @param cell
+     * @return
+     */
+    private Object getCellValue(Cell cell) {
+        Object cellValue = null;
+
+        if (cell==null){
+            return 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;
+    }
+}

+ 89 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/PojoUtils.java

@@ -0,0 +1,89 @@
+package com.jpsoft.bus.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 org.springframework.beans.BeanUtils;
+
+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);
+
+        //性能更好
+        BeanUtils.copyProperties(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;
+    }
+}

+ 154 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/SMSUtil.java

@@ -0,0 +1,154 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import com.jpsoft.bus.modules.common.dto.MessageResult;
+import com.taobao.api.ApiException;
+import com.taobao.api.DefaultTaobaoClient;
+import com.taobao.api.TaobaoClient;
+import com.taobao.api.request.AlibabaAliqinFcSmsNumSendRequest;
+import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse;
+import net.sf.json.JSONException;
+import net.sf.json.JSONObject;
+
+import java.util.Random;
+
+
+public class SMSUtil {
+
+	public final static String REG_TEMPLATE_CODE = "SMS_49390047";
+	public static final String NUMBERCHAR = "0123456789";
+	private final static String APP_KEY = "24698874";
+	private final static String APP_SECRET = "5f5b21d1dc93e124aa803f95d71c00b8";
+	private final static String APP_URL = "https://eco.taobao.com/router/rest";
+	private final static String SIGN_NAME = "校信达";
+	private final static String SMS_TYPE = "normal";
+
+	/**
+	 *
+	 * @param phones 手机号,多个以英文逗号","隔开
+	 * @param smsTemplateCode 短信模版ID
+	 * @param jsonStr 短信模板变量,传参规则{"key":"value"},key的名字须和申请模板中的变量名一致,多个变量之间以逗号隔开。示例:针对模板“验证码${code},您正在进行${product}身份验证,打死不要告诉别人哦!”,传参时需传入{"code":"1234","product":"alidayu"}
+	 * @return
+	 */
+	public static MessageResult send(String phones, String smsTemplateCode, String jsonStr){
+
+		boolean success = true;
+		String msg = "发送成功";
+
+		TaobaoClient client = new DefaultTaobaoClient(APP_URL, APP_KEY, APP_SECRET);
+		AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
+		req.setSmsType(SMS_TYPE);
+		req.setSmsFreeSignName(SIGN_NAME);
+		if(jsonStr != null){
+			req.setSmsParamString(jsonStr);
+		}
+		req.setRecNum(phones);
+		req.setSmsTemplateCode(smsTemplateCode);
+		AlibabaAliqinFcSmsNumSendResponse rsp;
+		try {
+			rsp = client.execute(req);
+
+			JSONObject ret = JSONObject.fromObject(rsp.getBody());
+
+			System.out.println("ret>>>>" + ret);
+
+			if(ret.containsKey("error_response")){
+				success = false;
+				msg = ret.getJSONObject("error_response").getString("sub_msg");
+			}else if(ret.containsKey("alibaba_aliqin_fc_sms_num_send_response")){
+
+				JSONObject result = ret.getJSONObject("alibaba_aliqin_fc_sms_num_send_response").getJSONObject("result");
+
+				if(!result.getBoolean("success")){
+					msg = result.getString("msg");
+				}
+			}else{
+				success = false;
+				msg = ret.toString();
+			}
+		} catch (ApiException e) {
+			success = false;
+			msg = e.getErrMsg();
+		} catch (JSONException ex) {
+			success = false;
+			msg = ex.getMessage();
+		}
+
+		MessageResult retMessage = new MessageResult();
+
+		retMessage.setMessage(msg);
+		retMessage.setResult(success);
+
+		return retMessage;
+	}
+
+	/**
+	 *
+	 * @param phones 手机号,多个以英文逗号","隔开
+	 * @param signName 签名:目前仅支持"荆鹏云平台","速乐购"两种签名
+	 * @param smsTemplateCode 短信模版ID
+	 * @param json 短信模板变量,传参规则{"key":"value"},key的名字须和申请模板中的变量名一致,多个变量之间以逗号隔开。示例:针对模板“验证码${code},您正在进行${product}身份验证,打死不要告诉别人哦!”,传参时需传入{"code":"1234","product":"alidayu"}
+	 * @return
+	 */
+	public static MessageResult send(String phones, String signName, String smsTemplateCode, JSONObject json){
+
+		boolean success = true;
+		String msg = "发送成功";
+
+		TaobaoClient client = new DefaultTaobaoClient(APP_URL, APP_KEY, APP_SECRET);
+		AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
+		req.setSmsType(SMS_TYPE);
+		req.setSmsFreeSignName(signName);
+		if(json != null){
+			req.setSmsParamString(json.toString());
+		}
+		req.setRecNum(phones);
+		req.setSmsTemplateCode(smsTemplateCode);
+		AlibabaAliqinFcSmsNumSendResponse rsp;
+		try {
+			rsp = client.execute(req);
+
+			JSONObject ret = JSONObject.fromObject(rsp.getBody());
+
+			System.out.println("ret>>>>" + ret);
+
+			if(ret.containsKey("error_response")){
+				success = false;
+				msg = ret.getJSONObject("error_response").getString("sub_msg");
+			}else if(ret.containsKey("alibaba_aliqin_fc_sms_num_send_response")){
+
+				JSONObject result = ret.getJSONObject("alibaba_aliqin_fc_sms_num_send_response").getJSONObject("result");
+
+				if(!result.getBoolean("success")){
+					msg = result.getString("msg");
+				}
+			}else{
+				success = false;
+				msg = ret.toString();
+			}
+		} catch (ApiException e) {
+			success = false;
+			msg = e.getErrMsg();
+		} catch (JSONException ex) {
+			success = false;
+			msg = ex.getMessage();
+		}
+
+		MessageResult retMessage = new MessageResult();
+
+		retMessage.setMessage(msg);
+		retMessage.setResult(success);
+
+		return retMessage;
+	}
+
+
+
+	public static String generateNumberString(int length) {
+		StringBuffer sb = new StringBuffer();
+		Random random = new Random();
+		for (int i = 0; i < length; i++) {
+			sb.append(NUMBERCHAR.charAt(random.nextInt(NUMBERCHAR.length())));
+		}
+		return sb.toString();
+	}
+}

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

@@ -0,0 +1,70 @@
+package com.jpsoft.bus.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);
+    }
+}

+ 208 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/StringUtils.java

@@ -0,0 +1,208 @@
+package com.jpsoft.bus.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;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 字符串工具类,继承lang3字符串工具类
+ * @author L.com
+ */
+public final class StringUtils extends org.apache.commons.lang3.StringUtils {
+
+	private static final double PI = 3.14159265;
+	private static final double EARTH_RADIUS = 6378137;    //赤道半径
+	private static final double RAD = Math.PI / 180.0;
+
+
+	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 getApplicationNo() {
+		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 = "W"+key +ran.toString();
+		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);
+	}
+
+	/**
+	 * 判断是否手机号
+	 * @param phone
+	 * @return
+	 */
+	public static boolean isMobilePhone(String phone) {
+		boolean flag=true;
+		String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[1,8,9]))\\d{8}$";
+		if (phone.length() != 11) {
+			flag= false;
+		} else {
+			Pattern p = Pattern.compile(regex);
+			Matcher m = p.matcher(phone);
+			flag = m.matches();
+		}
+
+		return flag;
+	}
+
+	public static double getDistance(double lng1, double lat1, double lng2, double lat2)
+	{
+		double radLat1 = lat1*RAD;
+		double radLat2 = lat2*RAD;
+		double a = radLat1 - radLat2;
+		double b = (lng1 - lng2)*RAD;
+		double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) +
+				Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));
+		s = s * EARTH_RADIUS;
+		s = Math.round(s * 10000) / 10000;
+		return s;
+	}
+
+	public static String strValue(Object object,String defaultValue) {
+		if (object!=null){
+			return String.valueOf(object);
+		}
+		else{
+			return defaultValue;
+		}
+	}
+
+
+	public static void main(String[] args) {
+		System.out.println(random(32, RandomType.ALL));
+	}
+}

+ 31 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/TTSSessionUtil.java

@@ -0,0 +1,31 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import io.netty.channel.Channel;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class TTSSessionUtil {
+    private static final Map<String, Channel> activeChannelMap = new ConcurrentHashMap<>();
+
+    public static void put(String deviceNo, Channel channel) {
+        activeChannelMap.put(deviceNo, channel);
+    }
+
+    public static Channel get(String deviceNo) {
+        return activeChannelMap.get(deviceNo);
+    }
+
+    public static boolean containsKey(String deviceNo) {
+        return activeChannelMap.containsKey(deviceNo);
+    }
+
+    public static void remove(String deviceNo) {
+        activeChannelMap.remove(deviceNo);
+    }
+
+    public static Set<String> keySet(){
+        return activeChannelMap.keySet();
+    }
+}

+ 387 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/WechatMessageUtil.java

@@ -0,0 +1,387 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import cn.hutool.core.date.DateUtil;
+import com.jpsoft.bus.modules.wechat.entity.AccessToken;
+import lombok.extern.slf4j.Slf4j;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.math.BigDecimal;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+@Slf4j
+@Component
+public class WechatMessageUtil {
+
+    @Autowired
+    private WeixinUtil weixinUtil;
+
+    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  boolean sendTemplate(JSONObject sendData, String appId, String appSecret, String templateId, String openId, String url) {
+        boolean result = false;
+
+        AccessToken accessToken = weixinUtil.getCommonAccessToken(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 String sendNativeTemplate(String appId, String appSecret, String templateId, String openId, JSONObject sendData, String urlPath) {
+        String result = "";
+
+        try {
+            AccessToken accessToken = weixinUtil.getCommonAccessToken(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;
+    }
+
+    /**
+     * 老师退回学生发送模板消息
+     *
+     * @param openId
+     * @param teacherName
+     * @param appId
+     * @param appSecret
+     * @return
+     */
+    public  boolean sendReturnExamineStudent(String openId, String teacherName, String reason, String appId, String appSecret) {
+
+
+        String templateId = "MKELH20mSQHRKlvD9FbQPizzEI7jNV-9Gv5OsB6WOc8";
+        JSONObject sendData = new JSONObject();
+
+		JSONObject first = new JSONObject();
+		first.put("value", "申请处理提醒!");
+		first.put("color", "#FF0000");
+
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm"));
+        keyword1.put("color", "#173177");
+
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", teacherName);
+        keyword2.put("color", "#173177");
+
+        //	String remarkStr = "发现有一例体温异常情况,点击查看详情";
+		JSONObject remark = new JSONObject();
+		remark.put("value", reason);
+		remark.put("color", "#173177");
+
+        sendData.put("first", first);
+        sendData.put("keyword1", keyword1);
+        sendData.put("keyword2", keyword2);
+        sendData.put("remark", remark);
+
+
+        boolean ret = sendTemplate(sendData, appId, appSecret, templateId, openId, "");
+
+        return ret;
+    }
+
+    /**
+     * 学平险发送模板消息
+     * @param openId
+     * @param detail 首行内容
+     * @param policyNo 保单号
+     * @param insuredName 被保人
+     * @param insurance 保险方案
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @param appId
+     * @param appSecret
+     * @return
+     */
+    public  boolean sendInsuranceMessage(String openId, String detail, String policyNo, String insuredName,String insurance,String startTime,String endTime,String reason ,String url,String appId, String appSecret) {
+
+
+        String templateId = "2mmM4l5Xh1ViB112EvkWkhJj8k7HQLtXxTeCqWr8vBA";
+        JSONObject sendData = new JSONObject();
+
+        JSONObject first = new JSONObject();
+        first.put("value", detail);
+        first.put("color", "#FF0000");
+
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", policyNo);
+        keyword1.put("color", "#173177");
+
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", insuredName);
+        keyword2.put("color", "#173177");
+
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", insurance);
+        keyword3.put("color", "#173177");
+
+        JSONObject keyword4 = new JSONObject();
+        keyword4.put("value", startTime);
+        keyword4.put("color", "#173177");
+
+        JSONObject keyword5 = new JSONObject();
+        keyword5.put("value", endTime);
+        keyword5.put("color", "#173177");
+
+        //	String remarkStr = "前往签字";
+        JSONObject remark = new JSONObject();
+        remark.put("value", reason);
+        remark.put("color", "#ed1414");
+
+        sendData.put("first", first);
+        sendData.put("keyword1", keyword1);
+        sendData.put("keyword2", keyword2);
+        sendData.put("keyword3", keyword3);
+        sendData.put("keyword4", keyword4);
+        sendData.put("keyword5", keyword5);
+        sendData.put("remark", remark);
+
+
+        boolean ret = sendTemplate(sendData, appId, appSecret, templateId, openId, url);
+
+        return ret;
+    }
+
+    /**
+     * vip移动充值模板消息
+     * @param openId
+     * @param detail 首行内容
+     * @param appId
+     * @param appSecret
+     * @return
+     */
+    public  boolean sendVipMoveMessage(String openId, String detail, String payPersonName, String result,String reason ,String url,String appId, String appSecret) {
+
+
+        String templateId = "9SsNV33hxxtlJuTYN4jo2toIkrxFJSKyf4KZ-g2Z6Io";
+        JSONObject sendData = new JSONObject();
+
+        JSONObject first = new JSONObject();
+        first.put("value", detail);
+        first.put("color", "#FF0000");
+
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", payPersonName);
+        keyword1.put("color", "#173177");
+
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", result);
+        keyword2.put("color", "#173177");
+
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", DateUtil.format(new Date(),"yyyy年MM月dd日"));
+        keyword3.put("color", "#173177");
+
+        JSONObject remark = new JSONObject();
+        remark.put("value", reason);
+        remark.put("color", "#ed1414");
+
+        sendData.put("first", first);
+        sendData.put("keyword1", keyword1);
+        sendData.put("keyword2", keyword2);
+        sendData.put("keyword3", keyword3);
+        sendData.put("remark", remark);
+
+
+        boolean ret = sendTemplate(sendData, appId, appSecret, templateId, openId, url);
+
+        return ret;
+    }
+
+    /**
+     *
+     * @param schoolName
+     * @param studentName
+     * @param amount
+     * @param openId
+     * @param createTime
+     * @return
+     */
+    public  boolean sendOrderInfo(String name,String orderRemark,String schoolName,String studentName,BigDecimal amount,String openId,Date createTime,String url,String appId, String appSecret) {
+
+
+        String templateId = "EtUairBxzoipyp8xMEVjctnDKGCfU4v5PxjSGUGNH2E";
+        JSONObject sendData = new JSONObject();
+
+        JSONObject first = new JSONObject();
+        first.put("value", "您有一个新的订单,点击查看详情!");
+        first.put("color", "#FF0000");
+
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", name);
+        keyword1.put("color", "#173177");
+
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", studentName);
+        keyword2.put("color", "#173177");
+
+        JSONObject keyword3 = new JSONObject();
+
+        keyword3.put("value", "¥" + amount.setScale(2) + "元");
+        keyword3.put("color", "#173177");
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+        JSONObject keyword4 = new JSONObject();
+        keyword4.put("value", sdf.format(createTime));
+        keyword4.put("color", "#173177");
+
+       /* String remarkStr = "账单来源:" + schoolName;
+
+        if(StringUtils.isNotBlank(billRemark)){
+            remarkStr = remarkStr + ",备注:"+ billRemark +"";
+        }
+*/
+        JSONObject remark = new JSONObject();
+        remark.put("value", orderRemark);
+        remark.put("color", "#173177");
+
+        sendData.put("first", first);
+        sendData.put("keyword1", keyword1);
+        sendData.put("keyword2", keyword2);
+        sendData.put("keyword3", keyword3);
+        sendData.put("keyword4", keyword4);
+        sendData.put("remark", remark);
+
+        boolean ret = false;
+        try{
+            //w8Zk_VQMFIEVSIBPZid7zSrvHmBdrgnqF76u8PLCZEs cs
+             ret = sendTemplate(sendData, appId, appSecret, templateId, openId, url);
+
+        }catch (Exception ex){
+
+        }
+
+        return ret;
+    }
+
+
+    public static void main(String[] args) {
+
+
+    }
+
+
+}

+ 352 - 0
common/src/main/java/com/jpsoft/bus/modules/common/utils/WeixinUtil.java

@@ -0,0 +1,352 @@
+package com.jpsoft.bus.modules.common.utils;
+
+import cn.hutool.core.date.DateTime;
+import com.jpsoft.bus.modules.wechat.entity.AccessToken;
+import com.jpsoft.bus.modules.wechat.vo.UserInfo;
+import lombok.extern.slf4j.Slf4j;
+import net.sf.json.JSONArray;
+import net.sf.json.JSONException;
+import net.sf.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Component;
+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
+ */
+@Slf4j
+@Component
+public class WeixinUtil {
+
+  /*  @Autowired
+    private RedisServiceImpl redisService;*/
+
+    //通用token,不同站点中相互刷新会导致冲突,因此要统一管理
+    @Value("${wx.commonAccessTokenUrl}")
+    private String commonAccessTokenUrl;
+
+    //获取微信的code
+    public String authCodeUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect";
+
+    //通过code换取网页授权access_token
+    public String webAccessTokenUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
+
+    //js访问token
+    public String jsAccessTokenUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi";
+
+    // 获取用户信息
+    public String user_info_url = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";
+
+    public String subscribe_user_info_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN ";
+
+    public 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 = authCodeUrl.replace("APPID", appid).replace("REDIRECT_URI", url_encode).replace("SCOPE", scope);
+        return result;
+    }
+
+    public AccessToken getWebAccessToken(String appid, String appsecret, String code) throws Exception {
+        AccessToken accessToken = null;
+        String formatUrl = webAccessTokenUrl.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  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失败
+                if (json.getInt("errcode") == 40001){
+
+                //    valueOperations.get
+                 //   redisService.remove("wxAccessToken","accessToken");
+                }
+                log.error("获取jsAPI失败,返回结果result={}", json);
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * 获取access_token
+     *
+     * @param appid     凭证
+     * @param appsecret 密钥
+     * @return
+     */
+    public AccessToken getCommonAccessToken(String appid, String appsecret) {
+        AccessToken accessToken = null;
+
+        if (accessToken == null) {
+            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"));
+                } catch (JSONException e) {
+                    accessToken = null;
+                    // 获取token失败
+                    log.error("获取token失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
+                }
+            }
+        }
+
+        return accessToken;
+    }
+
+    public 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 appid, String appSecret) {
+     //   AccessToken token = WeixinUtil.getCommonAccessToken(appid, appSecret);
+
+        AccessToken token = new AccessToken();
+        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;
+
+    }
+
+    public static void main(String[] args) {
+        System.out.println("//");
+    }
+}

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

@@ -0,0 +1,32 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.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();
+	String findParentId(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 findOneByCatalogNameAndValue(String catalogName, String value);
+
+	DataDictionary findByName(String name);
+}

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

@@ -0,0 +1,21 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.Menu;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@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/bus/modules/sys/dao/PermissionDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.Permission;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@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);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/dao/RoleDAO.java

@@ -0,0 +1,19 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.Role;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@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);
+}

+ 23 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/dao/RoleMenuDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.RoleMenu;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@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);
+}

+ 21 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/dao/RolePermissionDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.RolePermission;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@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/bus/modules/sys/dao/SysLogDAO.java

@@ -0,0 +1,19 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.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);
+}

+ 23 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/dao/UserDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.User;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@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> findByRoleName(String roleName);
+	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);
+}

+ 23 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/dao/UserRoleDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.bus.modules.sys.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.Role;
+import com.jpsoft.bus.modules.sys.entity.UserRole;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@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);
+	int deleteByUserId(String userId);
+    int existByRoleName(String userId, String roleName);
+}

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

@@ -0,0 +1,24 @@
+package com.jpsoft.bus.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;
+    }
+}

+ 46 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/entity/DataDictionary.java

@@ -0,0 +1,46 @@
+package com.jpsoft.bus.modules.sys.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+  描述:sys_data_dictionary的实体类
+ */
+@Data
+public class DataDictionary {
+	@ApiModelProperty(value = "")
+	private String id;
+	@ApiModelProperty(value = "")
+	private String name;
+	@ApiModelProperty(value = "")
+	private String value;
+	@ApiModelProperty(value = "")
+	private Integer sortNo;
+	@ApiModelProperty(value = "")
+	private String parentName;
+	@ApiModelProperty(value = "")
+	private String parentId;
+	@ApiModelProperty(value = "")
+	private String dataType;
+	@ApiModelProperty(value = "")
+	private String createBy;
+	@ApiModelProperty(value = "")
+	private Date createDate;
+	@ApiModelProperty(value = "")
+	private String updateBy;
+	@ApiModelProperty(value = "")
+	private Date updateDate;
+	@ApiModelProperty(value = "")
+	private Boolean activated;
+	@ApiModelProperty(value = "")
+	private Boolean delFlag;
+
+	@ApiModelProperty(value = "拓展字段1")
+	private String expand1;
+	@ApiModelProperty(value = "拓展字段2")
+	private String expand2;
+	@ApiModelProperty(value = "拓展字段3")
+	private String expand3;
+}

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

@@ -0,0 +1,199 @@
+package com.jpsoft.bus.modules.sys.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+  描述: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;
+	}
+}

+ 143 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/entity/Permission.java

@@ -0,0 +1,143 @@
+package com.jpsoft.bus.modules.sys.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ 描述: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/bus/modules/sys/entity/Role.java

@@ -0,0 +1,129 @@
+package com.jpsoft.bus.modules.sys.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述: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/bus/modules/sys/entity/RoleMenu.java

@@ -0,0 +1,129 @@
+package com.jpsoft.bus.modules.sys.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述: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/bus/modules/sys/entity/RolePermission.java

@@ -0,0 +1,129 @@
+package com.jpsoft.bus.modules.sys.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述: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/bus/modules/sys/entity/SysLog.java

@@ -0,0 +1,37 @@
+package com.jpsoft.bus.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:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
+    @ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	@ApiModelProperty(value = "备注")
+	private String remark;
+	@ApiModelProperty(value = "耗时(毫秒)")
+	private Long elapse;
+	@ApiModelProperty(value = "入口")
+	private String pointcut;
+}

+ 191 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/entity/User.java

@@ -0,0 +1,191 @@
+package com.jpsoft.bus.modules.sys.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+  描述:sys_user的实体类
+ */
+
+@Data
+public class User implements Serializable {
+	private String id;
+	private String companyId;
+	private String companyName;
+	private String userName;
+	private String password;
+	private String realName;
+	private Date createTime;
+	private Date updateTime;
+	private Boolean delFlag;
+	private String createBy;
+	private String updateBy;
+	private List<String> roles;
+	private String openId;
+
+		/**
+	 *获取用户编号
+	 */
+	public String getId(){
+		return id;
+	}
+
+	/**
+	 *设置用户编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取用户名
+	 */
+	public String getUserName(){
+		return userName;
+	}
+
+	/**
+	 *设置用户名
+	 */
+	public void setUserName(String userName){
+		this.userName = userName;
+	}
+		/**
+	 *获取密码
+	 */
+	public String getPassword(){
+		return password;
+	}
+
+	/**
+	 *设置密码
+	 */
+	public void setPassword(String password){
+		this.password = password;
+	}
+		/**
+	 *获取真实名称
+	 */
+	public String getRealName(){
+		return realName;
+	}
+
+	/**
+	 *设置真实名称
+	 */
+	public void setRealName(String realName){
+		this.realName = realName;
+	}
+
+	@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;
+	}
+
+	public List<String> getRoles() {
+		return roles;
+	}
+
+	public void setRoles(List<String> roles) {
+		this.roles = roles;
+	}
+
+	/**
+	 *设置企业名称
+	 */
+	public String getCompanyId() {
+		return companyId;
+	}
+
+	public void setCompanyId(String companyId) {
+		this.companyId = companyId;
+	}
+
+	/**
+	 *设置企业名称
+	 */
+	public String getCompanyName() {
+		return companyName;
+	}
+
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
+
+	public String getOpenId() {
+		return openId;
+	}
+
+	public void setOpenId(String openId) {
+		this.openId = openId;
+	}
+}

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

@@ -0,0 +1,129 @@
+package com.jpsoft.bus.modules.sys.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述: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/bus/modules/sys/service/DataDictionaryService.java

@@ -0,0 +1,27 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.DataDictionary;
+
+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();
+	String findParentId(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 findOneByCatalogNameAndValue(String catalogName, String value);
+	DataDictionary findByName(String name);
+    Map<String, DataDictionary> findMapByCatalogName(String catalogName);
+}

+ 22 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/service/MenuService.java

@@ -0,0 +1,22 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.Menu;
+
+import java.util.List;
+import java.util.Map;
+
+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);
+}

+ 20 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/service/PermissionService.java

@@ -0,0 +1,20 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.Permission;
+
+import java.util.List;
+import java.util.Map;
+
+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);
+}

+ 20 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/service/RoleMenuService.java

@@ -0,0 +1,20 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.RoleMenu;
+
+import java.util.List;
+import java.util.Map;
+
+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);
+}

+ 22 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/service/RolePermissionService.java

@@ -0,0 +1,22 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.RolePermission;
+
+import java.util.List;
+import java.util.Map;
+
+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);
+}

+ 18 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/service/RoleService.java

@@ -0,0 +1,18 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.Role;
+
+import java.util.List;
+import java.util.Map;
+
+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/bus/modules/sys/service/SysLogService.java

@@ -0,0 +1,18 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.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/bus/modules/sys/service/UserRoleService.java

@@ -0,0 +1,23 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.Role;
+import com.jpsoft.bus.modules.sys.entity.UserRole;
+
+import java.util.List;
+import java.util.Map;
+
+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);
+	int deleteByUserId(String userId);
+
+    boolean existByRoleName(String userId, String mobile_recharge);
+}

+ 21 - 0
common/src/main/java/com/jpsoft/bus/modules/sys/service/UserService.java

@@ -0,0 +1,21 @@
+package com.jpsoft.bus.modules.sys.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.entity.User;
+
+import java.util.List;
+import java.util.Map;
+
+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);
+	List<User> findByRoleName(String roleName);
+	boolean hasRole(String userId, String roleName) ;
+}

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

@@ -0,0 +1,126 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.DataDictionaryDAO;
+import com.jpsoft.bus.modules.sys.entity.DataDictionary;
+import com.jpsoft.bus.modules.sys.service.DataDictionaryService;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+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 String findParentId(String parentId,String value){
+		return dataDictionaryDAO.findParentId(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 findOneByCatalogNameAndValue(String catalogName, String value) {
+		return dataDictionaryDAO.findOneByCatalogNameAndValue(catalogName,value);
+	}
+
+	@Override
+	public DataDictionary findByName(String name) {
+		return dataDictionaryDAO.findByName(name);
+	}
+
+	@Override
+	public Map<String, DataDictionary> findMapByCatalogName(String catalogName) {
+		Map<String,DataDictionary> ddMap = new HashMap<>();
+
+		List<DataDictionary> ddList = dataDictionaryDAO.findByCatalogName(catalogName);
+
+		for (DataDictionary dd : ddList) {
+			ddMap.put(dd.getValue(),dd);
+		}
+
+		return ddMap;
+	}
+}

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

@@ -0,0 +1,84 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.MenuDAO;
+import com.jpsoft.bus.modules.sys.entity.Menu;
+import com.jpsoft.bus.modules.sys.service.MenuService;
+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="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);
+	}
+}

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

@@ -0,0 +1,75 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.PermissionDAO;
+import com.jpsoft.bus.modules.sys.entity.Permission;
+import com.jpsoft.bus.modules.sys.service.PermissionService;
+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="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;
+	}
+}

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

@@ -0,0 +1,80 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.RoleMenuDAO;
+import com.jpsoft.bus.modules.sys.entity.RoleMenu;
+import com.jpsoft.bus.modules.sys.service.RoleMenuService;
+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="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);
+	}
+}

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

@@ -0,0 +1,80 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.RolePermissionDAO;
+import com.jpsoft.bus.modules.sys.entity.RolePermission;
+import com.jpsoft.bus.modules.sys.service.RolePermissionService;
+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="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);
+	}
+}

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

@@ -0,0 +1,70 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.RoleDAO;
+import com.jpsoft.bus.modules.sys.entity.Role;
+import com.jpsoft.bus.modules.sys.service.RoleService;
+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="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;
+	}
+}

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

@@ -0,0 +1,80 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.SysLogDAO;
+import com.jpsoft.bus.modules.sys.entity.SysLog;
+import com.jpsoft.bus.modules.sys.service.SysLogService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@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
+		int affectCount;
+
+		try {
+			affectCount = sysLogDAO.insert(model);
+		}
+		catch (Exception ex){
+			log.error(ex.getMessage(),ex);
+			affectCount = 0;
+		}
+
+		return affectCount;
+	}
+
+	@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;
+	}
+}

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

@@ -0,0 +1,86 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.UserRoleDAO;
+import com.jpsoft.bus.modules.sys.entity.Role;
+import com.jpsoft.bus.modules.sys.entity.UserRole;
+import com.jpsoft.bus.modules.sys.service.UserRoleService;
+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="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 int deleteByUserId(String userId) {
+		return userRoleDAO.deleteByUserId(userId);
+	}
+
+	@Override
+	public boolean existByRoleName(String userId, String roleName) {
+		return userRoleDAO.existByRoleName(userId,roleName)>0;
+	}
+}

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

@@ -0,0 +1,87 @@
+package com.jpsoft.bus.modules.sys.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.sys.dao.UserDAO;
+import com.jpsoft.bus.modules.sys.entity.User;
+import com.jpsoft.bus.modules.sys.service.UserService;
+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="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 List<User> findByRoleName(String roleName){
+		return userDAO.findByRoleName(roleName);
+	}
+
+	@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;
+	}
+}

+ 20 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/dao/AccessContorlDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.bus.modules.wechat.dao;
+
+import com.jpsoft.bus.modules.wechat.entity.AccessControl;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-12-11 10:27
+ */
+@Repository
+public interface AccessContorlDAO {
+
+    AccessControl findByOpenId(String openId);
+
+    void save(AccessControl accessControl);
+
+    void update(AccessControl accessControl);
+
+    AccessControl findByOwner(String id);
+}

+ 23 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/dao/ReplyMessageDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.bus.modules.wechat.dao;
+
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.wechat.entity.ReplyMessage;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface ReplyMessageDAO {
+	int insert(ReplyMessage entity);
+	int update(ReplyMessage entity);
+	int exist(String id);
+	ReplyMessage get(String id);
+	int delete(String id);
+	List<ReplyMessage> list();
+	List<ReplyMessage> search(Map<String, Object> searchParams, List<Sort> sortList);
+    ReplyMessage findByEvent(@Param("event") String event);
+
+
+}

+ 62 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/entity/AccessControl.java

@@ -0,0 +1,62 @@
+package com.jpsoft.bus.modules.wechat.entity;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-12-11 9:55
+ */
+@Data
+public class AccessControl {
+
+    /**
+     * id
+     */
+    private String id;
+
+    /**
+     * 业主id
+     */
+    private String ownerId;
+
+    /**
+     * openId
+     */
+    private String openId;
+
+    /**
+     * 绑定时间
+     */
+    private Date bindTime;
+
+    /**
+     * 是否绑定人脸
+     */
+    private Boolean bindFace;
+
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 更新人
+     */
+    private String updateBy;
+
+
+}

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

@@ -0,0 +1,29 @@
+package com.jpsoft.bus.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;
+}

+ 51 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/entity/ReplyMessage.java

@@ -0,0 +1,51 @@
+package com.jpsoft.bus.modules.wechat.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;
+
+/**
+  描述:wechat_reply_message的实体类
+ */
+@Data
+@ApiModel(value = "wechat_reply_message的实体类")
+public class ReplyMessage {
+	/**
+	 *编号
+	 */
+        @ApiModelProperty(value = "编号")
+	private String id;
+	/**
+	 *事件
+	 */
+        @ApiModelProperty(value = "事件")
+	private String event;
+	/**
+	 *回复消息
+	 */
+        @ApiModelProperty(value = "回复消息")
+	private String message;
+	/**
+	 *回调地址
+	 */
+        @ApiModelProperty(value = "回调地址")
+	private String callbackUrl;
+	/**
+	 *创建时间
+	 */
+    	@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;
+}

+ 36 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/service/IAccessControlService.java

@@ -0,0 +1,36 @@
+package com.jpsoft.bus.modules.wechat.service;
+
+import com.jpsoft.bus.modules.wechat.entity.AccessControl;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-12-11 10:24
+ */
+public interface IAccessControlService {
+
+    /**
+     * 根据openid查询绑定记录
+     * @param openId
+     * @return
+     */
+    AccessControl findByOpenId(String openId);
+
+    /**
+     * 根据ownerid查询绑定记录
+     * @param id
+     * @return
+     */
+    AccessControl findByOwnerId(String id);
+
+    /**
+     * 保存绑定记录
+     * @param accessControl
+     */
+    void save(AccessControl accessControl);
+
+    /**
+     * 更新绑定信息
+     * @param accessControl
+     */
+    void update(AccessControl accessControl);
+}

+ 19 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/service/ReplyMessageService.java

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

+ 44 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/service/impl/AccessControlServiceImpl.java

@@ -0,0 +1,44 @@
+package com.jpsoft.bus.modules.wechat.service.impl;
+
+import com.jpsoft.bus.modules.wechat.dao.AccessContorlDAO;
+import com.jpsoft.bus.modules.wechat.entity.AccessControl;
+import com.jpsoft.bus.modules.wechat.service.IAccessControlService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-12-3 15:55
+ */
+@Service
+public class AccessControlServiceImpl implements IAccessControlService {
+
+    @Resource(name="accessContorlDAO")
+    private AccessContorlDAO accessContorlDAO;
+
+
+
+
+    @Override
+    public AccessControl findByOpenId(String openId) {
+        return accessContorlDAO.findByOpenId(openId);
+    }
+
+    @Override
+    public AccessControl findByOwnerId(String id) {
+        return accessContorlDAO.findByOwner(id);
+    }
+
+    @Override
+    public void save(AccessControl accessControl) {
+        accessContorlDAO.save(accessControl);
+    }
+
+    @Override
+    public void update(AccessControl accessControl) {
+        accessContorlDAO.update(accessControl);
+    }
+
+
+}

+ 75 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/service/impl/ReplyMessageServiceImpl.java

@@ -0,0 +1,75 @@
+package com.jpsoft.bus.modules.wechat.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.jpsoft.bus.modules.wechat.dao.ReplyMessageDAO;
+import com.jpsoft.bus.modules.wechat.entity.ReplyMessage;
+import com.jpsoft.bus.modules.wechat.service.ReplyMessageService;
+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="replyMessageService")
+public class ReplyMessageServiceImpl implements ReplyMessageService {
+	@Resource(name="replyMessageDAO")
+	private ReplyMessageDAO replyMessageDAO;
+
+	@Override
+	public ReplyMessage get(String id) {
+		// TODO Auto-generated method stub
+		return replyMessageDAO.get(id);
+	}
+
+	@Override
+	public int insert(ReplyMessage model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+
+		return replyMessageDAO.insert(model);
+	}
+
+	@Override
+	public int update(ReplyMessage model) {
+		// TODO Auto-generated method stub
+		return replyMessageDAO.update(model);
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return replyMessageDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = replyMessageDAO.exist(id);
+
+		return count > 0 ? true : false;
+	}
+
+	@Override
+	public List<ReplyMessage> list() {
+		// TODO Auto-generated method stub
+		return replyMessageDAO.list();
+	}
+
+	@Override
+	public Page<ReplyMessage> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<ReplyMessage> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            replyMessageDAO.search(searchParams,sortList);
+        });
+
+        return page;
+	}
+
+	@Override
+	public ReplyMessage findByEvent(String event) {
+		return replyMessageDAO.findByEvent(event);
+	}
+}

+ 65 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/vo/AccessControlVo.java

@@ -0,0 +1,65 @@
+package com.jpsoft.bus.modules.wechat.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-12-13 10:17
+ */
+@Data
+public class AccessControlVo {
+
+    /**
+     * id
+     */
+    private String id;
+
+    /**
+     * 业主姓名
+     */
+    private String name;
+
+    /**
+     * 业主手机号
+     */
+    private String phoneNum;
+
+    /**
+     * openId
+     */
+    private String openId;
+
+    /**
+     * 绑定时间
+     */
+    private Date bindTime;
+
+    /**
+     * 是否绑定人脸
+     */
+    private Boolean bindFace;
+
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 更新人
+     */
+    private String updateBy;
+}

+ 15 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/vo/BindFaceVo.java

@@ -0,0 +1,15 @@
+package com.jpsoft.bus.modules.wechat.vo;
+
+import lombok.Data;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-9-4 12:39
+ */
+@Data
+public class BindFaceVo {
+
+    private String phoneNum;
+
+    private String filedata;
+}

+ 39 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/vo/BindPhoneVo.java

@@ -0,0 +1,39 @@
+package com.jpsoft.bus.modules.wechat.vo;
+
+import lombok.Data;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-8-5 13:32
+ */
+@Data
+public class BindPhoneVo {
+
+
+    /**
+     * 业主姓名
+     */
+    private String name;
+
+    /**
+     * 业主手机号
+     */
+    private String phoneNum;
+
+    /**
+     * openId
+     */
+    private String openId;
+
+    /**
+     * 图片验证码
+     */
+    private String verifyPicCode;
+
+    /**
+     * 短信验证码
+     */
+    private String verifyCode;
+
+
+}

+ 17 - 0
common/src/main/java/com/jpsoft/bus/modules/wechat/vo/RepairsVo.java

@@ -0,0 +1,17 @@
+package com.jpsoft.bus.modules.wechat.vo;
+
+import lombok.Data;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2019-9-3 17:21
+ */
+@Data
+public class RepairsVo {
+
+    private String openId;
+
+    private String content;
+
+    private String type;
+}

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

@@ -0,0 +1,20 @@
+package com.jpsoft.bus.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;
+
+}

+ 211 - 0
common/src/main/resources/mapper/sys/DataDictionary.xml

@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.DataDictionaryDAO">
+    <resultMap id="DataDictionaryMap" type="com.jpsoft.bus.modules.sys.entity.DataDictionary">
+        <id property="id" column="id_"/>
+        <result property="name" column="name_"/>
+        <result property="value" column="value_"/>
+        <result property="sortNo" column="sort_no"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="parentName" column="parent_name"/>
+        <result property="dataType" column="data_type"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createDate" column="create_date"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateDate" column="update_date"/>
+        <result property="activated" column="activated_"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="expand1" column="expand_1"/>
+        <result property="expand2" column="expand_2"/>
+        <result property="expand3" column="expand_3"/>
+
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.DataDictionary">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into sys_data_dictionary
+	    (id_,name_,value_,sort_no,parent_id,data_type,create_by,create_date,update_by,
+	    update_date,activated_,del_flag,expand_1,expand_2,expand_3)
+		values
+		(
+            #{id,jdbcType=VARCHAR}
+            ,#{name,jdbcType=VARCHAR}
+            ,#{value,jdbcType=VARCHAR}
+            ,#{sortNo,jdbcType= NUMERIC }
+            ,#{parentId,jdbcType=VARCHAR}
+            ,#{dataType,jdbcType= NUMERIC }
+            ,#{createBy,jdbcType=VARCHAR}
+            ,#{createDate,jdbcType= TIMESTAMP }
+            ,#{updateBy,jdbcType=VARCHAR}
+            ,#{updateDate,jdbcType= TIMESTAMP }
+            ,#{activated,jdbcType= NUMERIC }
+            ,#{delFlag,jdbcType= NUMERIC }
+            ,#{expand1,jdbcType=VARCHAR}
+            ,#{expand2,jdbcType=VARCHAR}
+            ,#{expand3,jdbcType=VARCHAR}
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from sys_data_dictionary where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.DataDictionary">
+        update sys_data_dictionary
+        <set>
+            <if test="name!=null">
+                name_=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="value!=null">
+                value_=#{value,jdbcType=VARCHAR},
+            </if>
+            <if test="sortNo!=null">
+                sort_no=#{sortNo,jdbcType= NUMERIC },
+            </if>
+            <if test="parentId!=null">
+                parent_id=#{parentId,jdbcType=VARCHAR},
+            </if>
+            <if test="dataType!=null">
+                data_type=#{dataType,jdbcType= NUMERIC },
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createDate!=null">
+                create_date=#{createDate,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateDate!=null">
+                update_date=#{updateDate,jdbcType= TIMESTAMP },
+            </if>
+            <if test="activated!=null">
+                activated_=#{activated,jdbcType= NUMERIC },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="expand1!=null">
+                expand_1=#{expand1,jdbcType= NUMERIC },
+            </if>
+            <if test="expand2!=null">
+                expand_2=#{expand2,jdbcType= NUMERIC },
+            </if>
+            <if test="expand3!=null">
+                expand_3=#{expand3,jdbcType= NUMERIC },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="DataDictionaryMap">
+        select a.*,b.name_ as parent_name
+        from sys_data_dictionary a left join sys_data_dictionary b on a.parent_id = b.id_
+        where a.id_=#{0} and a.del_flag = 0
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from sys_data_dictionary where id_=#{0} and del_flag = 0
+    </select>
+    <select id="list" resultMap="DataDictionaryMap">
+        select * from sys_data_dictionary where del_flag = 0
+    </select>
+    <select id="findParentId" parameterType="string" resultType="string">
+        select a.name_ as name
+        from sys_data_dictionary a
+        where a.parent_id =#{parentId} and a.value_=#{value} and a.del_flag = 0
+        order by a.sort_no asc
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="DataDictionaryMap">
+        <![CDATA[
+			SELECT
+				a.*,b.name_ AS parent_name
+			FROM
+				sys_data_dictionary a
+			LEFT JOIN sys_data_dictionary b ON a.parent_id = b.id_
+		]]>
+        <where>
+            a.del_flag = 0
+            <if test="searchParams.id != null">
+                and a.ID_ like #{searchParams.id}
+            </if>
+            <if test="searchParams.name != null">
+                and a.name_ like #{searchParams.name}
+            </if>
+            <if test="searchParams.excludeId != null">
+                <![CDATA[
+				and a.ID_ <> #{searchParams.excludeId}
+				]]>
+            </if>
+            <if test="searchParams.dataType != null">
+                and a.data_type = #{searchParams.dataType}
+            </if>
+            <if test="searchParams.parentId != null">
+                <![CDATA[
+				and a.parent_id = #{searchParams.parentId}
+				]]>
+            </if>
+
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+
+    <select id="queryChildren" resultType="java.util.HashMap" parameterType="string">
+        SELECT
+        a.id_ as id,a.name_ as name,a.value_ as value
+        FROM
+        sys_data_dictionary a where a.del_flag = 0
+        and data_type = 2
+        and a.parent_id = #{0}
+    </select>
+
+    <select id="getName" parameterType="string" resultType="string">
+        select a.name_ as name
+        from sys_data_dictionary a
+        where a.id_=#{0} and a.del_flag = 0
+    </select>
+    <select id="getValue" parameterType="string" resultType="string">
+        select a.value_ as value
+        from sys_data_dictionary a
+        where a.id_=#{0} and a.del_flag = 0
+    </select>
+    <select id="findByCatalogName" resultMap="DataDictionaryMap">
+        select a.*
+        from sys_data_dictionary a,sys_data_dictionary b
+        where a.parent_id =b.id_ and b.name_=#{0}
+        and a.del_flag = 0
+        order by a.sort_no asc
+    </select>
+    <select id="findNameByCatalogNameAndValue" parameterType="map" resultType="string">
+        select a.name_
+        from sys_data_dictionary a,sys_data_dictionary b
+        where a.parent_id =b.id_ and b.name_=#{catalogName}
+        and a.del_flag = 0
+        and a.value_=#{value}
+        order by a.sort_no asc
+        limit 1
+    </select>
+    <select id="findOneByCatalogNameAndValue" parameterType="map" resultMap="DataDictionaryMap">
+        select a.*
+        from sys_data_dictionary a,sys_data_dictionary b
+        where a.parent_id =b.id_ and b.name_=#{catalogName}
+        and a.del_flag = 0
+        and a.value_=#{value}
+        order by a.sort_no asc
+        limit 1
+    </select>
+    <select id="findByName" resultMap="DataDictionaryMap">
+        <![CDATA[
+
+        select * from sys_data_dictionary
+        where del_flag = 0
+        and name_ = #{0}
+        ]]>
+    </select>
+</mapper>

+ 143 - 0
common/src/main/resources/mapper/sys/Menu.xml

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.MenuDAO">
+    <resultMap id="MenuMap" type="com.jpsoft.bus.modules.sys.entity.Menu">
+        <id property="id" column="id_"/>
+        <result property="menuName" column="menu_name"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="parentName" column="parent_name"/>
+        <result property="sortNo" column="sort_no"/>
+        <result property="menuUrl" column="menu_url"/>
+        <result property="icon" column="icon_"/>
+        <result property="menuType" column="menu_type"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.Menu">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into sys_menu
+	    (id_,menu_name,parent_id,sort_no,menu_url,menu_type,create_time,create_by,update_time,update_by,del_flag,icon_)
+		values
+		(
+            #{id,jdbcType=VARCHAR}
+            ,#{menuName,jdbcType=VARCHAR}
+            ,#{parentId,jdbcType=VARCHAR}
+            ,#{sortNo,jdbcType= NUMERIC }
+            ,#{menuUrl,jdbcType=VARCHAR}
+            ,#{menuType,jdbcType=VARCHAR}
+            ,#{createTime,jdbcType= TIMESTAMP }
+            ,#{createBy,jdbcType=VARCHAR}
+            ,#{updateTime,jdbcType= TIMESTAMP }
+            ,#{updateBy,jdbcType=VARCHAR}
+            ,#{delFlag,jdbcType= NUMERIC }
+            ,#{icon,jdbcType=VARCHAR}
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from sys_menu where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.Menu">
+        update sys_menu
+        <set>
+            <if test="menuName!=null">
+                menu_name=#{menuName,jdbcType=VARCHAR},
+            </if>
+            <if test="parentId!=null">
+                parent_id=#{parentId,jdbcType=VARCHAR},
+            </if>
+            <if test="sortNo!=null">
+                sort_no=#{sortNo,jdbcType= NUMERIC },
+            </if>
+            <if test="menuUrl!=null">
+                menu_url=#{menuUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="menuType!=null">
+                menu_type=#{menuType,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="icon!=null">
+                icon_=#{icon,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="MenuMap">
+        select a.*,b.menu_name as parent_name
+        from sys_menu a left join sys_menu b on a.parent_id = b.id_
+        where a.id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from sys_menu where id_=#{0}
+    </select>
+    <select id="list" resultMap="MenuMap">
+        select * from sys_menu
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="MenuMap">
+        <![CDATA[
+			select a.*,b.menu_name as parent_name
+			from sys_menu a left join sys_menu b on a.parent_id = b.id_
+		]]>
+        where a.del_flag=0
+        <if test="searchParams.menuName != null">
+            and a.menu_name like #{searchParams.menuName}
+        </if>
+        <if test="searchParams.menuType != null">
+            and a.menu_type = #{searchParams.menuType}
+        </if>
+        <if test="searchParams.parentId != null">
+            and a.parent_id = #{searchParams.parentId}
+        </if>
+        <if test="searchParams.excludeId != null">
+            <![CDATA[
+                and a.id_ <> #{searchParams.excludeId}
+            ]]>
+        </if>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+    <select id="findAllocMenu"  parameterType="string" resultMap="MenuMap">
+        select * from sys_menu m
+        where m.menu_type = 2
+        and m.del_flag=0
+        and m.id_ in(
+        select rm.menu_id from
+        sys_role_menu rm,sys_user_role ur
+        where ur.user_id=#{userId}
+        and ur.role_id = rm.role_id
+        and rm.menu_id = m.id_
+        )
+        <if test="parentId==null">
+            and (m.parent_id is null or m.parent_id='')
+        </if>
+        <if test="parentId!=null">
+            and m.parent_id = #{parentId}
+        </if>
+        order by m.sort_no asc
+    </select>
+</mapper>

+ 108 - 0
common/src/main/resources/mapper/sys/Permission.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.PermissionDAO">
+    <resultMap id="PermissionMap" type="com.jpsoft.bus.modules.sys.entity.Permission">
+        <id property="id" column="id_"/>
+        <result property="path" column="path_"/>
+        <result property="method" column="method_"/>
+        <result property="summary" column="summary_"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.Permission">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into sys_permission
+	    (id_,path_,method_,summary_,del_flag,create_by,update_by,create_time,update_time)
+		values
+		(
+            #{id,jdbcType=VARCHAR}
+            ,#{path,jdbcType=VARCHAR}
+            ,#{method,jdbcType=VARCHAR}
+            ,#{summary,jdbcType=VARCHAR}
+            ,#{delFlag,jdbcType= NUMERIC }
+            ,#{createBy,jdbcType=VARCHAR}
+            ,#{updateBy,jdbcType=VARCHAR}
+            ,#{createTime,jdbcType= TIMESTAMP }
+            ,#{updateTime,jdbcType= TIMESTAMP }
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from sys_permission where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.Permission">
+        update sys_permission
+        <set>
+            <if test="path!=null">
+                path_=#{path,jdbcType=VARCHAR},
+            </if>
+            <if test="method!=null">
+                method_=#{method,jdbcType=VARCHAR},
+            </if>
+            <if test="summary!=null">
+                summary_=#{summary,jdbcType=VARCHAR},
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="PermissionMap">
+        select
+        id_,path_,method_,summary_,del_flag,create_by,update_by,create_time,update_time from sys_permission where
+        id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from sys_permission where path_=#{path} and method_=#{method} and del_flag=0
+    </select>
+    <select id="list" resultMap="PermissionMap">
+        select * from sys_permission where del_flag=0
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="PermissionMap">
+        <![CDATA[
+			select * from sys_permission
+		]]>
+        where del_flag=0
+        <if test="searchParams.path != null">
+            and path_ like #{searchParams.path}
+        </if>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+    <select id="hasPermitted" parameterType="string" resultType="int">
+        <![CDATA[
+            select count(*) from
+            sys_user u,sys_user_role ur,sys_role_permission rp,sys_permission p
+            where u.id_=#{userId}
+            and u.id_=ur.user_id
+            and ur.role_id = rp.role_id
+            and rp.perm_id = p.id_
+            and p.path_ = #{path}
+            and p.method_ = #{method}
+        ]]>
+    </select>
+</mapper>

+ 93 - 0
common/src/main/resources/mapper/sys/Role.xml

@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.RoleDAO">
+    <resultMap id="RoleMap" type="com.jpsoft.bus.modules.sys.entity.Role">
+        <id property="id" column="id_"/>
+        <result property="name" column="name_"/>
+        <result property="description" column="description_"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.Role">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into sys_role
+	    (id_,name_,description_,create_time,update_time,del_flag,create_by,update_by)
+		values
+		(
+            #{id,jdbcType=VARCHAR}
+            ,#{name,jdbcType=VARCHAR}
+            ,#{description,jdbcType=VARCHAR}
+            ,#{createTime,jdbcType= TIMESTAMP }
+            ,#{updateTime,jdbcType= TIMESTAMP }
+            ,#{delFlag,jdbcType= NUMERIC }
+            ,#{createBy,jdbcType=VARCHAR}
+            ,#{updateBy,jdbcType=VARCHAR}
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from sys_role where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.Role">
+        update sys_role
+        <set>
+            <if test="name!=null">
+                name_=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="description!=null">
+                description_=#{description,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="RoleMap">
+        select
+        id_,name_,description_,create_time,update_time,del_flag,create_by,update_by from sys_role where id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from sys_role where id_=#{0}
+    </select>
+    <select id="list" resultMap="RoleMap">
+        select * from sys_role  where del_flag=0 order by create_time asc
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="RoleMap">
+        <![CDATA[
+			select * from sys_role
+		]]>
+            where del_flag=0
+            <if test="searchParams.roleName != null">
+                and name_ like #{searchParams.roleName}
+            </if>
+            <if test="searchParams.roleDesc != null">
+                and description_ like #{searchParams.roleDesc}
+            </if>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+</mapper>

+ 97 - 0
common/src/main/resources/mapper/sys/RoleMenu.xml

@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.RoleMenuDAO">
+	<resultMap id="RoleMenuMap" type="com.jpsoft.bus.modules.sys.entity.RoleMenu">
+		<id property="id" column="id_" />
+			<result property="roleId" column="role_id" />
+			<result property="menuId" column="menu_id" />
+			<result property="delFlag" column="del_flag" />
+			<result property="createBy" column="create_by" />
+			<result property="createTime" column="create_time" />
+			<result property="updateBy" column="update_by" />
+			<result property="updateTime" column="update_time" />
+			</resultMap>
+	<insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.RoleMenu">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into sys_role_menu
+	    (id_,role_id,menu_id,del_flag,create_by,create_time,update_by,update_time)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{roleId,jdbcType=VARCHAR}
+,#{menuId,jdbcType=VARCHAR}
+,#{delFlag,jdbcType= NUMERIC }
+,#{createBy,jdbcType=VARCHAR}
+,#{createTime,jdbcType= TIMESTAMP }
+,#{updateBy,jdbcType=VARCHAR}
+,#{updateTime,jdbcType= TIMESTAMP }
+		)
+	]]>
+	</insert>
+	<delete id="delete" parameterType="string">
+		delete from sys_role_menu where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<delete id="deleteByRoleId" parameterType="string">
+		delete from sys_role_menu where role_id=#{0}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.RoleMenu">
+		update sys_role_menu
+		<set>
+				<if test="roleId!=null">
+		role_id=#{roleId,jdbcType=VARCHAR},
+		</if>
+				<if test="menuId!=null">
+		menu_id=#{menuId,jdbcType=VARCHAR},
+		</if>
+				<if test="delFlag!=null">
+		del_flag=#{delFlag,jdbcType= NUMERIC },
+		</if>
+				<if test="createBy!=null">
+		create_by=#{createBy,jdbcType=VARCHAR},
+		</if>
+				<if test="createTime!=null">
+		create_time=#{createTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="updateBy!=null">
+		update_by=#{updateBy,jdbcType=VARCHAR},
+		</if>
+				<if test="updateTime!=null">
+		update_time=#{updateTime,jdbcType= TIMESTAMP },
+		</if>
+		</set>
+	where id_=#{id}
+	</update>
+	<select id="get" parameterType="string" resultMap="RoleMenuMap">
+		select
+id_,role_id,menu_id,del_flag,create_by,create_time,update_by,update_time		from sys_role_menu where id_=#{0}
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from sys_role_menu where id_=#{0}
+	</select>
+	<select id="list" resultMap="RoleMenuMap">
+		select * from sys_role_menu
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="RoleMenuMap">
+		<![CDATA[
+			select * from sys_role_menu
+		]]>
+		<where>
+			<if test="searchParams.id != null">
+				and ID_ like #{searchParams.id}
+			</if>
+		</where>
+		<foreach item="sort" collection="sortList"  open="order by" separator=",">
+	        ${sort.name} ${sort.order}
+	 	</foreach>
+	</select>
+	<select id="findByRoleId" parameterType="string" resultMap="RoleMenuMap">
+		select * from sys_role_menu where role_id=#{0}
+	</select>
+</mapper>

+ 96 - 0
common/src/main/resources/mapper/sys/RolePermission.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.RolePermissionDAO">
+	<resultMap id="RolePermissionMap" type="com.jpsoft.bus.modules.sys.entity.RolePermission">
+		<id property="id" column="id_" />
+			<result property="permId" column="perm_id" />
+			<result property="roleId" column="role_id" />
+			<result property="delFlag" column="del_flag" />
+			<result property="createBy" column="create_by" />
+			<result property="updateBy" column="update_by" />
+			<result property="createTime" column="create_time" />
+			<result property="updateTime" column="update_time" />
+			</resultMap>
+	<insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.RolePermission">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into sys_role_permission
+	    (id_,perm_id,role_id,del_flag,create_by,update_by,create_time,update_time)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{permId,jdbcType=VARCHAR}
+,#{roleId,jdbcType=VARCHAR}
+,#{delFlag,jdbcType= NUMERIC }
+,#{createBy,jdbcType=VARCHAR}
+,#{updateBy,jdbcType=VARCHAR}
+,#{createTime,jdbcType= TIMESTAMP }
+,#{updateTime,jdbcType= TIMESTAMP }
+		)
+	]]>
+	</insert>
+	<delete id="delete" parameterType="string">
+		delete from sys_role_permission where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<delete id="deleteByRoleId" parameterType="string">
+		delete from sys_role_permission where role_id=#{0}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.RolePermission">
+		update sys_role_permission
+		<set>
+				<if test="permId!=null">
+		perm_id=#{permId,jdbcType=VARCHAR},
+		</if>
+				<if test="roleId!=null">
+		role_id=#{roleId,jdbcType=VARCHAR},
+		</if>
+				<if test="delFlag!=null">
+		del_flag=#{delFlag,jdbcType= NUMERIC },
+		</if>
+				<if test="createBy!=null">
+		create_by=#{createBy,jdbcType=VARCHAR},
+		</if>
+				<if test="updateBy!=null">
+		update_by=#{updateBy,jdbcType=VARCHAR},
+		</if>
+				<if test="createTime!=null">
+		create_time=#{createTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="updateTime!=null">
+		update_time=#{updateTime,jdbcType= TIMESTAMP },
+		</if>
+		</set>
+	where id_=#{id}
+	</update>
+	<select id="get" parameterType="string" resultMap="RolePermissionMap">
+		select * from sys_role_permission where id_=#{0}
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from sys_role_permission where id_=#{0}
+	</select>
+	<select id="list" resultMap="RolePermissionMap">
+		select * from sys_role_permission
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="RolePermissionMap">
+		<![CDATA[
+			select * from sys_role_permission
+		]]>
+		<where>
+			<if test="searchParams.id != null">
+				and ID_ like #{searchParams.id}
+			</if>
+		</where>
+		<foreach item="sort" collection="sortList"  open="order by" separator=",">
+	        ${sort.name} ${sort.order}
+	 	</foreach>
+	</select>
+	<select id="findByRoleId" parameterType="string" resultMap="RolePermissionMap">
+		select * from sys_role_permission where role_id=#{0}
+	</select>
+</mapper>

+ 115 - 0
common/src/main/resources/mapper/sys/SysLog.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.SysLogDAO">
+    <resultMap id="SysLogMap" type="com.jpsoft.bus.modules.sys.entity.SysLog">
+        <id property="id" column="id_"/>
+        <result property="remoteIp" column="remote_ip"/>
+        <result property="url" column="url_"/>
+        <result property="data" column="data_"/>
+        <result property="userId" column="user_id"/>
+        <result property="createTime" column="create_time"/>
+        <result property="remark" column="remark_"/>
+        <result property="elapse" column="elapse_"/>
+        <result property="pointcut" column="pointcut_"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.SysLog">
+        <selectKey resultType="long" keyColumn="id_" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS id_
+        </selectKey>
+        <![CDATA[
+		insert into sys_log
+	    (remote_ip,url_,data_,user_id,create_time,remark_,elapse_,pointcut_)
+		values
+		(
+            #{remoteIp,jdbcType=VARCHAR}
+            ,#{url,jdbcType=VARCHAR}
+            ,#{data,jdbcType=VARCHAR}
+            ,#{userId,jdbcType=VARCHAR}
+            ,#{createTime,jdbcType= TIMESTAMP }
+            ,#{remark,jdbcType=VARCHAR}
+            ,#{elapse,jdbcType=NUMERIC}
+            ,#{pointcut,jdbcType=VARCHAR}
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from sys_log where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.SysLog">
+        update sys_log
+        <set>
+            <if test="remoteIp!=null">
+                remote_ip=#{remoteIp,jdbcType=VARCHAR},
+            </if>
+            <if test="url!=null">
+                url_=#{url,jdbcType=VARCHAR},
+            </if>
+            <if test="data!=null">
+                data_=#{data,jdbcType=VARCHAR},
+            </if>
+            <if test="userId!=null">
+                user_id=#{userId,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="SysLogMap">
+        select * from sys_log where id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from sys_log where id_=#{0}
+    </select>
+    <select id="list" resultMap="SysLogMap">
+        select * from sys_log
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="SysLogMap">
+        <![CDATA[
+			select * from sys_log
+		]]>
+        <where>
+            <if test="searchParams.userId != null">
+                and user_id = #{searchParams.userId}
+            </if>
+            <if test="searchParams.remoteIP != null">
+                and remote_ip like #{searchParams.remoteIP}
+            </if>
+            <if test="searchParams.url != null">
+                and url_ like #{searchParams.url}
+            </if>
+            <if test="searchParams.pointcut != null">
+                and pointcut_ like #{searchParams.pointcut}
+            </if>
+            <if test="searchParams.startTime != null">
+                <![CDATA[
+                    and create_time >= #{searchParams.startTime}
+                ]]>
+            </if>
+            <if test="searchParams.endTime != null">
+                <![CDATA[
+                    and create_time <= #{searchParams.endTime}
+                ]]>
+            </if>
+            <if test="searchParams.elapseMin != null">
+                <![CDATA[
+                    and elapse_ >= #{searchParams.elapseMin}
+                ]]>
+            </if>
+            <if test="searchParams.elapseMax != null">
+                <![CDATA[
+                    and elapse_ <= #{searchParams.elapseMax}
+                ]]>
+            </if>
+            <if test="searchParams.remark != null">
+                and remark_ like #{searchParams.remark}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+</mapper>

+ 129 - 0
common/src/main/resources/mapper/sys/User.xml

@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.UserDAO">
+    <resultMap id="UserMap" type="com.jpsoft.bus.modules.sys.entity.User">
+        <id property="id" column="id_"/>
+        <result property="userName" column="user_name"/>
+        <result property="companyId" column="company_id" />
+        <result property="companyName" column="company_name" />
+        <result property="password" column="password_"/>
+        <result property="realName" column="real_name"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="openId" column="open_id"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.User">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into sys_user
+	    (id_,company_id,user_name,password_,real_name,create_time,update_time,
+	    del_flag,create_by,update_by)
+		values
+		(
+            #{id,jdbcType=VARCHAR}
+            ,#{companyId,jdbcType=VARCHAR}
+            ,#{userName,jdbcType=VARCHAR}
+            ,#{password,jdbcType=VARCHAR}
+            ,#{realName,jdbcType=VARCHAR}
+            ,#{createTime,jdbcType= TIMESTAMP }
+            ,#{updateTime,jdbcType= TIMESTAMP }
+            ,#{delFlag,jdbcType= NUMERIC }
+            ,#{createBy,jdbcType=VARCHAR}
+            ,#{updateBy,jdbcType=VARCHAR}
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from sys_user where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.User">
+        update sys_user
+        <set>
+            <if test="userName!=null">
+                user_name=#{userName,jdbcType=VARCHAR},
+            </if>
+            <if test="companyId!=null">
+                company_id=#{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="password!=null">
+                password_=#{password,jdbcType=VARCHAR},
+            </if>
+            <if test="realName!=null">
+                real_name=#{realName,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="openId!=null">
+                open_id=#{openId,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="UserMap">
+        select * from sys_user where id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from sys_user where id_=#{0}
+    </select>
+    <select id="list" resultMap="UserMap">
+        select * from sys_user
+    </select>
+    <select id="findByUserName" parameterType="string" resultMap="UserMap">
+        select * from sys_user where user_name=#{userName} and del_flag=0 limit 1
+    </select>
+    <select id="findByRoleName" parameterType="string" resultMap="UserMap">
+        select a.* from sys_user a inner join sys_user_role b on a.id_ = b.user_id
+        inner join sys_role c on b.role_id = c.id_
+        where a.del_flag=false and c.name_=#{roleName}
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="UserMap">
+        <![CDATA[
+			select a.*,b.name_ as company_name
+			from sys_user a LEFT JOIN base_company_info b ON a.company_id = b.id_
+			where a.del_flag = 0
+		]]>
+        <if test="searchParams.userName != null">
+            and a.user_name like #{searchParams.userName}
+        </if>
+        <if test="searchParams.realName != null">
+            and a.real_name like #{searchParams.realName}
+        </if>
+        <if test="searchParams.companyId != null">
+            and a.company_id = #{searchParams.companyId}
+        </if>
+        <if test="searchParams.roleId != null">
+            and a.id_ in (select c.user_id from sys_user_role c
+            where c.role_id = #{searchParams.roleId})
+        </if>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+    <select id="hasRole" parameterType="string" resultType="long">
+        select count(*) from sys_user_role ur,sys_role r
+        where ur.role_id = r.id_
+        and ur.user_id = #{userId} and r.name_=#{roleName}
+    </select>
+</mapper>

+ 106 - 0
common/src/main/resources/mapper/sys/UserRole.xml

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.bus.modules.sys.dao.UserRoleDAO">
+    <resultMap id="UserRoleMap" type="com.jpsoft.bus.modules.sys.entity.UserRole">
+        <id property="id" column="id_"/>
+        <result property="roleId" column="role_id"/>
+        <result property="userId" column="user_id"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.bus.modules.sys.entity.UserRole">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into sys_user_role
+	    (id_,role_id,user_id,del_flag,create_by,update_by,create_time,update_time)
+		values
+		(
+            #{id,jdbcType=VARCHAR}
+            ,#{roleId,jdbcType=VARCHAR}
+            ,#{userId,jdbcType=VARCHAR}
+            ,#{delFlag,jdbcType= NUMERIC }
+            ,#{createBy,jdbcType=VARCHAR}
+            ,#{updateBy,jdbcType=VARCHAR}
+            ,#{createTime,jdbcType= TIMESTAMP }
+            ,#{updateTime,jdbcType= TIMESTAMP }
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from sys_user_role where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <delete id="deleteByUserId" parameterType="string">
+        delete from sys_user_role where user_id=#{0}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.bus.modules.sys.entity.UserRole">
+        update sys_user_role
+        <set>
+            <if test="roleId!=null">
+                role_id=#{roleId,jdbcType=VARCHAR},
+            </if>
+            <if test="userId!=null">
+                user_id=#{userId,jdbcType=VARCHAR},
+            </if>
+            <if test="delFlag!=null">
+                del_flag=#{delFlag,jdbcType= NUMERIC },
+            </if>
+            <if test="createBy!=null">
+                create_by=#{createBy,jdbcType=VARCHAR},
+            </if>
+            <if test="updateBy!=null">
+                update_by=#{updateBy,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="UserRoleMap">
+        select
+        id_,role_id,user_id,del_flag,create_by,update_by,create_time,update_time from sys_user_role where id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from sys_user_role where id_=#{0}
+    </select>
+    <select id="list" resultMap="UserRoleMap">
+        select * from sys_user_role
+    </select>
+    <select id="findRoleByUserId" parameterType="string" resultMap="com.jpsoft.bus.modules.sys.dao.RoleDAO.RoleMap">
+        select r.* from sys_user_role ur,sys_role r
+        where ur.role_id = r.id_
+        and ur.user_id = #{0}
+        order by ur.create_time asc
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="UserRoleMap">
+        <![CDATA[
+			select * from sys_user_role
+		]]>
+        <where>
+            <if test="searchParams.id != null">
+                and ID_ like #{searchParams.id}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+    <select id="existByRoleName" resultType="int">
+        select count(*) from sys_user_role ur,sys_role r
+        where ur.role_id = r.id_
+        and ur.user_id=#{userId}
+        and r.name_ = #{roleName}
+    </select>
+</mapper>

+ 310 - 0
mvnw

@@ -0,0 +1,310 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   M2_HOME - location of maven2's installed home dir
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
+#     e.g. to debug Maven itself, use
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        export JAVA_HOME="`/usr/libexec/java_home`"
+      else
+        export JAVA_HOME="/Library/Java/Home"
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+  ## resolve links - $0 may be a link to maven's home
+  PRG="$0"
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+      PRG="$link"
+    else
+      PRG="`dirname "$PRG"`/$link"
+    fi
+  done
+
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  M2_HOME=`cd "$M2_HOME" && pwd`
+
+  cd "$saveddir"
+  # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --unix "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+  javaExecutable="`which javac`"
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+    # readlink(1) is not available as standard on Solaris 10.
+    readLink=`which readlink`
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+      if $darwin ; then
+        javaHome="`dirname \"$javaExecutable\"`"
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+      else
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
+      fi
+      javaHome="`dirname \"$javaExecutable\"`"
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+      JAVA_HOME="$javaHome"
+      export JAVA_HOME
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD="`which java`"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+  if [ -z "$1" ]
+  then
+    echo "Path not specified to find_maven_basedir"
+    return 1
+  fi
+
+  basedir="$1"
+  wdir="$1"
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+    if [ -d "${wdir}" ]; then
+      wdir=`cd "$wdir/.."; pwd`
+    fi
+    # end of workaround
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
+    fi
+else
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+    fi
+    if [ -n "$MVNW_REPOURL" ]; then
+      jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    else
+      jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    fi
+    while IFS="=" read key value; do
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+      esac
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Downloading from: $jarUrl"
+    fi
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+    if $cygwin; then
+      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+    fi
+
+    if command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget "$jarUrl" -O "$wrapperJarPath"
+        else
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl -o "$wrapperJarPath" "$jarUrl" -f
+        else
+            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+        fi
+
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaClass=`cygpath --path --windows "$javaClass"`
+        fi
+        if [ -e "$javaClass" ]; then
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Compiling MavenWrapperDownloader.java ..."
+                fi
+                # Compiling the Java class
+                ("$JAVA_HOME/bin/javac" "$javaClass")
+            fi
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                # Running the downloader
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Running MavenWrapperDownloader.java ..."
+                fi
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+  echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 182 - 0
mvnw.cmd

@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM    https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM     e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Found %WRAPPER_JAR%
+    )
+) else (
+    if not "%MVNW_REPOURL%" == "" (
+        SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %DOWNLOAD_URL%
+    )
+
+    powershell -Command "&{"^
+		"$webclient = new-object System.Net.WebClient;"^
+		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+		"}"^
+		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%

+ 92 - 0
pom.xml

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>pom</packaging>
+    <modules>
+        <module>common</module>
+        <module>web</module>
+    </modules>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.4.4</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.jpsoft.bus</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0.0</version>
+    <name>smart-bus-server</name>
+    <description>车信达</description>
+    <properties>
+        <java.version>1.8</java.version>
+        <lombok.version>1.16.12</lombok.version>
+    </properties>
+
+
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <scope>runtime</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.vintage</groupId>
+                    <artifactId>junit-vintage-engine</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!--logging start-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.lazyluke</groupId>
+            <artifactId>log4jdbc-remix</artifactId>
+            <version>0.2.7</version>
+        </dependency>
+        <!--logging end-->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>${lombok.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.0.6</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.16</version>
+                <configuration>
+                    <includes>
+                        <include>**/*TestForPack.java</include>
+                    </includes>
+                    <argLine>-Xmx256M</argLine>
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.maven.surefire</groupId>
+                        <artifactId>surefire-junit47</artifactId>
+                        <version>2.16</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 190 - 0
web/pom.xml

@@ -0,0 +1,190 @@
+<?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>parent</artifactId>
+        <groupId>com.jpsoft.bus</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.jpsoft.bus</groupId>
+    <artifactId>web</artifactId>
+    <version>1.0.0</version>
+    <name>web</name>
+    <packaging>war</packaging>
+    <description>车信达</description>
+
+
+    <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>
+        <lombok.version>1.18.12</lombok.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>net.sourceforge.nekohtml</groupId>
+            <artifactId>nekohtml</artifactId>
+            <version>1.9.22</version>
+        </dependency>
+        <dependency>
+            <groupId>com.jpsoft.bus</groupId>
+            <artifactId>common</artifactId>
+            <version>1.0.0</version>
+        </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>
+        <!--整合Knife4j-->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+            <version>2.0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+        <!--jwt start-->
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-api</artifactId>
+            <version>0.10.5</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-impl</artifactId>
+            <version>${jwts.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-jackson</artifactId>
+            <version>${jwts.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <!--jwt end-->
+        <!--支付相关 start-->
+        <dependency>
+            <groupId>com.github.javen205</groupId>
+            <artifactId>IJPay-All</artifactId>
+            <version>${ijpay.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.jfinal</groupId>
+            <artifactId>jfinal</artifactId>
+            <version>3.5</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alipay.sdk</groupId>
+            <artifactId>alipay-sdk-java</artifactId>
+            <version>${alipay.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>bcprov-jdk15on</artifactId>
+                    <groupId>org.bouncycastle</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!--支付相关 end-->
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.6</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <fork>true</fork>
+                    <addResources>true</addResources>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </dependency>
+            </dependencies>
+            <properties>
+                <active.profile>dev</active.profile>
+            </properties>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+        </profile>
+        <profile>
+            <id>test</id>
+            <dependencies>
+                <dependency>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>javax.servlet-api</artifactId>
+                    <version>3.1.0</version>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+            <properties>
+                <active.profile>test</active.profile>
+            </properties>
+        </profile>
+        <profile>
+            <id>production</id>
+            <properties>
+                <active.profile>production</active.profile>
+            </properties>
+            <dependencies>
+                <dependency>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>javax.servlet-api</artifactId>
+                    <version>3.1.0</version>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
+</project>

+ 21 - 0
web/src/main/java/com/jpsoft/bus/SmartBusServerApplication.java

@@ -0,0 +1,21 @@
+package com.jpsoft.bus;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@SpringBootApplication
+@EnableTransactionManagement
+@EnableScheduling
+@EnableAsync
+@MapperScan("com.jpsoft.bus.**.dao")
+public class SmartBusServerApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SmartBusServerApplication.class, args);
+    }
+
+}

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