Browse Source

初始化提交

46DDCEF4218C6B515FAE3D2DFCD55A3C 1 month ago
commit
ce06ec0dcc
100 changed files with 12605 additions and 0 deletions
  1. 67 0
      META-INF/MANIFEST.MF
  2. 409 0
      pom.xml
  3. 68 0
      src/main/java/com/mysiteforme/admin/MysiteformeApplication.java
  4. 16 0
      src/main/java/com/mysiteforme/admin/annotation/SysLog.java
  5. 137 0
      src/main/java/com/mysiteforme/admin/aspect/WebLogAspect.java
  6. 37 0
      src/main/java/com/mysiteforme/admin/base/BaseController.java
  7. 72 0
      src/main/java/com/mysiteforme/admin/base/BaseEntity.java
  8. 38 0
      src/main/java/com/mysiteforme/admin/base/CaptchaFormAuthenticationFilter.java
  9. 151 0
      src/main/java/com/mysiteforme/admin/base/DataEntity.java
  10. 39 0
      src/main/java/com/mysiteforme/admin/base/MyBatisDao.java
  11. 63 0
      src/main/java/com/mysiteforme/admin/base/MyHandlerInterceptor.java
  12. 34 0
      src/main/java/com/mysiteforme/admin/base/MySysUser.java
  13. 104 0
      src/main/java/com/mysiteforme/admin/base/TreeEntity.java
  14. 227 0
      src/main/java/com/mysiteforme/admin/common/ExportExcelSeedBack.java
  15. 93 0
      src/main/java/com/mysiteforme/admin/common/ExportExcelUtils.java
  16. 33 0
      src/main/java/com/mysiteforme/admin/common/StringLogger.java
  17. 19 0
      src/main/java/com/mysiteforme/admin/common/annotation/SysLog.java
  18. 15 0
      src/main/java/com/mysiteforme/admin/common/consts/ConstValuesUtils.java
  19. 34 0
      src/main/java/com/mysiteforme/admin/common/consts/PushKind.java
  20. 52 0
      src/main/java/com/mysiteforme/admin/common/exception/RRException.java
  21. 54 0
      src/main/java/com/mysiteforme/admin/common/exception/RRExceptionHandler.java
  22. 11 0
      src/main/java/com/mysiteforme/admin/common/utils/ConfigConstant.java
  23. 180 0
      src/main/java/com/mysiteforme/admin/common/utils/Constant.java
  24. 172 0
      src/main/java/com/mysiteforme/admin/common/utils/DateUtils.java
  25. 57 0
      src/main/java/com/mysiteforme/admin/common/utils/DealStrSub.java
  26. 24 0
      src/main/java/com/mysiteforme/admin/common/utils/HttpContextUtils.java
  27. 54 0
      src/main/java/com/mysiteforme/admin/common/utils/IPUtils.java
  28. 114 0
      src/main/java/com/mysiteforme/admin/common/utils/JedisUtils.java
  29. 32 0
      src/main/java/com/mysiteforme/admin/common/utils/MapUtils.java
  30. 106 0
      src/main/java/com/mysiteforme/admin/common/utils/PageUtils.java
  31. 86 0
      src/main/java/com/mysiteforme/admin/common/utils/Query.java
  32. 55 0
      src/main/java/com/mysiteforme/admin/common/utils/R.java
  33. 11 0
      src/main/java/com/mysiteforme/admin/common/utils/RedisKeys.java
  34. 42 0
      src/main/java/com/mysiteforme/admin/common/utils/SpringContextUtils.java
  35. 22 0
      src/main/java/com/mysiteforme/admin/common/validator/Assert.java
  36. 38 0
      src/main/java/com/mysiteforme/admin/common/validator/ValidatorUtils.java
  37. 7 0
      src/main/java/com/mysiteforme/admin/common/validator/group/AddGroup.java
  38. 11 0
      src/main/java/com/mysiteforme/admin/common/validator/group/Group.java
  39. 9 0
      src/main/java/com/mysiteforme/admin/common/validator/group/UpdateGroup.java
  40. 527 0
      src/main/java/com/mysiteforme/admin/common/xss/HTMLFilter.java
  41. 40 0
      src/main/java/com/mysiteforme/admin/common/xss/SQLFilter.java
  42. 27 0
      src/main/java/com/mysiteforme/admin/common/xss/XssFilter.java
  43. 137 0
      src/main/java/com/mysiteforme/admin/common/xss/XssHttpServletRequestWrapper.java
  44. 41 0
      src/main/java/com/mysiteforme/admin/config/DruidDBConfig.java
  45. 38 0
      src/main/java/com/mysiteforme/admin/config/FastJson2JsonRedisSerializer.java
  46. 58 0
      src/main/java/com/mysiteforme/admin/config/FreemarkerConfig.java
  47. 41 0
      src/main/java/com/mysiteforme/admin/config/MybatisPlusConfig.java
  48. 45 0
      src/main/java/com/mysiteforme/admin/config/RedisCacheConfig.java
  49. 180 0
      src/main/java/com/mysiteforme/admin/config/ShiroConfig.java
  50. 59 0
      src/main/java/com/mysiteforme/admin/config/SysMetaObjectHandler.java
  51. 35 0
      src/main/java/com/mysiteforme/admin/config/UserSession.java
  52. 96 0
      src/main/java/com/mysiteforme/admin/config/WebMvcConfigurer.java
  53. 199 0
      src/main/java/com/mysiteforme/admin/controller/LoginController.java
  54. 107 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizCategoryController.java
  55. 292 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizColesCatalogueController.java
  56. 373 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizColesDiscountController.java
  57. 551 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizColesProductController.java
  58. 163 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizLabelManagerController.java
  59. 483 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizMainHomeController.java
  60. 486 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizMessageController.java
  61. 135 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOilCardController.java
  62. 71 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOrderApplyOnPostController.java
  63. 94 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOrderApplySenderController.java
  64. 301 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOrderController.java
  65. 149 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOrderCouponController.java
  66. 53 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOrderFeeController.java
  67. 60 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOrderMessageController.java
  68. 54 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOrderPostController.java
  69. 58 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizOrderReceiveController.java
  70. 38 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizProducdiscountController.java
  71. 90 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizProducimageController.java
  72. 163 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizProductImportController.java
  73. 131 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizProductMatchingController.java
  74. 90 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizProduczipcodeController.java
  75. 90 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizShopmessageController.java
  76. 90 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizShoppingCartController.java
  77. 92 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizUserConfigController.java
  78. 1079 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizUserController.java
  79. 510 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizUserNotesController.java
  80. 281 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizWoolCatalogueController.java
  81. 327 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizWoolDiscountController.java
  82. 669 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizWoolProductController.java
  83. 97 0
      src/main/java/com/mysiteforme/admin/controller/biz/BizZipcodeController.java
  84. 88 0
      src/main/java/com/mysiteforme/admin/controller/biz/InformationStatisticsController.java
  85. 60 0
      src/main/java/com/mysiteforme/admin/controller/biz/ScheduledController.java
  86. 93 0
      src/main/java/com/mysiteforme/admin/controller/system/LogController.java
  87. 183 0
      src/main/java/com/mysiteforme/admin/controller/system/MenuController.java
  88. 181 0
      src/main/java/com/mysiteforme/admin/controller/system/RoleController.java
  89. 48 0
      src/main/java/com/mysiteforme/admin/controller/system/SiteController.java
  90. 295 0
      src/main/java/com/mysiteforme/admin/controller/system/UserConteroller.java
  91. 32 0
      src/main/java/com/mysiteforme/admin/dao/BizCategoryDao.java
  92. 22 0
      src/main/java/com/mysiteforme/admin/dao/BizDialogueLabelDao.java
  93. 23 0
      src/main/java/com/mysiteforme/admin/dao/BizMessageDao.java
  94. 17 0
      src/main/java/com/mysiteforme/admin/dao/BizMessagePullDao.java
  95. 22 0
      src/main/java/com/mysiteforme/admin/dao/BizOilCardDao.java
  96. 14 0
      src/main/java/com/mysiteforme/admin/dao/BizOrderApplyOnPostDao.java
  97. 10 0
      src/main/java/com/mysiteforme/admin/dao/BizOrderApplySenderDao.java
  98. 14 0
      src/main/java/com/mysiteforme/admin/dao/BizOrderCommentDao.java
  99. 10 0
      src/main/java/com/mysiteforme/admin/dao/BizOrderCouponDao.java
  100. 0 0
      src/main/java/com/mysiteforme/admin/dao/BizOrderDao.java

+ 67 - 0
META-INF/MANIFEST.MF

@@ -0,0 +1,67 @@
+Manifest-Version: 1.0
+Class-Path: spring-websocket-4.3.12.RELEASE.jar spring-plugin-core-1.2
+ .0.RELEASE.jar tomcat-juli-8.5.23.jar tomcat-embed-el-8.5.23.jar spri
+ ngfox-spi-2.7.0.jar javax.transaction-api-1.2.jar stax-api-1.0.1.jar 
+ spring-boot-starter-data-redis-1.5.8.RELEASE.jar lombok-1.16.18.jar e
+ zmorph-1.0.6.jar jcl-over-slf4j-1.7.25.jar spring-boot-starter-websoc
+ ket-1.5.8.RELEASE.jar spring-boot-starter-cache-1.5.8.RELEASE.jar thy
+ meleaf-2.1.5.RELEASE.jar mmseg4j-core-1.10.0.jar lucene-analyzers-sma
+ rtcn-7.1.0.jar spring-plugin-metadata-1.2.0.RELEASE.jar jboss-logging
+ -3.3.1.Final.jar aliyun-sdk-oss-2.8.2.jar mybatis-spring-1.3.1.jar hi
+ bernate-jpa-2.1-api-1.0.0.Final.jar unbescape-1.1.0.RELEASE.jar sprin
+ g-data-jpa-1.11.8.RELEASE.jar commons-lang3-3.4.jar spring-boot-start
+ er-1.5.8.RELEASE.jar spring-boot-starter-aop-1.5.8.RELEASE.jar spring
+ fox-spring-web-2.7.0.jar commons-beanutils-1.9.3.jar okhttp-3.9.1.jar
+  druid-spring-boot-starter-1.1.9.jar logback-core-1.1.11.jar spring-b
+ oot-configuration-processor-1.5.8.RELEASE.jar springfox-schema-2.7.0.
+ jar spring-data-redis-1.8.8.RELEASE.jar lucene-analyzers-common-7.1.0
+ .jar velocity-engine-core-2.0.jar spring-orm-4.3.12.RELEASE.jar Hikar
+ iCP-java6-2.3.13.jar spring-context-support-4.3.12.RELEASE.jar jdom-1
+ .1.jar lucene-queries-7.1.0.jar commons-pool2-2.4.2.jar spring-data-c
+ ommons-1.13.8.RELEASE.jar springfox-swagger2-2.7.0.jar commons-fileup
+ load-1.3.1.jar fastjson-1.2.41.jar druid-1.1.9.jar qiniu-java-sdk-7.2
+ .17.jar logback-classic-1.1.11.jar lucene-join-7.1.0.jar quartz-2.3.0
+ .jar spring-expression-4.3.12.RELEASE.jar byte-buddy-1.6.14.jar httpc
+ lient-4.5.3.jar jackson-annotations-2.9.3.jar springfox-swagger-ui-2.
+ 7.0.jar jackson-databind-2.9.3.jar slf4j-api-1.7.25.jar hibernate-cor
+ e-5.0.12.Final.jar log4j-over-slf4j-1.7.25.jar shiro-cas-1.3.2.jar po
+ i-3.9.jar spring-beans-4.3.12.RELEASE.jar reflections-0.9.11.jar xmlb
+ eans-2.3.0.jar tomcat-embed-websocket-8.5.23.jar mysql-connector-java
+ -5.1.44.jar classmate-1.3.4.jar shiro-spring-1.3.2.jar jedis-2.9.0.ja
+ r httpcore-4.4.8.jar spring-boot-starter-freemarker-1.5.8.RELEASE.jar
+  dom4j-1.6.1.jar tomcat-jdbc-8.5.23.jar spring-tx-4.3.12.RELEASE.jar 
+ jackson-core-2.9.3.jar mybatis-spring-boot-starter-1.1.1.jar guava-17
+ .0.jar json-lib-2.4-jdk15.jar servlet-api-2.3.jar xml-apis-1.4.01.jar
+  joda-time-2.9.9.jar lucene-sandbox-7.1.0.jar hibernate-entitymanager
+ -5.0.12.Final.jar shiro-web-1.3.2.jar android-json-0.0.20131108.vaadi
+ n1.jar okio-1.13.0.jar poi-ooxml-schemas-3.9.jar spring-aspects-4.3.1
+ 2.RELEASE.jar hutool-all-3.3.0.jar lucene-highlighter-7.1.0.jar javas
+ sist-3.21.0-GA.jar thymeleaf-layout-dialect-1.4.0.jar tomcat-annotati
+ ons-api-8.5.23.jar mybatis-spring-boot-autoconfigure-1.1.1.jar spring
+ -boot-1.5.8.RELEASE.jar hibernate-commons-annotations-5.0.1.Final.jar
+  jsoup-1.11.2.jar poi-ooxml-3.9.jar ognl-3.0.8.jar commons-collection
+ s-3.2.2.jar springfox-core-2.7.0.jar spring-boot-starter-thymeleaf-1.
+ 5.8.RELEASE.jar spring-boot-autoconfigure-1.5.8.RELEASE.jar spring-bo
+ ot-starter-web-1.3.5.RELEASE.jar ik-analyzers-5.1.0.jar tomcat-embed-
+ core-8.5.23.jar cas-client-core-3.2.2.jar gson-2.8.2.jar thymeleaf-sp
+ ring4-2.1.5.RELEASE.jar spring-oxm-4.3.12.RELEASE.jar shiro-core-1.3.
+ 2.jar spring-context-4.3.12.RELEASE.jar hibernate-validator-5.3.5.Fin
+ al.jar lucene-memory-7.1.0.jar spring-boot-starter-logging-1.5.8.RELE
+ ASE.jar groovy-2.4.12.jar mybatis-3.4.5.jar mapstruct-1.1.0.Final.jar
+  antlr-2.7.7.jar jul-to-slf4j-1.7.25.jar spring-jdbc-4.3.12.RELEASE.j
+ ar validation-api-1.1.0.Final.jar spring-core-4.3.12.RELEASE.jar myba
+ tis-plus-2.1.4.jar freemarker-2.3.26-incubating.jar spring-boot-start
+ er-validation-1.5.8.RELEASE.jar springfox-swagger-common-2.7.0.jar my
+ batisplus-spring-boot-starter-1.0.5.jar commons-lang-2.5.jar lucene-c
+ ore-7.1.0.jar spring-webmvc-4.3.12.RELEASE.jar mchange-commons-java-0
+ .2.11.jar spring-web-4.3.12.RELEASE.jar jandex-2.0.0.Final.jar spring
+ -aop-4.3.12.RELEASE.jar commons-logging-1.1.jar mmseg4j-solr-2.4.0.ja
+ r lucene-queryparser-7.1.0.jar spring-boot-starter-jdbc-1.5.8.RELEASE
+ .jar swagger-models-1.5.13.jar commons-io-2.4.jar spring-messaging-4.
+ 3.12.RELEASE.jar aspectjweaver-1.8.11.jar spring-boot-starter-data-jp
+ a-1.5.8.RELEASE.jar jsqlparser-1.1.jar spring-data-keyvalue-1.2.8.REL
+ EASE.jar swagger-annotations-1.5.13.jar commons-codec-1.10.jar spring
+ -boot-starter-tomcat-1.5.8.RELEASE.jar shiro-redis-2.4.2.1-RELEASE.ja
+ r snakeyaml-1.17.jar
+Main-Class: com.mysiteforme.admin.MysiteformeApplication
+

+ 409 - 0
pom.xml

@@ -0,0 +1,409 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<groupId>com.mysiteforme</groupId>
+	<artifactId>wiselist-backstage-cn</artifactId>
+	<version>1</version>
+	<packaging>jar</packaging>
+
+	<name>wiselist-backstage-cn</name>
+	<description>this project for myself</description>
+
+	<parent>
+		<groupId>org.springframework.boot</groupId>
+		<artifactId>spring-boot-starter-parent</artifactId>
+		<version>1.5.8.RELEASE</version>
+		<!--<version>2.0.0.RELEASE</version>-->
+		<relativePath/> <!-- lookup parent from repository -->
+	</parent>
+
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+		<java.version>1.8</java.version>
+
+		<shiro.version>1.3.2</shiro.version>
+		<shiro-redis.version>2.4.2.1-RELEASE</shiro-redis.version>
+		<commons-lang3.version>3.4</commons-lang3.version>
+		<commons-codec.version>1.10</commons-codec.version>
+		<fileupload.version>1.3.1</fileupload.version>
+		<mybatisplus-spring-boot-starter.version>1.0.5</mybatisplus-spring-boot-starter.version>
+		<mybatisplus.version>2.1.4</mybatisplus.version>
+		<fastjson.version>1.2.41</fastjson.version>
+		<jackson.version>2.9.3</jackson.version>
+		<druid.version>1.1.9</druid.version>
+		<guava.version>17.0</guava.version>
+		<mysql.version>5.1.38</mysql.version>
+		<!--<quartz.version>2.3.0</quartz.version>-->
+		<!-- 留着下面的skip,打出来的包就会去掉boot-inf目录 -->
+		<!-- <skip>true</skip> -->
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>aliyunmaven</id>
+			<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+		</repository>
+	</repositories>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-data-jpa</artifactId>
+		</dependency>
+		<dependency>
+		<groupId>org.springframework.boot</groupId>
+		<artifactId>spring-boot-starter-thymeleaf</artifactId>
+		</dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-data-redis</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-web</artifactId>
+			<version>1.3.5.RELEASE</version>
+			<exclusions>
+				<exclusion>
+					<groupId>ch.qos.logback</groupId>
+					<artifactId>logback-classic</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>ch.qos.logback</groupId>
+					<artifactId>logback-core</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-aop</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-context-support</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>joda-time</groupId>
+			<artifactId>joda-time</artifactId>
+			<version>2.9.9</version>
+		</dependency>
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>${mysql.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-freemarker</artifactId>
+		</dependency>
+
+		<!--下面是自己引入的架包-->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-cache</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-lang3</artifactId>
+			<version>${commons-lang3.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>commons-codec</groupId>
+			<artifactId>commons-codec</artifactId>
+			<version>${commons-codec.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>commons-fileupload</groupId>
+			<artifactId>commons-fileupload</artifactId>
+			<version>${fileupload.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.vdurmont</groupId>
+			<artifactId>emoji-java</artifactId>
+			<version>3.2.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.mybatis.spring.boot</groupId>
+			<artifactId>mybatis-spring-boot-starter</artifactId>
+			<version>1.1.1</version>
+			<exclusions>
+				<exclusion>
+					<groupId>ch.qos.logback</groupId>
+					<artifactId>logback-classic</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>ch.qos.logback</groupId>
+					<artifactId>logback-core</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.velocity</groupId>
+			<artifactId>velocity-engine-core</artifactId>
+			<version>2.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>fastjson</artifactId>
+			<version>${fastjson.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-annotations</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-core</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>druid-spring-boot-starter</artifactId>
+			<version>${druid.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.baomidou</groupId>
+			<artifactId>mybatisplus-spring-boot-starter</artifactId>
+			<version>${mybatisplus-spring-boot-starter.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.baomidou</groupId>
+			<artifactId>mybatis-plus</artifactId>
+			<version>${mybatisplus.version}</version>
+		</dependency>
+
+		<!-- 极光推送 -->
+		<dependency>
+			<groupId>cn.jpush.api</groupId>
+			<artifactId>jpush-client</artifactId>
+			<version>3.3.9</version>
+		</dependency>
+		<dependency>
+			<groupId>cn.jpush.api</groupId>
+			<artifactId>jiguang-common</artifactId>
+			<version>1.1.3</version>
+		</dependency>
+		<dependency>
+			<groupId>io.netty</groupId>
+			<artifactId>netty-all</artifactId>
+			<version>4.1.6.Final</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>2.3</version>
+		</dependency>
+		<!--<dependency>-->
+			<!--<groupId>org.slf4j</groupId>-->
+			<!--<artifactId>slf4j-api</artifactId>-->
+			<!--<version>1.7.7</version>-->
+			<!--<exclusions>-->
+				<!--<exclusion>-->
+					<!--<groupId>ch.qos.logback</groupId>-->
+					<!--<artifactId>logback-classic</artifactId>-->
+				<!--</exclusion>-->
+				<!--<exclusion>-->
+					<!--<groupId>ch.qos.logback</groupId>-->
+					<!--<artifactId>logback-core</artifactId>-->
+				<!--</exclusion>-->
+			<!--</exclusions>-->
+		<!--</dependency>-->
+
+		<!-- For log4j -->
+		<!--<dependency>-->
+			<!--<groupId>org.slf4j</groupId>-->
+			<!--<artifactId>slf4j-log4j12</artifactId>-->
+			<!--<version>1.7.7</version>-->
+			<!--<exclusions>-->
+				<!--<exclusion>-->
+					<!--<groupId>ch.qos.logback</groupId>-->
+					<!--<artifactId>logback-classic</artifactId>-->
+				<!--</exclusion>-->
+				<!--<exclusion>-->
+					<!--<groupId>ch.qos.logback</groupId>-->
+					<!--<artifactId>logback-core</artifactId>-->
+				<!--</exclusion>-->
+			<!--</exclusions>-->
+		<!--</dependency>-->
+		<!--<dependency>-->
+			<!--<groupId>log4j</groupId>-->
+			<!--<artifactId>log4j</artifactId>-->
+			<!--<version>1.2.17</version>-->
+			<!--<exclusions>-->
+				<!--<exclusion>-->
+					<!--<groupId>ch.qos.logback</groupId>-->
+					<!--<artifactId>logback-classic</artifactId>-->
+				<!--</exclusion>-->
+				<!--<exclusion>-->
+					<!--<groupId>ch.qos.logback</groupId>-->
+					<!--<artifactId>logback-core</artifactId>-->
+				<!--</exclusion>-->
+			<!--</exclusions>-->
+		<!--</dependency>-->
+		<!--定时任务-->
+		<!--<dependency>-->
+			<!--<groupId>org.quartz-scheduler</groupId>-->
+			<!--<artifactId>quartz</artifactId>-->
+			<!--<version>${quartz.version}</version>-->
+			<!--<exclusions>-->
+				<!--<exclusion>-->
+					<!--<groupId>com.mchange</groupId>-->
+					<!--<artifactId>c3p0</artifactId>-->
+				<!--</exclusion>-->
+			<!--</exclusions>-->
+		<!--</dependency>-->
+
+		<!-- Google jar -->
+		<dependency>
+			<groupId>com.google.guava</groupId>
+			<artifactId>guava</artifactId>
+			<version>${guava.version}</version>
+		</dependency>
+
+		<!--shiro begin-->
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-web</artifactId>
+			<version>${shiro.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-cas</artifactId>
+			<version>${shiro.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-core</artifactId>
+			<version>${shiro.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.shiro</groupId>
+			<artifactId>shiro-spring</artifactId>
+			<version>${shiro.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.crazycake</groupId>
+			<artifactId>shiro-redis</artifactId>
+			<version>${shiro-redis.version}</version>
+		</dependency>
+		<!--shiro end-->
+
+		<!-- 七牛JAR -->
+		<!--<dependency>-->
+			<!--<groupId>com.qiniu</groupId>-->
+			<!--<artifactId>qiniu-java-sdk</artifactId>-->
+			<!--<version>[7.2.0, 7.2.99]</version>-->
+		<!--</dependency>-->
+
+		<!--阿里云OSS上传-->
+		<dependency>
+			<groupId>com.aliyun.oss</groupId>
+			<artifactId>aliyun-sdk-oss</artifactId>
+			<version>2.8.2</version>
+		</dependency>
+
+		<!--网页抓取-->
+		<dependency>
+			<groupId>org.jsoup</groupId>
+			<artifactId>jsoup</artifactId>
+			<version>1.11.2</version>
+		</dependency>
+
+		<!--工具类-->
+		<dependency>
+			<groupId>com.xiaoleilu</groupId>
+			<artifactId>hutool-all</artifactId>
+			<version>3.3.0</version>
+		</dependency>
+
+		<!--对分词索引查询解析-->
+		<!--<dependency>-->
+			<!--<groupId>org.apache.lucene</groupId>-->
+			<!--<artifactId>lucene-queryparser</artifactId>-->
+			<!--<version>7.1.0</version>-->
+		<!--</dependency>-->
+
+		<!--高亮 -->
+		<dependency>
+			<groupId>org.apache.lucene</groupId>
+			<artifactId>lucene-highlighter</artifactId>
+			<version>7.1.0</version>
+		</dependency>
+
+
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi-ooxml</artifactId>
+			<version>3.9</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>2.11.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>net.sourceforge.jexcelapi</groupId>
+			<artifactId>jxl</artifactId>
+			<version>2.6.12</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+        <plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+				<configuration>
+					<executable>true</executable>
+				</configuration>
+			</plugin>
+        </plugins>
+         <!-- <resources>
+				<resource>
+					<directory>src/main/resources</directory>
+					<excludes>
+						<exclude>**/*.properties</exclude>
+						<exclude>**/*.yml</exclude>
+					</excludes>
+				</resource>
+			</resources> -->
+    </build>
+</project>

+ 68 - 0
src/main/java/com/mysiteforme/admin/MysiteformeApplication.java

@@ -0,0 +1,68 @@
+package com.mysiteforme.admin;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
+import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.boot.web.support.ErrorPageFilter;
+import org.springframework.boot.web.support.SpringBootServletInitializer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Import;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.web.context.request.RequestContextListener;
+
+import com.mysiteforme.admin.datasources.DynamicDataSourceConfig;
+
+
+@MapperScan("com.mysiteforme.admin.dao")
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@Import({ DynamicDataSourceConfig.class })
+@EnableScheduling
+public class MysiteformeApplication extends SpringBootServletInitializer {
+
+    protected SpringApplicationBuilder configure(
+            SpringApplicationBuilder builder) {
+        return builder.sources(this.getClass());
+    }
+
+    public static void main(String[] args) {
+        SpringApplication.run(MysiteformeApplication.class, args);
+    }
+
+    /**
+     * session时长设置
+     *
+     * @return
+     */
+    @Bean
+    public EmbeddedServletContainerCustomizer containerCustomizer() {
+        return new EmbeddedServletContainerCustomizer() {
+            @Override
+            public void customize(ConfigurableEmbeddedServletContainer Container) {
+
+                Container.setSessionTimeout(12 * 60 * 60 * 60);//单位为S
+            }
+        };
+    }
+
+    @Bean
+    public ErrorPageFilter errorPageFilter() {
+        return new ErrorPageFilter();
+    }
+    @Bean
+    public FilterRegistrationBean disableSpringBootErrorFilter(ErrorPageFilter filter) {
+        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
+        filterRegistrationBean.setFilter(filter);
+        filterRegistrationBean.setEnabled(false);
+        return filterRegistrationBean;
+    }
+
+    @Bean
+    public RequestContextListener requestContextListener(){
+    	    return new RequestContextListener();
+    	} 
+}

+ 16 - 0
src/main/java/com/mysiteforme/admin/annotation/SysLog.java

@@ -0,0 +1,16 @@
+package com.mysiteforme.admin.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * Created by wangl on 2018/1/13.
+ * todo:
+ * 类SysLog的功能描述:
+ * 系统日志注解
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface SysLog {
+    String value() default "";
+}

+ 137 - 0
src/main/java/com/mysiteforme/admin/aspect/WebLogAspect.java

@@ -0,0 +1,137 @@
+package com.mysiteforme.admin.aspect;
+
+import com.alibaba.fastjson.JSONObject;
+import com.mysiteforme.admin.base.MySysUser;
+import com.mysiteforme.admin.entity.Log;
+import com.mysiteforme.admin.exception.GlobalExceptionHandler;
+import com.mysiteforme.admin.util.ToolUtil;
+import com.vdurmont.emoji.EmojiParser;
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.*;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * Created by wangl on 2018/1/13.
+ * todo:
+ */
+@Aspect
+@Order(5)
+@Component
+public class WebLogAspect {
+
+    private ThreadLocal<Long> startTime = new ThreadLocal<>();
+
+    @Autowired
+    private GlobalExceptionHandler exceptionHandle;
+
+    private Log sysLog = null;
+
+    @Pointcut("@annotation(com.mysiteforme.admin.annotation.SysLog)")
+    public void webLog(){}
+
+    @Before("webLog()")
+    public void doBefore(JoinPoint joinPoint) {
+        startTime.set(System.currentTimeMillis());
+        // 接收到请求,记录请求内容
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        HttpServletRequest request = attributes.getRequest();
+        HttpSession session = (HttpSession) attributes.resolveReference(RequestAttributes.REFERENCE_SESSION);
+        sysLog = new Log();
+        sysLog.setClassMethod(joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
+        sysLog.setHttpMethod(request.getMethod());
+        //获取传入目标方法的参数
+        Object[] args = joinPoint.getArgs();
+        for (int i = 0; i < args.length; i++) {
+            Object o = args[i];
+            if(o instanceof ServletRequest || (o instanceof ServletResponse) || o instanceof MultipartFile){
+                args[i] = o.toString();
+            }
+        }
+        String str = JSONObject.toJSONString(args);
+        sysLog.setParams(str.length()>5000?JSONObject.toJSONString("param too length no show"):EmojiParser.parseToAliases(str));
+        String ip = ToolUtil.getClientIp(request);
+        if("0.0.0.0".equals(ip) || "0:0:0:0:0:0:0:1".equals(ip) || "localhost".equals(ip) || "127.0.0.1".equals(ip)){
+            ip = "127.0.0.1";
+        }
+        sysLog.setRemoteAddr(ip);
+        sysLog.setRequestUri(request.getRequestURL().toString());
+        if(session != null){
+            sysLog.setSessionId(session.getId());
+        }
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+        com.mysiteforme.admin.annotation.SysLog mylog = method.getAnnotation(com.mysiteforme.admin.annotation.SysLog.class);
+        if(mylog != null){
+            //注解上的描述
+            sysLog.setTitle(mylog.value());
+        }
+
+        Map<String,String> browserMap = ToolUtil.getOsAndBrowserInfo(request);
+        sysLog.setBrowser(browserMap.get("os")+"-"+browserMap.get("browser"));
+
+        if(!"127.0.0.1".equals(ip)){
+            Map<String,String> map = (Map<String,String>)session.getAttribute("addressIp");
+            if(map == null){
+                map = ToolUtil.getAddressByIP(ToolUtil.getClientIp(request));
+                session.setAttribute("addressIp",map);
+            }
+            sysLog.setArea(map.get("area"));
+            sysLog.setProvince(map.get("province"));
+            sysLog.setCity(map.get("city"));
+            sysLog.setIsp(map.get("isp"));
+        }
+        sysLog.setType(ToolUtil.isAjax(request)?"Ajax":"No Ajax");
+        if(MySysUser.ShiroUser() != null) {
+            //sysLog.setUsername(StringUtils.isNotBlank(MySysUser.nickName()) ? MySysUser.nickName() : MySysUser.loginName());
+            sysLog.setUsername(MySysUser.loginName());
+        }
+    }
+
+    @Around("webLog()")
+    public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
+        try {
+            Object obj = proceedingJoinPoint.proceed();
+            return obj;
+        } catch (Exception e) {
+            e.printStackTrace();
+            sysLog.setException(e.getMessage());
+            throw e;
+        }
+    }
+
+    @AfterReturning(returning = "ret", pointcut = "webLog()")
+    public void doAfterReturning(Object ret) {
+        if(MySysUser.ShiroUser() != null) {
+            //sysLog.setUsername(StringUtils.isNotBlank(MySysUser.nickName()) ? MySysUser.nickName() : MySysUser.loginName());
+            sysLog.setUsername(MySysUser.loginName());
+        }
+        String retString = JSONObject.toJSONString(ret);
+        sysLog.setResponse(retString.length()>5000?JSONObject.toJSONString("param too length no show"):EmojiParser.parseToAliases(retString));
+        sysLog.setUseTime(System.currentTimeMillis() - startTime.get());
+        sysLog.setCreateDate(new Date());
+        sysLog.setCreateId(Long.valueOf("1"));
+        sysLog.setUpdateDate(new Date());
+        sysLog.setUpdateId(Long.valueOf("1"));
+        sysLog.setDelFlag(false);
+        sysLog.setRemarks("log");
+
+        sysLog.insert();
+    }
+}

+ 37 - 0
src/main/java/com/mysiteforme/admin/base/BaseController.java

@@ -0,0 +1,37 @@
+package com.mysiteforme.admin.base;
+
+import com.mysiteforme.admin.entity.User;
+import com.mysiteforme.admin.realm.AuthRealm.ShiroUser;
+import com.mysiteforme.admin.service.*;
+import org.apache.shiro.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class BaseController {
+	
+	public User getCurrentUser() {
+		ShiroUser shiroUser = (ShiroUser) SecurityUtils.getSubject().getPrincipal();
+		if(shiroUser == null) {
+			return null;
+		}
+		User loginUser = userService.selectById(shiroUser.getId());
+		return loginUser;
+	}
+
+	@Autowired
+	protected UserService userService;
+	@Autowired
+	protected MenuService menuService;
+	@Autowired
+	protected RoleService roleService;
+	@Autowired
+	protected DictService dictService;
+//	@Autowired
+//	protected RescourceService rescourceService;
+	@Autowired
+	protected SiteService siteService;
+
+	@Autowired
+	protected LogService logService;
+
+
+}

+ 72 - 0
src/main/java/com/mysiteforme/admin/base/BaseEntity.java

@@ -0,0 +1,72 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.mysiteforme.admin.base;
+
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+
+import java.io.Serializable;
+
+
+/**
+ * Entity支持类
+ *
+ * @param <T>
+ */
+
+public abstract class BaseEntity<T extends Model> extends Model<T>  {
+
+
+
+    /**
+     * 实体编号(唯一标识)
+     */
+
+    protected Long id;
+
+
+
+    public BaseEntity() {
+
+    }
+
+    public BaseEntity(Long id) {
+        this();
+        this.id = id;
+    }
+    @JsonSerialize(using=ToStringSerializer.class)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (null == obj) {
+            return false;
+        }
+        if (this == obj) {
+            return true;
+        }
+        if (!getClass().equals(obj.getClass())) {
+            return false;
+        }
+        BaseEntity<?> that = (BaseEntity<?>) obj;
+        return null != this.getId() && this.getId().equals(that.getId());
+    }
+
+
+
+
+}

+ 38 - 0
src/main/java/com/mysiteforme/admin/base/CaptchaFormAuthenticationFilter.java

@@ -0,0 +1,38 @@
+package com.mysiteforme.admin.base;
+
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Created by wangl on 2017/11/25.
+ * todo:
+ */
+public class CaptchaFormAuthenticationFilter extends FormAuthenticationFilter {
+    /**
+     * 覆盖默认实现,用sendRedirect直接跳出框架,以免造成js框架重复加载js出错。
+     * @param token
+     * @param subject
+     * @param request
+     * @param response
+     * @return
+     * @throws Exception
+     * @see FormAuthenticationFilter#onLoginSuccess(AuthenticationToken, Subject, ServletRequest, ServletResponse)
+     */
+    @Override
+    protected boolean onLoginSuccess(AuthenticationToken token, Subject subject,
+                                     ServletRequest request, ServletResponse response) throws Exception {
+        //issueSuccessRedirect(request, response);
+        //we handled the success redirect directly, prevent the chain from continuing:
+        HttpServletRequest httpServletRequest = (HttpServletRequest)request;
+        HttpServletResponse httpServletResponse = (HttpServletResponse)response;
+        httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + this.getSuccessUrl());
+
+        return true;
+    }
+}

+ 151 - 0
src/main/java/com/mysiteforme/admin/base/DataEntity.java

@@ -0,0 +1,151 @@
+/**
+ * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
+ */
+package com.mysiteforme.admin.base;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.enums.FieldFill;
+import com.baomidou.mybatisplus.enums.FieldStrategy;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.mysiteforme.admin.entity.User;
+
+import java.util.Date;
+
+/**
+ * 数据Entity类
+ *
+ * @param <T>
+ */
+public abstract class DataEntity<T extends Model> extends BaseEntity<T> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *  创建者
+     */
+    @TableField(value = "create_by", fill = FieldFill.INSERT)
+    protected Long createId;
+
+    /**
+     * 创建日期
+     */
+    @TableField(value = "create_date", fill = FieldFill.INSERT)
+    protected Date createDate;
+
+    /**
+     * 更新者
+     */
+    @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
+    protected Long updateId;
+
+    /**
+     * 更新日期
+      */
+    @TableField(value = "update_date", fill = FieldFill.INSERT_UPDATE)
+    protected Date updateDate;
+
+    /**
+     * 删除标记(Y:正常;N:删除;A:审核;)
+     */
+    @TableField(value = "del_flag")
+    protected Boolean delFlag;
+
+    /**
+     * 备注
+     */
+    @TableField(strategy= FieldStrategy.IGNORED)
+    protected String remarks;
+
+    /**
+     * 创建着
+     */
+    @TableField(exist = false)
+    protected User createUser;
+
+    /**
+     * 修改者
+     */
+    @TableField(exist = false)
+    protected User updateUser;
+
+
+
+
+    public Long getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(Long createId) {
+        this.createId = createId;
+    }
+
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+10")
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public Long getUpdateId() {
+        return updateId;
+    }
+
+    public void setUpdateId(Long updateId) {
+        this.updateId = updateId;
+    }
+
+    public DataEntity() {
+        super();
+        this.delFlag = false;
+    }
+
+    public DataEntity(Long id) {
+        super(id);
+    }
+
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+10")
+    public Date getUpdateDate() {
+        return updateDate;
+    }
+
+    public void setUpdateDate(Date updateDate) {
+        this.updateDate = updateDate;
+    }
+
+    public Boolean getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Boolean delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public User getCreateUser() {
+        return createUser;
+    }
+
+    public void setCreateUser(User createUser) {
+        this.createUser = createUser;
+    }
+
+    public User getUpdateUser() {
+        return updateUser;
+    }
+
+    public void setUpdateUser(User updateUser) {
+        this.updateUser = updateUser;
+    }
+}

+ 39 - 0
src/main/java/com/mysiteforme/admin/base/MyBatisDao.java

@@ -0,0 +1,39 @@
+package com.mysiteforme.admin.base;
+
+/**
+ * Created by wangl on 2017/11/23.
+ * todo:
+ */
+
+import org.springframework.stereotype.Component;
+
+import java.lang.annotation.*;
+
+/**
+
+ * 标识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 "";
+
+}
+

+ 63 - 0
src/main/java/com/mysiteforme/admin/base/MyHandlerInterceptor.java

@@ -0,0 +1,63 @@
+package com.mysiteforme.admin.base;
+
+import com.mysiteforme.admin.entity.User;
+import com.mysiteforme.admin.realm.AuthRealm.ShiroUser;
+import com.mysiteforme.admin.service.SiteService;
+import com.mysiteforme.admin.service.UserService;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.session.Session;
+import org.apache.shiro.util.Factory;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Created by wangl on 2017/11/30.
+ * todo:
+ */
+@Component
+public class MyHandlerInterceptor implements HandlerInterceptor {
+    private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(MyHandlerInterceptor.class);
+
+    @Autowired
+    private SiteService siteService;
+    @Autowired
+    private UserService userService;
+
+    @Override
+    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) {
+//        LOGGER.info("当前请求路径.."+httpServletRequest.getRequestURI());
+        if (siteService == null || userService == null) {//解决service为null无法注入问题
+            System.out.println("siteService is null!!!");
+            BeanFactory factory = WebApplicationContextUtils.getRequiredWebApplicationContext(httpServletRequest.getServletContext());
+            siteService = (SiteService) factory.getBean("siteService");
+            userService = (UserService) factory.getBean("userService");
+
+        }
+//        httpServletRequest.setAttribute("site",siteService.getCurrentSite());
+//        User user = userService.findUserById(MySysUser.id());
+//        if(user != null){
+//            httpServletRequest.setAttribute("currentUser",user);
+//            return true;
+//        }
+//        return false;
+        return true;
+    }
+
+    @Override
+    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) {
+
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) {
+
+    }
+}

+ 34 - 0
src/main/java/com/mysiteforme/admin/base/MySysUser.java

@@ -0,0 +1,34 @@
+package com.mysiteforme.admin.base;
+
+import com.mysiteforme.admin.realm.AuthRealm.ShiroUser;
+import org.apache.shiro.SecurityUtils;
+
+/**
+ * Created by wangl on 2017/11/25.
+ * todo:
+ */
+public class MySysUser {
+    /**
+     * 取出Shiro中的当前用户LoginName.
+     */
+    public static String icon() {
+        return ShiroUser().getIcon();
+    }
+
+    public static Long id() {
+        return ShiroUser().getId();
+    }
+
+    public static String loginName() {
+        return ShiroUser().getloginName();
+    }
+
+    public static String nickName(){
+        return ShiroUser().getNickName();
+    }
+
+    public static ShiroUser ShiroUser() {
+        ShiroUser user = (ShiroUser) SecurityUtils.getSubject().getPrincipal();
+        return user;
+    }
+}

+ 104 - 0
src/main/java/com/mysiteforme/admin/base/TreeEntity.java

@@ -0,0 +1,104 @@
+package com.mysiteforme.admin.base;
+
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import com.baomidou.mybatisplus.annotations.TableField;
+import org.hibernate.validator.constraints.Length;
+
+import java.util.List;
+
+/**
+ * 数据Entity类
+ *
+ * @author chenjianann
+ *
+ * @version 2014-05-16
+ */
+public abstract class TreeEntity<T extends Model> extends DataEntity<T> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * varchar(64) NULL父id
+     */
+    @TableField(value = "parent_id")
+    protected Long parentId;
+
+    /**
+     * 节点层次(第一层,第二层,第三层....)
+     */
+    protected Integer level;
+    /**
+     * varchar(1000) NULL路径
+     */
+    @TableField(value = "parent_ids")
+    protected String parentIds;
+    /**
+     * int(11) NULL排序
+     */
+    protected Integer sort;
+
+    @TableField(exist = false)
+    protected List<T> children;
+
+    @TableField(exist = false)
+    protected T parentTree;
+
+    public TreeEntity() {
+        super();
+        this.sort = 30;
+    }
+
+    public TreeEntity(Long id) {
+        super(id);
+    }
+
+    public Long getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Long parentId) {
+        this.parentId = parentId;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+
+    @Length( max = 1000, message = "路径长度必须介于 1 和 1000 之间")
+    public String getParentIds() {
+        return parentIds;
+    }
+
+    public void setParentIds(String parentIds) {
+        this.parentIds = parentIds;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    public List<T> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<T> children) {
+        this.children = children;
+    }
+
+    public T getParentTree() {
+        return parentTree;
+    }
+
+    public void setParentTree(T parentTree) {
+        this.parentTree = parentTree;
+    }
+}

+ 227 - 0
src/main/java/com/mysiteforme/admin/common/ExportExcelSeedBack.java

@@ -0,0 +1,227 @@
+package com.mysiteforme.admin.common;
+
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.hssf.util.HSSFColor;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ExportExcelSeedBack {
+    //显示的导出表的标题
+    private String title;
+    //导出表的列名
+    private String[] rowName;
+
+    private List<Object[]> dataList = new ArrayList<Object[]>();
+
+    HttpServletResponse response;
+
+
+    //构造方法,传入要导出的数据
+    public ExportExcelSeedBack(String title, String[] rowName, List<Object[]> dataList) {
+        this.dataList = dataList;
+        this.rowName = rowName;
+        this.title = title;
+    }
+
+    /*
+     * 导出数据
+     * */
+    public void export(OutputStream out) throws Exception {
+        try {
+            HSSFWorkbook workbook = new HSSFWorkbook();                     // 创建工作簿对象
+            HSSFSheet sheet = workbook.createSheet(title);                  // 创建工作表
+
+            // 产生表格标题行
+            //          HSSFRow rowm = sheet.createRow(0);
+            //          HSSFCell cellTiltle = rowm.createCell(0);
+
+            //sheet样式定义【getColumnTopStyle()/getStyle()均为自定义方法 - 在下面  - 可扩展】
+            HSSFCellStyle columnTopStyle = this.getColumnTopStyle(workbook);//获取列头样式对象
+            HSSFCellStyle style = this.getStyle(workbook);                  //单元格样式对象
+
+            //          sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, (rowName.length-1)));//合并单元格
+            //          cellTiltle.setCellStyle(columnTopStyle);
+            //          cellTiltle.setCellValue(title);
+
+            // 定义所需列数
+            int columnNum = rowName.length;
+            HSSFRow rowRowName = sheet.createRow(0);                // 在索引2的位置创建行(最顶端的行开始的第二行)
+
+            // 将列头设置到sheet的单元格中
+            for (int n = 0; n < columnNum; n++) {
+                HSSFCell cellRowName = rowRowName.createCell(n);               //创建列头对应个数的单元格
+                cellRowName.setCellType(HSSFCell.CELL_TYPE_STRING);             //设置列头单元格的数据类型
+                HSSFRichTextString text = new HSSFRichTextString(rowName[n]);
+                cellRowName.setCellValue(text);                                 //设置列头单元格的值
+                cellRowName.setCellStyle(columnTopStyle);                       //设置列头单元格样式
+            }
+
+            //将查询出的数据设置到sheet对应的单元格中
+            for (int i = 0; i < dataList.size(); i++) {
+                Object[] obj = dataList.get(i);//遍历每个对象
+                HSSFRow row = sheet.createRow(i + 1);//创建所需的行数(从第二行开始写数据)
+
+                for (int j = 0; j < obj.length; j++) {
+                    HSSFCell cell = null;   //设置单元格的数据类型
+                    if (j == 0) {
+                        cell = row.createCell(j, HSSFCell.CELL_TYPE_NUMERIC);
+                        cell.setCellValue(i + 1);
+                    } else {
+                        cell = row.createCell(j, HSSFCell.CELL_TYPE_STRING);
+                        if (!"".equals(obj[j]) && obj[j] != null) {
+                            cell.setCellValue(obj[j].toString());                       //设置单元格的值
+                        }
+                    }
+                    cell.setCellStyle(style);                                   //设置单元格样式
+                }
+            }
+            //让列宽随着导出的列长自动适应
+            for (int colNum = 0; colNum < columnNum; colNum++) {
+                int columnWidth = sheet.getColumnWidth(colNum) / 256;
+                for (int rowNum = 0; rowNum < sheet.getLastRowNum(); rowNum++) {
+                    HSSFRow currentRow;
+                    //当前行未被使用过
+                    if (sheet.getRow(rowNum) == null) {
+                        currentRow = sheet.createRow(rowNum);
+                    } else {
+                        currentRow = sheet.getRow(rowNum);
+                    }
+                    //                 if (currentRow.getCell(colNum) != null) {
+                    //                     HSSFCell currentCell = currentRow.getCell(colNum);
+                    //                      if (currentCell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
+                    //                          int length =     currentCell.getStringCellValue().getBytes().length;
+                    //                          if (columnWidth < length) {
+                    //                              columnWidth = length;
+                    //                          }
+                    //                      }
+                    //                  }
+                    if (currentRow.getCell(colNum) != null) {
+                        HSSFCell currentCell = currentRow.getCell(colNum);
+                        if (currentCell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
+                            int length = 0;
+                            try {
+                                length = currentCell.getStringCellValue().getBytes().length;
+                            } catch (Exception e) {
+                                //e.printStackTrace();
+                            }
+                            if (columnWidth < length) {
+                                columnWidth = length;
+                            }
+                        }
+                    }
+
+                }
+                if (colNum == 0) {
+                    sheet.setColumnWidth(colNum, (columnWidth - 2) * 256);
+                } else {
+                    sheet.setColumnWidth(colNum, (columnWidth + 4) * 256);
+                }
+            }
+            if (workbook != null) {
+                try {
+                    workbook.write(out);
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            out.close();
+        }
+    }
+
+    /*
+     * 列头单元格样式
+     */
+    public HSSFCellStyle getColumnTopStyle(HSSFWorkbook workbook) {
+
+        // 设置字体
+        HSSFFont font = workbook.createFont();
+        //设置字体大小
+        font.setFontHeightInPoints((short) 11);
+        //字体加粗
+        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+        //设置字体名字
+        font.setFontName("Courier New");
+        //设置样式;
+        HSSFCellStyle style = workbook.createCellStyle();
+        //设置底边框;
+        style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+        //设置底边框颜色;
+        style.setBottomBorderColor(HSSFColor.BLACK.index);
+        //设置左边框;
+        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        //设置左边框颜色;
+        style.setLeftBorderColor(HSSFColor.BLACK.index);
+        //设置右边框;
+        style.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        //设置右边框颜色;
+        style.setRightBorderColor(HSSFColor.BLACK.index);
+        //设置顶边框;
+        style.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        //设置顶边框颜色;
+        style.setTopBorderColor(HSSFColor.BLACK.index);
+        //在样式用应用设置的字体;
+        style.setFont(font);
+        //设置自动换行;
+        style.setWrapText(false);
+        //设置水平对齐的样式为居中对齐;
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        //设置垂直对齐的样式为居中对齐;
+        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+
+        return style;
+
+    }
+
+    /*
+     * 列数据信息单元格样式
+     */
+    public HSSFCellStyle getStyle(HSSFWorkbook workbook) {
+        // 设置字体
+        HSSFFont font = workbook.createFont();
+        //设置字体大小
+        //font.setFontHeightInPoints((short)10);
+        //字体加粗
+        //font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+        //设置字体名字
+        font.setFontName("Courier New");
+        //设置样式;
+        HSSFCellStyle style = workbook.createCellStyle();
+        //设置底边框;
+        style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+        //设置底边框颜色;
+        style.setBottomBorderColor(HSSFColor.BLACK.index);
+        //设置左边框;
+        style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        //设置左边框颜色;
+        style.setLeftBorderColor(HSSFColor.BLACK.index);
+        //设置右边框;
+        style.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        //设置右边框颜色;
+        style.setRightBorderColor(HSSFColor.BLACK.index);
+        //设置顶边框;
+        style.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        //设置顶边框颜色;
+        style.setTopBorderColor(HSSFColor.BLACK.index);
+        //在样式用应用设置的字体;
+        style.setFont(font);
+        //设置自动换行;
+        style.setWrapText(false);
+        //设置水平对齐的样式为居中对齐;
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        //设置垂直对齐的样式为居中对齐;
+        style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+
+        return style;
+
+    }
+
+
+}

+ 93 - 0
src/main/java/com/mysiteforme/admin/common/ExportExcelUtils.java

@@ -0,0 +1,93 @@
+package com.mysiteforme.admin.common;
+
+import com.mysiteforme.admin.entity.ExcelData;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.*;
+import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder;
+
+import javax.servlet.http.HttpServletResponse;
+import java.awt.Color;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+import java.util.List;
+import java.util.Map;
+
+public class ExportExcelUtils {
+    /**
+     * 创建excel文档,
+     * @param list 数据
+     * @param keys list中map的key数组集合
+     * @param columnNames excel的列名
+     * */
+    public static Workbook createWorkBook(List<Map<String, Object>> list, String []keys, String columnNames[]) {
+        // 创建excel工作簿
+        Workbook wb = new HSSFWorkbook();
+        // 创建第一个sheet(页),并命名
+        Sheet sheet = wb.createSheet(list.get(0).get("sheetName").toString());
+        // 手动设置列宽。第一个参数表示要为第几列设;,第二个参数表示列的宽度,n为列高的像素数。
+        for(int i=0;i<keys.length;i++){
+            sheet.setColumnWidth((short) i, (short) (35.7 * 150));
+        }
+
+        // 创建第一行
+        Row row = sheet.createRow((short) 0);
+
+        // 创建两种单元格格式
+        CellStyle cs = wb.createCellStyle();
+        CellStyle cs2 = wb.createCellStyle();
+
+        // 创建两种字体
+        Font f = wb.createFont();
+        Font f2 = wb.createFont();
+
+        // 创建第一种字体样式(用于列名)
+        f.setFontHeightInPoints((short) 10);
+        f.setColor(IndexedColors.BLACK.getIndex());
+        f.setBoldweight(Font.BOLDWEIGHT_BOLD);
+
+        // 创建第二种字体样式(用于值)
+        f2.setFontHeightInPoints((short) 10);
+        f2.setColor(IndexedColors.BLACK.getIndex());
+
+//      Font f3=wb.createFont();
+//      f3.setFontHeightInPoints((short) 10);
+//      f3.setColor(IndexedColors.RED.getIndex());
+
+        // 设置第一种单元格的样式(用于列名)
+        cs.setFont(f);
+        cs.setBorderLeft(CellStyle.BORDER_THIN);
+        cs.setBorderRight(CellStyle.BORDER_THIN);
+        cs.setBorderTop(CellStyle.BORDER_THIN);
+        cs.setBorderBottom(CellStyle.BORDER_THIN);
+        cs.setAlignment(CellStyle.ALIGN_CENTER);
+
+        // 设置第二种单元格的样式(用于值)
+        cs2.setFont(f2);
+        cs2.setBorderLeft(CellStyle.BORDER_THIN);
+        cs2.setBorderRight(CellStyle.BORDER_THIN);
+        cs2.setBorderTop(CellStyle.BORDER_THIN);
+        cs2.setBorderBottom(CellStyle.BORDER_THIN);
+        cs2.setAlignment(CellStyle.ALIGN_CENTER);
+        //设置列名
+        for(int i=0;i<columnNames.length;i++){
+            Cell cell = row.createCell(i);
+            cell.setCellValue(columnNames[i]);
+            cell.setCellStyle(cs);
+        }
+        //设置每行每列的值
+        for (short i = 1; i < list.size(); i++) {
+            // Row 行,Cell 方格 , Row 和 Cell 都是从0开始计数的
+            // 创建一行,在页sheet上
+            Row row1 = sheet.createRow((short) i);
+            // 在row行上创建一个方格
+            for(short j=0;j<keys.length;j++){
+                Cell cell = row1.createCell(j);
+                cell.setCellValue(list.get(i).get(keys[j]) == null?" ": list.get(i).get(keys[j]).toString());
+                cell.setCellStyle(cs2);
+            }
+        }
+        return wb;
+    }
+
+}

+ 33 - 0
src/main/java/com/mysiteforme/admin/common/StringLogger.java

@@ -0,0 +1,33 @@
+package com.mysiteforme.admin.common;
+
+/**
+ * @Title:
+ * @Description: TODO
+ * @Author: WuNing
+ * @Date: Created in 2018/11/1 17:36
+ */
+public  class StringLogger {
+    public static String GetZipNameByCode(String code)
+    {
+        switch (code)
+        {
+            case "3146":
+                return "VIC";
+            case"2137":
+                return "NSW";
+            case"7005":
+                return "TAS";
+            case"5000":
+                return "SA";
+            case"6000":
+                return "WA";
+            case"2603":
+                return "ACT";
+            case"0800":
+                return "NT";
+            case"4103":
+                return "QLD";
+        }
+        return null;
+    }
+}

+ 19 - 0
src/main/java/com/mysiteforme/admin/common/annotation/SysLog.java

@@ -0,0 +1,19 @@
+package com.mysiteforme.admin.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;
+
+/**
+ * 系统日志注解
+ *
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface SysLog {
+
+	String value() default "";
+}

+ 15 - 0
src/main/java/com/mysiteforme/admin/common/consts/ConstValuesUtils.java

@@ -0,0 +1,15 @@
+package com.mysiteforme.admin.common.consts;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ConstValuesUtils {
+    public static String productPath;
+
+    @Value("${productPath}")
+    public void setProductPath(String productPath){
+        ConstValuesUtils.productPath = productPath;
+    }
+}

+ 34 - 0
src/main/java/com/mysiteforme/admin/common/consts/PushKind.java

@@ -0,0 +1,34 @@
+package com.mysiteforme.admin.common.consts;
+
+public enum PushKind {
+    PUSHALL("PUSHALL",20),
+    PUSHSTATE("PUSHSTATE",10),
+    PUSHZIPCODE("PUSHZIPCODE",11),
+    PUSHEMAIL("PUSHEMAIL",12),
+    PUSHPHONE("PUSHPHONE",13),
+    PUSHFACEBOOK("PUSHFACEBOOK",14);
+
+    String name;
+    int value;
+
+    PushKind(String name, int value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public void setValue(int value) {
+        this.value = value;
+    }
+}

+ 52 - 0
src/main/java/com/mysiteforme/admin/common/exception/RRException.java

@@ -0,0 +1,52 @@
+package com.mysiteforme.admin.common.exception;
+
+/**
+ * 自定义异常
+ *
+ */
+public class RRException extends RuntimeException {
+	private static final long serialVersionUID = 1L;
+	
+    private String msg;
+    private int code = 500;
+    
+    public RRException(String msg) {
+		super(msg);
+		this.msg = msg;
+	}
+	
+	public RRException(String msg, Throwable e) {
+		super(msg, e);
+		this.msg = msg;
+	}
+	
+	public RRException(String msg, int code) {
+		super(msg);
+		this.msg = msg;
+		this.code = code;
+	}
+	
+	public RRException(String msg, int code, Throwable e) {
+		super(msg, e);
+		this.msg = msg;
+		this.code = code;
+	}
+
+	public String getMsg() {
+		return msg;
+	}
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+	
+	
+}

+ 54 - 0
src/main/java/com/mysiteforme/admin/common/exception/RRExceptionHandler.java

@@ -0,0 +1,54 @@
+package com.mysiteforme.admin.common.exception;
+
+import com.mysiteforme.admin.common.utils.R;
+import org.apache.shiro.authz.AuthorizationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.NoHandlerFoundException;
+
+/**
+ * 异常处理器
+ */
+@RestControllerAdvice
+public class RRExceptionHandler {
+	private Logger logger = LoggerFactory.getLogger(getClass());
+
+	/**
+	 * 处理自定义异常
+	 */
+	@ExceptionHandler(RRException.class)
+	public R handleRRException(RRException e){
+		R r = new R();
+		r.put("code", e.getCode());
+		r.put("msg", e.getMessage());
+
+		return r;
+	}
+
+	@ExceptionHandler(NoHandlerFoundException.class)
+	public R handlerNoFoundException(Exception e) {
+		logger.error(e.getMessage(), e);
+		return R.error(404, "路径不存在,请检查路径是否正确");
+	}
+
+	@ExceptionHandler(DuplicateKeyException.class)
+	public R handleDuplicateKeyException(DuplicateKeyException e){
+		logger.error(e.getMessage(), e);
+		return R.error("数据库中已存在该记录");
+	}
+
+	@ExceptionHandler(AuthorizationException.class)
+	public R handleAuthorizationException(AuthorizationException e){
+		logger.error(e.getMessage(), e);
+		return R.error("没有权限,请联系管理员授权");
+	}
+
+	@ExceptionHandler(Exception.class)
+	public R handleException(Exception e){
+		logger.error(e.getMessage(), e);
+		return R.error();
+	}
+}

+ 11 - 0
src/main/java/com/mysiteforme/admin/common/utils/ConfigConstant.java

@@ -0,0 +1,11 @@
+package com.mysiteforme.admin.common.utils;
+
+/**
+ * 系统参数相关Key
+ */
+public class ConfigConstant {
+    /**
+     * 云存储配置KEY
+     */
+    public final static String CLOUD_STORAGE_CONFIG_KEY = "CLOUD_STORAGE_CONFIG_KEY";
+}

+ 180 - 0
src/main/java/com/mysiteforme/admin/common/utils/Constant.java

@@ -0,0 +1,180 @@
+package com.mysiteforme.admin.common.utils;
+
+/**
+ * 常量
+ */
+public class Constant {
+	/** 超级管理员ID */
+	public static final int SUPER_ADMIN = 1;
+    public static final String WISELIST_MATE_PCODE = "wiselist_mate_pcode";
+	/**
+	 * 菜单类型
+	 */
+    public enum MenuType {
+        /**
+         * 目录
+         */
+    	CATALOG(0),
+        /**
+         * 菜单
+         */
+        MENU(1),
+        /**
+         * 按钮
+         */
+        BUTTON(2);
+
+        private int value;
+
+        MenuType(int value) {
+            this.value = value;
+        }
+
+        public int getValue() {
+            return value;
+        }
+    }
+    
+    /**
+     * 定时任务状态
+     *
+     */
+    public enum ScheduleStatus {
+        /**
+         * 正常
+         */
+    	NORMAL(0),
+        /**
+         * 暂停
+         */
+    	PAUSE(1);
+
+        private int value;
+
+        ScheduleStatus(int value) {
+            this.value = value;
+        }
+        
+        public int getValue() {
+            return value;
+        }
+    }
+
+    /**
+     * 产品类型
+     *
+     */
+    public enum ProductType {
+        /**
+         *
+         */
+        Coles("Coles",10),
+        /**
+         * 暂停
+         */
+        WoolWorths("WoolWorths",20);
+
+
+        String name;
+        int value;
+
+        ProductType(String name, int value) {
+            this.name = name;
+            this.value = value;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public int getValue() {
+            return value;
+        }
+
+        public void setValue(int value) {
+            this.value = value;
+        }
+    }
+
+    /**
+     * Coles州编号及名称
+     *
+     */
+    public enum ColesState {
+        VIC("VIC", "3151"),
+        NSW("NSW", "2089"),
+        QLD("QLD", "4000"),
+        SA("SA", "5000"),
+        TAS("TAS", "7005"),
+        WA("WA", "6280"),
+        NT("NT", "0830"),
+        ACT("ACT", "2601");
+
+        String name;
+        String value;
+
+        ColesState(String name, String value) {
+            this.name = name;
+            this.value = value;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getValue() {
+            return value;
+        }
+
+        public void setValue(String value) {
+            this.value = value;
+        }
+    }
+
+    /**
+     * Coles州编号及名称
+     *
+     */
+    public enum WoolState {
+        NSW("NSW", "2204"),
+        ACT("ACT", "2602"),
+        QLD("QLD", "4007"),
+        SA("SA", "5061"),
+        VIC("VIC", "3147"),
+        TAS("TAS", "7005"),
+        NT("NT", "0800"),
+        WA("WA", "6008");
+
+        String name;
+        String value;
+
+        WoolState(String name, String value) {
+            this.name = name;
+            this.value = value;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getValue() {
+            return value;
+        }
+
+        public void setValue(String value) {
+            this.value = value;
+        }
+    }
+}

+ 172 - 0
src/main/java/com/mysiteforme/admin/common/utils/DateUtils.java

@@ -0,0 +1,172 @@
+/**
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.mysiteforme.admin.common.utils;
+
+import org.apache.commons.lang.StringUtils;
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 日期处理
+ *
+ */
+public class DateUtils {
+	/** 时间格式(yyyy-MM-dd) */
+	public final static String DATE_PATTERN = "yyyy-MM-dd";
+	/** 时间格式(yyyy-MM-dd HH:mm:ss) */
+	public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     * @param date  日期
+     * @return  返回yyyy-MM-dd格式日期
+     */
+	public static String format(Date date) {
+        return format(date, DATE_PATTERN);
+    }
+
+    /**
+     * 日期格式化 日期格式为:yyyy-MM-dd
+     * @param date  日期
+     * @param pattern  格式,如:DateUtils.DATE_TIME_PATTERN
+     * @return  返回yyyy-MM-dd格式日期
+     */
+    public static String format(Date date, String pattern) {
+        if(date != null){
+            SimpleDateFormat df = new SimpleDateFormat(pattern);
+            return df.format(date);
+        }
+        return null;
+    }
+
+    /**
+     * 字符串转换成日期
+     * @param strDate 日期字符串
+     * @param pattern 日期的格式,如:DateUtils.DATE_TIME_PATTERN
+     */
+    public static Date stringToDate(String strDate, String pattern) {
+        if (StringUtils.isBlank(strDate)){
+            return null;
+        }
+
+        DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern);
+        return fmt.parseLocalDateTime(strDate).toDate();
+    }
+
+    /**
+     * 根据周数,获取开始日期、结束日期
+     * @param week  周期  0本周,-1上周,-2上上周,1下周,2下下周
+     * @return  返回date[0]开始日期、date[1]结束日期
+     */
+    public static Date[] getWeekStartAndEnd(int week) {
+        DateTime dateTime = new DateTime();
+        LocalDate date = new LocalDate(dateTime.plusWeeks(week));
+
+        date = date.dayOfWeek().withMinimumValue();
+        Date beginDate = date.toDate();
+        Date endDate = date.plusDays(6).toDate();
+        return new Date[]{beginDate, endDate};
+    }
+
+    /**
+     * 对日期的【秒】进行加/减
+     *
+     * @param date 日期
+     * @param seconds 秒数,负数为减
+     * @return 加/减几秒后的日期
+     */
+    public static Date addDateSeconds(Date date, int seconds) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusSeconds(seconds).toDate();
+    }
+
+    /**
+     * 对日期的【分钟】进行加/减
+     *
+     * @param date 日期
+     * @param minutes 分钟数,负数为减
+     * @return 加/减几分钟后的日期
+     */
+    public static Date addDateMinutes(Date date, int minutes) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusMinutes(minutes).toDate();
+    }
+
+    /**
+     * 对日期的【小时】进行加/减
+     *
+     * @param date 日期
+     * @param hours 小时数,负数为减
+     * @return 加/减几小时后的日期
+     */
+    public static Date addDateHours(Date date, int hours) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusHours(hours).toDate();
+    }
+
+    /**
+     * 对日期的【天】进行加/减
+     *
+     * @param date 日期
+     * @param days 天数,负数为减
+     * @return 加/减几天后的日期
+     */
+    public static Date addDateDays(Date date, int days) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusDays(days).toDate();
+    }
+
+    /**
+     * 对日期的【周】进行加/减
+     *
+     * @param date 日期
+     * @param weeks 周数,负数为减
+     * @return 加/减几周后的日期
+     */
+    public static Date addDateWeeks(Date date, int weeks) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusWeeks(weeks).toDate();
+    }
+
+    /**
+     * 对日期的【月】进行加/减
+     *
+     * @param date 日期
+     * @param months 月数,负数为减
+     * @return 加/减几月后的日期
+     */
+    public static Date addDateMonths(Date date, int months) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusMonths(months).toDate();
+    }
+
+    /**
+     * 对日期的【年】进行加/减
+     *
+     * @param date 日期
+     * @param years 年数,负数为减
+     * @return 加/减几年后的日期
+     */
+    public static Date addDateYears(Date date, int years) {
+        DateTime dateTime = new DateTime(date);
+        return dateTime.plusYears(years).toDate();
+    }
+}

+ 57 - 0
src/main/java/com/mysiteforme/admin/common/utils/DealStrSub.java

@@ -0,0 +1,57 @@
+package com.mysiteforme.admin.common.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @Title: 正则表达式
+ * @Description: 处理字符串的抽取
+ * @Author: WuNing
+ * @Date: Created in 2018/9/1 14:13
+ */
+public class DealStrSub {
+    /**
+     * 正则表达式匹配两个指定字符串中间的内容
+     * @param soap
+     * @return
+     */
+    public static List<String> getSubUtil(String soap, String rgex){
+        List<String> list = new ArrayList<String>();
+        Pattern pattern = Pattern.compile(rgex);// 匹配的模式
+        Matcher m = pattern.matcher(soap);
+        while (m.find()) {
+            int i = 1;
+            list.add(m.group(i));
+            i++;
+        }
+        return list;
+    }
+
+    /**
+     * 返回单个字符串,若匹配到多个的话就返回第一个,方法与getSubUtil一样
+     * @param soap
+     * @param rgex
+     * @return
+     */
+    public static String getSubUtilSimple(String soap,String rgex){
+        Pattern pattern = Pattern.compile(rgex);// 匹配的模式
+        Matcher m = pattern.matcher(soap);
+        while(m.find()){
+            return m.group(1);
+        }
+        return "";
+    }
+
+    /**
+     * 测试
+     * @param args
+     */
+    public static void main(String[] args) {
+        String str = "abc3443abcfgjhgabcgfjabc";
+        String rgex = "abc(.*?)abc";
+        System.out.println(getSubUtil(str,rgex));
+        System.out.println(getSubUtilSimple(str, rgex));
+    }
+}

+ 24 - 0
src/main/java/com/mysiteforme/admin/common/utils/HttpContextUtils.java

@@ -0,0 +1,24 @@
+package com.mysiteforme.admin.common.utils;
+
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class HttpContextUtils {
+
+	public static HttpServletRequest getHttpServletRequest() {
+		return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+	}
+
+	public static String getDomain(){
+		HttpServletRequest request = getHttpServletRequest();
+		StringBuffer url = request.getRequestURL();
+		return url.delete(url.length() - request.getRequestURI().length(), url.length()).toString();
+	}
+
+	public static String getOrigin(){
+		HttpServletRequest request = getHttpServletRequest();
+		return request.getHeader("Origin");
+	}
+}

+ 54 - 0
src/main/java/com/mysiteforme/admin/common/utils/IPUtils.java

@@ -0,0 +1,54 @@
+package com.mysiteforme.admin.common.utils;
+
+import com.alibaba.druid.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * IP地址
+ */
+public class IPUtils {
+	private static Logger logger = LoggerFactory.getLogger(IPUtils.class);
+
+	/**
+	 * 获取IP地址
+	 * 
+	 * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
+	 * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
+	 */
+	public static String getIpAddr(HttpServletRequest request) {
+    	String ip = null;
+        try {
+            ip = request.getHeader("x-forwarded-for");
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("Proxy-Client-IP");
+            }
+            if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("WL-Proxy-Client-IP");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_CLIENT_IP");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+            }
+            if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+            }
+        } catch (Exception e) {
+        	logger.error("IPUtils ERROR ", e);
+        }
+        
+//        //使用代理,则获取第一个IP地址
+//        if(StringUtils.isEmpty(ip) && ip.length() > 15) {
+//			if(ip.indexOf(",") > 0) {
+//				ip = ip.substring(0, ip.indexOf(","));
+//			}
+//		}
+        
+        return ip;
+    }
+	
+}

+ 114 - 0
src/main/java/com/mysiteforme/admin/common/utils/JedisUtils.java

@@ -0,0 +1,114 @@
+package com.mysiteforme.admin.common.utils;
+
+import org.springframework.beans.factory.annotation.Value;
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.JedisPool;
+import redis.clients.jedis.JedisPoolConfig;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *       timeout: 160000  # 连接超时时长(毫秒)
+ *       pool:
+ *         max-active: 1000  # 连接池最大连接数(使用负值表示没有限制)
+ *         max-wait: -1      # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ *         max-idle: 100      # 连接池中的最大空闲连接
+ *         min-idle: 5       # 连接池中的最小空闲连接
+ */
+public class JedisUtils {
+    private static String jedisHost;
+    @Value("${spring.redis.host}")
+    public void setJedisHost(String jedisHost){
+        JedisUtils.jedisHost = jedisHost;
+    }
+
+    private static Integer jedisPort;
+    @Value("${spring.redis.port}")
+    public void setJedisPort(Integer jedisPort){
+        JedisUtils.jedisPort = jedisPort;
+    }
+
+    private static String jedisPassword;
+    @Value("${spring.redis.password}")
+    public void setJedisPassword(String jedisPassword){
+        JedisUtils.jedisPassword = jedisPassword;
+    }
+
+    private static String jedisTimeOut;
+    @Value("${spring.redis.pool.timeout}")
+    public void setJedisTimeOut(String jedisTimeOut){
+        JedisUtils.jedisTimeOut = jedisTimeOut;
+    }
+
+    private static int jedisMaxIdle;
+    @Value("${spring.redis.pool.max-idle}")
+    public void setJedisMaxIdle(int jedisMaxIdle){
+        JedisUtils.jedisMaxIdle = jedisMaxIdle;
+    }
+
+    private static int jedisMinIdle;
+    @Value("${spring.redis.pool.min-idle}")
+    public void setJedisMinIdle(int jedisMinIdle){
+        JedisUtils.jedisMinIdle = jedisMinIdle;
+    }
+    private JedisUtils(){}
+
+    private static class RedisUtilHolder{
+        private static final JedisUtils instance = new JedisUtils();
+    }
+
+    public static JedisUtils getInstance(){
+        return RedisUtilHolder.instance;
+    }
+
+    private static Map<String,JedisPool> maps = new HashMap<String,JedisPool>();
+
+    private static JedisPool getPool(){
+
+        String key = jedisHost+":"+jedisPort;
+        JedisPool pool = null;
+        if(!maps.containsKey(key))
+        {
+            JedisPoolConfig config = new JedisPoolConfig();
+            config.setMaxIdle(jedisMaxIdle);
+            config.setTestOnBorrow(true);
+            config.setTestOnReturn(true);
+
+            pool = new JedisPool(config,jedisHost,jedisPort);
+            maps.put(key, pool);
+        }
+        else
+        {
+            pool = maps.get(key);
+        }
+        return pool;
+    }
+
+    public Jedis getJedis()
+    {
+        Jedis jedis = null;
+        int count = 0;
+        do
+        {
+            try
+            {
+                jedis = getPool().getResource();
+            }
+            catch (Exception e)
+            {
+                System.out.println("get redis master1 failed!" + e);
+                getPool().returnBrokenResource(jedis);
+            }
+        }
+        while(jedis == null && count<jedisMinIdle);
+        return jedis;
+    }
+
+    public void closeJedis(Jedis jedis, String ip, int port){
+        if(jedis != null)
+        {
+            getPool().returnResource(jedis);
+        }
+    }
+}

+ 32 - 0
src/main/java/com/mysiteforme/admin/common/utils/MapUtils.java

@@ -0,0 +1,32 @@
+/**
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.mysiteforme.admin.common.utils;
+
+import java.util.HashMap;
+
+
+/**
+ * Map工具类
+ *
+ */
+public class MapUtils extends HashMap<String, Object> {
+
+    @Override
+    public MapUtils put(String key, Object value) {
+        super.put(key, value);
+        return this;
+    }
+}

+ 106 - 0
src/main/java/com/mysiteforme/admin/common/utils/PageUtils.java

@@ -0,0 +1,106 @@
+/**
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.mysiteforme.admin.common.utils;
+
+import com.baomidou.mybatisplus.plugins.Page;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 分页工具类
+ *
+ */
+public class PageUtils implements Serializable {
+	private static final long serialVersionUID = 1L;
+	//总记录数
+	private int totalCount;
+	//每页记录数
+	private int pageSize;
+	//总页数
+	private int totalPage;
+	//当前页数
+	private int currPage;
+	//列表数据
+	private List<?> list;
+	
+	/**
+	 * 分页
+	 * @param list        列表数据
+	 * @param totalCount  总记录数
+	 * @param pageSize    每页记录数
+	 * @param currPage    当前页数
+	 */
+	public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
+		this.list = list;
+		this.totalCount = totalCount;
+		this.pageSize = pageSize;
+		this.currPage = currPage;
+		this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
+	}
+
+	/**
+	 * 分页
+	 */
+	public PageUtils(Page<?> page) {
+		this.list = page.getRecords();
+		this.totalCount = (int)page.getTotal();
+		this.pageSize = page.getSize();
+		this.currPage = page.getCurrent();
+		this.totalPage = (int)page.getPages();
+	}
+
+	public int getTotalCount() {
+		return totalCount;
+	}
+
+	public void setTotalCount(int totalCount) {
+		this.totalCount = totalCount;
+	}
+
+	public int getPageSize() {
+		return pageSize;
+	}
+
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+
+	public int getTotalPage() {
+		return totalPage;
+	}
+
+	public void setTotalPage(int totalPage) {
+		this.totalPage = totalPage;
+	}
+
+	public int getCurrPage() {
+		return currPage;
+	}
+
+	public void setCurrPage(int currPage) {
+		this.currPage = currPage;
+	}
+
+	public List<?> getList() {
+		return list;
+	}
+
+	public void setList(List<?> list) {
+		this.list = list;
+	}
+	
+}

+ 86 - 0
src/main/java/com/mysiteforme/admin/common/utils/Query.java

@@ -0,0 +1,86 @@
+/**
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.mysiteforme.admin.common.utils;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import org.apache.commons.lang.StringUtils;
+import com.mysiteforme.admin.common.xss.SQLFilter;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * 查询参数
+ */
+public class Query<T> extends LinkedHashMap<String, Object> {
+	private static final long serialVersionUID = 1L;
+    /**
+     * mybatis-plus分页参数
+     */
+    private Page<T> page;
+    /**
+     * 当前页码
+     */
+    private int currPage = 1;
+    /**
+     * 每页条数
+     */
+    private int limit = 10;
+
+    public Query(Map<String, Object> params){
+        this.putAll(params);
+
+        //分页参数
+        if(params.get("page") != null){
+            currPage = Integer.parseInt((String)params.get("page"));
+        }
+        if(params.get("limit") != null){
+            limit = Integer.parseInt((String)params.get("limit"));
+        }
+
+        this.put("offset", (currPage - 1) * limit);
+        this.put("page", currPage);
+        this.put("limit", limit);
+
+        //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险)
+        String sidx = SQLFilter.sqlInject((String)params.get("sidx"));
+        String order = SQLFilter.sqlInject((String)params.get("order"));
+        this.put("sidx", sidx);
+        this.put("order", order);
+
+        //mybatis-plus分页
+        this.page = new Page<>(currPage, limit);
+
+        //排序
+        if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){
+            this.page.setOrderByField(sidx);
+            this.page.setAsc("ASC".equalsIgnoreCase(order));
+        }
+
+    }
+
+    public Page<T> getPage() {
+        return page;
+    }
+
+    public int getCurrPage() {
+        return currPage;
+    }
+
+    public int getLimit() {
+        return limit;
+    }
+}

+ 55 - 0
src/main/java/com/mysiteforme/admin/common/utils/R.java

@@ -0,0 +1,55 @@
+package com.mysiteforme.admin.common.utils;
+
+import org.apache.http.HttpStatus;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 返回数据
+ *
+ */
+public class R extends HashMap<String, Object> {
+	private static final long serialVersionUID = 1L;
+	
+	public R() {
+		put("code", 0);
+		put("msg", "success");
+	}
+	
+	public static R error() {
+		return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员");
+	}
+	
+	public static R error(String msg) {
+		return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg);
+	}
+	
+	public static R error(int code, String msg) {
+		R r = new R();
+		r.put("code", code);
+		r.put("msg", msg);
+		return r;
+	}
+
+	public static R ok(String msg) {
+		R r = new R();
+		r.put("msg", msg);
+		return r;
+	}
+	
+	public static R ok(Map<String, Object> map) {
+		R r = new R();
+		r.putAll(map);
+		return r;
+	}
+	
+	public static R ok() {
+		return new R();
+	}
+
+	public R put(String key, Object value) {
+		super.put(key, value);
+		return this;
+	}
+}

+ 11 - 0
src/main/java/com/mysiteforme/admin/common/utils/RedisKeys.java

@@ -0,0 +1,11 @@
+package com.mysiteforme.admin.common.utils;
+
+/**
+ * Redis所有Keys
+ *
+ */
+public class RedisKeys {
+    public static String getSysConfigKey(String key){
+        return "sys:config:" + key;
+    }
+}

+ 42 - 0
src/main/java/com/mysiteforme/admin/common/utils/SpringContextUtils.java

@@ -0,0 +1,42 @@
+package com.mysiteforme.admin.common.utils;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ * Spring Context 工具类
+ *
+ */
+@Component
+public class SpringContextUtils implements ApplicationContextAware {
+	public static ApplicationContext applicationContext;
+
+	@Override
+	public void setApplicationContext(ApplicationContext applicationContext)
+			throws BeansException {
+		SpringContextUtils.applicationContext = applicationContext;
+	}
+
+	public static Object getBean(String name) {
+		return applicationContext.getBean(name);
+	}
+
+	public static <T> T getBean(String name, Class<T> requiredType) {
+		return applicationContext.getBean(name, requiredType);
+	}
+
+	public static boolean containsBean(String name) {
+		return applicationContext.containsBean(name);
+	}
+
+	public static boolean isSingleton(String name) {
+		return applicationContext.isSingleton(name);
+	}
+
+	public static Class<? extends Object> getType(String name) {
+		return applicationContext.getType(name);
+	}
+
+}

+ 22 - 0
src/main/java/com/mysiteforme/admin/common/validator/Assert.java

@@ -0,0 +1,22 @@
+package com.mysiteforme.admin.common.validator;
+
+import com.mysiteforme.admin.common.exception.RRException;
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * 数据校验
+ */
+public abstract class Assert {
+
+    public static void isBlank(String str, String message) {
+        if (StringUtils.isBlank(str)) {
+            throw new RRException(message);
+        }
+    }
+
+    public static void isNull(Object object, String message) {
+        if (object == null) {
+            throw new RRException(message);