Jelajahi Sumber

初始化仓库

rayson 1 tahun lalu
melakukan
9e828bfcbe
100 mengubah file dengan 11097 tambahan dan 0 penghapusan
  1. 17 0
      .gitignore
  2. 1 0
      README.md
  3. 328 0
      pom.xml
  4. 31 0
      src/main/java/com/wechat/activerequests/ActiveRequests.java
  5. 7 0
      src/main/java/com/wechat/activerequests/EnumUserIdentifierType.java
  6. 25 0
      src/main/java/com/wechat/activerequests/responses/BaseResponse.java
  7. 19 0
      src/main/java/com/wechat/activerequests/responses/CustomeServiceResponse.java
  8. 12 0
      src/main/java/com/wechat/activerequests/responses/MessageIdResponse.java
  9. 367 0
      src/main/java/com/wechat/common/CommonEnum.java
  10. 77 0
      src/main/java/com/wechat/common/CommonHelper.java
  11. 105 0
      src/main/java/com/wechat/common/Constants.java
  12. 20 0
      src/main/java/com/wechat/common/IEnum.java
  13. 204 0
      src/main/java/com/wechat/common/TwoDimensionCode.java
  14. 29 0
      src/main/java/com/wechat/common/TwoDimensionCodeImage.java
  15. 32 0
      src/main/java/com/wechat/common/annotation/MyBatisDao.java
  16. 143 0
      src/main/java/com/wechat/common/utils/AESUtil.java
  17. 31 0
      src/main/java/com/wechat/common/utils/BaseUtils.java
  18. 646 0
      src/main/java/com/wechat/common/utils/DateUtils.java
  19. 38 0
      src/main/java/com/wechat/common/utils/IOStreamUtils.java
  20. 123 0
      src/main/java/com/wechat/common/utils/JacksonUtils.java
  21. 133 0
      src/main/java/com/wechat/common/utils/MailUtil.java
  22. 153 0
      src/main/java/com/wechat/common/utils/MessageUtils.java
  23. 167 0
      src/main/java/com/wechat/common/utils/MvcUtil.java
  24. 243 0
      src/main/java/com/wechat/common/utils/NetworkUtils.java
  25. 285 0
      src/main/java/com/wechat/common/utils/NumberUtils.java
  26. 378 0
      src/main/java/com/wechat/common/utils/RSAUtils.java
  27. 90 0
      src/main/java/com/wechat/common/utils/SignUtils.java
  28. 108 0
      src/main/java/com/wechat/common/utils/SoapStudentUtil.java
  29. 108 0
      src/main/java/com/wechat/common/utils/SoapUtil.java
  30. 1124 0
      src/main/java/com/wechat/common/utils/StringsUtils.java
  31. 126 0
      src/main/java/com/wechat/common/utils/TextUtil.java
  32. 151 0
      src/main/java/com/wechat/common/utils/WsdlUtils.java
  33. 42 0
      src/main/java/com/wechat/common/utils/XmlUtils.java
  34. 49 0
      src/main/java/com/wechat/common/utils/view/JSONView.java
  35. 56 0
      src/main/java/com/wechat/config/ConfigReader.java
  36. 49 0
      src/main/java/com/wechat/controller/ActiveNoticeController.java
  37. 29 0
      src/main/java/com/wechat/controller/CleanUnActivatedUserController.java
  38. 41 0
      src/main/java/com/wechat/controller/CleanUpController.java
  39. 66 0
      src/main/java/com/wechat/controller/GoodsController.java
  40. 36 0
      src/main/java/com/wechat/controller/NoticeEnterpriseController.java
  41. 75 0
      src/main/java/com/wechat/controller/PvUvController.java
  42. 25 0
      src/main/java/com/wechat/controller/RemindBindMedicalReportController.java
  43. 148 0
      src/main/java/com/wechat/controller/SendSmsToUserController.java
  44. 37 0
      src/main/java/com/wechat/dao/AccessTokenRedisDao.java
  45. 24 0
      src/main/java/com/wechat/dao/AdCtrDao.java
  46. 144 0
      src/main/java/com/wechat/dao/AdCtrRedisDao.java
  47. 78 0
      src/main/java/com/wechat/dao/FriendRelationDao.java
  48. 93 0
      src/main/java/com/wechat/dao/JobPvRedisDao.java
  49. 24 0
      src/main/java/com/wechat/dao/JobUvPvDao.java
  50. 36 0
      src/main/java/com/wechat/dao/JsapiTicketRedisDao.java
  51. 33 0
      src/main/java/com/wechat/dao/MakeSureFriendshipRedisDao.java
  52. 34 0
      src/main/java/com/wechat/dao/MdeAdImagesMapper.java
  53. 43 0
      src/main/java/com/wechat/dao/MdeGoodsDao.java
  54. 25 0
      src/main/java/com/wechat/dao/MdeInformationMapper.java
  55. 40 0
      src/main/java/com/wechat/dao/MdeJobAdvertisedDao.java
  56. 27 0
      src/main/java/com/wechat/dao/MdeJobInvitationRelMapper.java
  57. 69 0
      src/main/java/com/wechat/dao/MdeOrdersMapper.java
  58. 165 0
      src/main/java/com/wechat/dao/MdeUserMapper.java
  59. 44 0
      src/main/java/com/wechat/dao/RedisGoodsSaleDao.java
  60. 21 0
      src/main/java/com/wechat/dao/TicketDetailMapper.java
  61. 55 0
      src/main/java/com/wechat/global/GlobalExceptionHandler.java
  62. 156 0
      src/main/java/com/wechat/global/GlobalLogAspect.java
  63. 42 0
      src/main/java/com/wechat/global/SysBatchException.java
  64. 14 0
      src/main/java/com/wechat/global/base/BaseController.java
  65. 20 0
      src/main/java/com/wechat/global/base/BaseService.java
  66. 182 0
      src/main/java/com/wechat/global/base/dao/IBaseSqlDao.java
  67. 123 0
      src/main/java/com/wechat/global/base/dao/Pagination.java
  68. 263 0
      src/main/java/com/wechat/global/base/dao/PagingResult.java
  69. 47 0
      src/main/java/com/wechat/global/base/dao/RedisGeneratorDao.java
  70. 83 0
      src/main/java/com/wechat/global/base/dao/RedisSetDao.java
  71. 88 0
      src/main/java/com/wechat/global/base/dao/RedisWithExpiryTimeDao.java
  72. 177 0
      src/main/java/com/wechat/global/base/dao/impl/BaseDao.java
  73. 334 0
      src/main/java/com/wechat/global/base/dao/impl/BaseSqlDaoImpl.java
  74. 62 0
      src/main/java/com/wechat/global/message/InfoMsg.java
  75. 94 0
      src/main/java/com/wechat/model/dbEntity/BaseEntity.java
  76. 104 0
      src/main/java/com/wechat/model/dbEntity/MdeAdCtrDtl.java
  77. 92 0
      src/main/java/com/wechat/model/dbEntity/MdeJobPvUv.java
  78. 658 0
      src/main/java/com/wechat/model/dbEntity/MdeOrders.java
  79. 427 0
      src/main/java/com/wechat/model/dbEntity/MdeUser.java
  80. 31 0
      src/main/java/com/wechat/model/dto/AccessTokenDto.java
  81. 44 0
      src/main/java/com/wechat/model/dto/AdvertisedAtTimeDto.java
  82. 44 0
      src/main/java/com/wechat/model/dto/AskUserInfoDto.java
  83. 80 0
      src/main/java/com/wechat/model/dto/AskUsersDto.java
  84. 49 0
      src/main/java/com/wechat/model/dto/ConfirmedUsersInfoDto.java
  85. 27 0
      src/main/java/com/wechat/model/dto/DateFromToDto.java
  86. 35 0
      src/main/java/com/wechat/model/dto/JsapiTicketDto.java
  87. 60 0
      src/main/java/com/wechat/model/dto/SubedPositionInfoDto.java
  88. 73 0
      src/main/java/com/wechat/model/dto/ToBeConfirmedUsersDto.java
  89. 39 0
      src/main/java/com/wechat/model/dto/UserSimple.java
  90. 59 0
      src/main/java/com/wechat/model/dto/UserSubedInfoDto.java
  91. 55 0
      src/main/java/com/wechat/model/dto/WsdlResponseDto.java
  92. 100 0
      src/main/java/com/wechat/model/dto/WsdlResponseInfoDto.java
  93. 55 0
      src/main/java/com/wechat/model/dto/WsdlResponseStudentDto.java
  94. 142 0
      src/main/java/com/wechat/model/dto/WsdlResponseStudentInfoDto.java
  95. 19 0
      src/main/java/com/wechat/model/dto/WxShortUrlDto.java
  96. 200 0
      src/main/java/com/wechat/model/dto/WxUserInfoDto.java
  97. 26 0
      src/main/java/com/wechat/model/requestDto/GroupInfoReq.java
  98. 25 0
      src/main/java/com/wechat/model/requestDto/TMsg2ParamsDto.java
  99. 16 0
      src/main/java/com/wechat/model/requestDto/TMsg3ParamsDto.java
  100. 23 0
      src/main/java/com/wechat/model/requestDto/TMsgBaseDto.java

+ 17 - 0
.gitignore

@@ -0,0 +1,17 @@
+# ---> Java
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+.idea/
+.settings/
+target/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+

+ 1 - 0
README.md

@@ -0,0 +1 @@
+#LZCT_BATCH

+ 328 - 0
pom.xml

@@ -0,0 +1,328 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.wechat</groupId>
+	<artifactId>RecruitmentBatch</artifactId>
+	<packaging>war</packaging>
+	<version>1.0.0</version>
+	<name>RecruitmentBatch Maven Webapp</name>
+	<url>http://maven.apache.org</url>
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+	</properties>
+	<dependencies>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<version>3.1.0</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.11</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-core</artifactId>
+			<version>4.1.4.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-webmvc</artifactId>
+			<version>4.1.4.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-jdbc</artifactId>
+			<version>4.1.4.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-tx</artifactId>
+			<version>4.1.4.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>aspectjweaver</artifactId>
+			<version>1.8.2</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-logging</groupId>
+			<artifactId>commons-logging</artifactId>
+			<version>1.2</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-core</artifactId>
+			<version>2.4.2</version>
+		</dependency>
+		<dependency>
+    		<groupId>commons-httpclient</groupId>
+    		<artifactId>commons-httpclient</artifactId>
+    		<version>3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>2.4.2</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-dbcp</groupId>
+			<artifactId>commons-dbcp</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-lang</groupId>
+			<artifactId>commons-lang</artifactId>
+			<version>2.6</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.17</version>
+		</dependency>
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+			<version>1.14.8</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-context</artifactId>
+			<version>4.1.4.RELEASE</version>
+		</dependency>
+		<!-- 发送邮件 -->
+		<dependency>
+			<groupId>javax.mail</groupId>
+			<artifactId>javax.mail-api</artifactId>
+			<version>1.5.3</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.mail</groupId>
+			<artifactId>javax.mail</artifactId>
+			<version>1.5.3</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.batch</groupId>
+			<artifactId>spring-batch-infrastructure</artifactId>
+			<version>3.0.5.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.data</groupId>
+			<artifactId>spring-data-redis</artifactId>
+			<version>1.5.2.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+			<version>1.7.12</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-aop</artifactId>
+			<version>4.1.4.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-context-support</artifactId>
+			<version>4.2.6.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-pool2</artifactId>
+			<version>2.4.2</version>
+		</dependency>
+		<dependency>
+			<groupId>redis.clients</groupId>
+			<artifactId>jedis</artifactId>
+			<version>2.7.3</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpclient</artifactId>
+			<version>4.5</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.json-lib</groupId>
+			<artifactId>json-lib</artifactId>
+			<version>2.4</version>
+			<classifier>jdk15</classifier>
+		</dependency>
+		<dependency>
+			<groupId>commons-fileupload</groupId>
+			<artifactId>commons-fileupload</artifactId>
+			<version>1.3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-core</artifactId>
+			<version>4.3.6.Final</version>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-entitymanager</artifactId>
+			<version>4.3.6.Final</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.data</groupId>
+			<artifactId>spring-data-jpa</artifactId>
+			<version>1.9.0.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>1.7.12</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sourceforge.jtds</groupId>
+			<artifactId>jtds</artifactId>
+			<version>1.2.4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.maven.plugins</groupId>
+			<artifactId>maven-resources-plugin</artifactId>
+			<version>2.4.3</version>
+		</dependency>
+		<dependency>
+		    <groupId>org.mybatis</groupId>
+		    <artifactId>mybatis-spring</artifactId>
+		    <version>2.0.4</version>
+		</dependency>
+		<dependency>
+		    <groupId>org.mybatis</groupId>
+		    <artifactId>mybatis</artifactId>
+		    <version>3.5.4</version>
+		</dependency>
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>5.1.36</version>
+		</dependency>
+		<dependency>
+			<groupId>org.bouncycastle</groupId>
+			<artifactId>bcprov-jdk15on</artifactId>
+			<version>1.52</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.axis</groupId>
+			<artifactId>axis</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.axis</groupId>
+			<artifactId>axis-jaxrpc</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-discovery</groupId>
+			<artifactId>commons-discovery</artifactId>
+			<version>0.5</version>
+		</dependency>
+		<dependency>
+			<groupId>wsdl4j</groupId>
+			<artifactId>wsdl4j</artifactId>
+			<version>1.6.3</version>
+		</dependency>
+		
+		<!-- http://mvnrepository.com/artifact/com.alibaba/fastjson -->
+		<dependency>
+		    <groupId>com.alibaba</groupId>
+		    <artifactId>fastjson</artifactId>
+		    <version>1.2.9</version>
+		</dependency>
+		<dependency>
+		    <groupId>org.quartz-scheduler</groupId>
+		    <artifactId>quartz</artifactId>
+		    <version>2.2.1</version>
+		</dependency>		
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-lang3</artifactId>
+			<version>3.3.2</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.mail</groupId>
+			<artifactId>javax.mail-api</artifactId>
+			<version>1.5.3</version>
+		</dependency>
+		<dependency>
+			<groupId>com.github.qcloudsms</groupId>
+			<artifactId>qcloudsms</artifactId>
+			<version>1.0.3</version>
+		</dependency>
+		<dependency>
+			<groupId>org.mybatis</groupId>
+			<artifactId>mybatis-typehandlers-jsr310</artifactId>
+			<version>1.0.2</version>
+		</dependency>
+		<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
+		<dependency>
+		    <groupId>commons-codec</groupId>
+		    <artifactId>commons-codec</artifactId>
+		    <version>1.11</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<finalName>RecruitmentBatch</finalName>
+		<defaultGoal>compile</defaultGoal>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>3.2</version>
+				<configuration>
+					<source>1.7</source>
+					<target>1.7</target>
+					<compilerArguments>
+						<extdirs>src/main/webapp/WEB-INF/lib</extdirs>
+					</compilerArguments>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<version>2.12.4</version>
+				<configuration>
+					<skipTests>true</skipTests>
+				</configuration>
+			</plugin>
+		</plugins>
+		<pluginManagement>
+			<plugins>
+				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+				<plugin>
+					<groupId>org.eclipse.m2e</groupId>
+					<artifactId>lifecycle-mapping</artifactId>
+					<version>1.0.0</version>
+					<configuration>
+						<lifecycleMappingMetadata>
+							<pluginExecutions>
+								<pluginExecution>
+									<pluginExecutionFilter>
+										<groupId>
+											org.apache.maven.plugins
+										</groupId>
+										<artifactId>
+											maven-compiler-plugin
+										</artifactId>
+										<versionRange>
+											[3.2,)
+										</versionRange>
+										<goals>
+											<goal>testCompile</goal>
+										</goals>
+									</pluginExecutionFilter>
+									<action>
+										<ignore></ignore>
+									</action>
+								</pluginExecution>
+							</pluginExecutions>
+						</lifecycleMappingMetadata>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+</project>

+ 31 - 0
src/main/java/com/wechat/activerequests/ActiveRequests.java

@@ -0,0 +1,31 @@
+//package com.wechat.activerequests;
+//
+//import org.apache.commons.logging.LogFactory;
+//
+//import com.wechat.activerequests.requests.IActiveRequest;
+//import com.wechat.activerequests.responses.BaseResponse;
+//import com.wechat.common.utils.JacksonUtils;
+//import com.wechat.common.utils.NetworkUtils;
+//import com.wechat.service.WeiXinService;
+//
+//public class ActiveRequests {
+//
+//    /**
+//     * 实际发送接口
+//     */
+//    public static BaseResponse send(IActiveRequest req) {
+//    	
+//        String url = req.getTargetUrl();
+//        String payload = req.getPayload();
+//        LogFactory.getLog(ActiveRequests.class).debug("Ready to send request to:" + url + "\n payload: "+ payload);
+//        BaseResponse rsp;
+//        if (payload == null) {
+//            rsp = NetworkUtils.getRemoteResponseAsJsonMethodGET(url, req.getResponseType());
+//        } else {
+//            url = String.format("%s?access_token=%s", url, WeiXinService.getInstance().getAccessToken());
+//            rsp = NetworkUtils.getRemoteResponseAsJsonWithStringPayload(url, payload, req.getResponseType());
+//        }
+//        LogFactory.getLog(ActiveRequests.class).debug("Responded: " + JacksonUtils.beautifulSerialize(rsp));
+//        return rsp;
+//    }
+//}

+ 7 - 0
src/main/java/com/wechat/activerequests/EnumUserIdentifierType.java

@@ -0,0 +1,7 @@
+package com.wechat.activerequests;
+
+public enum EnumUserIdentifierType {
+    OPENID,
+    QQ,
+    MOBILE
+}

+ 25 - 0
src/main/java/com/wechat/activerequests/responses/BaseResponse.java

@@ -0,0 +1,25 @@
+package com.wechat.activerequests.responses;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * 主动接口调用回执
+ */
+public class BaseResponse {
+    @JsonProperty("errcode")
+    private Long errCode = 0L;
+    @JsonProperty("errmsg")
+    private String errMsg;
+
+    public final Long getErrorCode() {
+        return errCode;
+    }
+
+    public final String getErrorMsg() {
+        return errMsg;
+    }
+
+    public boolean isSuccessful() {
+        return errCode == 0L;
+    }
+}

+ 19 - 0
src/main/java/com/wechat/activerequests/responses/CustomeServiceResponse.java

@@ -0,0 +1,19 @@
+package com.wechat.activerequests.responses;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public final class CustomeServiceResponse extends BaseResponse {
+    @JsonProperty("createtime")
+    private String createtime;
+
+    public String getCreateTime() {
+        return createtime;
+    }
+    
+    @JsonProperty("kf_account")
+    private String kfAccount;
+
+    public String getKfAccount() {
+        return kfAccount;
+    }
+}

+ 12 - 0
src/main/java/com/wechat/activerequests/responses/MessageIdResponse.java

@@ -0,0 +1,12 @@
+package com.wechat.activerequests.responses;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public final class MessageIdResponse extends BaseResponse {
+    @JsonProperty("msgid")
+    private Long messageId;
+
+    public Long getMessageId() {
+        return messageId;
+    }
+}

+ 367 - 0
src/main/java/com/wechat/common/CommonEnum.java

@@ -0,0 +1,367 @@
+package com.wechat.common;
+
+import com.wechat.common.utils.StringsUtils;
+
+public final class CommonEnum {
+
+    /** 不提供构造函数 */
+    private CommonEnum()
+    {
+    }
+    
+    
+    /**
+     * 是否删除
+     */
+    public enum IS_DELETE implements IEnum {
+        /** 0: 未删除 */
+        NO("未删除", "0"),
+        /** 1: 删除 */
+        YES("删除", "1");
+      
+
+        /** 值 */
+        private String label;
+
+        /** 键 */
+        private String code;
+
+        /**
+         * 取得枚举区分
+         * 
+         * @return String
+         */
+        public String getEnumName() {
+            return "IS_DELETE";
+        }
+
+        /**
+         * 构造函数
+         * 
+         * @param label String
+         * @param code String
+         */
+        private IS_DELETE(String label, String code)
+        {
+            this.label = label;
+            this.code = code;
+        }
+
+        /**
+         * 根据键取得值
+         * 
+         * @param code String
+         * @return String
+         */
+        public static String getEnumLabel(String code) {
+            for (IS_DELETE c : IS_DELETE.values()) {
+                if (StringsUtils.isEqual(c.getCode(), code)) {
+                    return c.label;
+                }
+            }
+            return null;
+        }
+
+        /**
+         * 根据值取得第一个匹配的键
+         * 
+         * @param label String
+         * @return String
+         */
+        public static String getEnumCode(String label) {
+            for (IS_DELETE c : IS_DELETE.values()) {
+                if (StringsUtils.isEqual(c.getLabel(), label)) {
+                    return c.code;
+                }
+            }
+            return null;
+        }
+
+
+        /**
+         * get
+         * 
+         * @return String
+         */
+        public String getLabel() {
+            return label;
+        }
+
+        /**
+         * set
+         * 
+         * @return String
+         */
+        public String getCode() {
+            return code;
+        }
+
+        /**
+         * String转换,中间加横杠
+         * 
+         * @return String
+         */
+        @Override
+        public String toString() {
+            return this.label;
+        }
+
+        /**
+         * 转换成value
+         * 
+         * @return String
+         */
+        public String toValueString() {
+            return String.valueOf(this.code);
+        }
+
+        /**
+         * 转换成label
+         * 
+         * @return String
+         */
+        public String toLabelString() {
+            return String.valueOf(this.label);
+        }
+    }
+    
+    
+
+    /**
+     * 微信客服消息类别
+     */
+    public enum SERVICE_MSG_TYPE {
+        /** 文本 */
+        TXT("text"),
+        /** 图片 */
+        IMAGE("image"),
+        /** 语音 */
+        VOICE("voice"),
+        /** 视频 */
+        VIDEO("video"),
+        /** 音乐 */
+        MUSIC("music"),
+        /** 图文 */
+        NEWS("news");
+      
+
+        /** 值 */
+        private String label;
+        
+        /**
+         * 构造函数
+         * 
+         * @param label String
+         * @param code String
+         */
+        private SERVICE_MSG_TYPE(String label)
+        {
+            this.label = label;
+        }
+
+        public String getLabel() {
+            return label;
+        }
+    }
+
+    
+    
+    /**
+     * 子菜单类型及关键词对应关系
+     */
+    public enum SUB_BTN_TYPE implements IEnum {
+        /** click - key */
+    	CLICK("key", "click"),
+        /** view - url */
+        VIEW("url", "view");
+      
+
+        /** 值 */
+        private String label;
+
+        /** 键 */
+        private String code;
+
+
+        /**
+         * 构造函数
+         * 
+         * @param label String
+         * @param code String
+         */
+        private SUB_BTN_TYPE(String label, String code)
+        {
+            this.label = label;
+            this.code = code;
+        }
+
+        /**
+         * 根据键取得值
+         * 
+         * @param code String
+         * @return String
+         */
+        public static String getEnumLabel(String code) {
+            for (SUB_BTN_TYPE c : SUB_BTN_TYPE.values()) {
+                if (StringsUtils.isEqual(c.getCode(), code)) {
+                    return c.label;
+                }
+            }
+            return null;
+        }
+
+        /**
+         * 根据值取得第一个匹配的键
+         * 
+         * @param label String
+         * @return String
+         */
+        public static String getEnumCode(String label) {
+            for (SUB_BTN_TYPE c : SUB_BTN_TYPE.values()) {
+                if (StringsUtils.isEqual(c.getLabel(), label)) {
+                    return c.code;
+                }
+            }
+            return null;
+        }
+
+
+        /**
+         * get
+         * 
+         * @return String
+         */
+        public String getLabel() {
+            return label;
+        }
+
+        /**
+         * set
+         * 
+         * @return String
+         */
+        public String getCode() {
+            return code;
+        }
+
+    }
+    
+    
+    /**
+     * 退款原因
+     */
+    public enum REFOUND_REASON implements IEnum {
+        ZERO("团购失败", "0"),
+        ONE("随机优惠减免", "1"),
+        TWO("超出成团指定人数", "2"),
+        THREE("售后维权", "3"),
+        FOUR("您参与的抽奖活动未中奖", "4"),
+        NINE("淘豆商城", "9");
+
+        /** 值 */
+        private String label;
+
+        /** 键 */
+        private String code;
+
+        /**
+         * 取得枚举区分
+         * 
+         * @return String
+         */
+        public String getEnumName() {
+            return "REFOUND_REASON";
+        }
+
+        /**
+         * 构造函数
+         * 
+         * @param label String
+         * @param code String
+         */
+        private REFOUND_REASON(String label, String code)
+        {
+            this.label = label;
+            this.code = code;
+        }
+
+        /**
+         * 根据键取得值
+         * 
+         * @param code String
+         * @return String
+         */
+        public static String getEnumLabel(String code) {
+            for (REFOUND_REASON c : REFOUND_REASON.values()) {
+                if (StringsUtils.isEqual(c.getCode(), code)) {
+                    return c.label;
+                }
+            }
+            return null;
+        }
+
+        /**
+         * 根据值取得第一个匹配的键
+         * 
+         * @param label String
+         * @return String
+         */
+        public static String getEnumCode(String label) {
+            for (REFOUND_REASON c : REFOUND_REASON.values()) {
+                if (StringsUtils.isEqual(c.getLabel(), label)) {
+                    return c.code;
+                }
+            }
+            return null;
+        }
+
+
+        /**
+         * get
+         * 
+         * @return String
+         */
+        public String getLabel() {
+            return label;
+        }
+
+        /**
+         * set
+         * 
+         * @return String
+         */
+        public String getCode() {
+            return code;
+        }
+
+        /**
+         * String转换,中间加横杠
+         * 
+         * @return String
+         */
+        @Override
+        public String toString() {
+            return this.label;
+        }
+
+        /**
+         * 转换成value
+         * 
+         * @return String
+         */
+        public String toValueString() {
+            return String.valueOf(this.code);
+        }
+
+        /**
+         * 转换成label
+         * 
+         * @return String
+         */
+        public String toLabelString() {
+            return String.valueOf(this.label);
+        }
+    }
+
+}
+

+ 77 - 0
src/main/java/com/wechat/common/CommonHelper.java

@@ -0,0 +1,77 @@
+package com.wechat.common;
+
+import java.io.InputStream;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import com.wechat.common.utils.MailUtil;
+import com.wechat.global.message.InfoMsg;
+
+import com.wechat.model.dbEntity.MdeUser;
+
+/**
+ * The common method shared in all project
+ * 
+ * @author Administrator
+ */
+@Component
+public class CommonHelper {
+    //url根目录
+    @Value("#{configProperties['url.base']}")
+    private String           urlBase;
+    
+    // 模板消息发送用url
+    @Value("#{configProperties['weixin.tmsg.send']}")
+    private  String        tmsgSendUrl;
+
+    private static final Log log = LogFactory.getLog(CommonHelper.class);
+
+    public String getIRealIPAddr(HttpServletRequest request) {
+        String ip = request.getHeader("x-forwarded-for");
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip) || "null".equalsIgnoreCase(ip)) {
+            ip = request.getHeader("Proxy-Client-IP");
+        }
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip) || "null".equalsIgnoreCase(ip)) {
+            ip = request.getHeader("WL-Proxy-Client-IP");
+        }
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip) || "null".equalsIgnoreCase(ip)) {
+            ip = request.getRemoteAddr();
+        }
+        return ip;
+    }
+
+    /**
+     * 验证是否是手机号码
+     * 
+     * @param mobile
+     * @return
+     */
+    public boolean isMobile(String mobile) {
+        Pattern p = null;
+        Matcher m = null;
+        p = Pattern.compile("^[1][3,4,5,7,8][0-9]{9}$"); // 验证手机号
+        m = p.matcher(mobile);
+        return m.matches();
+    }
+
+    /**
+     * 取得完整的url
+     * 
+     * @param mobile
+     * @return
+     */
+    public String getUrl(String urlChild) {
+        return urlBase + urlChild;
+    }
+
+
+}

+ 105 - 0
src/main/java/com/wechat/common/Constants.java

@@ -0,0 +1,105 @@
+/**
+ * Title: Constants.java Package com.linggou.net.base All rights Reserved, Designed By soyo Copyright: Copyright(C) 2010-2015 Company: soyo SuZhou LTD. Create By shensuoyao Create
+ * Date 2014年8月14日 下午2:03:45 Version V1.0
+ */
+package com.wechat.common;
+
+/**
+ * @ClassName: Constants
+ * @Description: 公共常量
+ * @author shensuoyao
+ */
+public class Constants {
+
+    //============  自定义常量    =================
+    /** 处理结果 1:成功 */
+    public static final int      RESULT_SUCCESS  = 1;
+
+    /** 处理结果 0:失败 */
+    public static final int      RESULT_ERROR    = 0;
+
+    /** 处理结果 9:更新0件、没数据 */
+    public static final int      RESULT_WARNING  = 9;
+    
+    /** 错误code 0 */
+    public static final String   STR_ZERO        = "0";
+    
+    /** 错误code 40001 */
+    public static final String   STR_TOKEN_ERO   = "40001";
+    
+    /** 错误code 0 */
+    public static final String   STR_OK   = "0";
+
+
+    // ============== 固定文字 =================
+    /** 空文字 */
+    public static final String   EMPTY           = "";
+
+    /** 1 */
+    public static final String   ONE             = "1.";
+
+    /** 2 */
+    public static final String   TWO             = "2.";
+
+    /** 3 */
+    public static final String   THREE           = "3.";
+
+    /** 4 */
+    public static final String   FOUR            = "4.";
+
+    /** 5 */
+    public static final String   FIVE            = "5.";
+
+    /** base url */
+    public static final String   URL_BEGIN       = "\n<a href='";
+
+    public static final String   URL_BEGIN_NOBR  = "<a href='";
+
+    public static final String   URL_MIDDLE      = "'>";
+
+    public static final String   URL_END         = "</a>\n";
+    
+    public static final String   URL_END_NOBR    = "</a>";
+
+    /** 换行符 */
+    public static final String   NEXT_LINE       = "\n";
+
+    /** 回车 换行 */
+    public static final String   ENTER_LINE      = "\r\n";
+    
+	/** 下划线 */
+	public static final String UNDER_LINE = "_";
+    
+    /** 添加好友通知运行时间-key */
+    public static final String   RUNTIME_ADD_FRIENDS_NOTICE_WX   = "addFriendsNoticeWx";
+    
+    /** 添加好友通知运行时间-key */
+    public static final String   RUNTIME_ADD_FRIENDS_NOTICE_MSG   = "addFriendsNoticeMsg";
+    
+    /** 好友确认通知运行时间-key */
+    public static final String   RUNTIME_ADD_FRIENDS_SUCCESS_WX   = "addFriendsSuccessWx";
+    
+    /** 好友确认通知运行时间-key */
+    public static final String   RUNTIME_ADD_FRIENDS_SUCCESS_MSG   = "addFriendsSuccessMsg";
+    
+	//redis 用 key
+	//商品的销售额
+	public static final String REDIS_GOODS_SALE="goodsSale_";
+	//简历投递提醒日期
+	public static final String REDIS_NOTICE_CV="noticeCv_date";
+	//职位PV UV信息统计
+	public static final String REDIS_JOB_PV="jobPv_";
+	public static final String REDIS_JOB_UV="jobUv_";
+	
+	/** 广告点击率 信息统计 */
+	public static final String REDIS_AD_SHOW="adShow_";
+	public static final String REDIS_AD_CLICK="adClick_";
+	
+	//职位订阅提醒日期
+	public static final String REDIS_NOTICE_NEWJOB="noticeNewJob_date";
+	
+	//邮件发送昵称
+	public static final String EMAIL_NICK="门墩儿";
+
+ 
+}

+ 20 - 0
src/main/java/com/wechat/common/IEnum.java

@@ -0,0 +1,20 @@
+package com.wechat.common;
+/**
+ * @author ma.jinchang
+ */
+public interface IEnum {
+
+    /**
+     * 取得编号
+     * 
+     * @return 枚举code
+     */
+    public String getCode();
+
+    /**
+     * 取得label
+     * 
+     * @return 枚举名
+     */
+    public String getLabel();
+}

+ 204 - 0
src/main/java/com/wechat/common/TwoDimensionCode.java

@@ -0,0 +1,204 @@
+package com.wechat.common;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.imageio.ImageIO;
+
+import jp.sourceforge.qrcode.QRCodeDecoder;
+import jp.sourceforge.qrcode.exception.DecodingFailedException;
+
+import com.swetake.util.Qrcode;
+
+public class TwoDimensionCode {
+
+    public TwoDimensionCode() {
+        System.out.println(1);
+    }
+
+    /**
+     * 生成二维码(QRCode)图片
+     *
+     * @param content 存储内容
+     * @param imgPath 图片路径
+     */
+    public static void encoderQRCode(String content, String imgPath) {
+        encoderQRCode(content, imgPath, "png", 7);
+    }
+
+    /**
+     * 生成二维码(QRCode)图片
+     *
+     * @param content 存储内容
+     * @param output  输出流
+     */
+    public static void encoderQRCode(String content, OutputStream output) {
+        encoderQRCode(content, output, "png", 7);
+    }
+
+    /**
+     * 生成二维码(QRCode)图片
+     *
+     * @param content 存储内容
+     * @param imgPath 图片路径
+     * @param imgType 图片类型
+     */
+    public static void encoderQRCode(String content, String imgPath, String imgType) {
+        encoderQRCode(content, imgPath, imgType, 7);
+    }
+
+    /**
+     * 生成二维码(QRCode)图片
+     *
+     * @param content 存储内容
+     * @param output  输出流
+     * @param imgType 图片类型
+     */
+    public static void encoderQRCode(String content, OutputStream output, String imgType) {
+        encoderQRCode(content, output, imgType, 7);
+    }
+
+    /**
+     * 生成二维码(QRCode)图片
+     *
+     * @param content 存储内容
+     * @param imgPath 图片路径
+     * @param imgType 图片类型
+     * @param size    二维码尺寸
+     */
+    public static void encoderQRCode(String content, String imgPath, String imgType, int size) {
+        try {
+            BufferedImage bufImg = qRCodeCommon(content, imgType, size);
+
+            File imgFile = new File(imgPath);
+            // 生成二维码QRCode图片  
+            ImageIO.write(bufImg, imgType, imgFile);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 生成二维码(QRCode)图片
+     *
+     * @param content 存储内容
+     * @param output  输出流
+     * @param imgType 图片类型
+     * @param size    二维码尺寸
+     */
+    public static void encoderQRCode(String content, OutputStream output, String imgType, int size) {
+        try {
+            BufferedImage bufImg = qRCodeCommon(content, imgType, size);
+            // 生成二维码QRCode图片  
+            ImageIO.write(bufImg, imgType, output);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 生成二维码(QRCode)图片的公共方法
+     *
+     * @param content 存储内容
+     * @param imgType 图片类型
+     * @param size    二维码尺寸
+     * @return
+     */
+    private static BufferedImage qRCodeCommon(String content, String imgType, int size) {
+        BufferedImage bufImg = null;
+        try {
+            Qrcode qrcodeHandler = new Qrcode();
+            // 设置二维码排错率,可选L(7%)、M(15%)、Q(25%)、H(30%),排错率越高可存储的信息越少,但对二维码清晰度的要求越小  
+            qrcodeHandler.setQrcodeErrorCorrect('H');
+            qrcodeHandler.setQrcodeEncodeMode('B');
+            // 设置设置二维码尺寸,取值范围1-40,值越大尺寸越大,可存储的信息越大  
+            qrcodeHandler.setQrcodeVersion(size);
+            // 获得内容的字节数组,设置编码格式  
+            byte[] contentBytes = content.getBytes("utf-8");
+            // 图片尺寸  
+//            int imgSize = 4+results *3;
+            int imgSize = 67 + 12 * (size - 1);
+            bufImg = new BufferedImage(imgSize, imgSize, BufferedImage.TYPE_INT_RGB);
+            Graphics2D gs = bufImg.createGraphics();
+            // 设置背景颜色  
+            gs.setBackground(Color.WHITE);
+            gs.clearRect(0, 0, imgSize, imgSize);
+
+            // 设定图像颜色> BLACK  
+            gs.setColor(Color.BLACK);
+            // 设置偏移量,不设置可能导致解析出错  
+            int pixoff = 2;
+            // 输出内容> 二维码  
+            if (contentBytes.length > 0 && contentBytes.length < 800) {
+                boolean[][] codeOut = qrcodeHandler.calQrcode(contentBytes);
+                for (int i = 0; i < codeOut.length; i++) {
+                    for (int j = 0; j < codeOut.length; j++) {
+                        if (codeOut[j][i]) {
+                            gs.fillRect(j * 3 + pixoff, i * 3 + pixoff, 3, 3);
+                        }
+                    }
+                }
+            } else {
+                throw new Exception("QRCode content bytes length = " + contentBytes.length + " not in [0, 800].");
+            }
+            gs.dispose();
+            bufImg.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return bufImg;
+    }
+
+    /**
+     * 解析二维码(QRCode)
+     *
+     * @param imgPath 图片路径
+     * @return
+     */
+    public static String decoderQRCode(String imgPath) {
+        // QRCode 二维码图片的文件  
+        File imageFile = new File(imgPath);
+        BufferedImage bufImg = null;
+        String content = null;
+        try {
+            bufImg = ImageIO.read(imageFile);
+            QRCodeDecoder decoder = new QRCodeDecoder();
+            content = new String(decoder.decode(new TwoDimensionCodeImage(bufImg)), "utf-8");
+        } catch (IOException e) {
+            System.out.println("Error: " + e.getMessage());
+            e.printStackTrace();
+        } catch (DecodingFailedException dfe) {
+            System.out.println("Error: " + dfe.getMessage());
+            dfe.printStackTrace();
+        }
+        return content;
+    }
+
+    /**
+     * 解析二维码(QRCode)
+     *
+     * @param input 输入流
+     * @return
+     */
+    public static String decoderQRCode(InputStream input) {
+        BufferedImage bufImg = null;
+        String content = null;
+        try {
+            bufImg = ImageIO.read(input);
+            QRCodeDecoder decoder = new QRCodeDecoder();
+            content = new String(decoder.decode(new TwoDimensionCodeImage(bufImg)), "utf-8");
+        } catch (IOException e) {
+            System.out.println("Error: " + e.getMessage());
+            e.printStackTrace();
+        } catch (DecodingFailedException dfe) {
+            System.out.println("Error: " + dfe.getMessage());
+            dfe.printStackTrace();
+        }
+        return content;
+    }
+}

+ 29 - 0
src/main/java/com/wechat/common/TwoDimensionCodeImage.java

@@ -0,0 +1,29 @@
+package com.wechat.common;
+
+import java.awt.image.BufferedImage;
+
+import jp.sourceforge.qrcode.data.QRCodeImage;
+
+public class TwoDimensionCodeImage implements QRCodeImage {
+
+    BufferedImage bufImg;  
+    
+    public TwoDimensionCodeImage(BufferedImage bufImg) {  
+        this.bufImg = bufImg;  
+    }  
+      
+    @Override  
+    public int getHeight() {  
+        return bufImg.getHeight();  
+    }  
+  
+    @Override  
+    public int getPixel(int x, int y) {  
+        return bufImg.getRGB(x, y);  
+    }  
+  
+    @Override  
+    public int getWidth() {  
+        return bufImg.getWidth();  
+    }  
+}

+ 32 - 0
src/main/java/com/wechat/common/annotation/MyBatisDao.java

@@ -0,0 +1,32 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * 标识MyBatis的DAO,方便{@link org.mybatis.spring.mapper.MapperScannerConfigurer}的扫描。 
+ * @author thinkgem
+ * @version 2013-8-28
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Documented
+@Component
+public @interface MyBatisDao {
+	
+	/**
+	 * The value may indicate a suggestion for a logical component name,
+	 * to be turned into a Spring bean in case of an autodetected component.
+	 * @return the suggested component name, if any
+	 */
+	String value() default "";
+
+}

+ 143 - 0
src/main/java/com/wechat/common/utils/AESUtil.java

@@ -0,0 +1,143 @@
+package com.wechat.common.utils;
+
+import java.io.UnsupportedEncodingException;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.KeyGenerator;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+
+public final class AESUtil extends BaseUtils{
+    // 定义加密算法
+    private static final String ALGORITHM = "AES";
+
+    private AESUtil() {
+    }
+
+    /**
+     * @param strCustomKey 自定义密钥,对于AES算法,请输入16||24||32个ASCII字符
+     * @return 密钥对象
+     * @throws UnsupportedEncodingException
+     */
+    public static SecretKey createKey(String strCustomKey) throws UnsupportedEncodingException {
+        SecretKey desKey = null;
+
+        desKey = new SecretKeySpec(strCustomKey.getBytes("UTF-8"), ALGORITHM);
+
+        return desKey;
+    }
+
+    /**
+     * 加密数据
+     * 
+     * @param para 要加密的数据
+     * @param deskey 密钥
+     * @return 加密后的密文
+     * @throws UnsupportedEncodingException
+     */
+    public static byte[] encrypt(String content, String password) {
+        try {
+            KeyGenerator kgen = KeyGenerator.getInstance("AES");
+            SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
+            secureRandom.setSeed(password.getBytes());
+            kgen.init(128, secureRandom);
+            SecretKey secretKey = kgen.generateKey();
+            byte[] enCodeFormat = secretKey.getEncoded();
+            SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
+            Cipher cipher = Cipher.getInstance("AES");// 创建密码器   
+            byte[] byteContent = content.getBytes("utf-8");
+            cipher.init(Cipher.ENCRYPT_MODE, key);// 初始化   
+            byte[] result = cipher.doFinal(byteContent);
+            return result; // 加密   
+        } catch (NoSuchAlgorithmException e) {
+            log.error(e);
+        } catch (NoSuchPaddingException e) {
+            log.error(e);
+        } catch (InvalidKeyException e) {
+            log.error(e);
+        } catch (UnsupportedEncodingException e) {
+            log.error(e);
+        } catch (IllegalBlockSizeException e) {
+            log.error(e);
+        } catch (BadPaddingException e) {
+            log.error(e);
+        }
+        return null;
+    }
+
+    /**
+     * 解密
+     * 
+     * @param content 密文
+     * @param password 密钥
+     * @return 解密后的内容
+     */
+    public static byte[] decrypt(byte[] content, String password) {
+        try {
+            KeyGenerator kgen = KeyGenerator.getInstance("AES");
+            SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
+            secureRandom.setSeed(password.getBytes());
+            kgen.init(128, secureRandom);
+            SecretKey secretKey = kgen.generateKey();
+            byte[] enCodeFormat = secretKey.getEncoded();
+            SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
+            Cipher cipher = Cipher.getInstance("AES");// 创建密码器   
+            cipher.init(Cipher.DECRYPT_MODE, key);// 初始化   
+            byte[] result = cipher.doFinal(content);
+            return result; // 加密   
+        } catch (NoSuchAlgorithmException e) {
+            log.error("",e);
+        } catch (NoSuchPaddingException e) {
+            log.error("",e);
+        } catch (InvalidKeyException e) {
+            log.error("",e);
+        } catch (IllegalBlockSizeException e) {
+            log.error("",e);
+        } catch (BadPaddingException e) {
+            log.error("",e);
+        }
+        return null;
+    }
+
+    /**
+     * 将二进制转换成16进制
+     * 
+     * @param buf
+     * @return
+     */
+    public static String parseByte2HexStr(byte buf[]) {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < buf.length; i++) {
+            String hex = Integer.toHexString(buf[i] & 0xFF);
+            if (hex.length() == 1) {
+                hex = '0' + hex;
+            }
+            sb.append(hex.toUpperCase());
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 将16进制转换为二进制
+     * 
+     * @param hexStr
+     * @return 转换后结果
+     */
+    public static byte[] parseHexStr2Byte(String hexStr) {
+        if (hexStr.length() < 1)
+            return null;
+        byte[] result = new byte[hexStr.length() / 2];
+        for (int i = 0; i < hexStr.length() / 2; i++) {
+            int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16);
+            int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16);
+            result[i] = (byte) (high * 16 + low);
+        }
+        return result;
+    }
+}

+ 31 - 0
src/main/java/com/wechat/common/utils/BaseUtils.java

@@ -0,0 +1,31 @@
+
+package com.wechat.common.utils;
+
+import java.util.Date;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @version 1.0
+ * @author ma.jinchang
+ * @createDate 2012-9-7
+ * @modifyBy ma.jinchang
+ * @modifyDate 2012-9-7
+ */
+public class BaseUtils {
+    /**
+     * 日志工具
+     */
+    protected static final Log log = LogFactory.getLog(BaseUtils.class);
+    
+	/**
+	 * 生成分享用的职位id
+	 * @param createDate
+	 * @param jobId
+	 * @return
+	 */
+	public static String getShareJob(Date createDate,int jobId) {
+		return String.valueOf((createDate.getTime())/1000)+String.valueOf(jobId);
+	}
+}

+ 646 - 0
src/main/java/com/wechat/common/utils/DateUtils.java

@@ -0,0 +1,646 @@
+package com.wechat.common.utils;
+
+import java.text.Format;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Calendar;
+import java.util.Date;
+
+public class DateUtils extends BaseUtils {
+
+    /**
+     * 日期格式
+     */
+    public static String PATTEN_YMD = "yyyy-MM-dd";
+    
+    /**
+     * 日期格式2yyyy/MM/dd
+     */
+    public static String PATTEN_YMD2 = "yyyy/MM/dd";
+    
+    /**
+     * 日期格式
+     */
+    public static String PATTEN_YMTOW = "yyyy-MM";
+
+    /**
+     * 日期时间 格式
+     */
+    public static String PATTEN_HMS = "yyyy-MM-dd HH:mm:ss";
+    
+    /**
+     * 日期格式,不带分隔符 yyyyMMddHHmmss
+     */
+    public static String PATTEN_YMD_HH_MM_SS_SEPRATE = "yyyyMMddHHmmss";
+
+    /**
+     * 日期时间 格式
+     */
+    public static String PATTEN_HM = "yyyy-MM-dd HH:mm";
+
+    /**
+     * 带毫秒日期格式
+     */
+    public static String PATTEN_SSS = "yyyy-MM-dd HH:mm:ss.SSS";
+
+    /**
+     * 日期格式,不带分隔符
+     */
+    public static String PATTEN_YMD_NO_SEPRATE = "yyyyMMdd";
+
+    /**
+     * 文件重命名专用日期格式
+     */
+    public static String PATTEN_FILE_RENAME = "yyyyMMddHHmmssSSS";
+    
+    /**
+     * HH:mm:ss
+     */
+    public static String PATTEN_ONLYHMS = "HH:mm:ss";
+    
+    /**
+     * 日期格式
+     */
+    public static String PATTEN_YMDH = "yyyy-MM-dd HH";
+
+    public static String PATTEN_YM = "yyyyMM";
+    public static String PATTEN_Y = "yyyy";
+    
+    public static String PATTEN_MD = "MM/dd";
+
+    /**
+     * 大于
+     */
+    public static final String COMPARE_TYPE_GT = "GT";
+
+    /**
+     * 大于等于
+     */
+    public static final String COMPARE_TYPE_GTE = "GTE";
+
+    /**
+     * 不等于
+     */
+    public static final String COMPARE_TYPE_NE = "NE";
+
+    /**
+     * 日期验证复杂正则
+     */
+    public static String DATE_REG = "([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-9])))";
+
+    /**
+     * 日期验证简单正则
+     */
+    private static String DATE_REG_SIMPLE = "^\\d{4}-\\d{2}-\\d{2}$";
+
+    /**
+     * 默认的日期间隔符
+     */
+    public static String DEFAULT_SEPERATOR = "-";
+    
+    /**
+     * 股票市场开始时的点
+     */
+    public static int MARKET_START_POINT = 570;
+
+    /**
+     * 提供日期格式化工具
+     * 
+     * @param pattern 日期格式
+     * @return 格式化工具类
+     */
+    private static SimpleDateFormat getDateParser(String pattern) {
+        return new SimpleDateFormat(pattern);
+    }
+
+    /**
+     * 将当前时间转换成指定的格式显示
+     * 
+     * @param pattern 日期格式
+     * @return 转换后的日期字符串
+     */
+    public static String dateToString(String pattern) {
+        return getDateParser(pattern).format(new Date());
+    }
+
+    /**
+     * 将指定日期转换成指定格式的字符串
+     * 
+     * @param date 日期
+     * @param pattern 日期格式
+     * @return 转换后的日期字符串
+     */
+    public static String dateToString(Date date, String pattern) {
+        return getDateParser(pattern).format(date);
+    }
+
+    /**
+     * 将指定格式的时间转换成Date类型
+     * 
+     * @param date 指定日期
+     * @param pattern 格式
+     * @return 转换后日期
+     * @throws Exception 转换异常时,返回系统异常
+     */
+    public static Date stringToDate(String date, String pattern){
+        if (StringsUtils.isEmpty(pattern)) {
+            pattern = PATTEN_YMD;
+        }
+        if (StringsUtils.isEmpty(date)) {
+            return null;
+        }
+        Date result = null;
+        try {
+            result = getDateParser(pattern).parse(date);
+        } catch (ParseException e) {
+            log.error("***********指定格式的时间转换成Date类型异常,date:【"+date+"】*******************",e);
+        	return null;
+        }
+        return result;
+    }
+
+    /**
+     * 将指定格式的时间转换成其他日期格式
+     * 
+     * @param date 指定日期
+     * @param pattern 指定格式
+     * @param resultPattern 目标格式
+     * @return 转换后的日期字符串
+     * @throws Exception 转换异常,抛出系统异常
+     */
+    public static String changeDateFormat(String date, String pattern, String resultPattern) throws Exception {
+        String result = "";
+        try {
+            Date dateTmp = null;
+            dateTmp = getDateParser(pattern).parse(date);
+            result = getDateParser(resultPattern).format(dateTmp);
+        } catch (ParseException e) {
+            throw e;
+        }
+        return result;
+    }
+
+    /**
+     * 获取前一天日期
+     * 
+     * @param fm 日期格式
+     * @return 前一天 日期
+     * @throws Exception 转换异常,抛出系统异常
+     */
+    public static String stringToBeforeDate(String fm) {
+        String result;
+        Calendar date = Calendar.getInstance();
+        date.add(Calendar.DAY_OF_MONTH, -1);
+        Format format = new SimpleDateFormat(fm);
+        result = format.format(date.getTime());
+        return result;
+    }
+
+    /**
+     * 获取当前日期前30天的日期
+     * 
+     * @param fm 日期格式
+     * @return 当前日期前三十天的日期
+     * @throws Exception 转换异常,抛出系统异常
+     */
+    public static String thirtyDaysBeforeNow(String fm) throws Exception {
+        String result;
+        Calendar date = Calendar.getInstance();
+        date.add(Calendar.DAY_OF_MONTH, -30);
+        Format format = new SimpleDateFormat(fm);
+        result = format.format(date.getTime());
+        return result;
+    }
+
+    /**
+     * 获取指定日期的前30天的日期
+     * 
+     * @param startDate 指定日期
+     * @param fm 格式
+     * @return 指定日期前30天的日期
+     * @throws Exception 转换异常,抛出系统异常
+     */
+    public static String thirtyDaysBeforeSpecifiedDate(Date startDate, String fm) throws Exception {
+        String result;
+        Calendar date = Calendar.getInstance();
+        date.setTime(startDate);
+        date.add(Calendar.DAY_OF_MONTH, -30);
+        Format format = new SimpleDateFormat(fm);
+        result = format.format(date.getTime());
+        return result;
+    }
+
+    /**
+     * 获取当天日期
+     * 
+     * @param fm 日期格式
+     * @return 当天日期
+     * @throws Exception 转换异常,抛出系统异常
+     */
+    public static String stringToToday(String fm) throws Exception {
+        String result;
+        Format format = new SimpleDateFormat(fm);
+        result = format.format(new Date());
+        return result;
+    }
+
+    /**
+     * 返回某月的第一天
+     * 
+     * @param year 年
+     * @param month 月
+     * @return 某月的第一天
+     * @throws Exception 
+     */
+    public static Date getFirstDayOfMonth(String year, String month) throws Exception {
+        //验证空
+        if (StringsUtils.isEmpty(year) || StringsUtils.isEmpty(month)) {
+            return null;
+        }
+        //验证年
+        if (!StringsUtils.matches(year, "\\d{4}")) {
+            return null;
+        }
+        //验证月
+        int monthValue = Integer.parseInt(month);
+        if (monthValue > 12 || monthValue < 1) {
+            return null;
+        }
+        //改成  yyyy-MM-dd格式
+        StringBuilder sb = new StringBuilder();
+        sb.append(year);
+        sb.append(DEFAULT_SEPERATOR);
+        sb.append(month);
+        sb.append(DEFAULT_SEPERATOR);
+        sb.append("01");
+        return stringToDate(sb.toString(), PATTEN_YMD);
+    }
+
+    /**
+     * 返回某月的最后一天
+     * 
+     * @param year 年
+     * @param month 月
+     * @return 某月的最后一天
+     */
+    public static Date getLastDayOfMonth(String year, String month) {
+        //验证空
+        if (StringsUtils.isEmpty(year) || StringsUtils.isEmpty(month)) {
+            return null;
+        }
+        //验证年
+        if (!StringsUtils.matches(year, "\\d{4}")) {
+            return null;
+        }
+        //验证月
+        int monthValue = Integer.parseInt(month);
+        if (monthValue > 12 || monthValue < 1) {
+            return null;
+        }
+        Calendar cal = Calendar.getInstance();
+        cal.set(Calendar.YEAR, Integer.parseInt(year));
+        cal.set(Calendar.MONTH, monthValue - 1);
+        cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        return cal.getTime();
+    }
+
+    /**
+     * 返回yyyy-mm-dd格式日期
+     * 
+     * @param date 传入的日期
+     * @return yyyy-mm-dd格式日期
+     */
+    public static String formatString(String date) {
+
+        if (StringsUtils.isEmpty(date) || !checkIsActiveDate(date)) {
+            return "";
+        }
+        if (date.length() < 10) {
+            return date;
+        } else {
+            return date.substring(0, 10);
+        }
+    }
+
+    /**
+     * 返回指定格式的日期字符串
+     * 
+     * @param date 待转化的日期数据
+     * @param dateFm 日期格式
+     * @return 指定格式的日期字符串
+     */
+    public static String formatString(Date date, String dateFm) {
+        if (StringsUtils.isEmpty(dateFm)) {
+            dateFm = PATTEN_YMD;
+        }
+        if (null == date) {
+            return "";
+        }
+        Format fm = new SimpleDateFormat(dateFm);
+        return fm.format(date);
+    }
+    
+    /**
+     * 返回指定格式的日期字符串
+     * 
+     * @param date 待转化的日期数据
+     * @param dateFm 日期格式
+     * @return 指定格式的日期字符串
+     */
+    public static String localDateformatString(LocalDate date, String dateFm) {
+        if (StringsUtils.isEmpty(dateFm)) {
+            dateFm = PATTEN_YMD;
+        }
+        if (null == date) {
+        	date=LocalDate.now();
+        }
+        
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateFm);
+        String dateStr = dateTimeFormatter.format(date);
+        return dateStr;
+    }
+    
+    public static String localDateTimeformatString(LocalDateTime time, String dateFm) {
+        if (StringsUtils.isEmpty(dateFm)) {
+            dateFm = PATTEN_YMD;
+        }
+        if (null == time) {
+        	time=LocalDateTime.now();
+        }
+        
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateFm);
+        String dateStr = dateTimeFormatter.format(time);
+        return dateStr;
+    }
+    
+
+    /**
+     * 获取当前日期字符串
+     * 
+     * @param formart 日期格式
+     * @return 当前日期字符串
+     */
+    public static String getDateFormatStr(String formart) {
+        return new SimpleDateFormat(formart).format(new java.util.Date());
+    }
+    
+    public static String getLocalDateNowStr(String formart) {
+        return localDateformatString(LocalDate.now(),formart);
+    }
+
+
+    /**
+     * 日期加年
+     * 
+     * @param date 日期
+     * @param spans 增加数量
+     * @return 增加X年后的日期
+     */
+    public static Date addYear(Date date, int spans) {
+        return addDate(date, Calendar.YEAR, spans);
+    }
+
+    /**
+     * 日期加月
+     * 
+     * @param date 日期
+     * @param spans 增加数量
+     * @return 加月后的日期
+     */
+    public static Date addMonth(Date date, int spans) {
+        return addDate(date, Calendar.MONTH, spans);
+    }
+
+    /**
+     * 日期加天
+     * 
+     * @param date 日期
+     * @param spans 增加数量
+     * @return 加天后的日期
+     */
+    public static Date addDay(Date date, int spans) {
+        return addDate(date, Calendar.DAY_OF_MONTH, spans);
+    }
+
+    /**
+     * 日期加小时
+     * 
+     * @param date 日期
+     * @param spans 增加数量
+     * @return 加小时后的日期
+     */
+    public static Date addHour(Date date, int spans) {
+        return addDate(date, Calendar.HOUR_OF_DAY, spans);
+    }
+
+    /**
+     * 日期加分钟
+     * 
+     * @param date 日期
+     * @param spans 增加数量
+     * @return 加分钟后的日期
+     */
+    public static Date addMinute(Date date, int spans) {
+        return addDate(date, Calendar.MINUTE, spans);
+    }
+
+    /**
+     * 日期加秒
+     * 
+     * @param date 日期
+     * @param spans 增加数量
+     * @return 加秒后的日期
+     */
+    public static Date addSecond(Date date, int spans) {
+        return addDate(date, Calendar.SECOND, spans);
+    }
+
+    /**
+     * 日期加法计算
+     * 
+     * @param date 日期
+     * @param type 增加类型
+     * @param spans 增加数量
+     * @return 加法计算后的日期
+     */
+    public static Date addDate(Date date, int type, int spans) {
+        Calendar inputCalendar = Calendar.getInstance();
+        inputCalendar.setTime(date);
+        inputCalendar.add(type, spans);
+        return inputCalendar.getTime();
+    }
+
+    /**
+     * 获取当前day of month
+     * 
+     * @return String
+     */
+    public static String getCurrentDayOfMonth() {
+        Calendar calendar = Calendar.getInstance();
+        return String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));
+    }
+
+    /**
+     * 获取当前月份数字
+     * 
+     * @return String
+     */
+    public static String getCurrentMonth() {
+        Calendar calendar = Calendar.getInstance();
+        return String.valueOf(calendar.get(Calendar.MONTH) + 1);
+    }
+
+    /**
+     * 获取当前小时
+     * 
+     * @return String
+     */
+    public static String getCurrentHour() {
+        Calendar calendar = Calendar.getInstance();
+        return String.valueOf(calendar.get(Calendar.HOUR_OF_DAY));
+    }
+    
+    /**
+     * 获取当前年
+     * 
+     * @return String
+     */
+    public static String getCurrentYear() {
+        Calendar calendar = Calendar.getInstance();
+        return String.valueOf(calendar.get(Calendar.YEAR));
+    }
+
+    /**
+     * 获取当前时间,字符串类型,格式(yyyy-mm-dd)
+     * 
+     * @return String
+     */
+    public static String getCurrentDateString() {
+        return getDateFormatStr(PATTEN_YMD);
+    }
+
+    /**
+     * 获取当前时间, 日期类型
+     * 
+     * @return java.util.Date
+     */
+    public static Date getCurrentDate() {
+        return new Date();
+    }
+
+    /**
+     * 判断是否是有效日期
+     * 
+     * @param date 判断日期
+     * @return 是否有效日期
+     */
+    public static boolean checkIsActiveDate(String date) {
+        //先验证基本格式是否正确
+        if (!StringsUtils.matches(date, DATE_REG_SIMPLE)) {
+            return false;
+        }
+        //验证复杂格式是否正确
+        if (StringsUtils.isNotEmpty(date) && date.contains(DEFAULT_SEPERATOR)) {
+            String dateNoSeprator = date.replaceAll(DEFAULT_SEPERATOR, "");
+            return StringsUtils.matches(dateNoSeprator, DATE_REG);
+        }
+        return false;
+    }
+
+    /**
+     * 比较两个日期大小
+     * 
+     * @param startDate 开始日期
+     * @param endDate 结束日期
+     * @return 开始日期早于结束日期,返回true。否则返回false。相等,返回false
+     */
+    public static boolean dateCompare(Date startDate, Date endDate) {
+        if (startDate.before(endDate)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 返回指定日期的年
+     * 
+     * @param date 指定的日期
+     * @return 指定日期的年
+     */
+    public static String getYearFromDate(String date) {
+        if (!checkIsActiveDate(date)) {
+            return "";
+        }
+        //日期格式化
+        try {
+            Date dateTmp = getDateParser(PATTEN_YMD).parse(date);
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(dateTmp);
+            return String.valueOf(calendar.get(Calendar.YEAR));
+        } catch (ParseException e) {
+            return "";
+        }
+    }
+
+    /**
+     * 返回指定日期的月
+     * 
+     * @param date 指定的日期
+     * @return 指定日期的月
+     */
+    public static String getMonthFromDate(String date) {
+        if (!checkIsActiveDate(date)) {
+            return "";
+        }
+        //日期格式化
+        try {
+            Date dateTmp = getDateParser(PATTEN_YMD).parse(date);
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(dateTmp);
+            return String.valueOf(calendar.get(Calendar.MONTH) + 1);
+        } catch (ParseException e) {
+            return "";
+        }
+    }
+
+    /**
+     * 返回指定日期的日
+     * 
+     * @param date 指定日期
+     * @return 指定日期的日
+     */
+    public static String getDayFromDate(String date) {
+        if (!checkIsActiveDate(date)) {
+            return "";
+        }
+        //日期格式化
+        try {
+            Date dateTmp = getDateParser(PATTEN_YMD).parse(date);
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(dateTmp);
+            return String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));
+        } catch (ParseException e) {
+            return "";
+        }
+    }
+    
+    /**
+	 * 根据日期取得星期几
+	 * @param dt
+	 * @return
+	 */
+    public static String getWeekOfDate(Date dt) {
+        String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(dt);
+
+        int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
+        if (w < 0)
+            w = 0;
+
+        return weekDays[w];
+    }
+}

+ 38 - 0
src/main/java/com/wechat/common/utils/IOStreamUtils.java

@@ -0,0 +1,38 @@
+package com.wechat.common.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import org.springframework.util.FileCopyUtils;
+
+public class IOStreamUtils extends BaseUtils {
+
+	/**
+	 * 根据图片名称获取字节流
+	 * 
+	 * @param basePath
+	 *            根路径
+	 * @param filePath
+	 *            图片路径
+	 * @param fileName
+	 *            图片名称
+	 * @return
+	 */
+	public static byte[] getimagefile(String basePath, String filePath, String fileName) {
+		byte[] data = null;
+		try {
+			// 设置文件上传路径
+			String uploadPath = basePath + filePath;
+			File file = new File(uploadPath, fileName);
+			if (file.exists()) {
+				FileInputStream fis = new FileInputStream(file);
+				data = FileCopyUtils.copyToByteArray(fis);
+			}
+		} catch (Exception ex) {
+			log.error("message", ex);
+			return null;
+		}
+		return data;
+	}
+
+}

+ 123 - 0
src/main/java/com/wechat/common/utils/JacksonUtils.java

@@ -0,0 +1,123 @@
+package com.wechat.common.utils;
+
+import java.util.List;
+import java.util.Map;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/** Another JSON Serialize & Deserialize Library */
+public class JacksonUtils extends BaseUtils{
+    private static ObjectMapper mapper = new ObjectMapper();
+    public static String serialize(Object obj) {
+        try {
+            return mapper.writeValueAsString(obj);
+        } catch (Exception ex) {
+            log.error("Error when serializing object to string.", ex);
+        }
+        return null;
+    }
+
+    /**
+     * pretty print enabled, for debug purpose.
+     * @param obj
+     * @return
+     */
+    public static String beautifulSerialize(Object obj) {
+        try {
+
+            return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj);
+        } catch (Exception ex) {
+            log.error("Error when serializing object to string.", ex);
+        }
+        return null;
+    }
+
+    public static <T> T deserialize(final String json, Class<T> classofT) {
+        try {
+
+            return mapper.readValue(json, classofT);
+        } catch (Exception ex) {
+            log.error("Error when deserializing json: " + json, ex);
+        }
+        return null;
+    }
+    
+    /**
+     * bean 转换成JSON
+     * 
+     * @param bean 对象参数
+     * @return 转换后的JSON字符串
+     */
+    public static String bean2json(Object bean) {
+        return JSONObject.fromObject(bean).toString();
+    }
+
+    /**
+     * list 转换成JSON
+     * 
+     * @param list 需要转换的list
+     * @return 转换后的JSON字符串
+     */
+    public static String list2json(List<?> list) {
+        return JSONArray.fromObject(list).toString();
+    }
+    
+    
+    /**
+     * string 转json
+     * 
+     * @param param
+     * @return
+     */
+    public static JSONObject StringTOJson(String param) {
+        if (param != null && param != "") {
+            //          param = param.substring(1, param.length() -1);
+            JSONObject jasonObject = JSONObject.fromObject(param);
+            return jasonObject;
+        }
+        else {
+            return null;
+        }
+    }
+
+    /**
+     String j = "{\"result\":0,\"msg\":\"msg\",\"info\":\"info_here\"}";
+     JsonResp<String> rsp = JacksonUtils.deserializeGeneric(j, new TypeReference<JsonResp<String>>() { });
+     System.out.print(rsp.getInfo());
+
+     This code will print `info_here`
+     */
+    public static <T> T deserializeGeneric(final String json, TypeReference<T> classofT) {
+        try {
+            return mapper.readValue(json, classofT);
+        } catch (Exception ex) {
+            log.error("Error when deserializing json: " + json, ex);
+        }
+        return null;
+    }
+    
+    
+    /**
+     * 从一个JSON 对象字符格式中得到一个java对象,其中beansList是一类的集合,形如: {"id" : idValue, "name" : nameValue, "aBean" : {"aBeanId" : aBeanIdValue, ...}, beansList:[{}, {}, ...]}
+     * 
+     * @param jsonString
+     * @param clazz
+     * @param map 集合属性的类型 (key : 集合属性名, value : 集合属性类型class) eg: ("beansList" : Bean.class)
+     * @return
+     */
+    @SuppressWarnings("rawtypes")
+    public static Object getDTO(String jsonString, Class clazz, Map map) {
+        JSONObject jsonObject = null;
+        try {
+            jsonObject = JSONObject.fromObject(jsonString);
+        }
+        catch (Exception e) {
+            log.error(e);
+        }
+        return JSONObject.toBean(jsonObject, clazz, map);
+    }
+}

+ 133 - 0
src/main/java/com/wechat/common/utils/MailUtil.java

@@ -0,0 +1,133 @@
+package com.wechat.common.utils;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.util.Properties;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.NoSuchProviderException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import com.sun.mail.util.MailSSLSocketFactory;
+import com.wechat.common.Constants;
+
+@Component
+public class MailUtil {
+	protected static Logger logger = LoggerFactory.getLogger(MailUtil.class);
+
+	public static String sendEmailAddress;
+	public static String sendEmailPassword;
+	
+	@Value("#{configProperties['send_email_address']}")
+	public void setSendEmailAddress(String sendEmailAddress) {
+		MailUtil.sendEmailAddress = sendEmailAddress;
+	}
+
+	@Value("#{configProperties['send_email_password']}")
+	public void setSendEmailPassword(String sendEmailPassword) {
+		MailUtil.sendEmailPassword = sendEmailPassword;
+	}
+
+	public static Boolean sendMailNew(String recipientAddress, String mailContent,String subject) {
+		Transport transport = null;
+		Boolean flag = false;
+		try {
+			// 创建连接对象 连接到邮件服务器
+			Properties properties = new Properties();
+			// 设置用户的认证方式
+			properties.setProperty("mail.smtp.auth", "true");
+
+			// 设置传输协议
+			properties.setProperty("mail.transport.protocol", "smtp");
+
+			// 设置发件人的SMTP服务器地址 阿里企业邮箱
+			properties.setProperty("mail.smtp.host", "smtp.mxhichina.com");
+			// 开启ssl加密,如果没有ssl加密,会报530错误
+			MailSSLSocketFactory sf = new MailSSLSocketFactory();
+			sf.setTrustAllHosts(true);
+			properties.put("mail.smtp.ssl.enable", "true");
+			properties.put("mail.smtp.ssl.socketFactory", sf);
+			// 2、创建定义整个应用程序所需的环境信息的 Session 对象
+			Session session = Session.getInstance(properties);
+			// 设置调试信息在控制台打印出来
+			session.setDebug(false);
+			// 3、创建邮件的实例对象
+			Message msg = getMimeMessageNew(session, sendEmailAddress, recipientAddress, mailContent,subject);
+			// 4、根据session对象获取邮件传输对象Transport
+			transport = session.getTransport();
+			// 设置发件人的账户名和密码
+			transport.connect(sendEmailAddress, sendEmailPassword);
+			// 发送邮件,并发送到所有收件人地址,message.getAllRecipients() 获取到的是在创建邮件对象时添加的所有收件人, 抄送人, 密送人
+			transport.sendMessage(msg, msg.getAllRecipients());
+			flag = true;
+		} catch (NoSuchProviderException e) {
+			flag = false;
+			logger.error(e.getMessage());
+		} catch (MessagingException e) {
+			flag = false;
+			logger.error(e.getMessage());
+		} catch (Exception e) {
+			flag = false;
+			logger.error(e.getMessage());
+		} finally {
+			// 5、关闭邮件连接
+			if (transport != null) {
+				try {
+					transport.close();
+				} catch (MessagingException e) {
+					logger.error("邮件发送异常",e.getMessage());
+				}
+			}
+		}
+		return flag;
+	}
+	
+	private static MimeMessage getMimeMessageNew(Session session, String senderAddress, String recipientAddress,
+			String mailContent,String subject) {
+		// 创建一封邮件的实例对象
+		MimeMessage msg = null;
+		try {
+			msg = new MimeMessage(session);
+			// 设置发件人地址
+			msg.setFrom(new InternetAddress(senderAddress));
+			/**
+			 * 设置收件人地址(可以增加多个收件人、抄送、密送),即下面这一行代码书写多行 MimeMessage.RecipientType.TO:发送
+			 * MimeMessage.RecipientType.CC:抄送 MimeMessage.RecipientType.BCC:密送
+			 */
+			//设置自定义发件人昵称  
+	        String nick="";  
+	        try {  
+	            nick=javax.mail.internet.MimeUtility.encodeText(Constants.EMAIL_NICK,"utf-8",null);  
+	        } catch (UnsupportedEncodingException e) {  
+	            e.printStackTrace();  
+	        } 
+			// 设置发件人地址
+			msg.setFrom(new InternetAddress(nick+" <"+sendEmailAddress+">"));
+			msg.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(recipientAddress));
+			// 设置邮件主题
+			msg.setSubject(subject, "UTF-8");
+			// 设置邮件正文
+			msg.setContent(mailContent, "text/html;charset=UTF-8");
+			// 设置邮件的发送时间,默认立即发送
+			msg.setSentDate(new Date());
+		} catch (AddressException e) {
+			logger.error(e.getMessage());
+		} catch (MessagingException e) {
+			logger.error(e.getMessage());
+		}
+
+		return msg;
+	}
+	
+	
+}

+ 153 - 0
src/main/java/com/wechat/common/utils/MessageUtils.java

@@ -0,0 +1,153 @@
+package com.wechat.common.utils;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.wechat.common.Constants;
+
+public class MessageUtils extends BaseUtils {
+
+    /**
+     * message cache
+     */
+    public static Map<String, String> messageMap = new HashMap<String, String>();
+
+
+    /**
+     * Message 格式化工具
+     */
+    final static MessageFormat FORMAT = new MessageFormat("");
+
+
+    /**
+     * 单一参数的Message
+     * 
+     * @param mes message mes
+     * @param arg0 参数1
+     * @return Message内容
+     */
+    public static String getText(String mes, String arg0) {
+        FORMAT.applyPattern(mes);
+        return FORMAT.format(new String[] { arg0 });
+    }
+
+    /**
+     * 两个参数的Message
+     * 
+     * @param mes message mes
+     * @param arg0 参数1
+     * @param arg1 参数2
+     * @return Message内容
+     */
+    public static String getText(String mes, String arg0, String arg1) {
+        FORMAT.applyPattern(mes);
+        return FORMAT.format(new String[] { arg0, arg1 });
+    }
+
+    /**
+     * 三个参数的Message
+     * 
+     * @param mes message mes
+     * @param arg0 参数1
+     * @param arg1 参数2
+     * @param arg2 参数3
+     * @return Message内容
+     */
+    public static String getText(String mes, String arg0, String arg1, String arg2) {
+        FORMAT.applyPattern(mes);
+        return FORMAT.format(new String[] { arg0, arg1, arg2 });
+    }
+
+    /**
+     * 四个参数的Message
+     * 
+     * @param mes message mes
+     * @param arg0 参数1
+     * @param arg1 参数2
+     * @param arg2 参数3
+     * @param arg3 参数4
+     * @return Message内容
+     */
+    public static String getText(String mes, String arg0, String arg1, String arg2, String arg3) {
+        FORMAT.applyPattern(mes);
+        return FORMAT.format(new String[] { arg0, arg1, arg2, arg3 });
+    }
+
+    /**
+     * 五个参数的Message
+     * 
+     * @param mes message mes
+     * @param arg0 参数1
+     * @param arg1 参数2
+     * @param arg2 参数3
+     * @param arg3 参数4
+     * @param arg4 参数5
+     * @return Message内容
+     */
+    public static String getText(String mes, String arg0, String arg1, String arg2, String arg3, String arg4) {
+        FORMAT.applyPattern(mes);
+        return FORMAT.format(new String[] { arg0, arg1, arg2, arg3, arg4 });
+    }
+    
+    /**
+     * 六个参数的Message
+     * 
+     * @param mes message mes
+     * @param arg0 参数1
+     * @param arg1 参数2
+     * @param arg2 参数3
+     * @param arg3 参数4
+     * @param arg4 参数5
+     * @return Message内容
+     */
+    public static String getText(String mes, String arg0, String arg1, String arg2, String arg3, String arg4, String arg5) {
+        FORMAT.applyPattern(mes);
+        return FORMAT.format(new String[] { arg0, arg1, arg2, arg3, arg4, arg5 });
+    }
+
+    /**
+     * 多个参数的Message
+     * 
+     * @param mes message mes
+     * @param arg0 参数数组
+     * @return Message内容
+     */
+    public static String getText(String mes, String[] arg0) {
+        if (arg0 == null || arg0.length == 0) {
+            return mes;
+        } else {
+            FORMAT.applyPattern(mes);
+            return FORMAT.format(arg0);
+        }
+    }
+    
+    /**
+     * 三个参数的url
+     * 
+     * @param mes message mes
+     * @param linkUrl
+     * @param Str 
+     * @param Content
+     * @return url内容
+     */
+    public static String getHyperLink(String linkUrl, String Str, String Content) {
+        String result =Constants.URL_BEGIN + linkUrl + Str + Constants.URL_MIDDLE + Content + Constants.URL_END;
+        return result;
+    }
+    
+    /**
+     * 三个参数的url 不换行
+     * 
+     * @param mes message mes
+     * @param linkUrl
+     * @param Str 
+     * @param Content
+     * @return url内容
+     */
+    public static String getHyperLinkNoNewline(String linkUrl, String Str, String Content) {
+        String result =Constants.URL_BEGIN_NOBR + linkUrl + Str + Constants.URL_MIDDLE + Content + Constants.URL_END_NOBR;
+        return result;
+    }
+
+}

+ 167 - 0
src/main/java/com/wechat/common/utils/MvcUtil.java

@@ -0,0 +1,167 @@
+package com.wechat.common.utils;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.FieldError;
+import org.springframework.validation.ObjectError;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.wechat.common.utils.view.JSONView;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+/**
+ * springMVC返回值工具类
+ * 
+
+ */
+@SuppressWarnings("all")
+public class MvcUtil {
+	private static final JSONView jsonLibView = new JSONView();
+	private static final SimpleDateFormat FORMAT_DATE = new SimpleDateFormat(
+			"yyyy-MM-dd");
+	private static final SimpleDateFormat FORMAT_TIME = new SimpleDateFormat(
+			"hh:mm:ss");
+	private static final SimpleDateFormat FORMAT_TIMESTAMP = new SimpleDateFormat(
+			"yyyy-MM-dd hh:mm:ss");
+
+	public MvcUtil() {
+	}
+
+	public static ModelAndView jsonObjectModelAndView(JSONObject jsonObject) {
+		return new ModelAndView(jsonLibView, "jsonObject", jsonObject);
+	}
+
+	public static ModelAndView jsonArrayModelAndView(JSONArray jsonArray) {
+		return new ModelAndView(jsonLibView, "jsonArray", jsonArray);
+	}
+
+	public static boolean checkBindingResult(BindingResult bindingResult,
+			JSONObject returnObject) {
+		if (bindingResult.hasErrors()) {
+			if (bindingResult.hasFieldErrors()) {
+				List list = bindingResult.getFieldErrors();
+				JSONObject errors = new JSONObject();
+				for (int i = 0; i < list.size(); i++) {
+					FieldError fieldError = (FieldError) list.get(i);
+					errors.element(fieldError.getField(), fieldError
+							.getRejectedValue().toString());
+				}
+
+				returnObject.element("errors", errors);
+			}
+			if (bindingResult.hasGlobalErrors()) {
+				List list = bindingResult.getGlobalErrors();
+				String errorMessage = "";
+				for (int i = 0; i < list.size(); i++) {
+					ObjectError fieldError = (ObjectError) list.get(i);
+					if (i > 0)
+						errorMessage = (new StringBuilder(String
+								.valueOf(errorMessage))).append("; ")
+								.toString();
+					errorMessage = (new StringBuilder(String
+							.valueOf(errorMessage))).append(
+							fieldError.getDefaultMessage()).toString();
+				}
+
+				returnObject.element("errorMessage", errorMessage);
+			}
+			return false;
+		} else {
+			return true;
+		}
+	}
+
+	public static void main(String[] args) {
+		Object obj=(Object)"120";
+		System.out.println(toJsonString(obj));
+	}
+	public static String toJsonString(Object obj) {
+		if (obj != null){
+			if(obj instanceof Double ||obj instanceof BigDecimal){
+				DecimalFormat df = new DecimalFormat("#0.00");
+				return df.format(Double.parseDouble(obj.toString()));
+			}else{
+				return obj.toString();
+			}
+		}
+			
+		else
+			return null;
+	}
+
+	public String toJsonString(Date obj) {
+		if (obj != null)
+			return FORMAT_DATE.format(obj);
+		else
+			return null;
+	}
+
+	public String toJsonString(Time obj) {
+		if (obj != null)
+			return FORMAT_TIME.format(obj);
+		else
+			return null;
+	}
+
+	public static String toJsonString(Timestamp obj) {
+		if (obj != null)
+			return FORMAT_TIMESTAMP.format(obj);
+		else
+			return null;
+	}
+
+	public static Long parseLong(HttpServletRequest request, String paramName) {
+		Long result = null;
+		String s = request.getParameter(paramName);
+		if (s != null && !"".equals(s))
+			result = Long.valueOf(Long.parseLong(s));
+		return result;
+	}
+
+	public static String toBigString(Object obj) {
+		if (obj != null)
+			return obj.toString();
+		else
+			return "0.00";
+	}
+
+	public static String toBigString2(Object obj) {
+		if (obj != null && !"".equals(obj.toString()))
+			return new BigDecimal(obj.toString()).setScale(2, RoundingMode.HALF_UP).toString();
+		else
+			return "";
+	}
+	
+	public static void writeJson(HttpServletRequest request, HttpServletResponse response, String json)
+			throws IOException {
+		response.setContentType("text/html;charset=utf-8");
+		String clientOrigin = request.getHeader("origin");
+		PrintWriter out = response.getWriter();
+		response.setHeader("Cache-control", "no-cache, no-store");
+		response.setHeader("Pragma", "no-cache");
+		response.setHeader("Expires", "-1");
+		response.setHeader("Access-Control-Allow-Methods", "POST");
+		response.setHeader("Access-Control-Allow-Origin", clientOrigin);
+		response.setHeader("Access-Control-Allow-Headers", "Content-Type");
+		response.setHeader("Access-Control-Max-Age", "86400");
+
+		out.println(json);
+		out.close();
+	}
+	
+}

+ 243 - 0
src/main/java/com/wechat/common/utils/NetworkUtils.java

@@ -0,0 +1,243 @@
+package com.wechat.common.utils;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.nio.charset.Charset;
+
+import net.sf.json.JSONObject;
+
+public class NetworkUtils extends BaseUtils{
+
+    /**
+     * 通过HTTP Post请求外部数据
+     * @param url 要访问的地址
+     * @param request 发送的数据, 会被转换成json字符串
+     * @param classofResp 返回数据类的类型
+     * @param <T> 返回数据类
+     * @return 将远端返回的Json字串解析为对象,类型为T
+     */
+    public static <T> T getRemoteResponseAsJson(String url, Object request, Class<T> classofResp) {
+        String payload = JacksonUtils.bean2json(request);
+        try {
+            URL obj = new URL(url);
+            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+            //add reuqest header
+            con.setRequestMethod("POST");
+            con.setRequestProperty("Content-Type", "application/json");
+            con.setRequestProperty("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
+
+            // Send post request
+            con.setDoOutput(true);
+            PrintWriter wr = new PrintWriter(new OutputStreamWriter(
+            		con.getOutputStream(), "UTF-8"));
+            wr.write(payload);
+            wr.flush();
+            wr.close();
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream(), Charset.forName("UTF-8")));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+            log.debug("Get response: " + response.toString());
+            return JacksonUtils.deserialize(response.toString(), classofResp);
+            
+        } catch (Exception ex) {
+            log.error("Network error.", ex);
+            return null;
+        }
+    }
+    
+    /**
+     * 通过HTTP Post请求外部数据
+     * @param url 要访问的地址
+     * @param request 发送的数据, 会被转换成json字符串
+     * @param classofResp 返回数据类的类型
+     * @return 将远端返回的Json字串解析为对象,类型为T
+     */
+    public static String getRemoteResponseAsJson(String url, Object request) {
+        String payload = JacksonUtils.bean2json(request);
+        try {
+            URL obj = new URL(url);
+            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+            //add reuqest header
+            con.setRequestMethod("POST");
+            con.setRequestProperty("Content-Type", "application/json");
+            con.setRequestProperty("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
+
+            // Send post request
+            con.setDoOutput(true);
+            PrintWriter wr = new PrintWriter(new OutputStreamWriter(
+            		con.getOutputStream(), "UTF-8"));
+            wr.write(payload);
+            wr.flush();
+            wr.close();
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream(), Charset.forName("UTF-8")));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+            log.debug("Get response: " + response.toString());
+            return response.toString();
+            
+        } catch (Exception ex) {
+            log.error("Network error.", ex);
+            return null;
+        }
+    }
+    
+    /**
+     * 通过HTTP Get请求外部数据,以JSON格式直接返回
+     * @param url 要访问的地址
+     * @param request 发送的数据, 会被转换成JSON字符串
+     * @param 以JSON格式直接返回
+     * @return 将远端返回的JSON字串
+     */
+    public static JSONObject getRemoteResponseAsJson(String url) {
+        try {
+            URL obj = new URL(url);
+            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+            //add reuqest header
+            con.setRequestMethod("GET");
+            con.setRequestProperty("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
+
+            // Send post request
+            con.setDoOutput(true);
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream(), Charset.forName("UTF-8")));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+            log.info("Get response: " + response.toString());
+            return JacksonUtils.StringTOJson(response.toString());
+            
+        } catch (Exception ex) {
+            log.error("Network error.", ex);
+            return null;
+        }
+    }
+    
+    /**
+     * 通过HTTP Get请求外部数据,以JSON格式直接返回
+     * @param url 要访问的地址
+     * @param classofResp需要格式化的目标类型
+     * @return 将远端返回的JSON格式化后输出
+     */
+    public static <T> T getRemoteResponseAsJson(String url, Class<T> classofResp) {
+        try {
+            URL obj = new URL(url);
+            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+            //add reuqest header
+            con.setRequestMethod("GET");
+			con.setRequestProperty("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
+
+            // Send post request
+            con.setDoOutput(true);
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream(), Charset.forName("UTF-8")));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+            log.info("Get response: " + response.toString());
+            return JacksonUtils.deserialize(response.toString(), classofResp);
+            
+        } catch (Exception ex) {
+            log.error("Network error.", ex);
+            return null;
+        }
+    }
+
+    public static <T> T getRemoteResponseAsJsonWithStringPayload(String url, String req, Class<T> classofResp){
+        String payload = req;
+        try {
+            URL obj = new URL(url);
+            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+            //add reuqest header
+            con.setRequestMethod("POST");
+            con.setRequestProperty("Content-Type", "application/json");
+            con.setRequestProperty("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
+
+            // Send post request
+            con.setDoOutput(true);
+            PrintWriter wr = new PrintWriter(new OutputStreamWriter(
+            		con.getOutputStream(), "UTF-8"));
+            wr.write(payload);
+            wr.flush();
+            wr.close();
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream(), Charset.forName("UTF-8")));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+            log.debug("Get response: " + response.toString());
+            return JacksonUtils.deserialize(response.toString(), classofResp);
+
+        } catch (Exception ex) {
+            log.error("Network error.", ex);
+            return null;
+        }
+    }
+
+    public static <T> T getRemoteResponseAsJsonMethodGET(String url, Class<T> classofResp){
+        try {
+            URL obj = new URL(url);
+            HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+            //add reuqest header
+            con.setRequestMethod("GET");
+            con.setRequestProperty("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
+
+            con.setDoOutput(false);
+            con.setDoInput(true);
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(con.getInputStream(), Charset.forName("UTF-8")));
+            String inputLine;
+            StringBuffer response = new StringBuffer();
+
+            while ((inputLine = in.readLine()) != null) {
+                response.append(inputLine);
+            }
+            in.close();
+            log.debug("Get response: " + response.toString());
+            return JacksonUtils.deserialize(response.toString(), classofResp);
+
+        } catch (Exception ex) {
+            log.error("Network error.", ex);
+            return null;
+        }
+    }
+}

+ 285 - 0
src/main/java/com/wechat/common/utils/NumberUtils.java

@@ -0,0 +1,285 @@
+package com.wechat.common.utils;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+
+public class NumberUtils extends BaseUtils {
+    /**
+     * 将字符串转换为数字
+     * 
+     * @param str 字符串
+     * @param min 是否设置成最大值。 如果为false, 当转换异常时返回int的最大值
+     * @return 转换后的数字
+     */
+    public static int stringToInt(String str, boolean min) {
+        int result = 0;
+        try {
+            result = Integer.parseInt(str);
+        } catch (Exception e) {
+            if (!min) {
+                result = Integer.MAX_VALUE;
+            }
+        }
+        return result;
+    }
+    
+    /**
+     * 将字符串转换为int
+     * 
+     * @param str
+     * @param min
+     * @return
+     */
+    public static int stringToInt(String str, int defult) {
+    	int result = 0;
+        try {
+            result = Integer.parseInt(str);
+        } catch (Exception e) {
+           	result = defult;
+        }
+        return result;
+    }
+
+    /**
+     * Integer 转换成Short
+     * 
+     * @param intValue
+     * @return
+     */
+    public static Short intToShort(Integer intValue) {
+        //TODO bug fix
+        if (null == intValue) {
+            return null;
+        }
+        return Short.valueOf(String.valueOf(intValue));
+    }
+
+    /**
+     * 将字符串转换为long
+     * 
+     * @param str
+     * @param min
+     * @return
+     */
+    public static long stringToLong(String str, boolean min) {
+        long result = 0;
+        try {
+            result = Long.parseLong(str);
+        } catch (Exception e) {
+            if (!min) {
+                result = Long.MAX_VALUE;
+            }
+        }
+        return result;
+    }
+    
+    /**
+     * 将字符串转换为long
+     * 
+     * @param str
+     * @param min
+     * @return
+     */
+    public static long stringToLong(String str, long defult) {
+    	long result = 0;
+        try {
+            result = Long.parseLong(str);
+        } catch (Exception e) {
+           	result = defult;
+        }
+        return result;
+    }
+
+    /**
+     * Integer 转换成long
+     * 
+     * @param intValue
+     * @return
+     */
+    public static long intTolong(Integer intValue) {
+        //TODO bug fix
+        if (null == intValue) {
+            return 0;
+        }
+        return Long.valueOf(String.valueOf(intValue));
+    }
+
+    /**
+     * 将字符串转换为Short
+     * 
+     * @param str
+     * @param min
+     * @return
+     */
+    public static Short stringToShort(String str, boolean min) {
+        Short result = 0;
+        try {
+            result = Short.parseShort(str);
+        } catch (Exception e) {
+            if (!min) {
+                result = Short.MAX_VALUE;
+            }
+        }
+        return result;
+    }
+    
+    /**
+     * 将字符串转换为Short
+     * 
+     * @param str
+     * @param min
+     * @return
+     */
+    public static Short stringToShort(String str, Short defult) {
+        Short result = 0;
+        try {
+            result = Short.parseShort(str);
+        } catch (Exception e) {
+           	result = defult;
+        }
+        return result;
+    }
+    
+    /**
+     * 将字符串转换为Bety
+     * 
+     * @param str
+     * @param min
+     * @return
+     */
+    public static Byte stringToByte(String str, boolean min) {
+    	Byte result = 0;
+        try {
+            result = Byte.parseByte(str);
+        } catch (Exception e) {
+            if (!min) {
+                result = Byte.MAX_VALUE;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Short 比较大小
+     * 
+     * @param s1 参数
+     * @param s2 参数
+     * @return 比较结果
+     */
+    public static int compareShort(Short s1, Short s2) {
+        if (s1 == null) {
+            s1 = 0;
+        }
+        if (s2 == null) {
+            s2 = 0;
+        }
+        return s1.compareTo(s2);
+    }
+    
+    /**
+     * Long转String
+     * @param longVal
+     * @return
+     */
+    public static String longToString(Long longVal){
+        if(longVal == null){
+            return null;
+        }else{
+            return Long.toString(longVal);
+        }
+    }
+    
+    /**
+     * string 转BigDecimal
+     * @param str
+     * @return
+     */
+    public static BigDecimal stringToBigDecimal(String str){
+        BigDecimal result = new BigDecimal(0);
+        try {
+            result = new BigDecimal(str);
+        } catch (Exception e) {
+            
+        }
+        return result;
+    }
+    
+    /**
+     * 保留小数(位数由传入参数决定)
+     * @param str 传入参数
+     * @param digital 保留几位小数
+     * @return 
+     */
+    public static String stringToHalfUp(String str, int digital) {
+        BigDecimal b = stringToBigDecimal(str);
+        if (b == null) {
+            return null;
+        }
+        return b.setScale(digital, RoundingMode.HALF_UP).toString();
+    }
+    
+    public static String stringToConUnit(String str) {
+        BigDecimal b = stringToBigDecimal(str);
+        if (b == null) {
+            return null;
+        }
+        if (b.compareTo(new BigDecimal(10000)) < 0) {
+            // 小于10000的时候没有单位
+            return b.toString();
+        } else if (b.compareTo(new BigDecimal(100000000)) >= 0) {
+            // 大于1亿
+            return null;
+        } else if (b.compareTo(new BigDecimal(10000)) >= 0 && b.compareTo(new BigDecimal(100000000)) < 0) {
+            // 大于1万,小于1亿
+            return null;
+        } else {
+            return null;
+        }
+    }
+    
+    /**
+     * Decimal 类型判空
+     * @param longVal
+     * @return
+     */
+    public static boolean isEmpty(BigDecimal val){
+        if(val == null){
+            return true;
+        }
+        if(val.compareTo(new BigDecimal(0)) == 0)
+        {
+            return true;
+        }
+        return false;
+    }
+    
+    /**
+     * 当数据类型属于BigDecimal时,转化操作
+     * 
+     * @param bd
+     * @return
+     */
+    public static BigDecimal formatBigDecimal(String bd) {
+
+        BigDecimal temp = BigDecimal.ZERO;
+
+        // 传值为空时
+        if (StringsUtils.isEmpty(bd)) {
+            return temp;
+        }
+        else {
+            bd = bd.trim();
+        }
+
+        if (bd.startsWith(".")) {
+            bd = "0" + bd;
+        }
+
+        if (StringsUtils.isBigDecimal(bd)) {
+            temp = new BigDecimal(bd);
+        }
+
+        return temp;
+    }
+}

+ 378 - 0
src/main/java/com/wechat/common/utils/RSAUtils.java

@@ -0,0 +1,378 @@
+package com.wechat.common.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.math.BigInteger;
+import java.security.InvalidParameterException;
+import java.security.KeyFactory;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Provider;
+import java.security.PublicKey;
+import java.security.SecureRandom;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.RSAPrivateKeySpec;
+import java.security.spec.RSAPublicKeySpec;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.crypto.Cipher;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateFormatUtils;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
+public abstract class RSAUtils extends BaseUtils {
+    
+    /** 算法名称 */
+    private static final String ALGORITHOM = "RSA";
+    /**保存生成的密钥对的文件名称。 */
+    private static final String RSA_PAIR_FILENAME = "/__RSA_PAIR.txt";
+    /** 密钥大小 */
+    private static final int KEY_SIZE = 1024;
+    /** 默认的安全服务提供者 */
+    private static final Provider DEFAULT_PROVIDER = new BouncyCastleProvider();
+ 
+    private static KeyPairGenerator keyPairGen = null;
+    private static KeyFactory keyFactory = null;
+    /** 缓存的密钥对。 */
+    private static KeyPair oneKeyPair = null;
+    
+    /** 密钥对系数和专用指数。 */
+    private static Map<String,String> modulusAndExponent = new HashMap<String, String>();
+ 
+    private static File rsaPairFile = null;
+ 
+    static {
+        try {
+            keyPairGen = KeyPairGenerator.getInstance(ALGORITHOM, DEFAULT_PROVIDER);
+            keyFactory = KeyFactory.getInstance(ALGORITHOM, DEFAULT_PROVIDER);
+        } catch (NoSuchAlgorithmException ex) {
+            log.error(ex.getMessage());
+        }
+        rsaPairFile = new File(getRSAPairFilePath());
+    }
+ 
+    private RSAUtils() {  
+    }
+    
+    /**
+     * 生成并返回RSA密钥对。
+     */
+    private static synchronized KeyPair generateKeyPair() {
+        try {
+            //当前时间(毫秒)+ 5位随机数生成 密匙
+            keyPairGen.initialize(KEY_SIZE, new SecureRandom((DateFormatUtils.format(new Date(),"yyyyMMddHHmmssSSS")+ com.wechat.common.utils.StringsUtils.getRandomNum(5)).getBytes()));
+            oneKeyPair = keyPairGen.generateKeyPair();
+            saveKeyPair(oneKeyPair);
+            return oneKeyPair;
+        } catch (InvalidParameterException ex) {
+            log.error("KeyPairGenerator does not support a key length of " + KEY_SIZE + ".", ex);
+        } catch (NullPointerException ex) {
+            log.error("RSAUtils#KEY_PAIR_GEN is null, can not generate KeyPairGenerator instance.",
+                    ex);
+        }
+        return null;
+    }
+    
+    /**
+     * bigInt转16进制。
+     */
+    private static String bigInt2Hex(BigInteger bi) {
+        return AESUtil.parseByte2HexStr(bi.toByteArray());
+    }
+    
+    /**
+     * 生成并返回RSA密钥对的系数和专用指数。
+     *      * 
+     * @param modulus 系数。
+     * @param publicExponent 专用指数。
+     */
+    public static synchronized Map<String, String> generateKeyPairModulusExponent() {
+        try {
+            //当前时间(毫秒)+ 5位随机数生成 密匙
+            keyPairGen.initialize(KEY_SIZE, new SecureRandom((DateFormatUtils.format(new Date(),"yyyyMMddHHmmssSSS")+ com.wechat.common.utils.StringsUtils.getRandomNum(5)).getBytes()));
+            oneKeyPair = keyPairGen.generateKeyPair();
+            modulusAndExponent.put("pubM",bigInt2Hex(((RSAPublicKey)oneKeyPair.getPublic()).getModulus()));
+            modulusAndExponent.put("pubE",bigInt2Hex(((RSAPublicKey)oneKeyPair.getPublic()).getPublicExponent()));
+            modulusAndExponent.put("priM",bigInt2Hex(((RSAPrivateKey)oneKeyPair.getPrivate()).getModulus()));
+            modulusAndExponent.put("priE",bigInt2Hex(((RSAPrivateKey)oneKeyPair.getPrivate()).getPrivateExponent()));
+            return modulusAndExponent;
+        } catch (InvalidParameterException ex) {
+            log.error("KeyPairGenerator does not support a key length of " + KEY_SIZE + ".", ex);
+        } catch (NullPointerException ex) {
+            log.error("RSAUtils#KEY_PAIR_GEN is null, can not generate KeyPairGenerator instance.",
+                    ex);
+        }
+        return null;
+    }
+    
+    
+    
+    
+    /**
+     * 返回生成/读取的密钥对文件的路径。
+     */
+    private static String getRSAPairFilePath() {
+        String urlPath = RSAUtils.class.getResource("/").getPath();
+        return (new File(urlPath).getParent() + RSA_PAIR_FILENAME);
+    }
+    
+    /**
+     * 将指定的RSA密钥对以文件形式保存。
+     * 
+     * @param keyPair 要保存的密钥对。
+     */
+    private static void saveKeyPair(KeyPair keyPair) {
+        FileOutputStream fos = null;
+        ObjectOutputStream oos = null;
+        try {
+            fos = FileUtils.openOutputStream(rsaPairFile);
+            oos = new ObjectOutputStream(fos);
+            oos.writeObject(keyPair);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        } finally {
+            IOUtils.closeQuietly(oos);
+            IOUtils.closeQuietly(fos);
+        }
+    }
+ 
+    /**
+     * 返回RSA密钥对。
+     */
+    public static KeyPair getKeyPair(boolean isCreateKeyPair) {
+        // 首先判断是否需要重新生成新的密钥对文件
+        if (isCreateKeyPair) {
+            // 直接强制生成密钥对文件,并存入缓存。
+            return generateKeyPair();
+        }
+        if (oneKeyPair != null) {
+            return oneKeyPair;
+        }
+        return readKeyPair();
+    }
+     
+    // 同步读出保存的密钥对
+    private static KeyPair readKeyPair() {
+        FileInputStream fis = null;
+        ObjectInputStream ois = null;
+        try {
+            fis = FileUtils.openInputStream(rsaPairFile);
+            ois = new ObjectInputStream(fis);
+            oneKeyPair = (KeyPair) ois.readObject();
+            return oneKeyPair;
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        } finally {
+            IOUtils.closeQuietly(ois);
+            IOUtils.closeQuietly(fis);
+        }
+        return null;
+    }
+ 
+    /**
+     * 根据给定的系数和专用指数构造一个RSA专用的公钥对象。
+     * 
+     * @param modulus 系数。
+     * @param publicExponent 专用指数。
+     * @return RSA专用公钥对象。
+     */
+    public static RSAPublicKey generateRSAPublicKey(byte[] modulus, byte[] publicExponent) {
+        RSAPublicKeySpec publicKeySpec = new RSAPublicKeySpec(new BigInteger(modulus),
+                new BigInteger(publicExponent));
+        try {
+            return (RSAPublicKey) keyFactory.generatePublic(publicKeySpec);
+        } catch (InvalidKeySpecException ex) {
+            log.error("RSAPublicKeySpec is unavailable.", ex);
+        } catch (NullPointerException ex) {
+            log.error("RSAUtils#KEY_FACTORY is null, can not generate KeyFactory instance.", ex);
+        }
+        return null;
+    }
+ 
+    /**
+     * 根据给定的系数和专用指数构造一个RSA专用的私钥对象。
+     * 
+     * @param modulus 系数。
+     * @param privateExponent 专用指数。
+     * @return RSA专用私钥对象。
+     */
+    public static RSAPrivateKey generateRSAPrivateKey(byte[] modulus, byte[] privateExponent) {
+        RSAPrivateKeySpec privateKeySpec = new RSAPrivateKeySpec(new BigInteger(modulus),
+                new BigInteger(privateExponent));
+        try {
+            return (RSAPrivateKey) keyFactory.generatePrivate(privateKeySpec);
+        } catch (InvalidKeySpecException ex) {
+            log.error("RSAPrivateKeySpec is unavailable.", ex);
+        } catch (NullPointerException ex) {
+            log.error("RSAUtils#KEY_FACTORY is null, can not generate KeyFactory instance.", ex);
+        }
+        return null;
+    }
+     
+    /**
+     * 根据给定的16进制系数和专用指数字符串构造一个RSA专用的私钥对象。
+     * 
+     * @param modulus 系数。
+     * @param privateExponent 专用指数。
+     * @return RSA专用私钥对象。
+     */
+    public static RSAPrivateKey getRSAPrivateKey(String hexModulus, String hexPrivateExponent) {
+        if(StringUtils.isBlank(hexModulus) || StringUtils.isBlank(hexPrivateExponent)) {
+            if(log.isDebugEnabled()) {
+                log.debug("hexModulus and hexPrivateExponent cannot be empty. RSAPrivateKey value is null to return.");
+            }
+            return null;
+        }
+        byte[] modulus = null;
+        byte[] privateExponent = null;
+        try {
+            modulus = Hex.decodeHex(hexModulus.toCharArray());
+            privateExponent = Hex.decodeHex(hexPrivateExponent.toCharArray());
+        } catch(DecoderException ex) {
+            log.error("hexModulus or hexPrivateExponent value is invalid. return null(RSAPrivateKey).");
+        }
+        if(modulus != null && privateExponent != null) {
+            return generateRSAPrivateKey(modulus, privateExponent);
+        }
+        return null;
+    }
+     
+    /**
+     * 根据给定的16进制系数和专用指数字符串构造一个RSA专用的公钥对象。
+     * 
+     * @param modulus 系数。
+     * @param publicExponent 专用指数。
+     * @return RSA专用公钥对象。
+     */
+    public static RSAPublicKey getRSAPublidKey(String hexModulus, String hexPublicExponent) {
+        if(StringUtils.isBlank(hexModulus) || StringUtils.isBlank(hexPublicExponent)) {
+            if(log.isDebugEnabled()) {
+                log.debug("hexModulus and hexPublicExponent cannot be empty. return null(RSAPublicKey).");
+            }
+            return null;
+        }
+        byte[] modulus = null;
+        byte[] publicExponent = null;
+        try {
+            modulus = Hex.decodeHex(hexModulus.toCharArray());
+            publicExponent = Hex.decodeHex(hexPublicExponent.toCharArray());
+        } catch(DecoderException ex) {
+            log.error("hexModulus or hexPublicExponent value is invalid. return null(RSAPublicKey).");
+        }
+        if(modulus != null && publicExponent != null) {
+            return generateRSAPublicKey(modulus, publicExponent);
+        }
+        return null;
+    }
+ 
+    /**
+     * 使用指定的公钥加密数据。
+     * 
+     * @param publicKey 给定的公钥。
+     * @param data 要加密的数据。
+     * @return 加密后的数据。
+     */
+    public static byte[] encrypt(PublicKey publicKey, byte[] data) throws Exception {
+        Cipher ci = Cipher.getInstance(ALGORITHOM, DEFAULT_PROVIDER);
+        ci.init(Cipher.ENCRYPT_MODE, publicKey);
+        return ci.doFinal(data);
+    }
+ 
+    /**
+     * 使用指定的私钥解密数据。
+     * 
+     * @param privateKey 给定的私钥。
+     * @param data 要解密的数据。
+     * @return 原数据。
+     */
+    public static byte[] decrypt(PrivateKey privateKey, byte[] data) throws Exception {
+        Cipher ci = Cipher.getInstance(ALGORITHOM, DEFAULT_PROVIDER);
+        ci.init(Cipher.DECRYPT_MODE, privateKey);
+        return ci.doFinal(data);
+    }
+ 
+    /**
+     * 使用给定的公钥加密给定的字符串。
+     * <p />
+     * 若 {@code publicKey} 为 {@code null},或者 {@code plaintext} 为 {@code null} 则返回 {@code
+     * null}。
+     * 
+     * @param publicKey 给定的公钥。
+     * @param plaintext 字符串。
+     * @return 给定字符串的密文。
+     */
+    public static String encryptString(PublicKey publicKey, String plaintext) {
+        if (publicKey == null || plaintext == null) {
+            return null;
+        }
+        byte[] data = plaintext.getBytes();
+        try {
+            byte[] en_data = encrypt(publicKey, data);
+            return new String(Hex.encodeHex(en_data));
+        } catch (Exception ex) {
+            log.error(ex.getCause().getMessage());
+        }
+        return null;
+    }
+     
+
+ 
+    /**
+     * 使用给定的私钥解密给定的字符串。
+     * <p />
+     * 若私钥为 {@code null},或者 {@code encrypttext} 为 {@code null}或空字符串则返回 {@code null}。
+     * 私钥不匹配时,返回 {@code null}。
+     * 
+     * @param privateKey 给定的私钥。
+     * @param encrypttext 密文。
+     * @return 原文字符串。
+     */
+    public static String decryptString(PrivateKey privateKey, String encrypttext) {
+        if (privateKey == null || StringUtils.isBlank(encrypttext)) {
+            return null;
+        }
+        try {
+            byte[] en_data = Hex.decodeHex(encrypttext.toCharArray());
+            byte[] data = decrypt(privateKey, en_data);
+            return new String(data);
+        } catch (Exception ex) {
+            log.error(String.format("\"%s\" Decryption failed. Cause: %s", encrypttext, ex.getCause().getMessage()));
+        }
+        return null;
+    }
+     
+   
+     
+    /** 返回已初始化的默认的公钥。*/
+    public static RSAPublicKey getDefaultPublicKey(boolean isCreateKeyPair) {
+        KeyPair keyPair = getKeyPair(isCreateKeyPair);
+        if(keyPair != null) {
+            return (RSAPublicKey)keyPair.getPublic();
+        }
+        return null;
+    }
+     
+    /** 返回已初始化的默认的私钥。*/
+    public static RSAPrivateKey getDefaultPrivateKey(boolean isCreateKeyPair) {
+        KeyPair keyPair = getKeyPair(isCreateKeyPair);
+        if(keyPair != null) {
+            return (RSAPrivateKey)keyPair.getPrivate();
+        }
+        return null;
+    }
+     
+}

+ 90 - 0
src/main/java/com/wechat/common/utils/SignUtils.java

@@ -0,0 +1,90 @@
+
+package com.wechat.common.utils;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * 请求校验工具类
+ * 
+ */
+public class SignUtils {
+
+    /**
+     * 验证签名
+     * 
+     * @param signature 微信加密签名
+     * @param timestamp 时间戳
+     * @param nonce 随机数
+     * @return
+     */
+    public static boolean checkSignature(String token, String signature, String timestamp,
+            String nonce) {
+        String[] arr = new String[] { token, timestamp, nonce };
+        // 将token、timestamp、nonce三个参数进行字典序排序
+        //Arrays.sort(arr);
+        sort(arr);
+        StringBuilder content = new StringBuilder();
+        for (int i = 0; i < arr.length; i++) {
+            content.append(arr[i]);
+        }
+        MessageDigest md = null;
+        String tmpStr = null;
+
+        try {
+            md = MessageDigest.getInstance("SHA-1");
+            // 将三个参数字符串拼接成一个字符串进行sha1加密
+            byte[] digest = md.digest(content.toString().getBytes());
+            tmpStr = byteToStr(digest);
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+
+        content = null;
+        // 将sha1加密后的字符串可与signature对比,标识该请求来源于微信
+        return tmpStr != null ? tmpStr.equals(signature.toUpperCase()) : false;
+    }
+
+    /**
+     * 将字节数组转换为十六进制字符串
+     * 
+     * @param byteArray
+     * @return
+     */
+    private static String byteToStr(byte[] byteArray) {
+        String strDigest = "";
+        for (int i = 0; i < byteArray.length; i++) {
+            strDigest += byteToHexStr(byteArray[i]);
+        }
+        return strDigest;
+    }
+
+    /**
+     * 将字节转换为十六进制字符串
+     * 
+     * @param mByte
+     * @return
+     */
+    private static String byteToHexStr(byte mByte) {
+        char[] Digit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',
+                'B', 'C', 'D', 'E', 'F' };
+        char[] tempArr = new char[2];
+        tempArr[0] = Digit[(mByte >>> 4) & 0X0F];
+        tempArr[1] = Digit[mByte & 0X0F];
+
+        String s = new String(tempArr);
+        return s;
+    }
+
+    public static void sort(String a[]) {
+        for (int i = 0; i < a.length - 1; i++) {
+            for (int j = i + 1; j < a.length; j++) {
+                if (a[j].compareTo(a[i]) < 0) {
+                    String temp = a[i];
+                    a[i] = a[j];
+                    a[j] = temp;
+                }
+            }
+        }
+    }
+}

+ 108 - 0
src/main/java/com/wechat/common/utils/SoapStudentUtil.java

@@ -0,0 +1,108 @@
+package com.wechat.common.utils;
+
+import java.io.ByteArrayInputStream;
+import java.util.Iterator;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPMessage;
+
+import com.wechat.model.dto.WsdlResponseStudentDto;
+import com.wechat.model.dto.WsdlResponseStudentInfoDto;
+
+import net.sf.json.JSONObject;
+
+public class SoapStudentUtil {
+    
+    /**
+     * 解析soapXML
+     * @param soapXML
+     * @return
+     */
+    public static WsdlResponseStudentDto parseSoapMessage(String soapXML) {
+        WsdlResponseStudentDto resultBean = new WsdlResponseStudentDto();
+        try {
+            SOAPMessage msg = formatSoapString(soapXML);
+            SOAPBody body = msg.getSOAPBody();
+            Iterator<SOAPElement> iterator = body.getChildElements();
+            parse(iterator, resultBean);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return resultBean;
+    }
+
+    public static void main(String[] args) {
+        String deptXML = "<SOAP:Envelope xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP:Header/><SOAP:Body><ns:OP_SDMS_Consume_Material_SynResponse xmlns:ns=\"http://toSDMS.material.service.ffcs.com\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><ns:return><ns:BASEINFO><MSGID>?</MSGID><PMSGID>?</PMSGID><SENDTIME>20140212094609</SENDTIME><S_PROVINCE>?</S_PROVINCE><S_SYSTEM>?</S_SYSTEM><SERVICENAME>?</SERVICENAME><T_PROVINCE>?</T_PROVINCE><T_SYSTEM>?</T_SYSTEM><RETRY>?</RETRY></ns:BASEINFO><ns:MESSAGE><RESULT>E</RESULT><REMARK/><XMLDATA><![CDATA[<response><RESULT>E</RESULT><MESSAGE>平台系统处理时发生异常!保存接口接收数据出错!</MESSAGE></response>]]></XMLDATA></ns:MESSAGE></ns:return></ns:OP_SDMS_Consume_Material_SynResponse></SOAP:Body></SOAP:Envelope>";
+        WsdlResponseStudentDto ret = parseSoapMessage(deptXML);
+        try {
+            SOAPMessage msg = formatSoapString(deptXML);
+            SOAPBody body = msg.getSOAPBody();
+            Iterator<SOAPElement> iterator = body.getChildElements();
+            PrintBody(iterator, null);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 把soap字符串格式化为SOAPMessage
+     * 
+     * @param soapString
+     * @return
+     * @see [类、类#方法、类#成员]
+     */
+    private static SOAPMessage formatSoapString(String soapString) {
+        MessageFactory msgFactory;
+        try {
+            msgFactory = MessageFactory.newInstance();
+            SOAPMessage reqMsg = msgFactory.createMessage(new MimeHeaders(),
+                    new ByteArrayInputStream(soapString.getBytes("UTF-8")));
+            reqMsg.saveChanges();
+            return reqMsg;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 解析soap xml
+     * @param iterator
+     * @param resultBean
+     */
+    private static void parse(Iterator<SOAPElement> iterator, WsdlResponseStudentDto resultBean) {
+        while (iterator.hasNext()) {
+            SOAPElement element = iterator.next();
+            if ("ns2:count".equals(element.getNodeName())) {
+                resultBean.setCount(element.getValue());
+            } else if ("ns2:list".equals(element.getNodeName())){
+                Iterator<SOAPElement> it = element.getChildElements();
+                SOAPElement el = null;
+                while (it.hasNext()) {
+                    el = it.next();
+                    JSONObject json = JSONObject.fromObject(el.getValue());
+                    WsdlResponseStudentInfoDto info = (WsdlResponseStudentInfoDto) JSONObject.toBean(json,WsdlResponseStudentInfoDto.class);
+                    resultBean.setInfo(info);
+                }
+            }else if ("ns2:resCode".equals(element.getNodeName())){
+                resultBean.setResCode(element.getValue());
+            }else if (null == element.getValue()
+                    && element.getChildElements().hasNext()) {
+                parse(element.getChildElements(), resultBean);
+            }
+        }
+    }
+    
+    private static void PrintBody(Iterator<SOAPElement> iterator, String side) {
+        while (iterator.hasNext()) {
+            SOAPElement element = (SOAPElement) iterator.next();
+            if (null == element.getValue()
+                    && element.getChildElements().hasNext()) {
+                PrintBody(element.getChildElements(), side + "-----");
+            }
+        }
+    }
+}

+ 108 - 0
src/main/java/com/wechat/common/utils/SoapUtil.java

@@ -0,0 +1,108 @@
+package com.wechat.common.utils;
+
+import java.io.ByteArrayInputStream;
+import java.util.Iterator;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPMessage;
+
+import com.wechat.model.dto.WsdlResponseDto;
+import com.wechat.model.dto.WsdlResponseInfoDto;
+
+import net.sf.json.JSONObject;
+
+public class SoapUtil {
+    
+    /**
+     * 解析soapXML
+     * @param soapXML
+     * @return
+     */
+    public static WsdlResponseDto parseSoapMessage(String soapXML) {
+        WsdlResponseDto resultBean = new WsdlResponseDto();
+        try {
+            SOAPMessage msg = formatSoapString(soapXML);
+            SOAPBody body = msg.getSOAPBody();
+            Iterator<SOAPElement> iterator = body.getChildElements();
+            parse(iterator, resultBean);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return resultBean;
+    }
+
+    public static void main(String[] args) {
+        String deptXML = "<SOAP:Envelope xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP:Header/><SOAP:Body><ns:OP_SDMS_Consume_Material_SynResponse xmlns:ns=\"http://toSDMS.material.service.ffcs.com\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><ns:return><ns:BASEINFO><MSGID>?</MSGID><PMSGID>?</PMSGID><SENDTIME>20140212094609</SENDTIME><S_PROVINCE>?</S_PROVINCE><S_SYSTEM>?</S_SYSTEM><SERVICENAME>?</SERVICENAME><T_PROVINCE>?</T_PROVINCE><T_SYSTEM>?</T_SYSTEM><RETRY>?</RETRY></ns:BASEINFO><ns:MESSAGE><RESULT>E</RESULT><REMARK/><XMLDATA><![CDATA[<response><RESULT>E</RESULT><MESSAGE>平台系统处理时发生异常!保存接口接收数据出错!</MESSAGE></response>]]></XMLDATA></ns:MESSAGE></ns:return></ns:OP_SDMS_Consume_Material_SynResponse></SOAP:Body></SOAP:Envelope>";
+        WsdlResponseDto ret = parseSoapMessage(deptXML);
+        try {
+            SOAPMessage msg = formatSoapString(deptXML);
+            SOAPBody body = msg.getSOAPBody();
+            Iterator<SOAPElement> iterator = body.getChildElements();
+            PrintBody(iterator, null);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 把soap字符串格式化为SOAPMessage
+     * 
+     * @param soapString
+     * @return
+     * @see [类、类#方法、类#成员]
+     */
+    private static SOAPMessage formatSoapString(String soapString) {
+        MessageFactory msgFactory;
+        try {
+            msgFactory = MessageFactory.newInstance();
+            SOAPMessage reqMsg = msgFactory.createMessage(new MimeHeaders(),
+                    new ByteArrayInputStream(soapString.getBytes("UTF-8")));
+            reqMsg.saveChanges();
+            return reqMsg;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 解析soap xml
+     * @param iterator
+     * @param resultBean
+     */
+    private static void parse(Iterator<SOAPElement> iterator, WsdlResponseDto resultBean) {
+        while (iterator.hasNext()) {
+            SOAPElement element = iterator.next();
+            if ("ns2:count".equals(element.getNodeName())) {
+                resultBean.setCount(element.getValue());
+            } else if ("ns2:list".equals(element.getNodeName())){
+                Iterator<SOAPElement> it = element.getChildElements();
+                SOAPElement el = null;
+                while (it.hasNext()) {
+                    el = it.next();
+                    JSONObject json = JSONObject.fromObject(el.getValue());
+                    WsdlResponseInfoDto info = (WsdlResponseInfoDto) JSONObject.toBean(json,WsdlResponseInfoDto.class);
+                    resultBean.setInfo(info);
+                }
+            }else if ("ns2:resCode".equals(element.getNodeName())){
+                resultBean.setResCode(element.getValue());
+            }else if (null == element.getValue()
+                    && element.getChildElements().hasNext()) {
+                parse(element.getChildElements(), resultBean);
+            }
+        }
+    }
+    
+    private static void PrintBody(Iterator<SOAPElement> iterator, String side) {
+        while (iterator.hasNext()) {
+            SOAPElement element = (SOAPElement) iterator.next();
+            if (null == element.getValue()
+                    && element.getChildElements().hasNext()) {
+                PrintBody(element.getChildElements(), side + "-----");
+            }
+        }
+    }
+}

+ 1124 - 0
src/main/java/com/wechat/common/utils/StringsUtils.java

@@ -0,0 +1,1124 @@
+package com.wechat.common.utils;
+
+import java.math.BigDecimal;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Random;
+import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public final class StringsUtils extends BaseUtils {
+
+    /**
+     * 编码格式定义
+     */
+    private static final String ENCODE    = "UTF-8";
+
+    /**
+     * 随机对象
+     */
+    private static Random       crsRand;
+
+    /**
+     * 随机对象
+     */
+    private static SecureRandom crsSecureRand;
+
+    /**
+     * token 用
+     */
+    private static final int    PAD_BELOW = 0x10;
+
+    /**
+     * token 用
+     */
+    private static final int    TWO_BYTES = 0xFF;
+
+    /**
+     * 访问Ip
+     */
+    private static String       s_id;
+
+    /**
+     * 构造函数
+     */
+    private StringsUtils()
+    {
+    }
+
+    /**
+     * 加载数据
+     */
+    static {
+        crsSecureRand = new SecureRandom();
+        long secureInitializer = crsSecureRand.nextLong();
+        crsRand = new Random(secureInitializer);
+        try {
+            s_id = InetAddress.getLocalHost().toString();
+        }
+        catch (UnknownHostException e) {
+            //DebugLogger.log(e.getMessage());
+        }
+    }
+
+    /**
+     * 字符串转黄成字符创数组,用逗号分组
+     * 
+     * @param str
+     * @return
+     */
+    public static String[] str2Array(String str) {
+        return str2Array(str, ",");
+    }
+
+    /**
+     * 根据只等分隔符处理String装换成数组
+     * 
+     * @param str
+     * @param sep
+     * @return
+     */
+    public static String[] str2Array(String str, String sep) {
+        StringTokenizer token = null;
+        String[] array = null;
+
+        // check
+        if (str == null || sep == null) {
+            return null;
+        }
+
+        // get string array
+        token = new StringTokenizer(str, sep);
+        array = new String[token.countTokens()];
+        for (int i = 0; token.hasMoreTokens(); i++) {
+            array[i] = token.nextToken();
+        }
+
+        return array;
+    }
+
+    /**
+     * String 数组转换成String
+     * 
+     * @param str
+     * @return
+     */
+    public static String array2String(String[] str) {
+        int num = 0;
+        StringBuffer result = new StringBuffer("");
+        if (str == null) {
+            return "";
+        }
+        num = str.length;
+        for (int i = 0; i < num; i++) {
+            if (str[i] != null) {
+                result.append(str[i]);
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * 正则表达式匹配<br>
+     * 
+     * @param value
+     * @param regexp
+     * @return boolean
+     */
+    public static boolean matches(String value, String regexp) {
+        if (isEmpty(value) || isEmpty(regexp)) {
+            return false;
+        }
+        else {
+            return value.matches(regexp);
+        }
+    }
+
+    /**
+     * 判断是否都是半角 <br>
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalf(String txt) {
+        if (txt == null) {
+            return true;
+        }
+        try {
+            txt = txt.replaceAll("\\?", "");
+
+            byte[] b = txt.getBytes(ENCODE);
+            for (int i = 0; i < b.length; i++) {
+                if ((b[i] & 0x80) == 0x80) {
+                    if (!(((byte) 0xA0) <= b[i] && b[i] <= ((byte) 0xDf))) {
+                        return false;
+                    }
+                }
+                else if (b[i] == 0x3F) {
+                    return false;
+                }
+            }
+            return true;
+        }
+        catch (java.io.UnsupportedEncodingException e) {
+            return false;
+        }
+    }
+
+    /**
+     * 判断是否都是半角的英文和数字
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalfENGNum(String txt) {
+        StringBuffer checkText = null;
+
+        if (txt == null) {
+            return true;
+        }
+        checkText = new StringBuffer(txt);
+        for (int i = 0; i < checkText.length(); i++) {
+            String subcheckText = checkText.substring(i, i + 1);
+            if (!matches(subcheckText, "([a-zA-Z]+)") && !matches(subcheckText, "([0-9]+)")) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 判断半角大写英文字符和数字
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalfUpperENGNum(String txt) {
+        StringBuffer checkText = null;
+
+        if (txt == null) {
+            return true;
+        }
+        checkText = new StringBuffer(txt);
+        for (int i = 0; i < checkText.length(); i++) {
+            String subcheckText = checkText.substring(i, i + 1);
+            if (!matches(subcheckText, "([A-Z]+)") && !matches(subcheckText, "([0-9]+)")) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 判断半角大写英文字符和数字和符号"-"
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalfUpperENGNumHalfSymbol(String txt) {
+        StringBuffer checkText = null;
+
+        if (txt == null) {
+            return true;
+        }
+        checkText = new StringBuffer(txt);
+        for (int i = 0; i < checkText.length(); i++) {
+            String subcheckText = checkText.substring(i, i + 1);
+            if (!matches(subcheckText, "([A-Z]+)") && !matches(subcheckText, "([0-9]+)") && !matches(subcheckText, "-")
+                    && !matches(subcheckText, " ")) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 判断半角大写英文字符和数字和符号"-" 加空格
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalfUpperENGNumHalfSymbolSpace(String txt) {
+        StringBuffer checkText = null;
+
+        if (txt == null) {
+            return true;
+        }
+        checkText = new StringBuffer(txt);
+        for (int i = 0; i < checkText.length(); i++) {
+            String subcheckText = checkText.substring(i, i + 1);
+            if (!matches(subcheckText, "([A-Z]+)") && !matches(subcheckText, "([0-9]+)") && !matches(subcheckText, "-")
+                    && !isEqual(subcheckText, " ")) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 判断半角大写英文字符与数字
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalfEN(String txt) {
+        if (txt == null) {
+            return true;
+        }
+        if (matches(txt, "([a-zA-Z]+)")) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 正整数验证
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isPositiveNumHalf(String txt) {
+        if (isEmpty(txt)) {
+            return true;
+        }
+
+        if (matches(txt, "([0-9]+)")) {
+            if (Integer.parseInt(txt) <= 0) {
+                return false;
+            }
+            else {
+                return true;
+            }
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+     * 判断是否是半角数字
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalfNum(String txt) {
+        if (txt == null) {
+            return true;
+        }
+        if (matches(txt, "([0-9]+)")) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 整数验证
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isInteger(String txt) {
+        if (isEmpty(txt)) {
+            return true;
+        }
+
+        if (matches(txt, "([-+]?[0-9]+)")) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 判断是否是半角数字和小数点
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalfNumPoint(String txt) {
+        if (txt == null) {
+            return true;
+        }
+        if (!txt.contains(".")) {
+            if (matches(txt, "([0-9]+)")) {
+                return true;
+            }
+        }
+        if (matches(txt, "([0-9]+.[0-9]+)")) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 判断是否是半角数字和小数点
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isBigDecimal(String txt) {
+        if (txt == null) {
+            return true;
+        }
+        if (!txt.contains(".")) {
+            if (matches(txt, "^[-+]?([0-9]+)")) {
+                return true;
+            }
+        }
+        if (matches(txt, "^[-+]?([0-9]+.[0-9]+)")) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 判断两个String 是否相等, 如果都是null 也表示相等
+     * 
+     * @param s1
+     * @param s2
+     * @return boolean
+     */
+    public static boolean isEqual(String s1, String s2) {
+        if (s1 == null) {
+            s1 = "";
+        }
+        if (s2 == null) {
+            s2 = "";
+        }
+
+        return (s1.equals(s2));
+    }
+
+    /**
+     * 判断s1 是否包含s2
+     * 
+     * @param s1
+     * @param s2
+     * @return boolean
+     */
+    public static boolean isContains(String s1, String s2) {
+        if (s1 == null) {
+            return false;
+        }
+        if (s2 == null) {
+            return false;
+        }
+
+        return (s1.contains(s2));
+    }
+
+    /**
+     * 处理String null 如果是null 返回空字符串,否则返回trim后的String
+     * 
+     * @param value
+     * @return String
+     */
+    public static String nvl(String value) {
+        if (value == null) {
+            return "";
+        }
+        else {
+            return value.trim();
+        }
+    }
+
+    /**
+     * int 转换成String
+     * 
+     * @param value
+     * @return String
+     */
+    public static String parseInt(Integer value) {
+        if (value == null) {
+            return "";
+        }
+        else {
+            return String.valueOf(value);
+        }
+    }
+
+    /**
+     * long 转换成字符串
+     * 
+     * @param value
+     * @return String
+     */
+    public static String parseLong(Long value) {
+        if (value == null) {
+            return "";
+        }
+        else {
+            return String.valueOf(value);
+        }
+    }
+
+    /**
+     * Short 转换成字符串
+     * 
+     * @param value
+     * @return String
+     */
+    public static String parseShort(Short value) {
+        if (value == null) {
+            return "";
+        }
+        else {
+            return String.valueOf(value);
+        }
+    }
+
+    /**
+     * 判断是否为空
+     * 
+     * @param str
+     * @return boolean
+     */
+    public static boolean isEmpty(String str) {
+        if ("".equals(nvl(str))) {
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+     * String list转换成String 数组
+     * 
+     * @param inputList
+     * @return String[]
+     */
+    public static String[] listToStringArray(List<String> inputList) {
+        return inputList.toArray(new String[inputList.size()]);
+    }
+
+    /**
+     * 取得 hash String
+     * 
+     * @param md5Data
+     * @return String
+     */
+    public static String getHashString(byte[] md5Data) {
+        StringBuffer hashString = new StringBuffer();
+        for (int i = 0; i < md5Data.length; ++i) {
+            String hex = Integer.toHexString(md5Data[i]);
+            if (hex.length() == 1) {
+                hashString.append('0');
+                hashString.append(hex.charAt(0));
+            }
+            else {
+                hashString.append(hex.substring(hex.length() - 2));
+            }
+        }
+        return hashString.toString();
+    }
+
+    /**
+     * 取得HexString
+     * 
+     * @param in
+     * @return String
+     */
+    public static String toHexString(byte[] in) {
+        byte ch = 0x00;
+        int i = 0;
+
+        if (in == null || in.length <= 0) {
+            return null;
+        }
+
+        String[] pseudo = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" };
+
+        StringBuffer out = new StringBuffer(in.length * 2);
+
+        while (i < in.length) {
+            ch = (byte) (in[i] & 0xF0);
+            ch = (byte) (ch >>> 4);
+            ch = (byte) (ch & 0x0F);
+            out.append(pseudo[(int) ch]);
+            ch = (byte) (in[i] & 0x0F);
+            out.append(pseudo[(int) ch]);
+            i++;
+        }
+
+        String rslt = new String(out);
+        return rslt;
+
+    }
+
+    /**
+     * String 数组转List
+     * 
+     * @param arrays
+     * @return List<String>
+     */
+    public static List<String> stringArray2List(String[] arrays) {
+        if (arrays == null) {
+            return null;
+        }
+        ArrayList<String> list = new ArrayList<String>();
+        for (int i = 0; i < arrays.length; i++) {
+            list.add(arrays[i]);
+        }
+        return list;
+    }
+
+    /**
+     * @Title: anyIsEmpty
+     * @Description: 判断是否为空
+     * @author hl
+     * @return boolean
+     * @throws
+     */
+    public static boolean anyIsEmpty(Object... object) {
+        for (Object o : object) {
+            if (o == null) {
+                return true;
+            }
+            if (o instanceof String) {
+                if (isEmpty((String) o)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 随机字符串源
+     */
+    private static final String BASE_CHAR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+    /**
+     * 或得随机字符串
+     * 
+     * @param length
+     * @return String
+     */
+    public static String getRandomString(int length) {
+        Random random = new Random();
+        StringBuffer sbReturn = new StringBuffer();
+        for (int i = 0; i < length; i++) {
+            int number = random.nextInt(BASE_CHAR.length());
+            sbReturn.append(BASE_CHAR.charAt(number));
+        }
+        return sbReturn.toString();
+    }
+
+    /**
+     * 随机字符串源
+     */
+    private static final String BASE_NUM = "0123456789";
+
+    /**
+     * 获得随机数字
+     * 
+     * @param length
+     * @return String
+     */
+    public static String getRandomNum(int length) {
+        Random random = new Random();
+        StringBuffer sbReturn = new StringBuffer();
+        for (int i = 0; i < length; i++) {
+            int number = random.nextInt(BASE_NUM.length());
+            sbReturn.append(BASE_NUM.charAt(number));
+        }
+        return sbReturn.toString();
+    }
+    
+    /**
+     * 获得指定范围的随机一个数字
+     * 
+     * @param length
+     * @return int
+     */
+    public static int getOneRandomNum(int length) {
+        Random random = new Random();
+        int number = random.nextInt(BASE_NUM.substring(0, length).length());
+        return number;
+    }
+
+    /**
+     * String 转换成 bigDecimail
+     * 
+     * @param number
+     * @return BigDecimal
+     */
+    public static BigDecimal formatString2BigDecimal(String number) {
+        if (isEmpty(number)) {
+            return null;
+        }
+        try {
+            return new BigDecimal(number.trim().replace(",", ""));
+        }
+        catch (Exception e) {
+            throw e;
+        }
+    }
+
+    /**
+     * BigDecimal 转String
+     * 
+     * @param value
+     * @param suffix
+     * @return String
+     */
+    public static String formatBigDecimal(BigDecimal value, int suffix) {
+        if (value == null) {
+            return "";
+        }
+        String fmtString = "###,###,###,###,##0";
+
+        if (suffix > 0) {
+            fmtString += ".";
+
+            for (int i = 0; i < suffix; i++) {
+                fmtString += "0";
+            }
+        }
+
+        DecimalFormat fmt = new DecimalFormat(fmtString);
+        if (value.doubleValue() == 0) {
+            return fmt.format(0.00);
+        }
+        else {
+            return fmt.format(value.doubleValue());
+        }
+    }
+
+    /**
+     * BigDecimal 转String
+     * 
+     * @param value
+     * @param suffix
+     * @return String
+     */
+    public static String bigDecimalToString(BigDecimal value, int suffix) {
+        if (value == null) {
+            return "";
+        }
+        String fmtString = "##############0";
+
+        if (suffix > 0) {
+            fmtString += ".";
+
+            for (int i = 0; i < suffix; i++) {
+                fmtString += "0";
+            }
+        }
+
+        DecimalFormat fmt = new DecimalFormat(fmtString);
+        if (value.doubleValue() == 0) {
+            return fmt.format(0.00);
+        }
+        else {
+            return fmt.format(value.doubleValue());
+        }
+    }
+
+    /**
+     * BigDecimal 转String 如果格式错误, 返回原字符串
+     * 
+     * @param value
+     * @param suffix
+     * @return String
+     */
+    public static String formatBigDecimal(String value, int suffix) {
+        if (!isBigDecimal(value)) {
+            return value;
+        }
+        BigDecimal bigDecimalvalue = formatString2BigDecimal(value);
+        String fmtString = "###,###,###,###,###,##0";
+
+        if (suffix > 0) {
+            fmtString += ".";
+
+            for (int i = 0; i < suffix; i++) {
+                fmtString += "0";
+            }
+        }
+
+        DecimalFormat fmt = new DecimalFormat(fmtString);
+        if (bigDecimalvalue.doubleValue() == 0) {
+            return fmt.format(0.00);
+        }
+        else {
+            return fmt.format(bigDecimalvalue.doubleValue());
+        }
+    }
+
+    /**
+     * 将String 形式的数值格式化(保留指定位数的小数), 返回原字符串
+     * 
+     * @param value
+     * @param suffix
+     * @return String
+     */
+    public static String formatStringToNumber(String value, int suffix) {
+
+        return StringsUtils.bigDecimalToString(StringsUtils.formatString2BigDecimal(value), suffix);
+    }
+
+    /** 半角符号 */
+    private static String halfSymbol = "!\"#$%&'()=~|`{+*}<>?_-^\\@[;:],./";
+
+    /**
+     * 判断是否是半角符号
+     * 
+     * @param txt
+     * @return boolean
+     */
+    public static boolean isHalfSymbol(String txt) {
+        if (halfSymbol.indexOf(txt) >= 0) {
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+     * token create<br>
+     * 
+     * @return String token
+     */
+    public static String createToken(boolean secure) {
+        MessageDigest md5 = null;
+        StringBuffer sbValueBeforeMD5 = new StringBuffer(128);
+        String valueBeforeMD5 = "";
+        try {
+            md5 = MessageDigest.getInstance("MD5");
+        }
+        catch (NoSuchAlgorithmException e) {
+            // Should not happen
+            throw new IllegalStateException(e);
+        }
+
+        long time = System.currentTimeMillis();
+        long rand = 0;
+
+        if (secure) {
+            rand = crsSecureRand.nextLong();
+        }
+        else {
+            rand = crsRand.nextLong();
+        }
+        sbValueBeforeMD5.append(s_id);
+        sbValueBeforeMD5.append(":");
+        sbValueBeforeMD5.append(Long.toString(time));
+        sbValueBeforeMD5.append(":");
+        sbValueBeforeMD5.append(Long.toString(rand));
+
+        valueBeforeMD5 = sbValueBeforeMD5.toString();
+        md5.update(valueBeforeMD5.getBytes());
+
+        byte[] array = md5.digest();
+        StringBuffer sb = new StringBuffer(32);
+        for (int j = 0; j < array.length; ++j) {
+            int b = array[j] & TWO_BYTES;
+            if (b < PAD_BELOW) {
+                sb.append('0');
+            }
+            sb.append(Integer.toHexString(b));
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * 长度范围内前加0
+     * 
+     * @param val
+     * @param length
+     * @return String
+     */
+    public static String addPreZero(Object val, int length) {
+        if (val == null) {
+            val = "";
+        }
+        String result = val.toString();
+        int strLen = result.length();
+        if (strLen < length) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0; i < length - strLen; i++) {
+                sb.append('0');
+            }
+            sb.append(val);
+            result = sb.toString();
+        }
+        else {
+            result = result.substring(0, length);
+        }
+
+        return result;
+    }
+
+    /**
+     * 判断List是否为空,空返回true
+     */
+    @SuppressWarnings("rawtypes")
+    public static boolean isListEmpty(List list) {
+        if (null != list && list.size() > 0) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 判断是否不为空,不空返回true
+     * 
+     * @param str
+     * @return boolean
+     */
+    public static boolean isNotEmpty(String str) {
+        return !isEmpty(str);
+    }
+
+    /**
+     * 去除所有空格,包括中间的
+     * 
+     * @param str
+     * @return boolean
+     */
+    public static String removeAllSpace(String str) {
+        return str.replaceAll("\\s+", "");
+    }
+
+    /**
+     * 封装String类的split
+     * 
+     * @param str
+     * @param symbol
+     * @return String[]
+     */
+    public static String[] split(String str, String symbol) {
+        if (isEmpty(str)) {
+            return null;
+        }
+
+        return str.split(symbol);
+    }
+
+    /**
+     * 去掉 resource中的空元素
+     * 
+     * @param resource
+     * @return String[]
+     */
+    public static String[] removeNull(String[] resource) {
+        List<String> target = new LinkedList<String>();
+
+        if (!isNotEmptyStringArray(resource)) {
+            return null;
+        }
+
+        for (String s : resource) {
+            if (isNotEmpty(s)) {
+                target.add(s);
+            }
+        }
+
+        return target.toArray(new String[target.size()]);
+    }
+
+    /**
+     * 判断是否是空的字符串数组
+     * 
+     * @param strs
+     * @return boolean
+     */
+    public static boolean isNotEmptyStringArray(String[] strs) {
+        return strs != null && strs.length != 0;
+    }
+
+    /**
+     * 验证金额输入框的值
+     * 
+     * @return
+     */
+    public static boolean isMoneyInput(String value) {
+        if (StringsUtils.matches(value, "(^[1-9]\\d{0,8}$)|(^0\\.\\d{1,2}$)|(^[1-9]\\d{0,8}\\.\\d{1,2}$)")) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 验证金额的整数部分是不是大于5位
+     * 
+     * @param value
+     * @return
+     */
+    public static boolean checkMoneyInputFiveBelow(BigDecimal value) {
+        if (null == value) {
+            return false;
+        }
+        String val = String.valueOf(value);
+        String intVal = "";
+        if (val.indexOf(".") < 0) {
+            intVal = val;
+        }
+        else {
+            intVal = val.substring(0, val.indexOf("."));
+        }
+        if (intVal.length() > 5) {
+            return false;
+        }
+        else {
+            return true;
+        }
+    }
+
+    /**
+     * 判断String中是否包含空格
+     * 
+     * @param str 判断字符串
+     * @return 是否包含空格
+     */
+    public static boolean checkHasBlankSpace(String str) {
+        if (str.contains(" ") || str.contains(" ")) {
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+     * Object 转换成String 避免出现空指针异常
+     * 
+     * @param obj 传入对象
+     * @return 转换后的字符串
+     */
+    public static String object2String(Object obj) {
+        return String.valueOf(obj);
+    }
+
+    /**
+     * 去除全角半角的前后空格
+     * 
+     * @param str 源字符串
+     * @return trim 后的字符串
+     */
+    public static String trim(String str) {
+        if (str == null) {
+            return "";
+        }
+        else {
+            str = str.trim();
+            if (str.startsWith(" ") || str.startsWith(" ") || str.startsWith(" ")) {
+                str = str.substring(1, str.length());
+                return trim(str);
+            }
+            else if (str.endsWith(" ") || str.endsWith(" ") || str.endsWith(" ")) {
+                str = str.substring(0, str.length() - 1);
+                return trim(str);
+            }
+            else {
+                return str;
+            }
+        }
+    }
+
+    /**
+     * String 字符串格式化, 传入格式化模式, 源字符串
+     * 
+     * @param formatPartten
+     * @param regionString
+     * @return 格式化后的字符串
+     */
+    public static String stringFormat(String formatPartten, String regionString) {
+        try {
+            String s = String.format(formatPartten, regionString);
+            return s;
+        }
+        catch (Exception e) {
+            return regionString.toString();
+        }
+    }
+
+    /**
+     * 使用java正则表达式去掉多余的.与0
+     * 
+     * @param s
+     * @return
+     */
+    public static String subZeroAndDot(String s) {
+        if (s.indexOf("0E") == 0) {
+            s = "0";
+        }
+        if (s.indexOf(".") > 0) {
+            s = s.replaceAll("0+?$", "");//去掉多余的0  
+            s = s.replaceAll("[.]$", "");//如最后一位是.则去掉  
+        }
+        return s;
+    }
+
+    /**
+     * BigDecimal转String
+     * 
+     * @param s
+     * @return
+     */
+    public static String decimal2String(BigDecimal d) {
+        if (d == null) {
+            return null;
+        }
+        else {
+            return d.toString();
+        }
+    }
+
+    /**
+     * 第一参数为空返回默认第二参数
+     * 
+     * @param target
+     * @param def
+     * @return
+     */
+    public static String defaultStr(String target, String def) {
+        if (StringsUtils.isEmpty(target)) {
+            return def;
+        }
+        return StringsUtils.trim(target);
+    }
+
+    public static String defaultStr(String target) {
+        return defaultStr(target, "");
+    }
+
+    public static void main(String[] args) {
+    }
+    
+    /**
+     * 将富文本内容中的图片地址转化为请求流
+     * @param source 富文本内容
+     * @param target 拼接富文本图片请求地址
+     * @return 将富文本内容中的图片地址转化为请求流
+     */
+    public static String strConvert(String source,String target){
+        Pattern p = Pattern.compile("<img[^>]+src\\s*=\\s*['\"]([^'\"]+)['\"][^>]*>");
+        Matcher m = p.matcher(source);
+        while (m.find()) {
+                String src = m.group(1);
+                String[] st = src.split("/");
+                String img = "/";
+                for (int i =st.length - 2; i< st.length;i++){
+                    if (i == st.length - 1){
+                        img = img + st[i];
+                    } else {
+                        img = img + st[i] + "/";
+                    }
+                }
+                source=source.replace(src, target+img);
+        }
+        return source;
+    }
+}

+ 126 - 0
src/main/java/com/wechat/common/utils/TextUtil.java

@@ -0,0 +1,126 @@
+package com.wechat.common.utils;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+
+
+/**
+ * 短信http接口的java代码调用示例
+ */
+public class TextUtil {
+	/**
+	 * 服务http地址
+	 */
+	private static String BASE_URI = "http://yunpian.com";
+	/**
+	 * 服务版本号
+	 */
+	private static String VERSION = "v1";
+	/**
+	 * 编码格式
+	 */
+	private static String ENCODING = "UTF-8";
+	/**
+	 * 查账户信息的http地址
+	 */
+	private static String URI_GET_USER_INFO = BASE_URI + "/" + VERSION + "/user/get.json";
+	/**
+	 * 通用发送接口的http地址
+	 */
+	private static String URI_SEND_SMS = BASE_URI + "/" + VERSION + "/sms/send.json";
+	/**
+	 * 模板发送接口的http地址
+	 */
+	private static String URI_TPL_SEND_SMS = BASE_URI + "/" + VERSION + "/sms/tpl_send.json";
+	/**
+	 * apikey
+	 */
+	private static String apikey;
+	
+	static{
+		Properties prop = new Properties();
+		try {
+			InputStream in = new FileInputStream(TextUtil.class.getResource("/").getPath()+"conf.test.properties");
+			prop.load(in);
+			apikey = prop.getProperty("API_KEY");
+		} catch (FileNotFoundException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} 
+	}
+	/**
+	 * 取账户信息
+	 * 
+	 * @return json格式字符串
+	 * @throws IOException
+	 */
+	public static String getUserInfo() throws IOException {
+		HttpClient client = new HttpClient();
+		HttpMethod method = new GetMethod(URI_GET_USER_INFO + "?apikey=" + apikey);
+		HttpMethodParams param = method.getParams();
+		param.setContentCharset(ENCODING);
+		client.executeMethod(method);
+		return method.getResponseBodyAsString();
+	}
+
+	/**
+	 * 发短信
+	 * 
+	 * @param apikey apikey
+	 * @param text 短信内容
+	 * @param mobile 接受的手机号
+	 * @return json格式字符串
+	 * @throws IOException
+	 */
+	public static String sendSms(String text, String mobile) throws IOException {
+		HttpClient client = new HttpClient();
+		NameValuePair[] nameValuePairs = new NameValuePair[3];
+		nameValuePairs[0] = new NameValuePair("apikey", apikey);
+		nameValuePairs[1] = new NameValuePair("text", text);
+		nameValuePairs[2] = new NameValuePair("mobile", mobile);
+		PostMethod method = new PostMethod(URI_SEND_SMS);
+		method.setRequestBody(nameValuePairs);
+		HttpMethodParams param = method.getParams();
+		param.setContentCharset(ENCODING);
+		client.executeMethod(method);
+		return method.getResponseBodyAsString();
+	}
+
+	/**
+	 * 通过模板发送短信
+	 * 
+	 * @param apikey apikey
+	 * @param tpl_id 模板id
+	 * @param tpl_value 模板变量值
+	 * @param mobile 接受的手机号
+	 * @return json格式字符串
+	 * @throws IOException
+	 */
+	public static String tplSendSms(long tpl_id, String tpl_value, String mobile) throws IOException {
+		HttpClient client = new HttpClient();
+		NameValuePair[] nameValuePairs = new NameValuePair[4];
+		nameValuePairs[0] = new NameValuePair("apikey", apikey);
+		nameValuePairs[1] = new NameValuePair("tpl_id", String.valueOf(tpl_id));
+		nameValuePairs[2] = new NameValuePair("tpl_value", tpl_value);
+		nameValuePairs[3] = new NameValuePair("mobile", mobile);
+		PostMethod method = new PostMethod(URI_TPL_SEND_SMS);
+		method.setRequestBody(nameValuePairs);
+		HttpMethodParams param = method.getParams();
+		param.setContentCharset(ENCODING);
+		client.executeMethod(method);
+		return method.getResponseBodyAsString();
+	}
+}

+ 151 - 0
src/main/java/com/wechat/common/utils/WsdlUtils.java

@@ -0,0 +1,151 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.common.utils;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.text.ParseException;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.RequestEntity;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.xpath.DefaultXPath;
+import org.springframework.beans.factory.annotation.Value;
+
+import com.wechat.model.dto.WsdlResponseDto;
+import com.wechat.model.dto.WsdlResponseStudentDto;
+
+
+
+/**
+ * 
+ * @author ThinkGem
+ */
+public class WsdlUtils extends DateUtils {
+   
+    public static WsdlResponseDto check(String name, String mqsfzh, String fqsfzh, String xb, String csrq, String mqxm, String fqxm, String wsdlUrl, String wsdlKey,String wsdlStr) {
+//        String name="王心彤";
+//        String mqsfzh="320925198210070021";
+//        String fqsfzh="32052519821024443X";
+//        String xb="2";
+//        String csrq="2013-02-21";
+//        String mqxm="谢淑玲";
+//        String fqxm="王振文";
+//        String wsdlUrl="http://61.132.114.110/esb/queryByParamWebs?wsdl=queryByParamWebs.wsdl";
+//        String wsdlKey="9458c18d99274d437858fa502442083c";
+//        String wsdlStr="WEIJW_CSXX";
+        WsdlResponseDto ret = new WsdlResponseDto();
+        try {
+            String soapRequestData = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ws=\"http://ws.digitalchina.com/\">\n" +
+                    "   <soapenv:Header/>\n" +
+                    "   <soapenv:Body>\n" +
+                    "      <ws:queryByParameter>\n" +
+                    "         <arg0>"+wsdlKey+"</arg0>\n" +
+                    "         <arg1>"+wsdlStr+"</arg1>\n" +
+                    "         <arg2></arg2>\n" +
+                    "         <arg3></arg3>\n" +
+                    "         <arg4>" + name +"##"+mqsfzh+"##"+fqsfzh+"##"+xb+"##"+csrq+"##"+mqxm+"##"+fqxm+"</arg4>\n" +
+                    "      </ws:queryByParameter>\n" +
+                    "   </soapenv:Body>\n" +
+                    "</soapenv:Envelope>";
+           
+            PostMethod post = new PostMethod(wsdlUrl);
+            byte[] b = soapRequestData.getBytes("utf-8");
+            InputStream is = new ByteArrayInputStream(b, 0, b.length);
+            RequestEntity re = new InputStreamRequestEntity(is, b.length, "text/xml; charset=utf-8");
+            // post.setParams(null);
+            post.setRequestEntity(re);
+            // post.setRequestHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client +http://xfire.codehaus.org)");
+            post.setRequestHeader("SOAPAction", "queryByParamWebs");
+            HttpClient httpClient = new HttpClient();
+            httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(8000);
+            httpClient.getHttpConnectionManager().getParams().setSoTimeout(8000);
+            int statusCode = httpClient.executeMethod(post);         
+            //httpClient.setConnectionTimeout(9000);
+            // soapRequest = post.getResponseBodyAsString();
+            InputStream iss = post.getResponseBodyAsStream();
+            BufferedReader br = new BufferedReader(new InputStreamReader(iss, "utf-8"));
+            StringBuffer stringBuffer = new StringBuffer();
+            String str = "";
+            while ((str = br.readLine()) != null) {
+                stringBuffer.append(str);
+            }
+            String dd = stringBuffer.toString();
+            // String sd=dd.replaceAll(";", "");
+            // sd=sd.replaceAll("&#x", "\\\\u");
+            // String msg=decodeUnicode(sd);
+
+            post.abort();
+            ret = SoapUtil.parseSoapMessage(dd);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+        return ret;
+    }
+    
+    
+    public static WsdlResponseStudentDto check(String name, String sfzh, String xb, String mz, String ssqx, String wsdlUrl, String wsdlKey,String wsdlStr) {
+        WsdlResponseStudentDto ret = new WsdlResponseStudentDto();
+        try {
+            String soapRequestData = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ws=\"http://ws.digitalchina.com/\">\n" +
+                    "   <soapenv:Header/>\n" +
+                    "   <soapenv:Body>\n" +
+                    "      <ws:queryByParameter>\n" +
+                    "         <arg0>"+wsdlKey+"</arg0>\n" +
+                    "         <arg1>"+wsdlStr+"</arg1>\n" +
+                    "         <arg2></arg2>\n" +
+                    "         <arg3></arg3>\n" +
+                    "         <arg4>" + name +"##"+sfzh+"##"+xb+"##"+mz+"##"+ssqx+"##?##?##?##?##?</arg4>\n" +
+                    "      </ws:queryByParameter>\n" +
+                    "   </soapenv:Body>\n" +
+                    "</soapenv:Envelope>";
+           
+            PostMethod post = new PostMethod(wsdlUrl);
+            byte[] b = soapRequestData.getBytes("utf-8");
+            InputStream is = new ByteArrayInputStream(b, 0, b.length);
+            RequestEntity re = new InputStreamRequestEntity(is, b.length, "text/xml; charset=utf-8");
+            // post.setParams(null);
+            post.setRequestEntity(re);
+            // post.setRequestHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client +http://xfire.codehaus.org)");
+            post.setRequestHeader("SOAPAction", "queryByParamWebs");
+            HttpClient httpClient = new HttpClient();
+            httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(8000);
+            httpClient.getHttpConnectionManager().getParams().setSoTimeout(8000);
+            int statusCode = httpClient.executeMethod(post);
+            // soapRequest = post.getResponseBodyAsString();
+            InputStream iss = post.getResponseBodyAsStream();
+            BufferedReader br = new BufferedReader(new InputStreamReader(iss, "utf-8"));
+            StringBuffer stringBuffer = new StringBuffer();
+            String str = "";
+            while ((str = br.readLine()) != null) {
+                stringBuffer.append(str);
+            }
+            String dd = stringBuffer.toString();
+            // String sd=dd.replaceAll(";", "");
+            // sd=sd.replaceAll("&#x", "\\\\u");
+            // String msg=decodeUnicode(sd);
+
+            post.abort();
+            ret = SoapStudentUtil.parseSoapMessage(dd);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+        return ret;
+    }
+    
+
+}

+ 42 - 0
src/main/java/com/wechat/common/utils/XmlUtils.java

@@ -0,0 +1,42 @@
+package com.wechat.common.utils;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+public class XmlUtils extends BaseUtils{
+    /**
+     * XML转成object
+     * 
+     * @param xml
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T xml2obj(String xml, Class<T> classOfT) {
+        try {
+            JAXBContext jaxbContext = JAXBContext.newInstance(classOfT);
+            Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
+            return (T)jaxbUnmarshaller.unmarshal(new StringReader(xml));
+        } catch (JAXBException ex) {
+            log.error(ex);
+            return null;
+        }
+    }
+
+    public static String obj2xml(Object obj) {
+        try {
+            JAXBContext context = JAXBContext.newInstance(obj.getClass());
+            Marshaller marshaller =  context.createMarshaller();
+            StringWriter writer = new StringWriter();
+            marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+            marshaller.marshal(obj, writer);
+            return writer.toString();
+        } catch (JAXBException ex) {
+            log.error(ex);
+            return null;
+        }
+    }
+}

+ 49 - 0
src/main/java/com/wechat/common/utils/view/JSONView.java

@@ -0,0 +1,49 @@
+package com.wechat.common.utils.view;
+
+import java.util.Map;
+
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import org.springframework.web.servlet.view.AbstractView;
+
+/**
+ * 
+ * @author 王科(小)
+ * 
+ */
+public class JSONView extends AbstractView {
+	public JSONView() {
+		setContentType("text/html");
+	}
+
+	@SuppressWarnings({ "rawtypes" })
+	protected void renderMergedOutputModel(Map model,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		response.setContentType("text/html");
+		response.setHeader("Pragma", "No-cache");
+		response.setDateHeader("Expires", 0L);
+		response.setHeader("Cache-Control", "no-cache");
+		response.setCharacterEncoding("UTF-8");
+		JSONArray jsonArray = (JSONArray) model.get("jsonArray");
+		if (jsonArray != null) {
+			jsonArray.write(response.getWriter());
+		} else {
+			JSONObject jsonObject = (JSONObject) model.get("jsonObject");
+			if (jsonObject != null) {
+				if (jsonObject.get("success") != null
+						&& !jsonObject.getBoolean("success"))
+					response.setStatus(417);
+				jsonObject.write(response.getWriter());
+			} else {
+				jsonArray = new JSONArray();
+				jsonArray.write(response.getWriter());
+			}
+		}
+	}
+}

+ 56 - 0
src/main/java/com/wechat/config/ConfigReader.java

@@ -0,0 +1,56 @@
+package com.wechat.config;
+
+import javax.annotation.PostConstruct;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ConfigReader {
+	
+	private static final Log logger = LogFactory
+			.getLog(ConfigReader.class);
+	
+	@PostConstruct
+	private void PrintLog() {
+		logger.info("Configuration Initializing...");
+		logger.info(String.format("%s is %s", "redisUrl", redisUrl));
+		logger.info(String.format("%s is %s", "jdbcUrl", jdbcUrl));
+		logger.info(String.format("%s is %s", "apiURL", apiURL));
+	}
+	
+	//just for log,no setter,getter
+	@Value("#{configProperties['redis.ip']}")
+	private String redisUrl;
+	
+	//just for log,no setter,getter
+	@Value("#{configProperties['jdbc.oracle.url']}")
+	private String jdbcUrl;
+	
+	
+	
+	@Value("#{configProperties['middleAPIURL']}")
+	private String apiURL;
+	
+	@Value("#{configProperties['token.key']}")
+	private String tokenKey;
+	
+	public String getApiURL() {
+		return apiURL;
+	}
+
+	public void setApiURL(String apiURL) {
+		this.apiURL = apiURL;
+	}
+
+	public String getTokenKey() {
+		return tokenKey;
+	}
+
+	public void setTokenKey(String tokenKey) {
+		this.tokenKey = tokenKey;
+	}
+
+}

+ 49 - 0
src/main/java/com/wechat/controller/ActiveNoticeController.java

@@ -0,0 +1,49 @@
+package com.wechat.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.wechat.common.utils.DateUtils;
+import com.wechat.global.base.BaseController;
+import com.wechat.service.ActiveNoticeService;
+
+@Controller
+@RequestMapping(value = "activeNotice")
+public class ActiveNoticeController extends BaseController {
+
+	@Autowired
+	private ActiveNoticeService activeNoticeService;
+
+	/**
+	 * 活动通知
+	 */
+	@RequestMapping(value = "activeNotice", method = RequestMethod.GET)
+	public void activeNotice() {
+      try {
+            log.info("==========活动通知1批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            activeNoticeService.activeNotice9();
+            log.info("==========活动通知1批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========活动通知批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	/**
+	 * 活动通知9
+	 */
+	@RequestMapping(value = "activeNotice2", method = RequestMethod.GET)
+	public void activeNotice2() {
+      try {
+            log.info("==========活动通知2批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            activeNoticeService.activeNotice9();
+            log.info("==========活动通知2批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========活动通知2批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+
+}

+ 29 - 0
src/main/java/com/wechat/controller/CleanUnActivatedUserController.java

@@ -0,0 +1,29 @@
+package com.wechat.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.wechat.common.utils.DateUtils;
+import com.wechat.global.base.BaseController;
+import com.wechat.service.RemindBindMedicalReportService;
+
+public class CleanUnActivatedUserController extends BaseController {
+
+	@Autowired
+	private RemindBindMedicalReportService remindBindMedicalReportService;
+
+	/**
+	 * 企业注册 未激活邮件 五天内(每天凌晨1点执行)
+	 */
+	public void cleanUnActivatedUser() {
+		try {
+			log.info("===============清理  五天内没有激活的企业用户与券过期处理  批处理开始 "+DateUtils.dateToString(DateUtils.PATTEN_HMS)+"==============");
+			remindBindMedicalReportService.cleanUnActivatedUser();
+			log.info("===============清理  五天内没有激活的企业用户与券过期处理  批处理结束 "+DateUtils.dateToString(DateUtils.PATTEN_HMS)+"==============");
+		} catch (Exception e) {
+			log.error("===============清理  五天内没有激活的企业用户与券过期处理  批处理异常 "+DateUtils.dateToString(DateUtils.PATTEN_HMS)+"==============",e);
+			e.printStackTrace();
+		}
+	}
+	
+
+}

+ 41 - 0
src/main/java/com/wechat/controller/CleanUpController.java

@@ -0,0 +1,41 @@
+package com.wechat.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.wechat.common.utils.DateUtils;
+import com.wechat.global.base.BaseController;
+import com.wechat.service.RemindBindMedicalReportService;
+
+/**
+ * 每周一定时处理已邀请的信息
+ * @author Administrator
+ *
+ */
+public class CleanUpController extends BaseController{
+	@Autowired
+    private RemindBindMedicalReportService remindBindMedicalReportService;
+	
+	public void cleanUp() {
+
+        try {
+            log.info("==========清理邀请投递简历 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            remindBindMedicalReportService.cleanUp();
+            log.info("==========清理邀请投递简历 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========清理邀请投递简历 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+    }
+	
+	
+	public void cleanDiscardOrders() {
+        try {
+            log.info("==========清理废弃订单 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            remindBindMedicalReportService.cleanDiscardOrders();
+            log.info("==========清理废弃订单 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========清理废弃订单 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+    }
+}

+ 66 - 0
src/main/java/com/wechat/controller/GoodsController.java

@@ -0,0 +1,66 @@
+package com.wechat.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.wechat.common.utils.DateUtils;
+import com.wechat.global.base.BaseController;
+import com.wechat.service.GoodsService;
+
+@Controller
+@RequestMapping(value = "goods")
+public class GoodsController extends BaseController {
+
+	@Autowired
+	private GoodsService goodsService;
+
+	/**
+	 * 未支付商品订单 
+	 */
+	@RequestMapping(value = "noPayOrders", method = RequestMethod.GET)
+	public void noPayOrders() {
+      try {
+            log.debug("==========未支付商品订单 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            goodsService.noPayGoodsOrders();
+            log.debug("==========未支付商品订单 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========未支付商品订单 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	/**
+	 * 商品上架
+	 */
+	@RequestMapping(value = "upGoods", method = RequestMethod.GET)
+	public void upGoods() {
+      try {
+            log.debug("==========商品上架 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            goodsService.upGoods();
+            log.debug("==========商品上架 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========商品上架 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	
+	/**
+	 * 商品下架
+	 */
+	@RequestMapping(value = "downGoods", method = RequestMethod.GET)
+	public void downGoods() {
+      try {
+            log.debug("==========商品下架 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            goodsService.downGoods();
+            log.debug("==========商品下架 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========商品下架 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+
+}

+ 36 - 0
src/main/java/com/wechat/controller/NoticeEnterpriseController.java

@@ -0,0 +1,36 @@
+package com.wechat.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.wechat.common.utils.DateUtils;
+import com.wechat.global.base.BaseController;
+import com.wechat.service.NoticeEnterpriseService;
+
+@Controller
+@RequestMapping(value = "noticeEnterprise")
+public class NoticeEnterpriseController extends BaseController {
+
+	@Autowired
+	private NoticeEnterpriseService noticeEnterpriseService;
+
+	/**
+	 * 简历投递提醒(每周2,5早上10点执行)
+	 */
+	@RequestMapping(value = "noticeCv", method = RequestMethod.GET)
+	public void noticeCv() {
+      try {
+            log.info("==========简历投递提醒批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            noticeEnterpriseService.noticeCv();
+            log.info("==========简历投递提醒批处理中-等待" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========简历投递提醒批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+
+
+}

+ 75 - 0
src/main/java/com/wechat/controller/PvUvController.java

@@ -0,0 +1,75 @@
+package com.wechat.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.wechat.common.utils.DateUtils;
+import com.wechat.global.base.BaseController;
+import com.wechat.service.AdCtrService;
+import com.wechat.service.PvUvService;
+
+/** 每天定时处理PV UV数据
+ * @author jadyn.wu
+ * @date: 2020-04-22 14:36
+ */
+@Controller
+@RequestMapping(value = "pvUvController")
+public class PvUvController extends BaseController{
+	@Autowired
+    private PvUvService dateService;
+	
+	@Autowired
+    private AdCtrService adCtrService;
+	
+	@RequestMapping(value = "writeYtdPosData", method = RequestMethod.GET)
+	public void writeYtdPosData() {
+        try {
+            log.debug("==========职位详情Pv Uv 昨日数据记录 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            dateService.writeYtdPosData();
+            log.info("==========职位详情Pv Uv 昨日数据记录 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========职位详情Pv Uv数据记录 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+    }
+	
+	@RequestMapping(value = "write2dAgoPosData", method = RequestMethod.GET)
+	public void write2dAgoPosData() {
+        try {
+            log.debug("==========职位详情Pv Uv数据记录 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            dateService.write2dAgoPosData();
+            log.info("==========职位详情Pv Uv 2天前数据记录 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========职位详情Pv Uv数据记录 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+    }
+	
+	
+	@RequestMapping(value = "writeYtdAdCtrData", method = RequestMethod.GET)
+	public void writeYtdAdCtrData() {
+        try {
+            log.debug("==========广告点击  昨日数据记录 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            adCtrService.writeYtdAdCtrData();
+            log.info("==========广告点击 昨日数据记录 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========广告点击  昨日数据记录 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+    }
+	
+	@RequestMapping(value = "write2dAgoAdCtrData", method = RequestMethod.GET)
+	public void write2dAgoAdCtrData() {
+        try {
+            log.debug("==========广告点击 2天前数据记录 批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            adCtrService.write2dAgoAdCtrData();
+            log.info("==========广告点击 2天前数据记录 批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========广告点击 2天前数据记录 批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+    }
+
+}

+ 25 - 0
src/main/java/com/wechat/controller/RemindBindMedicalReportController.java

@@ -0,0 +1,25 @@
+package com.wechat.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.wechat.common.utils.DateUtils;
+import com.wechat.global.base.BaseController;
+import com.wechat.service.RemindBindMedicalReportService;
+
+public class RemindBindMedicalReportController extends BaseController {
+
+    @Autowired
+    private RemindBindMedicalReportService remindBindMedicalReportService;
+
+    public void remindUserBindMedicalReport() {
+
+        try {
+            log.info("==========批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            remindBindMedicalReportService.check();
+            log.info("==========批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+    }
+}

+ 148 - 0
src/main/java/com/wechat/controller/SendSmsToUserController.java

@@ -0,0 +1,148 @@
+package com.wechat.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import com.wechat.common.utils.DateUtils;
+import com.wechat.global.base.BaseController;
+import com.wechat.service.AddFriendService;
+import com.wechat.service.NoticePersonalService;
+import com.wechat.service.RemindBindMedicalReportService;
+
+@Controller
+@RequestMapping(value = "sendsms")
+public class SendSmsToUserController extends BaseController {
+
+	@Autowired
+	private RemindBindMedicalReportService remindBindMedicalReportService;
+
+	@Autowired
+	private AddFriendService addFriendService;
+	
+	@Autowired
+	private NoticePersonalService noticePersonalService;
+
+	/**
+	 * 会员到期提醒(每天下午5点执行)
+	 */
+	public void remindExpirationUser() {
+      try {
+            log.info("==========会员到期提醒批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            remindBindMedicalReportService.remindExpirationUser();
+            log.info("==========会员到期提醒批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========会员到期提醒批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	/**
+	 * 未填写履历用户提醒(每周三下午5点执行)
+	 */
+	public void remindWorkExperience() {
+      try {
+            log.info("==========未填写履历用户提醒批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            remindBindMedicalReportService.remindWorkExperienceUsrs();
+            log.info("==========未填写履历用户提醒批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========未填写履历用户提醒批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	
+	/**
+	 * 活动通知
+	 */
+	public void activeNotice() {
+      try {
+            log.info("==========活动通知批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            remindBindMedicalReportService.activeNotice();
+            log.info("==========活动通知批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========活动通知批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	
+	/**
+	 * 加好友提醒-微信
+	 */
+	@RequestMapping(value = "addFriendsNoticeWx", method = RequestMethod.GET)
+	public void addFriendsNoticeWx() {
+      try {
+            log.info("==========加好友提醒批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            addFriendService.getToBeConfirmedAddRemindWx();
+            log.info("==========加好友提醒批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========加好友提醒批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	
+	/**
+	 * 加好友提醒-短信
+	 */
+	@RequestMapping(value = "addFriendsNoticeMsg", method = RequestMethod.GET)
+	public void addFriendsNoticeMsg() {
+      try {
+            log.info("==========加好友提醒批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            addFriendService.getToBeConfirmedAddRemindMsg();
+            log.info("==========加好友提醒批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========加好友提醒批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	
+	/**
+	 * 添加好友成功提醒通知-微信
+	 */
+	@RequestMapping(value = "getConfirmedRemindWx", method = RequestMethod.GET)
+	public void getConfirmedRemindWx() {
+      try {
+            log.info("==========加好友成功提醒批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            addFriendService.getConfirmedRemindWx();
+            log.info("==========加好友成功提醒批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========加好友成功提醒批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	/**
+	 * 添加好友成功提醒通知-短信
+	 */
+	@RequestMapping(value = "getConfirmedRemindMsg", method = RequestMethod.GET)
+	public void getConfirmedRemindMsg() {
+      try {
+            log.info("==========加好友成功提醒批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            addFriendService.getConfirmedRemindMsg();
+            log.info("==========加好友成功提醒批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========加好友成功提醒批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+	
+	/**
+	 * 职位订阅通知
+	 */
+	@RequestMapping(value = "sendSubedPositionMsg", method = RequestMethod.GET)
+	public void sendSubedPositionMsg() {
+      try {
+            log.info("==========职位订阅通知提醒批处理开始" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+            noticePersonalService.noticeNewJob();
+            log.info("==========职位订阅通知提醒批处理结束" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========");
+        } catch (Exception e) {
+            log.error("==========职位订阅通知提醒批处理异常" + DateUtils.dateToString(DateUtils.PATTEN_HMS) + "==========",e);
+            e.printStackTrace();
+        }
+	}
+
+}

+ 37 - 0
src/main/java/com/wechat/dao/AccessTokenRedisDao.java

@@ -0,0 +1,37 @@
+package com.wechat.dao;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.RedisGeneratorDao;
+import com.wechat.model.dto.AccessTokenDto;
+
+/**
+ * This is test for Git Stash
+ * @author Administrator
+ *
+ */
+@Repository
+public class AccessTokenRedisDao extends RedisGeneratorDao<String, AccessTokenDto>  {
+
+    private String tableKey = "accessTokenRedis";
+
+    public AccessTokenDto selectAccessToken(String infoKey) {
+        return selectOne(tableKey, infoKey);
+    }
+
+    public void updateAccessToken(String infoKey, AccessTokenDto infoValue) {
+        update(tableKey, infoKey, infoValue);
+
+    }
+
+    public void insertAccessToken(String infoKey, AccessTokenDto infoValue) {
+        insert(tableKey, infoKey, infoValue);
+
+    }
+
+    public void deleteAccessToken(String infoKey) {
+        delete(tableKey, infoKey);
+
+    }
+
+}

+ 24 - 0
src/main/java/com/wechat/dao/AdCtrDao.java

@@ -0,0 +1,24 @@
+package com.wechat.dao;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+import com.wechat.model.dbEntity.MdeAdCtrDtl;
+
+
+/**
+ * @author jadyn.wu
+ * @date: 2020-04-22 16:00
+ */
+@Repository
+public class AdCtrDao extends BaseDao {
+
+	public int insert(MdeAdCtrDtl date) {
+		return super.insert("MdeAdCtrDtlMapper.saveList", date);
+	}
+	
+	public int checkDatas(String dateStr) {
+		return super.selectOne("MdeAdCtrDtlMapper.checkDatas", dateStr);
+	}
+	
+}

+ 144 - 0
src/main/java/com/wechat/dao/AdCtrRedisDao.java

@@ -0,0 +1,144 @@
+package com.wechat.dao;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Repository;
+
+import com.wechat.common.Constants;
+import com.wechat.common.utils.DateUtils;
+import com.wechat.common.utils.StringsUtils;
+
+
+
+/**
+ * @author jadyn.wu
+ * @date: 2020-04-21 18:08
+ */
+@Repository
+public class AdCtrRedisDao {
+	// log 处理
+	protected static final Log log = LogFactory.getLog(AdCtrRedisDao.class);
+	
+	//PV/UV记录失效时间(一周 7天 )
+	@Value("#{configProperties['pvuv.expired.days']}")
+	private Integer expiredDays;
+	
+	@Autowired
+	protected RedisTemplate<String, Integer> redisTemplate;
+
+    
+    //广告展现量
+    public void insertAdShow(String id, int num) {
+    	//按日期统计
+        insertAdCtr(Constants.REDIS_AD_SHOW,id,num);
+    }
+    
+    //广告点击量
+    public void insertAdClick(String id, int num) {
+    	//按日期统计
+        insertAdCtr(Constants.REDIS_AD_CLICK,id,num);
+    }
+    
+    
+    private void insertAdCtr(String baseKey, String id, int num) {
+    	if(num>0) {
+    		//按日期统计
+            String adKey = baseKey + DateUtils.getLocalDateNowStr(DateUtils.PATTEN_YMD)+Constants.UNDER_LINE;
+        	if(!StringsUtils.isEmpty(id))
+        	{
+        		String key = adKey+id;
+            	if(hasKey(key))
+            	{
+            		insert(key, select(key)+num);
+            		//log.info("**********广告数量************"+key+"::"+select(key));
+            	} else {
+            		insertDay(key, num, expiredDays);
+            	}
+        	}
+    	}
+    }
+    
+    
+    //根据广告id获取展现量
+    public int getAdShowById(Integer id, String DateStr) {
+    	int showNum = getAdNumById(Constants.REDIS_AD_SHOW,id,DateStr);
+    	return showNum;
+    }
+    
+    //根据广告id获取点击量
+    public int getAdClickById(Integer id, String DateStr) {
+    	int clickNum = getAdNumById(Constants.REDIS_AD_CLICK,id,DateStr);
+    	return clickNum;
+    }
+    
+  //根据广告id获取展现量 、点击量
+    private int getAdNumById(String baseKey, Integer id, String DateStr) {
+    	int num = 0;
+    	//按日期统计
+    	String adKey = baseKey + DateStr +Constants.UNDER_LINE;
+    	if(null != id &&  id != 0)
+    	{
+    		String key = adKey + id.toString();
+        	if(hasKey(key))
+        	{
+        		Integer pv = select(key);
+        		num = pv != null ? pv.intValue() : 0;
+        	} 
+    	}
+    	return num;
+    }
+
+	public Integer select(String infoKey) {
+		return redisTemplate.opsForValue().get(infoKey);
+	}
+
+	private void insert(String infoKey, Integer infoValue) {
+		redisTemplate.opsForValue().set(infoKey, infoValue);
+	}
+
+	/**
+	 * 保存并设置过期时间
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry    过期时长
+	 * @param unit      单位
+	 */
+	private void insertAndExptime(String infoKey, Integer infoValue, int expiryNum, TimeUnit unit) {
+		redisTemplate.opsForValue().set(infoKey, infoValue);
+		// 设置失效时间
+		redisTemplate.expire(infoKey, expiryNum, unit);
+	}
+	
+	/**
+	 * 
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry 过期时长 单位:天
+	 */
+	private void insertDay(String infoKey, Integer infoValue, int expired) {
+		// 设置失效时间
+		insertAndExptime(infoKey, infoValue, expired, TimeUnit.DAYS);
+	}
+	
+
+
+	public void delete(String infoKey) {
+		redisTemplate.delete(infoKey);
+	}
+	
+   public Boolean hasKey(String infoKey) {
+       return redisTemplate.hasKey(infoKey);
+    }
+   
+   //模糊查询相关key
+   public Set<String> getKeys(String baseKey) {
+       return redisTemplate.keys(baseKey+ "*");
+   }
+
+}

+ 78 - 0
src/main/java/com/wechat/dao/FriendRelationDao.java

@@ -0,0 +1,78 @@
+package com.wechat.dao;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+import com.wechat.model.dto.AskUserInfoDto;
+import com.wechat.model.dto.AskUsersDto;
+import com.wechat.model.dto.ConfirmedUsersInfoDto;
+import com.wechat.model.dto.ToBeConfirmedUsersDto;
+import com.wechat.model.dto.UserSimple;
+
+/**
+ * 单表生成DAO接口
+ * 
+ * @author tangwc
+ * @version 2018-06-08
+ */
+@Repository
+public class FriendRelationDao extends BaseDao {
+
+	/**
+	 * 获取待确认用户列表
+	 * 
+	 */
+	public List<ToBeConfirmedUsersDto> getToBeConfirmedUsers(Date dateFrom, Date dateTo) {
+		Map<String,Date> map = new HashMap<String,Date>();
+		map.put("dateFrom", dateFrom);
+		map.put("dateTo", dateTo);
+		return super.select("MdeFriendRelationMapper.getToBeConfirmedUsers",map);
+	}
+	
+	/**
+	 * 获取发起人信息
+	 * 
+	 */
+	public List<AskUserInfoDto> getAskUserInfo(Date dateFrom, Date dateTo, String toBeConfirmed) {
+		Map<String,Object> map = new HashMap<String,Object>();
+		map.put("dateFrom", dateFrom);
+		map.put("dateTo", dateTo);
+		map.put("toBeConfirmed", toBeConfirmed);
+		return super.select("MdeFriendRelationMapper.getAskUserInfo",map);
+	}
+	
+	
+	/**
+	 * 获取已确认好友的通知对象用户列表
+	 * 
+	 */
+	public List<AskUsersDto> getAskUsers(Date dateFrom, Date dateTo) {
+		Map<String,Date> map = new HashMap<String,Date>();
+		map.put("dateFrom", dateFrom);
+		map.put("dateTo", dateTo);
+		return super.select("MdeFriendRelationMapper.getAskUsers",map);
+	}
+	
+	/**
+	 * 获取确认人信息
+	 * 
+	 */
+	public List<ConfirmedUsersInfoDto> getConfirmedUsersInfo(Date dateFrom, Date dateTo, String askUser, List<UserSimple> redisList) {
+		Map<String,Object> map = new HashMap<String,Object>();
+		map.put("dateFrom", dateFrom);
+		map.put("dateTo", dateTo);
+		map.put("askUser", askUser);
+		
+		//封装待确认的同意请求
+		map.put("redisList", redisList);
+		
+		return super.select("MdeFriendRelationMapper.getConfirmedUsersInfo",map);
+	}
+}

+ 93 - 0
src/main/java/com/wechat/dao/JobPvRedisDao.java

@@ -0,0 +1,93 @@
+package com.wechat.dao;
+
+import java.util.Date;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Repository;
+
+import com.wechat.common.Constants;
+import com.wechat.common.utils.DateUtils;
+import com.wechat.common.utils.StringsUtils;
+
+/**
+ * @author jadyn.wu
+ * @date: 2020-04-21 18:08
+ */
+@Repository
+public class JobPvRedisDao {
+	//PV/UV记录失效时间(一周 7天 )
+	@Value("#{configProperties['pvuv.expired.days']}")
+	private Integer expiredDays;
+	
+	@Autowired
+	protected RedisTemplate<String, Integer> redisTemplate;
+
+	//按日期统计
+    private String pvKey = DateUtils.getLocalDateNowStr(DateUtils.PATTEN_YMD)+Constants.UNDER_LINE;
+    
+    //职位详情pv统计
+    public void insertJobDtlPv(String id) {
+    	if(!StringsUtils.isEmpty(id))
+    	{
+    		String key = Constants.REDIS_JOB_PV + pvKey+id;
+        	if(hasKey(key))
+        	{
+        		insert(key, select(key)+1);
+        	} else {
+        		insertDay(key, 1 ,expiredDays);
+        	}
+    	}
+    }
+    
+
+	public Integer select(String infoKey) {
+		return redisTemplate.opsForValue().get(infoKey);
+	}
+
+	private void insert(String infoKey, Integer infoValue) {
+		redisTemplate.opsForValue().set(infoKey, infoValue);
+	}
+
+	/**
+	 * 保存并设置过期时间
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry    过期时长
+	 * @param unit      单位
+	 */
+	private void insertAndExptime(String infoKey, Integer infoValue, int expiryNum, TimeUnit unit) {
+		redisTemplate.opsForValue().set(infoKey, infoValue);
+		// 设置失效时间
+		redisTemplate.expire(infoKey, expiryNum, unit);
+	}
+	
+	/**
+	 * 
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry 过期时长 单位:天
+	 */
+	private void insertDay(String infoKey, Integer infoValue, int expired) {
+		// 设置失效时间
+		insertAndExptime(infoKey, infoValue, expired, TimeUnit.DAYS);
+	}
+	
+
+
+	public void delete(String infoKey) {
+		redisTemplate.delete(infoKey);
+	}
+	
+   public Boolean hasKey(String infoKey) {
+       return redisTemplate.hasKey(infoKey);
+    }
+
+   //模糊查询相关key
+   public Set<String> getKeys(String baseKey) {
+       return redisTemplate.keys(baseKey+ "*");
+   }
+}

+ 24 - 0
src/main/java/com/wechat/dao/JobUvPvDao.java

@@ -0,0 +1,24 @@
+package com.wechat.dao;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+import com.wechat.model.dbEntity.MdeJobPvUv;
+
+
+/**
+ * @author jadyn.wu
+ * @date: 2020-04-22 16:00
+ */
+@Repository
+public class JobUvPvDao extends BaseDao {
+
+	public int insert(MdeJobPvUv date) {
+		return super.insert("MdeJobUvPvMapper.saveList", date);
+	}
+	
+	public int checkDatas(String dateStr) {
+		return super.selectOne("MdeJobUvPvMapper.checkDatas", dateStr);
+	}
+	
+}

+ 36 - 0
src/main/java/com/wechat/dao/JsapiTicketRedisDao.java

@@ -0,0 +1,36 @@
+package com.wechat.dao;
+
+import org.springframework.stereotype.Repository;
+import com.wechat.global.base.dao.RedisGeneratorDao;
+import com.wechat.model.dto.JsapiTicketDto;
+
+/**
+ * This is test for Git Stash
+ * @author Administrator
+ *
+ */
+@Repository
+public class JsapiTicketRedisDao extends RedisGeneratorDao<String, JsapiTicketDto> {
+
+    private String tableKey = "jsapiTicketRedis";
+
+    public JsapiTicketDto selectJsapiTicket(String infoKey) {
+        return selectOne(tableKey, infoKey);
+    }
+
+    public void updateJsapiTicket(String infoKey, JsapiTicketDto infoValue) {
+        update(tableKey, infoKey, infoValue);
+
+    }
+
+    public void insertJsapiTicket(String infoKey, JsapiTicketDto infoValue) {
+        insert(tableKey, infoKey, infoValue);
+
+    }
+
+    public void deleteJsapiTicket(String infoKey) {
+        delete(tableKey, infoKey);
+
+    }
+
+}

+ 33 - 0
src/main/java/com/wechat/dao/MakeSureFriendshipRedisDao.java

@@ -0,0 +1,33 @@
+package com.wechat.dao;
+
+import java.util.ArrayList;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.RedisGeneratorDao;
+import com.wechat.model.dto.UserSimple;
+/**
+ * 好友同意邀请 redis暂存类
+ * @author Administrator
+ *
+ */
+@Repository
+public class MakeSureFriendshipRedisDao extends RedisGeneratorDao<String, ArrayList<UserSimple>>{
+	private String tableKey = "makeSureFriendship";
+
+    public ArrayList<UserSimple> select(String infoKey) {
+        return selectOne(tableKey, infoKey);
+    }
+
+    public void update(String infoKey, ArrayList<UserSimple> infoValue) {
+        update(tableKey, infoKey, infoValue);
+    }
+
+    public void insert(String infoKey, ArrayList<UserSimple> infoValue) {
+        insert(tableKey, infoKey, infoValue);
+    }
+
+    public void delete(String infoKey) {
+        delete(tableKey, infoKey);
+    }
+}

+ 34 - 0
src/main/java/com/wechat/dao/MdeAdImagesMapper.java

@@ -0,0 +1,34 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.dao;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+
+/**
+ * 单表生成DAO接口
+ * @author tangwc
+ * @version 2018-06-05
+ */
+@Repository
+public class MdeAdImagesMapper extends BaseDao {
+	
+	/**
+	 * 启用广告
+	 * @param openId
+	 * @return
+	 */
+	public int startAd() {
+		return sqlSession.update("MdeAdImagesMapper.startAd");
+	}
+	/**
+	 * 停用广告
+	 * @param openId
+	 * @return
+	 */
+	public int stopAd() {
+		return sqlSession.update("MdeAdImagesMapper.stopAd");
+	}
+}

+ 43 - 0
src/main/java/com/wechat/dao/MdeGoodsDao.java

@@ -0,0 +1,43 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.dao;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+
+
+/**
+ * 单表生成DAO接口
+ * @author jadyn.wu
+ * @version 2019-09-15
+ */
+@Repository
+public class MdeGoodsDao extends BaseDao {
+	
+	/**
+	 *  上架商品
+	 * @return 
+	 * 
+	 * @return
+	 */
+	public Integer upGoods() {
+        return super.update("MdeGoodsMapper.upGoods");
+    }
+	
+	/**
+	 *  下架商品
+	 * @return 
+	 * 
+	 * @return
+	 */
+	public Integer downGoods() {
+        return super.update("MdeGoodsMapper.downGoods");
+    }
+}

+ 25 - 0
src/main/java/com/wechat/dao/MdeInformationMapper.java

@@ -0,0 +1,25 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.dao;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+
+/**
+ * 单表生成DAO接口
+ * @author tangwc
+ * @version 2018-05-23
+ */
+@Repository
+public class MdeInformationMapper extends BaseDao {
+	
+	public void startInformation() {
+		sqlSession.update("MdeInformationMapper.startInformation");
+    }
+	public void stopInformation() {
+		sqlSession.update("MdeInformationMapper.stopInformation");
+	}
+	
+}

+ 40 - 0
src/main/java/com/wechat/dao/MdeJobAdvertisedDao.java

@@ -0,0 +1,40 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.dao;
+
+import java.util.List;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+import com.wechat.model.dto.AdvertisedAtTimeDto;
+import com.wechat.model.dto.DateFromToDto;
+import com.wechat.model.dto.SubedPositionInfoDto;
+import com.wechat.model.dto.UserSubedInfoDto;
+
+
+/**
+ * @author jadyn.wu
+ * @date: 2020-03-26 15:16
+ */
+@Repository
+public class MdeJobAdvertisedDao extends BaseDao {
+
+	/**
+	 * 获取指定时间内的职位投递信息
+	 * @return
+	 */
+	public List<AdvertisedAtTimeDto> getAdvertisedAtTime(DateFromToDto dto) {
+		return 	super.select("MdeJobAdvertisedMapper.getAdvertisedAtTime", dto);
+	}
+
+	/**
+	 * 获取指定时间内的符合条件的职位信息
+	 * @return
+	 */
+	public List<SubedPositionInfoDto> getSubedPositionInfos(UserSubedInfoDto params) {
+		return 	super.select("MdeJobAdvertisedMapper.getSubedPositionInfos", params);
+	}
+	
+}

+ 27 - 0
src/main/java/com/wechat/dao/MdeJobInvitationRelMapper.java

@@ -0,0 +1,27 @@
+package com.wechat.dao;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+
+/**
+ * 单表生成DAO接口
+ * 
+ * @author tangwc
+ * @version 2018-07-27
+ */
+
+@Repository
+public class MdeJobInvitationRelMapper extends BaseDao {
+
+	/**
+	 * 删除 一个月之前的数据
+	 * @param cleanedTotelInvitationDays 
+	 * 
+	 * @param params
+	 * @return
+	 */
+	public int deleteInvitation(int days) {
+		return sqlSession.delete("MdeJobInvitationRelMapper.deleteInvitation",days);
+	}
+}

+ 69 - 0
src/main/java/com/wechat/dao/MdeOrdersMapper.java

@@ -0,0 +1,69 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.dao;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+import com.wechat.model.dbEntity.MdeOrders;
+
+/**
+ * 单表生成DAO接口
+ * 
+ * @author tangwc
+ * @version 2018-06-08
+ */
+@Repository
+public class MdeOrdersMapper extends BaseDao {
+
+	/**
+	 * 取消订单
+	 * @param noPayOrderBeyondPeriod 
+	 * @return
+	 */
+	public int noPayOrders(String noPayOrderBeyondPeriod) {
+		return sqlSession.update("MdeOrdersMapper.noPayOrders",noPayOrderBeyondPeriod);
+	}
+	
+	/**
+	 * 取消过期商品订单
+	 * @param minute 
+	 * @return
+	 */
+	public int noPayGoodsOrders(String orderId) {
+		Map<String, Object> map = new HashMap<String, Object>();
+		map.put("orderId", orderId);
+		return super.update("MdeOrdersMapper.noPayGoodsOrders",map);
+	}
+	
+	/**
+	 * 获取过期商品订单
+	 * @param minute 
+	 * @return
+	 */
+	public List<MdeOrders> getNoPayGoodsOrders(String minute) {
+		return super.select("MdeOrdersMapper.getNoPayGoodsOrders",minute);
+	}
+	
+	/**
+	 * 处理 已完成订单
+	 * @return
+	 */
+	public int finishedOrders() {
+		return super.update("MdeOrdersMapper.finishedOrders");
+	}
+	
+	/**
+	 * 清理废弃订单
+	 * @param cleanDiscardOrder 
+	 * @return
+	 */
+	public int cleanDiscardOrders(int day) {
+		return sqlSession.update("MdeOrdersMapper.cleanDiscardOrders",day);
+	}
+}

+ 165 - 0
src/main/java/com/wechat/dao/MdeUserMapper.java

@@ -0,0 +1,165 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.dao;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+import com.wechat.model.dbEntity.MdeUser;
+import com.wechat.model.dto.UserSubedInfoDto;
+
+/**
+ * 单表生成DAO接口
+ * 
+ * @author tangwc
+ * @version 2018-05-23
+ */
+@Repository
+public class MdeUserMapper extends BaseDao {
+
+	/**
+	 * 取消会员
+	 * @return
+	 */
+	public int abolishUserVip() {
+		return sqlSession.update("MdeUserMapper.abolishUserVip");
+	}
+	public List<MdeUser> remindExpirationUserVip(String vip_remind_days) {
+		return sqlSession.selectList("MdeUserMapper.remindExpirationUserVip",vip_remind_days);
+	}
+
+	/**
+	 * 删除五天内没有激活的用户
+	 * @return
+	 */
+	public int deleteUnActivatedUser(Map<String,Object> maps) {
+		return sqlSession.delete("MdeUserMapper.deleteUnActivatedUser",maps);
+	}
+	/**
+	 * 清理未激活的企业用户
+	 * @param day 
+	 */
+	public int cleanUnActivatedUser(String day) {
+		return sqlSession.delete("MdeUserMapper.cleanUnActivatedUser",day);
+	}
+	
+	/**
+	 * 指定区间内未填写工作经验的用户
+	 * @param day 
+	 */
+	public List<MdeUser> unfilledWorkExperienceUsrs(String daysFrom,String daysTo) {
+		Map<String,String> map = new HashMap<String,String>();
+		map.put("daysFrom", daysFrom);
+		map.put("daysTo", daysTo);
+		return super.select("MdeUserMapper.unfilledWorkExperienceUsrs",map);
+	}
+	
+	/**
+	 * 获取所有个人用户信息
+	 * @param day 
+	 */
+	public List<MdeUser> getAllPersonalUsrs() {
+		return super.select("MdeUserMapper.getAllPersonalUsrs");
+	}
+	
+	/**
+	 * 获取所有未绑定微信个人用户
+	 * @param day 
+	 */
+	public List<MdeUser> getAllPersonalUsrsNobinding() {
+		return super.select("MdeUserMapper.getAllPersonalUsrsNobinding");
+	}
+	
+	/**
+	 * 获取所有已绑定微信个人用户
+	 * @param day 
+	 */
+	public List<MdeUser> getAllPersonalUsrsBinding() {
+		return super.select("MdeUserMapper.getAllPersonalUsrsBinding");
+	}
+	
+	/**
+	 * 获取所有未绑定微信个人用户 去除未写履历的 
+	 * @param day 
+	 */
+	public List<MdeUser> getAllPersonalUsrsNobindingWithCv() {
+		return super.select("MdeUserMapper.getAllPersonalUsrsNobindingWithCv");
+	}
+	
+	/**
+	 * 获取4级以上用户信息
+	 * @param day 
+	 */
+	public List<MdeUser> getUnQualityPersonalUsrs() {
+		return super.select("MdeUserMapper.getUnQualityPersonalUsrs");
+	}
+	
+	
+	/**
+	 * 获取2-6级用户信息
+	 * @param day 
+	 */
+	public List<MdeUser> get2To6PersonalUsrs() {
+		return super.select("MdeUserMapper.get2To6PersonalUsrs");
+	}
+	
+	/**
+	 * 获取3级以下用户信息
+	 * @param day 
+	 */
+	public List<MdeUser> getFrom3PersonalUsrs() {
+		return super.select("MdeUserMapper.getFrom3PersonalUsrs");
+	}
+	
+	
+	/**
+	 * 获取指定级别区间用户信息
+	 * @param day 
+	 */
+	public List<MdeUser> getFromXPersonalUsrs(String posGradeF,String posGradeT) {
+		Map<String,String> map = new HashMap<String,String>();
+		map.put("posGradeF", posGradeF);
+		map.put("posGradeT", posGradeT);
+		return super.select("MdeUserMapper.getFromXPersonalUsrs",map);
+	}
+	
+	/**
+	 * 获取所有离职用户
+	 * @param day 
+	 */
+	public List<MdeUser> getOutgoingUsrs() {
+		return super.select("MdeUserMapper.getOutgoingUsrs");
+	}
+	
+	/**
+	 * 获取所有订阅的个人用户信息
+	 * @param day 
+	 */
+	public List<UserSubedInfoDto> getSubedJobPersonalUsers() {
+		return super.select("MdeUserMapper.getSubedJobPersonalUsers");
+	}
+	
+	/**
+	 * 获取所有用户(除0以外的)
+	 * 工作状态[0-无跳槽打算;1-在职-考虑换个环境;2-在职-有好的工作可考虑;3-离职]
+	 * @param day 
+	 */
+	public List<MdeUser> getUsrsExceptNotConsider() {
+		return super.select("MdeUserMapper.getUsrsExceptNotConsider");
+	}
+	
+	/**
+	 * 获取指定职位用户(除0以外的)
+	 * 工作状态[0-无跳槽打算;1-在职-考虑换个环境;2-在职-有好的工作可考虑;3-离职]
+	 * @param day 
+	 */
+	public List<MdeUser> getUsrsByPostion() {
+		return super.select("MdeUserMapper.getUsrsByPostion");
+	}
+	
+}

+ 44 - 0
src/main/java/com/wechat/dao/RedisGoodsSaleDao.java

@@ -0,0 +1,44 @@
+package com.wechat.dao;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+import com.wechat.common.Constants;
+import com.wechat.global.base.dao.RedisWithExpiryTimeDao;
+
+/**
+ * This is test for Git Stash
+ * 
+ * @author Administrator
+ *
+ */
+@Repository
+public class RedisGoodsSaleDao{
+
+	@Autowired
+	RedisWithExpiryTimeDao baseRedisDao;
+	
+	public String selectSaleNum(int goodsId) {
+		return baseRedisDao.select(Constants.REDIS_GOODS_SALE+String.valueOf(goodsId));
+	}
+
+	/**
+	 * 存入缓存,30天后失效
+	 * @param goodsId
+	 * @param infoValue
+	 */
+	public void insertSaleNum(int goodsId, int infoValue) {
+		baseRedisDao.insertDay(Constants.REDIS_GOODS_SALE+String.valueOf(goodsId), String.valueOf(infoValue), 30);
+	}
+
+
+
+	public void deleteSaleNum(int goodsId) {
+		baseRedisDao.delete(Constants.REDIS_GOODS_SALE+String.valueOf(goodsId));
+	}
+	
+   public Boolean hasSaleNum(int goodsId) {
+       return baseRedisDao.hasKey(Constants.REDIS_GOODS_SALE+String.valueOf(goodsId));
+    }
+
+}

+ 21 - 0
src/main/java/com/wechat/dao/TicketDetailMapper.java

@@ -0,0 +1,21 @@
+package com.wechat.dao;
+
+import org.springframework.stereotype.Repository;
+
+import com.wechat.global.base.dao.impl.BaseDao;
+
+/**
+ * 
+ * @author tangwc
+ *
+ */
+@Repository
+public class TicketDetailMapper extends BaseDao {
+	public void setOverDue() {
+		sqlSession.update("MdeTicketDetailMapper.setOverDue");
+	}
+
+	public void cleanOverDueTicket(String day) {
+		sqlSession.delete("MdeTicketDetailMapper.cleanOverDueTicket",day);
+	}
+}

+ 55 - 0
src/main/java/com/wechat/global/GlobalExceptionHandler.java

@@ -0,0 +1,55 @@
+package com.wechat.global;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+import com.alibaba.fastjson.JSON;
+import com.wechat.common.Constants;
+import com.wechat.common.utils.MvcUtil;
+import com.wechat.global.message.InfoMsg;
+import com.wechat.model.responseDto.JsonResp;
+import com.wechat.service.TemplateMsgService;
+
+/**
+ * handle the global runtime exception which did not handled in the code
+ * 
+ * @author xueh
+ */
+@ControllerAdvice
+public class GlobalExceptionHandler {
+    private static final Log logger = LogFactory.getLog(GlobalExceptionHandler.class);
+    
+/*	 @Autowired
+	 private TemplateMsgService templateMsgService;*/
+
+    @ExceptionHandler(Exception.class)
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    public void handleException(Exception ex, HttpServletRequest request, HttpServletResponse response) {
+        logger.error(ex.getMessage());
+        JsonResp<String> resp = new JsonResp<String>(Constants.RESULT_ERROR, InfoMsg.ERROR_SYSTEM_ERROR);
+        String json = JSON.toJSONString(resp, true);
+        try {
+            MvcUtil.writeJson(request, response, json);
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+        	logger.error(e);
+        }
+    }
+    
+/*    @ExceptionHandler(SysBatchException.class)
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    public void handleSysBatchException(SysBatchException ex, HttpServletRequest request, HttpServletResponse response) {
+        logger.error(ex.getMessage(),ex);
+        templateMsgService.sendSysTmpMsg(ex.getMessage(),ex);
+    }*/
+}

+ 156 - 0
src/main/java/com/wechat/global/GlobalLogAspect.java

@@ -0,0 +1,156 @@
+package com.wechat.global;
+
+import java.lang.reflect.Field;
+import java.util.Date;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+import com.wechat.common.CommonHelper;
+
+/**
+ * log each method for input and output
+ * 
+ * @author xueh
+ */
+@Component
+public class GlobalLogAspect {
+
+    /**
+     * Log
+     */
+    private static final Log logger = LogFactory.getLog(GlobalLogAspect.class);
+
+    /**
+     * CommonHelper
+     */
+    @Autowired
+    private CommonHelper     commonHelper;
+
+    @Pointcut("execution(* com.wechat.controller..*.*(..))" + " || execution(* com.wechat.gateway..*.*(..))"
+            + " || execution(* com.wechat.service..*.*(..))" + " || execution(* com.wechat.dao..*.*(..))")
+    public void globalLog() {
+
+    }
+
+    /**
+     * executed after return log each method for input and output
+     * 
+     * @param joinPoint JoinPoint
+     * @param returnValue Object
+     */
+    @AfterReturning(pointcut = "globalLog()", returning = "returnValue")
+    public void doAfterReturning(JoinPoint joinPoint, Object returnValue) {
+        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder
+                .getRequestAttributes()).getRequest();
+//        HttpServletRequest request = WebContext.getInstance().getRequest();
+        try {
+            logger.info("请求IP:" + commonHelper.getIRealIPAddr(request));
+
+            logger.info("请求时间:" + new Date());
+            logger.info("请求方法:"
+                    + (joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName() + "()"));
+
+            StringBuilder param = new StringBuilder();
+            if (joinPoint.getArgs() != null && joinPoint.getArgs().length > 0) {
+                for (int i = 0; i < joinPoint.getArgs().length; i++) {
+                    Object pObject = joinPoint.getArgs()[i];
+                    param.append(getFieldsValues(pObject));
+                }
+            }
+            logger.info("请求参数:" + param);
+            logger.info("返回值为:" + getFieldsValues(returnValue));
+        }
+        catch (Exception e) {
+            logger.error(e.getMessage());
+        }
+    }
+
+    /**
+     * only executed when exception
+     * 
+     * @param joinPoint JoinPoint
+     * @param e Exception
+     */
+    @AfterThrowing(pointcut = "globalLog()", throwing = "e")
+    public void afterThrowing(JoinPoint joinPoint, Exception e) {
+        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder
+                .getRequestAttributes()).getRequest();
+        try {
+            logger.info("请求IP:" + commonHelper.getIRealIPAddr(request));
+
+            logger.info("请求时间:" + new Date());
+            logger.info("请求方法:"
+                    + (joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName() + "()"));
+
+            StringBuilder param = new StringBuilder();
+            if (joinPoint.getArgs() != null && joinPoint.getArgs().length > 0) {
+                for (int i = 0; i < joinPoint.getArgs().length; i++) {
+                    Object pObject = joinPoint.getArgs()[i];
+                    param.append(getFieldsValues(pObject));
+                }
+            }
+            logger.info("请求参数:" + param);
+            if (e != null) {
+                logger.info("出现异常:" + e.getMessage());
+            }
+        }
+        catch (Exception ex) {
+            logger.error(e.getMessage());
+        }
+    }
+
+    /**
+     * get the value of each fields of the object
+     * 
+     * @param pObject Object
+     * @return String
+     * @throws Exception Exception
+     */
+    private String getFieldsValues(Object pObject) throws Exception {
+        StringBuilder param = new StringBuilder();
+        if (pObject != null) {
+            if (pObject instanceof String || pObject instanceof Integer || pObject instanceof Long
+                    || pObject instanceof JSONArray || pObject instanceof JSONObject) {
+                param.append(pObject.toString() + "; ");
+            }
+            else {
+                Class<? extends Object> pClass = (Class<? extends Object>) pObject.getClass();
+
+                //just for BaseOutDto, to get the error code and error message
+                Class<? extends Object> superClass = (Class<? extends Object>) pClass.getSuperclass();
+                if (superClass != null && superClass.getName().contains("BaseOutDto")) {
+                    Field[] fs = superClass.getDeclaredFields();
+                    for (int j = 0; j < fs.length; j++) {
+                        Field f = fs[j];
+                        f.setAccessible(true); //make the fields accessible
+                        param.append(f.getName() + ":" + f.get(pObject) + "; ");
+                    }
+                }
+
+                //get the value of the returned object
+                Field[] fs = pClass.getDeclaredFields();
+                for (int j = 0; j < fs.length; j++) {
+                    Field f = fs[j];
+                    f.setAccessible(true); //make the fields accessible
+                    param.append(f.getName() + ":" + f.get(pObject) + "; ");
+                }
+            }
+        }
+        return param.toString();
+    }
+}

+ 42 - 0
src/main/java/com/wechat/global/SysBatchException.java

@@ -0,0 +1,42 @@
+package com.wechat.global;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.wechat.service.TemplateMsgService;
+
+
+/** 自定义异常
+ * @author jadyn.wu
+ * @date: 2020-04-23 11:44
+ */
+@Component
+public class SysBatchException extends Exception  {
+	 protected static final Log log = LogFactory.getLog(SysBatchException.class);
+	 
+	 @Resource
+	 private TemplateMsgService templateMsgService;
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	
+	public SysBatchException() {};
+	
+	/**
+ 	 * 系统错误通知管理员
+	 */
+	public SysBatchException(String msg, Throwable cause) {
+		super(msg,cause);
+		log.error(msg,cause);
+		templateMsgService.sendSysTmpMsg(msg,cause);
+	}
+	
+
+
+}

+ 14 - 0
src/main/java/com/wechat/global/base/BaseController.java

@@ -0,0 +1,14 @@
+package com.wechat.global.base;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @ClassName: BaseController
+ * @Description:
+ */
+public class BaseController {
+
+    protected static final Log log = LogFactory.getLog(BaseController.class);
+
+}

+ 20 - 0
src/main/java/com/wechat/global/base/BaseService.java

@@ -0,0 +1,20 @@
+package com.wechat.global.base;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.wechat.common.CommonHelper;
+
+/**
+ * @ClassName: BaseService
+ * @Description: 基础Service
+ */
+public class BaseService {
+
+	@Autowired
+	protected CommonHelper commonHelper;
+
+	// log 处理
+	protected static final Log log = LogFactory.getLog(BaseService.class);
+}

+ 182 - 0
src/main/java/com/wechat/global/base/dao/IBaseSqlDao.java

@@ -0,0 +1,182 @@
+package com.wechat.global.base.dao;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: IBaseSqlDao
+ * @Description: 数据库基础操作接口
+ * @author shensuoyao
+ * @date 2014年7月10日 下午3:40:03
+ */
+public interface IBaseSqlDao {
+
+	/**
+	 * @Title: insert
+	 * @Description: 新增实体
+	 * @author shensuoyao
+	 * @date 2014年7月10日 下午4:19:02
+	 * @param statementName
+	 * @param entity
+	 * @return int
+	 * @throws 影响记录条数
+	 */
+	public abstract <T> int insert(String statementName, T entity) throws RuntimeException;
+
+	/**
+	 * 修改一个实体对象(UPDATE一条记录)
+	 * 
+	 * @param entity
+	 *            实体对象
+	 * @return 修改的对象个数,正常情况=1
+	 */
+	public abstract <T> int update(String statementName, T entity) throws RuntimeException;
+
+	/**
+	 * @Title: updateParam
+	 * @Description: 修改符合条件的记录
+	 *               <p>
+	 *               此方法特别适合于一次性把多条记录的某些字段值设置为新值(定值)的情况,比如修改符合条件的记录的状态字段
+	 *               </p>
+	 *               <p>
+	 *               此方法的另一个用途是把一条记录的个别字段的值修改为新值(定值),此时要把条件设置为该记录的主键
+	 *               </p>
+	 * @author shensuoyao
+	 * @date 2014年7月10日 下午4:26:15
+	 * @param statementName
+	 * @param param
+	 *            用于产生SQL的参数值,包括WHERE条件、目标字段和新值等
+	 * @return 修改的记录个数,用于判断修改是否成功
+	 * @throws RuntimeException
+	 */
+	public abstract int updateParam(String statementName, Map<?, ?> param) throws RuntimeException;
+
+	/**
+	 * 按主键删除记录
+	 * 
+	 * @param primaryKey
+	 *            主键对象
+	 * @return 删除的对象个数,正常情况=1
+	 */
+	public abstract <PK extends Serializable> int delete(String statementName, PK primaryKey) throws RuntimeException;
+
+	/**
+	 * 删除符合条件的记录
+	 * <p>
+	 * <strong>此方法一定要慎用,如果条件设置不当,可能会删除有用的记录!</strong>
+	 * </p>
+	 * 
+	 * @param param
+	 *            用于产生SQL的参数值,包括WHERE条件(其他参数内容不起作用)
+	 * @return
+	 */
+	public abstract int deleteParam(String statementName, Map<?, ?> param) throws RuntimeException;
+
+	/**
+	 * 清空表,比delete具有更高的效率,而且是从数据库中物理删除(delete是逻辑删除,被删除的记录依然占有空间)
+	 * <p>
+	 * <strong>此方法一定要慎用!</strong>
+	 * </p>
+	 * 
+	 * @return
+	 */
+	public abstract int truncate(String statementName) throws RuntimeException;
+
+	/**
+	 * 查询整表总记录数
+	 * 
+	 * @return 整表总记录数
+	 */
+	public abstract int count(String statementName) throws RuntimeException;
+
+	/**
+	 * 查询符合条件的记录数
+	 * 
+	 * @param param
+	 *            查询条件参数,包括WHERE条件(其他参数内容不起作用)。此参数设置为null,则相当于count()
+	 * @return
+	 */
+	public abstract int count(String statementName, Object param) throws RuntimeException;
+
+	/**
+	 * 按主键取记录
+	 * 
+	 * @param primaryKey
+	 *            主键值
+	 * @return 记录实体对象,如果没有符合主键条件的记录,则返回null
+	 */
+	public abstract <T, PK extends Serializable> T get(String statementName, PK primaryKey) throws RuntimeException;
+	
+	/** 
+	* @Title: selectOne
+	* @Description: 获取单个记录
+	* @author shensuoyao
+	* @param statementName
+	* @param obj
+	* @return
+	* @throws RuntimeException T
+	* @throws 
+	*/ 
+	public abstract <T> T selectOne(String statementName, Object obj) throws RuntimeException;
+
+	/**
+	 * 取全部记录
+	 * 
+	 * @return 全部记录实体对象的List
+	 */
+	public abstract <T> List<T> select(String statementName) throws RuntimeException;
+	
+	/** 
+	* @Title: select
+	* @Description: 查询特定记录
+	* @author shensuoyao
+	* @date 2014年7月10日 下午5:03:03
+	* @param statementName
+	* @param obj
+	* @return
+	* @throws RuntimeException List<T>
+	* @throws 
+	*/ 
+	public abstract <T> List<T> select(String statementName, Object obj) throws RuntimeException;
+
+	/**
+	 * 按条件查询记录
+	 * 
+	 * @param param
+	 *            查询条件参数,包括WHERE条件、分页条件、排序条件
+	 * @return 符合条件记录的实体对象的List
+	 */
+	public abstract <T> List<T> selectParam(String statementName, Map<?, ?> param) throws RuntimeException;
+
+	/**
+	 * 按条件查询记录,并处理成分页结果
+	 * 
+	 * @param pagination
+	 *            查询条件参数,包括WHERE条件、分页条件、排序条件
+	 * @return PaginationResult对象,包括(符合条件的)总记录数、页实体对象List等
+	 */
+	public abstract <T> PagingResult<T> selectPagination(String statementName, String countStatementName,
+			Pagination pagination) throws RuntimeException;
+
+	/**
+	 * 批量插入
+	 * 
+	 * @param list
+	 */
+	public abstract <T> int insertBatch(String statementName, final List<T> list) throws RuntimeException;
+
+	/**
+	 * 批量修改
+	 * 
+	 * @param list
+	 */
+	public abstract <T> int updateBatch(String statementName, final List<T> list) throws RuntimeException;
+
+	/**
+	 * 批量删除
+	 * 
+	 * @param list
+	 */
+	public abstract <PK extends Serializable> int deleteBatch(String statementName, final List<PK> list) throws RuntimeException;
+}

+ 123 - 0
src/main/java/com/wechat/global/base/dao/Pagination.java

@@ -0,0 +1,123 @@
+package com.wechat.global.base.dao;
+
+import java.util.Map;
+
+/**
+ * @ClassName: Pagination
+ * @Description: 分页对象
+ * @author shensuoyao
+ * @date 2014年7月10日 下午4:08:18
+ */
+public class Pagination {
+	
+	private Integer page = 1; // 目前是第几页
+	
+	private Integer size = 10; // 每页大小
+	
+	private Map<Object, Object> params; // 传入的参数
+	
+	private String orderColumn;
+	
+	private String orderTurn = "ASC";
+	
+	private Integer pageNoSize = 10;
+	
+	public Pagination() {super();}
+	
+	public Pagination(Integer _page) {
+		if(_page != null) {
+			this.page = _page;
+		}
+	}
+	
+	public Pagination(Integer _page, Integer _size) {
+		this(_page);
+		if(null != _size) {
+			this.size = _size;
+		}
+	}
+	
+	/**
+	 * @return page
+	 */
+	public Integer getPage() {
+		return (null == page || 0 == page) ? 1 : page;
+	}
+
+	/**
+	 * @param page
+	 *            要设置的 page
+	 */
+	public void setPage(Integer page) {
+		this.page = page;
+	}
+
+	/**
+	 * @return size
+	 */
+	public Integer getSize() {
+		return size;
+	}
+
+	/**
+	 * @param size
+	 *            要设置的 size
+	 */
+	public void setSize(Integer size) {
+		this.size = size;
+	}
+
+	/**
+	 * @return params
+	 */
+	public Map<Object, Object> getParams() {
+		return params;
+	}
+
+	/**
+	 * @param params
+	 *            要设置的 params
+	 */
+	public void setParams(Map<Object, Object> params) {
+		this.params = params;
+	}
+
+	/**
+	 * @return orderColumn
+	 */
+	public String getOrderColumn() {
+		return orderColumn;
+	}
+
+	/**
+	 * @param orderColumn
+	 *            要设置的 orderColumn
+	 */
+	public void setOrderColumn(String orderColumn) {
+		this.orderColumn = orderColumn;
+	}
+
+	/**
+	 * @return orderTurn
+	 */
+	public String getOrderTurn() {
+		return orderTurn;
+	}
+
+	/**
+	 * @param orderTurn
+	 *            要设置的 orderTurn
+	 */
+	public void setOrderTurn(String orderTurn) {
+		this.orderTurn = orderTurn;
+	}
+
+    public Integer getPageNoSize() {
+        return pageNoSize;
+    }
+
+    public void setPageNoSize(Integer pageNoSize) {
+        this.pageNoSize = pageNoSize;
+    }
+	
+}

+ 263 - 0
src/main/java/com/wechat/global/base/dao/PagingResult.java

@@ -0,0 +1,263 @@
+/**   
+ * Title: PagingResult.java
+ * Package com.tiangou.me.core.support
+ * All rights Reserved, Designed By soyo
+ * Copyright: Copyright(C) 2010-2015
+ * Company: soyo SuZhou LTD.
+ * Create By shensuoyao
+ * Create Date 2014年7月10日 下午4:10:36
+ * Version V1.0
+ */
+package com.wechat.global.base.dao;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName: PagingResult
+ * @Description: 分页结果
+ * @author shensuoyao
+ * @date 2014年7月10日 下午4:10:36
+ */
+public class PagingResult<T> {
+	
+	// 当前页
+	private int currentPage;
+	
+	//总页数
+	private int totalPage;
+	
+	// 总共记录条数
+	private int totalSize;
+	
+	//每页显示数量
+	private int pageSize;
+	
+	private int pageNoSize = 10;
+	
+	// 结果集
+	private List<T> resultList = new ArrayList<T>();
+	
+	
+	/** 
+	* @Fields params : 查询条件
+	*/ 
+	private Map<String, Object> params;
+
+	/**
+	 * @return currentPage
+	 */
+	public int getCurrentPage() {
+		return currentPage;
+	}
+
+	/**
+	 * @param currentPage
+	 *            要设置的 currentPage
+	 */
+	public void setCurrentPage(int currentPage) {
+		this.currentPage = currentPage;
+	}
+
+	/**
+	 * @return totalSize
+	 */
+	public int getTotalSize() {
+		return totalSize;
+	}
+
+	/**
+	 * @param totalSize
+	 *            要设置的 totalSize
+	 */
+	public void setTotalSize(int totalSize) {
+		this.totalSize = totalSize;
+	}
+
+	/**
+	 * @return resultList
+	 */
+	public List<T> getResultList() {
+		return resultList;
+	}
+
+	/**
+	 * @param resultList
+	 *            要设置的 resultList
+	 */
+	public void setResultList(List<T> resultList) {
+		this.resultList = resultList;
+	}
+
+	/** 
+	 * @return totalPage
+	 */
+	public int getTotalPage() {
+		if(this.totalPage > 0) {
+			return this.totalPage;
+		}
+		this.totalPage = this.totalSize / this.pageSize;
+		if((this.totalSize % this.pageSize) > 0) {
+			this.totalPage += 1;
+		}
+		return totalPage;
+	}
+
+	/** 
+	 * @param totalPage 要设置的 totalPage
+	 */
+	public void setTotalPage(int totalPage) {
+		this.totalPage = totalPage;
+	}
+
+	/** 
+	 * @return pageSize
+	 */
+	public int getPageSize() {
+		return pageSize;
+	}
+
+	/** 
+	 * @param pageSize 要设置的 pageSize
+	 */
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+	
+	/** 
+	* @Title: prevPage
+	* @Description: 上一页页码
+	* @author shensuoyao
+	* @date 2014年7月11日 上午10:52:17
+	* @return int
+	* @throws 
+	*/ 
+	public int getPrevPage() {
+		int p = this.currentPage - 1;
+		if(p > 0) {
+			return p;
+		}
+		return this.currentPage;
+	}
+	
+	/** 
+	* @Title: nextPage
+	* @Description: 下一页页码
+	* @author shensuoyao
+	* @date 2014年7月11日 上午10:49:15
+	* @return int
+	* @throws 
+	*/ 
+	public int getNextPage() {
+		int p = this.currentPage + 1;
+		if(p > this.getTotalPage()) {
+			return this.currentPage;
+		}
+		return p;
+	}
+	
+	/** 
+	* @Title: hasPrevPage
+	* @Description: 是否有上一页
+	* @author shensuoyao
+	* @date 2014年7月11日 上午10:53:24
+	* @return boolean
+	* @throws 
+	*/ 
+	public boolean hasPrevPage() {
+		return getPrevPage() < this.currentPage;
+	}
+	
+	/** 
+	* @Title: hasNext
+	* @Description: 是否有下一页
+	* @author shensuoyao
+	* @date 2014年7月11日 上午10:50:27
+	* @return boolean
+	* @throws 
+	*/ 
+	public boolean hasNextPage() {
+		return getNextPage() > this.currentPage;
+	}
+	
+    /** get page no **/
+    public long getFirstPage() {
+        if ((currentPage - 1) > 0) {
+            return 1;
+        } else {
+            return 0;
+        }
+    }
+    
+    public long getLastPage() {
+        if ((currentPage + 1) <= getTotalPage()) {
+            return (getTotalPage());
+        } else {
+            return 0;
+        }
+    }
+	
+	/** 
+	* @Title: getResultSize
+	* @Description: 获取结果集数量
+	* @author shensuoyao
+	* @date 2014年7月11日 上午11:23:04
+	* @return int
+	* @throws 
+	*/ 
+	public int getResultSize() {
+		return this.resultList.size();
+	}
+
+	/** 
+	 * @return params
+	 */
+	public Map<String, Object> getParams() {
+		return params;
+	}
+
+	/** 
+	 * @param params 要设置的 params
+	 */
+	public void setParams(Map<String, Object> params) {
+		this.params = params;
+	}
+	
+	
+
+    public int getPageNoSize() {
+        return pageNoSize;
+    }
+
+    public void setPageNoSize(int pageNoSize) {
+        this.pageNoSize = pageNoSize;
+    }
+
+    public List<Integer> getPageList() {
+		List<Integer> numberList = new ArrayList<Integer>();
+		if(this.getTotalPage() <= pageNoSize){
+	    	for(int i = 0; i < this.getTotalPage(); i++){
+	    		numberList.add(i+1);
+	    	}
+	    }else {
+	    	if(this.getCurrentPage() <= (pageNoSize/2)){
+	        	for(int i = 0; i < pageNoSize; i++){
+	        		numberList.add(i+1);
+	        	}
+	    	}else if(this.getCurrentPage() > (this.getTotalPage() - (pageNoSize/2))){
+	    		for(int i = (int) this.getTotalPage()-10; i< this.getTotalPage(); i++){
+	    			numberList.add(i+1);
+	    		}
+	    	}else{
+	    		for(int i = (int) this.getCurrentPage()-(pageNoSize/2); i< this.getCurrentPage()+(pageSize/2); i++){
+	    			numberList.add(i+1);
+	    		}
+	    	}
+	    }
+		
+		return numberList;
+	}
+
+
+}

+ 47 - 0
src/main/java/com/wechat/global/base/dao/RedisGeneratorDao.java

@@ -0,0 +1,47 @@
+package com.wechat.global.base.dao;
+
+import java.io.Serializable;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.RedisSerializer;
+
+public abstract class RedisGeneratorDao<K extends Serializable, V extends Serializable> {
+
+    @Autowired
+    protected RedisTemplate<K, V> redisTemplate;
+
+    /**
+     * 设置redisTemplate
+     * 
+     * @param redisTemplate the redisTemplate to set
+     */
+    public void setRedisTemplate(RedisTemplate<K, V> redisTemplate) {
+        this.redisTemplate = redisTemplate;
+    }
+
+    /**
+     * 获取 RedisSerializer <br>
+     * ------------------------------<br>
+     */
+    protected RedisSerializer<String> getRedisSerializer() {
+        return redisTemplate.getStringSerializer();
+    }
+
+    public void insert(K tableKey, String dataKey, V v) {
+        redisTemplate.opsForHash().put(tableKey, dataKey, v);
+    }
+
+    public void update(K tableKey, String dataKey, V v) {
+        redisTemplate.opsForHash().put(tableKey, dataKey, v);
+    }
+
+    public void delete(K tableKey, String dataKey) {
+        redisTemplate.opsForHash().delete(tableKey, dataKey);
+    }
+
+    @SuppressWarnings("unchecked")
+    public V selectOne(K tableKey, String dataKey) {
+        return (V) redisTemplate.opsForHash().get(tableKey, dataKey);
+    }
+}

+ 83 - 0
src/main/java/com/wechat/global/base/dao/RedisSetDao.java

@@ -0,0 +1,83 @@
+package com.wechat.global.base.dao;
+
+import java.io.Serializable;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Repository;
+
+
+/**
+ * @author jadyn.wu
+ * @param <K>
+ * @date: 2020-04-21 11:36
+ */
+@Repository
+public class RedisSetDao<V extends Serializable> {
+
+	@Autowired
+	protected RedisTemplate<String, V> redisTemplate;
+	
+
+	public Boolean isMember(String infoKey, V infoValue) {
+		return redisTemplate.opsForSet().isMember(infoKey, infoValue);
+	}
+
+	public Long insert(String infoKey, V infoValue) {
+		Long add = redisTemplate.opsForSet().add(infoKey, infoValue);
+		return add;
+	}
+
+	/**
+	 * 
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry 过期时长(X秒后过期) 单位:秒
+	 */
+	public Long insertSecond(String infoKey, V infoValue, Integer expirySecond) {
+		Long add = redisTemplate.opsForSet().add(infoKey, infoValue);
+		// 设置失效时间
+		redisTemplate.expire(infoKey, expirySecond, TimeUnit.SECONDS);
+		return add;
+	}
+
+	/**
+	 * 
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry 过期时长 单位:天
+	 * @return 
+	 */
+	public Long insertDay(String infoKey, V infoValue, Integer expiryDay) {
+		Long add = redisTemplate.opsForSet().add(infoKey, infoValue);
+		// 设置失效时间
+		redisTemplate.expire(infoKey, expiryDay, TimeUnit.DAYS);
+		return add;
+	}
+	
+
+	public void delete(String infoKey) {
+		redisTemplate.delete(infoKey);
+	}
+	
+    public Boolean hasKey(String infoKey) {
+       return redisTemplate.hasKey(infoKey);
+    }
+
+    public Long getSize(String infoKey) {
+        return redisTemplate.opsForSet().size(infoKey);
+    }
+    
+    //模糊查询相关key
+    public Set<String> getKeys(String baseKey) {
+        return redisTemplate.keys(baseKey+ "*");
+    }
+    
+    //查询Set中的内容
+    public Set<V> select(String key) {
+        return redisTemplate.opsForSet().members(key);
+    }
+    
+}

+ 88 - 0
src/main/java/com/wechat/global/base/dao/RedisWithExpiryTimeDao.java

@@ -0,0 +1,88 @@
+package com.wechat.global.base.dao;
+
+import java.util.Date;
+import java.util.concurrent.TimeUnit;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Repository;
+
+/**
+ * This is test for Git Stash
+ * 
+ * @author Administrator
+ *
+ */
+@Repository
+public class RedisWithExpiryTimeDao {
+
+	@Autowired
+	protected RedisTemplate<String, String> redisTemplate;
+
+	public String select(String infoKey) {
+		return redisTemplate.opsForValue().get(infoKey);
+	}
+
+	public void insert(String infoKey, String infoValue) {
+		redisTemplate.opsForValue().set(infoKey, infoValue);
+	}
+
+	/**
+	 * 
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry 过期时长(X秒后过期) 单位:秒
+	 */
+	public void insert(String infoKey, String infoValue, Integer expirySecond) {
+		redisTemplate.opsForValue().set(infoKey, infoValue);
+		// 设置失效时间
+		redisTemplate.expire(infoKey, expirySecond, TimeUnit.SECONDS);
+	}
+
+	/**
+	 * 
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry 过期时长 单位:天
+	 */
+	public void insertDay(String infoKey, String infoValue, Integer expiryDay) {
+		redisTemplate.opsForValue().set(infoKey, infoValue);
+		// 设置失效时间
+		redisTemplate.expire(infoKey, expiryDay, TimeUnit.DAYS);
+	}
+	
+	/**
+	 * 
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiry 过期时长 单位:毫秒
+	 */
+   public void insertExpMs(String infoKey, String infoValue, long expiryMilliseSecond) {
+        redisTemplate.opsForValue().set(infoKey, infoValue);
+        // 设置失效时间
+        redisTemplate.expire(infoKey, expiryMilliseSecond, TimeUnit.MILLISECONDS);
+    }
+   
+	
+	/**
+	 * 
+	 * @param infoKey
+	 * @param infoValue
+	 * @param expiryTime 具体的过期时间(到X时间就过期)
+	 */
+	public void insert(String infoKey, String infoValue, Date expiryTime) {
+		redisTemplate.opsForValue().set(infoKey, infoValue);
+		// 设置失效时间
+		redisTemplate.expireAt(infoKey, expiryTime);
+	}
+
+
+	public void delete(String infoKey) {
+		redisTemplate.delete(infoKey);
+	}
+	
+   public Boolean hasKey(String infoKey) {
+       return redisTemplate.hasKey(infoKey);
+    }
+
+}

+ 177 - 0
src/main/java/com/wechat/global/base/dao/impl/BaseDao.java

@@ -0,0 +1,177 @@
+package com.wechat.global.base.dao.impl;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.apache.ibatis.session.RowBounds;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.springframework.dao.DataAccessException;
+
+import com.wechat.global.base.dao.Pagination;
+import com.wechat.global.base.dao.PagingResult;
+import com.wechat.model.dbEntity.BaseEntity;
+
+/**
+ * @ClassName: BaseDao
+ * @Description: 数据库操作基本实现类
+ */
+public abstract class BaseDao {
+
+    @Resource
+    public SqlSessionTemplate sqlSession;
+
+    /**
+     * @param sqlSession the sqlSession to set
+     */
+    public void setSqlSession(SqlSessionTemplate sqlSession) {
+        this.sqlSession = sqlSession;
+    }
+
+    public Integer insert(String statementName, BaseEntity entity) {
+        entity.setCreateDate(new Date());
+        entity.setUpdateDate(new Date());
+        return sqlSession.insert(statementName, entity);
+    }
+    
+    public <T> Integer insertList(String statementName, List<T> list) {
+        return sqlSession.insert(statementName, list);
+    }
+
+    /**
+     * 更新
+     * 
+     * @param statementName
+     * @param entity
+     * @return
+     */
+    public Integer update(String statementName, BaseEntity entity) {
+    	entity.setUpdateDate(new Date());
+        entity.setLastModifyTime(new Date());
+        return sqlSession.update(statementName, entity);
+    }
+    
+    /**
+     * 更新
+     * 
+     * @param statementName
+     * @param entity
+     * @return
+     */
+    public Integer update(String statementName) {
+    	BaseEntity entity = new BaseEntity();
+    	entity.setUpdateDate(new Date());
+        entity.setLastModifyTime(new Date());
+        return sqlSession.update(statementName,entity);
+    }
+    
+    /**
+     * 更新
+     * @param statementName
+     * @param param
+     * @return
+     */
+    public Integer update(String statementName, Map<String, Object> param) {
+    	param.put("updateDate", new Date());
+    	param.put("lastModifyTime", new Date());
+        return sqlSession.update(statementName, param);
+    }
+
+    /**
+     * 删除
+     * 
+     * @param statementName
+     * @param entity
+     * @return
+     */
+    public int delete(String statementName, BaseEntity entity) {
+        return sqlSession.delete(statementName, entity);
+    }
+
+    public <T> PagingResult<T> selectPagination(String statementName, String countStatementName, Pagination pagination)
+            throws RuntimeException {
+        try {
+            // 默认为第一页
+            int page = pagination.getPage();
+            // 默认每页15个
+            int size = pagination.getSize();
+            //页码默认10
+            int pageNoSize = pagination.getPageNoSize();
+
+            RowBounds rowBounds = new RowBounds((page - 1) * size, size);
+
+            Map<Object, Object> param = pagination.getParams();
+            if (param != null) {
+                param.put("orderColumn", pagination.getOrderColumn());
+                param.put("orderTurn", pagination.getOrderTurn());
+            }
+            else {
+                param = new HashMap<Object, Object>();
+                param.put("orderColumn", pagination.getOrderColumn());
+                param.put("orderTurn", pagination.getOrderTurn());
+            }
+
+            List<T> resultList = sqlSession.selectList(statementName, param, rowBounds);
+            int totalSize = count(countStatementName, pagination.getParams());
+
+            PagingResult<T> pagingResult = new PagingResult<T>();
+            pagingResult.setCurrentPage(page);
+            pagingResult.setTotalSize(totalSize);
+            pagingResult.setPageSize(size);
+            pagingResult.setResultList(resultList);
+            pagingResult.setPageNoSize(pageNoSize);
+            return pagingResult;
+        }
+        catch (DataAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public <T> T selectOne(String statementName, Object obj) throws RuntimeException {
+        try {
+            return sqlSession.selectOne(statementName, obj);
+        }
+        catch (DataAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    
+    public <T> T selectOne(String statementName) throws RuntimeException {
+        try {
+            return sqlSession.selectOne(statementName);
+        }
+        catch (DataAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public int count(String statementName, Object param) throws RuntimeException {
+        try {
+            return sqlSession.selectOne(statementName, param);
+        }
+        catch (DataAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public <T> List<T> select(String statementName) throws RuntimeException {
+        try {
+            return sqlSession.selectList(statementName);
+        }
+        catch (DataAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public <T> List<T> select(String statementName, Object obj) throws RuntimeException {
+        try {
+            return sqlSession.selectList(statementName, obj);
+        }
+        catch (DataAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}

+ 334 - 0
src/main/java/com/wechat/global/base/dao/impl/BaseSqlDaoImpl.java

@@ -0,0 +1,334 @@
+package com.wechat.global.base.dao.impl;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.session.RowBounds;
+import org.mybatis.spring.support.SqlSessionDaoSupport;
+import org.springframework.dao.DataAccessException;
+
+import com.wechat.global.base.dao.IBaseSqlDao;
+import com.wechat.global.base.dao.Pagination;
+import com.wechat.global.base.dao.PagingResult;
+
+/** 
+ * @ClassName: BaseSqlDaoImpl
+ * @Description: 数据库操作基本实现类
+ * @author shensuoyao
+ * @date 2014年7月10日 下午3:52:03
+ */
+public class BaseSqlDaoImpl extends SqlSessionDaoSupport implements IBaseSqlDao {
+
+	/** (非 Javadoc) 
+	* Title: insert
+	* Description:
+	* @param statementName
+	* @param entity
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#insert(java.lang.String, java.lang.Object)
+	*/ 
+	@Override
+	public <T> int insert(String statementName, T entity) throws RuntimeException {
+		try {
+			return this.getSqlSession().insert(statementName, entity);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: update
+	* Description:
+	* @param statementName
+	* @param entity
+	* @return
+	* @throws RuntimeException
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#update(java.lang.String, java.lang.Object)
+	*/ 
+	@Override
+	public <T> int update(String statementName, T entity) throws RuntimeException {
+		try {
+			return this.getSqlSession().update(statementName, entity);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: updateParam
+	* Description:
+	* @param statementName
+	* @param param
+	* @return
+	* @throws RuntimeException
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#updateParam(java.lang.String, java.util.Map)
+	*/ 
+	@Override
+	public int updateParam(String statementName, Map<?, ?> param) throws RuntimeException {
+		try {
+			return this.getSqlSession().update(statementName, param);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: delete
+	* Description:
+	* @param primaryKey
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#delete(java.io.Serializable)
+	*/ 
+	@Override
+	public <PK extends Serializable> int delete(String statementName, PK primaryKey) throws RuntimeException {
+		try {
+			return this.getSqlSession().delete(statementName, primaryKey);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: deleteParam
+	* Description:
+	* @param param
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#deleteParam(java.util.Map)
+	*/ 
+	@Override
+	public int deleteParam(String statementName, Map<?, ?> param) throws RuntimeException {
+		try {
+			return this.getSqlSession().delete(statementName, param);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: truncate
+	* Description:
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#truncate()
+	*/ 
+	@Override
+	public int truncate(String statementName) throws RuntimeException {
+		try {
+			return this.getSqlSession().delete(statementName);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: count
+	* Description:
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#count()
+	*/ 
+	@Override
+	public int count(String statementName) throws RuntimeException {
+		try {
+			return this.getSqlSession().selectOne(statementName);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: count
+	* Description:
+	* @param param
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#count(java.lang.Object)
+	*/ 
+	@Override
+	public int count(String statementName, Object param) throws RuntimeException {
+		try {
+			return this.getSqlSession().selectOne(statementName, param);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: get
+	* Description:
+	* @param primaryKey
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#get(java.io.Serializable)
+	*/ 
+	@Override
+	public <T, PK extends Serializable> T get(String statementName, PK primaryKey) throws RuntimeException {
+		try {
+			return this.getSqlSession().selectOne(statementName, primaryKey);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: selectOne
+	* Description:
+	* @param statementName
+	* @param obj
+	* @return
+	* @throws RuntimeException
+	* @see com.wechat.global.dao.test.core.base.dao.IBaseSqlDao#selectOne(java.lang.String, java.lang.Object)
+	*/ 
+	@Override
+	public <T> T selectOne(String statementName, Object obj) throws RuntimeException {
+		try {
+			return this.getSqlSession().selectOne(statementName, obj);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: select
+	* Description:
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#select()
+	*/ 
+	@Override
+	public <T> List<T> select(String statementName) throws RuntimeException {
+		try {
+			return this.getSqlSession().selectList(statementName);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+	
+
+	/** (非 Javadoc) 
+	* Title: select
+	* Description:
+	* @param statementName
+	* @param obj
+	* @return
+	* @throws RuntimeException
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#select(java.lang.String, java.lang.Object)
+	*/ 
+	@Override
+	public <T> List<T> select(String statementName, Object obj) throws RuntimeException {
+		try {
+			return this.getSqlSession().selectList(statementName, obj);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: selectParam
+	* Description:
+	* @param param
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#selectParam(java.util.Map)
+	*/ 
+	@Override
+	public <T> List<T> selectParam(String statementName, Map<?, ?> param) throws RuntimeException {
+		try {
+			return this.getSqlSession().selectList(statementName, param);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: selectPagination
+	* Description:
+	* @param pagination
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#selectPagination(com.wechat.global.dao.tiangou.me.core.support.Pagination)
+	*/ 
+	@Override
+	public <T> PagingResult<T> selectPagination(String statementName, String countStatementName, Pagination pagination)
+			throws RuntimeException {
+		try {
+			// 默认为第一页
+			int page = pagination.getPage();
+			// 默认每页15个
+			int size = pagination.getSize();
+			
+			RowBounds rowBounds = new RowBounds((page - 1) * size, size);
+
+			Map<Object, Object> param = pagination.getParams();
+			if (param != null) {
+				param.put("orderColumn", pagination.getOrderColumn());
+				param.put("orderTurn", pagination.getOrderTurn());
+			} else {
+				param = new HashMap<Object, Object>();
+				param.put("orderColumn", pagination.getOrderColumn());
+				param.put("orderTurn", pagination.getOrderTurn());
+			}
+
+			List<T> resultList = this.getSqlSession().selectList(statementName, param, rowBounds);
+			int totalSize = count(countStatementName, pagination.getParams());
+			
+			PagingResult<T> pagingResult = new PagingResult<T>();
+			pagingResult.setCurrentPage(page);
+			pagingResult.setTotalSize(totalSize);
+			pagingResult.setPageSize(size);
+			pagingResult.setResultList(resultList);
+			
+			return pagingResult;
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: insertBatch
+	* Description:
+	* @param list
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#insertBatch(java.util.List)
+	*/ 
+	@Override
+	public <T> int insertBatch(String statementName, List<T> list) throws RuntimeException {
+		try {
+			return this.getSqlSession().insert(statementName, list);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: updateBatch
+	* Description:
+	* @param list
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#updateBatch(java.util.List)
+	*/ 
+	@Override
+	public <T> int updateBatch(String statementName, List<T> list) throws RuntimeException {
+		try {
+			int rows = 0;
+			for(T t : list) {
+				rows += this.getSqlSession().update(statementName, t);
+			}
+			return rows;
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/** (非 Javadoc) 
+	* Title: deleteBatch
+	* Description:
+	* @param list
+	* @return
+	* @see com.wechat.global.dao.tiangou.me.core.support.IBaseSqlDao#deleteBatch(java.util.List)
+	*/ 
+	@Override
+	public <PK extends Serializable> int deleteBatch(String statementName, List<PK> list) throws RuntimeException {
+		try {
+			return this.getSqlSession().delete(statementName, list);
+		} catch (DataAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+}

+ 62 - 0
src/main/java/com/wechat/global/message/InfoMsg.java

@@ -0,0 +1,62 @@
+package com.wechat.global.message;
+
+public enum InfoMsg {
+
+    /****************系统级****************/
+    SUCCESS_REQUEST("0", "成功"),
+    
+    ERROR_SYSTEM_ERROR("9999", "系统异常,请联系客服人员"),
+
+    ERROR_EMPTY_REQUEST("9001", "空的非法请求"),
+    
+    /****************业务级 成功****************/
+    SUCCESS_BINDING("2001", "账户关联认证成功"), 
+    
+    /****************业务级 失败****************/
+    ERROR_BINDING("1001", "账户关联认证失败,请确认您输入的账户信息"),
+    ERROR_AUZ_FAILED("1004", "网页授权失败,请重新进入并授权!"),
+    ERROR_TOO_LARGE("1005", "上传图片太大"),
+    ERROR_WECHAT_MENU("1006", "自定义菜单设置失败"),
+    ERROR_UPLOAD_FIELD("1007", "上传失败"),
+    ERROR_SAVE_FIELD("1008", "保存失败"),
+    ERROR_SEND_EMAIL_FAIL("1041","邮件发送失败|Failure to send text email"),
+    
+    /****************业务级 警告****************/
+    WARNING_NOUSER("4001", "不存在该用户"),
+    WARNING_TIMEOUT("4002", "此会话已经过期"),
+    WARNING_NODATA("4003", "没有数据"),
+
+
+    
+    
+
+
+    ;
+
+    private String code;
+
+    private String msg;
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    private InfoMsg(String code, String msg)
+    {
+        this.code = code;
+        this.msg = msg;
+    }
+
+}

+ 94 - 0
src/main/java/com/wechat/model/dbEntity/BaseEntity.java

@@ -0,0 +1,94 @@
+package com.wechat.model.dbEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName: BaseEntity
+ * @Description: 公共实体对象
+ */
+public class BaseEntity implements Serializable, Cloneable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String creator;
+
+    private Date createTime;
+
+    private String lastModifier;
+
+    private Date lastModifyTime;
+    
+    private Date updateDate;
+    
+    private Date createDate;
+    
+    private String createBy;
+    
+    private String updateBy;
+    
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator == null ? null : creator.trim();
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getLastModifier() {
+        return lastModifier;
+    }
+    
+    public Date getUpdateDate() {
+		return updateDate;
+	}
+
+	public void setUpdateDate(Date updateDate) {
+		this.updateDate = updateDate;
+	}
+
+	public Date getCreateDate() {
+		return createDate;
+	}
+
+	public void setCreateDate(Date createDate) {
+		this.createDate = createDate;
+	}
+
+	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 void setLastModifier(String lastModifier) {
+        this.lastModifier = lastModifier == null ? null : lastModifier.trim();
+    }
+
+    public Date getLastModifyTime() {
+        return lastModifyTime;
+    }
+
+    public void setLastModifyTime(Date lastModifyTime) {
+        this.lastModifyTime = lastModifyTime;
+    }
+
+}

+ 104 - 0
src/main/java/com/wechat/model/dbEntity/MdeAdCtrDtl.java

@@ -0,0 +1,104 @@
+package com.wechat.model.dbEntity;
+
+import java.util.Date;
+
+import com.wechat.common.utils.DateUtils;
+
+
+/**
+ * @author jadyn.wu
+ * @date: 2020-04-22 16:54
+ */
+public class MdeAdCtrDtl extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	private int adId; 
+
+	private String adPosition;
+	
+	private String writeDateStr;
+	
+	private Date writeDate;
+
+	private Integer views;
+
+	private Integer clicks;
+	
+	public MdeAdCtrDtl (String writeDateStr) {
+		try {
+			setWriteDateStr(writeDateStr);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		setCreateDate(new Date());
+		setUpdateDate(new Date());
+		setCreateBy("Batch");
+		setUpdateBy("Batch");
+	}
+
+	public String getWriteDateStr() {
+		return writeDateStr;
+	}
+
+	public void setWriteDateStr(String writeDateStr){
+		this.writeDateStr = writeDateStr;
+		setWriteDate(DateUtils.stringToDate(writeDateStr, DateUtils.PATTEN_YMD));
+	}
+
+	public Date getWriteDate() {
+		return writeDate;
+	}
+
+	public void setWriteDate(Date writeDate) {
+		this.writeDate = writeDate;
+	}
+
+	public static long getSerialversionuid() {
+		return serialVersionUID;
+	}
+
+	public int getAdId() {
+		return adId;
+	}
+
+	public void setAdId(int adId) {
+		this.adId = adId;
+	}
+
+	public String getAdPosition() {
+		return adPosition;
+	}
+
+	public void setAdPosition(String adPosition) {
+		this.adPosition = adPosition;
+	}
+
+	public Integer getViews() {
+		return views;
+	}
+
+	public void setViews(Integer views) {
+		if (views == null)
+		{
+			views = 0;
+		}
+		this.views = views;
+	}
+
+	public Integer getClicks() {
+		return clicks;
+	}
+
+	public void setClicks(Integer clicks) {
+		if (clicks == null)
+		{
+			clicks = 0;
+		}
+		this.clicks = clicks;
+	}
+
+	
+	
+}

+ 92 - 0
src/main/java/com/wechat/model/dbEntity/MdeJobPvUv.java

@@ -0,0 +1,92 @@
+package com.wechat.model.dbEntity;
+
+import java.util.Date;
+
+import com.wechat.common.utils.DateUtils;
+
+
+/**
+ * @author jadyn.wu
+ * @date: 2020-04-22 16:54
+ */
+public class MdeJobPvUv extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	private String jobId; 
+
+	private String writeDateStr;
+	
+	private Date writeDate;
+
+	private Integer pageView;
+
+	private Integer userView;
+	
+	public MdeJobPvUv (String writeDateStr) {
+		try {
+			setWriteDateStr(writeDateStr);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		setCreateDate(new Date());
+		setUpdateDate(new Date());
+	}
+
+	public String getJobId() {
+		return jobId;
+	}
+
+	public void setJobId(String jobId) {
+		this.jobId = jobId;
+	}
+
+	public String getWriteDateStr() {
+		return writeDateStr;
+	}
+
+	public void setWriteDateStr(String writeDateStr){
+		this.writeDateStr = writeDateStr;
+		setWriteDate(DateUtils.stringToDate(writeDateStr, DateUtils.PATTEN_YMD));
+	}
+
+	public Date getWriteDate() {
+		return writeDate;
+	}
+
+	public void setWriteDate(Date writeDate) {
+		this.writeDate = writeDate;
+	}
+
+	public Integer getPageView() {
+		return pageView;
+	}
+
+	public void setPageView(Integer pageView) {
+		if (pageView == null)
+		{
+			pageView = 0;
+		}
+		this.pageView = pageView;
+	}
+
+	public Integer getUserView() {
+		return userView;
+	}
+
+	public void setUserView(Integer userView) {
+		if (userView == null)
+		{
+			userView = 0;
+		}
+		this.userView = userView;
+	}
+
+	public static long getSerialversionuid() {
+		return serialVersionUID;
+	}
+
+	
+	
+}

+ 658 - 0
src/main/java/com/wechat/model/dbEntity/MdeOrders.java

@@ -0,0 +1,658 @@
+package com.wechat.model.dbEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+
+/**
+ * @author jadyn.wu
+ * @date: 2019-09-16 14:09
+ */
+public class MdeOrders extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	private String orderId; // 订单编号(采番规则:P/E+YYMMDD+10位hashCode取正+3位随机数)
+
+	private String userCode; // 用户id
+
+	private String payType; // 支付方式[1-微信;2-支付宝;3-线下汇款]
+
+	private String thirdPartyOrd; // 第三方支付订单号
+
+	private String pkgId; // 套餐id(会员套餐表id)
+	
+	private Integer goodsId; // 商品id
+	
+	private String img;  //封面图
+
+	private String pkgTitle; // 套餐标题
+	private String pkgTitleEn; // 套餐标题英文
+	
+    private String subheadCn;  // 商品副标题
+    private String subheadEn;
+
+	private String pkgIntroduction; // 套餐简介
+	private String pkgIntroductionEn; // 套餐简介英文
+	
+	private String pkgDetail; // 套餐详情
+	private String pkgDetailEn; // 套餐详情英文 
+
+	private String validityPeriod; // 购买有效期
+	
+	private String skuCn;		// sku
+	private String skuEn;		// sku
+
+	private String price; // 商品售价(单价)
+	private String refundNo; // 退款金额
+
+    private BigDecimal payableMoney;  //应付商品总金额
+
+    private BigDecimal payableFreight;  //总运费金额
+
+    private BigDecimal realFreight;  //实付运费
+
+    private BigDecimal payPrice;   // 实际支付总金额(总价)
+    
+    private String goodsNo;    //商品的货号
+
+    private Integer goodsNums;  //商品数量
+
+    private BigDecimal goodsWeight;  //重量
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	private Date orderTime; // 下单时间
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	private Date payTime; // 支付时间
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	private Date finishTime; // 到期时间
+	
+	private Date sendTime; // 发货时间
+	
+	
+	private String invTitle; // 发票抬头
+	private String taxationNo; // 税号
+	private String ltdAdd; // 公司地址
+	private String ltdTel; // 公司电话
+	private String openingBank; // 开户行
+	private String accountNumber; // 开户账号
+	private String invContent; // 开票内容
+	private String invMoney; // 开票金额
+	private String recipientName; // 收件人姓名
+	private String recipientTel; // 收件人电话
+	private String recipientAdd; // 收件地址
+	
+	private Integer addId; // 地址id
+	private String addrProvince;  //地址-省(中国)
+	private String addrCity;  //地址-市(中国)
+	private String addrArea;  //地址-区(中国)
+	private String postcode; //邮编
+
+	private String invType; // 类型区分[0-不开票;1-普票;2-增值税发票]
+	private String expressName; // 快递公司名(字典表维护,此处直接填名称)
+	private String expressNo; // 快递单号
+	private String ordStatus; // 订单状态[1-订单生成;2-已支付;3-取消订单(用户);4-退款;9-作废(系统)]
+	private String changeBy; // 订单状态修改者编号
+	private String orderSource; // 订单来源[ 1-PC, 2-微信 ]
+	private String userDel; // 用户删除标志[ 0-正常, 1-已删除 ]
+	
+	private String distributionStatus;   //配送状态 0:未发送,1:已发送,2:部分发送
+
+    private Short point;  //增加的积分
+
+    private String type;  //0会员套餐订单 1个人服务,2企业服务,3商品购买,4积分兑换
+
+    private String postscript;  //用户附言
+	
+	
+	// 优惠券
+	private Integer discountMoney;//抵扣金额
+	private String tcCode;//券类别码
+	private String tdCode;// 券详细码
+	
+	private String vipFlag;// vip标识
+	
+	private Date availableTo;		// 使用时间to
+	
+	public MdeOrders() {
+		super();
+	}
+	
+	public String getOrderId() {
+		return orderId;
+	}
+
+	public void setOrderId(String orderId) {
+		this.orderId = orderId;
+	}
+
+	// @NotNull(message="用户id不能为空")
+	public String getUserCode() {
+		return userCode;
+	}
+
+	public void setUserCode(String userCode) {
+		this.userCode = userCode;
+	}
+
+	// @Length(min=0, max=1, message="支付方式[1-微信;2-支付宝;3-线下汇款]长度必须介于 0 和 1 之间")
+	public String getPayType() {
+		return payType;
+	}
+
+	public void setPayType(String payType) {
+		this.payType = payType;
+	}
+
+	// @Length(min=0, max=50, message="第三方支付订单号长度必须介于 0 和 50 之间")
+	public String getThirdPartyOrd() {
+		return thirdPartyOrd;
+	}
+
+	public void setThirdPartyOrd(String thirdPartyOrd) {
+		this.thirdPartyOrd = thirdPartyOrd;
+	}
+
+	// @Length(min=1, max=11, message="套餐id(会员套餐表id)长度必须介于 1 和 11 之间")
+	public String getPkgId() {
+		return pkgId;
+	}
+
+	public void setPkgId(String pkgId) {
+		this.pkgId = pkgId;
+	}
+
+	// @Length(min=1, max=10, message="套餐标题长度必须介于 1 和 10 之间")
+	public String getPkgTitle() {
+		return pkgTitle;
+	}
+
+	public void setPkgTitle(String pkgTitle) {
+		this.pkgTitle = pkgTitle;
+	}
+
+	// @Length(min=1, max=50, message="套餐简介长度必须介于 1 和 50 之间")
+	public String getPkgIntroduction() {
+		return pkgIntroduction;
+	}
+
+	public void setPkgIntroduction(String pkgIntroduction) {
+		this.pkgIntroduction = pkgIntroduction;
+	}
+
+	// @Length(min=1, max=11, message="购买有效期长度必须介于 1 和 11 之间")
+	public String getValidityPeriod() {
+		return validityPeriod;
+	}
+
+	public void setValidityPeriod(String validityPeriod) {
+		this.validityPeriod = validityPeriod;
+	}
+
+	public String getPrice() {
+		return price;
+	}
+
+	public void setPrice(String price) {
+		this.price = price;
+	}
+
+	public String getRefundNo() {
+		return refundNo;
+	}
+
+	public void setRefundNo(String refundNo) {
+		this.refundNo = refundNo;
+	}
+
+	// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	// @NotNull(message="下单时间不能为空")
+	public Date getOrderTime() {
+		return orderTime;
+	}
+
+	public void setOrderTime(Date orderTime) {
+		this.orderTime = orderTime;
+	}
+
+	// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+	public Date getPayTime() {
+		return payTime;
+	}
+
+	public void setPayTime(Date payTime) {
+		this.payTime = payTime;
+	}
+
+	// @Length(min=0, max=50, message="发票抬头长度必须介于 0 和 50 之间")
+	public String getInvTitle() {
+		return invTitle;
+	}
+
+	public void setInvTitle(String invTitle) {
+		this.invTitle = invTitle;
+	}
+
+	// @Length(min=0, max=20, message="税号长度必须介于 0 和 20 之间")
+	public String getTaxationNo() {
+		return taxationNo;
+	}
+
+	public void setTaxationNo(String taxationNo) {
+		this.taxationNo = taxationNo;
+	}
+
+	// @Length(min=0, max=100, message="公司地址长度必须介于 0 和 100 之间")
+	public String getLtdAdd() {
+		return ltdAdd;
+	}
+
+	public void setLtdAdd(String ltdAdd) {
+		this.ltdAdd = ltdAdd;
+	}
+
+	// @Length(min=0, max=12, message="公司电话长度必须介于 0 和 12 之间")
+	public String getLtdTel() {
+		return ltdTel;
+	}
+
+	public void setLtdTel(String ltdTel) {
+		this.ltdTel = ltdTel;
+	}
+
+	// @Length(min=0, max=100, message="开户行长度必须介于 0 和 100 之间")
+	public String getOpeningBank() {
+		return openingBank;
+	}
+
+	public void setOpeningBank(String openingBank) {
+		this.openingBank = openingBank;
+	}
+
+	// @Length(min=0, max=25, message="开户账号长度必须介于 0 和 25 之间")
+	public String getAccountNumber() {
+		return accountNumber;
+	}
+
+	public void setAccountNumber(String accountNumber) {
+		this.accountNumber = accountNumber;
+	}
+
+	// @Length(min=0, max=50, message="开票内容长度必须介于 0 和 50 之间")
+	public String getInvContent() {
+		return invContent;
+	}
+
+	public void setInvContent(String invContent) {
+		this.invContent = invContent;
+	}
+
+	public String getInvMoney() {
+		return invMoney;
+	}
+
+	public void setInvMoney(String invMoney) {
+		this.invMoney = invMoney;
+	}
+
+	// @Length(min=0, max=50, message="收件人姓名长度必须介于 0 和 50 之间")
+	public String getRecipientName() {
+		return recipientName;
+	}
+
+	public void setRecipientName(String recipientName) {
+		this.recipientName = recipientName;
+	}
+
+	// @Length(min=0, max=12, message="收件人电话长度必须介于 0 和 12 之间")
+	public String getRecipientTel() {
+		return recipientTel;
+	}
+
+	public void setRecipientTel(String recipientTel) {
+		this.recipientTel = recipientTel;
+	}
+
+	// @Length(min=0, max=100, message="收件地址长度必须介于 0 和 100 之间")
+	public String getRecipientAdd() {
+		return recipientAdd;
+	}
+
+	public void setRecipientAdd(String recipientAdd) {
+		this.recipientAdd = recipientAdd;
+	}
+
+	// @Length(min=1, max=1, message="类型区分[0-不开票;1-普票;2-增值税发票]长度必须介于 1 和 1 之间")
+	public String getInvType() {
+		return invType;
+	}
+
+	public void setInvType(String invType) {
+		this.invType = invType;
+	}
+
+	// @Length(min=0, max=50, message="快递公司名(字典表维护,此处直接填名称)长度必须介于 0 和 50 之间")
+	public String getExpressName() {
+		return expressName;
+	}
+
+	public void setExpressName(String expressName) {
+		this.expressName = expressName;
+	}
+
+	// @Length(min=0, max=50, message="快递单号长度必须介于 0 和 50 之间")
+	public String getExpressNo() {
+		return expressNo;
+	}
+
+	public void setExpressNo(String expressNo) {
+		this.expressNo = expressNo;
+	}
+
+	// @Length(min=1, max=255,
+	// message="订单状态[1-订单生成;2-已支付;3-取消订单(用户);4-退款;9-作废(系统)]长度必须介于 1 和 255 之间")
+	public String getOrdStatus() {
+		return ordStatus;
+	}
+
+	public void setOrdStatus(String ordStatus) {
+		this.ordStatus = ordStatus;
+	}
+
+	// @Length(min=0, max=128, message="订单状态修改者编号长度必须介于 0 和 128 之间")
+	public String getChangeBy() {
+		return changeBy;
+	}
+
+	public void setChangeBy(String changeBy) {
+		this.changeBy = changeBy;
+	}
+
+	public String getOrderSource() {
+		return orderSource;
+	}
+
+	public void setOrderSource(String orderSource) {
+		this.orderSource = orderSource;
+	}
+
+	public String getUserDel() {
+		return userDel;
+	}
+
+	public void setUserDel(String userDel) {
+		this.userDel = userDel;
+	}
+
+	public Date getFinishTime() {
+		return finishTime;
+	}
+
+	public void setFinishTime(Date finishTime) {
+		this.finishTime = finishTime;
+	}
+
+	public String getPkgDetail() {
+		return pkgDetail;
+	}
+
+	public void setPkgDetail(String pkgDetail) {
+		this.pkgDetail = pkgDetail;
+	}
+
+	public String getPkgTitleEn() {
+		return pkgTitleEn;
+	}
+
+	public void setPkgTitleEn(String pkgTitleEn) {
+		this.pkgTitleEn = pkgTitleEn;
+	}
+
+	public String getPkgIntroductionEn() {
+		return pkgIntroductionEn;
+	}
+
+	public void setPkgIntroductionEn(String pkgIntroductionEn) {
+		this.pkgIntroductionEn = pkgIntroductionEn;
+	}
+
+	public String getPkgDetailEn() {
+		return pkgDetailEn;
+	}
+
+	public void setPkgDetailEn(String pkgDetailEn) {
+		this.pkgDetailEn = pkgDetailEn;
+	}
+
+	public Integer getDiscountMoney() {
+		return discountMoney;
+	}
+
+	public void setDiscountMoney(Integer discountMoney) {
+		this.discountMoney = discountMoney;
+	}
+
+	public String getTcCode() {
+		return tcCode;
+	}
+
+	public void setTcCode(String tcCode) {
+		this.tcCode = tcCode;
+	}
+
+	public String getTdCode() {
+		return tdCode;
+	}
+
+	public void setTdCode(String tdCode) {
+		this.tdCode = tdCode;
+	}
+
+	public String getVipFlag() {
+		return vipFlag;
+	}
+
+	public void setVipFlag(String vipFlag) {
+		this.vipFlag = vipFlag;
+	}
+
+	public Date getAvailableTo() {
+		return availableTo;
+	}
+
+	public void setAvailableTo(Date availableTo) {
+		this.availableTo = availableTo;
+	}
+
+	public String getSkuCn() {
+		return skuCn;
+	}
+
+	public void setSkuCn(String skuCn) {
+		this.skuCn = skuCn;
+	}
+
+	public String getSkuEn() {
+		return skuEn;
+	}
+
+	public void setSkuEn(String skuEn) {
+		this.skuEn = skuEn;
+	}
+
+	public Integer getGoodsId() {
+		return goodsId;
+	}
+
+	public void setGoodsId(Integer goodsId) {
+		this.goodsId = goodsId;
+	}
+
+	public String getImg() {
+		return img;
+	}
+
+	public void setImg(String img) {
+		this.img = img;
+	}
+
+	public String getSubheadCn() {
+		return subheadCn;
+	}
+
+	public void setSubheadCn(String subheadCn) {
+		this.subheadCn = subheadCn;
+	}
+
+	public String getSubheadEn() {
+		return subheadEn;
+	}
+
+	public void setSubheadEn(String subheadEn) {
+		this.subheadEn = subheadEn;
+	}
+
+	public BigDecimal getPayableFreight() {
+		return payableFreight;
+	}
+
+	public void setPayableFreight(BigDecimal payableFreight) {
+		this.payableFreight = payableFreight;
+	}
+
+	public BigDecimal getRealFreight() {
+		return realFreight;
+	}
+
+	public void setRealFreight(BigDecimal realFreight) {
+		this.realFreight = realFreight;
+	}
+
+	public String getGoodsNo() {
+		return goodsNo;
+	}
+
+	public void setGoodsNo(String goodsNo) {
+		this.goodsNo = goodsNo;
+	}
+
+	public Integer getGoodsNums() {
+		return goodsNums;
+	}
+
+	public void setGoodsNums(Integer goodsNums) {
+		this.goodsNums = goodsNums;
+	}
+
+	public BigDecimal getGoodsWeight() {
+		return goodsWeight;
+	}
+
+	public void setGoodsWeight(BigDecimal goodsWeight) {
+		this.goodsWeight = goodsWeight;
+	}
+
+	public BigDecimal getPayableMoney() {
+		return payableMoney;
+	}
+
+	public void setPayableMoney(BigDecimal payableMoney) {
+		this.payableMoney = payableMoney;
+	}
+	
+	public void setPayableMoney(String payableMoney) {
+		this.payableMoney = new BigDecimal(payableMoney);
+	}
+
+
+	public BigDecimal getPayPrice() {
+		return payPrice;
+	}
+
+	public void setPayPrice(BigDecimal payPrice) {
+		this.payPrice = payPrice;
+	}
+
+	public Date getSendTime() {
+		return sendTime;
+	}
+
+	public void setSendTime(Date sendTime) {
+		this.sendTime = sendTime;
+	}
+
+	public String getDistributionStatus() {
+		return distributionStatus;
+	}
+
+	public void setDistributionStatus(String distributionStatus) {
+		this.distributionStatus = distributionStatus;
+	}
+
+	public Short getPoint() {
+		return point;
+	}
+
+	public void setPoint(Short point) {
+		this.point = point;
+	}
+
+	public String getPostscript() {
+		return postscript;
+	}
+
+	public void setPostscript(String postscript) {
+		this.postscript = postscript;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getAddrProvince() {
+		return addrProvince;
+	}
+
+	public void setAddrProvince(String addrProvince) {
+		this.addrProvince = addrProvince;
+	}
+
+	public String getAddrCity() {
+		return addrCity;
+	}
+
+	public void setAddrCity(String addrCity) {
+		this.addrCity = addrCity;
+	}
+
+	public String getAddrArea() {
+		return addrArea;
+	}
+
+	public void setAddrArea(String addrArea) {
+		this.addrArea = addrArea;
+	}
+
+	public String getPostcode() {
+		return postcode;
+	}
+
+	public void setPostcode(String postcode) {
+		this.postcode = postcode;
+	}
+
+	public Integer getAddId() {
+		return addId;
+	}
+
+	public void setAddId(Integer addId) {
+		this.addId = addId;
+	}
+	
+}

+ 427 - 0
src/main/java/com/wechat/model/dbEntity/MdeUser.java

@@ -0,0 +1,427 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.model.dbEntity;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+ * 单表生成Entity
+ * 
+ * @author tangwc
+ * @version 2018-05-23
+ */
+public class MdeUser extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+	private String userCode;		// 用户code(自增)
+	private String unionId; // 微信unionId 不同公众号下 unionId相同
+	private String openId; // 微信openid
+	private String linkedinId;		// 领英账号
+	private String userName;		// 登录名[手机号-个人/邮箱-企业](全局唯一)
+	private String phoneCode;		// 国际手机区号
+	private String password;		// 密码(手机号+密码 混合md5加密)
+	private String name;		// 用户姓名(个人)/企业名称(企业)
+	private String hotelBrand;		// 从业酒店品牌code(酒店品牌信息表)
+	private String hotelBrandStr;		// 从业酒店品牌名称(品牌信息表中不存在的情况下,用户自由填写)
+	private String entContacts;		// 企业联系人
+	private String entPhone;		// 企业联系电话
+	private String headPortrait;		// 头像(存放头像相对存放地址)
+	private String email;		// 邮箱地址(个人用户)
+//	private String addrCountry;		// 地址-国家/地区[三位字母代码(ISO 3166-1 alpha-3)]
+	private String addrProvince;		// 地址-省(中国)
+	private String addrCity;		// 地址-市(中国)
+	private String addrArea;		// 地址-区(中国)
+	private String addrZipcode;		// 地址-邮编(其他国家)
+	private String image;		// 名片(个人)/营业执照(企业)
+	private String identityFlag;		// 身份标识[0-个人;1-企业]
+	private String vipFlag;		// 会员标识[0-非会员;1-会员]
+	private Date dueDate;		// 会员到期时间
+	private String allowFlag;		// 登录开关[0-可登录;1-不可登录]
+	private String careAbout;		// 关注的企业(用户id,逗号分隔)
+	private Long fansCount;		// 粉丝数
+	private String likeList;		// 点赞过的资讯id(以逗号分隔)
+	private String shareList;		// 分享的资讯id(以逗号分隔)
+	private String positionList;		// 收藏的职位id(以逗号分隔)
+	private String positionTitle;		// 当前职位头衔
+	private String checkStatus;		// 审核状态
+	private String checkRemarks;		// 审核内容
+	private String onJobImage;   //在职证明
+	private String birthday;//生日
+
+	private double experience;// 行业经验
+	private String addDetail;// 工作地点详细地址
+	private double addLongitude;// 工作地点-经度
+	private double addLatitude;// 工作地点-纬度
+	private String website;// 企业官网
+	private String workStatus;// 工作状态(字典表维护)[0-无跳槽打算;1-在职-到岗时间待定;2-在职-到岗时间1月左右;3-离职]
+	private String international;// 国际区分[1-国际;2-国内;9-未知]
+	
+	private String address;
+	public MdeUser() {
+		super();
+	}
+
+	// @Length(min=1, max=11, message="用户code(自增)长度必须介于 1 和 11 之间")
+	public String getUserCode() {
+		return userCode;
+	}
+
+	public void setUserCode(String userCode) {
+		this.userCode = userCode;
+	}
+
+	// @Length(min=0, max=40, message="微信openid长度必须介于 0 和 40 之间")
+	public String getOpenId() {
+		return openId;
+	}
+
+	public void setOpenId(String openId) {
+		this.openId = openId;
+	}
+
+	// @Length(min=0, max=40, message="领英账号长度必须介于 0 和 40 之间")
+	public String getLinkedinId() {
+		return linkedinId;
+	}
+
+	public void setLinkedinId(String linkedinId) {
+		this.linkedinId = linkedinId;
+	}
+
+	// @Length(min=1, max=100, message="登录名[手机号-个人/邮箱-企业](全局唯一)长度必须介于 1 和 100 之间")
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	// @Length(min=1, max=255, message="密码(手机号+密码 混合md5加密)长度必须介于 1 和 255 之间")
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	// @Length(min=1, max=100, message="用户姓名(个人)/企业名称(企业)长度必须介于 1 和 100 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	// @Length(min=1, max=100, message="从业酒店品牌code(酒店品牌信息表)长度必须介于 1 和 100 之间")
+	public String getHotelBrand() {
+		return hotelBrand;
+	}
+
+	public void setHotelBrand(String hotelBrand) {
+		this.hotelBrand = hotelBrand;
+	}
+
+	// @Length(min=0, max=100, message="从业酒店品牌名称(品牌信息表中不存在的情况下,用户自由填写)长度必须介于 0 和 100
+	// 之间")
+	public String getHotelBrandStr() {
+		return hotelBrandStr;
+	}
+
+	public void setHotelBrandStr(String hotelBrandStr) {
+		this.hotelBrandStr = hotelBrandStr;
+	}
+
+	// @Length(min=0, max=50, message="企业联系人长度必须介于 0 和 50 之间")
+	public String getEntContacts() {
+		return entContacts;
+	}
+
+	public void setEntContacts(String entContacts) {
+		this.entContacts = entContacts;
+	}
+
+	// @Length(min=0, max=50, message="企业联系电话长度必须介于 0 和 50 之间")
+	public String getEntPhone() {
+		return entPhone;
+	}
+
+	public void setEntPhone(String entPhone) {
+		this.entPhone = entPhone;
+	}
+
+	// @Length(min=0, max=255, message="头像(存放头像相对存放地址)长度必须介于 0 和 255 之间")
+	public String getHeadPortrait() {
+		return headPortrait;
+	}
+
+	public void setHeadPortrait(String headPortrait) {
+		this.headPortrait = headPortrait;
+	}
+
+	// @Length(min=0, max=100, message="邮箱地址(个人用户)长度必须介于 0 和 100 之间")
+	public String getEmail() {
+		return email;
+	}
+
+	public void setEmail(String email) {
+		this.email = email;
+	}
+
+	// @Length(min=1, max=3, message="地址-国家/地区[三位字母代码(ISO 3166-1 alpha-3)]长度必须介于 1 和
+	// 3 之间")
+	// public String getAddrCountry() {
+	// return addrCountry;
+	// }
+	//
+	// public void setAddrCountry(String addrCountry) {
+	// this.addrCountry = addrCountry;
+	// }
+
+	// @Length(min=0, max=6, message="地址-省(中国)长度必须介于 0 和 6 之间")
+	public String getAddrProvince() {
+		return addrProvince;
+	}
+
+	public void setAddrProvince(String addrProvince) {
+		this.addrProvince = addrProvince;
+	}
+
+	// @Length(min=0, max=6, message="地址-市(中国)长度必须介于 0 和 6 之间")
+	public String getAddrCity() {
+		return addrCity;
+	}
+
+	public void setAddrCity(String addrCity) {
+		this.addrCity = addrCity;
+	}
+
+	// @Length(min=0, max=6, message="地址-区(中国)长度必须介于 0 和 6 之间")
+	public String getAddrArea() {
+		return addrArea;
+	}
+
+	public void setAddrArea(String addrArea) {
+		this.addrArea = addrArea;
+	}
+
+	// @Length(min=0, max=10, message="地址-邮编(其他国家)长度必须介于 0 和 10 之间")
+	public String getAddrZipcode() {
+		return addrZipcode;
+	}
+
+	public void setAddrZipcode(String addrZipcode) {
+		this.addrZipcode = addrZipcode;
+	}
+
+	// @Length(min=0, max=255, message="名片(个人)/营业执照(企业)长度必须介于 0 和 255 之间")
+	public String getImage() {
+		return image;
+	}
+
+	public void setImage(String image) {
+		this.image = image;
+	}
+
+	// @Length(min=0, max=1, message="身份标识[0-个人;1-企业]长度必须介于 0 和 1 之间")
+	public String getIdentityFlag() {
+		return identityFlag;
+	}
+
+	public void setIdentityFlag(String identityFlag) {
+		this.identityFlag = identityFlag;
+	}
+
+	// @Length(min=1, max=1, message="会员标识[0-非会员;1-会员]长度必须介于 1 和 1 之间")
+	public String getVipFlag() {
+		return vipFlag;
+	}
+
+	public void setVipFlag(String vipFlag) {
+		this.vipFlag = vipFlag;
+	}
+
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getDueDate() {
+		return dueDate;
+	}
+
+	public void setDueDate(Date dueDate) {
+		this.dueDate = dueDate;
+	}
+
+	// @Length(min=1, max=1, message="登录开关[0-可登录;1-不可登录]长度必须介于 1 和 1 之间")
+	public String getAllowFlag() {
+		return allowFlag;
+	}
+
+	public void setAllowFlag(String allowFlag) {
+		this.allowFlag = allowFlag;
+	}
+
+	public String getCareAbout() {
+		return careAbout;
+	}
+
+	public void setCareAbout(String careAbout) {
+		this.careAbout = careAbout;
+	}
+
+	// @NotNull(message="粉丝数不能为空")
+	public Long getFansCount() {
+		return fansCount;
+	}
+
+	public void setFansCount(Long fansCount) {
+		this.fansCount = fansCount;
+	}
+
+	public String getLikeList() {
+		return likeList;
+	}
+
+	public void setLikeList(String likeList) {
+		this.likeList = likeList;
+	}
+
+	public String getShareList() {
+		return shareList;
+	}
+
+	public void setShareList(String shareList) {
+		this.shareList = shareList;
+	}
+
+	public String getPositionList() {
+		return positionList;
+	}
+
+	public void setPositionList(String positionList) {
+		this.positionList = positionList;
+	}
+
+	public String getPositionTitle() {
+		return positionTitle;
+	}
+
+	public void setPositionTitle(String positionTitle) {
+		this.positionTitle = positionTitle;
+	}
+
+	public String getBirthday() {
+		return birthday;
+	}
+
+	public void setBirthday(String birthday) {
+		this.birthday = birthday;
+	}
+
+	public double getExperience() {
+		return experience;
+	}
+
+	public void setExperience(double experience) {
+		this.experience = experience;
+	}
+
+	public String getAddDetail() {
+		return addDetail;
+	}
+
+	public void setAddDetail(String addDetail) {
+		this.addDetail = addDetail;
+	}
+
+	public double getAddLongitude() {
+		return addLongitude;
+	}
+
+	public void setAddLongitude(double addLongitude) {
+		this.addLongitude = addLongitude;
+	}
+
+	public double getAddLatitude() {
+		return addLatitude;
+	}
+
+	public void setAddLatitude(double addLatitude) {
+		this.addLatitude = addLatitude;
+	}
+
+	public String getWebsite() {
+		return website;
+	}
+
+	public void setWebsite(String website) {
+		this.website = website;
+	}
+
+	public String getWorkStatus() {
+		return workStatus;
+	}
+
+	public void setWorkStatus(String workStatus) {
+		this.workStatus = workStatus;
+	}
+
+	public String getInternational() {
+		return international;
+	}
+
+	public void setInternational(String international) {
+		this.international = international;
+	}
+
+	public String getCheckStatus() {
+		return checkStatus;
+	}
+
+	public void setCheckStatus(String checkStatus) {
+		this.checkStatus = checkStatus;
+	}
+
+	public String getCheckRemarks() {
+		return checkRemarks;
+	}
+
+	public void setCheckRemarks(String checkRemarks) {
+		this.checkRemarks = checkRemarks;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+	public String getOnJobImage() {
+		return onJobImage;
+	}
+
+	public void setOnJobImage(String onJobImage) {
+		this.onJobImage = onJobImage;
+	}
+
+	public String getUnionId() {
+		return unionId;
+	}
+
+	public void setUnionId(String unionId) {
+		this.unionId = unionId;
+	}
+	
+	public String getPhoneCode() {
+		return phoneCode;
+	}
+
+	public void setPhoneCode(String phoneCode) {
+		this.phoneCode = phoneCode;
+	}
+}

+ 31 - 0
src/main/java/com/wechat/model/dto/AccessTokenDto.java

@@ -0,0 +1,31 @@
+package com.wechat.model.dto;
+
+import java.io.Serializable;
+
+public class AccessTokenDto implements Serializable {
+
+    private static final long serialVersionUID = -1384532631420562923L;
+
+    //accesstoken
+    private String            accessToken;
+
+    //expire
+    private String            expire;
+
+    public String getAccessToken() {
+        return accessToken;
+    }
+
+    public void setAccessToken(String accessToken) {
+        this.accessToken = accessToken;
+    }
+
+    public String getExpire() {
+        return expire;
+    }
+
+    public void setExpire(String expire) {
+        this.expire = expire;
+    }
+
+}

+ 44 - 0
src/main/java/com/wechat/model/dto/AdvertisedAtTimeDto.java

@@ -0,0 +1,44 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.model.dto;
+
+import java.util.List;
+
+/**
+ * @author jadyn.wu
+ * @date: 2020-03-26 15:09
+ */
+public class AdvertisedAtTimeDto {
+	
+	private String userName;// 联系方式
+	private String hotel;// 酒店名称
+	private List<String> jobList;		
+	private List<String> nameList;
+	
+	public String getUserName() {
+		return userName;
+	}
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	public List<String> getJobList() {
+		return jobList;
+	}
+	public void setJobList(List<String> jobList) {
+		this.jobList = jobList;
+	}
+	public List<String> getNameList() {
+		return nameList;
+	}
+	public void setNameList(List<String> nameList) {
+		this.nameList = nameList;
+	}
+	public String getHotel() {
+		return hotel;
+	}
+	public void setHotel(String hotel) {
+		this.hotel = hotel;
+	}		
+
+}

+ 44 - 0
src/main/java/com/wechat/model/dto/AskUserInfoDto.java

@@ -0,0 +1,44 @@
+package com.wechat.model.dto;
+
+/**
+ * 单表生成Entity
+ * @author jadyn.wu
+ * @version 20190521
+ */
+public class AskUserInfoDto {
+
+	private String askName;		 // 请求人姓名
+	private String identityFlag; // 个人区分
+	private String coName;		 // 就职企业名
+	private String positionTitle;	// 职位title
+	
+	
+	public String getAskName() {
+		return askName;
+	}
+	public void setAskName(String askName) {
+		this.askName = askName;
+	}
+	public String getIdentityFlag() {
+		return identityFlag;
+	}
+	public void setIdentityFlag(String identityFlag) {
+		this.identityFlag = identityFlag;
+	}
+	public String getCoName() {
+		return coName;
+	}
+	public void setCoName(String coName) {
+		this.coName = coName;
+	}
+	public String getPositionTitle() {
+		return positionTitle;
+	}
+	public void setPositionTitle(String positionTitle) {
+		this.positionTitle = positionTitle;
+	}
+
+
+	
+	
+}

+ 80 - 0
src/main/java/com/wechat/model/dto/AskUsersDto.java

@@ -0,0 +1,80 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.model.dto;
+
+/**
+ *  单表生成Entity
+ * @author jadyn.wu
+ * @version 20190521
+ */
+public class AskUsersDto {
+	
+	private String askUserCode;		// 发起者(用户id)
+	private String openid;		
+	private String name;	// 待确认者姓名	
+	private String phoneCode;		
+	private String entContacts;		
+	private String entPhone;
+	private String identityFlag; //身份标识
+	private String userName;// 联系方式
+	
+
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getIdentityFlag() {
+		return identityFlag;
+	}
+	public void setIdentityFlag(String identityFlag) {
+		this.identityFlag = identityFlag;
+	}
+	public String getUserName() {
+		return userName;
+	}
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	
+	public String getOpenid() {
+		return openid;
+	}
+
+	public String getPhoneCode() {
+		return phoneCode;
+	}
+	public void setPhoneCode(String phoneCode) {
+		this.phoneCode = phoneCode;
+	}
+	public String getEntContacts() {
+		return entContacts;
+	}
+	public void setEntContacts(String entContacts) {
+		this.entContacts = entContacts;
+	}
+	public String getEntPhone() {
+		return entPhone;
+	}
+	public void setEntPhone(String entPhone) {
+		this.entPhone = entPhone;
+	}
+	public void setOpenid(String openid) {
+		this.openid = openid;
+	}
+	/**
+	 * @return the askUserCode
+	 */
+	public String getAskUserCode() {
+		return askUserCode;
+	}
+	/**
+	 * @param askUserCode the askUserCode to set
+	 */
+	public void setAskUserCode(String askUserCode) {
+		this.askUserCode = askUserCode;
+	}
+
+}

+ 49 - 0
src/main/java/com/wechat/model/dto/ConfirmedUsersInfoDto.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.model.dto;
+
+/**
+ *  单表生成Entity
+ * @author jadyn.wu
+ * @version 20190521
+ */
+public class ConfirmedUsersInfoDto {
+	
+	private String confirmedName;		 // 接受请求人姓名
+	private String identityFlag; // 个人区分
+	private String coName;		 // 就职企业名
+	private String positionTitle;	// 职位title
+	
+	
+	public String getIdentityFlag() {
+		return identityFlag;
+	}
+	public void setIdentityFlag(String identityFlag) {
+		this.identityFlag = identityFlag;
+	}
+	public String getCoName() {
+		return coName;
+	}
+	public void setCoName(String coName) {
+		this.coName = coName;
+	}
+	public String getPositionTitle() {
+		return positionTitle;
+	}
+	public void setPositionTitle(String positionTitle) {
+		this.positionTitle = positionTitle;
+	}
+	/**
+	 * @return the confirmedName
+	 */
+	public String getConfirmedName() {
+		return confirmedName;
+	}
+	/**
+	 * @param confirmedName the confirmedName to set
+	 */
+	public void setConfirmedName(String confirmedName) {
+		this.confirmedName = confirmedName;
+	}
+}

+ 27 - 0
src/main/java/com/wechat/model/dto/DateFromToDto.java

@@ -0,0 +1,27 @@
+package com.wechat.model.dto;
+
+import java.util.Date;
+
+public class DateFromToDto  {
+
+    private Date dateFrom;
+
+    private Date dateTo;
+
+	public Date getDateFrom() {
+		return dateFrom;
+	}
+
+	public void setDateFrom(Date dateFrom) {
+		this.dateFrom = dateFrom;
+	}
+
+	public Date getDateTo() {
+		return dateTo;
+	}
+
+	public void setDateTo(Date dateTo) {
+		this.dateTo = dateTo;
+	}
+
+}

+ 35 - 0
src/main/java/com/wechat/model/dto/JsapiTicketDto.java

@@ -0,0 +1,35 @@
+package com.wechat.model.dto;
+
+import java.io.Serializable;
+
+public class JsapiTicketDto implements Serializable {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -6698231996919239956L;
+
+    //jsapiTicket
+    private String            jsapiTicket;
+
+    //expire
+    private String            expire;
+
+
+    public String getExpire() {
+        return expire;
+    }
+
+    public void setExpire(String expire) {
+        this.expire = expire;
+    }
+
+    public String getJsapiTicket() {
+        return jsapiTicket;
+    }
+
+    public void setJsapiTicket(String jsapiTicket) {
+        this.jsapiTicket = jsapiTicket;
+    }
+
+}

+ 60 - 0
src/main/java/com/wechat/model/dto/SubedPositionInfoDto.java

@@ -0,0 +1,60 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.model.dto;
+
+import java.util.Date;
+
+/**
+ * @author jadyn.wu
+ * @date: 2021-01-25 15:09
+ */
+public class SubedPositionInfoDto {
+	
+	private int jobId;
+	private String jobName;
+	private String addProvinceName;
+	private String addCityName;
+	private String hotelName;
+	private Date createDate;
+	
+	public int getJobId() {
+		return jobId;
+	}
+	public void setJobId(int jobId) {
+		this.jobId = jobId;
+	}
+	public String getJobName() {
+		return jobName;
+	}
+	public void setJobName(String jobName) {
+		this.jobName = jobName;
+	}
+	public String getAddProvinceName() {
+		return addProvinceName;
+	}
+	public void setAddProvinceName(String addProvinceName) {
+		this.addProvinceName = addProvinceName;
+	}
+	public String getAddCityName() {
+		return addCityName;
+	}
+	public void setAddCityName(String addCityName) {
+		this.addCityName = addCityName;
+	}
+	public String getHotelName() {
+		return hotelName;
+	}
+	public void setHotelName(String hotelName) {
+		this.hotelName = hotelName;
+	}
+	public Date getCreateDate() {
+		return createDate;
+	}
+	public void setCreateDate(Date createDate) {
+		this.createDate = createDate;
+	}
+
+	
+	
+}

+ 73 - 0
src/main/java/com/wechat/model/dto/ToBeConfirmedUsersDto.java

@@ -0,0 +1,73 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.model.dto;
+
+/**
+ *  单表生成Entity
+ * @author jadyn.wu
+ * @version 20190521
+ */
+public class ToBeConfirmedUsersDto {
+	
+	private String toBeConfirmed;		// 待确认者(用户id)
+	private String openid;		
+	private String name;	// 待确认者姓名	
+	private String phoneCode;		
+	private String entContacts;		
+	private String entPhone;
+	private String identityFlag; //身份标识
+	private String userName;// 联系方式
+	
+	public String getToBeConfirmed() {
+		return toBeConfirmed;
+	}
+	public void setToBeConfirmed(String toBeConfirmed) {
+		this.toBeConfirmed = toBeConfirmed;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getIdentityFlag() {
+		return identityFlag;
+	}
+	public void setIdentityFlag(String identityFlag) {
+		this.identityFlag = identityFlag;
+	}
+	public String getUserName() {
+		return userName;
+	}
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	
+	public String getOpenid() {
+		return openid;
+	}
+
+	public String getPhoneCode() {
+		return phoneCode;
+	}
+	public void setPhoneCode(String phoneCode) {
+		this.phoneCode = phoneCode;
+	}
+	public String getEntContacts() {
+		return entContacts;
+	}
+	public void setEntContacts(String entContacts) {
+		this.entContacts = entContacts;
+	}
+	public String getEntPhone() {
+		return entPhone;
+	}
+	public void setEntPhone(String entPhone) {
+		this.entPhone = entPhone;
+	}
+	public void setOpenid(String openid) {
+		this.openid = openid;
+	}
+
+}

+ 39 - 0
src/main/java/com/wechat/model/dto/UserSimple.java

@@ -0,0 +1,39 @@
+package com.wechat.model.dto;
+
+import java.io.Serializable;
+
+public class UserSimple implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private String userCode;
+	private String headPortrait;
+	private String name;
+	private String date;
+	public String getUserCode() {
+		return userCode;
+	}
+	public void setUserCode(String userCode) {
+		this.userCode = userCode;
+	}
+	public String getHeadPortrait() {
+		return headPortrait;
+	}
+	public void setHeadPortrait(String headPortrait) {
+		this.headPortrait = headPortrait;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getDate() {
+		return date;
+	}
+	public void setDate(String date) {
+		this.date = date;
+	}
+	
+}

+ 59 - 0
src/main/java/com/wechat/model/dto/UserSubedInfoDto.java

@@ -0,0 +1,59 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.wechat.model.dto;
+
+import java.util.List;
+
+/**
+ * @author jadyn.wu
+ * @date: 2021-01-26 11:45
+ */
+public class UserSubedInfoDto extends DateFromToDto{
+	
+	private String userCode;
+	private String name;
+	private String openId;
+	private String unionid;
+	private List<String> intdCityList;
+	private List<String> prepareFlagList;
+	
+	public String getUserCode() {
+		return userCode;
+	}
+	public void setUserCode(String userCode) {
+		this.userCode = userCode;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getOpenId() {
+		return openId;
+	}
+	public void setOpenId(String openId) {
+		this.openId = openId;
+	}
+	public String getUnionid() {
+		return unionid;
+	}
+	public void setUnionid(String unionid) {
+		this.unionid = unionid;
+	}
+	public List<String> getIntdCityList() {
+		return intdCityList;
+	}
+	public void setIntdCityList(List<String> intdCityList) {
+		this.intdCityList = intdCityList;
+	}
+	public List<String> getPrepareFlagList() {
+		return prepareFlagList;
+	}
+	public void setPrepareFlagList(List<String> prepareFlagList) {
+		this.prepareFlagList = prepareFlagList;
+	}
+ 
+
+}

+ 55 - 0
src/main/java/com/wechat/model/dto/WsdlResponseDto.java

@@ -0,0 +1,55 @@
+package com.wechat.model.dto;
+
+/**
+ * 下拉框列表Dto
+ * 
+ * @author zhangyj
+ * @version 2016-10-18
+ */
+public class WsdlResponseDto {
+
+    /**
+     * 返回总记录条数
+     */
+    private String count;
+    
+    /**
+     * 响应码
+     */
+    private String resCode;
+    
+    
+    /**
+     * 具体的返回值
+     */
+    private WsdlResponseInfoDto info;
+    
+  
+    public WsdlResponseInfoDto getInfo() {
+        return info;
+    }
+
+    public void setInfo(WsdlResponseInfoDto info) {
+        this.info = info;
+    }
+
+    public String getCount() {
+        return count;
+    }
+
+    public void setCount(String count) {
+        this.count = count;
+    }
+
+    public String getResCode() {
+        return resCode;
+    }
+
+    public void setResCode(String resCode) {
+        this.resCode = resCode;
+    }
+
+
+	
+
+}

+ 100 - 0
src/main/java/com/wechat/model/dto/WsdlResponseInfoDto.java

@@ -0,0 +1,100 @@
+package com.wechat.model.dto;
+
+/**
+ * 下拉框列表Dto
+ * 
+ */
+public class WsdlResponseInfoDto {
+    /**
+     * 性别
+     */
+    private String XB;
+    
+    /**
+     * 母亲身份证号
+     */
+    private String MQSFZH;
+
+    /**
+     * 父亲身份证号
+     */
+    private String FQSFZH;
+    
+    /**
+     * 母亲姓名
+     */
+    private String MQXM;
+    
+    /**
+     * 父亲姓名
+     */
+    private String FQXM;
+    
+    /**
+     * 出生日期
+     */
+    private String CSRQ;
+    
+    /**
+     * 姓名
+     */
+    private String XM;
+
+    
+	public String getXB() {
+        return XB;
+    }
+
+    public void setXB(String xB) {
+        XB = xB;
+    }
+
+    public String getMQSFZH() {
+        return MQSFZH;
+    }
+
+    public void setMQSFZH(String mQSFZH) {
+        MQSFZH = mQSFZH;
+    }
+
+    public String getFQSFZH() {
+        return FQSFZH;
+    }
+
+    public void setFQSFZH(String fQSFZH) {
+        FQSFZH = fQSFZH;
+    }
+
+    public String getMQXM() {
+        return MQXM;
+    }
+
+    public void setMQXM(String mQXM) {
+        MQXM = mQXM;
+    }
+
+    public String getFQXM() {
+        return FQXM;
+    }
+
+    public void setFQXM(String fQXM) {
+        FQXM = fQXM;
+    }
+
+    public String getCSRQ() {
+        return CSRQ;
+    }
+
+    public void setCSRQ(String cSRQ) {
+        CSRQ = cSRQ;
+    }
+    
+    public String getXM() {
+        return XM;
+    }
+
+    public void setXM(String xM) {
+        XM = xM;
+    }
+
+}

+ 55 - 0
src/main/java/com/wechat/model/dto/WsdlResponseStudentDto.java

@@ -0,0 +1,55 @@
+package com.wechat.model.dto;
+
+/**
+ * 下拉框列表Dto
+ * 
+ * @author zhangyj
+ * @version 2016-10-18
+ */
+public class WsdlResponseStudentDto {
+
+    /**
+     * 返回总记录条数
+     */
+    private String count;
+    
+    /**
+     * 响应码
+     */
+    private String resCode;
+    
+    
+    /**
+     * 具体的返回值
+     */
+    private WsdlResponseStudentInfoDto info;
+    
+  
+    public WsdlResponseStudentInfoDto getInfo() {
+        return info;
+    }
+
+    public void setInfo(WsdlResponseStudentInfoDto info) {
+        this.info = info;
+    }
+
+    public String getCount() {
+        return count;
+    }
+
+    public void setCount(String count) {
+        this.count = count;
+    }
+
+    public String getResCode() {
+        return resCode;
+    }
+
+    public void setResCode(String resCode) {
+        this.resCode = resCode;
+    }
+
+
+	
+
+}

+ 142 - 0
src/main/java/com/wechat/model/dto/WsdlResponseStudentInfoDto.java

@@ -0,0 +1,142 @@
+package com.wechat.model.dto;
+
+/**
+ * 下拉框列表Dto
+ * 
+ * @author zhangyj
+ * @version 2016-10-18
+ */
+public class WsdlResponseStudentInfoDto {
+    /**
+     * 性别
+     */
+    private String XB;
+    
+    /**
+     * 户号
+     */
+    private String HH;
+    
+    /**
+     * 与户主关系
+     */
+    private String YHZGX;
+    
+    /**
+     * 民族
+     */
+    private String MZ;
+    
+    /**
+     * 派出所
+     */
+    private String PCS;
+    
+    /**
+     * 身份号码
+     */
+    private String SFHM;
+    
+    /**
+     * 所属区县
+     */
+    private String SSXQ;
+
+    /**
+     * 街道
+     */
+    private String JD;
+    
+    /**
+     * 现住址
+     */
+    private String XZZ;
+    
+    /**
+     * 姓名
+     */
+    private String XM;
+    
+
+    
+    public String getXB() {
+        return XB;
+    }
+
+    public void setXB(String xB) {
+        XB = xB;
+    }
+
+    public String getHH() {
+        return HH;
+    }
+
+    public void setHH(String hH) {
+        HH = hH;
+    }
+
+    public String getYHZGX() {
+        return YHZGX;
+    }
+
+    public void setYHZGX(String yHZGX) {
+        YHZGX = yHZGX;
+    }
+
+    public String getMZ() {
+        return MZ;
+    }
+
+    public void setMZ(String mZ) {
+        MZ = mZ;
+    }
+
+    public String getPCS() {
+        return PCS;
+    }
+
+    public void setPCS(String pCS) {
+        PCS = pCS;
+    }
+
+    public String getSFHM() {
+        return SFHM;
+    }
+
+    public void setSFHM(String sFHM) {
+        SFHM = sFHM;
+    }
+
+    public String getSSXQ() {
+        return SSXQ;
+    }
+
+    public void setSSXQ(String sSXQ) {
+        SSXQ = sSXQ;
+    }
+
+    public String getJD() {
+        return JD;
+    }
+
+    public void setJD(String jD) {
+        JD = jD;
+    }
+
+    public String getXZZ() {
+        return XZZ;
+    }
+
+    public void setXZZ(String xZZ) {
+        XZZ = xZZ;
+    }
+
+    public String getXM() {
+        return XM;
+    }
+
+    public void setXM(String xM) {
+        XM = xM;
+    }
+
+}

+ 19 - 0
src/main/java/com/wechat/model/dto/WxShortUrlDto.java

@@ -0,0 +1,19 @@
+package com.wechat.model.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.wechat.activerequests.responses.BaseResponse;
+
+public class WxShortUrlDto extends BaseResponse{
+
+    @JsonProperty("short_url")
+    private String            shortUrl;
+
+	public String getShortUrl() {
+		return shortUrl;
+	}
+
+	public void setShortUrl(String shortUrl) {
+		this.shortUrl = shortUrl;
+	}
+
+}

+ 200 - 0
src/main/java/com/wechat/model/dto/WxUserInfoDto.java

@@ -0,0 +1,200 @@
+package com.wechat.model.dto;
+
+import com.wechat.activerequests.responses.BaseResponse;
+import com.wechat.common.Constants;
+import com.wechat.common.utils.StringsUtils;
+
+import antlr.StringUtils;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class WxUserInfoDto extends BaseResponse{
+
+    //用户是否订阅该公众号标识,值为0时,代表此用户没有关注该公众号,拉取不到其余信息。
+    @JsonProperty("subscribe")
+    private String            subscribe;
+
+	//openid
+    @JsonProperty("openid")
+    private String            openid;
+
+    //用户昵称
+    @JsonProperty("nickname")
+    private String            nickname;
+
+    //用户的性别,值为1时是男性,值为2时是女性,值为0时是未知
+    @JsonProperty("sex")
+    private String            sex;
+
+    //普通用户个人资料填写的城市
+    @JsonProperty("city")
+    private String            city;
+
+    //国家,如中国为CN
+    @JsonProperty("country")
+    private String            country;
+    
+    //用户个人资料填写的省份
+    @JsonProperty("province")
+    private String            province;
+    
+    //用户个人资料填写的省份
+    @JsonProperty("language")
+    private String            language;
+
+    //用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空。若用户更换头像,原有头像URL将失效。
+    @JsonProperty("headimgurl")
+    private String            headimgurl;
+    
+    //用户关注时间,为时间戳。如果用户曾多次关注,则取最后关注时间
+    @JsonProperty("subscribe_time")
+    private String            subscribeTime;
+    
+    //只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段
+    @JsonProperty("unionid")
+    private String            unionid;
+    
+    //公众号运营者对粉丝的备注,公众号运营者可在微信公众平台用户管理界面对粉丝添加备注
+    @JsonProperty("remark")
+    private String           remark;
+    
+    //用户所在的分组ID(兼容旧的用户分组接口)
+    @JsonProperty("groupid")
+    private String           groupid;
+    
+    //用户被打上的标签ID列表
+    @JsonProperty("tagid_list")
+    private String[]           tagidList;
+
+	
+	public WxUserInfoDto()
+	{
+		subscribe = Constants.EMPTY;
+		openid = Constants.EMPTY;
+		nickname = Constants.EMPTY;
+		sex = Constants.EMPTY;
+		city = Constants.EMPTY;
+		country = Constants.EMPTY;
+		province = Constants.EMPTY;
+		language = Constants.EMPTY;
+		headimgurl = Constants.EMPTY;
+		subscribeTime = Constants.EMPTY;
+		unionid = Constants.EMPTY;
+		remark = Constants.EMPTY;
+		groupid = Constants.EMPTY;
+	}
+
+    public String getOpenid() {
+        return openid;
+    }
+
+    public void setOpenid(String openid) {
+        this.openid = openid;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getCountry() {
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    public String getHeadimgurl() {
+        return headimgurl;
+    }
+
+    public void setHeadimgurl(String headimgurl) {
+        this.headimgurl = headimgurl;
+    }
+
+
+    public String getUnionid() {
+        return unionid;
+    }
+
+    public void setUnionid(String unionid) {
+        this.unionid = unionid;
+    }
+
+    public String getLanguage() {
+        return language;
+    }
+
+    public void setLanguage(String language) {
+        this.language = language;
+    }
+    
+    public String getSubscribe() {
+		return subscribe;
+	}
+
+	public void setSubscribe(String subscribe) {
+		this.subscribe = subscribe;
+	}
+
+	public String getSubscribeTime() {
+		return subscribeTime;
+	}
+
+	public void setSubscribeTime(String subscribeTime) {
+		this.subscribeTime = subscribeTime;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getGroupid() {
+		return groupid;
+	}
+
+	public void setGroupid(String groupid) {
+		this.groupid = groupid;
+	}
+
+	public String[] getTagidList() {
+		return tagidList;
+	}
+
+	public void setTagidList(String[] tagidList) {
+		this.tagidList = tagidList;
+	}
+
+}

+ 26 - 0
src/main/java/com/wechat/model/requestDto/GroupInfoReq.java

@@ -0,0 +1,26 @@
+package com.wechat.model.requestDto;
+
+import java.math.BigDecimal;
+
+public class GroupInfoReq {
+
+	private BigDecimal discountPrice;
+	private String groupTitle;
+
+	public BigDecimal getDiscountPrice() {
+		return discountPrice;
+	}
+
+	public void setDiscountPrice(BigDecimal discountPrice) {
+		this.discountPrice = discountPrice;
+	}
+
+	public String getGroupTitle() {
+		return groupTitle;
+	}
+
+	public void setGroupTitle(String groupTitle) {
+		this.groupTitle = groupTitle;
+	}
+
+}

+ 25 - 0
src/main/java/com/wechat/model/requestDto/TMsg2ParamsDto.java

@@ -0,0 +1,25 @@
+package com.wechat.model.requestDto;
+
+public class TMsg2ParamsDto extends TMsgBaseDto{
+
+	private TMsgValueReq keyword1;
+
+	private TMsgValueReq keyword2;
+
+	public TMsgValueReq getKeyword1() {
+		return keyword1;
+	}
+
+	public void setKeyword1(TMsgValueReq keyword1) {
+		this.keyword1 = keyword1;
+	}
+
+	public TMsgValueReq getKeyword2() {
+		return keyword2;
+	}
+
+	public void setKeyword2(TMsgValueReq keyword2) {
+		this.keyword2 = keyword2;
+	}
+
+}

+ 16 - 0
src/main/java/com/wechat/model/requestDto/TMsg3ParamsDto.java

@@ -0,0 +1,16 @@
+package com.wechat.model.requestDto;
+
+public class TMsg3ParamsDto extends TMsg2ParamsDto{
+
+	private TMsgValueReq keyword3;
+
+
+	public TMsgValueReq getKeyword3() {
+		return keyword3;
+	}
+
+	public void setKeyword3(TMsgValueReq keyword3) {
+		this.keyword3 = keyword3;
+	}
+
+}

+ 23 - 0
src/main/java/com/wechat/model/requestDto/TMsgBaseDto.java

@@ -0,0 +1,23 @@
+package com.wechat.model.requestDto;
+
+public class TMsgBaseDto {
+	private TMsgValueReq first;
+
+	private TMsgValueReq remark;
+
+	public TMsgValueReq getFirst() {
+		return first;
+	}
+
+	public void setFirst(TMsgValueReq first) {
+		this.first = first;
+	}
+
+	public TMsgValueReq getRemark() {
+		return remark;
+	}
+
+	public void setRemark(TMsgValueReq remark) {
+		this.remark = remark;
+	}
+}

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini