Bladeren bron

1.重构项目结构,精简分层,去掉manager层
2.去掉thymeleaf模板,使用beetl作为视图解析器
3.代码生成器模板使用beetl实现
4.后台管理去掉token交互逻辑,与接口调用验证分开

zhouchenglin 6 jaren geleden
bovenliggende
commit
84c41c38c1
100 gewijzigde bestanden met toevoegingen van 2629 en 3098 verwijderingen
  1. 2 2
      README.md
  2. 164 183
      pom.xml
  3. 6 7
      src/main/java/net/chenlin/dp/DpApplication.java
  4. 1 2
      src/main/java/net/chenlin/dp/common/annotation/DataSource.java
  5. 1 5
      src/main/java/net/chenlin/dp/common/annotation/SysLog.java
  6. 1 2
      src/main/java/net/chenlin/dp/common/aspect/DataSourceAspect.java
  7. 13 18
      src/main/java/net/chenlin/dp/common/aspect/SysLogAspect.java
  8. 1 5
      src/main/java/net/chenlin/dp/common/constant/MsgConstant.java
  9. 1 36
      src/main/java/net/chenlin/dp/common/constant/SystemConstant.java
  10. 1 5
      src/main/java/net/chenlin/dp/common/entity/Page.java
  11. 1 5
      src/main/java/net/chenlin/dp/common/entity/Query.java
  12. 1 5
      src/main/java/net/chenlin/dp/common/entity/R.java
  13. 1 5
      src/main/java/net/chenlin/dp/common/exception/RRException.java
  14. 17 8
      src/main/java/net/chenlin/dp/common/exception/RRExceptionHandler.java
  15. 44 0
      src/main/java/net/chenlin/dp/common/support/config/BeetlConfig.java
  16. 0 45
      src/main/java/net/chenlin/dp/common/support/config/FilterConfig.java
  17. 2 6
      src/main/java/net/chenlin/dp/common/support/config/QuartzConfig.java
  18. 64 40
      src/main/java/net/chenlin/dp/common/support/config/ShiroConfig.java
  19. 61 12
      src/main/java/net/chenlin/dp/common/support/config/WebConfig.java
  20. 3 4
      src/main/java/net/chenlin/dp/common/support/orm/db/DataSourceEnum.java
  21. 1 2
      src/main/java/net/chenlin/dp/common/support/orm/db/DynamicDataSource.java
  22. 2 6
      src/main/java/net/chenlin/dp/common/support/orm/db/DynamicDataSourceConfig.java
  23. 0 67
      src/main/java/net/chenlin/dp/common/support/orm/mybatis/PackagesSqlSessionFactoryBean.java
  24. 1 5
      src/main/java/net/chenlin/dp/common/support/orm/plugins/PaginationResultSetHandlerInterceptor.java
  25. 1 5
      src/main/java/net/chenlin/dp/common/support/orm/plugins/PaginationStatementHandlerInterceptor.java
  26. 112 0
      src/main/java/net/chenlin/dp/common/support/properties/BeetlProperties.java
  27. 60 0
      src/main/java/net/chenlin/dp/common/support/properties/GlobalProperties.java
  28. 72 5
      src/main/java/net/chenlin/dp/common/utils/CommonUtils.java
  29. 1 5
      src/main/java/net/chenlin/dp/common/utils/DateUtils.java
  30. 0 21
      src/main/java/net/chenlin/dp/common/utils/HttpContextUtils.java
  31. 0 71
      src/main/java/net/chenlin/dp/common/utils/IpUtils.java
  32. 1 5
      src/main/java/net/chenlin/dp/common/utils/JSONUtils.java
  33. 1 2
      src/main/java/net/chenlin/dp/common/utils/JdbcUtils.java
  34. 1 5
      src/main/java/net/chenlin/dp/common/utils/MD5Utils.java
  35. 1 2
      src/main/java/net/chenlin/dp/common/utils/PropertiesUtils.java
  36. 37 14
      src/main/java/net/chenlin/dp/common/utils/ShiroUtils.java
  37. 1 5
      src/main/java/net/chenlin/dp/common/utils/SpringContextUtils.java
  38. 10 9
      src/main/java/net/chenlin/dp/common/utils/UploadUtils.java
  39. 77 5
      src/main/java/net/chenlin/dp/common/utils/WebUtils.java
  40. 1 5
      src/main/java/net/chenlin/dp/common/xss/HTMLFilter.java
  41. 1 5
      src/main/java/net/chenlin/dp/common/xss/SQLFilter.java
  42. 1 5
      src/main/java/net/chenlin/dp/common/xss/XssFilter.java
  43. 1 5
      src/main/java/net/chenlin/dp/common/xss/XssHttpServletRequestWrapper.java
  44. 27 0
      src/main/java/net/chenlin/dp/modules/Generator.java
  45. 0 27
      src/main/java/net/chenlin/dp/modules/base/dao/SysMacroMapper.java
  46. 0 30
      src/main/java/net/chenlin/dp/modules/base/manager/SysAreaManager.java
  47. 0 34
      src/main/java/net/chenlin/dp/modules/base/manager/SysMacroManager.java
  48. 0 64
      src/main/java/net/chenlin/dp/modules/base/manager/impl/SysAreaManagerImpl.java
  49. 0 73
      src/main/java/net/chenlin/dp/modules/base/manager/impl/SysMacroManagerImpl.java
  50. 0 31
      src/main/java/net/chenlin/dp/modules/base/service/SysAreaService.java
  51. 0 32
      src/main/java/net/chenlin/dp/modules/base/service/SysMacroService.java
  52. 0 93
      src/main/java/net/chenlin/dp/modules/base/service/impl/SysMacroServiceImpl.java
  53. 0 26
      src/main/java/net/chenlin/dp/modules/generator/constant/GenConstant.java
  54. 0 26
      src/main/java/net/chenlin/dp/modules/generator/manager/SysGeneratorManager.java
  55. 0 44
      src/main/java/net/chenlin/dp/modules/generator/manager/impl/SysGeneratorManagerImpl.java
  56. 0 23
      src/main/java/net/chenlin/dp/modules/generator/service/SysGeneratorService.java
  57. 0 68
      src/main/java/net/chenlin/dp/modules/generator/utils/VelocityUtils.java
  58. 0 20
      src/main/java/net/chenlin/dp/modules/quartz/dao/QuartzJobLogMapper.java
  59. 0 19
      src/main/java/net/chenlin/dp/modules/quartz/dao/QuartzJobMapper.java
  60. 0 27
      src/main/java/net/chenlin/dp/modules/quartz/manager/QuartzJobLogManager.java
  61. 0 33
      src/main/java/net/chenlin/dp/modules/quartz/manager/QuartzJobManager.java
  62. 0 48
      src/main/java/net/chenlin/dp/modules/quartz/manager/impl/QuartzJobLogManagerImpl.java
  63. 0 66
      src/main/java/net/chenlin/dp/modules/quartz/manager/impl/QuartzJobManagerImpl.java
  64. 0 25
      src/main/java/net/chenlin/dp/modules/quartz/service/QuartzJobLogService.java
  65. 0 35
      src/main/java/net/chenlin/dp/modules/quartz/service/QuartzJobService.java
  66. 0 23
      src/main/java/net/chenlin/dp/modules/quartz/task/TestTask.java
  67. 89 8
      src/main/java/net/chenlin/dp/modules/sys/controller/AbstractController.java
  68. 113 117
      src/main/java/net/chenlin/dp/modules/sys/controller/QuartzJobController.java
  69. 58 62
      src/main/java/net/chenlin/dp/modules/sys/controller/QuartzJobLogController.java
  70. 90 95
      src/main/java/net/chenlin/dp/modules/sys/controller/SysAreaController.java
  71. 61 65
      src/main/java/net/chenlin/dp/modules/sys/controller/SysGeneratorController.java
  72. 1 5
      src/main/java/net/chenlin/dp/modules/sys/controller/SysLogController.java
  73. 48 33
      src/main/java/net/chenlin/dp/modules/sys/controller/SysLoginController.java
  74. 126 131
      src/main/java/net/chenlin/dp/modules/sys/controller/SysMacroController.java
  75. 1 5
      src/main/java/net/chenlin/dp/modules/sys/controller/SysMenuController.java
  76. 1 5
      src/main/java/net/chenlin/dp/modules/sys/controller/SysOrgController.java
  77. 35 15
      src/main/java/net/chenlin/dp/modules/sys/controller/SysPageController.java
  78. 1 5
      src/main/java/net/chenlin/dp/modules/sys/controller/SysRoleController.java
  79. 3 6
      src/main/java/net/chenlin/dp/modules/sys/controller/SysUserController.java
  80. 1 5
      src/main/java/net/chenlin/dp/modules/sys/dao/BaseMapper.java
  81. 19 0
      src/main/java/net/chenlin/dp/modules/sys/dao/QuartzJobLogMapper.java
  82. 14 0
      src/main/java/net/chenlin/dp/modules/sys/dao/QuartzJobMapper.java
  83. 30 25
      src/main/java/net/chenlin/dp/modules/sys/dao/SysAreaMapper.java
  84. 40 28
      src/main/java/net/chenlin/dp/modules/sys/dao/SysGeneratorMapper.java
  85. 6 6
      src/main/java/net/chenlin/dp/modules/sys/dao/SysLogMapper.java
  86. 36 0
      src/main/java/net/chenlin/dp/modules/sys/dao/SysMacroMapper.java
  87. 24 9
      src/main/java/net/chenlin/dp/modules/sys/dao/SysMenuMapper.java
  88. 14 0
      src/main/java/net/chenlin/dp/modules/sys/dao/SysOrgMapper.java
  89. 7 6
      src/main/java/net/chenlin/dp/modules/sys/dao/SysRoleMapper.java
  90. 18 7
      src/main/java/net/chenlin/dp/modules/sys/dao/SysRoleMenuMapper.java
  91. 18 7
      src/main/java/net/chenlin/dp/modules/sys/dao/SysRoleOrgMapper.java
  92. 36 10
      src/main/java/net/chenlin/dp/modules/sys/dao/SysUserMapper.java
  93. 18 7
      src/main/java/net/chenlin/dp/modules/sys/dao/SysUserRoleMapper.java
  94. 12 6
      src/main/java/net/chenlin/dp/modules/sys/dao/SysUserTokenMapper.java
  95. 125 125
      src/main/java/net/chenlin/dp/modules/sys/entity/ColumnEntity.java
  96. 92 92
      src/main/java/net/chenlin/dp/modules/sys/entity/GeneratorParamEntity.java
  97. 144 144
      src/main/java/net/chenlin/dp/modules/sys/entity/QuartzJobEntity.java
  98. 139 139
      src/main/java/net/chenlin/dp/modules/sys/entity/QuartzJobLogEntity.java
  99. 225 225
      src/main/java/net/chenlin/dp/modules/sys/entity/SysAreaEntity.java
  100. 189 189
      src/main/java/net/chenlin/dp/modules/sys/entity/SysMacroEntity.java

+ 2 - 2
README.md

@@ -12,7 +12,7 @@
 - 一个轻量级的Java快速开发框架,基于SpringBoot开发,能快速开发项目并交付
 - 友好的代码结构及注释,便于阅读及二次开发,命名规范和工程分层规约参考阿里巴巴JAVA开发规范
 - 前后端开发封装,快速实现CRUD开发
-- 支持通过velocity模板生成部分代码,可直接生成到项目路径,无须二次部署(见文档)
+- 支持通过beetl模板生成部分代码,可直接生成到项目路径,无须二次部署(见文档)
 - 基于角色的权限管理,支持操作权限和持数据权限
 - 基于Maven模块化开发,可快速扩展个性化业务模块
 - 封装常用开发组件,目前已集成select2、switchery及富文本组件
@@ -23,7 +23,7 @@
 - 核心框架:SpringBoot
 - ORM框架:Mybatis
 - 安全框架:Shiro
-- 模板框架:thymeleaf
+- 模板框架:beetl
 - 主页框架:adminLTE(Bootstrap)
 - JS框架:vue.js
 - 表格插件:bootstrap-table(扩展分页跳转)

+ 164 - 183
pom.xml

@@ -1,172 +1,162 @@
 <?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>
+         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>net.chenlin.dp</groupId>
-	<artifactId>dp</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
-	<packaging>jar</packaging><!-- clean package -->
+    <groupId>net.chenlin.dp</groupId>
+    <artifactId>dp</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
 
-	<name>dp-lte-boot</name>
-	<description>dp-lte开发框架SpringBoot版本</description>
+    <name>dp-lte-boot</name>
+    <description>dp-lte开发框架SpringBoot版本</description>
 
-	<parent>
-		<groupId>org.springframework.boot</groupId>
-		<artifactId>spring-boot-starter-parent</artifactId>
-		<version>1.5.7.RELEASE</version>
-		<relativePath/>
-	</parent>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.0.4.RELEASE</version>
+        <relativePath/>
+    </parent>
 
-	<properties>
-		<!-- base setting -->
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-		<java.version>1.8</java.version>
+    <properties>
+        <!-- base setting -->
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
 
-		<!-- lib versions -->
-		<java-version>1.8</java-version>
-		<mybatis-springboot-version>1.3.0</mybatis-springboot-version>
-		<mysql-version>5.1.38</mysql-version>
-		<druid-version>1.1.2</druid-version>
-		<commons-lang-version>2.6</commons-lang-version>
-		<commons-fileupload-version>1.3.1</commons-fileupload-version>
-		<commons-io-version>2.5</commons-io-version>
-		<commons-codec-version>1.10</commons-codec-version>
-		<commons-configuration-version>1.10</commons-configuration-version>
-		<aspect-version>1.8.10</aspect-version>
-		<shiro-version>1.3.2</shiro-version>
-		<quartz-version>2.2.3</quartz-version>
+        <!-- lib versions -->
+        <java-version>1.8</java-version>
+        <mybatis-springboot-version>1.3.0</mybatis-springboot-version>
+        <mysql-version>5.1.38</mysql-version>
+        <druid-version>1.1.9</druid-version>
+        <commons-lang-version>2.6</commons-lang-version>
+        <commons-fileupload-version>1.3.1</commons-fileupload-version>
+        <commons-io-version>2.5</commons-io-version>
+        <commons-codec-version>1.10</commons-codec-version>
+        <commons-configuration-version>1.10</commons-configuration-version>
+        <aspect-version>1.8.10</aspect-version>
+        <shiro-version>1.3.2</shiro-version>
+        <quartz-version>2.2.3</quartz-version>
         <httpclient-version>4.5.3</httpclient-version>
-        <nekohtml-version>1.9.22</nekohtml-version>
-        <velocity-version>1.7</velocity-version>
-	</properties>
+        <beetl-version>1.1.60.RELEASE</beetl-version>
+    </properties>
 
-	<dependencies>
-		<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-web</artifactId>
-		</dependency>
-		<dependency>
+    <dependencies>
+        <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-thymeleaf</artifactId>
-        </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>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-data-redis</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-configuration-processor</artifactId>
-			<optional>true</optional>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-devtools</artifactId>
-			<optional>true</optional>
-		</dependency>
-		<dependency>
-			<groupId>org.mybatis.spring.boot</groupId>
-			<artifactId>mybatis-spring-boot-starter</artifactId>
-			<version>${mybatis-springboot-version}</version>
-		</dependency>
-		<dependency>
-			<groupId>mysql</groupId>
-			<artifactId>mysql-connector-java</artifactId>
-			<version>${mysql-version}</version><!--$NO-MVN-MAN-VER$-->
-		</dependency>
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>druid-spring-boot-starter</artifactId>
-			<version>${druid-version}</version>
-		</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>
-		<dependency>
-			<groupId>commons-lang</groupId>
-			<artifactId>commons-lang</artifactId>
-			<version>${commons-lang-version}</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-fileupload</groupId>
-			<artifactId>commons-fileupload</artifactId>
-			<version>${commons-fileupload-version}</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-io</groupId>
-			<artifactId>commons-io</artifactId>
-			<version>${commons-io-version}</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-codec</groupId>
-			<artifactId>commons-codec</artifactId>
-			<version>${commons-codec-version}</version><!--$NO-MVN-MAN-VER$-->
-		</dependency>
-		<dependency>
-			<groupId>commons-configuration</groupId>
-			<artifactId>commons-configuration</artifactId>
-			<version>${commons-configuration-version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.aspectj</groupId>
-			<artifactId>aspectjrt</artifactId>
-			<version>${aspect-version}</version><!--$NO-MVN-MAN-VER$-->
-		</dependency>
-		<dependency>
-			<groupId>org.aspectj</groupId>
-			<artifactId>aspectjweaver</artifactId>
-			<version>${aspect-version}</version><!--$NO-MVN-MAN-VER$-->
-		</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.apache.httpcomponents</groupId>
-		    <artifactId>httpclient</artifactId>
-		    <version>${httpclient-version}</version><!--$NO-MVN-MAN-VER$-->
-		</dependency>
-		<dependency>
-		    <groupId>net.sourceforge.nekohtml</groupId>
-		    <artifactId>nekohtml</artifactId>
-		    <version>${nekohtml-version}</version><!--$NO-MVN-MAN-VER$-->
-		</dependency>
-		<dependency>
-			<artifactId>velocity</artifactId>
-			<groupId>org.apache.velocity</groupId>
-			<version>${velocity-version}</version>
-		</dependency>
-	</dependencies>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.ibeetl</groupId>
+            <artifactId>beetl-framework-starter</artifactId>
+            <version>${beetl-version}</version>
+        </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>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>${mybatis-springboot-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>${druid-version}</version>
+        </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>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>${commons-lang-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>${commons-fileupload-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>${commons-io-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>${commons-codec-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-configuration</groupId>
+            <artifactId>commons-configuration</artifactId>
+            <version>${commons-configuration-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjrt</artifactId>
+            <version>${aspect-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjweaver</artifactId>
+            <version>${aspect-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.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>${httpclient-version}</version>
+        </dependency>
+    </dependencies>
 
-	<build>
+    <build>
         <finalName>${project.artifactId}</finalName>
         <plugins>
             <plugin>
@@ -185,30 +175,21 @@
                 </configuration>
             </plugin>
         </plugins>
-	</build>
-
-    <repositories>
-        <repository>
-            <id>public</id>
-            <name>aliyun nexus</name>
-            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-        </repository>
-    </repositories>
-    <pluginRepositories>
-        <pluginRepository>
-            <id>public</id>
-            <name>aliyun nexus</name>
-            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </pluginRepository>
-    </pluginRepositories>
+        <resources>
+            <resource>
+                <directory>src/main/webapp</directory>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
 
 </project>

+ 6 - 7
src/main/java/net/chenlin/dp/DpApplication.java

@@ -1,26 +1,25 @@
 package net.chenlin.dp;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.boot.Banner;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Configuration;
 
 /**
  * 应用启动器
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201793日 上午1:53:12
+ * @author zcl<yczclcn@163.com>
  */
-@Configuration
 @SpringBootApplication
 public class DpApplication {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(DpApplication.class);
+
     public static void main(String[] args) {
         SpringApplication application = new SpringApplication(DpApplication.class);
         application.setBannerMode(Banner.Mode.OFF);
         application.run(args);
+        LOGGER.info("The Dp application has been started successfully!");
     }
 
 }

+ 1 - 2
src/main/java/net/chenlin/dp/common/annotation/DataSource.java

@@ -4,8 +4,7 @@ import java.lang.annotation.*;
 
 /**
  * 数据源注解
- * @author ZhouChenglin
- * @date 2018/2/7
+ * @author zcl<yczclcn@163.com>
  */
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.RUNTIME)

+ 1 - 5
src/main/java/net/chenlin/dp/common/annotation/SysLog.java

@@ -8,11 +8,7 @@ import java.lang.annotation.Target;
 
 /**
  * 系统日志注解
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017814日 下午8:00:45
+ * @author zcl<yczclcn@163.com>
  */
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.RUNTIME)

+ 1 - 2
src/main/java/net/chenlin/dp/common/aspect/DataSourceAspect.java

@@ -17,8 +17,7 @@ import java.lang.reflect.Method;
 
 /**
  * 数据源切面处理
- * @author ZhouChenglin
- * @date 2018/2/7
+ * @author zcl<yczclcn@163.com>
  */
 @Aspect
 @Component

+ 13 - 18
src/main/java/net/chenlin/dp/common/aspect/SysLogAspect.java

@@ -1,9 +1,13 @@
 package net.chenlin.dp.common.aspect;
 
-import java.lang.reflect.Method;
-import javax.servlet.http.HttpServletRequest;
-
-import net.chenlin.dp.common.utils.*;
+import net.chenlin.dp.common.annotation.SysLog;
+import net.chenlin.dp.common.utils.CommonUtils;
+import net.chenlin.dp.common.utils.JSONUtils;
+import net.chenlin.dp.common.utils.ShiroUtils;
+import net.chenlin.dp.common.utils.WebUtils;
+import net.chenlin.dp.modules.sys.dao.SysLogMapper;
+import net.chenlin.dp.modules.sys.entity.SysLogEntity;
+import net.chenlin.dp.modules.sys.entity.SysUserEntity;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
@@ -12,26 +16,19 @@ import org.aspectj.lang.reflect.MethodSignature;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import net.chenlin.dp.common.annotation.SysLog;
-import net.chenlin.dp.modules.sys.entity.SysLogEntity;
-import net.chenlin.dp.modules.sys.entity.SysUserEntity;
-import net.chenlin.dp.modules.sys.manager.SysLogManager;
+import java.lang.reflect.Method;
 
 
 /**
  * 系统日志,切面处理类
- * 
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017828日 上午11:07:35
+ * @author zcl<yczclcn@163.com>
  */
 @Aspect
 @Component
 public class SysLogAspect {
 	
 	@Autowired
-	private SysLogManager sysLogManager;
+	private SysLogMapper sysLogMapper;
 	
 	@Pointcut("@annotation(net.chenlin.dp.common.annotation.SysLog)")
 	public void logPointCut() { 
@@ -71,10 +68,8 @@ public class SysLogAspect {
 		}catch (Exception e){
 
 		}
-		//获取request
-		HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
 		//设置IP地址
-		sysLog.setIp(IpUtils.getIpAddr(request));
+		sysLog.setIp(WebUtils.getIpAddr());
 		//用户名
 		SysUserEntity currUser = ShiroUtils.getUserEntity();
 		if(CommonUtils.isNullOrEmpty(currUser)) {
@@ -91,7 +86,7 @@ public class SysLogAspect {
 		}
 		sysLog.setTime(time);
 		//保存系统日志
-		sysLogManager.saveLog(sysLog);
+		sysLogMapper.save(sysLog);
 	}
 	
 }

+ 1 - 5
src/main/java/net/chenlin/dp/common/constant/MsgConstant.java

@@ -2,11 +2,7 @@ package net.chenlin.dp.common.constant;
 
 /**
  * 系统提示静态变量
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017812日 下午1:33:18
+ * @author zcl<yczclcn@163.com>
  */
 public class MsgConstant {
 

+ 1 - 36
src/main/java/net/chenlin/dp/common/constant/SystemConstant.java

@@ -2,11 +2,7 @@ package net.chenlin.dp.common.constant;
 
 /**
  * 系统级静态变量
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午1:35:38
+ * @author zcl<yczclcn@163.com>
  */
 public class SystemConstant {
 	
@@ -19,37 +15,6 @@ public class SystemConstant {
 	 * 数据标识
 	 */
 	public static final String DATA_ROWS = "rows";
-
-	/**
-	 * 文件上传协议
-	 */
-	private static final String UPLOAD_LOCATION_PROTOCOL = "file:";
-
-	/**
-	 * 文件上传物理路径
-	 */
-	public static String UPLOAD_LOCATION_PATH;
-
-	/**
-	 * 文件上传目录访问路径
-	 */
-	public static final String UPLOAD_LOCATION_MAPPING = "/upload/";
-
-	/**
-	 * 访问映射
-	 * @return
-	 */
-	public static String getResourceHandlerMapping() {
-		return SystemConstant.UPLOAD_LOCATION_MAPPING.concat("**");
-	}
-
-	/**
-	 * 物理地址
-	 * @return
-	 */
-	public static String getResourceLocation() {
-		return SystemConstant.UPLOAD_LOCATION_PROTOCOL.concat(SystemConstant.UPLOAD_LOCATION_PATH);
-	}
 	
 	/**
 	 * 菜单类型

+ 1 - 5
src/main/java/net/chenlin/dp/common/entity/Page.java

@@ -6,11 +6,7 @@ import org.apache.ibatis.session.RowBounds;
 
 /**
  * Mybatis分页参数及查询结果封装. 注意所有序号从1开始
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 上午11:41:07
+ * @author zcl<yczclcn@163.com>
  */
 public class Page<T> extends RowBounds {
     

+ 1 - 5
src/main/java/net/chenlin/dp/common/entity/Query.java

@@ -6,11 +6,7 @@ import java.util.Map;
 
 /**
  * 查询条件
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017811日 下午12:13:58
+ * @author zcl<yczclcn@163.com>
  */
 public class Query extends HashMap<String, Object> {
 	

+ 1 - 5
src/main/java/net/chenlin/dp/common/entity/R.java

@@ -5,11 +5,7 @@ import java.util.Map;
 
 /**
  * 页面响应entity
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 上午11:40:42
+ * @author zcl<yczclcn@163.com>
  */
 public class R extends HashMap<String, Object> {
 	

+ 1 - 5
src/main/java/net/chenlin/dp/common/exception/RRException.java

@@ -2,11 +2,7 @@ package net.chenlin.dp.common.exception;
 
 /**
  * 自定义异常
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 上午11:59:32
+ * @author zcl<yczclcn@163.com>
  */
 public class RRException extends RuntimeException {
 	

+ 17 - 8
src/main/java/net/chenlin/dp/common/exception/RRExceptionHandler.java

@@ -1,5 +1,6 @@
 package net.chenlin.dp.common.exception;
 
+import net.chenlin.dp.common.entity.R;
 import org.apache.shiro.authz.AuthorizationException;
 import org.apache.shiro.authz.UnauthorizedException;
 import org.slf4j.Logger;
@@ -8,15 +9,9 @@ import org.springframework.dao.DuplicateKeyException;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 
-import net.chenlin.dp.common.entity.R;
-
 /**
  * 异常处理器
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 上午11:59:44
+ * @author zcl<yczclcn@163.com>
  */
 @RestControllerAdvice
 public class RRExceptionHandler {
@@ -31,22 +26,36 @@ public class RRExceptionHandler {
 		R r = new R();
 		r.put("code", e.getCode());
 		r.put("msg", e.getMessage());
-
 		return r;
 	}
 
+	/**
+	 * 新增异常
+	 * @param e
+	 * @return
+	 */
 	@ExceptionHandler(DuplicateKeyException.class)
 	public R handleDuplicateKeyException(DuplicateKeyException e){
 		logger.error(e.getMessage(), e);
 		return R.error("数据库中已存在该记录");
 	}
 
+	/**
+	 * 无权限异常
+	 * @param e
+	 * @return
+	 */
 	@ExceptionHandler({UnauthorizedException.class, AuthorizationException.class})
 	public R handleAuthorizationException(AuthorizationException e){
 		logger.error(e.getMessage(), e);
 		return R.error("没有权限,请联系管理员授权");
 	}
 
+	/**
+	 * 通用异常
+	 * @param e
+	 * @return
+	 */
 	@ExceptionHandler(Exception.class)
 	public R handleException(Exception e){
 		logger.error(e.getMessage(), e);

+ 44 - 0
src/main/java/net/chenlin/dp/common/support/config/BeetlConfig.java

@@ -0,0 +1,44 @@
+package net.chenlin.dp.common.support.config;
+
+import net.chenlin.dp.common.support.properties.BeetlProperties;
+import org.beetl.core.resource.ClasspathResourceLoader;
+import org.beetl.ext.spring.BeetlGroupUtilConfiguration;
+import org.beetl.ext.spring.BeetlSpringViewResolver;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * beetl配置
+ * @author zcl<yczclcn@163.com>
+ */
+@Configuration("beetlConfiguration")
+public class BeetlConfig {
+
+    @Autowired
+    BeetlProperties beetlProperties;
+
+    /**
+     * beetl的配置
+     */
+    @Bean(name="beetlConfig", initMethod = "init")
+    public BeetlGroupUtilConfiguration beetlConfiguration() {
+        BeetlGroupUtilConfiguration beetlGroupUtilConfiguration = new BeetlGroupUtilConfiguration();
+        beetlGroupUtilConfiguration.setResourceLoader(new ClasspathResourceLoader(BeetlConfig.class.getClassLoader(), beetlProperties.getPrefix()));
+        beetlGroupUtilConfiguration.setConfigProperties(beetlProperties.getProperties());
+        return beetlGroupUtilConfiguration;
+    }
+
+    /**
+     * beetl的视图解析器
+     */
+    @Bean
+    public BeetlSpringViewResolver beetlViewResolver() {
+        BeetlSpringViewResolver beetlSpringViewResolver = new BeetlSpringViewResolver();
+        beetlSpringViewResolver.setConfig(beetlConfiguration());
+        beetlSpringViewResolver.setContentType("text/html;charset=UTF-8");
+        beetlSpringViewResolver.setOrder(0);
+        return beetlSpringViewResolver;
+    }
+
+}

+ 0 - 45
src/main/java/net/chenlin/dp/common/support/config/FilterConfig.java

@@ -1,45 +0,0 @@
-package net.chenlin.dp.common.support.config;
-
-import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.filter.DelegatingFilterProxy;
-
-import net.chenlin.dp.common.xss.XssFilter;
-
-import javax.servlet.DispatcherType;
-
-/**
- * Filter配置
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201793日 下午7:26:49
- */
-@Configuration
-public class FilterConfig {
-
-    @Bean
-    public FilterRegistrationBean shiroFilterRegistration() {
-        FilterRegistrationBean registration = new FilterRegistrationBean();
-        registration.setFilter(new DelegatingFilterProxy("shiroFilter"));
-        //该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理
-        registration.addInitParameter("targetFilterLifecycle", "true");
-        registration.setEnabled(true);
-        registration.setOrder(Integer.MAX_VALUE - 1);
-        registration.addUrlPatterns("/*");
-        return registration;
-    }
-
-    @Bean
-    public FilterRegistrationBean xssFilterRegistration() {
-        FilterRegistrationBean registration = new FilterRegistrationBean();
-        registration.setDispatcherTypes(DispatcherType.REQUEST);
-        registration.setFilter(new XssFilter());
-        registration.addUrlPatterns("/*");
-        registration.setName("xssFilter");
-        registration.setOrder(Integer.MAX_VALUE);
-        return registration;
-    }
-}

+ 2 - 6
src/main/java/net/chenlin/dp/modules/quartz/config/QuartzConfig.java → src/main/java/net/chenlin/dp/common/support/config/QuartzConfig.java

@@ -1,4 +1,4 @@
-package net.chenlin.dp.modules.quartz.config;
+package net.chenlin.dp.common.support.config;
 
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -9,11 +9,7 @@ import java.util.Properties;
 
 /**
  * 定时任务配置
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201794日 下午2:34:06
+ * @author zcl<yczclcn@163.com>
  */
 @Configuration
 public class QuartzConfig {

+ 64 - 40
src/main/java/net/chenlin/dp/common/support/config/ShiroConfig.java

@@ -1,6 +1,7 @@
 package net.chenlin.dp.common.support.config;
 
-import net.chenlin.dp.common.constant.SystemConstant;
+import net.chenlin.dp.modules.sys.shiro.UserFilter;
+import net.chenlin.dp.modules.sys.shiro.UserRealm;
 import org.apache.shiro.mgt.SecurityManager;
 import org.apache.shiro.session.mgt.SessionManager;
 import org.apache.shiro.spring.LifecycleBeanPostProcessor;
@@ -12,79 +13,97 @@ import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreato
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
-import net.chenlin.dp.modules.sys.oauth2.OAuth2Filter;
-import net.chenlin.dp.modules.sys.oauth2.OAuth2Realm;
-
 import javax.servlet.Filter;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
 /**
- * Shiro配置
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201793日 下午4:08:42
+ * shiro配置
+ * @author zcl<yczclcn@163.com>
  */
 @Configuration
 public class ShiroConfig {
 
-    @Bean("sessionManager")
+    /**
+     * 安全管理器
+     * @param sessionManager
+     * @return
+     */
+    @Bean
+    public SecurityManager securityManager(SessionManager sessionManager) {
+        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
+        securityManager.setSessionManager(sessionManager);
+        securityManager.setRealm(this.userRealm());
+        return securityManager;
+    }
+
+    /**
+     * session管理器
+     * @return
+     */
+    @Bean
     public SessionManager sessionManager(){
         DefaultWebSessionManager sessionManager = new DefaultWebSessionManager();
         sessionManager.setSessionValidationSchedulerEnabled(true);
-        sessionManager.setSessionIdCookieEnabled(false);
+        sessionManager.setSessionIdUrlRewritingEnabled(false);
+        sessionManager.setDeleteInvalidSessions(true);
         return sessionManager;
     }
 
-    @Bean("securityManager")
-    public SecurityManager securityManager(OAuth2Realm oAuth2Realm, SessionManager sessionManager) {
-        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
-        securityManager.setRealm(oAuth2Realm);
-        securityManager.setSessionManager(sessionManager);
-
-        return securityManager;
+    /**
+     * 用户realm
+     * @return
+     */
+    @Bean
+    public UserRealm userRealm(){
+        return new UserRealm();
     }
 
-    @Bean("shiroFilter")
-    public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) {
+    /**
+     * shiro过滤器
+     * @param securityManager
+     * @return
+     */
+    @Bean
+    public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
         ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean();
         shiroFilter.setSecurityManager(securityManager);
 
-        //oauth过滤
+        shiroFilter.setLoginUrl("/login");
+
+        shiroFilter.setSuccessUrl("/");
+
+        shiroFilter.setUnauthorizedUrl("/error/403");
+
+        //user过滤器,处理ajax请求超时不跳转情况
         Map<String, Filter> filters = new HashMap<>();
-        filters.put("oauth2", new OAuth2Filter());
+        filters.put("user", new UserFilter());
         shiroFilter.setFilters(filters);
 
         Map<String, String> filterMap = new LinkedHashMap<>();
-        filterMap.put("/webjars/**", "anon");
-        filterMap.put("/druid/**", "anon");
-        filterMap.put("/api/**", "anon");
-        filterMap.put("/sys/login", "anon");
-        filterMap.put("/sys/captcha.jpg", "anon");
-        filterMap.put("/**/*.css", "anon");
-        filterMap.put("/**/*.js", "anon");
-        filterMap.put("/**/*.html", "anon");
-        filterMap.put("/images/**", "anon");
-        filterMap.put("/fonts/**", "anon");
-        filterMap.put("/plugins/**", "anon");
-        filterMap.put("/swagger/**", "anon");
-        filterMap.put(SystemConstant.getResourceHandlerMapping(), "anon");
-        filterMap.put("/favicon.ico", "anon");
-        filterMap.put("/", "anon");
-        filterMap.put("/**", "oauth2");
+        filterMap.put("/static/**", "anon");
+        filterMap.put("/error/**", "anon");
+        filterMap.put("/login", "anon");
+        filterMap.put("/**", "user");
         shiroFilter.setFilterChainDefinitionMap(filterMap);
 
         return shiroFilter;
     }
 
-    @Bean("lifecycleBeanPostProcessor")
+    /**
+     * shiro生命周期处理器
+     * @return
+     */
+    @Bean
     public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
         return new LifecycleBeanPostProcessor();
     }
 
+    /**
+     * 使用cglib方式创建代理对象
+     * @return
+     */
     @Bean
     public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
         DefaultAdvisorAutoProxyCreator proxyCreator = new DefaultAdvisorAutoProxyCreator();
@@ -92,6 +111,11 @@ public class ShiroConfig {
         return proxyCreator;
     }
 
+    /**
+     * 启用注解
+     * @param securityManager
+     * @return
+     */
     @Bean
     public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
         AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();

+ 61 - 12
src/main/java/net/chenlin/dp/common/support/config/WebConfig.java

@@ -1,12 +1,21 @@
 package net.chenlin.dp.common.support.config;
 
-import net.chenlin.dp.common.constant.SystemConstant;
+import net.chenlin.dp.common.support.properties.GlobalProperties;
+import net.chenlin.dp.common.xss.XssFilter;
 import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.web.server.ErrorPage;
+import org.springframework.boot.web.server.ErrorPageRegistrar;
+import org.springframework.boot.web.server.ErrorPageRegistry;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.filter.DelegatingFilterProxy;
 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
+import javax.servlet.DispatcherType;
 import java.io.File;
 
 /**
@@ -14,10 +23,10 @@ import java.io.File;
  * @author zcl<yczclcn@163.com>
  */
 @Configuration
-public class WebConfig extends WebMvcConfigurerAdapter {
+public class WebConfig implements WebMvcConfigurer, ErrorPageRegistrar {
 
-    @Value("${spring.http.multipart.location}")
-    private String uploadDir;
+    @Autowired
+    GlobalProperties globalProperties;
 
     /**
      * 文件上传路径虚拟映射
@@ -25,19 +34,59 @@ public class WebConfig extends WebMvcConfigurerAdapter {
      */
     @Override
     public void addResourceHandlers(ResourceHandlerRegistry registry) {
-        if (StringUtils.isBlank(uploadDir)) {
+        if (StringUtils.isBlank(globalProperties.getUploadLocation())) {
             throw new RuntimeException("文件上传路径为空,请先在application.yml中配置{spring.http.multipart.location}路径!");
         }
-        if (!uploadDir.endsWith("/")) {
+        if (!globalProperties.getUploadLocation().endsWith("/")) {
             throw new RuntimeException("文件上传路径必须以 / 结束!");
         }
-        File uploadDest = new File(uploadDir);
+        File uploadDest = new File(globalProperties.getUploadLocation());
         if (!uploadDest.exists()) {
             throw new RuntimeException("配置的文件上传路径不存在,请配置已存在的路径!");
         }
-        SystemConstant.UPLOAD_LOCATION_PATH = uploadDir;
-        registry.addResourceHandler(SystemConstant.getResourceHandlerMapping())
-                .addResourceLocations(SystemConstant.getResourceLocation());
+        registry.addResourceHandler(globalProperties.getRegisterUploadMapping())
+                .addResourceLocations(globalProperties.getRegisterUploadLocation());
     }
 
+    /**
+     * shiroFilter注册
+     * @return
+     */
+    @Bean
+    public FilterRegistrationBean shiroFilterRegistration() {
+        FilterRegistrationBean registration = new FilterRegistrationBean();
+        registration.setFilter(new DelegatingFilterProxy("shiroFilter"));
+        //该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理
+        registration.addInitParameter("targetFilterLifecycle", "true");
+        registration.setEnabled(true);
+        registration.setOrder(Integer.MAX_VALUE - 1);
+        registration.addUrlPatterns("/*");
+        return registration;
+    }
+
+    /**
+     * xssFilter注册
+     * @return
+     */
+    @Bean
+    public FilterRegistrationBean xssFilterRegistration() {
+        FilterRegistrationBean registration = new FilterRegistrationBean();
+        registration.setDispatcherTypes(DispatcherType.REQUEST);
+        registration.setFilter(new XssFilter());
+        registration.addUrlPatterns("/*");
+        registration.setName("xssFilter");
+        registration.setOrder(Integer.MAX_VALUE);
+        return registration;
+    }
+
+    /**
+     * 错误页面
+     * @param registry
+     */
+    @Override
+    public void registerErrorPages(ErrorPageRegistry registry) {
+        ErrorPage notFound = new ErrorPage(HttpStatus.NOT_FOUND, "/error/404");
+        ErrorPage sysError = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500");
+        registry.addErrorPages(notFound, sysError);
+    }
 }

+ 3 - 4
src/main/java/net/chenlin/dp/common/support/orm/db/DataSourceEnum.java

@@ -2,14 +2,13 @@ package net.chenlin.dp.common.support.orm.db;
 
 /**
  * 数据源上下文
- * @author ZhouChenglin
- * @date 2017/12/25
+ * @author zcl<yczclcn@163.com>
  */
 public enum DataSourceEnum {
 
-    MASTER("masterDataSource", true),
+    MASTER("master-data-source", true),
 
-    SLAVE("slaveDataSource", false);
+    SLAVE("slave-data-source", false);
 
     private String name;
 

+ 1 - 2
src/main/java/net/chenlin/dp/common/support/orm/db/DynamicDataSource.java

@@ -8,8 +8,7 @@ import java.util.Map;
 
 /**
  * 动态数据源
- * @author ZhouChenglin
- * @date 2017/12/25
+ * @author zcl<yczclcn@163.com>
  */
 public class DynamicDataSource extends AbstractRoutingDataSource {
 

+ 2 - 6
src/main/java/net/chenlin/dp/common/support/orm/db/DynamicDataSourceConfig.java

@@ -12,17 +12,13 @@ import java.util.Map;
 
 /**
  * 配置多数据源
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201793日 下午8:03:40
+ * @author zcl<yczclcn@163.com>
  */
 @Configuration
 public class DynamicDataSourceConfig {
 
     @Bean
-    @ConfigurationProperties("spring.datasource.druid.masterDataSource")
+    @ConfigurationProperties("spring.datasource.druid.master-data-source")
     public DataSource defaultDataSource(){
         return DruidDataSourceBuilder.create().build();
     }

+ 0 - 67
src/main/java/net/chenlin/dp/common/support/orm/mybatis/PackagesSqlSessionFactoryBean.java

@@ -1,67 +0,0 @@
-package net.chenlin.dp.common.support.orm.mybatis;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
-import org.mybatis.spring.SqlSessionFactoryBean;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
-import org.springframework.core.io.support.ResourcePatternResolver;
-import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
-import org.springframework.core.type.classreading.MetadataReader;
-import org.springframework.core.type.classreading.MetadataReaderFactory;
-import org.springframework.util.ClassUtils;
-
-/**
- * mybatis支持扫描多个包路径
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 上午11:28:59
- */
-public class PackagesSqlSessionFactoryBean extends SqlSessionFactoryBean {
-
-	static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
-
-	private static Logger logger = LoggerFactory.getLogger(PackagesSqlSessionFactoryBean.class);
-
-	@Override
-	public void setTypeAliasesPackage(String typeAliasesPackage) {
-		ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver();
-		MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
-		typeAliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
-				+ ClassUtils.convertClassNameToResourcePath(typeAliasesPackage) + "/" + DEFAULT_RESOURCE_PATTERN;
-
-		try {
-			List<String> result = new ArrayList<String>();
-			Resource[] resources = resolver.getResources(typeAliasesPackage);
-			if (resources != null && resources.length > 0) {
-				MetadataReader metadataReader = null;
-				for (Resource resource : resources) {
-					if (resource.isReadable()) {
-						metadataReader = metadataReaderFactory.getMetadataReader(resource);
-						try {
-							result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage()
-									.getName());
-						} catch (ClassNotFoundException e) {
-							e.printStackTrace();
-						}
-					}
-				}
-			}
-			if (result.size() > 0) {
-				super.setTypeAliasesPackage(StringUtils.join(result.toArray(), ","));
-			} else {
-				logger.warn("参数typeAliasesPackage:" + typeAliasesPackage + ",未找到任何包");
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 1 - 5
src/main/java/net/chenlin/dp/common/support/orm/plugins/PaginationResultSetHandlerInterceptor.java

@@ -23,11 +23,7 @@ import net.chenlin.dp.common.entity.Page;
 
 /**
  * PaginationResultSetHandlerInterceptor
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017811日 上午11:33:03
+ * @author zcl<yczclcn@163.com>
  */
 @Intercepts({ @Signature(type = ResultSetHandler.class, method = "handleResultSets", args = { Statement.class }) })
 public class PaginationResultSetHandlerInterceptor implements Interceptor {

+ 1 - 5
src/main/java/net/chenlin/dp/common/support/orm/plugins/PaginationStatementHandlerInterceptor.java

@@ -31,11 +31,7 @@ import net.chenlin.dp.common.support.orm.dialect.DialectFactory;
 
 /**
  * PaginationStatementHandlerInterceptor
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017811日 上午11:33:26
+ * @author zcl<yczclcn@163.com>
  */
 @Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class, Integer.class }) })
 public class PaginationStatementHandlerInterceptor implements Interceptor {

+ 112 - 0
src/main/java/net/chenlin/dp/common/support/properties/BeetlProperties.java

@@ -0,0 +1,112 @@
+package net.chenlin.dp.common.support.properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+
+import java.util.Properties;
+
+/**
+ * beetl配置
+ * @author zcl<yczclcn@163.com>
+ */
+@Configuration
+@ConfigurationProperties(prefix = BeetlProperties.BEETLCONF_PREFIX)
+@PropertySource("classpath:META-INF/application-default.properties")
+public class BeetlProperties {
+
+    /** 属性前缀名 **/
+    static final String BEETLCONF_PREFIX = "beetl";
+
+    /** 定界开始符号 **/
+    private String delimiterStatementStart;
+
+    /** 定界结束符号 **/
+    private String delimiterStatementEnd;
+
+    /** 自定义标签文件root目录 **/
+    private String resourceTagRoot;
+
+    /** 自定义标签文件后缀 **/
+    private String resourceTagSuffix;
+
+    /** 是否检测文件变化,开发使用true合适,生产使用false **/
+    private String resourceAutoCheck;
+
+    /** 视图解析器的路径前缀 **/
+    private String prefix;
+
+    public Properties getProperties(){
+        Properties properties = new Properties();
+        if(StringUtils.isNotEmpty(delimiterStatementStart)){
+            if(delimiterStatementStart.startsWith("\\")){
+                delimiterStatementStart = delimiterStatementStart.substring(1);
+            }
+            properties.setProperty("DELIMITER_STATEMENT_START",delimiterStatementStart);
+        }
+        if(StringUtils.isNotEmpty(delimiterStatementEnd)){
+            properties.setProperty("DELIMITER_STATEMENT_END",delimiterStatementEnd);
+        }else{
+            properties.setProperty("DELIMITER_STATEMENT_END","null");
+        }
+        if(StringUtils.isNotEmpty(resourceTagRoot)){
+            properties.setProperty("RESOURCE.tagRoot",resourceTagRoot);
+        }
+        if(StringUtils.isNotEmpty(resourceTagSuffix)){
+            properties.setProperty("RESOURCE.tagSuffix",resourceTagSuffix);
+        }
+        if(StringUtils.isNotEmpty(resourceAutoCheck)){
+            properties.setProperty("RESOURCE.autoCheck",resourceAutoCheck);
+        }
+        return properties;
+    }
+
+    public void setPrefix(String prefix) {
+        this.prefix = prefix;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+
+    public String getDelimiterStatementStart() {
+        return delimiterStatementStart;
+    }
+
+    public void setDelimiterStatementStart(String delimiterStatementStart) {
+        this.delimiterStatementStart = delimiterStatementStart;
+    }
+
+    public String getDelimiterStatementEnd() {
+        return delimiterStatementEnd;
+    }
+
+    public void setDelimiterStatementEnd(String delimiterStatementEnd) {
+        this.delimiterStatementEnd = delimiterStatementEnd;
+    }
+
+    public String getResourceTagRoot() {
+        return resourceTagRoot;
+    }
+
+    public void setResourceTagRoot(String resourceTagRoot) {
+        this.resourceTagRoot = resourceTagRoot;
+    }
+
+    public String getResourceTagSuffix() {
+        return resourceTagSuffix;
+    }
+
+    public void setResourceTagSuffix(String resourceTagSuffix) {
+        this.resourceTagSuffix = resourceTagSuffix;
+    }
+
+    public String getResourceAutoCheck() {
+        return resourceAutoCheck;
+    }
+
+    public void setResourceAutoCheck(String resourceAutoCheck) {
+        this.resourceAutoCheck = resourceAutoCheck;
+    }
+}

+ 60 - 0
src/main/java/net/chenlin/dp/common/support/properties/GlobalProperties.java

@@ -0,0 +1,60 @@
+package net.chenlin.dp.common.support.properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * 系统全局配置
+ * @author zcl<yczclcn@163.com>
+ */
+@Component
+@ConfigurationProperties(prefix = GlobalProperties.PREFIX)
+public class GlobalProperties {
+
+    static final String PREFIX = "global";
+
+    /** 文件上传目录 **/
+    private String uploadLocation;
+
+    /** 文件上传目录访问路径 **/
+    private String uploadMapping;
+
+    /**
+     * WebConfig注册上传路径
+     * @return
+     */
+    public String getRegisterUploadLocation() {
+        if (StringUtils.isEmpty(uploadLocation)) {
+            return null;
+        }
+        return "file:".concat(uploadLocation);
+    }
+
+    /**
+     * WebConfig注册访问路径
+     * @return
+     */
+    public String getRegisterUploadMapping() {
+        if (StringUtils.isEmpty(uploadMapping)) {
+            return null;
+        }
+        return uploadMapping.concat("**");
+    }
+
+    public String getUploadLocation() {
+        return uploadLocation;
+    }
+
+    public void setUploadLocation(String uploadLocation) {
+        this.uploadLocation = uploadLocation;
+    }
+
+    public String getUploadMapping() {
+        return uploadMapping;
+    }
+
+    public void setUploadMapping(String uploadMapping) {
+        this.uploadMapping = uploadMapping;
+    }
+}

+ 72 - 5
src/main/java/net/chenlin/dp/common/utils/CommonUtils.java

@@ -3,17 +3,84 @@ package net.chenlin.dp.common.utils;
 import net.chenlin.dp.common.constant.MsgConstant;
 import net.chenlin.dp.common.constant.SystemConstant;
 import net.chenlin.dp.common.entity.R;
+import org.apache.commons.io.output.FileWriterWithEncoding;
+import org.apache.commons.lang.StringUtils;
+import org.beetl.core.Configuration;
+import org.beetl.core.GroupTemplate;
+import org.beetl.core.Template;
+import org.beetl.core.resource.ClasspathResourceLoader;
+import org.beetl.core.resource.FileResourceLoader;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
 
 /**
  * 通用工具类
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017812日 下午1:34:44
+ * @author zcl<yczclcn@163.com>
  */
 public class CommonUtils {
 
+	/**
+	 * 根据模板生成文件内容
+	 * @param templateClassPath 类路径模板
+	 * @param bindAttrs 绑定变量表
+	 * @return 生成结果内容
+	 * @throws IOException
+	 */
+	public static String generate(String templateClassPath, Map<String, Object> bindAttrs) throws IOException {
+		ClasspathResourceLoader classpathResourceLoader = new ClasspathResourceLoader(getPath(templateClassPath));
+		Configuration cfg = Configuration.defaultConfiguration();
+		GroupTemplate groupTemplate = new GroupTemplate(classpathResourceLoader, cfg);
+		Template template = groupTemplate.getTemplate(getFile(templateClassPath));
+		template.fastBinding(bindAttrs);
+		return template.render();
+	}
+
+	/**
+	 * 生成代码到本地
+	 * @param templateFilePath 模板绝对路径
+	 * @param outputFilePath 输入文件绝对路径
+	 * @param bindAttrs 绑定变量表
+	 * @throws IOException
+	 */
+	public static void generate(String templateFilePath, String outputFilePath, Map<String, Object> bindAttrs) throws IOException {
+		FileResourceLoader fileResourceLoader = new FileResourceLoader(getPath(templateFilePath));
+		Configuration cfg = Configuration.defaultConfiguration();
+		GroupTemplate groupTemplate = new GroupTemplate(fileResourceLoader, cfg);
+		Template template = groupTemplate.getTemplate(getFile(templateFilePath));
+		template.fastBinding(bindAttrs);
+		File outputFile = new File(outputFilePath);
+		FileWriterWithEncoding writer = new FileWriterWithEncoding(outputFile, "utf-8");
+		template.renderTo(writer);
+	}
+
+	/**
+	 * 根据文件绝对路径获取目录
+	 * @param filePath
+	 * @return
+	 */
+	public static String getPath(String filePath) {
+		String path = "";
+		if (StringUtils.isNotBlank(filePath)) {
+			path = filePath.substring(0, filePath.lastIndexOf("/") + 1);
+		}
+		return path;
+	}
+
+	/**
+	 * 根据文件绝对路径获取文件
+	 * @param filePath
+	 * @return
+	 */
+	public static String getFile(String filePath) {
+		String file = "";
+		if (StringUtils.isNotBlank(filePath)) {
+			file = filePath.substring(filePath.lastIndexOf("/") + 1);
+		}
+		return file;
+	}
+
 	/**
 	 * 对象是否为空
 	 * 

+ 1 - 5
src/main/java/net/chenlin/dp/common/utils/DateUtils.java

@@ -5,11 +5,7 @@ import java.util.Date;
 
 /**
  * 日期处理
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午12:02:46
+ * @author zcl<yczclcn@163.com>
  */
 public class DateUtils {
 	

+ 0 - 21
src/main/java/net/chenlin/dp/common/utils/HttpContextUtils.java

@@ -1,21 +0,0 @@
-package net.chenlin.dp.common.utils;
-
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * http上下文
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017814日 下午8:04:00
- */
-public class HttpContextUtils {
-
-	public static HttpServletRequest getHttpServletRequest() {
-		return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
-	}
-}

+ 0 - 71
src/main/java/net/chenlin/dp/common/utils/IpUtils.java

@@ -1,71 +0,0 @@
-package net.chenlin.dp.common.utils;
-
-import com.alibaba.druid.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * IP地址
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午12:02:56
- */
-public class IpUtils {
-
-	private static Logger LOG = 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, unknown = "unknown", seperator = ",";
-		int maxLength = 15;
-		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) {
-			LOG.error("IpUtils ERROR ", e);
-		}
-
-		// 使用代理,则获取第一个IP地址
-		if (StringUtils.isEmpty(ip) && ip.length() > maxLength) {
-			int idx = ip.indexOf(seperator);
-			if (idx > 0) {
-				ip = ip.substring(0, idx);
-			}
-		}
-
-		return ip;
-	}
-
-	/**
-	 * 获取ip地址
-	 * @return
-	 */
-	public static String getIpAddr() {
-		HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
-		return getIpAddr(request);
-	}
-
-}

+ 1 - 5
src/main/java/net/chenlin/dp/common/utils/JSONUtils.java

@@ -15,11 +15,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 
 /**
  * json工具类(jackjson)
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201793日 上午2:37:04
+ * @author zcl<yczclcn@163.com>
  */
 public class JSONUtils {
 

+ 1 - 2
src/main/java/net/chenlin/dp/common/utils/JdbcUtils.java

@@ -8,8 +8,7 @@ import java.util.Map;
 
 /**
  * JDBC工具类
- * @author ZhouChenglin
- * @date 2018/1/7
+ * @author zcl<yczclcn@163.com>
  */
 public class JdbcUtils {
 

+ 1 - 5
src/main/java/net/chenlin/dp/common/utils/MD5Utils.java

@@ -5,11 +5,7 @@ import org.apache.shiro.util.ByteSource;
 
 /**
  * MD5加密工具
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午5:17:34
+ * @author zcl<yczclcn@163.com>
  */
 public class MD5Utils {
 

+ 1 - 2
src/main/java/net/chenlin/dp/common/utils/PropertiesUtils.java

@@ -7,8 +7,7 @@ import java.util.ResourceBundle;
 
 /**
  * 资源文件读取工具
- * @author ZhouChenglin
- * @date 2017/12/14
+ * @author zcl<yczclcn@163.com>
  */
 public class PropertiesUtils {
 

+ 37 - 14
src/main/java/net/chenlin/dp/common/utils/ShiroUtils.java

@@ -8,50 +8,73 @@ import net.chenlin.dp.modules.sys.entity.SysUserEntity;
 
 /**
  * Shiro工具类
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午2:39:59
+ * @author zcl<yczclcn@163.com>
  */
 public class ShiroUtils {
-	
+
+	/**
+	 * 获取session
+	 * @return
+	 */
 	public static Session getSession() {
 		return SecurityUtils.getSubject().getSession();
 	}
 
+	/**
+	 * 获取当前用户
+	 * @return
+	 */
 	public static Subject getSubject() {
 		return SecurityUtils.getSubject();
 	}
-	
+
+	/**
+	 * 获取当前用户信息
+	 * @return
+	 */
 	public static SysUserEntity getUserEntity() {
 		return (SysUserEntity)SecurityUtils.getSubject().getPrincipal();
 	}
 
+	/**
+	 * 获取当前登录用户id
+	 * @return
+	 */
 	public static Long getUserId() {
 		return getUserEntity().getUserId();
 	}
-	
+
+	/**
+	 * 设置session域参数
+	 * @param key
+	 * @param value
+	 */
 	public static void setSessionAttribute(Object key, Object value) {
 		getSession().setAttribute(key, value);
 	}
 
+	/**
+	 * 获取session域参数
+	 * @param key
+	 * @return
+	 */
 	public static Object getSessionAttribute(Object key) {
 		return getSession().getAttribute(key);
 	}
 
+	/**
+	 * 是否登录
+	 * @return
+	 */
 	public static boolean isLogin() {
 		return SecurityUtils.getSubject().getPrincipal() != null;
 	}
 
+	/**
+	 * 登出
+	 */
 	public static void logout() {
 		SecurityUtils.getSubject().logout();
 	}
-	
-	public static String getKaptcha(String key) {
-		String kaptcha = getSessionAttribute(key).toString();
-		getSession().removeAttribute(key);
-		return kaptcha;
-	}
 
 }

+ 1 - 5
src/main/java/net/chenlin/dp/common/utils/SpringContextUtils.java

@@ -7,11 +7,7 @@ import org.springframework.stereotype.Component;
 
 /**
  * Spring Context 工具类
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午10:50:24
+ * @author zcl<yczclcn@163.com>
  */
 @Component
 public class SpringContextUtils implements ApplicationContextAware {

+ 10 - 9
src/main/java/net/chenlin/dp/common/utils/UploadUtils.java

@@ -1,6 +1,6 @@
 package net.chenlin.dp.common.utils;
 
-import net.chenlin.dp.common.constant.SystemConstant;
+import net.chenlin.dp.common.support.properties.GlobalProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.multipart.MultipartFile;
@@ -16,13 +16,14 @@ import java.util.UUID;
 
 /**
  * 文件上传工具类
- * @author ZhouChenglin
- * @date 2018/1/29
+ * @author zcl<yczclcn@163.com>
  */
 public class UploadUtils {
 
     private static Logger LOG = LoggerFactory.getLogger(UploadUtils.class);
 
+    private static GlobalProperties globalProperties = SpringContextUtils.getBean("globalProperties", GlobalProperties.class);
+
     /** 上传文件处理(支持批量) */
     public static List<String> uploadFile(HttpServletRequest request) {
         CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(
@@ -30,7 +31,7 @@ public class UploadUtils {
         List<String> fileNames = new ArrayList<>();
         if (multipartResolver.isMultipart(request)) {
             MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
-            File dirFile = new File(SystemConstant.UPLOAD_LOCATION_PATH);
+            File dirFile = new File(globalProperties.getUploadLocation());
             if (!dirFile.isDirectory()) {
                 dirFile.mkdirs();
             }
@@ -42,12 +43,12 @@ public class UploadUtils {
                     String uuid = UUID.randomUUID().toString();
                     String postFix = name.substring(name.lastIndexOf(".")).toLowerCase();
                     String fileName = uuid + postFix;
-                    String filePath = SystemConstant.UPLOAD_LOCATION_PATH + fileName;
+                    String filePath = globalProperties.getUploadLocation() + fileName;
                     File file = new File(filePath);
                     file.setWritable(true, false);
                     try {
                         multipartFile.transferTo(file);
-                        fileNames.add(SystemConstant.UPLOAD_LOCATION_MAPPING.concat(fileName));
+                        fileNames.add(globalProperties.getUploadMapping().concat(fileName));
                     } catch (Exception e) {
                         LOG.error(name + "保存失败", e);
                     }
@@ -64,7 +65,7 @@ public class UploadUtils {
         List<String> fileNames = new ArrayList<>();
         if (multipartResolver.isMultipart(request)) {
             MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
-            File dirFile = new File(SystemConstant.UPLOAD_LOCATION_PATH.concat(path));
+            File dirFile = new File(globalProperties.getUploadLocation().concat(path));
             if (!dirFile.isDirectory()) {
                 dirFile.mkdirs();
             }
@@ -76,12 +77,12 @@ public class UploadUtils {
                     String uuid = UUID.randomUUID().toString();
                     String postFix = name.substring(name.lastIndexOf(".")).toLowerCase();
                     String fileName = uuid + postFix;
-                    String filePath = SystemConstant.UPLOAD_LOCATION_PATH + path + fileName;
+                    String filePath = globalProperties.getUploadLocation() + path + fileName;
                     File file = new File(filePath);
                     file.setWritable(true, false);
                     try {
                         multipartFile.transferTo(file);
-                        fileNames.add(SystemConstant.UPLOAD_LOCATION_MAPPING + path + fileName);
+                        fileNames.add(globalProperties.getUploadMapping() + path + fileName);
                     } catch (Exception e) {
                         LOG.error(name + "保存失败", e);
                     }

+ 77 - 5
src/main/java/net/chenlin/dp/common/utils/WebUtils.java

@@ -1,5 +1,12 @@
 package net.chenlin.dp.common.utils;
 
+import com.alibaba.druid.util.StringUtils;
+import net.chenlin.dp.common.xss.XssHttpServletRequestWrapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
 import java.io.IOException;
 import java.io.PrintWriter;
 import javax.servlet.http.HttpServletRequest;
@@ -7,13 +14,11 @@ import javax.servlet.http.HttpServletResponse;
 
 /**
  * web工具类
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017813日 下午3:18:22
+ * @author zcl<yczclcn@163.com>
  */
 public class WebUtils {
+
+	private static final Logger LOGGER = LoggerFactory.getLogger(WebUtils.class);
 	
 	/**
 	 * 是否为ajax请求
@@ -48,4 +53,71 @@ public class WebUtils {
 		}
 	}
 
+	/**
+	 * 获取httpServletRequest
+	 * @return
+	 */
+	public static HttpServletRequest getRequest() {
+		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+		return new XssHttpServletRequestWrapper(request);
+	}
+
+	/**
+	 * 获取httpServletResponse
+	 * @return
+	 */
+	public static HttpServletResponse getResponse() {
+		return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+	}
+
+	/**
+	 * 获取IP地址
+	 *
+	 * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
+	 * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
+	 */
+	public static String getIpAddr(HttpServletRequest request) {
+		String ip = null, unknown = "unknown", seperator = ",";
+		int maxLength = 15;
+		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("WebUtils.getIpAddr ERROR ", e);
+		}
+
+		// 使用代理,则获取第一个IP地址
+		if (StringUtils.isEmpty(ip) && ip.length() > maxLength) {
+			int idx = ip.indexOf(seperator);
+			if (idx > 0) {
+				ip = ip.substring(0, idx);
+			}
+		}
+
+		return ip;
+	}
+
+	/**
+	 * 获取ip地址
+	 * @return
+	 */
+	public static String getIpAddr() {
+		HttpServletRequest request = WebUtils.getRequest();
+		return getIpAddr(request);
+	}
+
 }

+ 1 - 5
src/main/java/net/chenlin/dp/common/xss/HTMLFilter.java

@@ -9,11 +9,7 @@ import java.util.regex.Pattern;
 
 /**
  * HTMLFilter
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午12:01:14
+ * @author zcl<yczclcn@163.com>
  */
 public final class HTMLFilter {
 

+ 1 - 5
src/main/java/net/chenlin/dp/common/xss/SQLFilter.java

@@ -6,11 +6,7 @@ import net.chenlin.dp.common.exception.RRException;
 
 /**
  * SQL过滤
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午12:00:08
+ * @author zcl<yczclcn@163.com>
  */
 public class SQLFilter {
 

+ 1 - 5
src/main/java/net/chenlin/dp/common/xss/XssFilter.java

@@ -6,11 +6,7 @@ import java.io.IOException;
 
 /**
  * XSS过滤
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午12:00:23
+ * @author zcl<yczclcn@163.com>
  */
 public class XssFilter implements Filter {
 

+ 1 - 5
src/main/java/net/chenlin/dp/common/xss/XssHttpServletRequestWrapper.java

@@ -16,11 +16,7 @@ import java.util.Map;
 
 /**
  * XSS过滤处理
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午12:00:35
+ * @author zcl<yczclcn@163.com>
  */
 public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
     //没被包装过的HttpServletRequest(特殊场景,需要自己过滤)

+ 27 - 0
src/main/java/net/chenlin/dp/modules/Generator.java

@@ -0,0 +1,27 @@
+package net.chenlin.dp.modules;
+
+import net.chenlin.dp.modules.sys.generator.JdbcGenUtils;
+
+/**
+ * 代码生成器
+ * @author zcl<yczclcn@163.com>
+ */
+public class Generator {
+
+    public static void main(String[] args) throws Exception {
+
+        String jdbcDriver = "com.mysql.jdbc.Driver";
+        String jdbcUrl = "jdbc:mysql://127.0.0.1:3306/dp-lte-boot?useUnicode=true&characterEncoding=utf-8";
+        String jdbcUsername = "root";
+        String jdbcPassword = "root";
+
+        String tablePrefix = "gen_";
+
+        String javaModule = "test";
+        String webModule = "test";
+
+        JdbcGenUtils.generatorCode(jdbcDriver, jdbcUrl, jdbcUsername, jdbcPassword, tablePrefix, javaModule, webModule);
+
+    }
+
+}

+ 0 - 27
src/main/java/net/chenlin/dp/modules/base/dao/SysMacroMapper.java

@@ -1,27 +0,0 @@
-package net.chenlin.dp.modules.base.dao;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import net.chenlin.dp.modules.base.entity.SysMacroEntity;
-import net.chenlin.dp.modules.sys.dao.BaseMapper;
-
-
-/**
- * 通用字典
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017815日 下午12:46:31
- */
-@Mapper
-public interface SysMacroMapper extends BaseMapper<SysMacroEntity> {
-
-	List<SysMacroEntity> listNotMacro();
-	
-	int countMacroChildren(Long typeId);
-
-	List<SysMacroEntity> listMacroValue(String type);
-	
-}

+ 0 - 30
src/main/java/net/chenlin/dp/modules/base/manager/SysAreaManager.java

@@ -1,30 +0,0 @@
-package net.chenlin.dp.modules.base.manager;
-
-import java.util.List;
-
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.base.entity.SysAreaEntity;
-
-/**
- * 行政区域
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017818日 下午3:39:00
- */
-public interface SysAreaManager {
-
-	List<SysAreaEntity> listAreaByParentCode(Query query);
-	
-	int saveArea(SysAreaEntity area);
-	
-	SysAreaEntity getAreaById(Long areaId);
-	
-	int updateArea(SysAreaEntity area);
-	
-	int batchRemoveArea(Long[] id);
-	
-	boolean hasChildren(Long[] id);
-	
-}

+ 0 - 34
src/main/java/net/chenlin/dp/modules/base/manager/SysMacroManager.java

@@ -1,34 +0,0 @@
-package net.chenlin.dp.modules.base.manager;
-
-import java.util.List;
-
-import net.chenlin.dp.modules.base.entity.SysMacroEntity;
-
-
-/**
- * 通用字典
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017815日 下午12:49:14
- */
-public interface SysMacroManager {
-
-	List<SysMacroEntity> listMacro();
-	
-	List<SysMacroEntity> listNotMacro();
-	
-	int saveMacro(SysMacroEntity macro);
-	
-	SysMacroEntity getObjectById(Long id);
-	
-	int updateMacro(SysMacroEntity macro);
-	
-	int batchRemove(Long[] id);
-	
-	boolean hasChildren(Long[] id);
-
-	List<SysMacroEntity> listMacroValue(String type);
-
-}

+ 0 - 64
src/main/java/net/chenlin/dp/modules/base/manager/impl/SysAreaManagerImpl.java

@@ -1,64 +0,0 @@
-package net.chenlin.dp.modules.base.manager.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.common.utils.CommonUtils;
-import net.chenlin.dp.modules.base.dao.SysAreaMapper;
-import net.chenlin.dp.modules.base.entity.SysAreaEntity;
-import net.chenlin.dp.modules.base.manager.SysAreaManager;
-
-/**
- * 行政区域
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017818日 下午3:39:35
- */
-@Component("sysAreaManager")
-public class SysAreaManagerImpl implements SysAreaManager {
-
-	@Autowired
-	private SysAreaMapper sysAreaMapper;
-	
-	@Override
-	public List<SysAreaEntity> listAreaByParentCode(Query query) {
-		return sysAreaMapper.listAreaByParentCode(query);
-	}
-
-	@Override
-	public int saveArea(SysAreaEntity area) {
-		return sysAreaMapper.save(area);
-	}
-
-	@Override
-	public SysAreaEntity getAreaById(Long areaId) {
-		return sysAreaMapper.getObjectById(areaId);
-	}
-
-	@Override
-	public int updateArea(SysAreaEntity area) {
-		return sysAreaMapper.update(area);
-	}
-
-	@Override
-	public int batchRemoveArea(Long[] id) {
-		return sysAreaMapper.batchRemove(id);
-	}
-	
-	@Override
-	public boolean hasChildren(Long[] id) {
-		for(Long typeId : id) {
-			int count = sysAreaMapper.countAreaChildren(typeId);
-			if(CommonUtils.isIntThanZero(count)) {
-				return true;
-			}
-		}
-		return false;
-	}
-	
-}

+ 0 - 73
src/main/java/net/chenlin/dp/modules/base/manager/impl/SysMacroManagerImpl.java

@@ -1,73 +0,0 @@
-package net.chenlin.dp.modules.base.manager.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import net.chenlin.dp.common.utils.CommonUtils;
-import net.chenlin.dp.modules.base.dao.SysMacroMapper;
-import net.chenlin.dp.modules.base.entity.SysMacroEntity;
-import net.chenlin.dp.modules.base.manager.SysMacroManager;
-
-/**
- * 通用字典
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017815日 下午12:49:26
- */
-@Component("sysMacroManager")
-public class SysMacroManagerImpl implements SysMacroManager {
-
-	@Autowired
-	private SysMacroMapper sysMacroMapper;
-	
-	@Override
-	public List<SysMacroEntity> listMacro() {
-		return sysMacroMapper.list();
-	}
-
-	@Override
-	public List<SysMacroEntity> listNotMacro() {
-		return sysMacroMapper.listNotMacro();
-	}
-
-	@Override
-	public int saveMacro(SysMacroEntity macro) {
-		return sysMacroMapper.save(macro);
-	}
-
-	@Override
-	public SysMacroEntity getObjectById(Long id) {
-		return sysMacroMapper.getObjectById(id);
-	}
-
-	@Override
-	public int updateMacro(SysMacroEntity macro) {
-		return sysMacroMapper.update(macro);
-	}
-
-	@Override
-	public int batchRemove(Long[] id) {
-		return sysMacroMapper.batchRemove(id);
-	}
-	
-	@Override
-	public boolean hasChildren(Long[] id) {
-		for(Long typeId : id) {
-			int count = sysMacroMapper.countMacroChildren(typeId);
-			if(CommonUtils.isIntThanZero(count)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	@Override
-	public List<SysMacroEntity> listMacroValue(String type) {
-		return sysMacroMapper.listMacroValue(type);
-	}
-
-}

+ 0 - 31
src/main/java/net/chenlin/dp/modules/base/service/SysAreaService.java

@@ -1,31 +0,0 @@
-package net.chenlin.dp.modules.base.service;
-
-import java.util.List;
-import java.util.Map;
-
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.modules.base.entity.SysAreaEntity;
-
-/**
- * 行政区域
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017818日 下午3:40:18
- */
-public interface SysAreaService {
-
-	List<SysAreaEntity> listAreaByParentCode(String areaCode);
-	
-	R listAreaByParentCode(Map<String, Object> params);
-	
-	R saveArea(SysAreaEntity area);
-	
-	R getAreaById(Long areaId);
-	
-	R updateArea(SysAreaEntity area);
-	
-	R batchRemoveArea(Long[] id);
-	
-}

+ 0 - 32
src/main/java/net/chenlin/dp/modules/base/service/SysMacroService.java

@@ -1,32 +0,0 @@
-package net.chenlin.dp.modules.base.service;
-
-import java.util.List;
-
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.modules.base.entity.SysMacroEntity;
-
-/**
- * 通用字典
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017815日 下午12:51:35
- */
-public interface SysMacroService {
-
-	List<SysMacroEntity> listMacro();
-	
-	List<SysMacroEntity> listNotMacro();
-	
-	R saveMacro(SysMacroEntity macro);
-	
-	R getObjectById(Long id);
-	
-	R updateMacro(SysMacroEntity macro);
-	
-	R batchRemove(Long[] id);
-
-	List<SysMacroEntity> listMacroValue(String type);
-	
-}

+ 0 - 93
src/main/java/net/chenlin/dp/modules/base/service/impl/SysMacroServiceImpl.java

@@ -1,93 +0,0 @@
-package net.chenlin.dp.modules.base.service.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import net.chenlin.dp.common.constant.MsgConstant;
-import net.chenlin.dp.common.constant.SystemConstant.MacroType;
-import net.chenlin.dp.common.constant.SystemConstant.StatusType;
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.common.utils.CommonUtils;
-import net.chenlin.dp.modules.base.entity.SysMacroEntity;
-import net.chenlin.dp.modules.base.manager.SysMacroManager;
-import net.chenlin.dp.modules.base.service.SysMacroService;
-
-/**
- * 通用字典
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017815日 下午12:52:38
- */
-@Service("sysMacroService")
-public class SysMacroServiceImpl implements SysMacroService {
-
-	@Autowired
-	private SysMacroManager sysMacroManager;
-	
-	@Override
-	public List<SysMacroEntity> listMacro() {
-		return sysMacroManager.listMacro();
-	}
-
-	@Override
-	public List<SysMacroEntity> listNotMacro() {
-		List<SysMacroEntity> macros = sysMacroManager.listNotMacro();
-		SysMacroEntity macro = new SysMacroEntity();
-		macro.setMacroId(0L);
-		macro.setTypeId(-1L);
-		macro.setName("一级目录");
-		macro.setOpen(true);
-		macros.add(macro);
-		return macros;
-	}
-
-	@Override
-	public R saveMacro(SysMacroEntity macro) {
-		int count = sysMacroManager.saveMacro(validateMacro(macro));
-		return CommonUtils.msg(count);
-	}
-
-	@Override
-	public R getObjectById(Long id) {
-		SysMacroEntity macro = sysMacroManager.getObjectById(id);
-		return CommonUtils.msg(macro);
-	}
-
-	@Override
-	public R updateMacro(SysMacroEntity macro) {
-		int count = sysMacroManager.updateMacro(macro);
-		return CommonUtils.msg(count);
-	}
-
-	@Override
-	public R batchRemove(Long[] id) {
-		boolean children = sysMacroManager.hasChildren(id);
-		if(children) {
-			return R.error(MsgConstant.MSG_HAS_CHILD);
-		}
-		int count = sysMacroManager.batchRemove(id);
-		return CommonUtils.msg(id, count);
-	}
-
-	@Override
-	public List<SysMacroEntity> listMacroValue(String type) {
-		return sysMacroManager.listMacroValue(type);
-	}
-
-	/**
-	 * 当为参数类型时,状态为显示
-	 * @param macro
-	 * @return
-	 */
-	public SysMacroEntity validateMacro(SysMacroEntity macro) {
-		if(macro.getType() == MacroType.TYPE.getValue()) {
-			macro.setStatus(StatusType.SHOW.getValue());
-		}
-		return macro;
-	}
-
-}

+ 0 - 26
src/main/java/net/chenlin/dp/modules/generator/constant/GenConstant.java

@@ -1,26 +0,0 @@
-package net.chenlin.dp.modules.generator.constant;
-
-/**
- * 代码生成器常量
- * @author ZhouChenglin
- * @date 2018/1/8
- */
-public class GenConstant {
-
-    public static final String JAVA_ENTITY = "Entity.java.vm";
-    public static final String JAVA_MAPPER = "Mapper.java.vm";
-    public static final String XML_MAPPER = "Mapper.xml.vm";
-    public static final String JAVA_MANAGER = "Manager.java.vm";
-    public static final String JAVA_MANAGER_IMPL = "ManagerImpl.java.vm";
-    public static final String JAVA_SERVICE = "Service.java.vm";
-    public static final String JAVA_SERVICE_IMPL = "ServiceImpl.java.vm";
-    public static final String JAVA_CONTROLLER = "Controller.java.vm";
-    public static final String HTML_LIST = "list.html.vm";
-    public static final String HTML_ADD = "add.html.vm";
-    public static final String HTML_EDIT = "edit.html.vm";
-    public static final String JS_LIST = "list.js.vm";
-    public static final String JS_ADD = "add.js.vm";
-    public static final String JS_EDIT = "edit.js.vm";
-    public static final String SQL_MENU = "menu.sql.vm";
-
-}

+ 0 - 26
src/main/java/net/chenlin/dp/modules/generator/manager/SysGeneratorManager.java

@@ -1,26 +0,0 @@
-package net.chenlin.dp.modules.generator.manager;
-
-import java.util.List;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.generator.entity.ColumnEntity;
-import net.chenlin.dp.modules.generator.entity.TableEntity;
-
-/**
- * 代码生成器
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017828日 下午8:54:09
- */
-public interface SysGeneratorManager {
-
-	void listTable(Page<TableEntity> page, Query query);
-	
-	TableEntity getTableByName(String tableName);
-	
-	List<ColumnEntity> listColumn(String tableName);
-	
-}

+ 0 - 44
src/main/java/net/chenlin/dp/modules/generator/manager/impl/SysGeneratorManagerImpl.java

@@ -1,44 +0,0 @@
-package net.chenlin.dp.modules.generator.manager.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.generator.dao.SysGeneratorMapper;
-import net.chenlin.dp.modules.generator.entity.ColumnEntity;
-import net.chenlin.dp.modules.generator.entity.TableEntity;
-import net.chenlin.dp.modules.generator.manager.SysGeneratorManager;
-
-/**
- * 代码生成器
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017828日 下午8:54:44
- */
-@Component("sysGeneratorManager")
-public class SysGeneratorManagerImpl implements SysGeneratorManager {
-
-	@Autowired
-	private SysGeneratorMapper sysGeneratorMapper;
-	
-	@Override
-	public void listTable(Page<TableEntity> page, Query query) {
-		sysGeneratorMapper.listTable(page, query);
-	}
-
-	@Override
-	public TableEntity getTableByName(String tableName) {
-		return sysGeneratorMapper.getTableByName(tableName);
-	}
-
-	@Override
-	public List<ColumnEntity> listColumn(String tableName) {
-		return sysGeneratorMapper.listColumn(tableName);
-	}
-
-}

+ 0 - 23
src/main/java/net/chenlin/dp/modules/generator/service/SysGeneratorService.java

@@ -1,23 +0,0 @@
-package net.chenlin.dp.modules.generator.service;
-
-import java.util.Map;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.modules.generator.entity.GeneratorParamEntity;
-import net.chenlin.dp.modules.generator.entity.TableEntity;
-
-/**
- * 代码生成器
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017828日 下午8:55:29
- */
-public interface SysGeneratorService {
-
-	Page<TableEntity> listTable(Map<String, Object> params);
-	
-	byte[] generator(GeneratorParamEntity params);
-	
-}

+ 0 - 68
src/main/java/net/chenlin/dp/modules/generator/utils/VelocityUtils.java

@@ -1,68 +0,0 @@
-package net.chenlin.dp.modules.generator.utils;
-
-import org.apache.commons.io.output.FileWriterWithEncoding;
-import org.apache.commons.lang.StringUtils;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.app.VelocityEngine;
-
-import java.io.File;
-import java.util.Properties;
-
-/**
- * velocity工具类
- * @author ZhouChenglin
- * @date 2018/1/7
- */
-public class VelocityUtils {
-
-    /**
-     * 根据模板生成文件
-     * @param inputVmFilePath 模板路径
-     * @param outputFilePath 输出文件路径
-     * @param context
-     * @throws Exception
-     */
-    public static void generate(String inputVmFilePath, String outputFilePath, VelocityContext context) throws Exception {
-        try {
-            Properties properties = new Properties();
-            properties.setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH, getPath(inputVmFilePath));
-            Velocity.init(properties);
-            Template template = Velocity.getTemplate(getFile(inputVmFilePath), "utf-8");
-            File outputFile = new File(outputFilePath);
-            FileWriterWithEncoding writer = new FileWriterWithEncoding(outputFile, "utf-8");
-            template.merge(context, writer);
-            writer.close();
-        } catch (Exception ex) {
-            throw ex;
-        }
-    }
-
-    /**
-     * 根据文件绝对路径获取目录
-     * @param filePath
-     * @return
-     */
-    public static String getPath(String filePath) {
-        String path = "";
-        if (StringUtils.isNotBlank(filePath)) {
-            path = filePath.substring(0, filePath.lastIndexOf("/") + 1);
-        }
-        return path;
-    }
-
-    /**
-     * 根据文件绝对路径获取文件
-     * @param filePath
-     * @return
-     */
-    public static String getFile(String filePath) {
-        String file = "";
-        if (StringUtils.isNotBlank(filePath)) {
-            file = filePath.substring(filePath.lastIndexOf("/") + 1);
-        }
-        return file;
-    }
-
-}

+ 0 - 20
src/main/java/net/chenlin/dp/modules/quartz/dao/QuartzJobLogMapper.java

@@ -1,20 +0,0 @@
-package net.chenlin.dp.modules.quartz.dao;
-
-import org.apache.ibatis.annotations.Mapper;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobLogEntity;
-import net.chenlin.dp.modules.sys.dao.BaseMapper;
-
-/**
- * 定时任务日志
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午11:04:51
- */
-@Mapper
-public interface QuartzJobLogMapper extends BaseMapper<QuartzJobLogEntity> {
-
-	int batchRemoveAll();
-	
-}

+ 0 - 19
src/main/java/net/chenlin/dp/modules/quartz/dao/QuartzJobMapper.java

@@ -1,19 +0,0 @@
-package net.chenlin.dp.modules.quartz.dao;
-
-import org.apache.ibatis.annotations.Mapper;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobEntity;
-import net.chenlin.dp.modules.sys.dao.BaseMapper;
-
-
-/**
- * 定时任务
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午11:19:55
- */
-@Mapper
-public interface QuartzJobMapper extends BaseMapper<QuartzJobEntity> {
-
-}

+ 0 - 27
src/main/java/net/chenlin/dp/modules/quartz/manager/QuartzJobLogManager.java

@@ -1,27 +0,0 @@
-package net.chenlin.dp.modules.quartz.manager;
-
-import java.util.List;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobLogEntity;
-
-/**
- * 定时任务日志
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午11:06:56
- */
-public interface QuartzJobLogManager {
-
-	List<QuartzJobLogEntity> listForPage(Page<QuartzJobLogEntity> page, Query query);
-	
-	int saveQuartzJobLog(QuartzJobLogEntity log);
-	
-	int batchRemove(Long[] id);
-	
-	int batchRemoveAll();
-	
-}

+ 0 - 33
src/main/java/net/chenlin/dp/modules/quartz/manager/QuartzJobManager.java

@@ -1,33 +0,0 @@
-package net.chenlin.dp.modules.quartz.manager;
-
-import java.util.List;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobEntity;
-
-/**
- * 定时任务
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午11:46:30
- */
-public interface QuartzJobManager {
-
-	List<QuartzJobEntity> listForPage(Page<QuartzJobEntity> page, Query query);
-	
-	List<QuartzJobEntity> listNormalJob();
-	
-	int saveQuartzJob(QuartzJobEntity job);
-	
-	QuartzJobEntity getQuartzJobById(Long jobId);
-	
-	int updateQuartzJob(QuartzJobEntity job);
-	
-	int batchRemoveQuartzJob(Long[] id);
-	
-	int batchUpdate(Long[] jobId, Integer status);
-	
-}

+ 0 - 48
src/main/java/net/chenlin/dp/modules/quartz/manager/impl/QuartzJobLogManagerImpl.java

@@ -1,48 +0,0 @@
-package net.chenlin.dp.modules.quartz.manager.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.quartz.dao.QuartzJobLogMapper;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobLogEntity;
-import net.chenlin.dp.modules.quartz.manager.QuartzJobLogManager;
-
-/**
- * 定时任务日志
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午11:10:11
- */
-@Component("quartzJobLogManager")
-public class QuartzJobLogManagerImpl implements QuartzJobLogManager {
-
-	@Autowired
-	private QuartzJobLogMapper quartzLobLogMapper;
-	
-	@Override
-	public List<QuartzJobLogEntity> listForPage(Page<QuartzJobLogEntity> page, Query query) {
-		return quartzLobLogMapper.listForPage(page, query);
-	}
-
-	@Override
-	public int saveQuartzJobLog(QuartzJobLogEntity log) {
-		return quartzLobLogMapper.save(log);
-	}
-
-	@Override
-	public int batchRemove(Long[] id) {
-		return quartzLobLogMapper.batchRemove(id);
-	}
-
-	@Override
-	public int batchRemoveAll() {
-		return quartzLobLogMapper.batchRemoveAll();
-	}
-
-}

+ 0 - 66
src/main/java/net/chenlin/dp/modules/quartz/manager/impl/QuartzJobManagerImpl.java

@@ -1,66 +0,0 @@
-package net.chenlin.dp.modules.quartz.manager.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.quartz.dao.QuartzJobMapper;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobEntity;
-import net.chenlin.dp.modules.quartz.manager.QuartzJobManager;
-
-/**
- * 定时任务
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午11:47:19
- */
-@Component("quartzJobManager")
-public class QuartzJobManagerImpl implements QuartzJobManager {
-
-	@Autowired
-	private QuartzJobMapper quartzJobMapper;
-	
-	@Override
-	public List<QuartzJobEntity> listNormalJob() {
-		return quartzJobMapper.list();
-	}
-
-	@Override
-	public List<QuartzJobEntity> listForPage(Page<QuartzJobEntity> page, Query query) {
-		return quartzJobMapper.listForPage(page, query);
-	}
-
-	@Override
-	public int saveQuartzJob(QuartzJobEntity job) {
-		return quartzJobMapper.save(job);
-	}
-
-	@Override
-	public QuartzJobEntity getQuartzJobById(Long jobId) {
-		return quartzJobMapper.getObjectById(jobId);
-	}
-
-	@Override
-	public int updateQuartzJob(QuartzJobEntity job) {
-		return quartzJobMapper.update(job);
-	}
-
-	@Override
-	public int batchRemoveQuartzJob(Long[] id) {
-		return quartzJobMapper.batchRemove(id);
-	}
-
-	@Override
-	public int batchUpdate(Long[] jobId, Integer status) {
-		Query query = new Query();
-		query.put("jobIdList", jobId);
-		query.put("status", status);
-		return quartzJobMapper.batchUpdate(query);
-	}
-
-}

+ 0 - 25
src/main/java/net/chenlin/dp/modules/quartz/service/QuartzJobLogService.java

@@ -1,25 +0,0 @@
-package net.chenlin.dp.modules.quartz.service;
-
-import java.util.Map;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobLogEntity;
-
-/**
- * 定时任务日志
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017821日 上午11:17:26
- */
-public interface QuartzJobLogService {
-
-	Page<QuartzJobLogEntity> listForPage(Map<String, Object> params);
-	
-	R batchRemove(Long[] id);
-	
-	R batchRemoveAll();
-	
-}

+ 0 - 35
src/main/java/net/chenlin/dp/modules/quartz/service/QuartzJobService.java

@@ -1,35 +0,0 @@
-package net.chenlin.dp.modules.quartz.service;
-
-import java.util.Map;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobEntity;
-
-/**
- * 定时任务
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午11:48:32
- */
-public interface QuartzJobService {
-	
-	Page<QuartzJobEntity> list(Map<String, Object> params);
-	
-	R saveQuartzJob(QuartzJobEntity job);
-	
-	R getQuartzJobById(Long jobId);
-	
-	R updateQuartzJob(QuartzJobEntity job);
-	
-	R batchRemoveQuartzJob(Long[] id);
-	
-	R run(Long[] id);
-	
-	R pause(Long[] id);
-	
-	R resume(Long[] id);
-	
-}

+ 0 - 23
src/main/java/net/chenlin/dp/modules/quartz/task/TestTask.java

@@ -1,23 +0,0 @@
-package net.chenlin.dp.modules.quartz.task;
-
-import org.springframework.stereotype.Component;
-
-/**
- * 测试任务
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017821日 上午1:09:44
- */
-@Component("testTask")
-public class TestTask {
-
-	/**
-	 * 测试方法
-	 */
-	public void test() {
-		System.out.println("current timestapmp is : " + System.currentTimeMillis());
-	}
-	
-}

+ 89 - 8
src/main/java/net/chenlin/dp/modules/sys/controller/AbstractController.java

@@ -1,29 +1,110 @@
 package net.chenlin.dp.modules.sys.controller;
 
+import net.chenlin.dp.common.utils.WebUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import net.chenlin.dp.common.utils.ShiroUtils;
 import net.chenlin.dp.modules.sys.entity.SysUserEntity;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
 /**
  * Controller公共组件
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午2:43:23
+ * @author zcl<yczclcn@163.com>
  */
 public abstract class AbstractController {
-	
-	protected Logger logger = LoggerFactory.getLogger(getClass());
-	
+
+	/**
+	 * 日志
+	 */
+	protected Logger LOGGER = LoggerFactory.getLogger(getClass());
+
+	/**
+	 * 获取参数
+	 * @param name 请求参数名称
+	 * @return 请求参数值
+	 */
+	protected String getParam(String name) {
+		return WebUtils.getRequest().getParameter(name);
+	}
+
+	/**
+	 * 设置属性
+	 * @param key 属性名
+	 * @param value 属性值
+	 */
+	protected void setAttr(String key, Object value) {
+		WebUtils.getRequest().setAttribute(key, value);
+	}
+
+	/**
+	 * 获取httpServletRequest
+	 * @return HttpServletRequest
+	 */
+	protected HttpServletRequest getHttpServletRequest() {
+		return WebUtils.getRequest();
+	}
+
+	/**
+	 * 获取httpServletResponse
+	 * @return HttpServletResponse
+	 */
+	protected HttpServletResponse getHttpServletResponse() {
+		return WebUtils.getResponse();
+	}
+
+	/**
+	 * 获取session:如果当前请求没有session,则创建一个
+	 * @return HttpSession
+	 */
+	protected HttpSession getSession() {
+		return WebUtils.getRequest().getSession();
+	}
+
+	/**
+	 * 获取session:如果当前请求没有session,true则创建一个,false则返回null
+	 * @param create 是否创建,true:创建,false:不创建,返回null
+	 * @return HttpSession
+	 */
+	protected HttpSession getSession(boolean create) {
+		return WebUtils.getRequest().getSession(create);
+	}
+
+	/**
+	 * 获取当前用户entity
+	 * @return SysUserEntity
+	 */
 	protected SysUserEntity getUser() {
 		return ShiroUtils.getUserEntity();
 	}
 
+	/**
+	 * 获取当前用户id
+	 * @return 用户id
+	 */
 	protected Long getUserId() {
 		return getUser().getUserId();
 	}
+
+	/**
+	 * 重定向
+	 * @param page
+	 * @return 重定向全路径
+	 */
+	protected String redirect(String page) {
+		return "redirect:".concat(page);
+	}
+
+	/**
+	 * beetl视图
+	 * @param page
+	 * @return html全路径
+	 */
+	protected String html(String page) {
+		return page.concat(".html");
+	}
 	
 }

+ 113 - 117
src/main/java/net/chenlin/dp/modules/quartz/controller/QuartzJobController.java → src/main/java/net/chenlin/dp/modules/sys/controller/QuartzJobController.java

@@ -1,117 +1,113 @@
-package net.chenlin.dp.modules.quartz.controller;
-
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import net.chenlin.dp.common.annotation.SysLog;
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobEntity;
-import net.chenlin.dp.modules.quartz.service.QuartzJobService;
-
-/**
- * 定时任务
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午11:51:24
- */
-@RestController
-@RequestMapping("/quartz/job")
-public class QuartzJobController {
-
-	@Autowired
-	private QuartzJobService quartzJobService;
-	
-	/**
-	 * 列表
-	 * @param params
-	 * @return
-	 */
-	@RequestMapping("/list")
-	public Page<QuartzJobEntity> list(@RequestBody Map<String, Object> params) {
-		return quartzJobService.list(params);
-	}
-	
-	/**
-	 * 新增任务
-	 * @param job
-	 * @return
-	 */
-	@SysLog("新增定时任务")
-	@RequestMapping("/save")
-	public R save(@RequestBody QuartzJobEntity job) {
-		return quartzJobService.saveQuartzJob(job);
-	}
-	
-	/**
-	 * 根据id查询详情
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping("/info")
-	public R info(@RequestBody Long id) {
-		return quartzJobService.getQuartzJobById(id);
-	}
-	
-	/**
-	 * 修改任务
-	 * @param job
-	 * @return
-	 */
-	@SysLog("修改定时任务")
-	@RequestMapping("/update")
-	public R update(@RequestBody QuartzJobEntity job) {
-		return quartzJobService.updateQuartzJob(job);
-	}
-	
-	/**
-	 * 删除定时任务
-	 * @param id
-	 * @return
-	 */
-	@SysLog("删除定时任务")
-	@RequestMapping("/remove")
-	public R remove(@RequestBody Long[] id) {
-		return quartzJobService.batchRemoveQuartzJob(id);
-	}
-	
-	/**
-	 * 立即运行
-	 * @param id
-	 * @return
-	 */
-	@SysLog("立即运行定时任务")
-	@RequestMapping("/run")
-	public R run(@RequestBody Long[] id) {
-		return quartzJobService.run(id);
-	}
-	
-	/**
-	 * 暂停任务
-	 * @param id
-	 * @return
-	 */
-	@SysLog("暂停定时运行")
-	@RequestMapping("/disable")
-	public R pause(@RequestBody Long[] id) {
-		return quartzJobService.pause(id);
-	}
-	
-	/**
-	 * 启用任务
-	 * @param id
-	 * @return
-	 */
-	@SysLog("启用定时任务")
-	@RequestMapping("/enable")
-	public R resume(@RequestBody Long[] id) {
-		return quartzJobService.resume(id);
-	}
-	
-}
+package net.chenlin.dp.modules.sys.controller;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import net.chenlin.dp.common.annotation.SysLog;
+import net.chenlin.dp.common.entity.Page;
+import net.chenlin.dp.common.entity.R;
+import net.chenlin.dp.modules.sys.entity.QuartzJobEntity;
+import net.chenlin.dp.modules.sys.service.QuartzJobService;
+
+/**
+ * 定时任务
+ * @author zcl<yczclcn@163.com>
+ */
+@RestController
+@RequestMapping("/quartz/job")
+public class QuartzJobController {
+
+	@Autowired
+	private QuartzJobService quartzJobService;
+	
+	/**
+	 * 列表
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping("/list")
+	public Page<QuartzJobEntity> list(@RequestBody Map<String, Object> params) {
+		return quartzJobService.list(params);
+	}
+	
+	/**
+	 * 新增任务
+	 * @param job
+	 * @return
+	 */
+	@SysLog("新增定时任务")
+	@RequestMapping("/save")
+	public R save(@RequestBody QuartzJobEntity job) {
+		return quartzJobService.saveQuartzJob(job);
+	}
+	
+	/**
+	 * 根据id查询详情
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping("/info")
+	public R info(@RequestBody Long id) {
+		return quartzJobService.getQuartzJobById(id);
+	}
+	
+	/**
+	 * 修改任务
+	 * @param job
+	 * @return
+	 */
+	@SysLog("修改定时任务")
+	@RequestMapping("/update")
+	public R update(@RequestBody QuartzJobEntity job) {
+		return quartzJobService.updateQuartzJob(job);
+	}
+	
+	/**
+	 * 删除定时任务
+	 * @param id
+	 * @return
+	 */
+	@SysLog("删除定时任务")
+	@RequestMapping("/remove")
+	public R remove(@RequestBody Long[] id) {
+		return quartzJobService.batchRemoveQuartzJob(id);
+	}
+	
+	/**
+	 * 立即运行
+	 * @param id
+	 * @return
+	 */
+	@SysLog("立即运行定时任务")
+	@RequestMapping("/run")
+	public R run(@RequestBody Long[] id) {
+		return quartzJobService.run(id);
+	}
+	
+	/**
+	 * 暂停任务
+	 * @param id
+	 * @return
+	 */
+	@SysLog("暂停定时运行")
+	@RequestMapping("/disable")
+	public R pause(@RequestBody Long[] id) {
+		return quartzJobService.pause(id);
+	}
+	
+	/**
+	 * 启用任务
+	 * @param id
+	 * @return
+	 */
+	@SysLog("启用定时任务")
+	@RequestMapping("/enable")
+	public R resume(@RequestBody Long[] id) {
+		return quartzJobService.resume(id);
+	}
+	
+}

+ 58 - 62
src/main/java/net/chenlin/dp/modules/quartz/controller/QuartzJobLogController.java → src/main/java/net/chenlin/dp/modules/sys/controller/QuartzJobLogController.java

@@ -1,62 +1,58 @@
-package net.chenlin.dp.modules.quartz.controller;
-
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import net.chenlin.dp.common.annotation.SysLog;
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.modules.quartz.entity.QuartzJobLogEntity;
-import net.chenlin.dp.modules.quartz.service.QuartzJobLogService;
-
-/**
- * 定时任务日志
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017821日 上午11:48:14
- */
-@RestController
-@RequestMapping("/quartz/job/log")
-public class QuartzJobLogController {
-
-	@Autowired
-	private QuartzJobLogService quartzJobLogService;
-	
-	/**
-	 * 列表
-	 * @param params
-	 * @return
-	 */
-	@RequestMapping("/list")
-	public Page<QuartzJobLogEntity> list(@RequestBody Map<String, Object> params) {
-		return quartzJobLogService.listForPage(params);
-	}
-	
-	/**
-	 * 删除
-	 * @param id
-	 * @return
-	 */
-	@SysLog("删除定时任务日志")
-	@RequestMapping("/remove")
-	public R batchRemove(@RequestBody Long[] id) {
-		return quartzJobLogService.batchRemove(id);
-	}
-	
-	/**
-	 * 清空
-	 * @return
-	 */
-	@SysLog("清空定时任务日志")
-	@RequestMapping("/clear")
-	public R batchRemoveAll() {
-		return quartzJobLogService.batchRemoveAll();
-	}
-	
-}
+package net.chenlin.dp.modules.sys.controller;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import net.chenlin.dp.common.annotation.SysLog;
+import net.chenlin.dp.common.entity.Page;
+import net.chenlin.dp.common.entity.R;
+import net.chenlin.dp.modules.sys.entity.QuartzJobLogEntity;
+import net.chenlin.dp.modules.sys.service.QuartzJobLogService;
+
+/**
+ * 定时任务日志
+ * @author zcl<yczclcn@163.com>
+ */
+@RestController
+@RequestMapping("/quartz/job/log")
+public class QuartzJobLogController {
+
+	@Autowired
+	private QuartzJobLogService quartzJobLogService;
+	
+	/**
+	 * 列表
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping("/list")
+	public Page<QuartzJobLogEntity> list(@RequestBody Map<String, Object> params) {
+		return quartzJobLogService.listForPage(params);
+	}
+	
+	/**
+	 * 删除
+	 * @param id
+	 * @return
+	 */
+	@SysLog("删除定时任务日志")
+	@RequestMapping("/remove")
+	public R batchRemove(@RequestBody Long[] id) {
+		return quartzJobLogService.batchRemove(id);
+	}
+	
+	/**
+	 * 清空
+	 * @return
+	 */
+	@SysLog("清空定时任务日志")
+	@RequestMapping("/clear")
+	public R batchRemoveAll() {
+		return quartzJobLogService.batchRemoveAll();
+	}
+	
+}

+ 90 - 95
src/main/java/net/chenlin/dp/modules/base/controller/SysAreaController.java → src/main/java/net/chenlin/dp/modules/sys/controller/SysAreaController.java

@@ -1,95 +1,90 @@
-package net.chenlin.dp.modules.base.controller;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import net.chenlin.dp.common.annotation.SysLog;
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.modules.base.entity.SysAreaEntity;
-import net.chenlin.dp.modules.base.service.SysAreaService;
-import net.chenlin.dp.modules.sys.controller.AbstractController;
-
-/**
- * 行政区域
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017818日 下午3:42:04
- */
-@RestController
-@RequestMapping("/sys/area")
-public class SysAreaController extends AbstractController {
-
-	@Autowired
-	private SysAreaService sysAreaService;
-	
-	/**
-	 * 根据父级code查询子节点,子区域列表
-	 * @param params
-	 * @return
-	 */
-	@RequestMapping("/list")
-	public R list(@RequestBody Map<String, Object> params) {
-		return sysAreaService.listAreaByParentCode(params);
-	}
-	
-	/**
-	 * 根据父级code查询子节点,树形目录
-	 * @return
-	 */
-	@RequestMapping("/select")
-	public List<SysAreaEntity> select(@RequestParam String areaCode) {
-		return sysAreaService.listAreaByParentCode(areaCode);
-	}
-	
-	/**
-	 * 新增区域
-	 * @param area
-	 * @return
-	 */
-	@SysLog("新增区域")
-	@RequestMapping("/save")
-	public R save(@RequestBody SysAreaEntity area) {
-		return sysAreaService.saveArea(area);
-	}
-	
-	/**
-	 * 查询详情
-	 * @param areaId
-	 * @return
-	 */
-	@RequestMapping("/info")
-	public R info(@RequestBody Long areaId) {
-		return sysAreaService.getAreaById(areaId);
-	}
-	
-	/**
-	 * 修改区域
-	 * @param area
-	 * @return
-	 */
-	@SysLog("修改区域")
-	@RequestMapping("/update")
-	public R update(@RequestBody SysAreaEntity area) {
-		return sysAreaService.updateArea(area);
-	}
-	
-	/**
-	 * 删除区域
-	 * @param id
-	 * @return
-	 */
-	@SysLog("删除区域")
-	@RequestMapping("/remove")
-	public R remove(@RequestBody Long[] id) {
-		return sysAreaService.batchRemoveArea(id);
-	}
-	
-}
+package net.chenlin.dp.modules.sys.controller;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import net.chenlin.dp.common.annotation.SysLog;
+import net.chenlin.dp.common.entity.R;
+import net.chenlin.dp.modules.sys.entity.SysAreaEntity;
+import net.chenlin.dp.modules.sys.service.SysAreaService;
+
+/**
+ * 行政区域
+ * @author zcl<yczclcn@163.com>
+ */
+@RestController
+@RequestMapping("/sys/area")
+public class SysAreaController extends AbstractController {
+
+	@Autowired
+	private SysAreaService sysAreaService;
+	
+	/**
+	 * 根据父级code查询子节点,子区域列表
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping("/list")
+	public R list(@RequestBody Map<String, Object> params) {
+		return sysAreaService.listAreaByParentCode(params);
+	}
+	
+	/**
+	 * 根据父级code查询子节点,树形目录
+	 * @return
+	 */
+	@RequestMapping("/select")
+	public List<SysAreaEntity> select(@RequestParam String areaCode) {
+		return sysAreaService.listAreaByParentCode(areaCode);
+	}
+	
+	/**
+	 * 新增区域
+	 * @param area
+	 * @return
+	 */
+	@SysLog("新增区域")
+	@RequestMapping("/save")
+	public R save(@RequestBody SysAreaEntity area) {
+		return sysAreaService.saveArea(area);
+	}
+	
+	/**
+	 * 查询详情
+	 * @param areaId
+	 * @return
+	 */
+	@RequestMapping("/info")
+	public R info(@RequestBody Long areaId) {
+		return sysAreaService.getAreaById(areaId);
+	}
+	
+	/**
+	 * 修改区域
+	 * @param area
+	 * @return
+	 */
+	@SysLog("修改区域")
+	@RequestMapping("/update")
+	public R update(@RequestBody SysAreaEntity area) {
+		return sysAreaService.updateArea(area);
+	}
+	
+	/**
+	 * 删除区域
+	 * @param id
+	 * @return
+	 */
+	@SysLog("删除区域")
+	@RequestMapping("/remove")
+	public R remove(@RequestBody Long[] id) {
+		return sysAreaService.batchRemoveArea(id);
+	}
+	
+}

+ 61 - 65
src/main/java/net/chenlin/dp/modules/generator/controller/SysGeneratorController.java → src/main/java/net/chenlin/dp/modules/sys/controller/SysGeneratorController.java

@@ -1,65 +1,61 @@
-package net.chenlin.dp.modules.generator.controller;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.io.IOUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.modules.generator.entity.GeneratorParamEntity;
-import net.chenlin.dp.modules.generator.entity.TableEntity;
-import net.chenlin.dp.modules.generator.service.SysGeneratorService;
-
-/**
- * 代码生成器
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017828日 下午8:56:30
- */
-@Controller
-@RequestMapping("/sys/generator")
-public class SysGeneratorController {
-
-	@Autowired
-	private SysGeneratorService sysGeneratorService;
-	
-	/**
-	 * 表格列表
-	 * @param params
-	 * @return
-	 */
-	@RequestMapping("/list")
-	@ResponseBody
-	public Page<TableEntity> list(@RequestBody Map<String, Object> params) {
-		return sysGeneratorService.listTable(params);
-	}
-	
-	/**
-	 * 生成代码
-	 * @param tables
-	 * @param request
-	 * @param response
-	 * @throws IOException 
-	 */
-	@RequestMapping("/code")
-	public void generator(GeneratorParamEntity params, HttpServletRequest request, HttpServletResponse response) throws IOException {
-		byte[] code = sysGeneratorService.generator(params);
-		String attachment = "attachment; filename=" + params.getTables()[0] + ".zip";
-		response.reset();  
-        response.setHeader("Content-Disposition", attachment);  
-        response.addHeader("Content-Length", "" + code.length);  
-        response.setContentType("application/octet-stream; charset=UTF-8");  
-        IOUtils.write(code, response.getOutputStream());
-	}
-	
-}
+package net.chenlin.dp.modules.sys.controller;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.io.IOUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import net.chenlin.dp.common.entity.Page;
+import net.chenlin.dp.modules.sys.entity.GeneratorParamEntity;
+import net.chenlin.dp.modules.sys.entity.TableEntity;
+import net.chenlin.dp.modules.sys.service.SysGeneratorService;
+
+/**
+ * 代码生成器
+ * @author zcl<yczclcn@163.com>
+ */
+@Controller
+@RequestMapping("/sys/generator")
+public class SysGeneratorController {
+
+	@Autowired
+	private SysGeneratorService sysGeneratorService;
+	
+	/**
+	 * 表格列表
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping("/list")
+	@ResponseBody
+	public Page<TableEntity> list(@RequestBody Map<String, Object> params) {
+		return sysGeneratorService.listTable(params);
+	}
+
+	/**
+	 * 生成代码
+	 * @param params
+	 * @param request
+	 * @param response
+	 * @throws IOException
+	 */
+	@RequestMapping("/code")
+	public void generator(GeneratorParamEntity params, HttpServletRequest request, HttpServletResponse response) throws IOException {
+		byte[] code = sysGeneratorService.generator(params);
+		String attachment = "attachment; filename=" + params.getTables()[0] + ".zip";
+		response.reset();  
+        response.setHeader("Content-Disposition", attachment);  
+        response.addHeader("Content-Length", "" + code.length);  
+        response.setContentType("application/octet-stream; charset=UTF-8");  
+        IOUtils.write(code, response.getOutputStream());
+	}
+	
+}

+ 1 - 5
src/main/java/net/chenlin/dp/modules/sys/controller/SysLogController.java

@@ -15,11 +15,7 @@ import net.chenlin.dp.modules.sys.service.SysLogService;
 
 /**
  * 系统日志
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017814日 下午10:01:36
+ * @author zcl<yczclcn@163.com>
  */
 @RestController
 @RequestMapping("/sys/log")

+ 48 - 33
src/main/java/net/chenlin/dp/modules/sys/controller/SysLoginController.java

@@ -1,63 +1,78 @@
 package net.chenlin.dp.modules.sys.controller;
 
-import java.io.IOException;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
 import net.chenlin.dp.common.annotation.SysLog;
-import net.chenlin.dp.common.entity.R;
 import net.chenlin.dp.common.utils.MD5Utils;
 import net.chenlin.dp.common.utils.ShiroUtils;
-import net.chenlin.dp.modules.sys.entity.SysUserEntity;
 import net.chenlin.dp.modules.sys.service.SysUserService;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
 
 /**
  * 用户controller
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午2:48:50
+ * @author zcl<yczclcn@163.com>
  */
-@RestController
-@RequestMapping("/sys")
+@Controller
 public class SysLoginController extends AbstractController {
-	
+
 	@Autowired
 	private SysUserService sysUserService;
+
+	/**
+	 * 跳转登录页面
+	 * @return
+	 */
+	@RequestMapping(value = "/login", method = RequestMethod.GET)
+	public String toLogin() {
+		if (ShiroUtils.isLogin() || ShiroUtils.getUserEntity() != null) {
+			return redirect("/");
+		}
+		return html("/login");
+	}
 	
 	/**
 	 * 登录
 	 */
 	@SysLog("登录")
 	@RequestMapping(value = "/login", method = RequestMethod.POST)
-	public R login(String username, String password)throws IOException {
-		SysUserEntity user = sysUserService.getByUserName(username);
-		password = MD5Utils.encrypt(username, password);
-		
-		if(user == null || !user.getPassword().equals(password)) {
-			return R.error("用户名或密码错误");
+	public String login(Model model) {
+		String username = getParam("username").trim();
+		String password = getParam("password").trim();
+		try {
+			UsernamePasswordToken token = new UsernamePasswordToken(username, MD5Utils.encrypt(username, password));
+			ShiroUtils.getSubject().login(token);
+			SecurityUtils.getSubject().getSession().setAttribute("sessionFlag", true);
+			return redirect("/");
+		} catch (UnknownAccountException | IncorrectCredentialsException | LockedAccountException e) {
+			model.addAttribute("errorMsg", e.getMessage());
+		} catch (AuthenticationException e) {
+			model.addAttribute("errorMsg", "登录服务异常");
 		}
-		
-		if(user.getStatus() == 0) {
-			return R.error("账号已被锁定,请联系管理员");
-		}
-	    
-		return sysUserService.saveUserToken(user.getUserId());
+		return html("/login");
+	}
+
+	/**
+	 * 跳转后台控制台
+	 * @return
+	 */
+	@RequestMapping(value = "/", method = RequestMethod.GET)
+	public String index() {
+		return html("/index");
 	}
 	
 	/**
 	 * 退出
 	 */
 	@SysLog("退出系统")
-	@RequestMapping(value = "/logout", method = RequestMethod.POST)
-	public R logout() {
-		R r = sysUserService.updateUserToken(getUserId());
+	@RequestMapping(value = "/logout", method = RequestMethod.GET)
+	public String logout() {
 		ShiroUtils.logout();
-		return r;
+		return html("/login");
 	}
 	
 }

+ 126 - 131
src/main/java/net/chenlin/dp/modules/base/controller/SysMacroController.java → src/main/java/net/chenlin/dp/modules/sys/controller/SysMacroController.java

@@ -1,131 +1,126 @@
-package net.chenlin.dp.modules.base.controller;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import net.chenlin.dp.common.annotation.SysLog;
-import net.chenlin.dp.common.entity.R;
-import net.chenlin.dp.modules.base.entity.SysMacroEntity;
-import net.chenlin.dp.modules.base.service.SysMacroService;
-import net.chenlin.dp.modules.sys.controller.AbstractController;
-
-/**
- * 通用字典
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017815日 下午12:54:33
- */
-@RestController
-@RequestMapping("/sys/macro")
-public class SysMacroController extends AbstractController {
-
-	@Autowired
-	private SysMacroService sysMacroService;
-	
-	/**
-	 * 列表
-	 * @return
-	 */
-	@RequestMapping("/list")
-	public List<SysMacroEntity> list() {
-		return sysMacroService.listMacro();
-	}
-	
-	/**
-	 * 树形列表
-	 * @return
-	 */
-	@RequestMapping("/select")
-	public List<SysMacroEntity> select() {
-		return sysMacroService.listNotMacro();
-	}
-	
-	/**
-	 * 新增字典
-	 * @param macro
-	 * @return
-	 */
-	@SysLog("新增字典")
-	@RequestMapping("/save")
-	public R save(@RequestBody SysMacroEntity macro) {
-		return sysMacroService.saveMacro(macro);
-	}
-	
-	/**
-	 * 根据id查询详情
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping("/info")
-	public R info(@RequestBody Long id) {
-		return sysMacroService.getObjectById(id);
-	}
-	
-	/**
-	 * 修改字典
-	 * @param macro
-	 * @return
-	 */
-	@SysLog("修改字典")
-	@RequestMapping("/update")
-	public R update(@RequestBody SysMacroEntity macro) {
-		return sysMacroService.updateMacro(macro);
-	}
-
-	/**
-	 * 显示字典
-	 * @param id
-	 * @return
-	 */
-	@SysLog("显示字典")
-	@RequestMapping("/enable")
-	public R updateStateShow(@RequestBody Long id) {
-		SysMacroEntity macro = new SysMacroEntity();
-		macro.setMacroId(id);
-		macro.setStatus(1);
-		return sysMacroService.updateMacro(macro);
-	}
-
-	/**
-	 * 隐藏字典
-	 * @param id
-	 * @return
-	 */
-	@SysLog("隐藏字典")
-	@RequestMapping("/disable")
-	public R updateStateHide(@RequestBody Long id) {
-		SysMacroEntity macro = new SysMacroEntity();
-		macro.setMacroId(id);
-		macro.setStatus(0);
-		return sysMacroService.updateMacro(macro);
-	}
-	
-	/**
-	 * 删除字典
-	 * @param id
-	 * @return
-	 */
-	@SysLog("删除字典")
-	@RequestMapping("/remove")
-	public R batchRemove(@RequestBody Long[] id) {
-		return sysMacroService.batchRemove(id);
-	}
-
-	/**
-	 * 获取某个类型所有参数值,用于前台构建下拉框
-	 * @param value
-	 * @return
-	 */
-	@RequestMapping("/value")
-	public List<SysMacroEntity> listMacroValue(@RequestParam String value) {
-		return sysMacroService.listMacroValue(value);
-	}
-	
-}
+package net.chenlin.dp.modules.sys.controller;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import net.chenlin.dp.common.annotation.SysLog;
+import net.chenlin.dp.common.entity.R;
+import net.chenlin.dp.modules.sys.entity.SysMacroEntity;
+import net.chenlin.dp.modules.sys.service.SysMacroService;
+
+/**
+ * 通用字典
+ * @author zcl<yczclcn@163.com>
+ */
+@RestController
+@RequestMapping("/sys/macro")
+public class SysMacroController extends AbstractController {
+
+	@Autowired
+	private SysMacroService sysMacroService;
+	
+	/**
+	 * 列表
+	 * @return
+	 */
+	@RequestMapping("/list")
+	public List<SysMacroEntity> list() {
+		return sysMacroService.listMacro();
+	}
+	
+	/**
+	 * 树形列表
+	 * @return
+	 */
+	@RequestMapping("/select")
+	public List<SysMacroEntity> select() {
+		return sysMacroService.listNotMacro();
+	}
+	
+	/**
+	 * 新增字典
+	 * @param macro
+	 * @return
+	 */
+	@SysLog("新增字典")
+	@RequestMapping("/save")
+	public R save(@RequestBody SysMacroEntity macro) {
+		return sysMacroService.saveMacro(macro);
+	}
+	
+	/**
+	 * 根据id查询详情
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping("/info")
+	public R info(@RequestBody Long id) {
+		return sysMacroService.getObjectById(id);
+	}
+	
+	/**
+	 * 修改字典
+	 * @param macro
+	 * @return
+	 */
+	@SysLog("修改字典")
+	@RequestMapping("/update")
+	public R update(@RequestBody SysMacroEntity macro) {
+		return sysMacroService.updateMacro(macro);
+	}
+
+	/**
+	 * 显示字典
+	 * @param id
+	 * @return
+	 */
+	@SysLog("显示字典")
+	@RequestMapping("/enable")
+	public R updateStateShow(@RequestBody Long id) {
+		SysMacroEntity macro = new SysMacroEntity();
+		macro.setMacroId(id);
+		macro.setStatus(1);
+		return sysMacroService.updateMacro(macro);
+	}
+
+	/**
+	 * 隐藏字典
+	 * @param id
+	 * @return
+	 */
+	@SysLog("隐藏字典")
+	@RequestMapping("/disable")
+	public R updateStateHide(@RequestBody Long id) {
+		SysMacroEntity macro = new SysMacroEntity();
+		macro.setMacroId(id);
+		macro.setStatus(0);
+		return sysMacroService.updateMacro(macro);
+	}
+	
+	/**
+	 * 删除字典
+	 * @param id
+	 * @return
+	 */
+	@SysLog("删除字典")
+	@RequestMapping("/remove")
+	public R batchRemove(@RequestBody Long[] id) {
+		return sysMacroService.batchRemove(id);
+	}
+
+	/**
+	 * 获取某个类型所有参数值,用于前台构建下拉框
+	 * @param value
+	 * @return
+	 */
+	@RequestMapping("/value")
+	public List<SysMacroEntity> listMacroValue(@RequestParam String value) {
+		return sysMacroService.listMacroValue(value);
+	}
+	
+}

+ 1 - 5
src/main/java/net/chenlin/dp/modules/sys/controller/SysMenuController.java

@@ -17,11 +17,7 @@ import net.chenlin.dp.modules.sys.service.SysMenuService;
 
 /**
  * 系统菜单controller
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017810日 上午12:23:44
+ * @author zcl<yczclcn@163.com>
  */
 @RestController
 @RequestMapping("/sys/menu")

+ 1 - 5
src/main/java/net/chenlin/dp/modules/sys/controller/SysOrgController.java

@@ -14,11 +14,7 @@ import net.chenlin.dp.modules.sys.service.SysOrgService;
 
 /**
  * 组织机构
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017817日 上午11:35:00
+ * @author zcl<yczclcn@163.com>
  */
 @RestController
 @RequestMapping("/sys/org")

+ 35 - 15
src/main/java/net/chenlin/dp/modules/sys/controller/SysPageController.java

@@ -3,14 +3,9 @@ package net.chenlin.dp.modules.sys.controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
-
 /**
  * 系统页面视图
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201789日 下午3:33:00
+ * @author zcl<yczclcn@163.com>
  */
 @Controller
 public class SysPageController {
@@ -22,21 +17,46 @@ public class SysPageController {
 	 * @param url
 	 * @return
 	 */
-	@RequestMapping("{module}/{function}/{url}.html")
+	@RequestMapping("/{module}/{function}/{url}.html")
 	public String page(@PathVariable("module") String module, @PathVariable("function") String function,
 			@PathVariable("url") String url) {
-		return module + "/" + function + "/" + url;
+		return "/" + module + "/" + function + "/" + url + ".html";
 	}
-	
+
 	/**
-	 * 页面跳转
-	 * @param module
-	 * @param url
+	 * 404页面
+	 * @return
+	 */
+	@RequestMapping("/error/404")
+	public String notFoundPage() {
+		return "/error/404.html";
+	}
+
+	/**
+	 * 403页面
+	 * @return
+	 */
+	@RequestMapping("/error/403")
+	public String noAuthPage() {
+		return "/error/403.html";
+	}
+
+	/**
+	 * 500页面
+	 * @return
+	 */
+	@RequestMapping("/error/500")
+	public String sysError() {
+		return "/error/500.html";
+	}
+
+	/**
+	 * 系统首页
 	 * @return
 	 */
-	@RequestMapping("{module}/{url}.html")
-	public String page(@PathVariable("module") String module, @PathVariable("url") String url) {
-		return module + "/" + url;
+	@RequestMapping("/dashboard")
+	public String main() {
+		return "/system/dashboard.html";
 	}
 
 }

+ 1 - 5
src/main/java/net/chenlin/dp/modules/sys/controller/SysRoleController.java

@@ -17,11 +17,7 @@ import net.chenlin.dp.modules.sys.service.SysRoleService;
 
 /**
  * 系统角色
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017812日 上午12:43:10
+ * @author zcl<yczclcn@163.com>
  */
 @RestController
 @RequestMapping("/sys/role")

+ 3 - 6
src/main/java/net/chenlin/dp/modules/sys/controller/SysUserController.java

@@ -2,6 +2,7 @@ package net.chenlin.dp.modules.sys.controller;
 
 import java.util.Map;
 
+import net.chenlin.dp.common.utils.CommonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -16,11 +17,7 @@ import net.chenlin.dp.modules.sys.service.SysUserService;
 
 /**
  * 系统用户
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午9:04:59
+ * @author zcl<yczclcn@163.com>
  */
 @RestController
 @RequestMapping("/sys/user")
@@ -56,7 +53,7 @@ public class SysUserController extends AbstractController {
 	 */
 	@RequestMapping("/perms")
 	public R listUserPerms() {
-		return sysUserService.listUserPerms(getUserId());
+		return CommonUtils.msgNotCheckNull(sysUserService.listUserPerms(getUserId()));
 	}
 	
 	/**

+ 1 - 5
src/main/java/net/chenlin/dp/modules/sys/dao/BaseMapper.java

@@ -7,11 +7,7 @@ import net.chenlin.dp.common.entity.Query;
 
 /**
  * 基础dao
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017812日 下午12:23:18
+ * @author zcl<yczclcn@163.com>
  */
 public interface BaseMapper<T> {
 	

+ 19 - 0
src/main/java/net/chenlin/dp/modules/sys/dao/QuartzJobLogMapper.java

@@ -0,0 +1,19 @@
+package net.chenlin.dp.modules.sys.dao;
+
+import net.chenlin.dp.modules.sys.entity.QuartzJobLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 定时任务日志
+ * @author zcl<yczclcn@163.com>
+ */
+@Mapper
+public interface QuartzJobLogMapper extends BaseMapper<QuartzJobLogEntity> {
+
+	/**
+	 * 批量删除
+	 * @return
+	 */
+	int batchRemoveAll();
+	
+}

+ 14 - 0
src/main/java/net/chenlin/dp/modules/sys/dao/QuartzJobMapper.java

@@ -0,0 +1,14 @@
+package net.chenlin.dp.modules.sys.dao;
+
+import net.chenlin.dp.modules.sys.entity.QuartzJobEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+
+/**
+ * 定时任务
+ * @author zcl<yczclcn@163.com>
+ */
+@Mapper
+public interface QuartzJobMapper extends BaseMapper<QuartzJobEntity> {
+
+}

+ 30 - 25
src/main/java/net/chenlin/dp/modules/base/dao/SysAreaMapper.java → src/main/java/net/chenlin/dp/modules/sys/dao/SysAreaMapper.java

@@ -1,25 +1,30 @@
-package net.chenlin.dp.modules.base.dao;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.base.entity.SysAreaEntity;
-import net.chenlin.dp.modules.sys.dao.BaseMapper;
-
-/**
- * 行政区域
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017818日 下午3:36:04
- */
-@Mapper
-public interface SysAreaMapper extends BaseMapper<SysAreaEntity> {
-
-	List<SysAreaEntity> listAreaByParentCode(Query query);
-	
-	int countAreaChildren(Long areaId);
-	
-}
+package net.chenlin.dp.modules.sys.dao;
+
+import net.chenlin.dp.common.entity.Query;
+import net.chenlin.dp.modules.sys.entity.SysAreaEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 行政区域
+ * @author zcl<yczclcn@163.com>
+ */
+@Mapper
+public interface SysAreaMapper extends BaseMapper<SysAreaEntity> {
+
+	/**
+	 * 根据父计编码查询
+	 * @param query
+	 * @return
+	 */
+	List<SysAreaEntity> listAreaByParentCode(Query query);
+
+	/**
+	 * 子节点总数
+	 * @param areaId
+	 * @return
+	 */
+	int countAreaChildren(Long areaId);
+	
+}

+ 40 - 28
src/main/java/net/chenlin/dp/modules/generator/dao/SysGeneratorMapper.java → src/main/java/net/chenlin/dp/modules/sys/dao/SysGeneratorMapper.java

@@ -1,28 +1,40 @@
-package net.chenlin.dp.modules.generator.dao;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Mapper;
-import net.chenlin.dp.common.entity.Page;
-import net.chenlin.dp.common.entity.Query;
-import net.chenlin.dp.modules.generator.entity.ColumnEntity;
-import net.chenlin.dp.modules.generator.entity.TableEntity;
-
-/**
- * 代码生成器
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017828日 下午8:47:12
- */
-@Mapper
-public interface SysGeneratorMapper {
-
-	List<TableEntity> listTable(Page<TableEntity> page, Query query);
-	
-	TableEntity getTableByName(String tableName);
-	
-	List<ColumnEntity> listColumn(String tableName);
-	
-}
+package net.chenlin.dp.modules.sys.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import net.chenlin.dp.common.entity.Page;
+import net.chenlin.dp.common.entity.Query;
+import net.chenlin.dp.modules.sys.entity.ColumnEntity;
+import net.chenlin.dp.modules.sys.entity.TableEntity;
+
+/**
+ * 代码生成器
+ * @author zcl<yczclcn@163.com>
+ */
+@Mapper
+public interface SysGeneratorMapper {
+
+	/**
+	 * 查询所有表格
+	 * @param page
+	 * @param query
+	 * @return
+	 */
+	List<TableEntity> listTable(Page<TableEntity> page, Query query);
+
+	/**
+	 * 根据名称查询
+	 * @param tableName
+	 * @return
+	 */
+	TableEntity getTableByName(String tableName);
+
+	/**
+	 * 查询所有列
+	 * @param tableName
+	 * @return
+	 */
+	List<ColumnEntity> listColumn(String tableName);
+	
+}

+ 6 - 6
src/main/java/net/chenlin/dp/modules/sys/dao/SysLogMapper.java

@@ -5,16 +5,16 @@ import org.apache.ibatis.annotations.Mapper;
 import net.chenlin.dp.modules.sys.entity.SysLogEntity;
 
 /**
- * 系统日志 
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017814日 下午8:19:01
+ * 系统日志
+ * @author zcl<yczclcn@163.com>
  */
 @Mapper
 public interface SysLogMapper extends BaseMapper<SysLogEntity> {
 
+	/**
+	 * 批量删除
+	 * @return
+	 */
 	int batchRemoveAll();
 	
 }

+ 36 - 0
src/main/java/net/chenlin/dp/modules/sys/dao/SysMacroMapper.java

@@ -0,0 +1,36 @@
+package net.chenlin.dp.modules.sys.dao;
+
+import net.chenlin.dp.modules.sys.entity.SysMacroEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+
+/**
+ * 通用字典
+ * @author zcl<yczclcn@163.com>
+ */
+@Mapper
+public interface SysMacroMapper extends BaseMapper<SysMacroEntity> {
+
+	/**
+	 * 查询目录集合
+	 * @return
+	 */
+	List<SysMacroEntity> listNotMacro();
+
+	/**
+	 * 查询子节点个数
+	 * @param typeId
+	 * @return
+	 */
+	int countMacroChildren(Long typeId);
+
+	/**
+	 * 根据类型查询所有参数
+	 * @param type
+	 * @return
+	 */
+	List<SysMacroEntity> listMacroValue(String type);
+	
+}

+ 24 - 9
src/main/java/net/chenlin/dp/modules/sys/dao/SysMenuMapper.java

@@ -8,21 +8,36 @@ import net.chenlin.dp.modules.sys.entity.SysMenuEntity;
 
 /**
  * 系统菜单dao
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017810日 上午12:21:34
+ * @author zcl<yczclcn@163.com>
  */
 @Mapper
 public interface SysMenuMapper extends BaseMapper<SysMenuEntity> {
-	
+
+	/**
+	 * 根据父级id查询菜单
+	 * @param parentId
+	 * @return
+	 */
 	List<SysMenuEntity> listParentId(Long parentId);
-	
+
+	/**
+	 * 查询菜单目录和菜单集合
+	 * @return
+	 */
 	List<SysMenuEntity> listNotButton();
-	
+
+	/**
+	 * 用户权限菜单
+	 * @param userId
+	 * @return
+	 */
 	List<String> listUserPerms(Long userId);
-	
+
+	/**
+	 * 菜单子节点个数
+	 * @param parentId
+	 * @return
+	 */
 	int countMenuChildren(Long parentId);
 
 }

+ 14 - 0
src/main/java/net/chenlin/dp/modules/sys/dao/SysOrgMapper.java

@@ -3,6 +3,8 @@ package net.chenlin.dp.modules.sys.dao;
 import org.apache.ibatis.annotations.Mapper;
 import net.chenlin.dp.modules.sys.entity.SysOrgEntity;
 
+import java.util.List;
+
 /**
  * 组织架构
  *
@@ -14,6 +16,18 @@ import net.chenlin.dp.modules.sys.entity.SysOrgEntity;
 @Mapper
 public interface SysOrgMapper extends BaseMapper<SysOrgEntity> {
 
+	/**
+	 * 统计子机构数量
+	 * @param parentId
+	 * @return
+	 */
 	int countOrgChildren(Long parentId);
+
+	/**
+	 * 查询子机构集合
+	 * @param parentId
+	 * @return
+	 */
+	List<Long> listOrgChildren(Long parentId);
 	
 }

+ 7 - 6
src/main/java/net/chenlin/dp/modules/sys/dao/SysRoleMapper.java

@@ -8,15 +8,16 @@ import net.chenlin.dp.modules.sys.entity.SysRoleEntity;
 
 /**
  * 系统角色
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017812日 上午12:35:51
+ * @author zcl<yczclcn@163.com>
  */
 @Mapper
 public interface SysRoleMapper extends BaseMapper<SysRoleEntity> {
-	
+
+	/**
+	 * 查询用户角色集合
+	 * @param userId
+	 * @return
+	 */
 	List<String> listUserRoles(Long userId);
 	
 }

+ 18 - 7
src/main/java/net/chenlin/dp/modules/sys/dao/SysRoleMenuMapper.java

@@ -8,19 +8,30 @@ import net.chenlin.dp.modules.sys.entity.SysRoleMenuEntity;
 
 /**
  * 系统角色与菜单关系
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017813日 下午8:32:26
+ * @author zcl<yczclcn@163.com>
  */
 @Mapper
 public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenuEntity> {
 
+	/**
+	 * 根据菜单id批量删除
+	 * @param id
+	 * @return
+	 */
 	int batchRemoveByMenuId(Long[] id);
-	
+
+	/**
+	 * 根据角色id批量删除
+	 * @param id
+	 * @return
+	 */
 	int batchRemoveByRoleId(Long[] id);
-	
+
+	/**
+	 * 查询角色所有菜单id集合
+	 * @param id
+	 * @return
+	 */
 	List<Long> listMenuId(Long id);
 	
 }

+ 18 - 7
src/main/java/net/chenlin/dp/modules/sys/dao/SysRoleOrgMapper.java

@@ -7,19 +7,30 @@ import net.chenlin.dp.modules.sys.entity.SysRoleOrgEntity;
 
 /**
  * 角色与机构的关系
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017817日 上午11:29:43
+ * @author zcl<yczclcn@163.com>
  */
 @Mapper
 public interface SysRoleOrgMapper extends BaseMapper<SysRoleOrgEntity> {
 
+	/**
+	 * 查询角色所有机构id集合
+	 * @param roleId
+	 * @return
+	 */
 	List<Long> listOrgId(Long roleId);
-	
+
+	/**
+	 * 根据机构id删除
+	 * @param id
+	 * @return
+	 */
 	int batchRemoveByOrgId(Long[] id);
-	
+
+	/**
+	 * 根据角色id删除
+	 * @param id
+	 * @return
+	 */
 	int batchRemoveByRoleId(Long[] id);
 	
 }

+ 36 - 10
src/main/java/net/chenlin/dp/modules/sys/dao/SysUserMapper.java

@@ -9,25 +9,51 @@ import net.chenlin.dp.modules.sys.entity.SysUserEntity;
 
 /**
  * 系统用户dao
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201788日 下午3:26:05
+ * @author zcl<yczclcn@163.com>
  */
 @Mapper
 public interface SysUserMapper extends BaseMapper<SysUserEntity> {
 
+	/**
+	 * 根据用户名查询
+	 * @param username
+	 * @return
+	 */
 	SysUserEntity getByUserName(String username);
-	
+
+	/**
+	 * 查询用户所有菜单id
+	 * @param userId
+	 * @return
+	 */
 	List<Long> listAllMenuId(Long userId);
-	
+
+	/**
+	 * 查询用户所有机构id
+	 * @param userId
+	 * @return
+	 */
 	List<Long> listAllOrgId(Long userId);
-	
+
+	/**
+	 * 用户修改密码
+	 * @param query
+	 * @return
+	 */
 	int updatePswdByUser(Query query);
-	
+
+	/**
+	 * 更新用户状态
+	 * @param query
+	 * @return
+	 */
 	int updateUserStatus(Query query);
-	
+
+	/**
+	 * 修改密码
+	 * @param user
+	 * @return
+	 */
 	int updatePswd(SysUserEntity user);
 	
 }

+ 18 - 7
src/main/java/net/chenlin/dp/modules/sys/dao/SysUserRoleMapper.java

@@ -8,19 +8,30 @@ import net.chenlin.dp.modules.sys.entity.SysUserRoleEntity;
 
 /**
  * 用户与角色关系
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017813日 上午1:01:55
+ * @author zcl<yczclcn@163.com>
  */
 @Mapper
 public interface SysUserRoleMapper extends BaseMapper<SysUserRoleEntity> {
 
+	/**
+	 * 查询用户所有角色id
+	 * @param userId
+	 * @return
+	 */
 	List<Long> listUserRoleId(Long userId);
-	
+
+	/**
+	 * 根据用户id删除
+	 * @param id
+	 * @return
+	 */
 	int batchRemoveByUserId(Long[] id);
-	
+
+	/**
+	 * 根据角色id删除
+	 * @param id
+	 * @return
+	 */
 	int batchRemoveByRoleId(Long[] id);
 	
 }

+ 12 - 6
src/main/java/net/chenlin/dp/modules/sys/dao/SysUserTokenMapper.java

@@ -6,17 +6,23 @@ import net.chenlin.dp.modules.sys.entity.SysUserTokenEntity;
 
 /**
  * 用户token
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 201793日 上午3:29:17
+ * @author zcl<yczclcn@163.com>
  */
 @Mapper
 public interface SysUserTokenMapper extends BaseMapper<SysUserTokenEntity> {
 
+	/**
+	 * 根据token查询
+	 * @param token
+	 * @return
+	 */
 	SysUserTokenEntity getByToken(String token);
-	
+
+	/**
+	 * 根据用户id查询
+	 * @param userId
+	 * @return
+	 */
 	SysUserTokenEntity getByUserId(Long userId);
 	
 }

+ 125 - 125
src/main/java/net/chenlin/dp/modules/generator/entity/ColumnEntity.java → src/main/java/net/chenlin/dp/modules/sys/entity/ColumnEntity.java

@@ -1,125 +1,125 @@
-package net.chenlin.dp.modules.generator.entity;
-
-import java.io.Serializable;
-
-/**
- * 数据表列属性
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017828日 下午8:04:40
- */
-public class ColumnEntity implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 列名
-	 */
-	private String columnName;
-	
-	/**
-	 * 数据类型
-	 */
-	private String dataType;
-	
-	/**
-	 * 列注释
-	 */
-	private String columnComment;
-	
-	/**
-	 * 属性名,作为类属性名(userId)
-	 */
-	private String fieldName;
-	
-	/**
-	 * 属性名,作为类方法名(UserId)
-	 */
-	private String methodName;
-	
-	/**
-	 * 列数据类型对应java数据类型
-	 */
-	private String fieldType;
-	
-	/**
-	 * 键类型标识
-	 */
-	private String columnKey;
-	
-	/**
-	 * 自增标识 auto_increment
-	 */
-	private String extra;
-
-	public ColumnEntity() {
-		super();
-	}
-
-	public String getColumnName() {
-		return columnName;
-	}
-
-	public void setColumnName(String columnName) {
-		this.columnName = columnName;
-	}
-
-	public String getDataType() {
-		return dataType;
-	}
-
-	public void setDataType(String dataType) {
-		this.dataType = dataType;
-	}
-
-	public String getColumnComment() {
-		return columnComment;
-	}
-
-	public void setColumnComment(String columnComment) {
-		this.columnComment = columnComment;
-	}
-
-	public String getFieldName() {
-		return fieldName;
-	}
-
-	public void setFieldName(String fieldName) {
-		this.fieldName = fieldName;
-	}
-
-	public String getMethodName() {
-		return methodName;
-	}
-
-	public void setMethodName(String methodName) {
-		this.methodName = methodName;
-	}
-
-	public String getFieldType() {
-		return fieldType;
-	}
-
-	public void setFieldType(String fieldType) {
-		this.fieldType = fieldType;
-	}
-
-	public String getExtra() {
-		return extra;
-	}
-
-	public void setExtra(String extra) {
-		this.extra = extra;
-	}
-
-	public String getColumnKey() {
-		return columnKey;
-	}
-
-	public void setColumnKey(String columnKey) {
-		this.columnKey = columnKey;
-	}
-	
-}
+package net.chenlin.dp.modules.sys.entity;
+
+import java.io.Serializable;
+
+/**
+ * 数据表列属性
+ *
+ * @author ZhouChenglin
+ * @email yczclcn@163.com
+ * @url www.chenlintech.com
+ * @date 2017828日 下午8:04:40
+ */
+public class ColumnEntity implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 列名
+	 */
+	private String columnName;
+	
+	/**
+	 * 数据类型
+	 */
+	private String dataType;
+	
+	/**
+	 * 列注释
+	 */
+	private String columnComment;
+	
+	/**
+	 * 属性名,作为类属性名(userId)
+	 */
+	private String fieldName;
+	
+	/**
+	 * 属性名,作为类方法名(UserId)
+	 */
+	private String methodName;
+	
+	/**
+	 * 列数据类型对应java数据类型
+	 */
+	private String fieldType;
+	
+	/**
+	 * 键类型标识
+	 */
+	private String columnKey;
+	
+	/**
+	 * 自增标识 auto_increment
+	 */
+	private String extra;
+
+	public ColumnEntity() {
+		super();
+	}
+
+	public String getColumnName() {
+		return columnName;
+	}
+
+	public void setColumnName(String columnName) {
+		this.columnName = columnName;
+	}
+
+	public String getDataType() {
+		return dataType;
+	}
+
+	public void setDataType(String dataType) {
+		this.dataType = dataType;
+	}
+
+	public String getColumnComment() {
+		return columnComment;
+	}
+
+	public void setColumnComment(String columnComment) {
+		this.columnComment = columnComment;
+	}
+
+	public String getFieldName() {
+		return fieldName;
+	}
+
+	public void setFieldName(String fieldName) {
+		this.fieldName = fieldName;
+	}
+
+	public String getMethodName() {
+		return methodName;
+	}
+
+	public void setMethodName(String methodName) {
+		this.methodName = methodName;
+	}
+
+	public String getFieldType() {
+		return fieldType;
+	}
+
+	public void setFieldType(String fieldType) {
+		this.fieldType = fieldType;
+	}
+
+	public String getExtra() {
+		return extra;
+	}
+
+	public void setExtra(String extra) {
+		this.extra = extra;
+	}
+
+	public String getColumnKey() {
+		return columnKey;
+	}
+
+	public void setColumnKey(String columnKey) {
+		this.columnKey = columnKey;
+	}
+	
+}

+ 92 - 92
src/main/java/net/chenlin/dp/modules/generator/entity/GeneratorParamEntity.java → src/main/java/net/chenlin/dp/modules/sys/entity/GeneratorParamEntity.java

@@ -1,92 +1,92 @@
-package net.chenlin.dp.modules.generator.entity;
-
-/**
- * 代码生成器请求参数
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017829日 上午11:29:00
- */
-public class GeneratorParamEntity {
-
-	private String[] tables;
-	
-	/**
-	 * 系统模块,用户管理 shiro
-	 */
-	private String module;
-	
-	/**
-	 * 功能编码,用户管理 user
-	 */
-	private String functionCode;
-	
-	/**
-	 * 后台请求地址,用户管理 sys/user
-	 */
-	private String requestMapping;
-	
-	/**
-	 * 页面路径,用户管理 base/user
-	 */
-	private String viewPath;
-	
-	/**
-	 * 生成类型,1:生成包结构,2:只生成源代码
-	 */
-	private String type;
-
-	public GeneratorParamEntity() {
-		super();
-	}
-
-	public String[] getTables() {
-		return tables;
-	}
-
-	public void setTables(String[] tables) {
-		this.tables = tables;
-	}
-
-	public String getModule() {
-		return module;
-	}
-
-	public void setModule(String module) {
-		this.module = module;
-	}
-
-	public String getFunctionCode() {
-		return functionCode;
-	}
-
-	public void setFunctionCode(String functionCode) {
-		this.functionCode = functionCode;
-	}
-
-	public String getRequestMapping() {
-		return requestMapping;
-	}
-
-	public void setRequestMapping(String requestMapping) {
-		this.requestMapping = requestMapping;
-	}
-
-	public String getViewPath() {
-		return viewPath;
-	}
-
-	public void setViewPath(String viewPath) {
-		this.viewPath = viewPath;
-	}
-
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-	
-}
+package net.chenlin.dp.modules.sys.entity;
+
+/**
+ * 代码生成器请求参数
+ *
+ * @author ZhouChenglin
+ * @email yczclcn@163.com
+ * @url www.chenlintech.com
+ * @date 2017829日 上午11:29:00
+ */
+public class GeneratorParamEntity {
+
+	private String[] tables;
+	
+	/**
+	 * 系统模块,用户管理 shiro
+	 */
+	private String module;
+	
+	/**
+	 * 功能编码,用户管理 user
+	 */
+	private String functionCode;
+	
+	/**
+	 * 后台请求地址,用户管理 sys/user
+	 */
+	private String requestMapping;
+	
+	/**
+	 * 页面路径,用户管理 base/user
+	 */
+	private String viewPath;
+	
+	/**
+	 * 生成类型,1:生成包结构,2:只生成源代码
+	 */
+	private String type;
+
+	public GeneratorParamEntity() {
+		super();
+	}
+
+	public String[] getTables() {
+		return tables;
+	}
+
+	public void setTables(String[] tables) {
+		this.tables = tables;
+	}
+
+	public String getModule() {
+		return module;
+	}
+
+	public void setModule(String module) {
+		this.module = module;
+	}
+
+	public String getFunctionCode() {
+		return functionCode;
+	}
+
+	public void setFunctionCode(String functionCode) {
+		this.functionCode = functionCode;
+	}
+
+	public String getRequestMapping() {
+		return requestMapping;
+	}
+
+	public void setRequestMapping(String requestMapping) {
+		this.requestMapping = requestMapping;
+	}
+
+	public String getViewPath() {
+		return viewPath;
+	}
+
+	public void setViewPath(String viewPath) {
+		this.viewPath = viewPath;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+	
+}

+ 144 - 144
src/main/java/net/chenlin/dp/modules/quartz/entity/QuartzJobEntity.java → src/main/java/net/chenlin/dp/modules/sys/entity/QuartzJobEntity.java

@@ -1,144 +1,144 @@
-package net.chenlin.dp.modules.quartz.entity;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-/**
- * 定时任务
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午10:33:21
- */
-public class QuartzJobEntity implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-	
-	/**
-	 * 任务调度参数key
-	 */
-    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
-	
-	/**
-	 * 任务id
-	 */
-	private Long jobId;
-	
-	/**
-	 * spring bean 名称
-	 */
-	private String beanName;
-	
-	/**
-	 * 方法名
-	 */
-	private String methodName;
-	
-	/**
-	 * 参数
-	 */
-	private String params;
-	
-	/**
-	 * cron表达式
-	 */
-	private String cronExpression;
-	
-	/**
-	 * 状态,0:暂停,1:正常
-	 */
-	private Integer status;
-	
-	/**
-	 * 备注
-	 */
-	private String remark;
-	
-	/**
-	 * 创建时间
-	 */
-	private Timestamp gmtCreate;
-	
-	/**
-	 * 修改时间
-	 */
-	private Timestamp gmtModified;
-
-	public QuartzJobEntity() {
-		super();
-	}
-
-	public Long getJobId() {
-		return jobId;
-	}
-
-	public void setJobId(Long jobId) {
-		this.jobId = jobId;
-	}
-
-	public String getBeanName() {
-		return beanName;
-	}
-
-	public void setBeanName(String beanName) {
-		this.beanName = beanName;
-	}
-
-	public String getMethodName() {
-		return methodName;
-	}
-
-	public void setMethodName(String methodName) {
-		this.methodName = methodName;
-	}
-
-	public String getParams() {
-		return params;
-	}
-
-	public void setParams(String params) {
-		this.params = params;
-	}
-
-	public String getCronExpression() {
-		return cronExpression;
-	}
-
-	public void setCronExpression(String cronExpression) {
-		this.cronExpression = cronExpression;
-	}
-
-	public Integer getStatus() {
-		return status;
-	}
-
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Timestamp getGmtCreate() {
-		return gmtCreate;
-	}
-
-	public void setGmtCreate(Timestamp gmtCreate) {
-		this.gmtCreate = gmtCreate;
-	}
-
-	public Timestamp getGmtModified() {
-		return gmtModified;
-	}
-
-	public void setGmtModified(Timestamp gmtModified) {
-		this.gmtModified = gmtModified;
-	}
-
-}
+package net.chenlin.dp.modules.sys.entity;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 定时任务
+ *
+ * @author ZhouChenglin
+ * @email yczclcn@163.com
+ * @url www.chenlintech.com
+ * @date 2017820日 下午10:33:21
+ */
+public class QuartzJobEntity implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+	
+	/**
+	 * 任务调度参数key
+	 */
+    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
+	
+	/**
+	 * 任务id
+	 */
+	private Long jobId;
+	
+	/**
+	 * spring bean 名称
+	 */
+	private String beanName;
+	
+	/**
+	 * 方法名
+	 */
+	private String methodName;
+	
+	/**
+	 * 参数
+	 */
+	private String params;
+	
+	/**
+	 * cron表达式
+	 */
+	private String cronExpression;
+	
+	/**
+	 * 状态,0:暂停,1:正常
+	 */
+	private Integer status;
+	
+	/**
+	 * 备注
+	 */
+	private String remark;
+	
+	/**
+	 * 创建时间
+	 */
+	private Timestamp gmtCreate;
+	
+	/**
+	 * 修改时间
+	 */
+	private Timestamp gmtModified;
+
+	public QuartzJobEntity() {
+		super();
+	}
+
+	public Long getJobId() {
+		return jobId;
+	}
+
+	public void setJobId(Long jobId) {
+		this.jobId = jobId;
+	}
+
+	public String getBeanName() {
+		return beanName;
+	}
+
+	public void setBeanName(String beanName) {
+		this.beanName = beanName;
+	}
+
+	public String getMethodName() {
+		return methodName;
+	}
+
+	public void setMethodName(String methodName) {
+		this.methodName = methodName;
+	}
+
+	public String getParams() {
+		return params;
+	}
+
+	public void setParams(String params) {
+		this.params = params;
+	}
+
+	public String getCronExpression() {
+		return cronExpression;
+	}
+
+	public void setCronExpression(String cronExpression) {
+		this.cronExpression = cronExpression;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Timestamp getGmtCreate() {
+		return gmtCreate;
+	}
+
+	public void setGmtCreate(Timestamp gmtCreate) {
+		this.gmtCreate = gmtCreate;
+	}
+
+	public Timestamp getGmtModified() {
+		return gmtModified;
+	}
+
+	public void setGmtModified(Timestamp gmtModified) {
+		this.gmtModified = gmtModified;
+	}
+
+}

+ 139 - 139
src/main/java/net/chenlin/dp/modules/quartz/entity/QuartzJobLogEntity.java → src/main/java/net/chenlin/dp/modules/sys/entity/QuartzJobLogEntity.java

@@ -1,139 +1,139 @@
-package net.chenlin.dp.modules.quartz.entity;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-/**
- * 定时任务日志
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017820日 下午10:34:33
- */
-public class QuartzJobLogEntity implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-	
-	/**
-	 * 记录id
-	 */
-	private Long logId;
-	
-	/**
-	 * 任务id
-	 */
-	private Long jobId;
-	
-	/**
-	 * spring bean 名称
-	 */
-	private String beanName;
-	
-	/**
-	 * 方法名
-	 */
-	private String methodName;
-	
-	/**
-	 * 参数
-	 */
-	private String params;
-	
-	/**
-	 * 状态,0:失败,1:成功
-	 */
-	private Integer status;
-	
-	/**
-	 * 错误信息
-	 */
-	private String error;
-	
-	/**
-	 * 耗时(ms)
-	 */
-	private Integer times;
-	
-	/**
-	 * 创建时间
-	 */
-	private Timestamp gmtCreate;
-
-	public QuartzJobLogEntity() {
-		super();
-	}
-
-	public Long getLogId() {
-		return logId;
-	}
-
-	public void setLogId(Long logId) {
-		this.logId = logId;
-	}
-
-	public Long getJobId() {
-		return jobId;
-	}
-
-	public void setJobId(Long jobId) {
-		this.jobId = jobId;
-	}
-
-	public String getBeanName() {
-		return beanName;
-	}
-
-	public void setBeanName(String beanName) {
-		this.beanName = beanName;
-	}
-
-	public String getMethodName() {
-		return methodName;
-	}
-
-	public void setMethodName(String methodName) {
-		this.methodName = methodName;
-	}
-
-	public String getParams() {
-		return params;
-	}
-
-	public void setParams(String params) {
-		this.params = params;
-	}
-
-	public Integer getStatus() {
-		return status;
-	}
-
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	public String getError() {
-		return error;
-	}
-
-	public void setError(String error) {
-		this.error = error;
-	}
-
-	public Integer getTimes() {
-		return times;
-	}
-
-	public void setTimes(Integer times) {
-		this.times = times;
-	}
-
-	public Timestamp getGmtCreate() {
-		return gmtCreate;
-	}
-
-	public void setGmtCreate(Timestamp gmtCreate) {
-		this.gmtCreate = gmtCreate;
-	}
-
-}
+package net.chenlin.dp.modules.sys.entity;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 定时任务日志
+ *
+ * @author ZhouChenglin
+ * @email yczclcn@163.com
+ * @url www.chenlintech.com
+ * @date 2017820日 下午10:34:33
+ */
+public class QuartzJobLogEntity implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+	
+	/**
+	 * 记录id
+	 */
+	private Long logId;
+	
+	/**
+	 * 任务id
+	 */
+	private Long jobId;
+	
+	/**
+	 * spring bean 名称
+	 */
+	private String beanName;
+	
+	/**
+	 * 方法名
+	 */
+	private String methodName;
+	
+	/**
+	 * 参数
+	 */
+	private String params;
+	
+	/**
+	 * 状态,0:失败,1:成功
+	 */
+	private Integer status;
+	
+	/**
+	 * 错误信息
+	 */
+	private String error;
+	
+	/**
+	 * 耗时(ms)
+	 */
+	private Integer times;
+	
+	/**
+	 * 创建时间
+	 */
+	private Timestamp gmtCreate;
+
+	public QuartzJobLogEntity() {
+		super();
+	}
+
+	public Long getLogId() {
+		return logId;
+	}
+
+	public void setLogId(Long logId) {
+		this.logId = logId;
+	}
+
+	public Long getJobId() {
+		return jobId;
+	}
+
+	public void setJobId(Long jobId) {
+		this.jobId = jobId;
+	}
+
+	public String getBeanName() {
+		return beanName;
+	}
+
+	public void setBeanName(String beanName) {
+		this.beanName = beanName;
+	}
+
+	public String getMethodName() {
+		return methodName;
+	}
+
+	public void setMethodName(String methodName) {
+		this.methodName = methodName;
+	}
+
+	public String getParams() {
+		return params;
+	}
+
+	public void setParams(String params) {
+		this.params = params;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getError() {
+		return error;
+	}
+
+	public void setError(String error) {
+		this.error = error;
+	}
+
+	public Integer getTimes() {
+		return times;
+	}
+
+	public void setTimes(Integer times) {
+		this.times = times;
+	}
+
+	public Timestamp getGmtCreate() {
+		return gmtCreate;
+	}
+
+	public void setGmtCreate(Timestamp gmtCreate) {
+		this.gmtCreate = gmtCreate;
+	}
+
+}

+ 225 - 225
src/main/java/net/chenlin/dp/modules/base/entity/SysAreaEntity.java → src/main/java/net/chenlin/dp/modules/sys/entity/SysAreaEntity.java

@@ -1,225 +1,225 @@
-package net.chenlin.dp.modules.base.entity;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-import java.util.List;
-
-import net.chenlin.dp.common.utils.CommonUtils;
-
-/**
- * 行政区域
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017818日 下午1:20:48
- */
-public class SysAreaEntity implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 区域id
-	 */
-	private Long areaId;
-	
-	/**
-	 * 区域代码
-	 */
-	private String areaCode;
-	
-	/**
-	 * 父级代码,省级为0
-	 */
-	private String parentCode;
-	
-	/**
-	 * 父级名称
-	 */
-	private String parentName;
-	
-	/**
-	 * 区域名称
-	 */
-	private String name;
-	
-	/**
-	 * 层级,1:省级,2:地市,3:区县
-	 */
-	private Integer layer;
-	
-	/**
-	 * 排序
-	 */
-	private Integer orderNum;
-	
-	/**
-	 * 状态,1:显示,0:隐藏
-	 */
-	private Integer status;
-	
-	/**
-	 * 备注
-	 */
-	private String remark;
-	
-	/**
-	 * 创建时间
-	 */
-	private Timestamp gmtCreate;
-	
-	/**
-	 * 修改时间
-	 */
-	private Timestamp gmtModified;
-	
-	/**
-	 * ztree属性
-	 */
-	private Boolean open;
-	
-	private Boolean isParent;
-	
-	private Integer size;
-	
-	private List<?> list;
-
-	public SysAreaEntity() {
-		super();
-	}
-
-	public Long getAreaId() {
-		return areaId;
-	}
-
-	public void setAreaId(Long areaId) {
-		this.areaId = areaId;
-	}
-
-	public String getAreaCode() {
-		return areaCode;
-	}
-
-	public void setAreaCode(String areaCode) {
-		this.areaCode = areaCode;
-	}
-
-	public String getParentCode() {
-		return parentCode;
-	}
-
-	public void setParentCode(String parentCode) {
-		this.parentCode = parentCode;
-	}
-
-	public String getParentName() {
-		return parentName;
-	}
-
-	public void setParentName(String parentName) {
-		this.parentName = parentName;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public Integer getLayer() {
-		return layer;
-	}
-
-	public void setLayer(Integer layer) {
-		this.layer = layer;
-	}
-
-	public Integer getOrderNum() {
-		return orderNum;
-	}
-
-	public void setOrderNum(Integer orderNum) {
-		this.orderNum = orderNum;
-	}
-
-	public Integer getStatus() {
-		return status;
-	}
-
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Timestamp getGmtCreate() {
-		return gmtCreate;
-	}
-
-	public void setGmtCreate(Timestamp gmtCreate) {
-		this.gmtCreate = gmtCreate;
-	}
-
-	public Timestamp getGmtModified() {
-		return gmtModified;
-	}
-
-	public void setGmtModified(Timestamp gmtModified) {
-		this.gmtModified = gmtModified;
-	}
-
-	public Boolean getOpen() {
-		return open;
-	}
-
-	public void setOpen(Boolean open) {
-		this.open = open;
-	}
-
-	public Boolean getIsParent() {
-		return isParent;
-	}
-
-	public void setIsParent(Boolean isParent) {
-		this.isParent = isParent;
-	}
-
-	public Integer getSize() {
-		return size;
-	}
-
-	public void setSize(Integer size) {
-		this.size = size;
-	}
-
-	public List<?> getList() {
-		return list;
-	}
-
-	public void setList(List<?> list) {
-		this.list = list;
-	}
-	
-	public void checkParent() {
-		if(CommonUtils.isIntThanZero(this.size)) {
-			this.isParent = true;
-		} else {
-			this.isParent = false;
-		}
-	}
-	
-	public void checkParentName() {
-		if(this.parentCode.equals("0")) {
-			this.parentName = "省级区域";
-		}
-	}
-	
-}
+package net.chenlin.dp.modules.sys.entity;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.util.List;
+
+import net.chenlin.dp.common.utils.CommonUtils;
+
+/**
+ * 行政区域
+ *
+ * @author ZhouChenglin
+ * @email yczclcn@163.com
+ * @url www.chenlintech.com
+ * @date 2017818日 下午1:20:48
+ */
+public class SysAreaEntity implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 区域id
+	 */
+	private Long areaId;
+	
+	/**
+	 * 区域代码
+	 */
+	private String areaCode;
+	
+	/**
+	 * 父级代码,省级为0
+	 */
+	private String parentCode;
+	
+	/**
+	 * 父级名称
+	 */
+	private String parentName;
+	
+	/**
+	 * 区域名称
+	 */
+	private String name;
+	
+	/**
+	 * 层级,1:省级,2:地市,3:区县
+	 */
+	private Integer layer;
+	
+	/**
+	 * 排序
+	 */
+	private Integer orderNum;
+	
+	/**
+	 * 状态,1:显示,0:隐藏
+	 */
+	private Integer status;
+	
+	/**
+	 * 备注
+	 */
+	private String remark;
+	
+	/**
+	 * 创建时间
+	 */
+	private Timestamp gmtCreate;
+	
+	/**
+	 * 修改时间
+	 */
+	private Timestamp gmtModified;
+	
+	/**
+	 * ztree属性
+	 */
+	private Boolean open;
+	
+	private Boolean isParent;
+	
+	private Integer size;
+	
+	private List<?> list;
+
+	public SysAreaEntity() {
+		super();
+	}
+
+	public Long getAreaId() {
+		return areaId;
+	}
+
+	public void setAreaId(Long areaId) {
+		this.areaId = areaId;
+	}
+
+	public String getAreaCode() {
+		return areaCode;
+	}
+
+	public void setAreaCode(String areaCode) {
+		this.areaCode = areaCode;
+	}
+
+	public String getParentCode() {
+		return parentCode;
+	}
+
+	public void setParentCode(String parentCode) {
+		this.parentCode = parentCode;
+	}
+
+	public String getParentName() {
+		return parentName;
+	}
+
+	public void setParentName(String parentName) {
+		this.parentName = parentName;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getLayer() {
+		return layer;
+	}
+
+	public void setLayer(Integer layer) {
+		this.layer = layer;
+	}
+
+	public Integer getOrderNum() {
+		return orderNum;
+	}
+
+	public void setOrderNum(Integer orderNum) {
+		this.orderNum = orderNum;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Timestamp getGmtCreate() {
+		return gmtCreate;
+	}
+
+	public void setGmtCreate(Timestamp gmtCreate) {
+		this.gmtCreate = gmtCreate;
+	}
+
+	public Timestamp getGmtModified() {
+		return gmtModified;
+	}
+
+	public void setGmtModified(Timestamp gmtModified) {
+		this.gmtModified = gmtModified;
+	}
+
+	public Boolean getOpen() {
+		return open;
+	}
+
+	public void setOpen(Boolean open) {
+		this.open = open;
+	}
+
+	public Boolean getIsParent() {
+		return isParent;
+	}
+
+	public void setIsParent(Boolean isParent) {
+		this.isParent = isParent;
+	}
+
+	public Integer getSize() {
+		return size;
+	}
+
+	public void setSize(Integer size) {
+		this.size = size;
+	}
+
+	public List<?> getList() {
+		return list;
+	}
+
+	public void setList(List<?> list) {
+		this.list = list;
+	}
+	
+	public void checkParent() {
+		if(CommonUtils.isIntThanZero(this.size)) {
+			this.isParent = true;
+		} else {
+			this.isParent = false;
+		}
+	}
+	
+	public void checkParentName() {
+		if(this.parentCode.equals("0")) {
+			this.parentName = "省级区域";
+		}
+	}
+	
+}

+ 189 - 189
src/main/java/net/chenlin/dp/modules/base/entity/SysMacroEntity.java → src/main/java/net/chenlin/dp/modules/sys/entity/SysMacroEntity.java

@@ -1,189 +1,189 @@
-package net.chenlin.dp.modules.base.entity;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-import java.util.List;
-
-/**
- * 通用字典
- *
- * @author ZhouChenglin
- * @email yczclcn@163.com
- * @url www.chenlintech.com
- * @date 2017815日 下午12:34:37
- */
-public class SysMacroEntity implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 字典id
-	 */
-	private Long macroId;
-	
-	/**
-	 * 类型id
-	 */
-	private Long typeId;
-	
-	/**
-	 * 类型名称
-	 */
-	private String typeName;
-	
-	/**
-	 * 字典码
-	 */
-	private String name;
-	
-	/**
-	 * 字典值
-	 */
-	private String value;
-	
-	/**
-	 * 状态(1:显示, 0:隐藏)
-	 */
-	private Integer status;
-	
-	/**
-	 * 类型(1:参数, 0:目录)
-	 */
-	private Integer type;
-	
-	/**
-	 * 排序
-	 */
-	private Integer orderNum;
-	
-	/**
-	 * 备注
-	 */
-	private String remark;
-	
-	/**
-	 * 创建时间
-	 */
-	private Timestamp gmtCreate;
-	
-	/**
-	 * 修改时间
-	 */
-	private Timestamp gmtModified;
-	
-	/**
-	 * ztree属性
-	 */
-	private Boolean open;
-	
-	private List<?> list;
-
-	public SysMacroEntity() {
-		super();
-	}
-
-	public Long getMacroId() {
-		return macroId;
-	}
-
-	public void setMacroId(Long macroId) {
-		this.macroId = macroId;
-	}
-
-	public Long getTypeId() {
-		return typeId;
-	}
-
-	public void setTypeId(Long typeId) {
-		this.typeId = typeId;
-	}
-
-	public String getTypeName() {
-		return typeName;
-	}
-
-	public void setTypeName(String typeName) {
-		this.typeName = typeName;
-	}
-
-	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;
-	}
-
-	public Integer getStatus() {
-		return status;
-	}
-
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	public Integer getType() {
-		return type;
-	}
-
-	public void setType(Integer type) {
-		this.type = type;
-	}
-
-	public Integer getOrderNum() {
-		return orderNum;
-	}
-
-	public void setOrderNum(Integer orderNum) {
-		this.orderNum = orderNum;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Timestamp getGmtCreate() {
-		return gmtCreate;
-	}
-
-	public void setGmtCreate(Timestamp gmtCreate) {
-		this.gmtCreate = gmtCreate;
-	}
-
-	public Timestamp getGmtModified() {
-		return gmtModified;
-	}
-
-	public void setGmtModified(Timestamp gmtModified) {
-		this.gmtModified = gmtModified;
-	}
-
-	public Boolean getOpen() {
-		return open;
-	}
-
-	public void setOpen(Boolean open) {
-		this.open = open;
-	}
-
-	public List<?> getList() {
-		return list;
-	}
-
-	public void setList(List<?> list) {
-		this.list = list;
-	}
-
-}
+package net.chenlin.dp.modules.sys.entity;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.util.List;
+
+/**
+ * 通用字典
+ *
+ * @author ZhouChenglin
+ * @email yczclcn@163.com
+ * @url www.chenlintech.com
+ * @date 2017815日 下午12:34:37
+ */
+public class SysMacroEntity implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 字典id
+	 */
+	private Long macroId;
+	
+	/**
+	 * 类型id
+	 */
+	private Long typeId;
+	
+	/**
+	 * 类型名称
+	 */
+	private String typeName;
+	
+	/**
+	 * 字典码
+	 */
+	private String name;
+	
+	/**
+	 * 字典值
+	 */
+	private String value;
+	
+	/**
+	 * 状态(1:显示, 0:隐藏)
+	 */
+	private Integer status;
+	
+	/**
+	 * 类型(1:参数, 0:目录)
+	 */
+	private Integer type;
+	
+	/**
+	 * 排序
+	 */
+	private Integer orderNum;
+	
+	/**
+	 * 备注
+	 */
+	private String remark;
+	
+	/**
+	 * 创建时间
+	 */
+	private Timestamp gmtCreate;
+	
+	/**
+	 * 修改时间
+	 */
+	private Timestamp gmtModified;
+	
+	/**
+	 * ztree属性
+	 */
+	private Boolean open;
+	
+	private List<?> list;
+
+	public SysMacroEntity() {
+		super();
+	}
+
+	public Long getMacroId() {
+		return macroId;
+	}
+
+	public void setMacroId(Long macroId) {
+		this.macroId = macroId;
+	}
+
+	public Long getTypeId() {
+		return typeId;
+	}
+
+	public void setTypeId(Long typeId) {
+		this.typeId = typeId;
+	}
+
+	public String getTypeName() {
+		return typeName;
+	}
+
+	public void setTypeName(String typeName) {
+		this.typeName = typeName;
+	}
+
+	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;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public Integer getOrderNum() {
+		return orderNum;
+	}
+
+	public void setOrderNum(Integer orderNum) {
+		this.orderNum = orderNum;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Timestamp getGmtCreate() {
+		return gmtCreate;
+	}
+
+	public void setGmtCreate(Timestamp gmtCreate) {
+		this.gmtCreate = gmtCreate;
+	}
+
+	public Timestamp getGmtModified() {
+		return gmtModified;
+	}
+
+	public void setGmtModified(Timestamp gmtModified) {
+		this.gmtModified = gmtModified;
+	}
+
+	public Boolean getOpen() {
+		return open;
+	}
+
+	public void setOpen(Boolean open) {
+		this.open = open;
+	}
+
+	public List<?> getList() {
+		return list;
+	}
+
+	public void setList(List<?> list) {
+		this.list = list;
+	}
+
+}

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