diff --git a/README.md b/README.md index 28a4b2d419..e45280c949 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ JeeSite是基于多个优秀的开源项目,高度整合封装而成的高效,高性能,强安全性的**开源**Java EE快速开发平台。 -JeeSite本身是以Spring Framework为核心容器,Spring MVC为模型视图控制器,MyBatis为数据访问层, -Apache Shiro为权限授权层,Ehcahe对常用数据进行缓存,Activit为工作流引擎。 +JeeSite是您快速完成项目的最佳基础平台解决方案,JeeSite是您想学习Java平台的最佳学习案例,JeeSite还是接私活的最佳助手。 + +JeeSite是在Spring Framework基础上搭建的一个Java基础开发平台,以Spring MVC为模型视图控制器,MyBatis为数据访问层, +Apache Shiro为权限授权层,Ehcahe对常用数据进行缓存,Activit为工作流引擎。是JavaEE界的最佳整合。 JeeSite主要定位于企业信息化领域,已内置企业信息化系统的基础功能和高效的**代码生成**工具, 包括:系统权限组件、数据权限组件、数据字典组件、核心工具组件、视图操作组件、工作流组件、代码生成等。 @@ -13,10 +15,10 @@ JeeSite主要定位于企业信息化领域,已内置企业信息化系统的 采用分层设计、双重验证、提交数据安全编码、密码加密、访问验证、数据权限验证。 使用Maven做项目管理,提高项目的易开发性、扩展性。 -JeeSite目前包括以下三大模块,系统管理(SYS)模块、 +JeeSite目前包括以下四大模块,系统管理(SYS)模块、 内容管理(CMS)模块、在线办公(OA)模块、代码生成(GEN)模块。 **系统管理模块** ,包括企业组织架构(用户管理、机构管理、区域管理)、 菜单管理、角色权限管理、字典管理等功能; **内容管理模块** ,包括内容管理(文章、链接),栏目管理、站点管理、 -公共留言、文件管理、前端网站展示等功能; **在线办公模块** ,提供简单的请假流程实例。 +公共留言、文件管理、前端网站展示等功能; **在线办公模块** ,提供简单的请假流程实例;**代码生成模块** ,完成重复的工作。 JeeSite 提供了常用工具进行封装,包括日志工具、缓存工具、服务器端验证、数据字典、当前组织机构数据 (用户、机构、区域)以及其它常用小工具等。另外还提供一个强大的在线 **代码生成** 工具, @@ -51,13 +53,13 @@ JeeSite 提供了常用工具进行封装,包括日志工具、缓存工具、 1、后端 -* 核心框架:Spring Framework 4.0 +* 核心框架:Spring Framework 4.1 * 安全框架:Apache Shiro 1.2 -* 视图框架:Spring MVC 4.0 -* 服务端验证:Hibernate Validator 5.1 +* 视图框架:Spring MVC 4.1 +* 服务端验证:Hibernate Validator 5.2 * 布局框架:SiteMesh 2.4 -* 工作流引擎:Activiti 5.15、FoxBPM 6 -* 任务调度:Spring Task 4.0 +* 工作流引擎:Activiti 5.21 +* 任务调度:Spring Task 4.1 * 持久层框架:MyBatis 3.2 * 数据库连接池:Alibaba Druid 1.0 * 缓存框架:Ehcache 2.6、Redis @@ -67,10 +69,10 @@ JeeSite 提供了常用工具进行封装,包括日志工具、缓存工具、 2、前端 * JS框架:jQuery 1.9。 -* CSS框架:Twitter Bootstrap 2.3.1。 +* CSS框架:Twitter Bootstrap 2.3.1(稳定是后台,UI方面根据需求自己升级改造吧)。 * 客户端验证:JQuery Validation Plugin 1.11。 -* 富文本:CKEcitor -* 文件管理:CKFinder +* 富文本在线编辑:CKEcitor +* 在线文件管理:CKFinder * 动态页签:Jerichotab * 手机端框架:Jingle * 数据表格:jqGrid @@ -82,10 +84,10 @@ JeeSite 提供了常用工具进行封装,包括日志工具、缓存工具、 4、平台 * 服务器中间件:在Java EE 5规范(Servlet 2.5、JSP 2.1)下开发,支持应用服务器中间件 -有Tomcat 6、Jboss 7、WebLogic 10、WebSphere 8。 +有Tomcat 6+、Jboss 7+、WebLogic 10+、WebSphere 8+。 * 数据库支持:目前仅提供MySql和Oracle数据库的支持,但不限于数据库,平台留有其它数据库支持接口, -可方便更改为其它数据库,如:SqlServer 2008、MySql 5.5、H2等 -* 开发环境:Java EE、Eclipse、Maven、Git +你可以很方便的更改为其它数据库,如:SqlServer 2008、MySql 5.5、H2等 +* 开发环境:Java、Eclipse Java EE 4.3、Maven 3.1、Git ## 安全考虑 @@ -98,7 +100,7 @@ JeeSite 提供了常用工具进行封装,包括日志工具、缓存工具、 ## 演示地址 -* 用户名:thinkgem 密码:admin +*   用户名:thinkgem   密码:admin ## 快速体验 @@ -111,8 +113,8 @@ JeeSite 提供了常用工具进行封装,包括日志工具、缓存工具、 ## 常见问题 -1. 有时出现文字乱码:修改Tomcat的server.xml文件的Connector项,增加URIEncoding="UTF-8" -2. 用一段时间提示内存溢出,请修改JVM参数:-Xmx512m -XX:MaxPermSize=256m +1. 用一段时间提示内存溢出,请修改JVM参数:-Xmx512m -XX:MaxPermSize=256m +2. 有时出现文字乱码:修改Tomcat的server.xml文件的Connector项,增加URIEncoding="UTF-8" 3. 为什么新建菜单后看不到新建的菜单?因为授权问题,菜单管理只允许最高管理员账号管理(最高管理员默认账号:thinkgem 密码:admin)。 ## 更多文档 @@ -121,12 +123,12 @@ JeeSite 提供了常用工具进行封装,包括日志工具、缓存工具、 ## 如何交流、反馈、参与贡献? -* QQ Group:127515876   209330483   223507718 +* QQ Group:127515876   209330483   223507718   苹果版QQ若不能加入请使用手机QQ最新版 * E-mail:thinkgem@163.com * GitHub: * 开源中国: * 官方网址: 论坛: -* 捐赠支持JeeSite(支付宝):[thinkgem@163.com](http://jeesite.com/donation.html) +* 支持JeeSite发展:(加我好友)支付宝:thinkgem@163.com   微信:thinkgem 一个人的个人能力再强,也无法战胜一个团队,希望兄弟姐妹的支持,能够贡献出自己的部分代码,参与进来共同完善它(^_^)。 @@ -140,7 +142,9 @@ JeeSite 提供了常用工具进行封装,包括日志工具、缓存工具、 2. 如果你修改了代码,需要在被修改的文件中说明。 3. **在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明。** 4. 如果再发布的产品中包含一个Notice文件,则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可,但不可以表现为对Apache Licence构成更改。 -3. Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售 +5. Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售 +6. 你可以二次包装出售,**但还请保留文件中的版权和作者信息**,并在你的产品说明中注明JeeSite。 +7. 你可以以任何方式获得,你可以修改包名或类名,**但还请保留文件中的版权和作者信息**。 ##为何使用MyBatis diff --git a/bin/clean.bat b/bin/clean.bat index fb7e626041..6bb8578637 100644 --- a/bin/clean.bat +++ b/bin/clean.bat @@ -1,11 +1,11 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ echo. -echo [��Ϣ] ��������·���� +echo [��Ϣ] �������·���� echo. pause echo. diff --git a/bin/deploy.bat b/bin/deploy.bat index c8cf9fd23c..317472e976 100644 --- a/bin/deploy.bat +++ b/bin/deploy.bat @@ -1,11 +1,11 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ echo. -echo [��Ϣ] ����Eclipse�����ļ��� +echo [��Ϣ] ���Eclipse�����ļ��� echo. pause echo. diff --git a/bin/eclipse.bat b/bin/eclipse.bat index 53d92f91a6..17c3805862 100644 --- a/bin/eclipse.bat +++ b/bin/eclipse.bat @@ -1,11 +1,11 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ echo. -echo [��Ϣ] ����Eclipse�����ļ��� +echo [��Ϣ] ���Eclipse�����ļ��� echo. pause echo. diff --git a/bin/package.bat b/bin/package.bat index 6303601298..09a5fb3b8e 100644 --- a/bin/package.bat +++ b/bin/package.bat @@ -1,11 +1,11 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ echo. -echo [��Ϣ] ������̣�����war���ļ��� +echo [��Ϣ] ���̣����war���ļ��� echo. pause echo. diff --git a/bin/run-jetty.bat b/bin/run-jetty.bat index bd6ff5b4e4..b890d9f48e 100644 --- a/bin/run-jetty.bat +++ b/bin/run-jetty.bat @@ -1,12 +1,12 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ title %cd% echo. -echo [��Ϣ] ʹ��Jetty������й��̡� +echo [��Ϣ] ʹ��Jetty������й��̡� echo. rem pause rem echo. diff --git a/bin/run-tomcat6.bat b/bin/run-tomcat6.bat index 4eeffba25f..69d2748c8f 100644 --- a/bin/run-tomcat6.bat +++ b/bin/run-tomcat6.bat @@ -1,12 +1,12 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ title %cd% echo. -echo [��Ϣ] ʹ��Tomcat6������й��̡� +echo [��Ϣ] ʹ��Tomcat6������й��̡� echo. rem pause rem echo. diff --git a/bin/run-tomcat7.bat b/bin/run-tomcat7.bat index 483925c12b..0d0a3bf2e1 100644 --- a/bin/run-tomcat7.bat +++ b/bin/run-tomcat7.bat @@ -1,12 +1,12 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ title %cd% echo. -echo [��Ϣ] ʹ��Tomcat7������й��̡� +echo [��Ϣ] ʹ��Tomcat7������й��̡� echo. rem pause rem echo. diff --git a/bin/versions.bat b/bin/versions.bat index 0ab5c24b54..105f46986d 100644 --- a/bin/versions.bat +++ b/bin/versions.bat @@ -1,28 +1,28 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ echo. -echo [��Ϣ] ������Ŀ�汾�š� +echo [��Ϣ] ������Ŀ�汾�š� echo. rem pause echo. cd %~dp0 -set /p new=�������°汾�ţ� +set /p new=�������°汾�ţ� echo. pause echo. cd .. -rem ����pom�汾�� +rem ����pom�汾�� call mvn versions:set -DnewVersion=%new% -rem �滻 jeesite.properties �еİ汾�� +rem �滻 jeesite.properties �еİ汾�� echo. set f=%cd%\src\main\resources\jeesite.properties echo [INFO] Update %f% diff --git a/db/init-db.bat b/db/init-db.bat index ab20b0a851..e81d6daa45 100644 --- a/db/init-db.bat +++ b/db/init-db.bat @@ -1,21 +1,21 @@ @echo off rem /** -rem * Copyright © 2012-2014 JeeSite All rights reserved. +rem * Copyright © 2012-2016 JeeSite All rights reserved. rem * rem * Author: ThinkGem@163.com rem */ echo. -echo [��Ϣ] �ؽ��������ݿⲢ�����ʼ���ݡ� +echo [��Ϣ] �ؽ������ݿⲢ�����ʼ��ݡ� echo. pause echo. -echo [��Ϣ] �˲���������������ݱ������ݣ����ָ���ʼ״̬�� +echo [��Ϣ] �˲�������������ݱ����ݣ����ָ���ʼ״̬�� echo. -echo [��Ϣ] ȷ�ϼ����𣿷�����رմ��ڡ� +echo [��Ϣ] ȷ�ϼ����𣿷�����رմ��ڡ� echo. pause echo. -echo [��Ϣ] �����ȷ�ϼ����𣿷�����رմ��ڡ� +echo [��Ϣ] �����ȷ�ϼ����𣿷�����رմ��ڡ� echo. pause echo. diff --git a/pom.xml b/pom.xml index d7852bdac5..b514544493 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ com.thinkgem.jeesite jeesite - 1.2.6 + 1.2.7 war JeeSite http://thinkgem.github.com/jeesite - 2012-2014 + 2012-2016 diff --git a/src/main/java/com/thinkgem/jeesite/common/config/Global.java b/src/main/java/com/thinkgem/jeesite/common/config/Global.java index ff5a275c8d..6908448dfd 100644 --- a/src/main/java/com/thinkgem/jeesite/common/config/Global.java +++ b/src/main/java/com/thinkgem/jeesite/common/config/Global.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.config; diff --git a/src/main/java/com/thinkgem/jeesite/common/filter/PageCachingFilter.java b/src/main/java/com/thinkgem/jeesite/common/filter/PageCachingFilter.java index 1e9af1fe47..ebe5d4c453 100644 --- a/src/main/java/com/thinkgem/jeesite/common/filter/PageCachingFilter.java +++ b/src/main/java/com/thinkgem/jeesite/common/filter/PageCachingFilter.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.filter; diff --git a/src/main/java/com/thinkgem/jeesite/common/mapper/JsonMapper.java b/src/main/java/com/thinkgem/jeesite/common/mapper/JsonMapper.java index 533cf9c02e..7110410ada 100644 --- a/src/main/java/com/thinkgem/jeesite/common/mapper/JsonMapper.java +++ b/src/main/java/com/thinkgem/jeesite/common/mapper/JsonMapper.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.mapper; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/ActEntity.java b/src/main/java/com/thinkgem/jeesite/common/persistence/ActEntity.java index f978117585..d1e269f133 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/ActEntity.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/ActEntity.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/BaseDao.java b/src/main/java/com/thinkgem/jeesite/common/persistence/BaseDao.java index 461d289d9a..45faf270bc 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/BaseDao.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/BaseDao.java @@ -1,13 +1,13 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence; - -/** - * DAO支持类实现 - * @author ThinkGem - * @version 2014-05-16 - */ -public interface BaseDao { - +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence; + +/** + * DAO支持类实现 + * @author ThinkGem + * @version 2014-05-16 + */ +public interface BaseDao { + } \ No newline at end of file diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/BaseEntity.java b/src/main/java/com/thinkgem/jeesite/common/persistence/BaseEntity.java index bc6bde193f..c7b80aa943 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/BaseEntity.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/BaseEntity.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/CrudDao.java b/src/main/java/com/thinkgem/jeesite/common/persistence/CrudDao.java index 9fab7d59aa..f1da6b19ac 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/CrudDao.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/CrudDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/DataEntity.java b/src/main/java/com/thinkgem/jeesite/common/persistence/DataEntity.java index 6f69eef229..81e0c04fc5 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/DataEntity.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/DataEntity.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/Page.java b/src/main/java/com/thinkgem/jeesite/common/persistence/Page.java index f9b004850f..b772b3ab74 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/Page.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/Page.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/Parameter.java b/src/main/java/com/thinkgem/jeesite/common/persistence/Parameter.java index 63ef89326f..cc820dab02 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/Parameter.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/Parameter.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/TreeDao.java b/src/main/java/com/thinkgem/jeesite/common/persistence/TreeDao.java index de5ad9e301..afea2d7c91 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/TreeDao.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/TreeDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/TreeEntity.java b/src/main/java/com/thinkgem/jeesite/common/persistence/TreeEntity.java index 933e27341b..d5468666b8 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/TreeEntity.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/TreeEntity.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/annotation/MyBatisDao.java b/src/main/java/com/thinkgem/jeesite/common/persistence/annotation/MyBatisDao.java index efe5986d85..a2d8ea3a2c 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/annotation/MyBatisDao.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/annotation/MyBatisDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence.annotation; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/Dialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/Dialect.java index 3ce2ba95d5..67bab9985a 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/Dialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/Dialect.java @@ -1,33 +1,33 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect; - -/** - * 类似hibernate的Dialect,但只精简出分页部分 - * - * @author poplar.yfyang - * @version 1.0 2011-11-18 下午12:31 - * @since JDK 1.5 - */ -public interface Dialect { - - /** - * 数据库本身是否支持分页当前的分页查询方式 - * 如果数据库不支持的话,则不进行数据库分页 - * - * @return true:支持当前的分页查询方式 - */ - public boolean supportsLimit(); - - /** - * 将sql转换为分页SQL,分别调用分页sql - * - * @param sql SQL语句 - * @param offset 开始条数 - * @param limit 每页显示多少纪录条数 - * @return 分页查询的sql - */ - public String getLimitString(String sql, int offset, int limit); - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect; + +/** + * 类似hibernate的Dialect,但只精简出分页部分 + * + * @author poplar.yfyang + * @version 1.0 2011-11-18 下午12:31 + * @since JDK 1.5 + */ +public interface Dialect { + + /** + * 数据库本身是否支持分页当前的分页查询方式 + * 如果数据库不支持的话,则不进行数据库分页 + * + * @return true:支持当前的分页查询方式 + */ + public boolean supportsLimit(); + + /** + * 将sql转换为分页SQL,分别调用分页sql + * + * @param sql SQL语句 + * @param offset 开始条数 + * @param limit 每页显示多少纪录条数 + * @return 分页查询的sql + */ + public String getLimitString(String sql, int offset, int limit); + +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/DB2Dialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/DB2Dialect.java index 8e969d7e20..21a471787d 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/DB2Dialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/DB2Dialect.java @@ -1,89 +1,89 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * DB2的分页数据库方言实现 - * - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class DB2Dialect implements Dialect { - @Override - public boolean supportsLimit() { - return true; - } - - private static String getRowNumber(String sql) { - StringBuilder rownumber = new StringBuilder(50) - .append("rownumber() over("); - - int orderByIndex = sql.toLowerCase().indexOf("order by"); - - if (orderByIndex > 0 && !hasDistinct(sql)) { - rownumber.append(sql.substring(orderByIndex)); - } - - rownumber.append(") as rownumber_,"); - - return rownumber.toString(); - } - - private static boolean hasDistinct(String sql) { - return sql.toLowerCase().contains("select distinct"); - } - - @Override - public String getLimitString(String sql, int offset, int limit) { - return getLimitString(sql, offset, Integer.toString(offset), Integer.toString(limit)); - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param offsetPlaceholder 分页开始纪录条数-占位符号 - * @param limitPlaceholder 分页纪录条数占位符号 - * @return 包含占位符的分页sql - */ - public String getLimitString(String sql, int offset, String offsetPlaceholder, String limitPlaceholder) { - int startOfSelect = sql.toLowerCase().indexOf("select"); - - StringBuilder pagingSelect = new StringBuilder(sql.length() + 100) - .append(sql.substring(0, startOfSelect)) //add the comment - .append("select * from ( select ") //nest the main query in an outer select - .append(getRowNumber(sql)); //add the rownnumber bit into the outer query select list - - if (hasDistinct(sql)) { - pagingSelect.append(" row_.* from ( ") //add another (inner) nested select - .append(sql.substring(startOfSelect)) //add the main query - .append(" ) as row_"); //close off the inner nested select - } else { - pagingSelect.append(sql.substring(startOfSelect + 6)); //add the main query - } - - pagingSelect.append(" ) as temp_ where rownumber_ "); - - //add the restriction to the outer select - if (offset > 0) { -// int end = offset + limit; - String endString = offsetPlaceholder + "+" + limitPlaceholder; - pagingSelect.append("between ").append(offsetPlaceholder) - .append("+1 and ").append(endString); - } else { - pagingSelect.append("<= ").append(limitPlaceholder); - } - - return pagingSelect.toString(); - } -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * DB2的分页数据库方言实现 + * + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class DB2Dialect implements Dialect { + @Override + public boolean supportsLimit() { + return true; + } + + private static String getRowNumber(String sql) { + StringBuilder rownumber = new StringBuilder(50) + .append("rownumber() over("); + + int orderByIndex = sql.toLowerCase().indexOf("order by"); + + if (orderByIndex > 0 && !hasDistinct(sql)) { + rownumber.append(sql.substring(orderByIndex)); + } + + rownumber.append(") as rownumber_,"); + + return rownumber.toString(); + } + + private static boolean hasDistinct(String sql) { + return sql.toLowerCase().contains("select distinct"); + } + + @Override + public String getLimitString(String sql, int offset, int limit) { + return getLimitString(sql, offset, Integer.toString(offset), Integer.toString(limit)); + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param offsetPlaceholder 分页开始纪录条数-占位符号 + * @param limitPlaceholder 分页纪录条数占位符号 + * @return 包含占位符的分页sql + */ + public String getLimitString(String sql, int offset, String offsetPlaceholder, String limitPlaceholder) { + int startOfSelect = sql.toLowerCase().indexOf("select"); + + StringBuilder pagingSelect = new StringBuilder(sql.length() + 100) + .append(sql.substring(0, startOfSelect)) //add the comment + .append("select * from ( select ") //nest the main query in an outer select + .append(getRowNumber(sql)); //add the rownnumber bit into the outer query select list + + if (hasDistinct(sql)) { + pagingSelect.append(" row_.* from ( ") //add another (inner) nested select + .append(sql.substring(startOfSelect)) //add the main query + .append(" ) as row_"); //close off the inner nested select + } else { + pagingSelect.append(sql.substring(startOfSelect + 6)); //add the main query + } + + pagingSelect.append(" ) as temp_ where rownumber_ "); + + //add the restriction to the outer select + if (offset > 0) { +// int end = offset + limit; + String endString = offsetPlaceholder + "+" + limitPlaceholder; + pagingSelect.append("between ").append(offsetPlaceholder) + .append("+1 and ").append(endString); + } else { + pagingSelect.append("<= ").append(limitPlaceholder); + } + + return pagingSelect.toString(); + } +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/DerbyDialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/DerbyDialect.java index f59b14b3d2..3e9019aca6 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/DerbyDialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/DerbyDialect.java @@ -1,44 +1,44 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class DerbyDialect implements Dialect { - @Override - public boolean supportsLimit() { - return false; - } - - @Override - public String getLimitString(String sql, int offset, int limit) { -// return getLimitString(sql,offset,Integer.toString(offset),limit,Integer.toString(limit)); - throw new UnsupportedOperationException("paged queries not supported"); - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param offsetPlaceholder 分页开始纪录条数-占位符号 - * @param limit 分页每页显示纪录条数 - * @param limitPlaceholder 分页纪录条数占位符号 - * @return 包含占位符的分页sql - */ - public String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder) { - throw new UnsupportedOperationException( "paged queries not supported" ); - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class DerbyDialect implements Dialect { + @Override + public boolean supportsLimit() { + return false; + } + + @Override + public String getLimitString(String sql, int offset, int limit) { +// return getLimitString(sql,offset,Integer.toString(offset),limit,Integer.toString(limit)); + throw new UnsupportedOperationException("paged queries not supported"); + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param offsetPlaceholder 分页开始纪录条数-占位符号 + * @param limit 分页每页显示纪录条数 + * @param limitPlaceholder 分页纪录条数占位符号 + * @return 包含占位符的分页sql + */ + public String getLimitString(String sql, int offset,String offsetPlaceholder, int limit, String limitPlaceholder) { + throw new UnsupportedOperationException( "paged queries not supported" ); + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/H2Dialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/H2Dialect.java index 6f833245e4..3935c5f6da 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/H2Dialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/H2Dialect.java @@ -1,45 +1,45 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * A dialect compatible with the H2 database. - * - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class H2Dialect implements Dialect { - - public boolean supportsLimit() { - return true; - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param offsetPlaceholder 分页开始纪录条数-占位符号 - * @param limit 分页每页显示纪录条数 - * @param limitPlaceholder 分页纪录条数占位符号 - * @return 包含占位符的分页sql - */ - private String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { - return sql + ((offset > 0) ? " limit " + limitPlaceholder + " offset " - + offsetPlaceholder : " limit " + limitPlaceholder); - } - - @Override - public String getLimitString(String sql, int offset, int limit) { - return getLimitString(sql, offset, Integer.toString(offset), limit, Integer.toString(limit)); - } +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * A dialect compatible with the H2 database. + * + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class H2Dialect implements Dialect { + + public boolean supportsLimit() { + return true; + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param offsetPlaceholder 分页开始纪录条数-占位符号 + * @param limit 分页每页显示纪录条数 + * @param limitPlaceholder 分页纪录条数占位符号 + * @return 包含占位符的分页sql + */ + private String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { + return sql + ((offset > 0) ? " limit " + limitPlaceholder + " offset " + + offsetPlaceholder : " limit " + limitPlaceholder); + } + + @Override + public String getLimitString(String sql, int offset, int limit) { + return getLimitString(sql, offset, Integer.toString(offset), limit, Integer.toString(limit)); + } } \ No newline at end of file diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/HSQLDialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/HSQLDialect.java index 1189d98685..98aedbaf85 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/HSQLDialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/HSQLDialect.java @@ -1,50 +1,50 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * Dialect for HSQLDB - * - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class HSQLDialect implements Dialect { - @Override - public boolean supportsLimit() { - return true; - } - - @Override - public String getLimitString(String sql, int offset, int limit) { - return getLimitString(sql, offset, Integer.toString(offset), - Integer.toString(limit)); - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param offsetPlaceholder 分页开始纪录条数-占位符号 - * @param limitPlaceholder 分页纪录条数占位符号 - * @return 包含占位符的分页sql - */ - public String getLimitString(String sql, int offset, String offsetPlaceholder, String limitPlaceholder) { - boolean hasOffset = offset > 0; - return - new StringBuffer(sql.length() + 10) - .append(sql) - .insert(sql.toLowerCase().indexOf("select") + 6, hasOffset ? " limit " + offsetPlaceholder + " " + limitPlaceholder : " top " + limitPlaceholder) - .toString(); - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * Dialect for HSQLDB + * + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class HSQLDialect implements Dialect { + @Override + public boolean supportsLimit() { + return true; + } + + @Override + public String getLimitString(String sql, int offset, int limit) { + return getLimitString(sql, offset, Integer.toString(offset), + Integer.toString(limit)); + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param offsetPlaceholder 分页开始纪录条数-占位符号 + * @param limitPlaceholder 分页纪录条数占位符号 + * @return 包含占位符的分页sql + */ + public String getLimitString(String sql, int offset, String offsetPlaceholder, String limitPlaceholder) { + boolean hasOffset = offset > 0; + return + new StringBuffer(sql.length() + 10) + .append(sql) + .insert(sql.toLowerCase().indexOf("select") + 6, hasOffset ? " limit " + offsetPlaceholder + " " + limitPlaceholder : " top " + limitPlaceholder) + .toString(); + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/MySQLDialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/MySQLDialect.java index 04989baad1..634ebc94c8 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/MySQLDialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/MySQLDialect.java @@ -1,53 +1,53 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * Mysql方言的实现 - * - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class MySQLDialect implements Dialect { - - - @Override - public String getLimitString(String sql, int offset, int limit) { - return getLimitString(sql, offset, Integer.toString(offset), - Integer.toString(limit)); - } - - public boolean supportsLimit() { - return true; - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param offsetPlaceholder 分页开始纪录条数-占位符号 - * @param limitPlaceholder 分页纪录条数占位符号 - * @return 包含占位符的分页sql - */ - public String getLimitString(String sql, int offset, String offsetPlaceholder, String limitPlaceholder) { - StringBuilder stringBuilder = new StringBuilder(sql); - stringBuilder.append(" limit "); - if (offset > 0) { - stringBuilder.append(offsetPlaceholder).append(",").append(limitPlaceholder); - } else { - stringBuilder.append(limitPlaceholder); - } - return stringBuilder.toString(); - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * Mysql方言的实现 + * + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class MySQLDialect implements Dialect { + + + @Override + public String getLimitString(String sql, int offset, int limit) { + return getLimitString(sql, offset, Integer.toString(offset), + Integer.toString(limit)); + } + + public boolean supportsLimit() { + return true; + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param offsetPlaceholder 分页开始纪录条数-占位符号 + * @param limitPlaceholder 分页纪录条数占位符号 + * @return 包含占位符的分页sql + */ + public String getLimitString(String sql, int offset, String offsetPlaceholder, String limitPlaceholder) { + StringBuilder stringBuilder = new StringBuilder(sql); + stringBuilder.append(" limit "); + if (offset > 0) { + stringBuilder.append(offsetPlaceholder).append(",").append(limitPlaceholder); + } else { + stringBuilder.append(limitPlaceholder); + } + return stringBuilder.toString(); + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/OracleDialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/OracleDialect.java index 4bd94bb15d..2efedc0313 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/OracleDialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/OracleDialect.java @@ -1,68 +1,68 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * Oracle的方言实现 - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class OracleDialect implements Dialect { - @Override - public boolean supportsLimit() { - return true; - } - - @Override - public String getLimitString(String sql, int offset, int limit) { - return getLimitString(sql, offset, Integer.toString(offset), Integer.toString(limit)); - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param offsetPlaceholder 分页开始纪录条数-占位符号 - * @param limitPlaceholder 分页纪录条数占位符号 - * @return 包含占位符的分页sql - */ - public String getLimitString(String sql, int offset, String offsetPlaceholder, String limitPlaceholder) { - sql = sql.trim(); - boolean isForUpdate = false; - if (sql.toLowerCase().endsWith(" for update")) { - sql = sql.substring(0, sql.length() - 11); - isForUpdate = true; - } - StringBuilder pagingSelect = new StringBuilder(sql.length() + 100); - - if (offset > 0) { - pagingSelect.append("select * from ( select row_.*, rownum rownum_ from ( "); - } else { - pagingSelect.append("select * from ( "); - } - pagingSelect.append(sql); - if (offset > 0) { - String endString = offsetPlaceholder + "+" + limitPlaceholder; - pagingSelect.append(" ) row_ where rownum <= "+endString+") where rownum_ > ").append(offsetPlaceholder); - } else { - pagingSelect.append(" ) where rownum <= "+limitPlaceholder); - } - - if (isForUpdate) { - pagingSelect.append(" for update"); - } - - return pagingSelect.toString(); - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * Oracle的方言实现 + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class OracleDialect implements Dialect { + @Override + public boolean supportsLimit() { + return true; + } + + @Override + public String getLimitString(String sql, int offset, int limit) { + return getLimitString(sql, offset, Integer.toString(offset), Integer.toString(limit)); + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param offsetPlaceholder 分页开始纪录条数-占位符号 + * @param limitPlaceholder 分页纪录条数占位符号 + * @return 包含占位符的分页sql + */ + public String getLimitString(String sql, int offset, String offsetPlaceholder, String limitPlaceholder) { + sql = sql.trim(); + boolean isForUpdate = false; + if (sql.toLowerCase().endsWith(" for update")) { + sql = sql.substring(0, sql.length() - 11); + isForUpdate = true; + } + StringBuilder pagingSelect = new StringBuilder(sql.length() + 100); + + if (offset > 0) { + pagingSelect.append("select * from ( select row_.*, rownum rownum_ from ( "); + } else { + pagingSelect.append("select * from ( "); + } + pagingSelect.append(sql); + if (offset > 0) { + String endString = offsetPlaceholder + "+" + limitPlaceholder; + pagingSelect.append(" ) row_ where rownum <= "+endString+") where rownum_ > ").append(offsetPlaceholder); + } else { + pagingSelect.append(" ) where rownum <= "+limitPlaceholder); + } + + if (isForUpdate) { + pagingSelect.append(" for update"); + } + + return pagingSelect.toString(); + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/PostgreSQLDialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/PostgreSQLDialect.java index 46ceaeced9..a69c74dd26 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/PostgreSQLDialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/PostgreSQLDialect.java @@ -1,48 +1,48 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * Postgre Sql的方言实现 - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class PostgreSQLDialect implements Dialect { - - public boolean supportsLimit() { - return true; - } - - @Override - public String getLimitString(String sql, int offset, int limit) { - return getLimitString(sql, offset, Integer.toString(offset), - Integer.toString(limit)); - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param offsetPlaceholder 分页开始纪录条数-占位符号 - * @param limitPlaceholder 分页纪录条数占位符号 - * @return 包含占位符的分页sql - */ - public String getLimitString(String sql, int offset, - String offsetPlaceholder, String limitPlaceholder) { - StringBuilder pageSql = new StringBuilder().append(sql); - pageSql = offset <= 0 - ? pageSql.append(" limit ").append(limitPlaceholder) : - pageSql.append(" limit ").append(limitPlaceholder).append(" offset ").append(offsetPlaceholder); - return pageSql.toString(); - } -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * Postgre Sql的方言实现 + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class PostgreSQLDialect implements Dialect { + + public boolean supportsLimit() { + return true; + } + + @Override + public String getLimitString(String sql, int offset, int limit) { + return getLimitString(sql, offset, Integer.toString(offset), + Integer.toString(limit)); + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param offsetPlaceholder 分页开始纪录条数-占位符号 + * @param limitPlaceholder 分页纪录条数占位符号 + * @return 包含占位符的分页sql + */ + public String getLimitString(String sql, int offset, + String offsetPlaceholder, String limitPlaceholder) { + StringBuilder pageSql = new StringBuilder().append(sql); + pageSql = offset <= 0 + ? pageSql.append(" limit ").append(limitPlaceholder) : + pageSql.append(" limit ").append(limitPlaceholder).append(" offset ").append(offsetPlaceholder); + return pageSql.toString(); + } +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SQLServer2005Dialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SQLServer2005Dialect.java index 73eff1ab3a..7da688e7e1 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SQLServer2005Dialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SQLServer2005Dialect.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence.dialect.db; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SQLServerDialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SQLServerDialect.java index ab6f330718..5e31d5d6b6 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SQLServerDialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SQLServerDialect.java @@ -1,55 +1,55 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * MSSQLServer 数据库实现分页方言 - * - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class SQLServerDialect implements Dialect { - - public boolean supportsLimit() { - return true; - } - - static int getAfterSelectInsertPoint(String sql) { - int selectIndex = sql.toLowerCase().indexOf("select"); - final int selectDistinctIndex = sql.toLowerCase().indexOf("select distinct"); - return selectIndex + (selectDistinctIndex == selectIndex ? 15 : 6); - } - - public String getLimitString(String sql, int offset, int limit) { - return getLimit(sql, offset, limit); - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param limit 分页每页显示纪录条数 - * @return 包含占位符的分页sql - */ - public String getLimit(String sql, int offset, int limit) { - if (offset > 0) { - throw new UnsupportedOperationException("sql server has no offset"); - } - return new StringBuffer(sql.length() + 8) - .append(sql) - .insert(getAfterSelectInsertPoint(sql), " top " + limit) - .toString(); - } - - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * MSSQLServer 数据库实现分页方言 + * + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class SQLServerDialect implements Dialect { + + public boolean supportsLimit() { + return true; + } + + static int getAfterSelectInsertPoint(String sql) { + int selectIndex = sql.toLowerCase().indexOf("select"); + final int selectDistinctIndex = sql.toLowerCase().indexOf("select distinct"); + return selectIndex + (selectDistinctIndex == selectIndex ? 15 : 6); + } + + public String getLimitString(String sql, int offset, int limit) { + return getLimit(sql, offset, limit); + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param limit 分页每页显示纪录条数 + * @return 包含占位符的分页sql + */ + public String getLimit(String sql, int offset, int limit) { + if (offset > 0) { + throw new UnsupportedOperationException("sql server has no offset"); + } + return new StringBuffer(sql.length() + 8) + .append(sql) + .insert(getAfterSelectInsertPoint(sql), " top " + limit) + .toString(); + } + + +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SybaseDialect.java b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SybaseDialect.java index 5760b08991..2fd81ffec2 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SybaseDialect.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/dialect/db/SybaseDialect.java @@ -1,47 +1,47 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.dialect.db; - -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; - -/** - * Sybase数据库分页方言实现。 - * 还未实现 - * - * @author poplar.yfyang - * @version 1.0 2010-10-10 下午12:31 - * @since JDK 1.5 - */ -public class SybaseDialect implements Dialect { - - public boolean supportsLimit() { - return false; - } - - - @Override - public String getLimitString(String sql, int offset, int limit) { - return null; - } - - /** - * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. - *
-     * 如mysql
-     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
-     * select * from user limit :offset,:limit
-     * 
- * - * @param sql 实际SQL语句 - * @param offset 分页开始纪录条数 - * @param offsetPlaceholder 分页开始纪录条数-占位符号 - * @param limit 分页每页显示纪录条数 - * @param limitPlaceholder 分页纪录条数占位符号 - * @return 包含占位符的分页sql - */ - public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { - throw new UnsupportedOperationException("paged queries not supported"); - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.dialect.db; + +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; + +/** + * Sybase数据库分页方言实现。 + * 还未实现 + * + * @author poplar.yfyang + * @version 1.0 2010-10-10 下午12:31 + * @since JDK 1.5 + */ +public class SybaseDialect implements Dialect { + + public boolean supportsLimit() { + return false; + } + + + @Override + public String getLimitString(String sql, int offset, int limit) { + return null; + } + + /** + * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. + *
+     * 如mysql
+     * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回
+     * select * from user limit :offset,:limit
+     * 
+ * + * @param sql 实际SQL语句 + * @param offset 分页开始纪录条数 + * @param offsetPlaceholder 分页开始纪录条数-占位符号 + * @param limit 分页每页显示纪录条数 + * @param limitPlaceholder 分页纪录条数占位符号 + * @return 包含占位符的分页sql + */ + public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { + throw new UnsupportedOperationException("paged queries not supported"); + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/BaseInterceptor.java b/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/BaseInterceptor.java index 57c973dd1a..ba39ac9f63 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/BaseInterceptor.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/BaseInterceptor.java @@ -1,110 +1,110 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.interceptor; - -import org.apache.ibatis.logging.Log; -import org.apache.ibatis.logging.LogFactory; -import org.apache.ibatis.plugin.Interceptor; - -import com.thinkgem.jeesite.common.config.Global; -import com.thinkgem.jeesite.common.persistence.Page; -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.DB2Dialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.DerbyDialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.H2Dialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.HSQLDialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.MySQLDialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.OracleDialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.PostgreSQLDialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.SQLServer2005Dialect; -import com.thinkgem.jeesite.common.persistence.dialect.db.SybaseDialect; -import com.thinkgem.jeesite.common.utils.Reflections; - -import java.io.Serializable; -import java.util.Properties; - -/** - * Mybatis分页拦截器基类 - * @author poplar.yfyang / thinkgem - * @version 2013-8-28 - */ -public abstract class BaseInterceptor implements Interceptor, Serializable { - - private static final long serialVersionUID = 1L; - - protected static final String PAGE = "page"; - - protected static final String DELEGATE = "delegate"; - - protected static final String MAPPED_STATEMENT = "mappedStatement"; - - protected Log log = LogFactory.getLog(this.getClass()); - - protected Dialect DIALECT; - -// /** -// * 拦截的ID,在mapper中的id,可以匹配正则 -// */ -// protected String _SQL_PATTERN = ""; - - /** - * 对参数进行转换和检查 - * @param parameterObject 参数对象 - * @param page 分页对象 - * @return 分页对象 - * @throws NoSuchFieldException 无法找到参数 - */ - @SuppressWarnings("unchecked") - protected static Page convertParameter(Object parameterObject, Page page) { - try{ - if (parameterObject instanceof Page) { - return (Page) parameterObject; - } else { - return (Page)Reflections.getFieldValue(parameterObject, PAGE); - } - }catch (Exception e) { - return null; - } - } - - /** - * 设置属性,支持自定义方言类和制定数据库的方式 - * dialectClass,自定义方言类。可以不配置这项 - * dbms 数据库类型,插件支持的数据库 - * sqlPattern 需要拦截的SQL ID - * @param p 属性 - */ - protected void initProperties(Properties p) { - Dialect dialect = null; - String dbType = Global.getConfig("jdbc.type"); - if ("db2".equals(dbType)){ - dialect = new DB2Dialect(); - }else if("derby".equals(dbType)){ - dialect = new DerbyDialect(); - }else if("h2".equals(dbType)){ - dialect = new H2Dialect(); - }else if("hsql".equals(dbType)){ - dialect = new HSQLDialect(); - }else if("mysql".equals(dbType)){ - dialect = new MySQLDialect(); - }else if("oracle".equals(dbType)){ - dialect = new OracleDialect(); - }else if("postgre".equals(dbType)){ - dialect = new PostgreSQLDialect(); - }else if("mssql".equals(dbType) || "sqlserver".equals(dbType)){ - dialect = new SQLServer2005Dialect(); - }else if("sybase".equals(dbType)){ - dialect = new SybaseDialect(); - } - if (dialect == null) { - throw new RuntimeException("mybatis dialect error."); - } - DIALECT = dialect; -// _SQL_PATTERN = p.getProperty("sqlPattern"); -// _SQL_PATTERN = Global.getConfig("mybatis.pagePattern"); -// if (StringUtils.isEmpty(_SQL_PATTERN)) { -// throw new RuntimeException("sqlPattern property is not found!"); -// } - } -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.interceptor; + +import org.apache.ibatis.logging.Log; +import org.apache.ibatis.logging.LogFactory; +import org.apache.ibatis.plugin.Interceptor; + +import com.thinkgem.jeesite.common.config.Global; +import com.thinkgem.jeesite.common.persistence.Page; +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.DB2Dialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.DerbyDialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.H2Dialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.HSQLDialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.MySQLDialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.OracleDialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.PostgreSQLDialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.SQLServer2005Dialect; +import com.thinkgem.jeesite.common.persistence.dialect.db.SybaseDialect; +import com.thinkgem.jeesite.common.utils.Reflections; + +import java.io.Serializable; +import java.util.Properties; + +/** + * Mybatis分页拦截器基类 + * @author poplar.yfyang / thinkgem + * @version 2013-8-28 + */ +public abstract class BaseInterceptor implements Interceptor, Serializable { + + private static final long serialVersionUID = 1L; + + protected static final String PAGE = "page"; + + protected static final String DELEGATE = "delegate"; + + protected static final String MAPPED_STATEMENT = "mappedStatement"; + + protected Log log = LogFactory.getLog(this.getClass()); + + protected Dialect DIALECT; + +// /** +// * 拦截的ID,在mapper中的id,可以匹配正则 +// */ +// protected String _SQL_PATTERN = ""; + + /** + * 对参数进行转换和检查 + * @param parameterObject 参数对象 + * @param page 分页对象 + * @return 分页对象 + * @throws NoSuchFieldException 无法找到参数 + */ + @SuppressWarnings("unchecked") + protected static Page convertParameter(Object parameterObject, Page page) { + try{ + if (parameterObject instanceof Page) { + return (Page) parameterObject; + } else { + return (Page)Reflections.getFieldValue(parameterObject, PAGE); + } + }catch (Exception e) { + return null; + } + } + + /** + * 设置属性,支持自定义方言类和制定数据库的方式 + * dialectClass,自定义方言类。可以不配置这项 + * dbms 数据库类型,插件支持的数据库 + * sqlPattern 需要拦截的SQL ID + * @param p 属性 + */ + protected void initProperties(Properties p) { + Dialect dialect = null; + String dbType = Global.getConfig("jdbc.type"); + if ("db2".equals(dbType)){ + dialect = new DB2Dialect(); + }else if("derby".equals(dbType)){ + dialect = new DerbyDialect(); + }else if("h2".equals(dbType)){ + dialect = new H2Dialect(); + }else if("hsql".equals(dbType)){ + dialect = new HSQLDialect(); + }else if("mysql".equals(dbType)){ + dialect = new MySQLDialect(); + }else if("oracle".equals(dbType)){ + dialect = new OracleDialect(); + }else if("postgre".equals(dbType)){ + dialect = new PostgreSQLDialect(); + }else if("mssql".equals(dbType) || "sqlserver".equals(dbType)){ + dialect = new SQLServer2005Dialect(); + }else if("sybase".equals(dbType)){ + dialect = new SybaseDialect(); + } + if (dialect == null) { + throw new RuntimeException("mybatis dialect error."); + } + DIALECT = dialect; +// _SQL_PATTERN = p.getProperty("sqlPattern"); +// _SQL_PATTERN = Global.getConfig("mybatis.pagePattern"); +// if (StringUtils.isEmpty(_SQL_PATTERN)) { +// throw new RuntimeException("sqlPattern property is not found!"); +// } + } +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/PaginationInterceptor.java b/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/PaginationInterceptor.java index 7f140e6dfe..4c29edf9a0 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/PaginationInterceptor.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/PaginationInterceptor.java @@ -1,128 +1,128 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.interceptor; - -import org.apache.ibatis.executor.Executor; -import org.apache.ibatis.mapping.BoundSql; -import org.apache.ibatis.mapping.MappedStatement; -import org.apache.ibatis.mapping.SqlSource; -import org.apache.ibatis.plugin.Intercepts; -import org.apache.ibatis.plugin.Invocation; -import org.apache.ibatis.plugin.Plugin; -import org.apache.ibatis.plugin.Signature; -import org.apache.ibatis.reflection.MetaObject; -import org.apache.ibatis.session.ResultHandler; -import org.apache.ibatis.session.RowBounds; - -import com.thinkgem.jeesite.common.persistence.Page; -import com.thinkgem.jeesite.common.utils.Reflections; -import com.thinkgem.jeesite.common.utils.StringUtils; - -import java.util.Properties; - -/** - * 数据库分页插件,只拦截查询语句. - * @author poplar.yfyang / thinkgem - * @version 2013-8-28 - */ -@Intercepts({@Signature(type = Executor.class, method = "query", - args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class})}) -public class PaginationInterceptor extends BaseInterceptor { - - private static final long serialVersionUID = 1L; - - @Override - public Object intercept(Invocation invocation) throws Throwable { - - final MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0]; - -// //拦截需要分页的SQL -//// if (mappedStatement.getId().matches(_SQL_PATTERN)) { -// if (StringUtils.indexOfIgnoreCase(mappedStatement.getId(), _SQL_PATTERN) != -1) { - Object parameter = invocation.getArgs()[1]; - BoundSql boundSql = mappedStatement.getBoundSql(parameter); - Object parameterObject = boundSql.getParameterObject(); - - //获取分页参数对象 - Page page = null; - if (parameterObject != null) { - page = convertParameter(parameterObject, page); - } - - //如果设置了分页对象,则进行分页 - if (page != null && page.getPageSize() != -1) { - - if (StringUtils.isBlank(boundSql.getSql())){ - return null; - } - String originalSql = boundSql.getSql().trim(); - - //得到总记录数 - page.setCount(SQLHelper.getCount(originalSql, null, mappedStatement, parameterObject, boundSql, log)); - - //分页查询 本地化对象 修改数据库注意修改实现 - String pageSql = SQLHelper.generatePageSql(originalSql, page, DIALECT); -// if (log.isDebugEnabled()) { -// log.debug("PAGE SQL:" + StringUtils.replace(pageSql, "\n", "")); -// } - invocation.getArgs()[2] = new RowBounds(RowBounds.NO_ROW_OFFSET, RowBounds.NO_ROW_LIMIT); - BoundSql newBoundSql = new BoundSql(mappedStatement.getConfiguration(), pageSql, boundSql.getParameterMappings(), boundSql.getParameterObject()); - //解决MyBatis 分页foreach 参数失效 start - if (Reflections.getFieldValue(boundSql, "metaParameters") != null) { - MetaObject mo = (MetaObject) Reflections.getFieldValue(boundSql, "metaParameters"); - Reflections.setFieldValue(newBoundSql, "metaParameters", mo); - } - //解决MyBatis 分页foreach 参数失效 end - MappedStatement newMs = copyFromMappedStatement(mappedStatement, new BoundSqlSqlSource(newBoundSql)); - - invocation.getArgs()[0] = newMs; - } -// } - return invocation.proceed(); - } - - - @Override - public Object plugin(Object target) { - return Plugin.wrap(target, this); - } - - @Override - public void setProperties(Properties properties) { - super.initProperties(properties); - } - - private MappedStatement copyFromMappedStatement(MappedStatement ms, - SqlSource newSqlSource) { - MappedStatement.Builder builder = new MappedStatement.Builder(ms.getConfiguration(), - ms.getId(), newSqlSource, ms.getSqlCommandType()); - builder.resource(ms.getResource()); - builder.fetchSize(ms.getFetchSize()); - builder.statementType(ms.getStatementType()); - builder.keyGenerator(ms.getKeyGenerator()); - if (ms.getKeyProperties() != null) { - for (String keyProperty : ms.getKeyProperties()) { - builder.keyProperty(keyProperty); - } - } - builder.timeout(ms.getTimeout()); - builder.parameterMap(ms.getParameterMap()); - builder.resultMaps(ms.getResultMaps()); - builder.cache(ms.getCache()); - builder.useCache(ms.isUseCache()); - return builder.build(); - } - - public static class BoundSqlSqlSource implements SqlSource { - BoundSql boundSql; - - public BoundSqlSqlSource(BoundSql boundSql) { - this.boundSql = boundSql; - } - - public BoundSql getBoundSql(Object parameterObject) { - return boundSql; - } - } -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.interceptor; + +import org.apache.ibatis.executor.Executor; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.SqlSource; +import org.apache.ibatis.plugin.Intercepts; +import org.apache.ibatis.plugin.Invocation; +import org.apache.ibatis.plugin.Plugin; +import org.apache.ibatis.plugin.Signature; +import org.apache.ibatis.reflection.MetaObject; +import org.apache.ibatis.session.ResultHandler; +import org.apache.ibatis.session.RowBounds; + +import com.thinkgem.jeesite.common.persistence.Page; +import com.thinkgem.jeesite.common.utils.Reflections; +import com.thinkgem.jeesite.common.utils.StringUtils; + +import java.util.Properties; + +/** + * 数据库分页插件,只拦截查询语句. + * @author poplar.yfyang / thinkgem + * @version 2013-8-28 + */ +@Intercepts({@Signature(type = Executor.class, method = "query", + args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class})}) +public class PaginationInterceptor extends BaseInterceptor { + + private static final long serialVersionUID = 1L; + + @Override + public Object intercept(Invocation invocation) throws Throwable { + + final MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0]; + +// //拦截需要分页的SQL +//// if (mappedStatement.getId().matches(_SQL_PATTERN)) { +// if (StringUtils.indexOfIgnoreCase(mappedStatement.getId(), _SQL_PATTERN) != -1) { + Object parameter = invocation.getArgs()[1]; + BoundSql boundSql = mappedStatement.getBoundSql(parameter); + Object parameterObject = boundSql.getParameterObject(); + + //获取分页参数对象 + Page page = null; + if (parameterObject != null) { + page = convertParameter(parameterObject, page); + } + + //如果设置了分页对象,则进行分页 + if (page != null && page.getPageSize() != -1) { + + if (StringUtils.isBlank(boundSql.getSql())){ + return null; + } + String originalSql = boundSql.getSql().trim(); + + //得到总记录数 + page.setCount(SQLHelper.getCount(originalSql, null, mappedStatement, parameterObject, boundSql, log)); + + //分页查询 本地化对象 修改数据库注意修改实现 + String pageSql = SQLHelper.generatePageSql(originalSql, page, DIALECT); +// if (log.isDebugEnabled()) { +// log.debug("PAGE SQL:" + StringUtils.replace(pageSql, "\n", "")); +// } + invocation.getArgs()[2] = new RowBounds(RowBounds.NO_ROW_OFFSET, RowBounds.NO_ROW_LIMIT); + BoundSql newBoundSql = new BoundSql(mappedStatement.getConfiguration(), pageSql, boundSql.getParameterMappings(), boundSql.getParameterObject()); + //解决MyBatis 分页foreach 参数失效 start + if (Reflections.getFieldValue(boundSql, "metaParameters") != null) { + MetaObject mo = (MetaObject) Reflections.getFieldValue(boundSql, "metaParameters"); + Reflections.setFieldValue(newBoundSql, "metaParameters", mo); + } + //解决MyBatis 分页foreach 参数失效 end + MappedStatement newMs = copyFromMappedStatement(mappedStatement, new BoundSqlSqlSource(newBoundSql)); + + invocation.getArgs()[0] = newMs; + } +// } + return invocation.proceed(); + } + + + @Override + public Object plugin(Object target) { + return Plugin.wrap(target, this); + } + + @Override + public void setProperties(Properties properties) { + super.initProperties(properties); + } + + private MappedStatement copyFromMappedStatement(MappedStatement ms, + SqlSource newSqlSource) { + MappedStatement.Builder builder = new MappedStatement.Builder(ms.getConfiguration(), + ms.getId(), newSqlSource, ms.getSqlCommandType()); + builder.resource(ms.getResource()); + builder.fetchSize(ms.getFetchSize()); + builder.statementType(ms.getStatementType()); + builder.keyGenerator(ms.getKeyGenerator()); + if (ms.getKeyProperties() != null) { + for (String keyProperty : ms.getKeyProperties()) { + builder.keyProperty(keyProperty); + } + } + builder.timeout(ms.getTimeout()); + builder.parameterMap(ms.getParameterMap()); + builder.resultMaps(ms.getResultMaps()); + builder.cache(ms.getCache()); + builder.useCache(ms.isUseCache()); + return builder.build(); + } + + public static class BoundSqlSqlSource implements SqlSource { + BoundSql boundSql; + + public BoundSqlSqlSource(BoundSql boundSql) { + this.boundSql = boundSql; + } + + public BoundSql getBoundSql(Object parameterObject) { + return boundSql; + } + } +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/PreparePaginationInterceptor.java b/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/PreparePaginationInterceptor.java index 24e21d1c49..a0962a2909 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/PreparePaginationInterceptor.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/PreparePaginationInterceptor.java @@ -1,89 +1,89 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.interceptor; - -import org.apache.ibatis.executor.statement.BaseStatementHandler; -import org.apache.ibatis.executor.statement.RoutingStatementHandler; -import org.apache.ibatis.executor.statement.StatementHandler; -import org.apache.ibatis.mapping.BoundSql; -import org.apache.ibatis.mapping.MappedStatement; -import org.apache.ibatis.plugin.Intercepts; -import org.apache.ibatis.plugin.Invocation; -import org.apache.ibatis.plugin.Plugin; -import org.apache.ibatis.plugin.Signature; - -import com.thinkgem.jeesite.common.persistence.Page; -import com.thinkgem.jeesite.common.utils.Reflections; - -import java.sql.Connection; -import java.util.Properties; - -/** - * Mybatis数据库分页插件,拦截StatementHandler的prepare方法 - * @author poplar.yfyang / thinkgem - * @version 2013-8-28 - */ -@Intercepts({ - @Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class}) -}) -public class PreparePaginationInterceptor extends BaseInterceptor { - - private static final long serialVersionUID = 1L; - - public PreparePaginationInterceptor() { - super(); - } - - @Override - public Object intercept(Invocation ivk) throws Throwable { - if (ivk.getTarget().getClass().isAssignableFrom(RoutingStatementHandler.class)) { - final RoutingStatementHandler statementHandler = (RoutingStatementHandler) ivk.getTarget(); - final BaseStatementHandler delegate = (BaseStatementHandler) Reflections.getFieldValue(statementHandler, DELEGATE); - final MappedStatement mappedStatement = (MappedStatement) Reflections.getFieldValue(delegate, MAPPED_STATEMENT); - -// //拦截需要分页的SQL -//// if (mappedStatement.getId().matches(_SQL_PATTERN)) { -// if (StringUtils.indexOfIgnoreCase(mappedStatement.getId(), _SQL_PATTERN) != -1) { - BoundSql boundSql = delegate.getBoundSql(); - //分页SQL中parameterType属性对应的实体参数,即Mapper接口中执行分页方法的参数,该参数不得为空 + Object parameterObject = boundSql.getParameterObject(); + if (parameterObject == null) { + log.error("参数未实例化"); + throw new NullPointerException("parameterObject尚未实例化!"); + } else { + final Connection connection = (Connection) ivk.getArgs()[0]; + final String sql = boundSql.getSql(); + //记录统计 + final int count = SQLHelper.getCount(sql, connection, mappedStatement, parameterObject, boundSql, log); + Page page = null; + page = convertParameter(parameterObject, page); + page.setCount(count); + String pagingSql = SQLHelper.generatePageSql(sql, page, DIALECT); + if (log.isDebugEnabled()) { + log.debug("PAGE SQL:" + pagingSql); + } + //将分页sql语句反射回BoundSql. + Reflections.setFieldValue(boundSql, "sql", pagingSql); + } + + if (boundSql.getSql() == null || "".equals(boundSql.getSql())){ + return null; + } + + } +// } + return ivk.proceed(); + } + + + @Override + public Object plugin(Object o) { + return Plugin.wrap(o, this); + } + + @Override + public void setProperties(Properties properties) { + initProperties(properties); + } +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/SQLHelper.java b/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/SQLHelper.java index 40e2bf483f..a82d4e12c9 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/SQLHelper.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/interceptor/SQLHelper.java @@ -1,195 +1,195 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.interceptor; - -import org.apache.ibatis.executor.ErrorContext; -import org.apache.ibatis.executor.ExecutorException; -import org.apache.ibatis.logging.Log; -import org.apache.ibatis.mapping.BoundSql; -import org.apache.ibatis.mapping.MappedStatement; -import org.apache.ibatis.mapping.ParameterMapping; -import org.apache.ibatis.mapping.ParameterMode; -import org.apache.ibatis.reflection.MetaObject; -import org.apache.ibatis.reflection.property.PropertyTokenizer; -import org.apache.ibatis.scripting.xmltags.ForEachSqlNode; -import org.apache.ibatis.session.Configuration; -import org.apache.ibatis.type.TypeHandler; -import org.apache.ibatis.type.TypeHandlerRegistry; - -import com.thinkgem.jeesite.common.config.Global; -import com.thinkgem.jeesite.common.persistence.Page; -import com.thinkgem.jeesite.common.persistence.dialect.Dialect; -import com.thinkgem.jeesite.common.utils.Reflections; -import com.thinkgem.jeesite.common.utils.StringUtils; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * SQL工具类 - * @author poplar.yfyang / thinkgem - * @version 2013-8-28 - */ -public class SQLHelper { - - /** - * 对SQL参数(?)设值,参考org.apache.ibatis.executor.parameter.DefaultParameterHandler - * - * @param ps 表示预编译的 SQL 语句的对象。 - * @param mappedStatement MappedStatement - * @param boundSql SQL - * @param parameterObject 参数对象 - * @throws java.sql.SQLException 数据库异常 - */ - @SuppressWarnings("unchecked") - public static void setParameters(PreparedStatement ps, MappedStatement mappedStatement, BoundSql boundSql, Object parameterObject) throws SQLException { - ErrorContext.instance().activity("setting parameters").object(mappedStatement.getParameterMap().getId()); - List parameterMappings = boundSql.getParameterMappings(); - if (parameterMappings != null) { - Configuration configuration = mappedStatement.getConfiguration(); - TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry(); - MetaObject metaObject = parameterObject == null ? null : - configuration.newMetaObject(parameterObject); - for (int i = 0; i < parameterMappings.size(); i++) { - ParameterMapping parameterMapping = parameterMappings.get(i); - if (parameterMapping.getMode() != ParameterMode.OUT) { - Object value; - String propertyName = parameterMapping.getProperty(); - PropertyTokenizer prop = new PropertyTokenizer(propertyName); - if (parameterObject == null) { - value = null; - } else if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) { - value = parameterObject; - } else if (boundSql.hasAdditionalParameter(propertyName)) { - value = boundSql.getAdditionalParameter(propertyName); - } else if (propertyName.startsWith(ForEachSqlNode.ITEM_PREFIX) && boundSql.hasAdditionalParameter(prop.getName())) { - value = boundSql.getAdditionalParameter(prop.getName()); - if (value != null) { - value = configuration.newMetaObject(value).getValue(propertyName.substring(prop.getName().length())); - } - } else { - value = metaObject == null ? null : metaObject.getValue(propertyName); - } - @SuppressWarnings("rawtypes") - TypeHandler typeHandler = parameterMapping.getTypeHandler(); - if (typeHandler == null) { - throw new ExecutorException("There was no TypeHandler found for parameter " + propertyName + " of statement " + mappedStatement.getId()); - } - typeHandler.setParameter(ps, i + 1, value, parameterMapping.getJdbcType()); - } - } - } - } - - - /** - * 查询总纪录数 - * @param sql SQL语句 - * @param connection 数据库连接 - * @param mappedStatement mapped - * @param parameterObject 参数 - * @param boundSql boundSql - * @return 总记录数 - * @throws SQLException sql查询错误 - */ - public static int getCount(final String sql, final Connection connection, - final MappedStatement mappedStatement, final Object parameterObject, - final BoundSql boundSql, Log log) throws SQLException { - String dbName = Global.getConfig("jdbc.type"); - final String countSql; - if("oracle".equals(dbName)){ - countSql = "select count(1) from (" + sql + ") tmp_count"; - }else{ - countSql = "select count(1) from (" + removeOrders(sql) + ") tmp_count"; -// countSql = "select count(1) " + removeSelect(removeOrders(sql)); - } - Connection conn = connection; - PreparedStatement ps = null; - ResultSet rs = null; - try { - if (log.isDebugEnabled()) { - log.debug("COUNT SQL: " + StringUtils.replaceEach(countSql, new String[]{"\n","\t"}, new String[]{" "," "})); - } - if (conn == null){ - conn = mappedStatement.getConfiguration().getEnvironment().getDataSource().getConnection(); - } - ps = conn.prepareStatement(countSql); - BoundSql countBS = new BoundSql(mappedStatement.getConfiguration(), countSql, - boundSql.getParameterMappings(), parameterObject); - //解决MyBatis 分页foreach 参数失效 start - if (Reflections.getFieldValue(boundSql, "metaParameters") != null) { - MetaObject mo = (MetaObject) Reflections.getFieldValue(boundSql, "metaParameters"); - Reflections.setFieldValue(countBS, "metaParameters", mo); - } - //解决MyBatis 分页foreach 参数失效 end - SQLHelper.setParameters(ps, mappedStatement, countBS, parameterObject); - rs = ps.executeQuery(); - int count = 0; - if (rs.next()) { - count = rs.getInt(1); - } - return count; - } finally { - if (rs != null) { - rs.close(); - } - if (ps != null) { - ps.close(); - } - if (conn != null) { - conn.close(); - } - } - } - - - /** - * 根据数据库方言,生成特定的分页sql - * @param sql Mapper中的Sql语句 - * @param page 分页对象 - * @param dialect 方言类型 - * @return 分页SQL - */ - public static String generatePageSql(String sql, Page page, Dialect dialect) { - if (dialect.supportsLimit()) { - return dialect.getLimitString(sql, page.getFirstResult(), page.getMaxResults()); - } else { - return sql; - } - } - - /** - * 去除qlString的select子句。 - * @param hql - * @return - */ - @SuppressWarnings("unused") - private static String removeSelect(String qlString){ - int beginPos = qlString.toLowerCase().indexOf("from"); - return qlString.substring(beginPos); - } - - /** - * 去除hql的orderBy子句。 - * @param hql - * @return - */ - @SuppressWarnings("unused") - private static String removeOrders(String qlString) { - Pattern p = Pattern.compile("order\\s*by[\\w|\\W|\\s|\\S]*", Pattern.CASE_INSENSITIVE); - Matcher m = p.matcher(qlString); - StringBuffer sb = new StringBuffer(); - while (m.find()) { - m.appendReplacement(sb, ""); - } - m.appendTail(sb); - return sb.toString(); - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.interceptor; + +import org.apache.ibatis.executor.ErrorContext; +import org.apache.ibatis.executor.ExecutorException; +import org.apache.ibatis.logging.Log; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.ParameterMapping; +import org.apache.ibatis.mapping.ParameterMode; +import org.apache.ibatis.reflection.MetaObject; +import org.apache.ibatis.reflection.property.PropertyTokenizer; +import org.apache.ibatis.scripting.xmltags.ForEachSqlNode; +import org.apache.ibatis.session.Configuration; +import org.apache.ibatis.type.TypeHandler; +import org.apache.ibatis.type.TypeHandlerRegistry; + +import com.thinkgem.jeesite.common.config.Global; +import com.thinkgem.jeesite.common.persistence.Page; +import com.thinkgem.jeesite.common.persistence.dialect.Dialect; +import com.thinkgem.jeesite.common.utils.Reflections; +import com.thinkgem.jeesite.common.utils.StringUtils; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * SQL工具类 + * @author poplar.yfyang / thinkgem + * @version 2013-8-28 + */ +public class SQLHelper { + + /** + * 对SQL参数(?)设值,参考org.apache.ibatis.executor.parameter.DefaultParameterHandler + * + * @param ps 表示预编译的 SQL 语句的对象。 + * @param mappedStatement MappedStatement + * @param boundSql SQL + * @param parameterObject 参数对象 + * @throws java.sql.SQLException 数据库异常 + */ + @SuppressWarnings("unchecked") + public static void setParameters(PreparedStatement ps, MappedStatement mappedStatement, BoundSql boundSql, Object parameterObject) throws SQLException { + ErrorContext.instance().activity("setting parameters").object(mappedStatement.getParameterMap().getId()); + List parameterMappings = boundSql.getParameterMappings(); + if (parameterMappings != null) { + Configuration configuration = mappedStatement.getConfiguration(); + TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry(); + MetaObject metaObject = parameterObject == null ? null : + configuration.newMetaObject(parameterObject); + for (int i = 0; i < parameterMappings.size(); i++) { + ParameterMapping parameterMapping = parameterMappings.get(i); + if (parameterMapping.getMode() != ParameterMode.OUT) { + Object value; + String propertyName = parameterMapping.getProperty(); + PropertyTokenizer prop = new PropertyTokenizer(propertyName); + if (parameterObject == null) { + value = null; + } else if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) { + value = parameterObject; + } else if (boundSql.hasAdditionalParameter(propertyName)) { + value = boundSql.getAdditionalParameter(propertyName); + } else if (propertyName.startsWith(ForEachSqlNode.ITEM_PREFIX) && boundSql.hasAdditionalParameter(prop.getName())) { + value = boundSql.getAdditionalParameter(prop.getName()); + if (value != null) { + value = configuration.newMetaObject(value).getValue(propertyName.substring(prop.getName().length())); + } + } else { + value = metaObject == null ? null : metaObject.getValue(propertyName); + } + @SuppressWarnings("rawtypes") + TypeHandler typeHandler = parameterMapping.getTypeHandler(); + if (typeHandler == null) { + throw new ExecutorException("There was no TypeHandler found for parameter " + propertyName + " of statement " + mappedStatement.getId()); + } + typeHandler.setParameter(ps, i + 1, value, parameterMapping.getJdbcType()); + } + } + } + } + + + /** + * 查询总纪录数 + * @param sql SQL语句 + * @param connection 数据库连接 + * @param mappedStatement mapped + * @param parameterObject 参数 + * @param boundSql boundSql + * @return 总记录数 + * @throws SQLException sql查询错误 + */ + public static int getCount(final String sql, final Connection connection, + final MappedStatement mappedStatement, final Object parameterObject, + final BoundSql boundSql, Log log) throws SQLException { + String dbName = Global.getConfig("jdbc.type"); + final String countSql; + if("oracle".equals(dbName)){ + countSql = "select count(1) from (" + sql + ") tmp_count"; + }else{ + countSql = "select count(1) from (" + removeOrders(sql) + ") tmp_count"; +// countSql = "select count(1) " + removeSelect(removeOrders(sql)); + } + Connection conn = connection; + PreparedStatement ps = null; + ResultSet rs = null; + try { + if (log.isDebugEnabled()) { + log.debug("COUNT SQL: " + StringUtils.replaceEach(countSql, new String[]{"\n","\t"}, new String[]{" "," "})); + } + if (conn == null){ + conn = mappedStatement.getConfiguration().getEnvironment().getDataSource().getConnection(); + } + ps = conn.prepareStatement(countSql); + BoundSql countBS = new BoundSql(mappedStatement.getConfiguration(), countSql, + boundSql.getParameterMappings(), parameterObject); + //解决MyBatis 分页foreach 参数失效 start + if (Reflections.getFieldValue(boundSql, "metaParameters") != null) { + MetaObject mo = (MetaObject) Reflections.getFieldValue(boundSql, "metaParameters"); + Reflections.setFieldValue(countBS, "metaParameters", mo); + } + //解决MyBatis 分页foreach 参数失效 end + SQLHelper.setParameters(ps, mappedStatement, countBS, parameterObject); + rs = ps.executeQuery(); + int count = 0; + if (rs.next()) { + count = rs.getInt(1); + } + return count; + } finally { + if (rs != null) { + rs.close(); + } + if (ps != null) { + ps.close(); + } + if (conn != null) { + conn.close(); + } + } + } + + + /** + * 根据数据库方言,生成特定的分页sql + * @param sql Mapper中的Sql语句 + * @param page 分页对象 + * @param dialect 方言类型 + * @return 分页SQL + */ + public static String generatePageSql(String sql, Page page, Dialect dialect) { + if (dialect.supportsLimit()) { + return dialect.getLimitString(sql, page.getFirstResult(), page.getMaxResults()); + } else { + return sql; + } + } + + /** + * 去除qlString的select子句。 + * @param hql + * @return + */ + @SuppressWarnings("unused") + private static String removeSelect(String qlString){ + int beginPos = qlString.toLowerCase().indexOf("from"); + return qlString.substring(beginPos); + } + + /** + * 去除hql的orderBy子句。 + * @param hql + * @return + */ + @SuppressWarnings("unused") + private static String removeOrders(String qlString) { + Pattern p = Pattern.compile("order\\s*by[\\w|\\W|\\s|\\S]*", Pattern.CASE_INSENSITIVE); + Matcher m = p.matcher(qlString); + StringBuffer sb = new StringBuffer(); + while (m.find()) { + m.appendReplacement(sb, ""); + } + m.appendTail(sb); + return sb.toString(); + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PageConfiguration.java b/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PageConfiguration.java index 21738e02f6..9c9e081c0e 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PageConfiguration.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PageConfiguration.java @@ -1,37 +1,37 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.proxy; - -import org.apache.ibatis.binding.MapperRegistry; -import org.apache.ibatis.session.Configuration; -import org.apache.ibatis.session.SqlSession; - -/** - *

- * 自定义Mybatis的配置,扩展. - *

- * - * @author poplar.yfyang - * @version 1.0 2012-05-13 上午10:06 - * @since JDK 1.5 - */ -public class PageConfiguration extends Configuration { - - protected MapperRegistry mapperRegistry = new PaginationMapperRegistry(this); - - @Override - public void addMapper(Class type) { - mapperRegistry.addMapper(type); - } - - @Override - public T getMapper(Class type, SqlSession sqlSession) { - return mapperRegistry.getMapper(type, sqlSession); - } - - @Override - public boolean hasMapper(Class type) { - return mapperRegistry.hasMapper(type); - } -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.proxy; + +import org.apache.ibatis.binding.MapperRegistry; +import org.apache.ibatis.session.Configuration; +import org.apache.ibatis.session.SqlSession; + +/** + *

+ * 自定义Mybatis的配置,扩展. + *

+ * + * @author poplar.yfyang + * @version 1.0 2012-05-13 上午10:06 + * @since JDK 1.5 + */ +public class PageConfiguration extends Configuration { + + protected MapperRegistry mapperRegistry = new PaginationMapperRegistry(this); + + @Override + public void addMapper(Class type) { + mapperRegistry.addMapper(type); + } + + @Override + public T getMapper(Class type, SqlSession sqlSession) { + return mapperRegistry.getMapper(type, sqlSession); + } + + @Override + public boolean hasMapper(Class type) { + return mapperRegistry.hasMapper(type); + } +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperMethod.java b/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperMethod.java index 17fcb75faf..d7f24569fc 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperMethod.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperMethod.java @@ -1,191 +1,191 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.common.persistence.proxy; - -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.binding.BindingException; -import org.apache.ibatis.mapping.MappedStatement; -import org.apache.ibatis.mapping.SqlCommandType; -import org.apache.ibatis.session.Configuration; -import org.apache.ibatis.session.RowBounds; -import org.apache.ibatis.session.SqlSession; - -import com.thinkgem.jeesite.common.persistence.Page; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - *

- * 执行代理类,扩展Mybatis的方式来让其Mapper接口来支持. - *

- * - * @author poplar.yfyang - * @version 1.0 2012-05-13 上午10:09 - * @since JDK 1.5 - */ -public class PaginationMapperMethod { - - private final SqlSession sqlSession; - private final Configuration config; - - private SqlCommandType type; - private String commandName; - private String commandCountName; - - private final Class declaringInterface; - private final Method method; - - private Integer rowBoundsIndex; - private Integer paginationIndex; - - private final List paramNames; - private final List paramPositions; - - private boolean hasNamedParameters; - - public PaginationMapperMethod(Class declaringInterface, Method method, - SqlSession sqlSession) { - paramNames = new ArrayList(); - paramPositions = new ArrayList(); - this.sqlSession = sqlSession; - this.method = method; - this.config = sqlSession.getConfiguration(); - this.declaringInterface = declaringInterface; - this.hasNamedParameters = false; - setupFields(); - setupMethodSignature(); - setupCommandType(); - validateStatement(); - } - - /** - * 代理执行方法。 - * - * @param args 参数信息 - * @return 执行结果 - */ - @SuppressWarnings("unchecked") - public Object execute(Object[] args) { - final Object param = getParam(args); - Page page; - RowBounds rowBounds; - if (paginationIndex != null) { - page = (Page) args[paginationIndex]; - rowBounds = new RowBounds(page.getFirstResult(), page.getMaxResults()); - } else if (rowBoundsIndex != null) { - rowBounds = (RowBounds) args[rowBoundsIndex]; - page = new Page(); - } else { - throw new BindingException("Invalid bound statement (not found rowBounds or pagination in paramenters)"); - } - page.setCount(executeForCount(param)); - page.setList(executeForList(param, rowBounds)); - return page; - } - - /** - * 执行总数的方法,调用方法执行计算总数,取得总结果 - * - * @param param 参数信息 - * @return 查询的总记录数 - */ - private long executeForCount(Object param) { - Number result = (Number) sqlSession.selectOne(commandCountName, param); - return result.longValue(); - } - - /** - * 取得分页的执行结果,返回的是纪录信息 - * - * @param param 参数 - * @param rowBounds row - * @return 纪录列表 - */ - private List executeForList(Object param, RowBounds rowBounds) { - return sqlSession.selectList(commandName, param, rowBounds); - } - - /** - * 取得当前执行的参数信息 - * - * @param args 参数 - * @return 参数信息 - */ - private Object getParam(Object[] args) { - final int paramCount = paramPositions.size(); - if (args == null || paramCount == 0) { - return null; - } else if (!hasNamedParameters && paramCount == 1) { - return args[paramPositions.get(0)]; - } else { - Map param = new HashMap(); - for (int i = 0; i < paramCount; i++) { - param.put(paramNames.get(i), args[paramPositions.get(i)]); - } - return param; - } - } - - private void setupMethodSignature() { - final Class[] argTypes = method.getParameterTypes(); - for (int i = 0; i < argTypes.length; i++) { - if (Page.class.isAssignableFrom(argTypes[i])) { - paginationIndex = i; - } else if (RowBounds.class.isAssignableFrom(argTypes[i])) { - rowBoundsIndex = i; - } else { - String paramName = String.valueOf(paramPositions.size()); - paramName = getParamNameFromAnnotation(i, paramName); - paramNames.add(paramName); - paramPositions.add(i); - } - } - } - - private String getParamNameFromAnnotation(int i, String paramName) { - Object[] annotations = method.getParameterAnnotations()[i]; - for (Object annotation : annotations) { - if (annotation instanceof Param) { - hasNamedParameters = true; - paramName = ((Param) annotation).value(); - } - } - return paramName; - } - - /** - * 设置当前的查询总记录数的ID - */ - private void setupFields() { - commandName = declaringInterface.getName() + "." + method.getName(); - commandCountName = commandName + "Count"; // 命名约定 - } - - /** - * 设置当前的参数的类型信息 - */ - private void setupCommandType() { - MappedStatement ms = config.getMappedStatement(commandName); - type = ms.getSqlCommandType(); - if (type != SqlCommandType.SELECT) { - throw new BindingException("Unsupport execution method for: " + commandName); - } - } - - /** - * 验证Statement - */ - private void validateStatement() { - if (!config.hasStatement(commandName)) { - throw new BindingException("Invalid bound statement (not found): " + commandName); - } - if (!config.hasStatement(commandCountName)) { - throw new BindingException("Invalid bound statement (not found): " + commandCountName); - } - } -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.common.persistence.proxy; + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.binding.BindingException; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.SqlCommandType; +import org.apache.ibatis.session.Configuration; +import org.apache.ibatis.session.RowBounds; +import org.apache.ibatis.session.SqlSession; + +import com.thinkgem.jeesite.common.persistence.Page; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + *

+ * 执行代理类,扩展Mybatis的方式来让其Mapper接口来支持. + *

+ * + * @author poplar.yfyang + * @version 1.0 2012-05-13 上午10:09 + * @since JDK 1.5 + */ +public class PaginationMapperMethod { + + private final SqlSession sqlSession; + private final Configuration config; + + private SqlCommandType type; + private String commandName; + private String commandCountName; + + private final Class declaringInterface; + private final Method method; + + private Integer rowBoundsIndex; + private Integer paginationIndex; + + private final List paramNames; + private final List paramPositions; + + private boolean hasNamedParameters; + + public PaginationMapperMethod(Class declaringInterface, Method method, + SqlSession sqlSession) { + paramNames = new ArrayList(); + paramPositions = new ArrayList(); + this.sqlSession = sqlSession; + this.method = method; + this.config = sqlSession.getConfiguration(); + this.declaringInterface = declaringInterface; + this.hasNamedParameters = false; + setupFields(); + setupMethodSignature(); + setupCommandType(); + validateStatement(); + } + + /** + * 代理执行方法。 + * + * @param args 参数信息 + * @return 执行结果 + */ + @SuppressWarnings("unchecked") + public Object execute(Object[] args) { + final Object param = getParam(args); + Page page; + RowBounds rowBounds; + if (paginationIndex != null) { + page = (Page) args[paginationIndex]; + rowBounds = new RowBounds(page.getFirstResult(), page.getMaxResults()); + } else if (rowBoundsIndex != null) { + rowBounds = (RowBounds) args[rowBoundsIndex]; + page = new Page(); + } else { + throw new BindingException("Invalid bound statement (not found rowBounds or pagination in paramenters)"); + } + page.setCount(executeForCount(param)); + page.setList(executeForList(param, rowBounds)); + return page; + } + + /** + * 执行总数的方法,调用方法执行计算总数,取得总结果 + * + * @param param 参数信息 + * @return 查询的总记录数 + */ + private long executeForCount(Object param) { + Number result = (Number) sqlSession.selectOne(commandCountName, param); + return result.longValue(); + } + + /** + * 取得分页的执行结果,返回的是纪录信息 + * + * @param param 参数 + * @param rowBounds row + * @return 纪录列表 + */ + private List executeForList(Object param, RowBounds rowBounds) { + return sqlSession.selectList(commandName, param, rowBounds); + } + + /** + * 取得当前执行的参数信息 + * + * @param args 参数 + * @return 参数信息 + */ + private Object getParam(Object[] args) { + final int paramCount = paramPositions.size(); + if (args == null || paramCount == 0) { + return null; + } else if (!hasNamedParameters && paramCount == 1) { + return args[paramPositions.get(0)]; + } else { + Map param = new HashMap(); + for (int i = 0; i < paramCount; i++) { + param.put(paramNames.get(i), args[paramPositions.get(i)]); + } + return param; + } + } + + private void setupMethodSignature() { + final Class[] argTypes = method.getParameterTypes(); + for (int i = 0; i < argTypes.length; i++) { + if (Page.class.isAssignableFrom(argTypes[i])) { + paginationIndex = i; + } else if (RowBounds.class.isAssignableFrom(argTypes[i])) { + rowBoundsIndex = i; + } else { + String paramName = String.valueOf(paramPositions.size()); + paramName = getParamNameFromAnnotation(i, paramName); + paramNames.add(paramName); + paramPositions.add(i); + } + } + } + + private String getParamNameFromAnnotation(int i, String paramName) { + Object[] annotations = method.getParameterAnnotations()[i]; + for (Object annotation : annotations) { + if (annotation instanceof Param) { + hasNamedParameters = true; + paramName = ((Param) annotation).value(); + } + } + return paramName; + } + + /** + * 设置当前的查询总记录数的ID + */ + private void setupFields() { + commandName = declaringInterface.getName() + "." + method.getName(); + commandCountName = commandName + "Count"; // 命名约定 + } + + /** + * 设置当前的参数的类型信息 + */ + private void setupCommandType() { + MappedStatement ms = config.getMappedStatement(commandName); + type = ms.getSqlCommandType(); + if (type != SqlCommandType.SELECT) { + throw new BindingException("Unsupport execution method for: " + commandName); + } + } + + /** + * 验证Statement + */ + private void validateStatement() { + if (!config.hasStatement(commandName)) { + throw new BindingException("Invalid bound statement (not found): " + commandName); + } + if (!config.hasStatement(commandCountName)) { + throw new BindingException("Invalid bound statement (not found): " + commandCountName); + } + } +} diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperProxy.java b/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperProxy.java index c386e6799e..63278c7c34 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperProxy.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperProxy.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence.proxy; diff --git a/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperRegistry.java b/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperRegistry.java index fbb7552e4b..c9b4765df9 100644 --- a/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperRegistry.java +++ b/src/main/java/com/thinkgem/jeesite/common/persistence/proxy/PaginationMapperRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.persistence.proxy; diff --git a/src/main/java/com/thinkgem/jeesite/common/security/shiro/HasAnyPermissionsTag.java b/src/main/java/com/thinkgem/jeesite/common/security/shiro/HasAnyPermissionsTag.java index 5195f90ca1..9e5669bc1a 100644 --- a/src/main/java/com/thinkgem/jeesite/common/security/shiro/HasAnyPermissionsTag.java +++ b/src/main/java/com/thinkgem/jeesite/common/security/shiro/HasAnyPermissionsTag.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.security.shiro; diff --git a/src/main/java/com/thinkgem/jeesite/common/security/shiro/cache/JedisCacheManager.java b/src/main/java/com/thinkgem/jeesite/common/security/shiro/cache/JedisCacheManager.java index 08b0c4b5c3..030b3c67a3 100644 --- a/src/main/java/com/thinkgem/jeesite/common/security/shiro/cache/JedisCacheManager.java +++ b/src/main/java/com/thinkgem/jeesite/common/security/shiro/cache/JedisCacheManager.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.security.shiro.cache; diff --git a/src/main/java/com/thinkgem/jeesite/common/security/shiro/cache/SessionCacheManager.java b/src/main/java/com/thinkgem/jeesite/common/security/shiro/cache/SessionCacheManager.java index 453e1cc99f..2b21a3a3b6 100644 --- a/src/main/java/com/thinkgem/jeesite/common/security/shiro/cache/SessionCacheManager.java +++ b/src/main/java/com/thinkgem/jeesite/common/security/shiro/cache/SessionCacheManager.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.security.shiro.cache; diff --git a/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/CacheSessionDAO.java b/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/CacheSessionDAO.java index 8aadfbcfd0..bafc3d2799 100644 --- a/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/CacheSessionDAO.java +++ b/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/CacheSessionDAO.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.security.shiro.session; diff --git a/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/JedisSessionDAO.java b/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/JedisSessionDAO.java index 6ce1e8bce5..af2798ac37 100644 --- a/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/JedisSessionDAO.java +++ b/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/JedisSessionDAO.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.security.shiro.session; diff --git a/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/SessionManager.java b/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/SessionManager.java index 7b4bf0aa24..473d398d2b 100644 --- a/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/SessionManager.java +++ b/src/main/java/com/thinkgem/jeesite/common/security/shiro/session/SessionManager.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.security.shiro.session; diff --git a/src/main/java/com/thinkgem/jeesite/common/service/BaseService.java b/src/main/java/com/thinkgem/jeesite/common/service/BaseService.java index cca9372774..2439a92465 100644 --- a/src/main/java/com/thinkgem/jeesite/common/service/BaseService.java +++ b/src/main/java/com/thinkgem/jeesite/common/service/BaseService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.service; diff --git a/src/main/java/com/thinkgem/jeesite/common/service/CrudService.java b/src/main/java/com/thinkgem/jeesite/common/service/CrudService.java index 047e7ade47..8f908b52ec 100644 --- a/src/main/java/com/thinkgem/jeesite/common/service/CrudService.java +++ b/src/main/java/com/thinkgem/jeesite/common/service/CrudService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.service; diff --git a/src/main/java/com/thinkgem/jeesite/common/service/ServiceException.java b/src/main/java/com/thinkgem/jeesite/common/service/ServiceException.java index f57f2ab4da..30f403c0df 100644 --- a/src/main/java/com/thinkgem/jeesite/common/service/ServiceException.java +++ b/src/main/java/com/thinkgem/jeesite/common/service/ServiceException.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.service; diff --git a/src/main/java/com/thinkgem/jeesite/common/service/TreeService.java b/src/main/java/com/thinkgem/jeesite/common/service/TreeService.java index 1759781e91..5fc4c8cc68 100644 --- a/src/main/java/com/thinkgem/jeesite/common/service/TreeService.java +++ b/src/main/java/com/thinkgem/jeesite/common/service/TreeService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.service; diff --git a/src/main/java/com/thinkgem/jeesite/common/servlet/ValidateCodeServlet.java b/src/main/java/com/thinkgem/jeesite/common/servlet/ValidateCodeServlet.java index 18902d2b67..61d65b1a6f 100644 --- a/src/main/java/com/thinkgem/jeesite/common/servlet/ValidateCodeServlet.java +++ b/src/main/java/com/thinkgem/jeesite/common/servlet/ValidateCodeServlet.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.servlet; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/SupcanController.java b/src/main/java/com/thinkgem/jeesite/common/supcan/SupcanController.java index c5cf323632..80f2c0499e 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/SupcanController.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/SupcanController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/fonts/SupFont.java b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/fonts/SupFont.java index ac837d63ca..81493b1e09 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/fonts/SupFont.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/fonts/SupFont.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.annotation.common.fonts; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupBackground.java b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupBackground.java index a9c1f53c1f..d6e76461f0 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupBackground.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupBackground.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.annotation.common.properties; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupExpress.java b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupExpress.java index c9ed1ab842..8aab90874a 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupExpress.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupExpress.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.annotation.common.properties; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupProperties.java b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupProperties.java index 4992cd8c46..ebfaa2d989 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupProperties.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/common/properties/SupProperties.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.annotation.common.properties; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/SupTreeList.java b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/SupTreeList.java index f9ec94e4b5..ec6f4341bd 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/SupTreeList.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/SupTreeList.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.annotation.treelist; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/cols/SupCol.java b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/cols/SupCol.java index 56dabc86de..f30ab63d86 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/cols/SupCol.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/cols/SupCol.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.annotation.treelist.cols; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/cols/SupGroup.java b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/cols/SupGroup.java index e28cfbf2ab..5f027894da 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/cols/SupGroup.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/annotation/treelist/cols/SupGroup.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.annotation.treelist.cols; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/common/Common.java b/src/main/java/com/thinkgem/jeesite/common/supcan/common/Common.java index f2aa4b7264..3e7c52a169 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/common/Common.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/common/Common.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.common; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/common/fonts/Font.java b/src/main/java/com/thinkgem/jeesite/common/supcan/common/fonts/Font.java index 8e214e2c9d..82b377e890 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/common/fonts/Font.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/common/fonts/Font.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.common.fonts; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Background.java b/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Background.java index 133de2d1cb..e7f42b9568 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Background.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Background.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.common.properties; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Express.java b/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Express.java index e281922424..a4ec8bd8f5 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Express.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Express.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.common.properties; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Properties.java b/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Properties.java index fb95139090..dd5a698797 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Properties.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/common/properties/Properties.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.common.properties; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/freeform/FreeForm.java b/src/main/java/com/thinkgem/jeesite/common/supcan/freeform/FreeForm.java index d27615b9b1..f0cb6d40da 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/freeform/FreeForm.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/freeform/FreeForm.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.freeform; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/TreeList.java b/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/TreeList.java index f91660684b..2549b26c81 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/TreeList.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/TreeList.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.treelist; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/cols/Col.java b/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/cols/Col.java index 4e664a749c..0326fcace4 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/cols/Col.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/cols/Col.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.treelist.cols; diff --git a/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/cols/Group.java b/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/cols/Group.java index e207386369..0a7d4501c7 100644 --- a/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/cols/Group.java +++ b/src/main/java/com/thinkgem/jeesite/common/supcan/treelist/cols/Group.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.supcan.treelist.cols; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/CacheUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/CacheUtils.java index b5aa49f391..4498d2105b 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/CacheUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/CacheUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/CookieUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/CookieUtils.java index a55a91ff7b..ec16610e76 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/CookieUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/CookieUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/DateUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/DateUtils.java index 3b9a14d4ae..95c73b3626 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/DateUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/DateUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/EhCacheUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/EhCacheUtils.java index 38e5f28f1e..93d44c710c 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/EhCacheUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/EhCacheUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/FileUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/FileUtils.java index 4db1ba9943..bcc75a03fb 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/FileUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/FileUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/FreeMarkers.java b/src/main/java/com/thinkgem/jeesite/common/utils/FreeMarkers.java index 32d5a5caf4..82c01a5a84 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/FreeMarkers.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/FreeMarkers.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/IdGen.java b/src/main/java/com/thinkgem/jeesite/common/utils/IdGen.java index 0492ab7aee..a55223df99 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/IdGen.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/IdGen.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/JedisUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/JedisUtils.java index 936c13c36b..edb63b904e 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/JedisUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/JedisUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/MacUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/MacUtils.java index 72605770b0..e22c3fd487 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/MacUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/MacUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/ObjectUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/ObjectUtils.java index 070a8998ef..3b7454965f 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/ObjectUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/ObjectUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/SendMailUtil.java b/src/main/java/com/thinkgem/jeesite/common/utils/SendMailUtil.java index e21d75a8c3..edbda16a12 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/SendMailUtil.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/SendMailUtil.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/SpringContextHolder.java b/src/main/java/com/thinkgem/jeesite/common/utils/SpringContextHolder.java index 15b1c90de3..2f1594af0d 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/SpringContextHolder.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/SpringContextHolder.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/StreamUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/StreamUtils.java index 15dd9fa74c..151fde20e2 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/StreamUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/StreamUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/StringUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/StringUtils.java index bae2d59273..c255ab8d63 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/StringUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/StringUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/SystemPath.java b/src/main/java/com/thinkgem/jeesite/common/utils/SystemPath.java index 9f5228bb71..af91471a27 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/SystemPath.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/SystemPath.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/TimeUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/TimeUtils.java index 6e2812030e..5cf9bd84b5 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/TimeUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/TimeUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/UserAgentUtils.java b/src/main/java/com/thinkgem/jeesite/common/utils/UserAgentUtils.java index 8a8af14b05..4b089c3679 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/UserAgentUtils.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/UserAgentUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/excel/ExportExcel.java b/src/main/java/com/thinkgem/jeesite/common/utils/excel/ExportExcel.java index 620a45b1ad..bb1ff6d3fa 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/excel/ExportExcel.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/excel/ExportExcel.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils.excel; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/excel/ImportExcel.java b/src/main/java/com/thinkgem/jeesite/common/utils/excel/ImportExcel.java index 91a27a9e62..d6a54a95d6 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/excel/ImportExcel.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/excel/ImportExcel.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils.excel; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/excel/annotation/ExcelField.java b/src/main/java/com/thinkgem/jeesite/common/utils/excel/annotation/ExcelField.java index 13817fbf9f..f075505716 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/excel/annotation/ExcelField.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/excel/annotation/ExcelField.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils.excel.annotation; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/AreaType.java b/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/AreaType.java index aab31fb292..492f9c86fd 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/AreaType.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/AreaType.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils.excel.fieldtype; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/OfficeType.java b/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/OfficeType.java index 77daedaebe..a5c4a38816 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/OfficeType.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/OfficeType.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils.excel.fieldtype; diff --git a/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/RoleListType.java b/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/RoleListType.java index 945a570e60..d23284e681 100644 --- a/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/RoleListType.java +++ b/src/main/java/com/thinkgem/jeesite/common/utils/excel/fieldtype/RoleListType.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.utils.excel.fieldtype; diff --git a/src/main/java/com/thinkgem/jeesite/common/web/BaseController.java b/src/main/java/com/thinkgem/jeesite/common/web/BaseController.java index 499810c11f..ed49b64004 100644 --- a/src/main/java/com/thinkgem/jeesite/common/web/BaseController.java +++ b/src/main/java/com/thinkgem/jeesite/common/web/BaseController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.web; diff --git a/src/main/java/com/thinkgem/jeesite/common/web/CKFinderConfig.java b/src/main/java/com/thinkgem/jeesite/common/web/CKFinderConfig.java index 1009651358..871a0fb531 100644 --- a/src/main/java/com/thinkgem/jeesite/common/web/CKFinderConfig.java +++ b/src/main/java/com/thinkgem/jeesite/common/web/CKFinderConfig.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.web; diff --git a/src/main/java/com/thinkgem/jeesite/common/web/CKFinderConnectorServlet.java b/src/main/java/com/thinkgem/jeesite/common/web/CKFinderConnectorServlet.java index 638444192f..b3451951bb 100644 --- a/src/main/java/com/thinkgem/jeesite/common/web/CKFinderConnectorServlet.java +++ b/src/main/java/com/thinkgem/jeesite/common/web/CKFinderConnectorServlet.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.common.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/dao/ActDao.java b/src/main/java/com/thinkgem/jeesite/modules/act/dao/ActDao.java index 5ea969454e..8afd2ede8b 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/dao/ActDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/dao/ActDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/entity/Act.java b/src/main/java/com/thinkgem/jeesite/modules/act/entity/Act.java index 119ff85ba5..3d674d4d7f 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/entity/Act.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/entity/Act.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/service/ActModelService.java b/src/main/java/com/thinkgem/jeesite/modules/act/service/ActModelService.java index ef4f39e53f..6c64c3ca83 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/service/ActModelService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/service/ActModelService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/service/ActProcessService.java b/src/main/java/com/thinkgem/jeesite/modules/act/service/ActProcessService.java index f0380012e4..2db8f52d66 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/service/ActProcessService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/service/ActProcessService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java b/src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java index e7a28a2b07..86f11f65fa 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActGroupEntityService.java b/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActGroupEntityService.java index d0c446a28e..63ec57ae8e 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActGroupEntityService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActGroupEntityService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.service.ext; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActGroupEntityServiceFactory.java b/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActGroupEntityServiceFactory.java index b2d496599e..ffe18eaf00 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActGroupEntityServiceFactory.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActGroupEntityServiceFactory.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.service.ext; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActUserEntityService.java b/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActUserEntityService.java index 78f2db2380..47efa6e243 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActUserEntityService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActUserEntityService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.service.ext; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActUserEntityServiceFactory.java b/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActUserEntityServiceFactory.java index 982b5a7907..f1b51ce10d 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActUserEntityServiceFactory.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/service/ext/ActUserEntityServiceFactory.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.service.ext; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/utils/ActUtils.java b/src/main/java/com/thinkgem/jeesite/modules/act/utils/ActUtils.java index 0500d2748a..1b9a0ea716 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/utils/ActUtils.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/utils/ActUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/utils/DateConverter.java b/src/main/java/com/thinkgem/jeesite/modules/act/utils/DateConverter.java index 6b34b45f3a..b0fad93709 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/utils/DateConverter.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/utils/DateConverter.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/utils/ProcessDefCache.java b/src/main/java/com/thinkgem/jeesite/modules/act/utils/ProcessDefCache.java index 5bf07b2dbc..0b39d2d147 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/utils/ProcessDefCache.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/utils/ProcessDefCache.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/utils/PropertyType.java b/src/main/java/com/thinkgem/jeesite/modules/act/utils/PropertyType.java index ad177a01f8..e6218acc6a 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/utils/PropertyType.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/utils/PropertyType.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/utils/Variable.java b/src/main/java/com/thinkgem/jeesite/modules/act/utils/Variable.java index 44d20ad18d..6dbc1d0676 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/utils/Variable.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/utils/Variable.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/web/ActModelController.java b/src/main/java/com/thinkgem/jeesite/modules/act/web/ActModelController.java index 1e9380067f..0f67f8b730 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/web/ActModelController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/web/ActModelController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/web/ActProcessController.java b/src/main/java/com/thinkgem/jeesite/modules/act/web/ActProcessController.java index b5d032b357..55adb4864c 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/web/ActProcessController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/web/ActProcessController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/act/web/ActTaskController.java b/src/main/java/com/thinkgem/jeesite/modules/act/web/ActTaskController.java index 5b5b74c658..04a806ec41 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/act/web/ActTaskController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/act/web/ActTaskController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.act.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/ArticleDao.java b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/ArticleDao.java index caba1815bf..e4231e40b6 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/ArticleDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/ArticleDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/ArticleDataDao.java b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/ArticleDataDao.java index e19ef39bf1..1a8be18d45 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/ArticleDataDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/ArticleDataDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/CategoryDao.java b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/CategoryDao.java index aec108617c..9c4c07ac64 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/CategoryDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/CategoryDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/CommentDao.java b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/CommentDao.java index 7c6c502e3f..7c18f4ca0c 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/CommentDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/CommentDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/GuestbookDao.java b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/GuestbookDao.java index f7a7065958..04977ed584 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/GuestbookDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/GuestbookDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/LinkDao.java b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/LinkDao.java index e735fbeeec..8ed4dbb4eb 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/LinkDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/LinkDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/SiteDao.java b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/SiteDao.java index 37df1b74e0..c942715c94 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/dao/SiteDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/dao/SiteDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Article.java b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Article.java index 35d8a49dca..d68788d9bc 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Article.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Article.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/ArticleData.java b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/ArticleData.java index b3a7d763ff..02107a8016 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/ArticleData.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/ArticleData.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Category.java b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Category.java index 63b3eaebe6..af82060c61 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Category.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Category.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Comment.java b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Comment.java index 7ceed99996..59a5445601 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Comment.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Comment.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Guestbook.java b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Guestbook.java index b722a63ce3..d4df4d15c6 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Guestbook.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Guestbook.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Site.java b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Site.java index f4ad2f7e05..1611b3272c 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Site.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/entity/Site.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/service/ArticleDataService.java b/src/main/java/com/thinkgem/jeesite/modules/cms/service/ArticleDataService.java index 2d6ab6b101..7e078e7f6c 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/service/ArticleDataService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/service/ArticleDataService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/service/ArticleService.java b/src/main/java/com/thinkgem/jeesite/modules/cms/service/ArticleService.java index 7f3ba7642f..380acf0786 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/service/ArticleService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/service/ArticleService.java @@ -1,197 +1,197 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.modules.cms.service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.google.common.collect.Lists; -import com.thinkgem.jeesite.common.config.Global; -import com.thinkgem.jeesite.common.persistence.Page; -import com.thinkgem.jeesite.common.service.CrudService; -import com.thinkgem.jeesite.common.utils.CacheUtils; -import com.thinkgem.jeesite.common.utils.StringUtils; -import com.thinkgem.jeesite.modules.cms.dao.ArticleDao; -import com.thinkgem.jeesite.modules.cms.dao.ArticleDataDao; -import com.thinkgem.jeesite.modules.cms.dao.CategoryDao; -import com.thinkgem.jeesite.modules.cms.entity.Article; -import com.thinkgem.jeesite.modules.cms.entity.ArticleData; -import com.thinkgem.jeesite.modules.cms.entity.Category; -import com.thinkgem.jeesite.modules.sys.utils.UserUtils; - -/** - * 文章Service - * @author ThinkGem - * @version 2013-05-15 - */ -@Service -@Transactional(readOnly = true) -public class ArticleService extends CrudService { - - @Autowired - private ArticleDataDao articleDataDao; - @Autowired - private CategoryDao categoryDao; - - @Transactional(readOnly = false) - public Page
findPage(Page
page, Article article, boolean isDataScopeFilter) { - // 更新过期的权重,间隔为“6”个小时 - Date updateExpiredWeightDate = (Date)CacheUtils.get("updateExpiredWeightDateByArticle"); - if (updateExpiredWeightDate == null || (updateExpiredWeightDate != null - && updateExpiredWeightDate.getTime() < new Date().getTime())){ - dao.updateExpiredWeight(article); - CacheUtils.put("updateExpiredWeightDateByArticle", DateUtils.addHours(new Date(), 6)); - } -// DetachedCriteria dc = dao.createDetachedCriteria(); -// dc.createAlias("category", "category"); -// dc.createAlias("category.site", "category.site"); - if (article.getCategory()!=null && StringUtils.isNotBlank(article.getCategory().getId()) && !Category.isRoot(article.getCategory().getId())){ - Category category = categoryDao.get(article.getCategory().getId()); - if (category==null){ - category = new Category(); - } - category.setParentIds(category.getId()); - category.setSite(category.getSite()); - article.setCategory(category); - } - else{ - article.setCategory(new Category()); - } -// if (StringUtils.isBlank(page.getOrderBy())){ -// page.setOrderBy("a.weight,a.update_date desc"); -// } -// return dao.find(page, dc); - // article.getSqlMap().put("dsf", dataScopeFilter(article.getCurrentUser(), "o", "u")); - return super.findPage(page, article); - - } - - @Transactional(readOnly = false) - public void save(Article article) { - if (article.getArticleData().getContent()!=null){ - article.getArticleData().setContent(StringEscapeUtils.unescapeHtml4( - article.getArticleData().getContent())); - } - // 如果没有审核权限,则将当前内容改为待审核状态 - if (!UserUtils.getSubject().isPermitted("cms:article:audit")){ - article.setDelFlag(Article.DEL_FLAG_AUDIT); - } - // 如果栏目不需要审核,则将该内容设为发布状态 - if (article.getCategory()!=null&&StringUtils.isNotBlank(article.getCategory().getId())){ - Category category = categoryDao.get(article.getCategory().getId()); - if (!Global.YES.equals(category.getIsAudit())){ - article.setDelFlag(Article.DEL_FLAG_NORMAL); - } - } - article.setUpdateBy(UserUtils.getUser()); - article.setUpdateDate(new Date()); - if (StringUtils.isNotBlank(article.getViewConfig())){ - article.setViewConfig(StringEscapeUtils.unescapeHtml4(article.getViewConfig())); - } - - ArticleData articleData = new ArticleData();; - if (StringUtils.isBlank(article.getId())){ - article.preInsert(); - articleData = article.getArticleData(); - articleData.setId(article.getId()); - dao.insert(article); - articleDataDao.insert(articleData); - }else{ - article.preUpdate(); - articleData = article.getArticleData(); - articleData.setId(article.getId()); - dao.update(article); - articleDataDao.update(article.getArticleData()); - } - } - - @Transactional(readOnly = false) - public void delete(Article article, Boolean isRe) { -// dao.updateDelFlag(id, isRe!=null&&isRe?Article.DEL_FLAG_NORMAL:Article.DEL_FLAG_DELETE); - // 使用下面方法,以便更新索引。 - //Article article = dao.get(id); - //article.setDelFlag(isRe!=null&&isRe?Article.DEL_FLAG_NORMAL:Article.DEL_FLAG_DELETE); - //dao.insert(article); - super.delete(article); - } - - /** - * 通过编号获取内容标题 - * @return new Object[]{栏目Id,文章Id,文章标题} - */ - public List findByIds(String ids) { - if(ids == null){ - return new ArrayList(); - } - List list = Lists.newArrayList(); - String[] idss = StringUtils.split(ids,","); - Article e = null; - for(int i=0;(idss.length-i)>0;i++){ - e = dao.get(idss[i]); - list.add(new Object[]{e.getCategory().getId(),e.getId(),StringUtils.abbr(e.getTitle(),50)}); - } - return list; - } - - /** - * 点击数加一 - */ - @Transactional(readOnly = false) - public void updateHitsAddOne(String id) { - dao.updateHitsAddOne(id); - } - - /** - * 更新索引 - */ - public void createIndex(){ - //dao.createIndex(); - } - - /** - * 全文检索 - */ - //FIXME 暂不提供检索功能 - public Page
search(Page
page, String q, String categoryId, String beginDate, String endDate){ - - // 设置查询条件 -// BooleanQuery query = dao.getFullTextQuery(q, "title","keywords","description","articleData.content"); -// -// // 设置过滤条件 -// List bcList = Lists.newArrayList(); -// -// bcList.add(new BooleanClause(new TermQuery(new Term(Article.FIELD_DEL_FLAG, Article.DEL_FLAG_NORMAL)), Occur.MUST)); -// if (StringUtils.isNotBlank(categoryId)){ -// bcList.add(new BooleanClause(new TermQuery(new Term("category.ids", categoryId)), Occur.MUST)); -// } -// -// if (StringUtils.isNotBlank(beginDate) && StringUtils.isNotBlank(endDate)) { -// bcList.add(new BooleanClause(new TermRangeQuery("updateDate", beginDate.replaceAll("-", ""), -// endDate.replaceAll("-", ""), true, true), Occur.MUST)); -// } - - //BooleanQuery queryFilter = dao.getFullTextQuery((BooleanClause[])bcList.toArray(new BooleanClause[bcList.size()])); - -// System.out.println(queryFilter); - - // 设置排序(默认相识度排序) - //FIXME 暂时不提供lucene检索 - //Sort sort = null;//new Sort(new SortField("updateDate", SortField.DOC, true)); - // 全文检索 - //dao.search(page, query, queryFilter, sort); - // 关键字高亮 - //dao.keywordsHighlight(query, page.getList(), 30, "title"); - //dao.keywordsHighlight(query, page.getList(), 130, "description","articleData.content"); - - return page; - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.modules.cms.service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.lang3.time.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.google.common.collect.Lists; +import com.thinkgem.jeesite.common.config.Global; +import com.thinkgem.jeesite.common.persistence.Page; +import com.thinkgem.jeesite.common.service.CrudService; +import com.thinkgem.jeesite.common.utils.CacheUtils; +import com.thinkgem.jeesite.common.utils.StringUtils; +import com.thinkgem.jeesite.modules.cms.dao.ArticleDao; +import com.thinkgem.jeesite.modules.cms.dao.ArticleDataDao; +import com.thinkgem.jeesite.modules.cms.dao.CategoryDao; +import com.thinkgem.jeesite.modules.cms.entity.Article; +import com.thinkgem.jeesite.modules.cms.entity.ArticleData; +import com.thinkgem.jeesite.modules.cms.entity.Category; +import com.thinkgem.jeesite.modules.sys.utils.UserUtils; + +/** + * 文章Service + * @author ThinkGem + * @version 2013-05-15 + */ +@Service +@Transactional(readOnly = true) +public class ArticleService extends CrudService { + + @Autowired + private ArticleDataDao articleDataDao; + @Autowired + private CategoryDao categoryDao; + + @Transactional(readOnly = false) + public Page
findPage(Page
page, Article article, boolean isDataScopeFilter) { + // 更新过期的权重,间隔为“6”个小时 + Date updateExpiredWeightDate = (Date)CacheUtils.get("updateExpiredWeightDateByArticle"); + if (updateExpiredWeightDate == null || (updateExpiredWeightDate != null + && updateExpiredWeightDate.getTime() < new Date().getTime())){ + dao.updateExpiredWeight(article); + CacheUtils.put("updateExpiredWeightDateByArticle", DateUtils.addHours(new Date(), 6)); + } +// DetachedCriteria dc = dao.createDetachedCriteria(); +// dc.createAlias("category", "category"); +// dc.createAlias("category.site", "category.site"); + if (article.getCategory()!=null && StringUtils.isNotBlank(article.getCategory().getId()) && !Category.isRoot(article.getCategory().getId())){ + Category category = categoryDao.get(article.getCategory().getId()); + if (category==null){ + category = new Category(); + } + category.setParentIds(category.getId()); + category.setSite(category.getSite()); + article.setCategory(category); + } + else{ + article.setCategory(new Category()); + } +// if (StringUtils.isBlank(page.getOrderBy())){ +// page.setOrderBy("a.weight,a.update_date desc"); +// } +// return dao.find(page, dc); + // article.getSqlMap().put("dsf", dataScopeFilter(article.getCurrentUser(), "o", "u")); + return super.findPage(page, article); + + } + + @Transactional(readOnly = false) + public void save(Article article) { + if (article.getArticleData().getContent()!=null){ + article.getArticleData().setContent(StringEscapeUtils.unescapeHtml4( + article.getArticleData().getContent())); + } + // 如果没有审核权限,则将当前内容改为待审核状态 + if (!UserUtils.getSubject().isPermitted("cms:article:audit")){ + article.setDelFlag(Article.DEL_FLAG_AUDIT); + } + // 如果栏目不需要审核,则将该内容设为发布状态 + if (article.getCategory()!=null&&StringUtils.isNotBlank(article.getCategory().getId())){ + Category category = categoryDao.get(article.getCategory().getId()); + if (!Global.YES.equals(category.getIsAudit())){ + article.setDelFlag(Article.DEL_FLAG_NORMAL); + } + } + article.setUpdateBy(UserUtils.getUser()); + article.setUpdateDate(new Date()); + if (StringUtils.isNotBlank(article.getViewConfig())){ + article.setViewConfig(StringEscapeUtils.unescapeHtml4(article.getViewConfig())); + } + + ArticleData articleData = new ArticleData();; + if (StringUtils.isBlank(article.getId())){ + article.preInsert(); + articleData = article.getArticleData(); + articleData.setId(article.getId()); + dao.insert(article); + articleDataDao.insert(articleData); + }else{ + article.preUpdate(); + articleData = article.getArticleData(); + articleData.setId(article.getId()); + dao.update(article); + articleDataDao.update(article.getArticleData()); + } + } + + @Transactional(readOnly = false) + public void delete(Article article, Boolean isRe) { +// dao.updateDelFlag(id, isRe!=null&&isRe?Article.DEL_FLAG_NORMAL:Article.DEL_FLAG_DELETE); + // 使用下面方法,以便更新索引。 + //Article article = dao.get(id); + //article.setDelFlag(isRe!=null&&isRe?Article.DEL_FLAG_NORMAL:Article.DEL_FLAG_DELETE); + //dao.insert(article); + super.delete(article); + } + + /** + * 通过编号获取内容标题 + * @return new Object[]{栏目Id,文章Id,文章标题} + */ + public List findByIds(String ids) { + if(ids == null){ + return new ArrayList(); + } + List list = Lists.newArrayList(); + String[] idss = StringUtils.split(ids,","); + Article e = null; + for(int i=0;(idss.length-i)>0;i++){ + e = dao.get(idss[i]); + list.add(new Object[]{e.getCategory().getId(),e.getId(),StringUtils.abbr(e.getTitle(),50)}); + } + return list; + } + + /** + * 点击数加一 + */ + @Transactional(readOnly = false) + public void updateHitsAddOne(String id) { + dao.updateHitsAddOne(id); + } + + /** + * 更新索引 + */ + public void createIndex(){ + //dao.createIndex(); + } + + /** + * 全文检索 + */ + //FIXME 暂不提供检索功能 + public Page
search(Page
page, String q, String categoryId, String beginDate, String endDate){ + + // 设置查询条件 +// BooleanQuery query = dao.getFullTextQuery(q, "title","keywords","description","articleData.content"); +// +// // 设置过滤条件 +// List bcList = Lists.newArrayList(); +// +// bcList.add(new BooleanClause(new TermQuery(new Term(Article.FIELD_DEL_FLAG, Article.DEL_FLAG_NORMAL)), Occur.MUST)); +// if (StringUtils.isNotBlank(categoryId)){ +// bcList.add(new BooleanClause(new TermQuery(new Term("category.ids", categoryId)), Occur.MUST)); +// } +// +// if (StringUtils.isNotBlank(beginDate) && StringUtils.isNotBlank(endDate)) { +// bcList.add(new BooleanClause(new TermRangeQuery("updateDate", beginDate.replaceAll("-", ""), +// endDate.replaceAll("-", ""), true, true), Occur.MUST)); +// } + + //BooleanQuery queryFilter = dao.getFullTextQuery((BooleanClause[])bcList.toArray(new BooleanClause[bcList.size()])); + +// System.out.println(queryFilter); + + // 设置排序(默认相识度排序) + //FIXME 暂时不提供lucene检索 + //Sort sort = null;//new Sort(new SortField("updateDate", SortField.DOC, true)); + // 全文检索 + //dao.search(page, query, queryFilter, sort); + // 关键字高亮 + //dao.keywordsHighlight(query, page.getList(), 30, "title"); + //dao.keywordsHighlight(query, page.getList(), 130, "description","articleData.content"); + + return page; + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/service/CategoryService.java b/src/main/java/com/thinkgem/jeesite/modules/cms/service/CategoryService.java index 3227efa1c5..1027a3d9fa 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/service/CategoryService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/service/CategoryService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/service/CommentService.java b/src/main/java/com/thinkgem/jeesite/modules/cms/service/CommentService.java index 3e38bebc2c..58fa13e492 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/service/CommentService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/service/CommentService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/service/GuestbookService.java b/src/main/java/com/thinkgem/jeesite/modules/cms/service/GuestbookService.java index 2bb0bb26d5..d91ad325a4 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/service/GuestbookService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/service/GuestbookService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/service/LinkService.java b/src/main/java/com/thinkgem/jeesite/modules/cms/service/LinkService.java index d71700fcd2..1c9e2eec69 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/service/LinkService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/service/LinkService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/service/SiteService.java b/src/main/java/com/thinkgem/jeesite/modules/cms/service/SiteService.java index 7abf9db6ad..1689bc0c69 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/service/SiteService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/service/SiteService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/service/StatsService.java b/src/main/java/com/thinkgem/jeesite/modules/cms/service/StatsService.java index 81837b8587..8dc1ad2dbf 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/service/StatsService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/service/StatsService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/utils/CmsUtils.java b/src/main/java/com/thinkgem/jeesite/modules/cms/utils/CmsUtils.java index b1bd6f8751..65a6d70155 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/utils/CmsUtils.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/utils/CmsUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/ArticleController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/ArticleController.java index 1c2626d7de..4e2b83a792 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/ArticleController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/ArticleController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/CategoryController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/CategoryController.java index 926347f0b3..fecf443698 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/CategoryController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/CategoryController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/CmsController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/CmsController.java index 77fc438556..1aa9159b46 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/CmsController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/CmsController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/CommentController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/CommentController.java index 19f1b6cdd8..c6545eb6bd 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/CommentController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/CommentController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/GuestbookController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/GuestbookController.java index 9944ad2496..c33a2f57e0 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/GuestbookController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/GuestbookController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/LinkController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/LinkController.java index 2973707b6d..4a9907ef59 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/LinkController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/LinkController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/SiteController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/SiteController.java index 9ec46285c6..e6ff2a4dde 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/SiteController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/SiteController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/StatsController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/StatsController.java index 47eb9dccd0..e9f0b1e60d 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/StatsController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/StatsController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontController.java index 5faed207a4..775d42af1b 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontController.java @@ -1,343 +1,343 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.modules.cms.web.front; - -import java.util.Date; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -import com.google.common.collect.Lists; -import com.thinkgem.jeesite.common.config.Global; -import com.thinkgem.jeesite.common.persistence.Page; -import com.thinkgem.jeesite.common.servlet.ValidateCodeServlet; -import com.thinkgem.jeesite.common.utils.StringUtils; -import com.thinkgem.jeesite.common.web.BaseController; -import com.thinkgem.jeesite.modules.cms.entity.Article; -import com.thinkgem.jeesite.modules.cms.entity.Category; -import com.thinkgem.jeesite.modules.cms.entity.Comment; -import com.thinkgem.jeesite.modules.cms.entity.Link; -import com.thinkgem.jeesite.modules.cms.entity.Site; -import com.thinkgem.jeesite.modules.cms.service.ArticleDataService; -import com.thinkgem.jeesite.modules.cms.service.ArticleService; -import com.thinkgem.jeesite.modules.cms.service.CategoryService; -import com.thinkgem.jeesite.modules.cms.service.CommentService; -import com.thinkgem.jeesite.modules.cms.service.LinkService; -import com.thinkgem.jeesite.modules.cms.service.SiteService; -import com.thinkgem.jeesite.modules.cms.utils.CmsUtils; - -/** - * 网站Controller - * @author ThinkGem - * @version 2013-5-29 - */ -@Controller -@RequestMapping(value = "${frontPath}") -public class FrontController extends BaseController{ - - @Autowired - private ArticleService articleService; - @Autowired - private ArticleDataService articleDataService; - @Autowired - private LinkService linkService; - @Autowired - private CommentService commentService; - @Autowired - private CategoryService categoryService; - @Autowired - private SiteService siteService; - - /** - * 网站首页 - */ - @RequestMapping - public String index(Model model) { - Site site = CmsUtils.getSite(Site.defaultSiteId()); - model.addAttribute("site", site); - model.addAttribute("isIndex", true); - return "modules/cms/front/themes/"+site.getTheme()+"/frontIndex"; - } - - /** - * 网站首页 - */ - @RequestMapping(value = "index-{siteId}${urlSuffix}") - public String index(@PathVariable String siteId, Model model) { - if (siteId.equals("1")){ - return "redirect:"+Global.getFrontPath(); - } - Site site = CmsUtils.getSite(siteId); - // 子站有独立页面,则显示独立页面 - if (StringUtils.isNotBlank(site.getCustomIndexView())){ - model.addAttribute("site", site); - model.addAttribute("isIndex", true); - return "modules/cms/front/themes/"+site.getTheme()+"/frontIndex"+site.getCustomIndexView(); - } - // 否则显示子站第一个栏目 - List mainNavList = CmsUtils.getMainNavList(siteId); - if (mainNavList.size() > 0){ - String firstCategoryId = CmsUtils.getMainNavList(siteId).get(0).getId(); - return "redirect:"+Global.getFrontPath()+"/list-"+firstCategoryId+Global.getUrlSuffix(); - }else{ - model.addAttribute("site", site); - return "modules/cms/front/themes/"+site.getTheme()+"/frontListCategory"; - } - } - - /** - * 内容列表 - */ - @RequestMapping(value = "list-{categoryId}${urlSuffix}") - public String list(@PathVariable String categoryId, @RequestParam(required=false, defaultValue="1") Integer pageNo, - @RequestParam(required=false, defaultValue="15") Integer pageSize, Model model) { - Category category = categoryService.get(categoryId); - if (category==null){ - Site site = CmsUtils.getSite(Site.defaultSiteId()); - model.addAttribute("site", site); - return "error/404"; - } - Site site = siteService.get(category.getSite().getId()); - model.addAttribute("site", site); - // 2:简介类栏目,栏目第一条内容 - if("2".equals(category.getShowModes()) && "article".equals(category.getModule())){ - // 如果没有子栏目,并父节点为跟节点的,栏目列表为当前栏目。 - List categoryList = Lists.newArrayList(); - if (category.getParent().getId().equals("1")){ - categoryList.add(category); - }else{ - categoryList = categoryService.findByParentId(category.getParent().getId(), category.getSite().getId()); - } - model.addAttribute("category", category); - model.addAttribute("categoryList", categoryList); - // 获取文章内容 - Page
page = new Page
(1, 1, -1); - Article article = new Article(category); - page = articleService.findPage(page, article, false); - if (page.getList().size()>0){ - article = page.getList().get(0); - article.setArticleData(articleDataService.get(article.getId())); - articleService.updateHitsAddOne(article.getId()); - } - model.addAttribute("article", article); - CmsUtils.addViewConfigAttribute(model, category); - CmsUtils.addViewConfigAttribute(model, article.getViewConfig()); - return "modules/cms/front/themes/"+site.getTheme()+"/"+getTpl(article); - }else{ - List categoryList = categoryService.findByParentId(category.getId(), category.getSite().getId()); - // 展现方式为1 、无子栏目或公共模型,显示栏目内容列表 - if("1".equals(category.getShowModes())||categoryList.size()==0){ - // 有子栏目并展现方式为1,则获取第一个子栏目;无子栏目,则获取同级分类列表。 - if(categoryList.size()>0){ - category = categoryList.get(0); - }else{ - // 如果没有子栏目,并父节点为跟节点的,栏目列表为当前栏目。 - if (category.getParent().getId().equals("1")){ - categoryList.add(category); - }else{ - categoryList = categoryService.findByParentId(category.getParent().getId(), category.getSite().getId()); - } - } - model.addAttribute("category", category); - model.addAttribute("categoryList", categoryList); - // 获取内容列表 - if ("article".equals(category.getModule())){ - Page
page = new Page
(pageNo, pageSize); - //System.out.println(page.getPageNo()); - page = articleService.findPage(page, new Article(category), false); - model.addAttribute("page", page); - // 如果第一个子栏目为简介类栏目,则获取该栏目第一篇文章 - if ("2".equals(category.getShowModes())){ - Article article = new Article(category); - if (page.getList().size()>0){ - article = page.getList().get(0); - article.setArticleData(articleDataService.get(article.getId())); - articleService.updateHitsAddOne(article.getId()); - } - model.addAttribute("article", article); - CmsUtils.addViewConfigAttribute(model, category); - CmsUtils.addViewConfigAttribute(model, article.getViewConfig()); - return "modules/cms/front/themes/"+site.getTheme()+"/"+getTpl(article); - } - }else if ("link".equals(category.getModule())){ - Page page = new Page(1, -1); - page = linkService.findPage(page, new Link(category), false); - model.addAttribute("page", page); - } - String view = "/frontList"; - if (StringUtils.isNotBlank(category.getCustomListView())){ - view = "/"+category.getCustomListView(); - } - CmsUtils.addViewConfigAttribute(model, category); - site =siteService.get(category.getSite().getId()); - //System.out.println("else 栏目第一条内容 _2 :"+category.getSite().getTheme()+","+site.getTheme()); - return "modules/cms/front/themes/"+siteService.get(category.getSite().getId()).getTheme()+view; - //return "modules/cms/front/themes/"+category.getSite().getTheme()+view; - } - // 有子栏目:显示子栏目列表 - else{ - model.addAttribute("category", category); - model.addAttribute("categoryList", categoryList); - String view = "/frontListCategory"; - if (StringUtils.isNotBlank(category.getCustomListView())){ - view = "/"+category.getCustomListView(); - } - CmsUtils.addViewConfigAttribute(model, category); - return "modules/cms/front/themes/"+site.getTheme()+view; - } - } - } - - /** - * 内容列表(通过url自定义视图) - */ - @RequestMapping(value = "listc-{categoryId}-{customView}${urlSuffix}") - public String listCustom(@PathVariable String categoryId, @PathVariable String customView, @RequestParam(required=false, defaultValue="1") Integer pageNo, - @RequestParam(required=false, defaultValue="15") Integer pageSize, Model model) { - Category category = categoryService.get(categoryId); - if (category==null){ - Site site = CmsUtils.getSite(Site.defaultSiteId()); - model.addAttribute("site", site); - return "error/404"; - } - Site site = siteService.get(category.getSite().getId()); - model.addAttribute("site", site); - List categoryList = categoryService.findByParentId(category.getId(), category.getSite().getId()); - model.addAttribute("category", category); - model.addAttribute("categoryList", categoryList); - CmsUtils.addViewConfigAttribute(model, category); - return "modules/cms/front/themes/"+site.getTheme()+"/frontListCategory"+customView; - } - - /** - * 显示内容 - */ - @RequestMapping(value = "view-{categoryId}-{contentId}${urlSuffix}") - public String view(@PathVariable String categoryId, @PathVariable String contentId, Model model) { - Category category = categoryService.get(categoryId); - if (category==null){ - Site site = CmsUtils.getSite(Site.defaultSiteId()); - model.addAttribute("site", site); - return "error/404"; - } - model.addAttribute("site", category.getSite()); - if ("article".equals(category.getModule())){ - // 如果没有子栏目,并父节点为跟节点的,栏目列表为当前栏目。 - List categoryList = Lists.newArrayList(); - if (category.getParent().getId().equals("1")){ - categoryList.add(category); - }else{ - categoryList = categoryService.findByParentId(category.getParent().getId(), category.getSite().getId()); - } - // 获取文章内容 - Article article = articleService.get(contentId); - if (article==null || !Article.DEL_FLAG_NORMAL.equals(article.getDelFlag())){ - return "error/404"; - } - // 文章阅读次数+1 - articleService.updateHitsAddOne(contentId); - // 获取推荐文章列表 - List relationList = articleService.findByIds(articleDataService.get(article.getId()).getRelation()); - // 将数据传递到视图 - model.addAttribute("category", categoryService.get(article.getCategory().getId())); - model.addAttribute("categoryList", categoryList); - article.setArticleData(articleDataService.get(article.getId())); - model.addAttribute("article", article); - model.addAttribute("relationList", relationList); - CmsUtils.addViewConfigAttribute(model, article.getCategory()); - CmsUtils.addViewConfigAttribute(model, article.getViewConfig()); - Site site = siteService.get(category.getSite().getId()); - model.addAttribute("site", site); -// return "modules/cms/front/themes/"+category.getSite().getTheme()+"/"+getTpl(article); - return "modules/cms/front/themes/"+site.getTheme()+"/"+getTpl(article); - } - return "error/404"; - } - - /** - * 内容评论 - */ - @RequestMapping(value = "comment", method=RequestMethod.GET) - public String comment(String theme, Comment comment, HttpServletRequest request, HttpServletResponse response, Model model) { - Page page = new Page(request, response); - Comment c = new Comment(); - c.setCategory(comment.getCategory()); - c.setContentId(comment.getContentId()); - c.setDelFlag(Comment.DEL_FLAG_NORMAL); - page = commentService.findPage(page, c); - model.addAttribute("page", page); - model.addAttribute("comment", comment); - return "modules/cms/front/themes/"+theme+"/frontComment"; - } - - /** - * 内容评论保存 - */ - @ResponseBody - @RequestMapping(value = "comment", method=RequestMethod.POST) - public String commentSave(Comment comment, String validateCode,@RequestParam(required=false) String replyId, HttpServletRequest request) { - if (StringUtils.isNotBlank(validateCode)){ - if (ValidateCodeServlet.validate(request, validateCode)){ - if (StringUtils.isNotBlank(replyId)){ - Comment replyComment = commentService.get(replyId); - if (replyComment != null){ - comment.setContent("
"+replyComment.getName()+":
" - +replyComment.getContent()+"
"+comment.getContent()); - } - } - comment.setIp(request.getRemoteAddr()); - comment.setCreateDate(new Date()); - comment.setDelFlag(Comment.DEL_FLAG_AUDIT); - commentService.save(comment); - return "{result:1, message:'提交成功。'}"; - }else{ - return "{result:2, message:'验证码不正确。'}"; - } - }else{ - return "{result:2, message:'验证码不能为空。'}"; - } - } - - /** - * 站点地图 - */ - @RequestMapping(value = "map-{siteId}${urlSuffix}") - public String map(@PathVariable String siteId, Model model) { - Site site = CmsUtils.getSite(siteId!=null?siteId:Site.defaultSiteId()); - model.addAttribute("site", site); - return "modules/cms/front/themes/"+site.getTheme()+"/frontMap"; - } - - private String getTpl(Article article){ - if(StringUtils.isBlank(article.getCustomContentView())){ - String view = null; - Category c = article.getCategory(); - boolean goon = true; - do{ - if(StringUtils.isNotBlank(c.getCustomContentView())){ - view = c.getCustomContentView(); - goon = false; - }else if(c.getParent() == null || c.getParent().isRoot()){ - goon = false; - }else{ - c = c.getParent(); - } - }while(goon); - return StringUtils.isBlank(view) ? Article.DEFAULT_TEMPLATE : view; - }else{ - return article.getCustomContentView(); - } - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.modules.cms.web.front; + +import java.util.Date; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.google.common.collect.Lists; +import com.thinkgem.jeesite.common.config.Global; +import com.thinkgem.jeesite.common.persistence.Page; +import com.thinkgem.jeesite.common.servlet.ValidateCodeServlet; +import com.thinkgem.jeesite.common.utils.StringUtils; +import com.thinkgem.jeesite.common.web.BaseController; +import com.thinkgem.jeesite.modules.cms.entity.Article; +import com.thinkgem.jeesite.modules.cms.entity.Category; +import com.thinkgem.jeesite.modules.cms.entity.Comment; +import com.thinkgem.jeesite.modules.cms.entity.Link; +import com.thinkgem.jeesite.modules.cms.entity.Site; +import com.thinkgem.jeesite.modules.cms.service.ArticleDataService; +import com.thinkgem.jeesite.modules.cms.service.ArticleService; +import com.thinkgem.jeesite.modules.cms.service.CategoryService; +import com.thinkgem.jeesite.modules.cms.service.CommentService; +import com.thinkgem.jeesite.modules.cms.service.LinkService; +import com.thinkgem.jeesite.modules.cms.service.SiteService; +import com.thinkgem.jeesite.modules.cms.utils.CmsUtils; + +/** + * 网站Controller + * @author ThinkGem + * @version 2013-5-29 + */ +@Controller +@RequestMapping(value = "${frontPath}") +public class FrontController extends BaseController{ + + @Autowired + private ArticleService articleService; + @Autowired + private ArticleDataService articleDataService; + @Autowired + private LinkService linkService; + @Autowired + private CommentService commentService; + @Autowired + private CategoryService categoryService; + @Autowired + private SiteService siteService; + + /** + * 网站首页 + */ + @RequestMapping + public String index(Model model) { + Site site = CmsUtils.getSite(Site.defaultSiteId()); + model.addAttribute("site", site); + model.addAttribute("isIndex", true); + return "modules/cms/front/themes/"+site.getTheme()+"/frontIndex"; + } + + /** + * 网站首页 + */ + @RequestMapping(value = "index-{siteId}${urlSuffix}") + public String index(@PathVariable String siteId, Model model) { + if (siteId.equals("1")){ + return "redirect:"+Global.getFrontPath(); + } + Site site = CmsUtils.getSite(siteId); + // 子站有独立页面,则显示独立页面 + if (StringUtils.isNotBlank(site.getCustomIndexView())){ + model.addAttribute("site", site); + model.addAttribute("isIndex", true); + return "modules/cms/front/themes/"+site.getTheme()+"/frontIndex"+site.getCustomIndexView(); + } + // 否则显示子站第一个栏目 + List mainNavList = CmsUtils.getMainNavList(siteId); + if (mainNavList.size() > 0){ + String firstCategoryId = CmsUtils.getMainNavList(siteId).get(0).getId(); + return "redirect:"+Global.getFrontPath()+"/list-"+firstCategoryId+Global.getUrlSuffix(); + }else{ + model.addAttribute("site", site); + return "modules/cms/front/themes/"+site.getTheme()+"/frontListCategory"; + } + } + + /** + * 内容列表 + */ + @RequestMapping(value = "list-{categoryId}${urlSuffix}") + public String list(@PathVariable String categoryId, @RequestParam(required=false, defaultValue="1") Integer pageNo, + @RequestParam(required=false, defaultValue="15") Integer pageSize, Model model) { + Category category = categoryService.get(categoryId); + if (category==null){ + Site site = CmsUtils.getSite(Site.defaultSiteId()); + model.addAttribute("site", site); + return "error/404"; + } + Site site = siteService.get(category.getSite().getId()); + model.addAttribute("site", site); + // 2:简介类栏目,栏目第一条内容 + if("2".equals(category.getShowModes()) && "article".equals(category.getModule())){ + // 如果没有子栏目,并父节点为跟节点的,栏目列表为当前栏目。 + List categoryList = Lists.newArrayList(); + if (category.getParent().getId().equals("1")){ + categoryList.add(category); + }else{ + categoryList = categoryService.findByParentId(category.getParent().getId(), category.getSite().getId()); + } + model.addAttribute("category", category); + model.addAttribute("categoryList", categoryList); + // 获取文章内容 + Page
page = new Page
(1, 1, -1); + Article article = new Article(category); + page = articleService.findPage(page, article, false); + if (page.getList().size()>0){ + article = page.getList().get(0); + article.setArticleData(articleDataService.get(article.getId())); + articleService.updateHitsAddOne(article.getId()); + } + model.addAttribute("article", article); + CmsUtils.addViewConfigAttribute(model, category); + CmsUtils.addViewConfigAttribute(model, article.getViewConfig()); + return "modules/cms/front/themes/"+site.getTheme()+"/"+getTpl(article); + }else{ + List categoryList = categoryService.findByParentId(category.getId(), category.getSite().getId()); + // 展现方式为1 、无子栏目或公共模型,显示栏目内容列表 + if("1".equals(category.getShowModes())||categoryList.size()==0){ + // 有子栏目并展现方式为1,则获取第一个子栏目;无子栏目,则获取同级分类列表。 + if(categoryList.size()>0){ + category = categoryList.get(0); + }else{ + // 如果没有子栏目,并父节点为跟节点的,栏目列表为当前栏目。 + if (category.getParent().getId().equals("1")){ + categoryList.add(category); + }else{ + categoryList = categoryService.findByParentId(category.getParent().getId(), category.getSite().getId()); + } + } + model.addAttribute("category", category); + model.addAttribute("categoryList", categoryList); + // 获取内容列表 + if ("article".equals(category.getModule())){ + Page
page = new Page
(pageNo, pageSize); + //System.out.println(page.getPageNo()); + page = articleService.findPage(page, new Article(category), false); + model.addAttribute("page", page); + // 如果第一个子栏目为简介类栏目,则获取该栏目第一篇文章 + if ("2".equals(category.getShowModes())){ + Article article = new Article(category); + if (page.getList().size()>0){ + article = page.getList().get(0); + article.setArticleData(articleDataService.get(article.getId())); + articleService.updateHitsAddOne(article.getId()); + } + model.addAttribute("article", article); + CmsUtils.addViewConfigAttribute(model, category); + CmsUtils.addViewConfigAttribute(model, article.getViewConfig()); + return "modules/cms/front/themes/"+site.getTheme()+"/"+getTpl(article); + } + }else if ("link".equals(category.getModule())){ + Page page = new Page(1, -1); + page = linkService.findPage(page, new Link(category), false); + model.addAttribute("page", page); + } + String view = "/frontList"; + if (StringUtils.isNotBlank(category.getCustomListView())){ + view = "/"+category.getCustomListView(); + } + CmsUtils.addViewConfigAttribute(model, category); + site =siteService.get(category.getSite().getId()); + //System.out.println("else 栏目第一条内容 _2 :"+category.getSite().getTheme()+","+site.getTheme()); + return "modules/cms/front/themes/"+siteService.get(category.getSite().getId()).getTheme()+view; + //return "modules/cms/front/themes/"+category.getSite().getTheme()+view; + } + // 有子栏目:显示子栏目列表 + else{ + model.addAttribute("category", category); + model.addAttribute("categoryList", categoryList); + String view = "/frontListCategory"; + if (StringUtils.isNotBlank(category.getCustomListView())){ + view = "/"+category.getCustomListView(); + } + CmsUtils.addViewConfigAttribute(model, category); + return "modules/cms/front/themes/"+site.getTheme()+view; + } + } + } + + /** + * 内容列表(通过url自定义视图) + */ + @RequestMapping(value = "listc-{categoryId}-{customView}${urlSuffix}") + public String listCustom(@PathVariable String categoryId, @PathVariable String customView, @RequestParam(required=false, defaultValue="1") Integer pageNo, + @RequestParam(required=false, defaultValue="15") Integer pageSize, Model model) { + Category category = categoryService.get(categoryId); + if (category==null){ + Site site = CmsUtils.getSite(Site.defaultSiteId()); + model.addAttribute("site", site); + return "error/404"; + } + Site site = siteService.get(category.getSite().getId()); + model.addAttribute("site", site); + List categoryList = categoryService.findByParentId(category.getId(), category.getSite().getId()); + model.addAttribute("category", category); + model.addAttribute("categoryList", categoryList); + CmsUtils.addViewConfigAttribute(model, category); + return "modules/cms/front/themes/"+site.getTheme()+"/frontListCategory"+customView; + } + + /** + * 显示内容 + */ + @RequestMapping(value = "view-{categoryId}-{contentId}${urlSuffix}") + public String view(@PathVariable String categoryId, @PathVariable String contentId, Model model) { + Category category = categoryService.get(categoryId); + if (category==null){ + Site site = CmsUtils.getSite(Site.defaultSiteId()); + model.addAttribute("site", site); + return "error/404"; + } + model.addAttribute("site", category.getSite()); + if ("article".equals(category.getModule())){ + // 如果没有子栏目,并父节点为跟节点的,栏目列表为当前栏目。 + List categoryList = Lists.newArrayList(); + if (category.getParent().getId().equals("1")){ + categoryList.add(category); + }else{ + categoryList = categoryService.findByParentId(category.getParent().getId(), category.getSite().getId()); + } + // 获取文章内容 + Article article = articleService.get(contentId); + if (article==null || !Article.DEL_FLAG_NORMAL.equals(article.getDelFlag())){ + return "error/404"; + } + // 文章阅读次数+1 + articleService.updateHitsAddOne(contentId); + // 获取推荐文章列表 + List relationList = articleService.findByIds(articleDataService.get(article.getId()).getRelation()); + // 将数据传递到视图 + model.addAttribute("category", categoryService.get(article.getCategory().getId())); + model.addAttribute("categoryList", categoryList); + article.setArticleData(articleDataService.get(article.getId())); + model.addAttribute("article", article); + model.addAttribute("relationList", relationList); + CmsUtils.addViewConfigAttribute(model, article.getCategory()); + CmsUtils.addViewConfigAttribute(model, article.getViewConfig()); + Site site = siteService.get(category.getSite().getId()); + model.addAttribute("site", site); +// return "modules/cms/front/themes/"+category.getSite().getTheme()+"/"+getTpl(article); + return "modules/cms/front/themes/"+site.getTheme()+"/"+getTpl(article); + } + return "error/404"; + } + + /** + * 内容评论 + */ + @RequestMapping(value = "comment", method=RequestMethod.GET) + public String comment(String theme, Comment comment, HttpServletRequest request, HttpServletResponse response, Model model) { + Page page = new Page(request, response); + Comment c = new Comment(); + c.setCategory(comment.getCategory()); + c.setContentId(comment.getContentId()); + c.setDelFlag(Comment.DEL_FLAG_NORMAL); + page = commentService.findPage(page, c); + model.addAttribute("page", page); + model.addAttribute("comment", comment); + return "modules/cms/front/themes/"+theme+"/frontComment"; + } + + /** + * 内容评论保存 + */ + @ResponseBody + @RequestMapping(value = "comment", method=RequestMethod.POST) + public String commentSave(Comment comment, String validateCode,@RequestParam(required=false) String replyId, HttpServletRequest request) { + if (StringUtils.isNotBlank(validateCode)){ + if (ValidateCodeServlet.validate(request, validateCode)){ + if (StringUtils.isNotBlank(replyId)){ + Comment replyComment = commentService.get(replyId); + if (replyComment != null){ + comment.setContent("
"+replyComment.getName()+":
" + +replyComment.getContent()+"
"+comment.getContent()); + } + } + comment.setIp(request.getRemoteAddr()); + comment.setCreateDate(new Date()); + comment.setDelFlag(Comment.DEL_FLAG_AUDIT); + commentService.save(comment); + return "{result:1, message:'提交成功。'}"; + }else{ + return "{result:2, message:'验证码不正确。'}"; + } + }else{ + return "{result:2, message:'验证码不能为空。'}"; + } + } + + /** + * 站点地图 + */ + @RequestMapping(value = "map-{siteId}${urlSuffix}") + public String map(@PathVariable String siteId, Model model) { + Site site = CmsUtils.getSite(siteId!=null?siteId:Site.defaultSiteId()); + model.addAttribute("site", site); + return "modules/cms/front/themes/"+site.getTheme()+"/frontMap"; + } + + private String getTpl(Article article){ + if(StringUtils.isBlank(article.getCustomContentView())){ + String view = null; + Category c = article.getCategory(); + boolean goon = true; + do{ + if(StringUtils.isNotBlank(c.getCustomContentView())){ + view = c.getCustomContentView(); + goon = false; + }else if(c.getParent() == null || c.getParent().isRoot()){ + goon = false; + }else{ + c = c.getParent(); + } + }while(goon); + return StringUtils.isBlank(view) ? Article.DEFAULT_TEMPLATE : view; + }else{ + return article.getCustomContentView(); + } + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontGuestbookController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontGuestbookController.java index 72a1b8b4cc..09bd839db5 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontGuestbookController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontGuestbookController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web.front; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontSearchController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontSearchController.java index a1f36a1b1a..b3ce4b4cbd 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontSearchController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/FrontSearchController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web.front; diff --git a/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/WeixinController.java b/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/WeixinController.java index d467568ffe..648d150e8d 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/WeixinController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/cms/web/front/WeixinController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.cms.web.front; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenDataBaseDictDao.java b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenDataBaseDictDao.java index a896b822c6..a818eabc64 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenDataBaseDictDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenDataBaseDictDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenSchemeDao.java b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenSchemeDao.java index 1163d814de..203d212db0 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenSchemeDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenSchemeDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTableColumnDao.java b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTableColumnDao.java index 867f259973..d22d0356a3 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTableColumnDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTableColumnDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTableDao.java b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTableDao.java index 7fffa5cc33..ec2ff1886c 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTableDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTableDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTemplateDao.java b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTemplateDao.java index 84d6412d19..22162bec6c 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTemplateDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/dao/GenTemplateDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenCategory.java b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenCategory.java index 61931ffd00..d07c13f1bc 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenCategory.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenCategory.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenConfig.java b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenConfig.java index 77db0b4907..24967cad38 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenConfig.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenConfig.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenScheme.java b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenScheme.java index 9a3496aa25..2a49c41e91 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenScheme.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenScheme.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTable.java b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTable.java index fa83ab15c7..f0723cc9f3 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTable.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTable.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTableColumn.java b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTableColumn.java index dc1d443177..a1a8227ce1 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTableColumn.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTableColumn.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTemplate.java b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTemplate.java index b4609eeb18..a853066a96 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTemplate.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/entity/GenTemplate.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenSchemeService.java b/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenSchemeService.java index 2ecf37f962..4d67b1aa06 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenSchemeService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenSchemeService.java @@ -1,117 +1,117 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.modules.gen.service; - -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.thinkgem.jeesite.common.persistence.Page; -import com.thinkgem.jeesite.common.service.BaseService; -import com.thinkgem.jeesite.common.utils.StringUtils; -import com.thinkgem.jeesite.modules.gen.dao.GenSchemeDao; -import com.thinkgem.jeesite.modules.gen.dao.GenTableColumnDao; -import com.thinkgem.jeesite.modules.gen.dao.GenTableDao; -import com.thinkgem.jeesite.modules.gen.entity.GenConfig; -import com.thinkgem.jeesite.modules.gen.entity.GenScheme; -import com.thinkgem.jeesite.modules.gen.entity.GenTable; -import com.thinkgem.jeesite.modules.gen.entity.GenTableColumn; -import com.thinkgem.jeesite.modules.gen.entity.GenTemplate; -import com.thinkgem.jeesite.modules.gen.util.GenUtils; - -/** - * 生成方案Service - * @author ThinkGem - * @version 2013-10-15 - */ -@Service -@Transactional(readOnly = true) -public class GenSchemeService extends BaseService { - - @Autowired - private GenSchemeDao genSchemeDao; -// @Autowired -// private GenTemplateDao genTemplateDao; - @Autowired - private GenTableDao genTableDao; - @Autowired - private GenTableColumnDao genTableColumnDao; - - public GenScheme get(String id) { - return genSchemeDao.get(id); - } - - public Page find(Page page, GenScheme genScheme) { - GenUtils.getTemplatePath(); - genScheme.setPage(page); - page.setList(genSchemeDao.findList(genScheme)); - return page; - } - - @Transactional(readOnly = false) - public String save(GenScheme genScheme) { - if (StringUtils.isBlank(genScheme.getId())){ - genScheme.preInsert(); - genSchemeDao.insert(genScheme); - }else{ - genScheme.preUpdate(); - genSchemeDao.update(genScheme); - } - // 生成代码 - if ("1".equals(genScheme.getFlag())){ - return generateCode(genScheme); - } - return ""; - } - - @Transactional(readOnly = false) - public void delete(GenScheme genScheme) { - genSchemeDao.delete(genScheme); - } - - private String generateCode(GenScheme genScheme){ - - StringBuilder result = new StringBuilder(); - - // 查询主表及字段列 - GenTable genTable = genTableDao.get(genScheme.getGenTable().getId()); - genTable.setColumnList(genTableColumnDao.findList(new GenTableColumn(new GenTable(genTable.getId())))); - - // 获取所有代码模板 - GenConfig config = GenUtils.getConfig(); - - // 获取模板列表 - List templateList = GenUtils.getTemplateList(config, genScheme.getCategory(), false); - List childTableTemplateList = GenUtils.getTemplateList(config, genScheme.getCategory(), true); - - // 如果有子表模板,则需要获取子表列表 - if (childTableTemplateList.size() > 0){ - GenTable parentTable = new GenTable(); - parentTable.setParentTable(genTable.getName()); - genTable.setChildList(genTableDao.findList(parentTable)); - } - - // 生成子表模板代码 - for (GenTable childTable : genTable.getChildList()){ - childTable.setParent(genTable); - childTable.setColumnList(genTableColumnDao.findList(new GenTableColumn(new GenTable(childTable.getId())))); - genScheme.setGenTable(childTable); - Map childTableModel = GenUtils.getDataModel(genScheme); - for (GenTemplate tpl : childTableTemplateList){ - result.append(GenUtils.generateToFile(tpl, childTableModel, genScheme.getReplaceFile())); - } - } - - // 生成主表模板代码 - genScheme.setGenTable(genTable); - Map model = GenUtils.getDataModel(genScheme); - for (GenTemplate tpl : templateList){ - result.append(GenUtils.generateToFile(tpl, model, genScheme.getReplaceFile())); - } - return result.toString(); - } -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.modules.gen.service; + +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.thinkgem.jeesite.common.persistence.Page; +import com.thinkgem.jeesite.common.service.BaseService; +import com.thinkgem.jeesite.common.utils.StringUtils; +import com.thinkgem.jeesite.modules.gen.dao.GenSchemeDao; +import com.thinkgem.jeesite.modules.gen.dao.GenTableColumnDao; +import com.thinkgem.jeesite.modules.gen.dao.GenTableDao; +import com.thinkgem.jeesite.modules.gen.entity.GenConfig; +import com.thinkgem.jeesite.modules.gen.entity.GenScheme; +import com.thinkgem.jeesite.modules.gen.entity.GenTable; +import com.thinkgem.jeesite.modules.gen.entity.GenTableColumn; +import com.thinkgem.jeesite.modules.gen.entity.GenTemplate; +import com.thinkgem.jeesite.modules.gen.util.GenUtils; + +/** + * 生成方案Service + * @author ThinkGem + * @version 2013-10-15 + */ +@Service +@Transactional(readOnly = true) +public class GenSchemeService extends BaseService { + + @Autowired + private GenSchemeDao genSchemeDao; +// @Autowired +// private GenTemplateDao genTemplateDao; + @Autowired + private GenTableDao genTableDao; + @Autowired + private GenTableColumnDao genTableColumnDao; + + public GenScheme get(String id) { + return genSchemeDao.get(id); + } + + public Page find(Page page, GenScheme genScheme) { + GenUtils.getTemplatePath(); + genScheme.setPage(page); + page.setList(genSchemeDao.findList(genScheme)); + return page; + } + + @Transactional(readOnly = false) + public String save(GenScheme genScheme) { + if (StringUtils.isBlank(genScheme.getId())){ + genScheme.preInsert(); + genSchemeDao.insert(genScheme); + }else{ + genScheme.preUpdate(); + genSchemeDao.update(genScheme); + } + // 生成代码 + if ("1".equals(genScheme.getFlag())){ + return generateCode(genScheme); + } + return ""; + } + + @Transactional(readOnly = false) + public void delete(GenScheme genScheme) { + genSchemeDao.delete(genScheme); + } + + private String generateCode(GenScheme genScheme){ + + StringBuilder result = new StringBuilder(); + + // 查询主表及字段列 + GenTable genTable = genTableDao.get(genScheme.getGenTable().getId()); + genTable.setColumnList(genTableColumnDao.findList(new GenTableColumn(new GenTable(genTable.getId())))); + + // 获取所有代码模板 + GenConfig config = GenUtils.getConfig(); + + // 获取模板列表 + List templateList = GenUtils.getTemplateList(config, genScheme.getCategory(), false); + List childTableTemplateList = GenUtils.getTemplateList(config, genScheme.getCategory(), true); + + // 如果有子表模板,则需要获取子表列表 + if (childTableTemplateList.size() > 0){ + GenTable parentTable = new GenTable(); + parentTable.setParentTable(genTable.getName()); + genTable.setChildList(genTableDao.findList(parentTable)); + } + + // 生成子表模板代码 + for (GenTable childTable : genTable.getChildList()){ + childTable.setParent(genTable); + childTable.setColumnList(genTableColumnDao.findList(new GenTableColumn(new GenTable(childTable.getId())))); + genScheme.setGenTable(childTable); + Map childTableModel = GenUtils.getDataModel(genScheme); + for (GenTemplate tpl : childTableTemplateList){ + result.append(GenUtils.generateToFile(tpl, childTableModel, genScheme.getReplaceFile())); + } + } + + // 生成主表模板代码 + genScheme.setGenTable(genTable); + Map model = GenUtils.getDataModel(genScheme); + for (GenTemplate tpl : templateList){ + result.append(GenUtils.generateToFile(tpl, model, genScheme.getReplaceFile())); + } + return result.toString(); + } +} diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenTableService.java b/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenTableService.java index 9939e4075d..acaa027133 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenTableService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenTableService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenTemplateService.java b/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenTemplateService.java index b217a8e3c2..a3673c81a8 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenTemplateService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/service/GenTemplateService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/util/GenUtils.java b/src/main/java/com/thinkgem/jeesite/modules/gen/util/GenUtils.java index 20059a1cd1..726cba67ec 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/util/GenUtils.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/util/GenUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.util; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenSchemeController.java b/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenSchemeController.java index c4e3a50574..7c6840f484 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenSchemeController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenSchemeController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenTableController.java b/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenTableController.java index 1d3d3b6fac..fcc0bbe34e 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenTableController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenTableController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenTemplateController.java b/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenTemplateController.java index ba1a399b0b..7d10069e29 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenTemplateController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/gen/web/GenTemplateController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.gen.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/dao/OaNotifyDao.java b/src/main/java/com/thinkgem/jeesite/modules/oa/dao/OaNotifyDao.java index 98055f6d51..dccddcdcaa 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/dao/OaNotifyDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/dao/OaNotifyDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/dao/OaNotifyRecordDao.java b/src/main/java/com/thinkgem/jeesite/modules/oa/dao/OaNotifyRecordDao.java index 53b26d4160..92f4381bed 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/dao/OaNotifyRecordDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/dao/OaNotifyRecordDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/dao/TestAuditDao.java b/src/main/java/com/thinkgem/jeesite/modules/oa/dao/TestAuditDao.java index c5dfacf53f..72bfa0a5fd 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/dao/TestAuditDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/dao/TestAuditDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/entity/OaNotify.java b/src/main/java/com/thinkgem/jeesite/modules/oa/entity/OaNotify.java index 8e7dfc1ea4..80d735f797 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/entity/OaNotify.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/entity/OaNotify.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/entity/OaNotifyRecord.java b/src/main/java/com/thinkgem/jeesite/modules/oa/entity/OaNotifyRecord.java index 9095a14e50..1c36bda8fd 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/entity/OaNotifyRecord.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/entity/OaNotifyRecord.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/entity/TestAudit.java b/src/main/java/com/thinkgem/jeesite/modules/oa/entity/TestAudit.java index 6d15fa5d91..68f531a690 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/entity/TestAudit.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/entity/TestAudit.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/service/OaNotifyService.java b/src/main/java/com/thinkgem/jeesite/modules/oa/service/OaNotifyService.java index 5f93c8c76a..f60a4a1923 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/service/OaNotifyService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/service/OaNotifyService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/service/TestAuditService.java b/src/main/java/com/thinkgem/jeesite/modules/oa/service/TestAuditService.java index a341e846b0..2f5801531a 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/service/TestAuditService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/service/TestAuditService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/web/OaNotifyController.java b/src/main/java/com/thinkgem/jeesite/modules/oa/web/OaNotifyController.java index 61f06571ba..dee6706413 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/web/OaNotifyController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/web/OaNotifyController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/oa/web/TestAuditController.java b/src/main/java/com/thinkgem/jeesite/modules/oa/web/TestAuditController.java index b0527866b3..700c9cc9a0 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/oa/web/TestAuditController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/oa/web/TestAuditController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.oa.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/AreaDao.java b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/AreaDao.java index b81e7048be..a5196ea7bb 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/AreaDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/AreaDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/DictDao.java b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/DictDao.java index 56244dc2c6..d81272652a 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/DictDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/DictDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/LogDao.java b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/LogDao.java index ca1f8ce698..c00d5f5aff 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/LogDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/LogDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/MenuDao.java b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/MenuDao.java index b6e6e6edc4..34f5778fc6 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/MenuDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/MenuDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/OfficeDao.java b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/OfficeDao.java index c7ba30adea..d05e89ab95 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/OfficeDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/OfficeDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/RoleDao.java b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/RoleDao.java index 8add071acb..ef0124b93c 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/RoleDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/RoleDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/UserDao.java b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/UserDao.java index d7b8fb0edd..be0b02e4af 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/dao/UserDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/dao/UserDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Area.java b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Area.java index 4b39f4a006..5abbf4bac0 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Area.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Area.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Dict.java b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Dict.java index aa6832d38e..bab9dff380 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Dict.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Dict.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Log.java b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Log.java index 089f1e8b62..9ae9e6378a 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Log.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Log.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Menu.java b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Menu.java index 5490a4e758..57f25d24d0 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Menu.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Menu.java @@ -1,171 +1,171 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.modules.sys.entity; - -import java.util.List; - -import javax.validation.constraints.NotNull; - -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonBackReference; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.thinkgem.jeesite.common.persistence.DataEntity; - -/** - * 菜单Entity - * @author ThinkGem - * @version 2013-05-15 - */ -public class Menu extends DataEntity { - - private static final long serialVersionUID = 1L; - private Menu parent; // 父级菜单 - private String parentIds; // 所有父级编号 - private String name; // 名称 - private String href; // 链接 - private String target; // 目标( mainFrame、_blank、_self、_parent、_top) - private String icon; // 图标 - private Integer sort; // 排序 - private String isShow; // 是否在菜单中显示(1:显示;0:不显示) - private String permission; // 权限标识 - - private String userId; - - public Menu(){ - super(); - this.sort = 30; - this.isShow = "1"; - } - - public Menu(String id){ - super(id); - } - - @JsonBackReference - @NotNull - public Menu getParent() { - return parent; - } - - public void setParent(Menu parent) { - this.parent = parent; - } - - @Length(min=1, max=2000) - public String getParentIds() { - return parentIds; - } - - public void setParentIds(String parentIds) { - this.parentIds = parentIds; - } - - @Length(min=1, max=100) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Length(min=0, max=2000) - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - @Length(min=0, max=20) - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - @Length(min=0, max=100) - public String getIcon() { - return icon; - } - - public void setIcon(String icon) { - this.icon = icon; - } - - @NotNull - public Integer getSort() { - return sort; - } - - public void setSort(Integer sort) { - this.sort = sort; - } - - @Length(min=1, max=1) - public String getIsShow() { - return isShow; - } - - public void setIsShow(String isShow) { - this.isShow = isShow; - } - - @Length(min=0, max=200) - public String getPermission() { - return permission; - } - - public void setPermission(String permission) { - this.permission = permission; - } - - public String getParentId() { - return parent != null && parent.getId() != null ? parent.getId() : "0"; - } - - @JsonIgnore - public static void sortList(List list, List sourcelist, String parentId, boolean cascade){ - for (int i=0; iJeeSite All rights reserved. + */ +package com.thinkgem.jeesite.modules.sys.entity; + +import java.util.List; + +import javax.validation.constraints.NotNull; + +import org.hibernate.validator.constraints.Length; + +import com.fasterxml.jackson.annotation.JsonBackReference; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.thinkgem.jeesite.common.persistence.DataEntity; + +/** + * 菜单Entity + * @author ThinkGem + * @version 2013-05-15 + */ +public class Menu extends DataEntity { + + private static final long serialVersionUID = 1L; + private Menu parent; // 父级菜单 + private String parentIds; // 所有父级编号 + private String name; // 名称 + private String href; // 链接 + private String target; // 目标( mainFrame、_blank、_self、_parent、_top) + private String icon; // 图标 + private Integer sort; // 排序 + private String isShow; // 是否在菜单中显示(1:显示;0:不显示) + private String permission; // 权限标识 + + private String userId; + + public Menu(){ + super(); + this.sort = 30; + this.isShow = "1"; + } + + public Menu(String id){ + super(id); + } + + @JsonBackReference + @NotNull + public Menu getParent() { + return parent; + } + + public void setParent(Menu parent) { + this.parent = parent; + } + + @Length(min=1, max=2000) + public String getParentIds() { + return parentIds; + } + + public void setParentIds(String parentIds) { + this.parentIds = parentIds; + } + + @Length(min=1, max=100) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Length(min=0, max=2000) + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + @Length(min=0, max=20) + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + @Length(min=0, max=100) + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + @NotNull + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + @Length(min=1, max=1) + public String getIsShow() { + return isShow; + } + + public void setIsShow(String isShow) { + this.isShow = isShow; + } + + @Length(min=0, max=200) + public String getPermission() { + return permission; + } + + public void setPermission(String permission) { + this.permission = permission; + } + + public String getParentId() { + return parent != null && parent.getId() != null ? parent.getId() : "0"; + } + + @JsonIgnore + public static void sortList(List list, List sourcelist, String parentId, boolean cascade){ + for (int i=0; iJeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Role.java b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Role.java index fbe24ff0d6..55deb11e9f 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Role.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/Role.java @@ -1,270 +1,270 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.modules.sys.entity; - -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.hibernate.validator.constraints.Length; - -import com.google.common.collect.Lists; -import com.thinkgem.jeesite.common.config.Global; -import com.thinkgem.jeesite.common.persistence.DataEntity; - -/** - * 角色Entity - * @author ThinkGem - * @version 2013-12-05 - */ -public class Role extends DataEntity { - - private static final long serialVersionUID = 1L; - private Office office; // 归属机构 - private String name; // 角色名称 - private String enname; // 英文名称 - private String roleType;// 权限类型 - private String dataScope;// 数据范围 - - private String oldName; // 原角色名称 - private String oldEnname; // 原英文名称 - private String sysData; //是否是系统数据 - private String useable; //是否是可用 - - private User user; // 根据用户ID查询角色列表 - -// private List userList = Lists.newArrayList(); // 拥有用户列表 - private List menuList = Lists.newArrayList(); // 拥有菜单列表 - private List officeList = Lists.newArrayList(); // 按明细设置数据范围 - - // 数据范围(1:所有数据;2:所在公司及以下数据;3:所在公司数据;4:所在部门及以下数据;5:所在部门数据;8:仅本人数据;9:按明细设置) - public static final String DATA_SCOPE_ALL = "1"; - public static final String DATA_SCOPE_COMPANY_AND_CHILD = "2"; - public static final String DATA_SCOPE_COMPANY = "3"; - public static final String DATA_SCOPE_OFFICE_AND_CHILD = "4"; - public static final String DATA_SCOPE_OFFICE = "5"; - public static final String DATA_SCOPE_SELF = "8"; - public static final String DATA_SCOPE_CUSTOM = "9"; - - public Role() { - super(); - this.dataScope = DATA_SCOPE_SELF; - this.useable=Global.YES; - } - - public Role(String id){ - super(id); - } - - public Role(User user) { - this(); - this.user = user; - } - - public String getUseable() { - return useable; - } - - public void setUseable(String useable) { - this.useable = useable; - } - - public String getSysData() { - return sysData; - } - - public void setSysData(String sysData) { - this.sysData = sysData; - } - - public Office getOffice() { - return office; - } - - public void setOffice(Office office) { - this.office = office; - } - - @Length(min=1, max=100) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Length(min=1, max=100) - public String getEnname() { - return enname; - } - - public void setEnname(String enname) { - this.enname = enname; - } - - @Length(min=1, max=100) - public String getRoleType() { - return roleType; - } - - public void setRoleType(String roleType) { - this.roleType = roleType; - } - - public String getDataScope() { - return dataScope; - } - - public void setDataScope(String dataScope) { - this.dataScope = dataScope; - } - - public String getOldName() { - return oldName; - } - - public void setOldName(String oldName) { - this.oldName = oldName; - } - - public String getOldEnname() { - return oldEnname; - } - - public void setOldEnname(String oldEnname) { - this.oldEnname = oldEnname; - } - -// public List getUserList() { -// return userList; -// } -// -// public void setUserList(List userList) { -// this.userList = userList; -// } -// -// public List getUserIdList() { -// List nameIdList = Lists.newArrayList(); -// for (User user : userList) { -// nameIdList.add(user.getId()); -// } -// return nameIdList; -// } -// -// public String getUserIds() { -// return StringUtils.join(getUserIdList(), ","); -// } - - public List getMenuList() { - return menuList; - } - - public void setMenuList(List menuList) { - this.menuList = menuList; - } - - public List getMenuIdList() { - List menuIdList = Lists.newArrayList(); - for (Menu menu : menuList) { - menuIdList.add(menu.getId()); - } - return menuIdList; - } - - public void setMenuIdList(List menuIdList) { - menuList = Lists.newArrayList(); - for (String menuId : menuIdList) { - Menu menu = new Menu(); - menu.setId(menuId); - menuList.add(menu); - } - } - - public String getMenuIds() { - return StringUtils.join(getMenuIdList(), ","); - } - - public void setMenuIds(String menuIds) { - menuList = Lists.newArrayList(); - if (menuIds != null){ - String[] ids = StringUtils.split(menuIds, ","); - setMenuIdList(Lists.newArrayList(ids)); - } - } - - public List getOfficeList() { - return officeList; - } - - public void setOfficeList(List officeList) { - this.officeList = officeList; - } - - public List getOfficeIdList() { - List officeIdList = Lists.newArrayList(); - for (Office office : officeList) { - officeIdList.add(office.getId()); - } - return officeIdList; - } - - public void setOfficeIdList(List officeIdList) { - officeList = Lists.newArrayList(); - for (String officeId : officeIdList) { - Office office = new Office(); - office.setId(officeId); - officeList.add(office); - } - } - - public String getOfficeIds() { - return StringUtils.join(getOfficeIdList(), ","); - } - - public void setOfficeIds(String officeIds) { - officeList = Lists.newArrayList(); - if (officeIds != null){ - String[] ids = StringUtils.split(officeIds, ","); - setOfficeIdList(Lists.newArrayList(ids)); - } - } - - /** - * 获取权限字符串列表 - */ - public List getPermissions() { - List permissions = Lists.newArrayList(); - for (Menu menu : menuList) { - if (menu.getPermission()!=null && !"".equals(menu.getPermission())){ - permissions.add(menu.getPermission()); - } - } - return permissions; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - -// public boolean isAdmin(){ -// return isAdmin(this.id); -// } -// -// public static boolean isAdmin(String id){ -// return id != null && "1".equals(id); -// } - -// @Transient -// public String getMenuNames() { -// List menuNameList = Lists.newArrayList(); -// for (Menu menu : menuList) { -// menuNameList.add(menu.getName()); -// } -// return StringUtils.join(menuNameList, ","); -// } -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.modules.sys.entity; + +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.hibernate.validator.constraints.Length; + +import com.google.common.collect.Lists; +import com.thinkgem.jeesite.common.config.Global; +import com.thinkgem.jeesite.common.persistence.DataEntity; + +/** + * 角色Entity + * @author ThinkGem + * @version 2013-12-05 + */ +public class Role extends DataEntity { + + private static final long serialVersionUID = 1L; + private Office office; // 归属机构 + private String name; // 角色名称 + private String enname; // 英文名称 + private String roleType;// 权限类型 + private String dataScope;// 数据范围 + + private String oldName; // 原角色名称 + private String oldEnname; // 原英文名称 + private String sysData; //是否是系统数据 + private String useable; //是否是可用 + + private User user; // 根据用户ID查询角色列表 + +// private List userList = Lists.newArrayList(); // 拥有用户列表 + private List menuList = Lists.newArrayList(); // 拥有菜单列表 + private List officeList = Lists.newArrayList(); // 按明细设置数据范围 + + // 数据范围(1:所有数据;2:所在公司及以下数据;3:所在公司数据;4:所在部门及以下数据;5:所在部门数据;8:仅本人数据;9:按明细设置) + public static final String DATA_SCOPE_ALL = "1"; + public static final String DATA_SCOPE_COMPANY_AND_CHILD = "2"; + public static final String DATA_SCOPE_COMPANY = "3"; + public static final String DATA_SCOPE_OFFICE_AND_CHILD = "4"; + public static final String DATA_SCOPE_OFFICE = "5"; + public static final String DATA_SCOPE_SELF = "8"; + public static final String DATA_SCOPE_CUSTOM = "9"; + + public Role() { + super(); + this.dataScope = DATA_SCOPE_SELF; + this.useable=Global.YES; + } + + public Role(String id){ + super(id); + } + + public Role(User user) { + this(); + this.user = user; + } + + public String getUseable() { + return useable; + } + + public void setUseable(String useable) { + this.useable = useable; + } + + public String getSysData() { + return sysData; + } + + public void setSysData(String sysData) { + this.sysData = sysData; + } + + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + @Length(min=1, max=100) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Length(min=1, max=100) + public String getEnname() { + return enname; + } + + public void setEnname(String enname) { + this.enname = enname; + } + + @Length(min=1, max=100) + public String getRoleType() { + return roleType; + } + + public void setRoleType(String roleType) { + this.roleType = roleType; + } + + public String getDataScope() { + return dataScope; + } + + public void setDataScope(String dataScope) { + this.dataScope = dataScope; + } + + public String getOldName() { + return oldName; + } + + public void setOldName(String oldName) { + this.oldName = oldName; + } + + public String getOldEnname() { + return oldEnname; + } + + public void setOldEnname(String oldEnname) { + this.oldEnname = oldEnname; + } + +// public List getUserList() { +// return userList; +// } +// +// public void setUserList(List userList) { +// this.userList = userList; +// } +// +// public List getUserIdList() { +// List nameIdList = Lists.newArrayList(); +// for (User user : userList) { +// nameIdList.add(user.getId()); +// } +// return nameIdList; +// } +// +// public String getUserIds() { +// return StringUtils.join(getUserIdList(), ","); +// } + + public List getMenuList() { + return menuList; + } + + public void setMenuList(List menuList) { + this.menuList = menuList; + } + + public List getMenuIdList() { + List menuIdList = Lists.newArrayList(); + for (Menu menu : menuList) { + menuIdList.add(menu.getId()); + } + return menuIdList; + } + + public void setMenuIdList(List menuIdList) { + menuList = Lists.newArrayList(); + for (String menuId : menuIdList) { + Menu menu = new Menu(); + menu.setId(menuId); + menuList.add(menu); + } + } + + public String getMenuIds() { + return StringUtils.join(getMenuIdList(), ","); + } + + public void setMenuIds(String menuIds) { + menuList = Lists.newArrayList(); + if (menuIds != null){ + String[] ids = StringUtils.split(menuIds, ","); + setMenuIdList(Lists.newArrayList(ids)); + } + } + + public List getOfficeList() { + return officeList; + } + + public void setOfficeList(List officeList) { + this.officeList = officeList; + } + + public List getOfficeIdList() { + List officeIdList = Lists.newArrayList(); + for (Office office : officeList) { + officeIdList.add(office.getId()); + } + return officeIdList; + } + + public void setOfficeIdList(List officeIdList) { + officeList = Lists.newArrayList(); + for (String officeId : officeIdList) { + Office office = new Office(); + office.setId(officeId); + officeList.add(office); + } + } + + public String getOfficeIds() { + return StringUtils.join(getOfficeIdList(), ","); + } + + public void setOfficeIds(String officeIds) { + officeList = Lists.newArrayList(); + if (officeIds != null){ + String[] ids = StringUtils.split(officeIds, ","); + setOfficeIdList(Lists.newArrayList(ids)); + } + } + + /** + * 获取权限字符串列表 + */ + public List getPermissions() { + List permissions = Lists.newArrayList(); + for (Menu menu : menuList) { + if (menu.getPermission()!=null && !"".equals(menu.getPermission())){ + permissions.add(menu.getPermission()); + } + } + return permissions; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + +// public boolean isAdmin(){ +// return isAdmin(this.id); +// } +// +// public static boolean isAdmin(String id){ +// return id != null && "1".equals(id); +// } + +// @Transient +// public String getMenuNames() { +// List menuNameList = Lists.newArrayList(); +// for (Menu menu : menuList) { +// menuNameList.add(menu.getName()); +// } +// return StringUtils.join(menuNameList, ","); +// } +} diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/User.java b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/User.java index d4550ba71c..724e345896 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/entity/User.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/entity/User.java @@ -1,324 +1,324 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.modules.sys.entity; - -import java.util.Date; -import java.util.List; - -import javax.validation.constraints.NotNull; - -import org.hibernate.validator.constraints.Email; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.google.common.collect.Lists; -import com.thinkgem.jeesite.common.config.Global; -import com.thinkgem.jeesite.common.persistence.DataEntity; -import com.thinkgem.jeesite.common.supcan.annotation.treelist.cols.SupCol; -import com.thinkgem.jeesite.common.utils.Collections3; -import com.thinkgem.jeesite.common.utils.excel.annotation.ExcelField; -import com.thinkgem.jeesite.common.utils.excel.fieldtype.RoleListType; - -/** - * 用户Entity - * @author ThinkGem - * @version 2013-12-05 - */ -public class User extends DataEntity { - - private static final long serialVersionUID = 1L; - private Office company; // 归属公司 - private Office office; // 归属部门 - private String loginName;// 登录名 - private String password;// 密码 - private String no; // 工号 - private String name; // 姓名 - private String email; // 邮箱 - private String phone; // 电话 - private String mobile; // 手机 - private String userType;// 用户类型 - private String loginIp; // 最后登陆IP - private Date loginDate; // 最后登陆日期 - private String loginFlag; // 是否允许登陆 - private String photo; // 头像 - - private String oldLoginName;// 原登录名 - private String newPassword; // 新密码 - - private String oldLoginIp; // 上次登陆IP - private Date oldLoginDate; // 上次登陆日期 - - private Role role; // 根据角色查询用户条件 - - private List roleList = Lists.newArrayList(); // 拥有角色列表 - - public User() { - super(); - this.loginFlag = Global.YES; - } - - public User(String id){ - super(id); - } - - public User(String id, String loginName){ - super(id); - this.loginName = loginName; - } - - public User(Role role){ - super(); - this.role = role; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getLoginFlag() { - return loginFlag; - } - - public void setLoginFlag(String loginFlag) { - this.loginFlag = loginFlag; - } - - @SupCol(isUnique="true", isHide="true") - @ExcelField(title="ID", type=1, align=2, sort=1) - public String getId() { - return id; - } - - @JsonIgnore - @NotNull(message="归属公司不能为空") - @ExcelField(title="归属公司", align=2, sort=20) - public Office getCompany() { - return company; - } - - public void setCompany(Office company) { - this.company = company; - } - - @JsonIgnore - @NotNull(message="归属部门不能为空") - @ExcelField(title="归属部门", align=2, sort=25) - public Office getOffice() { - return office; - } - - public void setOffice(Office office) { - this.office = office; - } - - @Length(min=1, max=100, message="登录名长度必须介于 1 和 100 之间") - @ExcelField(title="登录名", align=2, sort=30) - public String getLoginName() { - return loginName; - } - - public void setLoginName(String loginName) { - this.loginName = loginName; - } - - @JsonIgnore - @Length(min=1, max=100, message="密码长度必须介于 1 和 100 之间") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Length(min=1, max=100, message="姓名长度必须介于 1 和 100 之间") - @ExcelField(title="姓名", align=2, sort=40) - public String getName() { - return name; - } - - @Length(min=1, max=100, message="工号长度必须介于 1 和 100 之间") - @ExcelField(title="工号", align=2, sort=45) - public String getNo() { - return no; - } - - public void setNo(String no) { - this.no = no; - } - - public void setName(String name) { - this.name = name; - } - - @Email(message="邮箱格式不正确") - @Length(min=0, max=200, message="邮箱长度必须介于 1 和 200 之间") - @ExcelField(title="邮箱", align=1, sort=50) - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - @Length(min=0, max=200, message="电话长度必须介于 1 和 200 之间") - @ExcelField(title="电话", align=2, sort=60) - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - @Length(min=0, max=200, message="手机长度必须介于 1 和 200 之间") - @ExcelField(title="手机", align=2, sort=70) - public String getMobile() { - return mobile; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - @ExcelField(title="备注", align=1, sort=900) - public String getRemarks() { - return remarks; - } - - @Length(min=0, max=100, message="用户类型长度必须介于 1 和 100 之间") - @ExcelField(title="用户类型", align=2, sort=80, dictType="sys_user_type") - public String getUserType() { - return userType; - } - - public void setUserType(String userType) { - this.userType = userType; - } - - @ExcelField(title="创建时间", type=0, align=1, sort=90) - public Date getCreateDate() { - return createDate; - } - - @ExcelField(title="最后登录IP", type=1, align=1, sort=100) - public String getLoginIp() { - return loginIp; - } - - public void setLoginIp(String loginIp) { - this.loginIp = loginIp; - } - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @ExcelField(title="最后登录日期", type=1, align=1, sort=110) - public Date getLoginDate() { - return loginDate; - } - - public void setLoginDate(Date loginDate) { - this.loginDate = loginDate; - } - - public String getOldLoginName() { - return oldLoginName; - } - - public void setOldLoginName(String oldLoginName) { - this.oldLoginName = oldLoginName; - } - - public String getNewPassword() { - return newPassword; - } - - public void setNewPassword(String newPassword) { - this.newPassword = newPassword; - } - - public String getOldLoginIp() { - if (oldLoginIp == null){ - return loginIp; - } - return oldLoginIp; - } - - public void setOldLoginIp(String oldLoginIp) { - this.oldLoginIp = oldLoginIp; - } - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - public Date getOldLoginDate() { - if (oldLoginDate == null){ - return loginDate; - } - return oldLoginDate; - } - - public void setOldLoginDate(Date oldLoginDate) { - this.oldLoginDate = oldLoginDate; - } - - public Role getRole() { - return role; - } - - public void setRole(Role role) { - this.role = role; - } - - @JsonIgnore - @ExcelField(title="拥有角色", align=1, sort=800, fieldType=RoleListType.class) - public List getRoleList() { - return roleList; - } - - public void setRoleList(List roleList) { - this.roleList = roleList; - } - - @JsonIgnore - public List getRoleIdList() { - List roleIdList = Lists.newArrayList(); - for (Role role : roleList) { - roleIdList.add(role.getId()); - } - return roleIdList; - } - - public void setRoleIdList(List roleIdList) { - roleList = Lists.newArrayList(); - for (String roleId : roleIdList) { - Role role = new Role(); - role.setId(roleId); - roleList.add(role); - } - } - - /** - * 用户拥有的角色名称字符串, 多个角色名称用','分隔. - */ - public String getRoleNames() { - return Collections3.extractToString(roleList, "name", ","); - } - - public boolean isAdmin(){ - return isAdmin(this.id); - } - - public static boolean isAdmin(String id){ - return id != null && "1".equals(id); - } - - @Override - public String toString() { - return id; - } +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.modules.sys.entity; + +import java.util.Date; +import java.util.List; + +import javax.validation.constraints.NotNull; + +import org.hibernate.validator.constraints.Email; +import org.hibernate.validator.constraints.Length; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.collect.Lists; +import com.thinkgem.jeesite.common.config.Global; +import com.thinkgem.jeesite.common.persistence.DataEntity; +import com.thinkgem.jeesite.common.supcan.annotation.treelist.cols.SupCol; +import com.thinkgem.jeesite.common.utils.Collections3; +import com.thinkgem.jeesite.common.utils.excel.annotation.ExcelField; +import com.thinkgem.jeesite.common.utils.excel.fieldtype.RoleListType; + +/** + * 用户Entity + * @author ThinkGem + * @version 2013-12-05 + */ +public class User extends DataEntity { + + private static final long serialVersionUID = 1L; + private Office company; // 归属公司 + private Office office; // 归属部门 + private String loginName;// 登录名 + private String password;// 密码 + private String no; // 工号 + private String name; // 姓名 + private String email; // 邮箱 + private String phone; // 电话 + private String mobile; // 手机 + private String userType;// 用户类型 + private String loginIp; // 最后登陆IP + private Date loginDate; // 最后登陆日期 + private String loginFlag; // 是否允许登陆 + private String photo; // 头像 + + private String oldLoginName;// 原登录名 + private String newPassword; // 新密码 + + private String oldLoginIp; // 上次登陆IP + private Date oldLoginDate; // 上次登陆日期 + + private Role role; // 根据角色查询用户条件 + + private List roleList = Lists.newArrayList(); // 拥有角色列表 + + public User() { + super(); + this.loginFlag = Global.YES; + } + + public User(String id){ + super(id); + } + + public User(String id, String loginName){ + super(id); + this.loginName = loginName; + } + + public User(Role role){ + super(); + this.role = role; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getLoginFlag() { + return loginFlag; + } + + public void setLoginFlag(String loginFlag) { + this.loginFlag = loginFlag; + } + + @SupCol(isUnique="true", isHide="true") + @ExcelField(title="ID", type=1, align=2, sort=1) + public String getId() { + return id; + } + + @JsonIgnore + @NotNull(message="归属公司不能为空") + @ExcelField(title="归属公司", align=2, sort=20) + public Office getCompany() { + return company; + } + + public void setCompany(Office company) { + this.company = company; + } + + @JsonIgnore + @NotNull(message="归属部门不能为空") + @ExcelField(title="归属部门", align=2, sort=25) + public Office getOffice() { + return office; + } + + public void setOffice(Office office) { + this.office = office; + } + + @Length(min=1, max=100, message="登录名长度必须介于 1 和 100 之间") + @ExcelField(title="登录名", align=2, sort=30) + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + @JsonIgnore + @Length(min=1, max=100, message="密码长度必须介于 1 和 100 之间") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Length(min=1, max=100, message="姓名长度必须介于 1 和 100 之间") + @ExcelField(title="姓名", align=2, sort=40) + public String getName() { + return name; + } + + @Length(min=1, max=100, message="工号长度必须介于 1 和 100 之间") + @ExcelField(title="工号", align=2, sort=45) + public String getNo() { + return no; + } + + public void setNo(String no) { + this.no = no; + } + + public void setName(String name) { + this.name = name; + } + + @Email(message="邮箱格式不正确") + @Length(min=0, max=200, message="邮箱长度必须介于 1 和 200 之间") + @ExcelField(title="邮箱", align=1, sort=50) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Length(min=0, max=200, message="电话长度必须介于 1 和 200 之间") + @ExcelField(title="电话", align=2, sort=60) + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + @Length(min=0, max=200, message="手机长度必须介于 1 和 200 之间") + @ExcelField(title="手机", align=2, sort=70) + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + @ExcelField(title="备注", align=1, sort=900) + public String getRemarks() { + return remarks; + } + + @Length(min=0, max=100, message="用户类型长度必须介于 1 和 100 之间") + @ExcelField(title="用户类型", align=2, sort=80, dictType="sys_user_type") + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + @ExcelField(title="创建时间", type=0, align=1, sort=90) + public Date getCreateDate() { + return createDate; + } + + @ExcelField(title="最后登录IP", type=1, align=1, sort=100) + public String getLoginIp() { + return loginIp; + } + + public void setLoginIp(String loginIp) { + this.loginIp = loginIp; + } + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ExcelField(title="最后登录日期", type=1, align=1, sort=110) + public Date getLoginDate() { + return loginDate; + } + + public void setLoginDate(Date loginDate) { + this.loginDate = loginDate; + } + + public String getOldLoginName() { + return oldLoginName; + } + + public void setOldLoginName(String oldLoginName) { + this.oldLoginName = oldLoginName; + } + + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(String newPassword) { + this.newPassword = newPassword; + } + + public String getOldLoginIp() { + if (oldLoginIp == null){ + return loginIp; + } + return oldLoginIp; + } + + public void setOldLoginIp(String oldLoginIp) { + this.oldLoginIp = oldLoginIp; + } + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + public Date getOldLoginDate() { + if (oldLoginDate == null){ + return loginDate; + } + return oldLoginDate; + } + + public void setOldLoginDate(Date oldLoginDate) { + this.oldLoginDate = oldLoginDate; + } + + public Role getRole() { + return role; + } + + public void setRole(Role role) { + this.role = role; + } + + @JsonIgnore + @ExcelField(title="拥有角色", align=1, sort=800, fieldType=RoleListType.class) + public List getRoleList() { + return roleList; + } + + public void setRoleList(List roleList) { + this.roleList = roleList; + } + + @JsonIgnore + public List getRoleIdList() { + List roleIdList = Lists.newArrayList(); + for (Role role : roleList) { + roleIdList.add(role.getId()); + } + return roleIdList; + } + + public void setRoleIdList(List roleIdList) { + roleList = Lists.newArrayList(); + for (String roleId : roleIdList) { + Role role = new Role(); + role.setId(roleId); + roleList.add(role); + } + } + + /** + * 用户拥有的角色名称字符串, 多个角色名称用','分隔. + */ + public String getRoleNames() { + return Collections3.extractToString(roleList, "name", ","); + } + + public boolean isAdmin(){ + return isAdmin(this.id); + } + + public static boolean isAdmin(String id){ + return id != null && "1".equals(id); + } + + @Override + public String toString() { + return id; + } } \ No newline at end of file diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/interceptor/LogInterceptor.java b/src/main/java/com/thinkgem/jeesite/modules/sys/interceptor/LogInterceptor.java index 308d305755..dd0964fb71 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/interceptor/LogInterceptor.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/interceptor/LogInterceptor.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.interceptor; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/interceptor/MobileInterceptor.java b/src/main/java/com/thinkgem/jeesite/modules/sys/interceptor/MobileInterceptor.java index 2fe8fbdb87..34fa2cae5b 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/interceptor/MobileInterceptor.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/interceptor/MobileInterceptor.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.interceptor; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/security/FormAuthenticationFilter.java b/src/main/java/com/thinkgem/jeesite/modules/sys/security/FormAuthenticationFilter.java index ef42ae2af2..bafe3792a1 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/security/FormAuthenticationFilter.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/security/FormAuthenticationFilter.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.security; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/security/SystemAuthorizingRealm.java b/src/main/java/com/thinkgem/jeesite/modules/sys/security/SystemAuthorizingRealm.java index c87e9b9382..d11b69afc0 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/security/SystemAuthorizingRealm.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/security/SystemAuthorizingRealm.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.security; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/security/UsernamePasswordToken.java b/src/main/java/com/thinkgem/jeesite/modules/sys/security/UsernamePasswordToken.java index c5ab5715c7..8200be119f 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/security/UsernamePasswordToken.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/security/UsernamePasswordToken.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.security; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/service/AreaService.java b/src/main/java/com/thinkgem/jeesite/modules/sys/service/AreaService.java index c594addb5e..504909fbbe 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/service/AreaService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/service/AreaService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/service/DictService.java b/src/main/java/com/thinkgem/jeesite/modules/sys/service/DictService.java index 201c8e1b62..c8e248bb5e 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/service/DictService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/service/DictService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/service/OfficeService.java b/src/main/java/com/thinkgem/jeesite/modules/sys/service/OfficeService.java index d42a7c93eb..494db7d567 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/service/OfficeService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/service/OfficeService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/service/SystemService.java b/src/main/java/com/thinkgem/jeesite/modules/sys/service/SystemService.java index 92510314d5..ca3e6d0e68 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/service/SystemService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/service/SystemService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/utils/DictUtils.java b/src/main/java/com/thinkgem/jeesite/modules/sys/utils/DictUtils.java index 08e11a16dd..f73d3757b7 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/utils/DictUtils.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/utils/DictUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/utils/LogUtils.java b/src/main/java/com/thinkgem/jeesite/modules/sys/utils/LogUtils.java index 9edceaaebb..11137efc91 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/utils/LogUtils.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/utils/LogUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/utils/UserUtils.java b/src/main/java/com/thinkgem/jeesite/modules/sys/utils/UserUtils.java index 52b908b34f..ea452f281f 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/utils/UserUtils.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/utils/UserUtils.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.utils; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/AreaController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/AreaController.java index 69cd8a033a..d35c2460eb 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/AreaController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/AreaController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/DictController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/DictController.java index 52c7cfedf2..23ab24d9fc 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/DictController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/DictController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/LogController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/LogController.java index c7364ad641..039ff13a45 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/LogController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/LogController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/LoginController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/LoginController.java index 101e8173ac..8294caffea 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/LoginController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/LoginController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/MenuController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/MenuController.java index 13cf4ae420..2131898224 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/MenuController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/MenuController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/OfficeController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/OfficeController.java index 73252f3349..7f0d1c71a3 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/OfficeController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/OfficeController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/RoleController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/RoleController.java index c4dfc2c3ba..3cc81b75b7 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/RoleController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/RoleController.java @@ -1,279 +1,279 @@ -/** - * Copyright © 2012-2014 JeeSite All rights reserved. - */ -package com.thinkgem.jeesite.modules.sys.web; - -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.mvc.support.RedirectAttributes; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.thinkgem.jeesite.common.config.Global; -import com.thinkgem.jeesite.common.persistence.Page; -import com.thinkgem.jeesite.common.utils.Collections3; -import com.thinkgem.jeesite.common.utils.StringUtils; -import com.thinkgem.jeesite.common.web.BaseController; -import com.thinkgem.jeesite.modules.sys.entity.Office; -import com.thinkgem.jeesite.modules.sys.entity.Role; -import com.thinkgem.jeesite.modules.sys.entity.User; -import com.thinkgem.jeesite.modules.sys.service.OfficeService; -import com.thinkgem.jeesite.modules.sys.service.SystemService; -import com.thinkgem.jeesite.modules.sys.utils.UserUtils; - -/** - * 角色Controller - * @author ThinkGem - * @version 2013-12-05 - */ -@Controller -@RequestMapping(value = "${adminPath}/sys/role") -public class RoleController extends BaseController { - - @Autowired - private SystemService systemService; - - @Autowired - private OfficeService officeService; - - @ModelAttribute("role") - public Role get(@RequestParam(required=false) String id) { - if (StringUtils.isNotBlank(id)){ - return systemService.getRole(id); - }else{ - return new Role(); - } - } - - @RequiresPermissions("sys:role:view") - @RequestMapping(value = {"list", ""}) - public String list(Role role, Model model) { - List list = systemService.findAllRole(); - model.addAttribute("list", list); - return "modules/sys/roleList"; - } - - @RequiresPermissions("sys:role:view") - @RequestMapping(value = "form") - public String form(Role role, Model model) { - if (role.getOffice()==null){ - role.setOffice(UserUtils.getUser().getOffice()); - } - model.addAttribute("role", role); - model.addAttribute("menuList", systemService.findAllMenu()); - model.addAttribute("officeList", officeService.findAll()); - return "modules/sys/roleForm"; - } - - @RequiresPermissions("sys:role:edit") - @RequestMapping(value = "save") - public String save(Role role, Model model, RedirectAttributes redirectAttributes) { - if(!UserUtils.getUser().isAdmin()&&role.getSysData().equals(Global.YES)){ - addMessage(redirectAttributes, "越权操作,只有超级管理员才能修改此数据!"); - return "redirect:" + adminPath + "/sys/role/?repage"; - } - if(Global.isDemoMode()){ - addMessage(redirectAttributes, "演示模式,不允许操作!"); - return "redirect:" + adminPath + "/sys/role/?repage"; - } - if (!beanValidator(model, role)){ - return form(role, model); - } - if (!"true".equals(checkName(role.getOldName(), role.getName()))){ - addMessage(model, "保存角色'" + role.getName() + "'失败, 角色名已存在"); - return form(role, model); - } - if (!"true".equals(checkEnname(role.getOldEnname(), role.getEnname()))){ - addMessage(model, "保存角色'" + role.getName() + "'失败, 英文名已存在"); - return form(role, model); - } - systemService.saveRole(role); - addMessage(redirectAttributes, "保存角色'" + role.getName() + "'成功"); - return "redirect:" + adminPath + "/sys/role/?repage"; - } - - @RequiresPermissions("sys:role:edit") - @RequestMapping(value = "delete") - public String delete(Role role, RedirectAttributes redirectAttributes) { - if(!UserUtils.getUser().isAdmin() && role.getSysData().equals(Global.YES)){ - addMessage(redirectAttributes, "越权操作,只有超级管理员才能修改此数据!"); - return "redirect:" + adminPath + "/sys/role/?repage"; - } - if(Global.isDemoMode()){ - addMessage(redirectAttributes, "演示模式,不允许操作!"); - return "redirect:" + adminPath + "/sys/role/?repage"; - } -// if (Role.isAdmin(id)){ -// addMessage(redirectAttributes, "删除角色失败, 不允许内置角色或编号空"); -//// }else if (UserUtils.getUser().getRoleIdList().contains(id)){ -//// addMessage(redirectAttributes, "删除角色失败, 不能删除当前用户所在角色"); -// }else{ - systemService.deleteRole(role); - addMessage(redirectAttributes, "删除角色成功"); -// } - return "redirect:" + adminPath + "/sys/role/?repage"; - } - - /** - * 角色分配页面 - * @param role - * @param model - * @return - */ - @RequiresPermissions("sys:role:edit") - @RequestMapping(value = "assign") - public String assign(Role role, Model model) { - List userList = systemService.findUser(new User(new Role(role.getId()))); - model.addAttribute("userList", userList); - return "modules/sys/roleAssign"; - } - - /** - * 角色分配 -- 打开角色分配对话框 - * @param role - * @param model - * @return - */ - @RequiresPermissions("sys:role:view") - @RequestMapping(value = "usertorole") - public String selectUserToRole(Role role, Model model) { - List userList = systemService.findUser(new User(new Role(role.getId()))); - model.addAttribute("role", role); - model.addAttribute("userList", userList); - model.addAttribute("selectIds", Collections3.extractToString(userList, "name", ",")); - model.addAttribute("officeList", officeService.findAll()); - return "modules/sys/selectUserToRole"; - } - - /** - * 角色分配 -- 根据部门编号获取用户列表 - * @param officeId - * @param response - * @return - */ - @RequiresPermissions("sys:role:view") - @ResponseBody - @RequestMapping(value = "users") - public List> users(String officeId, HttpServletResponse response) { - List> mapList = Lists.newArrayList(); - User user = new User(); - user.setOffice(new Office(officeId)); - Page page = systemService.findUser(new Page(1, -1), user); - for (User e : page.getList()) { - Map map = Maps.newHashMap(); - map.put("id", e.getId()); - map.put("pId", 0); - map.put("name", e.getName()); - mapList.add(map); - } - return mapList; - } - - /** - * 角色分配 -- 从角色中移除用户 - * @param userId - * @param roleId - * @param redirectAttributes - * @return - */ - @RequiresPermissions("sys:role:edit") - @RequestMapping(value = "outrole") - public String outrole(String userId, String roleId, RedirectAttributes redirectAttributes) { - if(Global.isDemoMode()){ - addMessage(redirectAttributes, "演示模式,不允许操作!"); - return "redirect:" + adminPath + "/sys/role/assign?id="+roleId; - } - Role role = systemService.getRole(roleId); - User user = systemService.getUser(userId); - if (UserUtils.getUser().getId().equals(userId)) { - addMessage(redirectAttributes, "无法从角色【" + role.getName() + "】中移除用户【" + user.getName() + "】自己!"); - }else { - if (user.getRoleList().size() <= 1){ - addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除失败!这已经是该用户的唯一角色,不能移除。"); - }else{ - Boolean flag = systemService.outUserInRole(role, user); - if (!flag) { - addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除失败!"); - }else { - addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除成功!"); - } - } - } - return "redirect:" + adminPath + "/sys/role/assign?id="+role.getId(); - } - - /** - * 角色分配 - * @param role - * @param idsArr - * @param redirectAttributes - * @return - */ - @RequiresPermissions("sys:role:edit") - @RequestMapping(value = "assignrole") - public String assignRole(Role role, String[] idsArr, RedirectAttributes redirectAttributes) { - if(Global.isDemoMode()){ - addMessage(redirectAttributes, "演示模式,不允许操作!"); - return "redirect:" + adminPath + "/sys/role/assign?id="+role.getId(); - } - StringBuilder msg = new StringBuilder(); - int newNum = 0; - for (int i = 0; i < idsArr.length; i++) { - User user = systemService.assignUserToRole(role, systemService.getUser(idsArr[i])); - if (null != user) { - msg.append("
新增用户【" + user.getName() + "】到角色【" + role.getName() + "】!"); - newNum++; - } - } - addMessage(redirectAttributes, "已成功分配 "+newNum+" 个用户"+msg); - return "redirect:" + adminPath + "/sys/role/assign?id="+role.getId(); - } - - /** - * 验证角色名是否有效 - * @param oldName - * @param name - * @return - */ - @RequiresPermissions("user") - @ResponseBody - @RequestMapping(value = "checkName") - public String checkName(String oldName, String name) { - if (name!=null && name.equals(oldName)) { - return "true"; - } else if (name!=null && systemService.getRoleByName(name) == null) { - return "true"; - } - return "false"; - } - - /** - * 验证角色英文名是否有效 - * @param oldName - * @param name - * @return - */ - @RequiresPermissions("user") - @ResponseBody - @RequestMapping(value = "checkEnname") - public String checkEnname(String oldEnname, String enname) { - if (enname!=null && enname.equals(oldEnname)) { - return "true"; - } else if (enname!=null && systemService.getRoleByEnname(enname) == null) { - return "true"; - } - return "false"; - } - -} +/** + * Copyright © 2012-2016 JeeSite All rights reserved. + */ +package com.thinkgem.jeesite.modules.sys.web; + +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.thinkgem.jeesite.common.config.Global; +import com.thinkgem.jeesite.common.persistence.Page; +import com.thinkgem.jeesite.common.utils.Collections3; +import com.thinkgem.jeesite.common.utils.StringUtils; +import com.thinkgem.jeesite.common.web.BaseController; +import com.thinkgem.jeesite.modules.sys.entity.Office; +import com.thinkgem.jeesite.modules.sys.entity.Role; +import com.thinkgem.jeesite.modules.sys.entity.User; +import com.thinkgem.jeesite.modules.sys.service.OfficeService; +import com.thinkgem.jeesite.modules.sys.service.SystemService; +import com.thinkgem.jeesite.modules.sys.utils.UserUtils; + +/** + * 角色Controller + * @author ThinkGem + * @version 2013-12-05 + */ +@Controller +@RequestMapping(value = "${adminPath}/sys/role") +public class RoleController extends BaseController { + + @Autowired + private SystemService systemService; + + @Autowired + private OfficeService officeService; + + @ModelAttribute("role") + public Role get(@RequestParam(required=false) String id) { + if (StringUtils.isNotBlank(id)){ + return systemService.getRole(id); + }else{ + return new Role(); + } + } + + @RequiresPermissions("sys:role:view") + @RequestMapping(value = {"list", ""}) + public String list(Role role, Model model) { + List list = systemService.findAllRole(); + model.addAttribute("list", list); + return "modules/sys/roleList"; + } + + @RequiresPermissions("sys:role:view") + @RequestMapping(value = "form") + public String form(Role role, Model model) { + if (role.getOffice()==null){ + role.setOffice(UserUtils.getUser().getOffice()); + } + model.addAttribute("role", role); + model.addAttribute("menuList", systemService.findAllMenu()); + model.addAttribute("officeList", officeService.findAll()); + return "modules/sys/roleForm"; + } + + @RequiresPermissions("sys:role:edit") + @RequestMapping(value = "save") + public String save(Role role, Model model, RedirectAttributes redirectAttributes) { + if(!UserUtils.getUser().isAdmin()&&role.getSysData().equals(Global.YES)){ + addMessage(redirectAttributes, "越权操作,只有超级管理员才能修改此数据!"); + return "redirect:" + adminPath + "/sys/role/?repage"; + } + if(Global.isDemoMode()){ + addMessage(redirectAttributes, "演示模式,不允许操作!"); + return "redirect:" + adminPath + "/sys/role/?repage"; + } + if (!beanValidator(model, role)){ + return form(role, model); + } + if (!"true".equals(checkName(role.getOldName(), role.getName()))){ + addMessage(model, "保存角色'" + role.getName() + "'失败, 角色名已存在"); + return form(role, model); + } + if (!"true".equals(checkEnname(role.getOldEnname(), role.getEnname()))){ + addMessage(model, "保存角色'" + role.getName() + "'失败, 英文名已存在"); + return form(role, model); + } + systemService.saveRole(role); + addMessage(redirectAttributes, "保存角色'" + role.getName() + "'成功"); + return "redirect:" + adminPath + "/sys/role/?repage"; + } + + @RequiresPermissions("sys:role:edit") + @RequestMapping(value = "delete") + public String delete(Role role, RedirectAttributes redirectAttributes) { + if(!UserUtils.getUser().isAdmin() && role.getSysData().equals(Global.YES)){ + addMessage(redirectAttributes, "越权操作,只有超级管理员才能修改此数据!"); + return "redirect:" + adminPath + "/sys/role/?repage"; + } + if(Global.isDemoMode()){ + addMessage(redirectAttributes, "演示模式,不允许操作!"); + return "redirect:" + adminPath + "/sys/role/?repage"; + } +// if (Role.isAdmin(id)){ +// addMessage(redirectAttributes, "删除角色失败, 不允许内置角色或编号空"); +//// }else if (UserUtils.getUser().getRoleIdList().contains(id)){ +//// addMessage(redirectAttributes, "删除角色失败, 不能删除当前用户所在角色"); +// }else{ + systemService.deleteRole(role); + addMessage(redirectAttributes, "删除角色成功"); +// } + return "redirect:" + adminPath + "/sys/role/?repage"; + } + + /** + * 角色分配页面 + * @param role + * @param model + * @return + */ + @RequiresPermissions("sys:role:edit") + @RequestMapping(value = "assign") + public String assign(Role role, Model model) { + List userList = systemService.findUser(new User(new Role(role.getId()))); + model.addAttribute("userList", userList); + return "modules/sys/roleAssign"; + } + + /** + * 角色分配 -- 打开角色分配对话框 + * @param role + * @param model + * @return + */ + @RequiresPermissions("sys:role:view") + @RequestMapping(value = "usertorole") + public String selectUserToRole(Role role, Model model) { + List userList = systemService.findUser(new User(new Role(role.getId()))); + model.addAttribute("role", role); + model.addAttribute("userList", userList); + model.addAttribute("selectIds", Collections3.extractToString(userList, "name", ",")); + model.addAttribute("officeList", officeService.findAll()); + return "modules/sys/selectUserToRole"; + } + + /** + * 角色分配 -- 根据部门编号获取用户列表 + * @param officeId + * @param response + * @return + */ + @RequiresPermissions("sys:role:view") + @ResponseBody + @RequestMapping(value = "users") + public List> users(String officeId, HttpServletResponse response) { + List> mapList = Lists.newArrayList(); + User user = new User(); + user.setOffice(new Office(officeId)); + Page page = systemService.findUser(new Page(1, -1), user); + for (User e : page.getList()) { + Map map = Maps.newHashMap(); + map.put("id", e.getId()); + map.put("pId", 0); + map.put("name", e.getName()); + mapList.add(map); + } + return mapList; + } + + /** + * 角色分配 -- 从角色中移除用户 + * @param userId + * @param roleId + * @param redirectAttributes + * @return + */ + @RequiresPermissions("sys:role:edit") + @RequestMapping(value = "outrole") + public String outrole(String userId, String roleId, RedirectAttributes redirectAttributes) { + if(Global.isDemoMode()){ + addMessage(redirectAttributes, "演示模式,不允许操作!"); + return "redirect:" + adminPath + "/sys/role/assign?id="+roleId; + } + Role role = systemService.getRole(roleId); + User user = systemService.getUser(userId); + if (UserUtils.getUser().getId().equals(userId)) { + addMessage(redirectAttributes, "无法从角色【" + role.getName() + "】中移除用户【" + user.getName() + "】自己!"); + }else { + if (user.getRoleList().size() <= 1){ + addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除失败!这已经是该用户的唯一角色,不能移除。"); + }else{ + Boolean flag = systemService.outUserInRole(role, user); + if (!flag) { + addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除失败!"); + }else { + addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除成功!"); + } + } + } + return "redirect:" + adminPath + "/sys/role/assign?id="+role.getId(); + } + + /** + * 角色分配 + * @param role + * @param idsArr + * @param redirectAttributes + * @return + */ + @RequiresPermissions("sys:role:edit") + @RequestMapping(value = "assignrole") + public String assignRole(Role role, String[] idsArr, RedirectAttributes redirectAttributes) { + if(Global.isDemoMode()){ + addMessage(redirectAttributes, "演示模式,不允许操作!"); + return "redirect:" + adminPath + "/sys/role/assign?id="+role.getId(); + } + StringBuilder msg = new StringBuilder(); + int newNum = 0; + for (int i = 0; i < idsArr.length; i++) { + User user = systemService.assignUserToRole(role, systemService.getUser(idsArr[i])); + if (null != user) { + msg.append("
新增用户【" + user.getName() + "】到角色【" + role.getName() + "】!"); + newNum++; + } + } + addMessage(redirectAttributes, "已成功分配 "+newNum+" 个用户"+msg); + return "redirect:" + adminPath + "/sys/role/assign?id="+role.getId(); + } + + /** + * 验证角色名是否有效 + * @param oldName + * @param name + * @return + */ + @RequiresPermissions("user") + @ResponseBody + @RequestMapping(value = "checkName") + public String checkName(String oldName, String name) { + if (name!=null && name.equals(oldName)) { + return "true"; + } else if (name!=null && systemService.getRoleByName(name) == null) { + return "true"; + } + return "false"; + } + + /** + * 验证角色英文名是否有效 + * @param oldName + * @param name + * @return + */ + @RequiresPermissions("user") + @ResponseBody + @RequestMapping(value = "checkEnname") + public String checkEnname(String oldEnname, String enname) { + if (enname!=null && enname.equals(oldEnname)) { + return "true"; + } else if (enname!=null && systemService.getRoleByEnname(enname) == null) { + return "true"; + } + return "false"; + } + +} diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/TagController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/TagController.java index e60f496967..f9d4af92f6 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/TagController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/TagController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/sys/web/UserController.java b/src/main/java/com/thinkgem/jeesite/modules/sys/web/UserController.java index 33c3802ddb..de8d3a4e45 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/sys/web/UserController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/sys/web/UserController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.sys.web; diff --git a/src/main/java/com/thinkgem/jeesite/modules/test/dao/TestDao.java b/src/main/java/com/thinkgem/jeesite/modules/test/dao/TestDao.java index eb55ce98ef..d22a9379e7 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/test/dao/TestDao.java +++ b/src/main/java/com/thinkgem/jeesite/modules/test/dao/TestDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.test.dao; diff --git a/src/main/java/com/thinkgem/jeesite/modules/test/entity/Test.java b/src/main/java/com/thinkgem/jeesite/modules/test/entity/Test.java index af478f1e4b..79662bd4e2 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/test/entity/Test.java +++ b/src/main/java/com/thinkgem/jeesite/modules/test/entity/Test.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.test.entity; diff --git a/src/main/java/com/thinkgem/jeesite/modules/test/service/TestService.java b/src/main/java/com/thinkgem/jeesite/modules/test/service/TestService.java index ff051d33d9..55769c4f5e 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/test/service/TestService.java +++ b/src/main/java/com/thinkgem/jeesite/modules/test/service/TestService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.test.service; diff --git a/src/main/java/com/thinkgem/jeesite/modules/test/web/TestController.java b/src/main/java/com/thinkgem/jeesite/modules/test/web/TestController.java index 6ad5b114e8..f6d6c88950 100644 --- a/src/main/java/com/thinkgem/jeesite/modules/test/web/TestController.java +++ b/src/main/java/com/thinkgem/jeesite/modules/test/web/TestController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.modules.test.web; diff --git a/src/main/java/com/thinkgem/jeesite/test/dao/TestDataChildDao.java b/src/main/java/com/thinkgem/jeesite/test/dao/TestDataChildDao.java index e80689218f..b933963e3a 100644 --- a/src/main/java/com/thinkgem/jeesite/test/dao/TestDataChildDao.java +++ b/src/main/java/com/thinkgem/jeesite/test/dao/TestDataChildDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.dao; diff --git a/src/main/java/com/thinkgem/jeesite/test/dao/TestDataDao.java b/src/main/java/com/thinkgem/jeesite/test/dao/TestDataDao.java index 375caced4c..aac2134367 100644 --- a/src/main/java/com/thinkgem/jeesite/test/dao/TestDataDao.java +++ b/src/main/java/com/thinkgem/jeesite/test/dao/TestDataDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.dao; diff --git a/src/main/java/com/thinkgem/jeesite/test/dao/TestDataMainDao.java b/src/main/java/com/thinkgem/jeesite/test/dao/TestDataMainDao.java index 348cf5db86..d28a0cafd3 100644 --- a/src/main/java/com/thinkgem/jeesite/test/dao/TestDataMainDao.java +++ b/src/main/java/com/thinkgem/jeesite/test/dao/TestDataMainDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.dao; diff --git a/src/main/java/com/thinkgem/jeesite/test/dao/TestTreeDao.java b/src/main/java/com/thinkgem/jeesite/test/dao/TestTreeDao.java index e1c275f75e..465b4fc50f 100644 --- a/src/main/java/com/thinkgem/jeesite/test/dao/TestTreeDao.java +++ b/src/main/java/com/thinkgem/jeesite/test/dao/TestTreeDao.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.dao; diff --git a/src/main/java/com/thinkgem/jeesite/test/entity/TestData.java b/src/main/java/com/thinkgem/jeesite/test/entity/TestData.java index fe1aa1fe4c..795e36b205 100644 --- a/src/main/java/com/thinkgem/jeesite/test/entity/TestData.java +++ b/src/main/java/com/thinkgem/jeesite/test/entity/TestData.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.entity; diff --git a/src/main/java/com/thinkgem/jeesite/test/entity/TestDataChild.java b/src/main/java/com/thinkgem/jeesite/test/entity/TestDataChild.java index 93b6c9b5bf..c0bb404c26 100644 --- a/src/main/java/com/thinkgem/jeesite/test/entity/TestDataChild.java +++ b/src/main/java/com/thinkgem/jeesite/test/entity/TestDataChild.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.entity; diff --git a/src/main/java/com/thinkgem/jeesite/test/entity/TestDataMain.java b/src/main/java/com/thinkgem/jeesite/test/entity/TestDataMain.java index 569d3e616d..daaf1acd78 100644 --- a/src/main/java/com/thinkgem/jeesite/test/entity/TestDataMain.java +++ b/src/main/java/com/thinkgem/jeesite/test/entity/TestDataMain.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.entity; diff --git a/src/main/java/com/thinkgem/jeesite/test/entity/TestTree.java b/src/main/java/com/thinkgem/jeesite/test/entity/TestTree.java index 0e52e45d37..27f683186b 100644 --- a/src/main/java/com/thinkgem/jeesite/test/entity/TestTree.java +++ b/src/main/java/com/thinkgem/jeesite/test/entity/TestTree.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.entity; diff --git a/src/main/java/com/thinkgem/jeesite/test/service/TestDataMainService.java b/src/main/java/com/thinkgem/jeesite/test/service/TestDataMainService.java index a7f187d5e8..f3a4a52714 100644 --- a/src/main/java/com/thinkgem/jeesite/test/service/TestDataMainService.java +++ b/src/main/java/com/thinkgem/jeesite/test/service/TestDataMainService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.service; diff --git a/src/main/java/com/thinkgem/jeesite/test/service/TestDataService.java b/src/main/java/com/thinkgem/jeesite/test/service/TestDataService.java index 64be7f2aeb..849d5980e5 100644 --- a/src/main/java/com/thinkgem/jeesite/test/service/TestDataService.java +++ b/src/main/java/com/thinkgem/jeesite/test/service/TestDataService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.service; diff --git a/src/main/java/com/thinkgem/jeesite/test/service/TestTreeService.java b/src/main/java/com/thinkgem/jeesite/test/service/TestTreeService.java index 78d06d5c41..16c5dfba15 100644 --- a/src/main/java/com/thinkgem/jeesite/test/service/TestTreeService.java +++ b/src/main/java/com/thinkgem/jeesite/test/service/TestTreeService.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.service; diff --git a/src/main/java/com/thinkgem/jeesite/test/web/TestDataController.java b/src/main/java/com/thinkgem/jeesite/test/web/TestDataController.java index 5d91d3c46c..19035ee66e 100644 --- a/src/main/java/com/thinkgem/jeesite/test/web/TestDataController.java +++ b/src/main/java/com/thinkgem/jeesite/test/web/TestDataController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.web; diff --git a/src/main/java/com/thinkgem/jeesite/test/web/TestDataMainController.java b/src/main/java/com/thinkgem/jeesite/test/web/TestDataMainController.java index a2317412f7..5735baf8b7 100644 --- a/src/main/java/com/thinkgem/jeesite/test/web/TestDataMainController.java +++ b/src/main/java/com/thinkgem/jeesite/test/web/TestDataMainController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.web; diff --git a/src/main/java/com/thinkgem/jeesite/test/web/TestTreeController.java b/src/main/java/com/thinkgem/jeesite/test/web/TestTreeController.java index 3789f9e523..9128e79c47 100644 --- a/src/main/java/com/thinkgem/jeesite/test/web/TestTreeController.java +++ b/src/main/java/com/thinkgem/jeesite/test/web/TestTreeController.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.test.web; diff --git a/src/main/resources/jeesite.properties b/src/main/resources/jeesite.properties index cbedd5b306..e29492c639 100644 --- a/src/main/resources/jeesite.properties +++ b/src/main/resources/jeesite.properties @@ -42,8 +42,8 @@ redis.port=6379 #\u4ea7\u54c1\u4fe1\u606f\u8bbe\u7f6e productName=JeeSite \u5feb\u901f\u5f00\u53d1\u5e73\u53f0 -copyrightYear=2014 -version=V1.2.6 +copyrightYear=2016 +version=V1.2.7 #\u6f14\u793a\u6a21\u5f0f: \u4e0d\u80fd\u64cd\u4f5c\u548c\u4fdd\u5b58\u7684\u6a21\u5757\uff1a sys: area/office/user/role/menu/dict, cms: site/category demoMode=false diff --git a/src/main/resources/templates/modules/gen/curd/controller.xml b/src/main/resources/templates/modules/gen/curd/controller.xml index 18c350a6fb..425a399ee6 100644 --- a/src/main/resources/templates/modules/gen/curd/controller.xml +++ b/src/main/resources/templates/modules/gen/curd/controller.xml @@ -5,7 +5,7 @@ ${ClassName}Controller.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.web<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/resources/templates/modules/gen/curd/service.xml b/src/main/resources/templates/modules/gen/curd/service.xml index 6b6e1a2605..3d475b0e5c 100644 --- a/src/main/resources/templates/modules/gen/curd/service.xml +++ b/src/main/resources/templates/modules/gen/curd/service.xml @@ -5,7 +5,7 @@ ${ClassName}Service.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.service<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/resources/templates/modules/gen/curd/serviceMany.xml b/src/main/resources/templates/modules/gen/curd/serviceMany.xml index 7e9baa2bc6..e9019daa52 100644 --- a/src/main/resources/templates/modules/gen/curd/serviceMany.xml +++ b/src/main/resources/templates/modules/gen/curd/serviceMany.xml @@ -5,7 +5,7 @@ ${ClassName}Service.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.service<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/resources/templates/modules/gen/dao/dao.xml b/src/main/resources/templates/modules/gen/dao/dao.xml index 4d1c977ac6..b173b63b89 100644 --- a/src/main/resources/templates/modules/gen/dao/dao.xml +++ b/src/main/resources/templates/modules/gen/dao/dao.xml @@ -5,7 +5,7 @@ ${ClassName}Dao.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.dao<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/resources/templates/modules/gen/dao/entity.xml b/src/main/resources/templates/modules/gen/dao/entity.xml index e15f19a84a..97ac64e4df 100644 --- a/src/main/resources/templates/modules/gen/dao/entity.xml +++ b/src/main/resources/templates/modules/gen/dao/entity.xml @@ -5,7 +5,7 @@ ${ClassName}.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.entity<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/resources/templates/modules/gen/treetable/controller.xml b/src/main/resources/templates/modules/gen/treetable/controller.xml index 49409e106a..7aaf863cf1 100644 --- a/src/main/resources/templates/modules/gen/treetable/controller.xml +++ b/src/main/resources/templates/modules/gen/treetable/controller.xml @@ -5,7 +5,7 @@ ${ClassName}Controller.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.web<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/resources/templates/modules/gen/treetable/dao.xml b/src/main/resources/templates/modules/gen/treetable/dao.xml index 7ae5db8eb7..cb513f701d 100644 --- a/src/main/resources/templates/modules/gen/treetable/dao.xml +++ b/src/main/resources/templates/modules/gen/treetable/dao.xml @@ -5,7 +5,7 @@ ${ClassName}Dao.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.dao<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/resources/templates/modules/gen/treetable/entity.xml b/src/main/resources/templates/modules/gen/treetable/entity.xml index bebb03f655..08d63d9fae 100644 --- a/src/main/resources/templates/modules/gen/treetable/entity.xml +++ b/src/main/resources/templates/modules/gen/treetable/entity.xml @@ -5,7 +5,7 @@ ${ClassName}.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.entity<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/resources/templates/modules/gen/treetable/service.xml b/src/main/resources/templates/modules/gen/treetable/service.xml index dca10d4460..6005c35af4 100644 --- a/src/main/resources/templates/modules/gen/treetable/service.xml +++ b/src/main/resources/templates/modules/gen/treetable/service.xml @@ -5,7 +5,7 @@ ${ClassName}Service.java JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package ${packageName}.${moduleName}.service<#if subModuleName != "">.${subModuleName}; diff --git a/src/main/webapp/WEB-INF/views/modules/act/actModelList.jsp b/src/main/webapp/WEB-INF/views/modules/act/actModelList.jsp index 5a27651f1d..4f5086e160 100644 --- a/src/main/webapp/WEB-INF/views/modules/act/actModelList.jsp +++ b/src/main/webapp/WEB-INF/views/modules/act/actModelList.jsp @@ -22,6 +22,7 @@ style="text-align:center;" class="form-search" onsubmit="loading('正在分类,请稍等...');">
- +
- - + + - - + + + + + + + - - - - - - diff --git a/src/main/webapp/WEB-INF/views/modules/act/actProcessList.jsp b/src/main/webapp/WEB-INF/views/modules/act/actProcessList.jsp index e5487e8641..e57327a1cc 100644 --- a/src/main/webapp/WEB-INF/views/modules/act/actProcessList.jsp +++ b/src/main/webapp/WEB-INF/views/modules/act/actProcessList.jsp @@ -22,6 +22,7 @@ style="text-align:center;" class="form-search" onsubmit="loading('正在设置,请稍等...');">
-
分类操作流程分类 模型ID 模型标识 模型名称 版本号 创建时间 最后更新时间操作
${fns:getDictLabel(model.category,'act_category','无分类')} + ${fns:getDictLabel(model.category,'act_category','无分类')}${model.id}${model.key}${model.name}V: ${model.version} 编辑 部署 导出 删除 ${model.id}${model.key}${model.name}V: ${model.version}
+
- - + @@ -59,6 +59,7 @@ + @@ -66,8 +67,15 @@ - - + + + + + + + + - - - - - - - diff --git a/src/main/webapp/static/common/jeesite.css b/src/main/webapp/static/common/jeesite.css index 8f859a79ac..5864c31c7d 100644 --- a/src/main/webapp/static/common/jeesite.css +++ b/src/main/webapp/static/common/jeesite.css @@ -32,6 +32,7 @@ input.btn:hover {*color:#333333} .table th, .table td {vertical-align:middle;} .table td i{margin:0 2px;} .table-striped tbody>tr:nth-child(odd)>td, .table-striped tbody>tr:nth-child(odd)>th{background-color:#F5F5F5} +.table-nowrap td {width:200px;max-width:175px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} .sort-column{color:#0663A2;cursor:pointer;} diff --git a/src/main/webapp/static/common/jeesite.js b/src/main/webapp/static/common/jeesite.js index ea4cba9791..855ae71006 100644 --- a/src/main/webapp/static/common/jeesite.js +++ b/src/main/webapp/static/common/jeesite.js @@ -1,5 +1,5 @@ /*! - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. * * 通用公共方法 * @author ThinkGem diff --git a/src/main/webapp/static/common/jeesite.min.css b/src/main/webapp/static/common/jeesite.min.css index 1706c63d61..8626c0a0d1 100644 --- a/src/main/webapp/static/common/jeesite.min.css +++ b/src/main/webapp/static/common/jeesite.min.css @@ -1,5 +1,5 @@ /*! * Copyright © 2012-2013 JeeSite All rights reserved. */html,body{scrollbar-face-color:#fff;scrollbar-highlight-color:#fff;scrollbar-darkshadow-color:#fff;padding:0}img{max-width:auto}h1{font-size:30px}h1,h2,h3,h4,h5,h6{margin:0}a{outline:0}a:active{star:expression(this.onFocus=this.blur())}body,label,input,button,select,textarea,.uneditable-input,.navbar-search .search-query{font-family:Helvetica,Georgia,Arial,sans-serif,宋体;font-size:13px;_font-size:12px}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:middle}label{display:inline-block;margin-bottom:0}input[type="radio"],input[type="checkbox"]{margin:-2px 3px;*margin-top:1px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:auto;background-color:#f3f3f3}.input-prepend input,.input-append input,.input-prepend select,.input-append select,.input-prepend .uneditable-input,.input-append .uneditable-input{position:static}legend{margin:10px 0;*left:-7px;*position:relative;color:#08c;*width:99.5%}.collapse{*display:none;_position:static}.collapse.in{*display:block}.close{opacity:.3;filter:alpha(opacity=30)}.close:hover{opacity:.8;filter:alpha(opacity=80)}a.btn,button.btn{*padding:4px 10px 4px;*border:1px solid #ccc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe',endColorstr='#e6e6e6',GradientType=0)}a.btn-primary,a.btn-primary:hover,a.btn-warning,a.btn-warning:hover,a.btn-danger,a.btn-danger:hover,a.btn-success,a.btn-success:hover,a.btn-info,a.btn-info:hover,a.btn-inverse,a.btn-inverse:hover{*padding:4px 10px 3px}button.btn{*padding:3px 10px 2px;*background-color:transparent}.btn-group a.btn,.btn-group button.btn,.btn-group button.btn:hover{position:static}.btn-group a.btn+a.btn,.btn-group button.btn+button.btn{margin-left:-2px}.nav,.breadcrumb{margin-bottom:8px}.nav-list li a{margin-top:5px;margin-bottom:5px;_padding-top:6px} -.nav-list li a i{_margin-top:-1px}.table{margin-bottom:8px;background-color:#fdfdfd}.table th,.table td{vertical-align:middle}.table td i{margin:0 2px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f5f5f5}.sort-column{color:#0663a2;cursor:pointer}.supcan{border:1px #d3d3d3 solid;height:300px}.control-group{padding-bottom:8px;margin-bottom:0;border-bottom:1px dotted #ddd}legend+.control-group{margin-top:8px}.controls .lbl{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.measure-input{background:url("../images/ruler.gif") repeat-x scroll 0 bottom transparent}.input-min{width:30px}.input-mini{width:90px}.input-small{width:120px}.input-medium{width:163px}.input-xxlarge{width:460px}.help-block,.help-inline{color:#aaa}.alert{margin-bottom:10px}.form-search label{margin-left:10px}.form-search span label{margin-left:0}.form-search .ul-form{margin:0;overflow:hidden}.form-search .ul-form li{float:left;list-style:none;height:35px;line-height:35px}.form-search .ul-form li label{width:80px;text-align:right}.form-search .ul-form li span label{width:auto}.form-search .ul-form li.clearfix{float:none}.form-search .ul-form li.btns{padding-left:10px}.form-search .ul-form li.btns .btn{margin-right:5px}.form-horizontal{margin:0 10px}.form-horizontal .control-group{margin-bottom:8px}.form-horizontal .control-label{padding-top:3px}.form-horizontal .controls{text-align:left;overflow-x:auto;overflow-y:hidden}.form-horizontal .controls label.error{background-position:0 2px}.form-horizontal .table-form{width:100%;border-color:#ddd}.form-horizontal .table-form,.form-horizontal .table-form td{border:1px solid #ddd;background-color:#fdfdfd;padding:4px}.form-horizontal .table-form td.tit{background:#fafafa;text-align:center;padding-right:8px;white-space:nowrap}.form-horizontal .form-actions{margin-bottom:0}.form-horizontal fieldset .row-fluid{margin-bottom:10px}.pagination{margin:8px 0}.pagination .controls a{border:0}.pagination .controls input{border:0;color:#999;width:30px;padding:0;margin:-3px 0 0 0;text-align:center} +.nav-list li a i{_margin-top:-1px}.table{margin-bottom:8px;background-color:#fdfdfd}.table th,.table td{vertical-align:middle}.table td i{margin:0 2px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f5f5f5}.table-nowrap td {width:200px;max-width:175px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sort-column{color:#0663a2;cursor:pointer}.supcan{border:1px #d3d3d3 solid;height:300px}.control-group{padding-bottom:8px;margin-bottom:0;border-bottom:1px dotted #ddd}legend+.control-group{margin-top:8px}.controls .lbl{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.measure-input{background:url("../images/ruler.gif") repeat-x scroll 0 bottom transparent}.input-min{width:30px}.input-mini{width:90px}.input-small{width:120px}.input-medium{width:163px}.input-xxlarge{width:460px}.help-block,.help-inline{color:#aaa}.alert{margin-bottom:10px}.form-search label{margin-left:10px}.form-search span label{margin-left:0}.form-search .ul-form{margin:0;overflow:hidden}.form-search .ul-form li{float:left;list-style:none;height:35px;line-height:35px}.form-search .ul-form li label{width:80px;text-align:right}.form-search .ul-form li span label{width:auto}.form-search .ul-form li.clearfix{float:none}.form-search .ul-form li.btns{padding-left:10px}.form-search .ul-form li.btns .btn{margin-right:5px}.form-horizontal{margin:0 10px}.form-horizontal .control-group{margin-bottom:8px}.form-horizontal .control-label{padding-top:3px}.form-horizontal .controls{text-align:left;overflow-x:auto;overflow-y:hidden}.form-horizontal .controls label.error{background-position:0 2px}.form-horizontal .table-form{width:100%;border-color:#ddd}.form-horizontal .table-form,.form-horizontal .table-form td{border:1px solid #ddd;background-color:#fdfdfd;padding:4px}.form-horizontal .table-form td.tit{background:#fafafa;text-align:center;padding-right:8px;white-space:nowrap}.form-horizontal .form-actions{margin-bottom:0}.form-horizontal fieldset .row-fluid{margin-bottom:10px}.pagination{margin:8px 0}.pagination .controls a{border:0}.pagination .controls input{border:0;color:#999;width:30px;padding:0;margin:-3px 0 0 0;text-align:center} .modal-backdrop{background-color:#fff}.modal-backdrop,.modal-backdrop.fade.in{opacity:.5;filter:alpha(opacity=50)}.modal.tree{width:300px;margin:-250px 0 0 -180px;*margin:-200px 0 0 -150px}.modal.tree .modal-body{height:260px;padding:20px 25px}.accordion-heading,.table th{white-space:nowrap;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#f5f5f5);background-image:-ms-linear-gradient(top,#fff,#f5f5f5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fafaf9),to(#f5f5f5));background-image:-webkit-linear-gradient(top,#fff,#f5f5f5);background-image:-o-linear-gradient(top,#fff,#f5f5f5);background-image:linear-gradient(top,#fff,#f5f5f5);background-repeat:repeat-x}.accordion-heading{filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fefefe',endColorstr='#f5f5f5',GradientType=0);float:inherit;width:100%;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.accordion-heading a:hover,.dropdown a:hover{text-decoration:none;background:0}.accordion-heading .accordion-toggle{font-family:黑体;font-size:14px;_padding-top:10px;_padding-bottom:8px}.accordion-heading .accordion-toggle i{_margin-top:-1px}.accordion-inner{padding:3px 8px 3px 8px}.accordion-inner .nav-list{margin-bottom:4px}.accordion-inner .nav-list li a{padding:3px 0 3px 8px}#left,#right,#openClose{float:left}#openClose{width:6px;margin:0 1px;cursor:pointer}#openClose,#openClose.close{background:#efefef url("../images/openclose.png") no-repeat -29px center}#openClose.close{background-position:1px center;opacity:.5;filter:alpha(opacity=50)} \ No newline at end of file diff --git a/src/main/webapp/static/common/jeesite.min.js b/src/main/webapp/static/common/jeesite.min.js index 3f237acff5..42dd06dd6f 100644 --- a/src/main/webapp/static/common/jeesite.min.js +++ b/src/main/webapp/static/common/jeesite.min.js @@ -1,5 +1,5 @@ /*! - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. * * 通用公共方法 * @author ThinkGem diff --git a/src/main/webapp/static/common/wsize.js b/src/main/webapp/static/common/wsize.js index 72a56a0a6e..5958695084 100644 --- a/src/main/webapp/static/common/wsize.js +++ b/src/main/webapp/static/common/wsize.js @@ -1,5 +1,5 @@ /*! - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. * * 主框架窗口大小调整 * @author ThinkGem diff --git a/src/main/webapp/static/common/wsize.min.js b/src/main/webapp/static/common/wsize.min.js index 3e665a8ea5..86d2352316 100644 --- a/src/main/webapp/static/common/wsize.min.js +++ b/src/main/webapp/static/common/wsize.min.js @@ -1,5 +1,5 @@ /*! - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. * * 主框架窗口大小调整 * @author ThinkGem diff --git a/src/main/webapp/static/supcan/supcan.js b/src/main/webapp/static/supcan/supcan.js index 0caefcec4a..196e9d7662 100644 --- a/src/main/webapp/static/supcan/supcan.js +++ b/src/main/webapp/static/supcan/supcan.js @@ -1,5 +1,5 @@ /*! - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. * * 硕正组件封装 * @author ThinkGem diff --git a/src/main/webapp/static/supcan/supcan.min.js b/src/main/webapp/static/supcan/supcan.min.js index e194ef9b2b..e90ddbce7e 100644 --- a/src/main/webapp/static/supcan/supcan.min.js +++ b/src/main/webapp/static/supcan/supcan.min.js @@ -1,5 +1,5 @@ /*! - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. * * 硕正组件封装 * @author ThinkGem diff --git a/src/test/java/com/thinkgem/jeesite/tools/CodeCounter.java b/src/test/java/com/thinkgem/jeesite/tools/CodeCounter.java index 25da7bebe0..9ebc610694 100644 --- a/src/test/java/com/thinkgem/jeesite/tools/CodeCounter.java +++ b/src/test/java/com/thinkgem/jeesite/tools/CodeCounter.java @@ -1,5 +1,5 @@ /** - * Copyright © 2012-2014 JeeSite All rights reserved. + * Copyright © 2012-2016 JeeSite All rights reserved. */ package com.thinkgem.jeesite.tools;
分类操作流程分类 流程ID 流程标识 流程名称部署时间 流程XML 流程图片操作
${fns:getDictLabel(process.category,'act_category','无分类')} + ${fns:getDictLabel(process.category,'act_category','无分类')}${process.id}${process.key}${process.name}V: ${process.version}${process.resourceName}${process.diagramResourceName} 激活 @@ -77,13 +85,6 @@ 删除 转换为模型 ${process.id}${process.key}${process.name}V: ${process.version}${process.resourceName}${process.diagramResourceName}