Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
171b5f426f | ||
|
|
e2664614da | ||
|
|
a64991f5e3 | ||
|
|
39ec6649d5 | ||
|
|
80a5f83791 | ||
|
|
5204015db5 | ||
|
|
80a35fec5d | ||
|
|
9d19595c9a | ||
|
|
2cffa9c396 | ||
|
|
fac969bd9c | ||
|
|
596f6eee4e | ||
|
|
7fc8394cbd | ||
|
|
c0ab584687 | ||
|
|
ff5c7ef05b | ||
|
|
b470509623 | ||
|
|
87c0a7116f | ||
|
|
4bc10be699 | ||
|
|
13af0ac9f9 | ||
|
|
c1684b51a2 | ||
|
|
a73ee3688d | ||
|
|
2d81b86b10 | ||
|
|
2fd28e18f9 | ||
|
|
d5d05050e3 | ||
|
|
ada63af9dc |
@@ -1,13 +0,0 @@
|
||||
### 该问题是怎么引起的?
|
||||
|
||||
|
||||
|
||||
### 重现步骤
|
||||
|
||||
|
||||
|
||||
### 报错信息
|
||||
|
||||
|
||||
|
||||
|
||||
8
.gitignore
vendored
@@ -2,12 +2,17 @@
|
||||
**/target
|
||||
**/webapp/userfiles
|
||||
**/WEB-INF/classes
|
||||
**/transaction-logs
|
||||
**/logs/*.log*
|
||||
*.epoch
|
||||
*.lic
|
||||
|
||||
.settings
|
||||
.apt_generated
|
||||
.factorypath
|
||||
.classpath
|
||||
.project
|
||||
.vscode
|
||||
|
||||
.idea
|
||||
*.ipr
|
||||
@@ -15,4 +20,5 @@
|
||||
*.iws
|
||||
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
Thumbs.db
|
||||
rebel.xml
|
||||
3
LICENSE
@@ -877,4 +877,5 @@ For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
理解您的用意。
|
||||
5. 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议、版权声明和其他
|
||||
原作者规定需要包含的说明(请尊重原作者的著作权,不要删除或修改文件中的`@author`信息)。
|
||||
6. 您可以应用于商业软件,但必须遵循以上条款原则(请协助改进本作品)。
|
||||
6. 您可以应用于商业软件,但必须遵循以上条款原则(请协助改进本作品 http://jeesite.com)。
|
||||
7. 您若套用本平台的一些代码或功能参考,需要在您的软件介绍明显位置说明出处。
|
||||
|
||||
108
README.md
@@ -1,37 +1,53 @@
|
||||
## 引言
|
||||
|
||||
JeeSite 是一个 Java EE 企业级快速开发平台,基于经典技术组合(Spring Boot、Spring MVC、Apache Shiro、MyBatis、Beetl、Bootstrap、AdminLTE)采用经典开发模式,让初学者能够更快的入门并投入到团队开发中去。在线代码生成功能,包括核心模块如:组织机构、角色用户、菜单及按钮授权、数据权限、系统参数、内容管理、工作流等。采用松耦合设计;界面无刷新,一键换肤;众多账号安全设置,密码策略;在线定时任务配置;支持集群,支持SAAS;支持多数据源;支持微服务。
|
||||
## 交流方式
|
||||
|
||||
* 交流 QQ 群(千人大群):`127515876`、`209330483`、`223507718`、`709534275`、`730390092`、`1373527`、`183903863(外包)`
|
||||
* 问题反馈:<https://gitee.com/thinkgem/jeesite4/issues> [【新手必读】](https://gitee.com/thinkgem/jeesite4/issues/I18ARR)
|
||||
* 码云Gitee:<https://gitee.com/thinkgem/jeesite4>
|
||||
* GitHub:<https://github.com/thinkgem/jeesite4>
|
||||
* 作者博客:<https://my.oschina.net/thinkgem>
|
||||
* **技术服务:**<http://s.jeesite.com>
|
||||
* 官方网站:<http://jeesite.com>
|
||||
* 官方论坛:<http://jeesite.net>
|
||||
* 关注微信公众号,了解最新动态:
|
||||
|
||||

|
||||
|
||||
## 平台介绍
|
||||
|
||||
JeeSite 快速开发平台,不仅仅是一个后台开发框架,它是一个企业级快速开发解决方案,基于经典技术组合(Spring Boot、Spring MVC、Apache Shiro、MyBatis、Beetl、Bootstrap、AdminLTE)采用经典开发模式,让初学者能够更快的入门并投入到团队开发中去。在线代码生成功能,包括模块如:组织机构、角色用户、菜单及按钮授权、数据权限、系统参数、内容管理、工作流等。采用松耦合设计,模块增减便捷;界面无刷新,一键换肤;众多账号安全设置,密码策略;文件在线预览;消息推送;多元化第三方登录;在线定时任务配置;支持集群,支持SAAS;支持多数据源;支持读写分离、分库分表;支持微服务应用。
|
||||
|
||||
JeeSite 快速开发平台的主要目的是能够让初级的研发人员快速的开发出复杂的业务功能(经典架构会的人多),让开发者注重专注业务,其余有平台来封装技术细节,降低技术难度,从而节省人力成本,缩短项目周期,提高软件安全质量。
|
||||
|
||||
JeeSite 自 2013 年发布以来已被广大爱好者用到了企业、政府、医疗、金融、互联网等各个领域中,JeeSite 依架构简单精良、易于扩展、大众思维的设计模式,深入开发者的内心,并得到一致好评,于[2016](http://www.oschina.net/project/top_cn_2016?sort=1)和[2017](http://www.oschina.net/project/top_cn_2017?sort=1)连续两年获得开源中国《最受欢迎中国开源软件》奖杯,期间也帮助了不少刚毕业的大学生作为入门教材,快速的去实践。
|
||||
JeeSite 自 2013 年发布以来已被广大爱好者用到了企业、政府、医疗、金融、互联网等各个领域中,JeeSite 架构精良、易于扩展、大众思维的设计模式、工匠精神打磨每一个细节,深入开发者的内心,并荣获开源中国《最受欢迎中国开源软件》奖杯,期间也帮助了不少刚毕业的大学生,教师作为入门教材,快速的去实践。
|
||||
|
||||
4.x 的升级,作者结合了多年总结和经验,以及各方面的应用案例,对架构完成了一次全部重构,也纳入很多新的思想。不管是从开发者模式、底层架构、逻辑处理还是到用户界面,用户交互体验上都有很大的进步,在不忘学习成本、提高开发效率的情况下,安全方面也做和很多工作,包括:身份认证、密码策略、安全审计、日志收集。
|
||||
JeeSite4 的升级,作者结合了多年总结和经验,以及各方面的应用案例,对架构完成了一次全部重构,也纳入很多新的思想。不管是从开发者模式、底层架构、逻辑处理还是到用户界面,用户交互体验上都有很大的进步,在不忘学习成本、提高开发效率的情况下,安全方面也做和很多工作,包括:身份认证、密码策略、安全审计、日志收集。努力为大中小微企业打造全方位企业级快速开发解决方案。
|
||||
|
||||
### 4.x 新特性:<http://jeesite.com/?t=281645>
|
||||
学会使用 JeeSite 的知识点非常多,也非常少,因为她使用的都是一些通用的技术,通俗的设计风格,多数基础知识点大家都能掌握。 你只需要学会 JeeSite 的功能使用及组件应用就可以完成开发了。
|
||||
|
||||
* **我们的优势:** 整体架构清晰、稳定技术先进、入门简单、易于维护、易于扩展、安全稳定。
|
||||
### 4.x 的新特性及优势:<http://jeesite.com/docs/feature/>
|
||||
|
||||
## 技术选型
|
||||
|
||||
* 主框架:Spring Boot 2.0、Spring Framework 5.0、Apache Shiro 1.4、J2Cache
|
||||
* 持久层:Apache MyBatis 3.4、Hibernate Validation 6.0、Alibaba Druid 1.1
|
||||
* 视图层:Spring MVC 5.0、Beetl 2.7 替换JSP、Bootstrap 3.3、AdminLTE 2.4
|
||||
* 主框架:Spring Boot 1.5、Spring Framework 4.3、Apache Shiro 1.6
|
||||
* 持久层:Apache MyBatis 3.4、Hibernate Validation 5.3、Alibaba Druid 1.1
|
||||
* 视图层:Spring MVC 4.3、Beetl 2.7 替换JSP、Bootstrap 3.3、AdminLTE 2.4
|
||||
* 前端组件:jQuery 1.12、jqGrid 4.7、layer 3.0、zTree 3.5、jquery-validation
|
||||
* 工具组件:Apache Commons、Logback 1.1、Jackson 2.8、POI 3.14、Quartz 2.2
|
||||
* 技术选型详情:<http://jeesite.com/?t=273599>
|
||||
* 技术选型详情:<http://jeesite.com/docs/technology/>
|
||||
|
||||
## 内置功能
|
||||
|
||||
* <http://jeesite.com/?t=270187>
|
||||
* <http://jeesite.com/docs/function/>
|
||||
|
||||
## 生态系统
|
||||
|
||||
* 分布式微服务系统(Spring Cloud):<https://gitee.com/thinkgem/jeesite4-cloud>
|
||||
* JFlow工作流引擎:<https://gitee.com/thinkgem/jeesite4-jflow> :<http://ccflow.org>
|
||||
* 内容管理模块(CMS):<https://gitee.com/thinkgem/jeesite4-cms>【敬请期待】
|
||||
* Flowable业务流程模块(BPM):<http://jeesite.com/docs/bpm/>
|
||||
* 内容管理模块(CMS):<https://gitee.com/thinkgem/jeesite4-cms>
|
||||
|
||||
## 快速体验
|
||||
# 快速体验
|
||||
|
||||
### 在线演示
|
||||
|
||||
@@ -42,43 +58,27 @@ JeeSite 自 2013 年发布以来已被广大爱好者用到了企业、政府、
|
||||
### 本地运行
|
||||
|
||||
1. 环境准备:`JDK 1.8`、`Maven 3.3`、`MySQL 5.7`
|
||||
2. 下载源码:<https://gitee.com/thinkgem/jeesite4/attach_files>
|
||||
3. 打开文件:/web`/src/main/resources/config/application.yml` 配置JDBC连接
|
||||
4. 执行脚本:/web`/bin/init-data.bat` 初始化数据库
|
||||
5. 执行脚本:/web`/bin/run-tomcat.bat` 启动服务即可
|
||||
2. 执行命令:`git clone https://gitee.com/thinkgem/jeesite4.git` 下载源码
|
||||
3. 打开文件:`/web/src/main/resources/config/jeesite.yml` 配置JDBC连接
|
||||
4. 执行脚本:`/web/bin/init-data.bat` 初始化数据库
|
||||
5. 执行脚本:`/web/bin/run-tomcat.bat` 启动服务即可
|
||||
6. 浏览器访问:<http://127.0.0.1:8980/js/> 账号 system 密码 admin
|
||||
7. 部署常见问题:<http://jeesite.com/?t=284210>
|
||||
7. 部署常见问题:<http://jeesite.com/docs/faq/>
|
||||
|
||||
### 开发环境
|
||||
|
||||
1. 部署运行:<http://jeesite.com/?t=267354>
|
||||
2. 常见问题:<http://jeesite.com/?t=284210>
|
||||
1. 部署运行文档:<http://jeesite.com/docs/install-deploy/>
|
||||
2. 部署常见问题:<http://jeesite.com/docs/faq/>
|
||||
|
||||
## 开发手册
|
||||
## 在线文档
|
||||
|
||||
* 代码生成 / 快速入门 (Guide):<http://jeesite.com/?t=316743>
|
||||
* 持久层 / 数据库操作 (MyBatis):<http://jeesite.com/?t=267351>
|
||||
* 业务层 / 数据权限 (Service):<http://jeesite.com/?t=267352>
|
||||
* 视图层 / 表单组件 (Beetl):<http://jeesite.com/?t=267353>
|
||||
* 功能权限基础文档 (Shiro):<http://jeesite.com/?t=298473>
|
||||
* 常用JS类库API (jeesite.js):<http://jeesite.com/?t=301473>
|
||||
* 数据表格API (DataGrid.js):<http://jeesite.com/?t=301488>
|
||||
* 修改 (默认) 视图,新增主题:<http://jeesite.com/?t=267355>
|
||||
* 手机 API 接口调用、前后分离:<http://jeesite.com/?t=270527>
|
||||
* 消息提醒中心使用手册:<http://jeesite.com/?t=323351>
|
||||
* 常见问题:<http://jeesite.com/?t=284210>
|
||||
* 在线文档学习地址:<http://docs.jeesite.com>
|
||||
|
||||
## 今后如何升级?
|
||||
## 技术服务与支持
|
||||
|
||||
尽量不修改web项目以外的源码项目,如 jeesite-common、jeesite-modele-core,如果修改了,请 Pull Requests 上来,否则代码编码将与官方不同步,将对你的日后升级带来困难。
|
||||
|
||||
JeeSite的小版本(4.1.x)升级是非常便捷的,你只需要将 pom.xml 文件中的 parent.version 版本修改到最新版本即可,同版本下你可进行Maven快照强制更新,即可将最新版的依赖jar更新到本地,下面介绍一下在Eclipse里如何操作:
|
||||
|
||||
在web项目上右键,选择菜单 -> Maven -> Update Project...(或按Alt+F5) -> 点击 Select All 按钮 -> 选择 Force Update of Snapshots/Releases 复选框 -> 点击OK按钮即可。
|
||||
|
||||
如果您修改了其它依赖模块代码,这时你需要与官方Git仓库代码进行同步。
|
||||
|
||||
如果进行相对大的版本(4.x.x)升级这里我们会附加一个声明,帮助你进行迁移操作。
|
||||
* 没有资金的支撑就很难得到发展,特别是一个好的产品,如果 JeeSite 帮助了您,请为我们点赞。支持我们,您可以得到一些回报,有了这些我们会把公益事业做的更好,回报社区和社会,请给我们一些动力吧,在此非常感谢已支持我们的朋友!
|
||||
* **联系方式(官方商务)QQ:[1766571055](http://wpa.qq.com/msgrd?v=3&uin=1766571055&site=qq&menu=yes)**
|
||||
* 技术服务支持网页:<http://s.jeesite.com>
|
||||
|
||||
## 授权协议声明
|
||||
|
||||
@@ -86,27 +86,21 @@ JeeSite的小版本(4.1.x)升级是非常便捷的,你只需要将 pom.xml
|
||||
2. 您可以免费使用、修改和衍生代码,但不允许修改后和衍生的代码做为闭源软件发布。
|
||||
3. 修改后和衍生的代码必须也按照AGPL协议进行流通,对修改后和衍生的代码必须向社会公开。
|
||||
4. 如果您修改了代码,需要在被修改的文件中进行说明,并遵守代码格式规范,帮助他人更好的理解您的用意。
|
||||
5. 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议、版权声明和其他原作者规定需要包含的说明(请尊重原作者的著作权,不要删除或修改文件中的`@author`信息)。
|
||||
5. 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议、版权声明和其他原作者规定
|
||||
需要包含的说明(请尊重原作者的著作权,不要删除或修改文件中的`@author`信息)。
|
||||
6. 您可以应用于商业软件,但必须遵循以上条款原则(请协助改进本作品)。
|
||||
7. 关系平台的发展战略考虑,底层部分代码暂未开源,但这不影响您的二次开发。
|
||||
8. 请知悉社区版,用户数不可超过100个,最大允许10个用户同时在线(不含匿名)。
|
||||
7. 您若套用本平台的一些代码或功能参考,需要在您的软件介绍明显位置说明出处。
|
||||
8. **当前 v4.0.8 版本,没有系统用户数量限制,没有最大在线人数限制。**
|
||||
|
||||
### 获得技术服务支持:<http://s.jeesite.com>
|
||||
## 今后如何升级?
|
||||
|
||||
* 我们深知,没有资金的支撑就很难得到发展,特别是一个好的产品,如果 JeeSite 帮助了您,请为我们点赞。支持我们,您可以得到一些回报,有了这些我们会把开源事业做的更好,回报社区和社会,请给我们一些动力吧,在此非常感谢已支持我们的朋友!
|
||||
尽量不修改 web 项目以外的源码项目,如 jeesite-common、jeesite-modele-core,如果修改了,请 Pull Requests 上来,否则代码与官方不同步,会将对你的日后升级增加难度。
|
||||
|
||||
# 技术交流方式
|
||||
如果您修改了依赖模块代码,也没关系,这时你需要利用 Git 版本控制工具,与官方仓库代码进行同步,合并代码即可。
|
||||
|
||||
* QQ 群号:`127515876`、`209330483`、`223507718`、`709534275`、`730390092`、`183903863(外包)`
|
||||
* 问题反馈:<https://gitee.com/thinkgem/jeesite4/issues> [【新手必读】](http://www.dianbo.org/9238/stone/tiwendezhihui.htm)
|
||||
* 码云Gitee:<https://gitee.com/thinkgem/jeesite4>
|
||||
* GitHub:<https://github.com/thinkgem/jeesite4>
|
||||
* 作者博客:<https://my.oschina.net/thinkgem>
|
||||
* 官方网站:<http://jeesite.com>
|
||||
* 官方论坛:<http://jeesite.net>
|
||||
* 微信公众号:
|
||||
每个版本升级,我们都会附带详细更新日志:<http://jeesite.com/docs/upgrade/>。
|
||||
|
||||

|
||||
在这里,你可以看到 JeeSite 新增哪些新功能和改进,在每个版本下都有对应升级方法。
|
||||
|
||||
# Git 全局设置技巧
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
@@ -1,8 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -1,4 +0,0 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="jeesite-common">
|
||||
<wb-resource deploy-path="/" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<installed facet="jst.utility" version="1.0"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
</faceted-project>
|
||||
@@ -1,2 +0,0 @@
|
||||
disabled=06target
|
||||
eclipse.preferences.version=1
|
||||
237
common/pom.xml
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.1.3-SNAPSHOT</version>
|
||||
<version>4.0.8-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -27,16 +27,17 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons-io.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
@@ -45,33 +46,19 @@
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>${commons-beanutils.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
<version>${commons-text.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Apache Tools Ant Tar Zip -->
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>${ant.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Java serialization -->
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
<version>${fst.version}</version>
|
||||
<version>${ruedigermoeller-fst.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Json in java -->
|
||||
<!-- Json in java -->
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>${json.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Jackson json -->
|
||||
@@ -106,97 +93,11 @@
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Apache HTTP -->
|
||||
<!-- Bean To Bean copy -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Jsoup HTTP -->
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>${jsoup.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Email -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-email</artifactId>
|
||||
<version>${commons-email.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.activation</groupId>
|
||||
<artifactId>activation</artifactId>
|
||||
<version>${activation.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- User Agent -->
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>${UserAgentUtils.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 图片Meta获取
|
||||
<dependency>
|
||||
<groupId>com.drewnoakes</groupId>
|
||||
<artifactId>metadata-extractor</artifactId>
|
||||
<version>${metadata-extractor.version}</version>
|
||||
</dependency> -->
|
||||
<!-- 缩略图工具 -->
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>${thumbnailator.version}</version>
|
||||
</dependency>
|
||||
<!-- 支持CMYK图片 -->
|
||||
<dependency>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
<artifactId>imageio-jpeg</artifactId>
|
||||
<version>${twelvemonkeys.version}</version>
|
||||
</dependency>
|
||||
<!-- 图片验证码生成 -->
|
||||
<dependency>
|
||||
<groupId>com.bladejava</groupId>
|
||||
<artifactId>blade-patchca</artifactId>
|
||||
<version>${blade-patchca.version}</version>
|
||||
</dependency>
|
||||
<!-- File MimeType ContentType -->
|
||||
<dependency>
|
||||
<groupId>net.sf.jmimemagic</groupId>
|
||||
<artifactId>jmimemagic</artifactId>
|
||||
<version>${jmimemagic.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-xc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-jaxrs</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>log4j</artifactId>
|
||||
<groupId>log4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- 条形码、二维码生成 -->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>${zxing.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>javase</artifactId>
|
||||
<version>${zxing.version}</version>
|
||||
<groupId>net.sf.dozer</groupId>
|
||||
<artifactId>dozer</artifactId>
|
||||
<version>${dozer.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- POI Office Tools -->
|
||||
@@ -227,14 +128,109 @@
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Email -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-email</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.activation</groupId>
|
||||
<artifactId>activation</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 条形码、二维码生成 -->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>javase</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- User Agent -->
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>1.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Apache HTTP -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Jsoup HTTP -->
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.9.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 图片Meta获取 -->
|
||||
<dependency>
|
||||
<groupId>com.drewnoakes</groupId>
|
||||
<artifactId>metadata-extractor</artifactId>
|
||||
<version>2.9.1</version>
|
||||
</dependency>
|
||||
<!-- 缩略图工具 -->
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>0.4.8</version>
|
||||
</dependency>
|
||||
<!-- 图片验证码生成 -->
|
||||
<dependency>
|
||||
<groupId>com.bladejava</groupId>
|
||||
<artifactId>blade-patchca</artifactId>
|
||||
<version>1.0.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Apache Tools Ant Tar Zip -->
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>1.9.7</version>
|
||||
</dependency>
|
||||
|
||||
<!-- File MimeType ContentType -->
|
||||
<dependency>
|
||||
<groupId>net.sf.jmimemagic</groupId>
|
||||
<artifactId>jmimemagic</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-xc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-jaxrs</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>log4j</artifactId>
|
||||
<groupId>log4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- pinyin4j -->
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>${pinyin4j.version}</version>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Logging begin -->
|
||||
<!-- LOGGING begin -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
@@ -259,24 +255,23 @@
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
</dependency>
|
||||
<!-- Logging end -->
|
||||
<!-- LOGGING end -->
|
||||
|
||||
<!-- Spring begin -->
|
||||
<!-- Spring Core Web-->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Bean validate -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot</artifactId>
|
||||
<optional>true</optional>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
<!-- Spring end -->
|
||||
|
||||
<!-- JUnit Test -->
|
||||
<dependency>
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.regex.Pattern;
|
||||
import org.apache.commons.codec.DecoderException;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -192,7 +192,7 @@ public class EncodeUtils {
|
||||
Pattern.compile("(<\\s*(script|link|style|iframe)([\\s\\S]*?)(>|<\\/\\s*\\1\\s*>))|(</\\s*(script|link|style|iframe)\\s*>)", Pattern.CASE_INSENSITIVE),
|
||||
Pattern.compile("\\s*(href|src)\\s*=\\s*(\"\\s*(javascript|vbscript):[^\"]+\"|'\\s*(javascript|vbscript):[^']+'|(javascript|vbscript):[^\\s]+)\\s*(?=>)", Pattern.CASE_INSENSITIVE),
|
||||
Pattern.compile("\\s*on[a-z]+\\s*=\\s*(\"[^\"]+\"|'[^']+'|[^\\s]+)\\s*(?=>)", Pattern.CASE_INSENSITIVE),
|
||||
Pattern.compile("(eval\\((.*?)\\)|xpression\\((.*?)\\))", Pattern.CASE_INSENSITIVE)
|
||||
Pattern.compile("(eval\\((.|\\n)*\\)|xpression\\((.|\\n)*\\))", Pattern.CASE_INSENSITIVE)
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -216,34 +216,7 @@ public class EncodeUtils {
|
||||
&& !(StringUtils.startsWith(value, "{") && StringUtils.endsWith(value, "}")) // JSON Object
|
||||
&& !(StringUtils.startsWith(value, "[") && StringUtils.endsWith(value, "]")) // JSON Array
|
||||
){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char c = value.charAt(i);
|
||||
switch (c) {
|
||||
case '>':
|
||||
sb.append(">");
|
||||
break;
|
||||
case '<':
|
||||
sb.append("<");
|
||||
break;
|
||||
case '\'':
|
||||
sb.append("'");
|
||||
break;
|
||||
case '\"':
|
||||
sb.append(""");
|
||||
break;
|
||||
// case '&':
|
||||
// sb.append("&");
|
||||
// break;
|
||||
// case '#':
|
||||
// sb.append("#");
|
||||
// break;
|
||||
default:
|
||||
sb.append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
value = sb.toString();
|
||||
value = value.replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
||||
}
|
||||
if (logger.isInfoEnabled() && !value.equals(oriValue)){
|
||||
logger.info("xssFilter: {} <=<=<= {}", value, text);
|
||||
@@ -277,35 +250,33 @@ public class EncodeUtils {
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// int i = 0;
|
||||
// xssFilter((++i)+"你好,<script>alert(document.cookie)</script>我还在。");
|
||||
// xssFilter((++i)+"你好,<strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,\"><strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<iframe src=\"abcdef\"></iframe><strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<iframe src=\"abcdef\"/><strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<iframe src=\"abcdef\"><strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<script type=\"text/javascript\">alert(document.cookie)</script>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<script\n type=\"text/javascript\">\nalert(document.cookie)\n</script>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<script src='' onerror='alert(document.cookie)'></script>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<script type=text/javascript>alert()我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<script>alert(document.cookie)</script>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<script>window.location='url'我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,</script></iframe>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,eval(abc)我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,xpression(abc)我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<img src='abc.jpg' onerror='location='';alert(document.cookie);'></img>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<img src='abc.jpg' onerror='alert(document.cookie);'/>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<img src='abc.jpg' onerror='alert(document.cookie);'>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<a onload='alert(\"abc\")'>hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<a href=\"/abc\">hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<a href='/abc'>hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<a href='vbscript:alert(\"abc\");'>hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,<a href='javascript:alert(\"abc\");'>hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,?abc=def&hello=123&world={\"a\":1}我还在。");
|
||||
// xssFilter("<!--HTML-->"+(++i)+"你好,?abc=def&hello=123&world={'a':1}我还在。");
|
||||
// sqlFilter((++i)+"你好,select * from xxx where abc=def and 1=1我还在。");
|
||||
// sqlFilter((++i)+"你好,insert into xxx values(1,2,3,4,5)我还在。");
|
||||
// sqlFilter((++i)+"你好,delete from xxx我还在。");
|
||||
// xssFilter("你好,<script>alert(document.cookie)</script>我还在。");
|
||||
// xssFilter("你好,<strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,\"><strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<iframe src=\"abcdef\"></iframe><strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<iframe src=\"abcdef\"/><strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<iframe src=\"abcdef\"><strong>加粗文字</strong>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<script type=\"text/javascript\">alert(document.cookie)</script>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<script\n type=\"text/javascript\">\nalert(document.cookie)\n</script>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<script src='' onerror='alert(document.cookie)'></script>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<script type=text/javascript>alert()我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<script>alert(document.cookie)</script>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<script>window.location='url'我还在。");
|
||||
// xssFilter("<!--HTML-->你好,</script></iframe>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,eval(abc)我还在。");
|
||||
// xssFilter("<!--HTML-->你好,xpression(abc)我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<img src='abc.jpg' onerror='location='';alert(document.cookie);'></img>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<img src='abc.jpg' onerror='alert(document.cookie);'/>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<img src='abc.jpg' onerror='alert(document.cookie);'>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<a onload='alert(\"abc\")'>hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<a href=\"/abc\">hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<a href='/abc'>hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<a href='vbscript:alert(\"abc\");'>hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,<a href='javascript:alert(\"abc\");'>hello</a>我还在。");
|
||||
// xssFilter("<!--HTML-->你好,?abc=def&hello=123&world={\"a\":1}我还在。");
|
||||
// sqlFilter("你好,select * from xxx where abc=def and 1=1我还在。");
|
||||
// sqlFilter("你好,insert into xxx values(1,2,3,4,5)我还在。");
|
||||
// sqlFilter("你好,delete from xxx我还在。");
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -76,12 +76,13 @@ public class Md5Utils {
|
||||
|
||||
/**
|
||||
* 获取文件的MD5值,支持获取文件部分的MD5值
|
||||
* uploader.md5File(file, 0, 10 * 1024 * 1024)
|
||||
*/
|
||||
public static String md5File(File file, int size) {
|
||||
if (file != null && file.exists()){
|
||||
try (InputStream in = FileUtils.openInputStream(file)){
|
||||
InputStream in = null;
|
||||
try {
|
||||
byte[] bytes = null;
|
||||
in = FileUtils.openInputStream(file);
|
||||
if (size != -1 && file.length() >= size){
|
||||
bytes = IOUtils.toByteArray(in, size);
|
||||
}else{
|
||||
@@ -90,6 +91,8 @@ public class Md5Utils {
|
||||
return EncodeUtils.encodeHex(md5(bytes));
|
||||
} catch (IOException e) {
|
||||
return StringUtils.EMPTY;
|
||||
} finally {
|
||||
IOUtils.closeQuietly(in);
|
||||
}
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
|
||||
@@ -1,66 +1,66 @@
|
||||
///**
|
||||
// * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
// */
|
||||
//package com.jeesite.common.image;
|
||||
//
|
||||
//import java.io.File;
|
||||
//
|
||||
//import com.drew.imaging.jpeg.JpegMetadataReader;
|
||||
//import com.drew.lang.Rational;
|
||||
//import com.drew.metadata.Metadata;
|
||||
//import com.drew.metadata.exif.GpsDirectory;
|
||||
//
|
||||
///**
|
||||
// * 图片地理信息获取
|
||||
// * @author ThinkGem
|
||||
// */
|
||||
//public class ImageGeo {
|
||||
//
|
||||
// public double lat = 0.0;
|
||||
// public double lon = 0.0;
|
||||
// public double alt = 0.0;
|
||||
// public boolean error = false;
|
||||
//
|
||||
// public ImageGeo(String filename) {
|
||||
// try {
|
||||
// error = false;
|
||||
// File jpegFile = new File(filename);
|
||||
// Metadata metadata = JpegMetadataReader.readMetadata(jpegFile);
|
||||
//
|
||||
// GpsDirectory gpsdir = (GpsDirectory) metadata.getDirectoriesOfType(GpsDirectory.class);
|
||||
// Rational latpart[] = gpsdir.getRationalArray(GpsDirectory.TAG_LATITUDE);
|
||||
// Rational lonpart[] = gpsdir.getRationalArray(GpsDirectory.TAG_LONGITUDE);
|
||||
// String northing = gpsdir.getString(GpsDirectory.TAG_LATITUDE_REF);
|
||||
// String easting = gpsdir.getString(GpsDirectory.TAG_LONGITUDE_REF);
|
||||
//
|
||||
// try {
|
||||
// alt = gpsdir.getDouble(GpsDirectory.TAG_ALTITUDE);
|
||||
// } catch (Exception ex) {}
|
||||
//
|
||||
// double latsign = 1.0d;
|
||||
// if (northing.equalsIgnoreCase("S")) {
|
||||
// latsign = -1.0d;
|
||||
// }
|
||||
// double lonsign = 1.0d;
|
||||
// if (easting.equalsIgnoreCase("W")) {
|
||||
// lonsign = -1.0d;
|
||||
// }
|
||||
//
|
||||
// lat = (Math.abs(latpart[0].doubleValue()) + latpart[1].doubleValue() / 60.0d + latpart[2].doubleValue() / 3600.0d) * latsign;
|
||||
// lon = (Math.abs(lonpart[0].doubleValue()) + lonpart[1].doubleValue() / 60.0d + lonpart[2].doubleValue() / 3600.0d) * lonsign;
|
||||
//
|
||||
// if (Double.isNaN(lat) || Double.isNaN(lon)) {
|
||||
// error = true;
|
||||
// }
|
||||
// } catch (Exception ex) {
|
||||
// error = true;
|
||||
// }
|
||||
// System.out.println(filename + ": (" + lat + ", " + lon + ")");
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.common.image;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.drew.imaging.jpeg.JpegMetadataReader;
|
||||
import com.drew.lang.Rational;
|
||||
import com.drew.metadata.Metadata;
|
||||
import com.drew.metadata.exif.GpsDirectory;
|
||||
|
||||
/**
|
||||
* 图片地理信息获取
|
||||
* @author ThinkGem
|
||||
*/
|
||||
public class ImageGeo {
|
||||
|
||||
public double lat = 0.0;
|
||||
public double lon = 0.0;
|
||||
public double alt = 0.0;
|
||||
public boolean error = false;
|
||||
|
||||
public ImageGeo(String filename) {
|
||||
try {
|
||||
error = false;
|
||||
File jpegFile = new File(filename);
|
||||
Metadata metadata = JpegMetadataReader.readMetadata(jpegFile);
|
||||
|
||||
GpsDirectory gpsdir = (GpsDirectory) metadata.getDirectoriesOfType(GpsDirectory.class);
|
||||
Rational latpart[] = gpsdir.getRationalArray(GpsDirectory.TAG_LATITUDE);
|
||||
Rational lonpart[] = gpsdir.getRationalArray(GpsDirectory.TAG_LONGITUDE);
|
||||
String northing = gpsdir.getString(GpsDirectory.TAG_LATITUDE_REF);
|
||||
String easting = gpsdir.getString(GpsDirectory.TAG_LONGITUDE_REF);
|
||||
|
||||
try {
|
||||
alt = gpsdir.getDouble(GpsDirectory.TAG_ALTITUDE);
|
||||
} catch (Exception ex) {}
|
||||
|
||||
double latsign = 1.0d;
|
||||
if (northing.equalsIgnoreCase("S")) {
|
||||
latsign = -1.0d;
|
||||
}
|
||||
double lonsign = 1.0d;
|
||||
if (easting.equalsIgnoreCase("W")) {
|
||||
lonsign = -1.0d;
|
||||
}
|
||||
|
||||
lat = (Math.abs(latpart[0].doubleValue()) + latpart[1].doubleValue() / 60.0d + latpart[2].doubleValue() / 3600.0d) * latsign;
|
||||
lon = (Math.abs(lonpart[0].doubleValue()) + lonpart[1].doubleValue() / 60.0d + lonpart[2].doubleValue() / 3600.0d) * lonsign;
|
||||
|
||||
if (Double.isNaN(lat) || Double.isNaN(lon)) {
|
||||
error = true;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
error = true;
|
||||
}
|
||||
System.out.println(filename + ": (" + lat + ", " + lon + ")");
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// ImageGeo imageGeo = new ImageGeo(ImageGeo.class.getResource("IMAG0068.jpg").getFile());
|
||||
// System.out.println(imageGeo.lon + "," + imageGeo.lat);
|
||||
// }
|
||||
//
|
||||
//// public static void main(String[] args) {
|
||||
//// ImageGeo imageGeo = new ImageGeo(ImageGeo.class.getResource("IMAG0068.jpg").getFile());
|
||||
//// System.out.println(imageGeo.lon + "," + imageGeo.lat);
|
||||
//// }
|
||||
//
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.common.image;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.jeesite.common.io.FileUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import net.coobird.thumbnailator.Thumbnails.Builder;
|
||||
|
||||
/**
|
||||
* 图片处理工具类
|
||||
* @author ThinkGem
|
||||
* @version 2018年12月31日
|
||||
*/
|
||||
public class ImageUtils {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(ImageUtils.class);
|
||||
|
||||
/**
|
||||
* 缩略图生成,处理一些较大的图片,防止占用太多的网络资源
|
||||
*/
|
||||
public static void thumbnails(File imageFile, int maxWidth, int maxHeight, String outputFormat){
|
||||
if (imageFile == null || !imageFile.exists() || (maxWidth <= 0 && maxHeight <= 0)){
|
||||
return;
|
||||
}
|
||||
// 只处理可以压缩的图片,如gif图片压缩后会出现黑色背景的情况
|
||||
String extension = FileUtils.getFileExtension(imageFile.getName());
|
||||
if (!StringUtils.inString(extension, "png", "jpg", "jpeg", "bmp", "ico")){
|
||||
return;
|
||||
}
|
||||
try{
|
||||
BufferedImage bufferedImage = ImageIO.read(imageFile);
|
||||
Builder<BufferedImage> bilder = Thumbnails.of(bufferedImage);
|
||||
if (bufferedImage != null){
|
||||
if (maxWidth > 0){
|
||||
if (bufferedImage.getWidth() <= maxWidth){
|
||||
bilder.width(bufferedImage.getWidth());
|
||||
}else{
|
||||
bilder.width(maxWidth);
|
||||
}
|
||||
}
|
||||
if (maxHeight > 0){
|
||||
if (bufferedImage.getHeight() <= maxHeight){
|
||||
bilder.height(bufferedImage.getHeight());
|
||||
}else{
|
||||
bilder.height(maxHeight);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(outputFormat)){
|
||||
bilder.outputFormat(outputFormat);
|
||||
}
|
||||
bilder.toFile(imageFile);
|
||||
}
|
||||
}catch(IOException e){
|
||||
logger.error("图片压缩失败:" + imageFile.getAbsoluteFile(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,7 +44,6 @@ import net.sf.jmimemagic.MagicMatch;
|
||||
public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(FileUtils.class);
|
||||
private static MimetypesFileTypeMap mimetypesFileTypeMap;
|
||||
|
||||
/**
|
||||
* 复制单个文件,如果目标文件存在,则不覆盖
|
||||
@@ -243,10 +242,14 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
* @author ThinkGem 2016-7-4
|
||||
*/
|
||||
public static String readFileToString(String classResourcePath){
|
||||
try (InputStream in = new ClassPathResource(classResourcePath).getInputStream()){
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = new ClassPathResource(classResourcePath).getInputStream();
|
||||
return IOUtils.toString(in, Charsets.toCharset("UTF-8"));
|
||||
} catch (IOException e) {
|
||||
logger.warn("Error file convert: {}", e.getMessage());
|
||||
}finally{
|
||||
IOUtils.closeQuietly(in);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -655,10 +658,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
* @return 返回文件类型
|
||||
*/
|
||||
public static String getContentType(String fileName) {
|
||||
if (mimetypesFileTypeMap == null){
|
||||
mimetypesFileTypeMap = new MimetypesFileTypeMap();
|
||||
}
|
||||
return mimetypesFileTypeMap.getContentType(fileName);
|
||||
return new MimetypesFileTypeMap().getContentType(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -758,7 +758,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
try {
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" +
|
||||
EncodeUtils.encodeUrl(StringUtils.isBlank(fileName) ? file.getName() : fileName) + "\"");
|
||||
response.setContentType(FileUtils.getContentType(file.getName())); // set the MIME type.
|
||||
response.setContentType(getContentType(file.getName())); // set the MIME type.
|
||||
response.addHeader("Content-Length", String.valueOf(contentLength));
|
||||
os = response.getOutputStream();
|
||||
out = new BufferedOutputStream(os);
|
||||
@@ -808,7 +808,7 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
logger.debug("提醒:向客户端传输时出现IO异常,但此异常是允许的,有可能客户端取消了下载,导致此异常,不用关心!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.debug(e.getMessage(), e);
|
||||
logger.error(e.getMessage(), e);
|
||||
} finally {
|
||||
if (out != null) {
|
||||
try {
|
||||
@@ -944,9 +944,9 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
projectPath = file.toString();
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
// 忽略异常
|
||||
;
|
||||
} catch (IOException e) {
|
||||
// 忽略异常
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 取不到,取当前工作路径
|
||||
if (StringUtils.isBlank(projectPath)){
|
||||
@@ -982,9 +982,9 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
webappPath = file.toString();
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
// 忽略异常
|
||||
;
|
||||
} catch (IOException e) {
|
||||
// 忽略异常
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 取不到,取当前工作路径
|
||||
if (StringUtils.isBlank(webappPath)){
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
*/
|
||||
package com.jeesite.common.io;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* 数据流工具类
|
||||
@@ -83,24 +80,4 @@ public class IOUtils extends org.apache.commons.io.IOUtils {
|
||||
return fileOutputStream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes a <code>Closeable</code> unconditionally.
|
||||
*/
|
||||
public static void closeQuietly(final InputStream input) {
|
||||
closeQuietly((Closeable) input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes a <code>Closeable</code> unconditionally.
|
||||
*/
|
||||
public static void closeQuietly(final Closeable closeable) {
|
||||
try {
|
||||
if (closeable != null) {
|
||||
closeable.close();
|
||||
}
|
||||
} catch (final IOException ioe) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,10 +12,10 @@ import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.io.DefaultResourceLoader;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
@@ -34,13 +34,11 @@ public class PropertiesUtils {
|
||||
|
||||
// 默认加载的文件,可通过继承覆盖(若有相同Key,优先加载后面的)
|
||||
public static final String[] DEFAULT_CONFIG_FILE = new String[]{
|
||||
"classpath:config/bootstrap.yml", "classpath:bootstrap.yml",
|
||||
"classpath:config/application.yml", "classpath:application.yml"};
|
||||
|
||||
private static Logger logger = PropertiesUtils.initLogger();
|
||||
private final Set<String> configSet = SetUtils.newLinkedHashSet();
|
||||
|
||||
private final Properties properties = new Properties();
|
||||
private static Environment environment;
|
||||
|
||||
/**
|
||||
* 当前类的实例持有者(静态内部类,延迟加载,懒汉式,线程安全的单例模式)
|
||||
@@ -57,7 +55,7 @@ public class PropertiesUtils {
|
||||
for(Resource resource : resources){
|
||||
configSet.add("classpath:config/"+resource.getFilename());
|
||||
}
|
||||
//configSet.add("classpath:config/jeesite.yml");
|
||||
configSet.add("classpath:config/jeesite.yml");
|
||||
// 获取全局设置默认的配置文件(以下是支持环境配置的属性文件)
|
||||
Set<String> set = SetUtils.newLinkedHashSet();
|
||||
for (String configFile : DEFAULT_CONFIG_FILE){
|
||||
@@ -85,7 +83,7 @@ public class PropertiesUtils {
|
||||
}
|
||||
for (String location : configFiles){
|
||||
configSet.add(location);
|
||||
if (StringUtils.isNotBlank(profiles)){
|
||||
if (StringUtils.isNotBlank(profiles) && !StringUtils.equals(profiles, "default")){
|
||||
if (location.endsWith(".properties")){
|
||||
configSet.add(StringUtils.substringBeforeLast(location, ".properties")
|
||||
+ "-" + profiles + ".properties");
|
||||
@@ -110,11 +108,14 @@ public class PropertiesUtils {
|
||||
Resource resource = ResourceUtils.getResource(location);
|
||||
if (resource.exists()){
|
||||
if (location.endsWith(".properties")){
|
||||
try (InputStreamReader is = new InputStreamReader(resource.getInputStream(), "UTF-8")){
|
||||
InputStreamReader is = null;
|
||||
try {
|
||||
is = new InputStreamReader(resource.getInputStream(), "UTF-8");
|
||||
properties.load(is);
|
||||
configSet.add(location);
|
||||
} catch (IOException ex) {
|
||||
logger.error("Load " + location + " failure. ", ex);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(is);
|
||||
}
|
||||
}
|
||||
else if (location.endsWith(".yml")){
|
||||
@@ -124,24 +125,18 @@ public class PropertiesUtils {
|
||||
properties.put(ObjectUtils.toString(entry.getKey()),
|
||||
ObjectUtils.toString(entry.getValue()));
|
||||
}
|
||||
configSet.add(location);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Load " + location + " failure. ", e);
|
||||
}
|
||||
// 存储当前加载的配置文件路径和名称
|
||||
properties.setProperty("configFiles", StringUtils.join(configFiles, ","));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前加载的属性文件
|
||||
*/
|
||||
public Set<String> getConfigSet() {
|
||||
return configSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前加载的属性数据
|
||||
* 获取当前加载的属性
|
||||
*/
|
||||
public Properties getProperties() {
|
||||
return properties;
|
||||
@@ -168,19 +163,14 @@ public class PropertiesUtils {
|
||||
* 获取属性值,取不到从System.getProperty()获取,都取不到返回null
|
||||
*/
|
||||
public String getProperty(String key) {
|
||||
if (environment != null){
|
||||
String value = environment.getProperty(key);
|
||||
if (value != null){
|
||||
return value;
|
||||
}
|
||||
}
|
||||
String value = properties.getProperty(key);
|
||||
if (value != null){
|
||||
// 支持嵌套取值的问题 key=${xx}/yy
|
||||
Matcher m = p1.matcher(value);
|
||||
while(m.find()) {
|
||||
String g = m.group();
|
||||
String childKey = g.replaceAll("\\$\\{|\\}", "");
|
||||
value = StringUtils.replace(value, g, getProperty(childKey));
|
||||
String keyChild = g.replaceAll("\\$\\{", "").replaceAll("\\}", "");
|
||||
value = StringUtils.replace(value, g, getProperty(keyChild));
|
||||
}
|
||||
return value;
|
||||
}else{
|
||||
@@ -200,14 +190,6 @@ public class PropertiesUtils {
|
||||
return value != null ? value : defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置环境属性
|
||||
* @param environment
|
||||
*/
|
||||
public static void setEnvironment(Environment environment) {
|
||||
PropertiesUtils.environment = environment;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化日志路径
|
||||
*/
|
||||
@@ -225,9 +207,7 @@ public class PropertiesUtils {
|
||||
if (new File(classesLogPath).exists()){
|
||||
logPath = classesLogPath;
|
||||
}
|
||||
if (StringUtils.isBlank(System.getProperty("logPath"))){
|
||||
System.setProperty("logPath", FileUtils.path(logPath));
|
||||
}
|
||||
System.setProperty("logPath", FileUtils.path(logPath));
|
||||
return LoggerFactory.getLogger(PropertiesUtils.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.common.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.boot.env.OriginTrackedMapPropertySource;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
/**
|
||||
* 配置文件加载(Boot)
|
||||
* @author ThinkGem
|
||||
* @version 2018-10-16
|
||||
*/
|
||||
public class PropertyLoader implements org.springframework.boot.env.PropertySourceLoader{
|
||||
|
||||
private static boolean isLoadPropertySource = false;
|
||||
|
||||
@Override
|
||||
public String[] getFileExtensions() {
|
||||
return new String[] { "properties", "yml" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PropertySource<?>> load(String name, Resource resource) throws IOException {
|
||||
if (!isLoadPropertySource){
|
||||
isLoadPropertySource = true;
|
||||
Properties properties = PropertiesUtils.getInstance().getProperties();
|
||||
return Collections.singletonList(new OriginTrackedMapPropertySource("jeesite", properties));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,10 +67,14 @@ public class ResourceUtils extends org.springframework.util.ResourceUtils {
|
||||
* @author ThinkGem
|
||||
*/
|
||||
public static String getResourceFileContent(String location){
|
||||
try(InputStream is = ResourceUtils.getResourceFileStream(location)){
|
||||
InputStream is = null;
|
||||
try{
|
||||
is = ResourceUtils.getResourceFileStream(location);
|
||||
return IOUtils.toString(is, "UTF-8");
|
||||
}catch (IOException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}finally{
|
||||
IOUtils.closeQuietly(is);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.nustaq.serialization.FSTConfiguration;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.core.NamedThreadLocal;
|
||||
|
||||
import com.jeesite.common.io.IOUtils;
|
||||
|
||||
/**
|
||||
* 对象操作工具类, 继承org.apache.commons.lang3.ObjectUtils类
|
||||
* @author ThinkGem
|
||||
@@ -116,13 +118,9 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
if (source == null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
Object target = source.getClass().newInstance();
|
||||
BeanUtils.copyProperties(source, target, ignoreProperties);
|
||||
return target;
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
Object target = BeanUtils.instantiate(source.getClass());
|
||||
BeanUtils.copyProperties(source, target, ignoreProperties);
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,12 +162,18 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
}
|
||||
long beginTime = System.currentTimeMillis();
|
||||
byte[] bytes = null;
|
||||
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ObjectOutputStream oos = new ObjectOutputStream(baos);) {
|
||||
ObjectOutputStream oos = null;
|
||||
ByteArrayOutputStream baos = null;
|
||||
try {
|
||||
baos = new ByteArrayOutputStream();
|
||||
oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(object);
|
||||
bytes = baos.toByteArray();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
IOUtils.closeQuietly(oos);
|
||||
IOUtils.closeQuietly(baos);
|
||||
}
|
||||
long totalTime = System.currentTimeMillis() - beginTime;
|
||||
if (totalTime > 3000){
|
||||
@@ -189,13 +193,19 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
}
|
||||
long beginTime = System.currentTimeMillis();
|
||||
Object object = null;
|
||||
if (bytes.length > 0) {
|
||||
try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
|
||||
ObjectInputStream ois = new ObjectInputStream(bais);) {
|
||||
ByteArrayInputStream bais = null;
|
||||
ObjectInputStream ois = null;
|
||||
try {
|
||||
if (bytes.length > 0) {
|
||||
bais = new ByteArrayInputStream(bytes);
|
||||
ois = new ObjectInputStream(bais);
|
||||
object = ois.readObject();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
IOUtils.closeQuietly(ois);
|
||||
IOUtils.closeQuietly(bais);
|
||||
}
|
||||
long totalTime = System.currentTimeMillis() - beginTime;
|
||||
if (totalTime > 3000){
|
||||
|
||||
@@ -9,6 +9,8 @@ import java.util.Random;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
|
||||
@@ -85,14 +87,6 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除左右空格(包含中文空格)
|
||||
* @param str
|
||||
*/
|
||||
public static String trim2(final String str) {
|
||||
return str == null ? null : str.replaceAll("^[\\s| | ]*|[\\s| | ]*$", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换掉HTML标签方法
|
||||
@@ -146,7 +140,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int currentLength = 0;
|
||||
for (char c : stripHtml(EncodeUtils.decodeHtml(str)).toCharArray()) {
|
||||
for (char c : stripHtml(StringEscapeUtils.unescapeHtml4(str)).toCharArray()) {
|
||||
currentLength += String.valueOf(c).getBytes("GBK").length;
|
||||
if (currentLength <= length - 3) {
|
||||
sb.append(c);
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
*/
|
||||
package com.jeesite.common.lang;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
/**
|
||||
* 时间计算工具类
|
||||
* @author ThinkGem
|
||||
@@ -13,46 +16,45 @@ import java.util.Date;
|
||||
public class TimeUtils {
|
||||
|
||||
/**
|
||||
* 将毫秒数转换为:xx天,xx时,xx分,xx秒
|
||||
* 将时间转换为字符串(xx天,xx时,xx分,xx秒,大于360天显示日期时间)
|
||||
*/
|
||||
public static String formatDateAgo(long millisecond) {
|
||||
long ms = millisecond;
|
||||
int ss = 1000;
|
||||
int mi = ss * 60;
|
||||
int hh = mi * 60;
|
||||
int dd = hh * 24;
|
||||
long day = ms / dd;
|
||||
long hour = (ms - day * dd) / hh;
|
||||
long minute = (ms - day * dd - hour * hh) / mi;
|
||||
long second = (ms - day * dd - hour * hh - minute * mi) / ss;
|
||||
public static String formatDateAgo(long dateTime) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (ms < 1000) {
|
||||
sb.append(ms).append("毫秒");
|
||||
} else {
|
||||
if (day > 0) {
|
||||
if (dateTime < 1000){
|
||||
sb.append(dateTime).append("毫秒");
|
||||
}else{
|
||||
TimeUtils t = new TimeUtils(dateTime);
|
||||
int day = t.get(TimeUtils.DAY);
|
||||
int hour = t.get(TimeUtils.HOUR);
|
||||
int minute = t.get(TimeUtils.MINUTE);
|
||||
int second = t.get(TimeUtils.SECOND);
|
||||
if (day > 365){
|
||||
return DateUtils.formatDate(new Date(dateTime), "yyyy年MM月dd日 HH时mm分ss秒");
|
||||
}
|
||||
if (day > 0){
|
||||
sb.append(day).append("天");
|
||||
}
|
||||
if (hour > 0) {
|
||||
if (hour > 0){
|
||||
sb.append(hour).append("时");
|
||||
}
|
||||
if (minute > 0) {
|
||||
if (minute > 0){
|
||||
sb.append(minute).append("分");
|
||||
}
|
||||
if (second > 0) {
|
||||
if (second > 0){
|
||||
sb.append(second).append("秒");
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 将过去的时间转为为,刚刚,xx秒,xx分钟,xx小时前、xx天前,大于3天的显示日期
|
||||
*/
|
||||
public static String formatTimeAgo(String dateTime) {
|
||||
return formatTimeAgo(DateUtils.parseDate(dateTime));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* 将过去的时间转为为,刚刚,xx秒,xx分钟,xx小时前、xx天前,大于3天的显示日期
|
||||
*/
|
||||
public static String formatTimeAgo(Date dateTime) {
|
||||
@@ -64,8 +66,8 @@ public class TimeUtils {
|
||||
interval = "刚刚";
|
||||
}
|
||||
// 如果时间间隔大于24小时则显示多少天前
|
||||
else if (time / 3600000 < 24 * 4 && time / 3600000 >= 24) {
|
||||
int d = (int) (time / (3600000 * 24));// 得出的时间间隔的单位是天
|
||||
else if (time / 3600000 < 24*4 && time / 3600000 >= 24) {
|
||||
int d = (int) (time / (3600000*24));// 得出的时间间隔的单位是天
|
||||
interval = d + "天前";
|
||||
}
|
||||
// 如果时间间隔小于24小时则显示多少小时前
|
||||
@@ -74,20 +76,310 @@ public class TimeUtils {
|
||||
interval = h + "小时前";
|
||||
}
|
||||
// 如果时间间隔小于60分钟则显示多少分钟前
|
||||
else if (time / 60000 < 60 && time / 60000 >= 1) {
|
||||
else if (time / 60000 < 60 && time / 60000 >=1) {
|
||||
int m = (int) ((time % 3600000) / 60000);// 得出的时间间隔的单位是分钟
|
||||
interval = m + "分钟前";
|
||||
}
|
||||
// 如果时间间隔小于60秒则显示多少秒前
|
||||
else if (time / 1000 < 60 && time / 1000 >= 10) {
|
||||
else if (time / 1000 < 60 && time / 1000 >=10) {
|
||||
int se = (int) ((time % 60000) / 1000);
|
||||
interval = se + "秒前";
|
||||
}
|
||||
// 大于3天的,则显示正常的时间,但是不显示秒
|
||||
else {
|
||||
interval = DateUtils.formatDate(dateTime, "yyyy-MM-dd");
|
||||
interval = DateUtils.formatDate(dateTime,"yyyy-MM-dd");
|
||||
}
|
||||
return interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间字段常量,表示“秒”
|
||||
*/
|
||||
public final static int SECOND = 0;
|
||||
|
||||
/**
|
||||
* 时间字段常量,表示“分”
|
||||
*/
|
||||
public final static int MINUTE = 1;
|
||||
|
||||
/**
|
||||
* 时间字段常量,表示“时”
|
||||
*/
|
||||
public final static int HOUR = 2;
|
||||
|
||||
/**
|
||||
* 时间字段常量,表示“天”
|
||||
*/
|
||||
public final static int DAY = 3;
|
||||
|
||||
/**
|
||||
* 各常量允许的最大值
|
||||
*/
|
||||
private final int[] maxFields = { 59, 59, 23, Integer.MAX_VALUE - 1 };
|
||||
|
||||
/**
|
||||
* 各常量允许的最小值
|
||||
*/
|
||||
private final int[] minFields = { 0, 0, 0, Integer.MIN_VALUE };
|
||||
|
||||
/**
|
||||
* 默认的字符串格式时间分隔符
|
||||
*/
|
||||
private String timeSeparator = ":";
|
||||
|
||||
/**
|
||||
* 时间数据容器
|
||||
*/
|
||||
private int[] fields = new int[4];
|
||||
|
||||
/**
|
||||
* 无参构造,将各字段置为 0
|
||||
*/
|
||||
public TimeUtils() {
|
||||
this(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用时、分构造一个时间
|
||||
* @param hour 小时
|
||||
* @param minute 分钟
|
||||
*/
|
||||
public TimeUtils(int hour, int minute) {
|
||||
this(0, hour, minute, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用时、分、秒构造一个时间
|
||||
* @param hour 小时
|
||||
* @param minute 分钟
|
||||
* @param second 秒
|
||||
*/
|
||||
public TimeUtils(int hour, int minute, int second) {
|
||||
this(0, hour, minute, second);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用一个字符串构造时间<br>
|
||||
* Time time = new Time("14:22:23");
|
||||
* @param time 字符串格式的时间,默认采用“:”作为分隔符
|
||||
*/
|
||||
public TimeUtils(String time) {
|
||||
this(time, null);
|
||||
// System.out.println(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用时间毫秒构建时间
|
||||
* @param time
|
||||
*/
|
||||
public TimeUtils(long time){
|
||||
this(new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用日期对象构造时间
|
||||
* @param date
|
||||
*/
|
||||
public TimeUtils(Date date){
|
||||
this(DateFormatUtils.formatUTC(date, "HH:mm:ss"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用天、时、分、秒构造时间,进行全字符的构造
|
||||
* @param day 天
|
||||
* @param hour 时
|
||||
* @param minute 分
|
||||
* @param second 秒
|
||||
*/
|
||||
public TimeUtils(int day, int hour, int minute, int second) {
|
||||
initialize(day, hour, minute, second);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用一个字符串构造时间,指定分隔符<br>
|
||||
* Time time = new Time("14-22-23", "-");
|
||||
* @param time 字符串格式的时间
|
||||
*/
|
||||
public TimeUtils(String time, String timeSeparator) {
|
||||
if(timeSeparator != null) {
|
||||
setTimeSeparator(timeSeparator);
|
||||
}
|
||||
parseTime(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置时间字段的值
|
||||
* @param field 时间字段常量
|
||||
* @param value 时间字段的值
|
||||
*/
|
||||
public void set(int field, int value) {
|
||||
if(value < minFields[field]) {
|
||||
throw new IllegalArgumentException(value + ", time value must be positive.");
|
||||
}
|
||||
fields[field] = value % (maxFields[field] + 1);
|
||||
// 进行进位计算
|
||||
int carry = value / (maxFields[field] + 1);
|
||||
if(carry > 0) {
|
||||
int upFieldValue = get(field + 1);
|
||||
set(field + 1, upFieldValue + carry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得时间字段的值
|
||||
* @param field 时间字段常量
|
||||
* @return 该时间字段的值
|
||||
*/
|
||||
public int get(int field) {
|
||||
if(field < 0 || field > fields.length - 1) {
|
||||
throw new IllegalArgumentException(field + ", field value is error.");
|
||||
}
|
||||
return fields[field];
|
||||
}
|
||||
|
||||
/**
|
||||
* 将时间进行“加”运算,即加上一个时间
|
||||
* @param time 需要加的时间
|
||||
* @return 运算后的时间
|
||||
*/
|
||||
public TimeUtils addTime(TimeUtils time) {
|
||||
TimeUtils result = new TimeUtils();
|
||||
int up = 0; // 进位标志
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
int sum = fields[i] + time.fields[i] + up;
|
||||
up = sum / (maxFields[i] + 1);
|
||||
result.fields[i] = sum % (maxFields[i] + 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将时间进行“减”运算,即减去一个时间
|
||||
* @param time 需要减的时间
|
||||
* @return 运算后的时间
|
||||
*/
|
||||
public TimeUtils subtractTime(TimeUtils time) {
|
||||
TimeUtils result = new TimeUtils();
|
||||
int down = 0; // 退位标志
|
||||
for (int i = 0, k = fields.length - 1; i < k; i++) {
|
||||
int difference = fields[i] + down;
|
||||
if (difference >= time.fields[i]) {
|
||||
difference -= time.fields[i];
|
||||
down = 0;
|
||||
} else {
|
||||
difference += maxFields[i] + 1 - time.fields[i];
|
||||
down = -1;
|
||||
}
|
||||
result.fields[i] = difference;
|
||||
}
|
||||
result.fields[DAY] = fields[DAY] - time.fields[DAY] + down;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得时间字段的分隔符
|
||||
* @return
|
||||
*/
|
||||
public String getTimeSeparator() {
|
||||
return timeSeparator;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置时间字段的分隔符(用于字符串格式的时间)
|
||||
* @param timeSeparator 分隔符字符串
|
||||
*/
|
||||
public void setTimeSeparator(String timeSeparator) {
|
||||
this.timeSeparator = timeSeparator;
|
||||
}
|
||||
|
||||
private void initialize(int day, int hour, int minute, int second) {
|
||||
set(DAY, day);
|
||||
set(HOUR, hour);
|
||||
set(MINUTE, minute);
|
||||
set(SECOND, second);
|
||||
}
|
||||
|
||||
private void parseTime(String time) {
|
||||
if(time == null) {
|
||||
initialize(0, 0, 0, 0);
|
||||
return;
|
||||
}
|
||||
String t = time;
|
||||
int field = DAY;
|
||||
set(field--, 0);
|
||||
int p = -1;
|
||||
while((p = t.indexOf(timeSeparator)) > -1) {
|
||||
parseTimeField(time, t.substring(0, p), field--);
|
||||
t = t.substring(p + timeSeparator.length());
|
||||
}
|
||||
parseTimeField(time, t, field--);
|
||||
}
|
||||
|
||||
private void parseTimeField(String time, String t, int field) {
|
||||
if(field < SECOND || t.length() < 1) {
|
||||
parseTimeException(time);
|
||||
}
|
||||
char[] chs = t.toCharArray();
|
||||
int n = 0;
|
||||
for(int i = 0; i < chs.length; i++) {
|
||||
if(chs[i] <= ' ') {
|
||||
continue;
|
||||
}
|
||||
if(chs[i] >= '0' && chs[i] <= '9') {
|
||||
n = n * 10 + chs[i] - '0';
|
||||
continue;
|
||||
}
|
||||
parseTimeException(time);
|
||||
}
|
||||
set(field, n);
|
||||
}
|
||||
|
||||
private void parseTimeException(String time) {
|
||||
throw new IllegalArgumentException(time + ", time format error, HH"
|
||||
+ this.timeSeparator + "mm" + this.timeSeparator + "ss");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(16);
|
||||
sb.append(fields[DAY]).append(',').append(' ');
|
||||
buildString(sb, HOUR).append(timeSeparator);
|
||||
buildString(sb, MINUTE).append(timeSeparator);
|
||||
buildString(sb, SECOND);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private StringBuilder buildString(StringBuilder sb, int field) {
|
||||
if(fields[field] < 10) {
|
||||
sb.append('0');
|
||||
}
|
||||
return sb.append(fields[field]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int PRIME = 31;
|
||||
int result = 1;
|
||||
result = PRIME * result + Arrays.hashCode(fields);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final TimeUtils other = (TimeUtils) obj;
|
||||
if (!Arrays.equals(fields, other.fields)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
37
common/src/main/java/com/jeesite/common/mail/EmailUtils.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.common.mail;
|
||||
|
||||
/**
|
||||
* 发送电子邮件
|
||||
*/
|
||||
@Deprecated
|
||||
public class EmailUtils {
|
||||
|
||||
/**
|
||||
* 发送邮件
|
||||
* @param toAddress 接收地址
|
||||
* @param subject 标题
|
||||
* @param content 内容
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean sendEmail(String toAddress, String subject, String content) {
|
||||
return com.jeesite.common.msg.EmailUtils.send(toAddress, subject, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送邮件
|
||||
* @param toAddress 接收地址
|
||||
* @param subject 标题
|
||||
* @param content 内容
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean sendEmail(String fromAddress, String fromPassword, String fromHostName,
|
||||
String sslOnConnect, String sslSmtpPort, String toAddress, String subject, String content) {
|
||||
return com.jeesite.common.msg.EmailUtils.send(fromAddress, fromPassword, fromHostName, sslOnConnect, sslSmtpPort, toAddress, subject, content);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright (c) 2005-2012 springside.org.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
*/
|
||||
package com.jeesite.common.mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.dozer.DozerBeanMapper;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
|
||||
/**
|
||||
* 简单封装Dozer, 实现深度转换Bean<->Bean的Mapper.实现:
|
||||
*
|
||||
* 1. 持有Mapper的单例.
|
||||
* 2. 返回值类型转换.
|
||||
* 3. 批量转换Collection中的所有对象.
|
||||
* 4. 区分创建新的B对象与将对象A值复制到已存在的B对象两种函数.
|
||||
*
|
||||
* @author calvin
|
||||
* @version 2013-01-15
|
||||
*/
|
||||
public class BeanMapper {
|
||||
|
||||
/**
|
||||
* 持有Dozer单例, 避免重复创建DozerMapper消耗资源.
|
||||
*/
|
||||
private static DozerBeanMapper dozer = new DozerBeanMapper();
|
||||
|
||||
/**
|
||||
* 基于Dozer转换对象的类型.
|
||||
*/
|
||||
public static <T> T map(Object source, Class<T> destinationClass) {
|
||||
return dozer.map(source, destinationClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 基于Dozer转换Collection中对象的类型.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static <T> List<T> mapList(Collection sourceList, Class<T> destinationClass) {
|
||||
List<T> destinationList = ListUtils.newArrayList();
|
||||
for (Object sourceObject : sourceList) {
|
||||
T destinationObject = dozer.map(sourceObject, destinationClass);
|
||||
destinationList.add(destinationObject);
|
||||
}
|
||||
return destinationList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 基于Dozer将对象A的值拷贝到对象B中.
|
||||
*/
|
||||
public static void copy(Object source, Object destinationObject) {
|
||||
dozer.map(source, destinationObject);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,6 @@ import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.util.JSONPObject;
|
||||
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.io.PropertiesUtils;
|
||||
|
||||
/**
|
||||
* 简单封装Jackson,实现JSON String<->Java Object的Mapper.
|
||||
@@ -56,9 +55,8 @@ public class JsonMapper extends ObjectMapper {
|
||||
this.configure(Feature.ALLOW_SINGLE_QUOTES, true);
|
||||
// 允许不带引号的字段名称
|
||||
this.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
|
||||
// 设置默认时区
|
||||
this.setTimeZone(TimeZone.getTimeZone(PropertiesUtils.getInstance()
|
||||
.getProperty("lang.defaultTimeZone", "GMT+08:00")));
|
||||
// 设置时区
|
||||
this.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
|
||||
// 设置输入时忽略在JSON字符串中存在但Java对象实际没有的属性
|
||||
this.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
|
||||
// 遇到空值处理为空串
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.jeesite.common.io.PropertiesUtils;
|
||||
|
||||
/**
|
||||
* XML <-> Map、Object
|
||||
@@ -50,9 +49,8 @@ public class XmlMapper extends com.fasterxml.jackson.dataformat.xml.XmlMapper{
|
||||
public XmlMapper() {
|
||||
// Spring ObjectMapper 初始化配置,支持 @JsonView
|
||||
new Jackson2ObjectMapperBuilder().configure(this);
|
||||
// 设置默认时区
|
||||
this.setTimeZone(TimeZone.getTimeZone(PropertiesUtils.getInstance()
|
||||
.getProperty("lang.defaultTimeZone", "GMT+08:00")));
|
||||
// 设置时区
|
||||
this.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
package com.jeesite.common.media;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.image.ImageUtils;
|
||||
import com.jeesite.common.io.FileUtils;
|
||||
import com.jeesite.common.io.PropertiesUtils;
|
||||
import com.jeesite.common.lang.ObjectUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.lang.TimeUtils;
|
||||
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import net.coobird.thumbnailator.Thumbnails.Builder;
|
||||
|
||||
/**
|
||||
* 视频工具类
|
||||
* @author ThinkGem
|
||||
@@ -107,11 +114,34 @@ public class VideoUtils {
|
||||
try {
|
||||
File imgfile = new File(imgFile);
|
||||
if (imgfile.exists()){
|
||||
ImageUtils.thumbnails(imgfile, 800, 600, null);
|
||||
// 过滤掉gif图片,因为gif图片转换后会出现黑色背景的情况(gif基本也没有比较大的图片)。
|
||||
if (!StringUtils.inString(FileUtils.getFileExtension(imgFile), "gif")){
|
||||
Integer w = 800;
|
||||
Integer h = 600;
|
||||
if (StringUtils.isNotBlank(width)){
|
||||
w = ObjectUtils.toInteger(width);
|
||||
}
|
||||
if (StringUtils.isNotBlank(height)){
|
||||
h = ObjectUtils.toInteger(height);
|
||||
}
|
||||
Builder<File> file = Thumbnails.of(imgFile);
|
||||
BufferedImage bufferedImage = ImageIO.read(imgfile);
|
||||
if (bufferedImage.getWidth() <= w){
|
||||
file.width(bufferedImage.getWidth());
|
||||
}else{
|
||||
file.width(w);
|
||||
}
|
||||
if (bufferedImage.getHeight() <= h){
|
||||
file.height(bufferedImage.getHeight());
|
||||
}else{
|
||||
file.height(h);
|
||||
}
|
||||
file.toFile(imgFile);
|
||||
}
|
||||
}else{
|
||||
statusTemp = false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
statusTemp = false;
|
||||
log.error("视频剪切图片失败", e);
|
||||
}
|
||||
|
||||
@@ -43,21 +43,20 @@ public class ReflectUtils {
|
||||
* 调用Getter方法.
|
||||
* 支持多级,如:对象名.对象名.方法
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> E invokeGetter(Object obj, String propertyName) {
|
||||
public static Object invokeGetter(Object obj, String propertyName) {
|
||||
Object object = obj;
|
||||
for (String name : StringUtils.split(propertyName, ".")){
|
||||
String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name);
|
||||
object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {});
|
||||
}
|
||||
return (E)object;
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用Setter方法, 仅匹配方法名。
|
||||
* 支持多级,如:对象名.对象名.方法
|
||||
*/
|
||||
public static <E> void invokeSetter(Object obj, String propertyName, E value) {
|
||||
public static void invokeSetter(Object obj, String propertyName, Object value) {
|
||||
Object object = obj;
|
||||
String[] names = StringUtils.split(propertyName, ".");
|
||||
for (int i=0; i<names.length; i++){
|
||||
@@ -74,17 +73,16 @@ public class ReflectUtils {
|
||||
/**
|
||||
* 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> E getFieldValue(final Object obj, final String fieldName) {
|
||||
public static Object getFieldValue(final Object obj, final String fieldName) {
|
||||
Field field = getAccessibleField(obj, fieldName);
|
||||
if (field == null) {
|
||||
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||
logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||
return null;
|
||||
}
|
||||
E result = null;
|
||||
Object result = null;
|
||||
try {
|
||||
result = (E)field.get(obj);
|
||||
result = field.get(obj);
|
||||
} catch (IllegalAccessException e) {
|
||||
logger.error("不可能抛出的异常{}", e.getMessage());
|
||||
}
|
||||
@@ -94,11 +92,11 @@ public class ReflectUtils {
|
||||
/**
|
||||
* 直接设置对象属性值, 无视private/protected修饰符, 不经过setter函数.
|
||||
*/
|
||||
public static <E> void setFieldValue(final Object obj, final String fieldName, final E value) {
|
||||
public static void setFieldValue(final Object obj, final String fieldName, final Object value) {
|
||||
Field field = getAccessibleField(obj, fieldName);
|
||||
if (field == null) {
|
||||
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||
logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -113,8 +111,7 @@ public class ReflectUtils {
|
||||
* 用于一次性调用的情况,否则应使用getAccessibleMethod()函数获得Method后反复调用.
|
||||
* 同时匹配方法名+参数类型,
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> E invokeMethod(final Object obj, final String methodName, final Class<?>[] parameterTypes,
|
||||
public static Object invokeMethod(final Object obj, final String methodName, final Class<?>[] parameterTypes,
|
||||
final Object[] args) {
|
||||
if (obj == null || methodName == null){
|
||||
return null;
|
||||
@@ -122,11 +119,11 @@ public class ReflectUtils {
|
||||
Method method = getAccessibleMethod(obj, methodName, parameterTypes);
|
||||
if (method == null) {
|
||||
//throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||
logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return (E)method.invoke(obj, args);
|
||||
return method.invoke(obj, args);
|
||||
} catch (Exception e) {
|
||||
String msg = "method: "+method+", obj: "+obj+", args: "+args+"";
|
||||
throw convertReflectionExceptionToUnchecked(msg, e);
|
||||
@@ -138,13 +135,12 @@ public class ReflectUtils {
|
||||
* 用于一次性调用的情况,否则应使用getAccessibleMethodByName()函数获得Method后反复调用.
|
||||
* 只匹配函数名,如果有多个同名函数调用第一个。
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> E invokeMethodByName(final Object obj, final String methodName, final Object[] args) {
|
||||
public static Object invokeMethodByName(final Object obj, final String methodName, final Object[] args) {
|
||||
Method method = getAccessibleMethodByName(obj, methodName, args.length);
|
||||
if (method == null) {
|
||||
// 如果为空不报错,直接返回空。
|
||||
// throw new IllegalArgumentException("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||
logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||
logger.warn("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
@@ -175,7 +171,7 @@ public class ReflectUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
return (E)method.invoke(obj, args);
|
||||
return method.invoke(obj, args);
|
||||
} catch (Exception e) {
|
||||
String msg = "method: "+method+", obj: "+obj+", args: "+args+"";
|
||||
throw convertReflectionExceptionToUnchecked(msg, e);
|
||||
@@ -304,19 +300,19 @@ public class ReflectUtils {
|
||||
Type genType = clazz.getGenericSuperclass();
|
||||
|
||||
if (!(genType instanceof ParameterizedType)) {
|
||||
logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType");
|
||||
logger.warn(clazz.getSimpleName() + "'s superclass not ParameterizedType");
|
||||
return Object.class;
|
||||
}
|
||||
|
||||
Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
|
||||
|
||||
if (index >= params.length || index < 0) {
|
||||
logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: "
|
||||
logger.warn("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: "
|
||||
+ params.length);
|
||||
return Object.class;
|
||||
}
|
||||
if (!(params[index] instanceof Class)) {
|
||||
logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter");
|
||||
logger.warn(clazz.getSimpleName() + " not set the actual class on superclass generic parameter");
|
||||
return Object.class;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,9 +39,6 @@ public final class Base64Uploader {
|
||||
storageState.putInfo("url", ctx + PathFormat.format(savePath));
|
||||
storageState.putInfo("type", suffix);
|
||||
storageState.putInfo("original", "");
|
||||
|
||||
// UEditor上传文件成功后调用事件
|
||||
StorageManager.uploadFileSuccess(physicalPath, storageState);
|
||||
}
|
||||
|
||||
return storageState;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jeesite.common.ueditor.upload;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -8,6 +9,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.fileupload.FileItemIterator;
|
||||
@@ -18,8 +20,8 @@ import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
import com.jeesite.common.image.ImageUtils;
|
||||
import com.jeesite.common.io.FileUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.media.VideoUtils;
|
||||
import com.jeesite.common.ueditor.PathFormat;
|
||||
import com.jeesite.common.ueditor.define.ActionMap;
|
||||
@@ -28,6 +30,9 @@ import com.jeesite.common.ueditor.define.BaseState;
|
||||
import com.jeesite.common.ueditor.define.FileType;
|
||||
import com.jeesite.common.ueditor.define.State;
|
||||
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import net.coobird.thumbnailator.Thumbnails.Builder;
|
||||
|
||||
public class BinaryUploader {
|
||||
|
||||
public static final State save(HttpServletRequest request,
|
||||
@@ -109,8 +114,21 @@ public class BinaryUploader {
|
||||
|
||||
// 如果开启了压缩图片
|
||||
if ((Boolean)conf.get("imageCompressEnable")){
|
||||
Integer maxWidth = (Integer)conf.get("imageCompressBorder");
|
||||
ImageUtils.thumbnails(new File(physicalPath), maxWidth, -1, null);
|
||||
Integer width = (Integer)conf.get("imageCompressBorder");
|
||||
// 过滤掉gif图片,因为gif图片转换后会出现黑色背景的情况(gif基本也没有比较大的图片)。
|
||||
if (StringUtils.inString(FileUtils.getFileExtension(physicalPath),
|
||||
"png","jpg","jpeg","bmp","ico")){
|
||||
Builder<File> file = Thumbnails.of(physicalPath);
|
||||
BufferedImage bufferedImage = ImageIO.read(new File(physicalPath));
|
||||
if (bufferedImage != null){
|
||||
if (bufferedImage.getWidth() <= width){
|
||||
file.width(bufferedImage.getWidth());
|
||||
}else{
|
||||
file.width(width);
|
||||
}
|
||||
file.toFile(physicalPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -135,19 +153,12 @@ public class BinaryUploader {
|
||||
storageState.putInfo("url", ctx + PathFormat.format(savePath) + "." + v.getOutputFileExtension());
|
||||
storageState.putInfo("type", "." + v.getOutputFileExtension());
|
||||
storageState.putInfo("original", originFileName +"."+ v.getInputFileExtension());
|
||||
|
||||
// Ueditor编辑器上传文件完成后调用事件
|
||||
StorageManager.uploadFileSuccess(physicalPath, storageState);
|
||||
|
||||
return storageState;
|
||||
}
|
||||
}
|
||||
storageState.putInfo("url", ctx + PathFormat.format(savePath));
|
||||
storageState.putInfo("type", suffix);
|
||||
storageState.putInfo("original", originFileName + suffix);
|
||||
|
||||
// UEditor上传文件成功后调用事件
|
||||
StorageManager.uploadFileSuccess(physicalPath, storageState);
|
||||
}
|
||||
|
||||
return storageState;
|
||||
|
||||
@@ -210,14 +210,4 @@ public class StorageManager {
|
||||
|
||||
return new BaseState(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* UEditor上传文件成功后调用事件
|
||||
* @param physicalPath 上传文件实际路径
|
||||
* @param storageState.url 返回到客户端的文件访问地址
|
||||
*/
|
||||
public static void uploadFileSuccess(String physicalPath, State storageState){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -585,18 +585,18 @@ public class ExcelExport implements Closeable{
|
||||
return this;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 清理临时文件
|
||||
// * @deprecated see close()
|
||||
// */
|
||||
// public ExcelExport dispose(){
|
||||
// try {
|
||||
// this.close();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return this;
|
||||
// }
|
||||
/**
|
||||
* 清理临时文件
|
||||
* @deprecated see close()
|
||||
*/
|
||||
public ExcelExport dispose(){
|
||||
try {
|
||||
this.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
|
||||
text/html html htm shtml
|
||||
text/css css
|
||||
text/xml xml
|
||||
image/gif gif
|
||||
image/jpeg jpeg jpg
|
||||
application/javascript js
|
||||
application/atom+xml atom
|
||||
application/rss+xml rss
|
||||
|
||||
text/mathml mml
|
||||
text/plain txt
|
||||
text/vnd.sun.j2me.app-descriptor jad
|
||||
text/vnd.wap.wml wml
|
||||
text/x-component htc
|
||||
|
||||
image/png png
|
||||
image/tiff tif tiff
|
||||
image/vnd.wap.wbmp wbmp
|
||||
image/x-icon ico
|
||||
image/x-jng jng
|
||||
image/x-ms-bmp bmp
|
||||
image/svg+xml svg svgz
|
||||
image/webp webp
|
||||
|
||||
application/font-woff woff
|
||||
application/java-archive jar war ear
|
||||
application/json json
|
||||
application/mac-binhex40 hqx
|
||||
application/msword doc
|
||||
application/pdf pdf
|
||||
application/postscript ps eps ai
|
||||
application/rtf rtf
|
||||
application/vnd.apple.mpegurl m3u8
|
||||
application/vnd.ms-excel xls
|
||||
application/vnd.ms-fontobject eot
|
||||
application/vnd.ms-powerpoint ppt
|
||||
application/vnd.wap.wmlc wmlc
|
||||
application/vnd.google-earth.kml+xml kml
|
||||
application/vnd.google-earth.kmz kmz
|
||||
application/x-7z-compressed 7z
|
||||
application/x-cocoa cco
|
||||
application/x-java-archive-diff jardiff
|
||||
application/x-java-jnlp-file jnlp
|
||||
application/x-makeself run
|
||||
application/x-perl pl pm
|
||||
application/x-pilot prc pdb
|
||||
application/x-rar-compressed rar
|
||||
application/x-redhat-package-manager rpm
|
||||
application/x-sea sea
|
||||
application/x-shockwave-flash swf
|
||||
application/x-stuffit sit
|
||||
application/x-tcl tcl tk
|
||||
application/x-x509-ca-cert der pem crt
|
||||
application/x-xpinstall xpi
|
||||
application/xhtml+xml xhtml
|
||||
application/xspf+xml xspf
|
||||
application/zip zip
|
||||
|
||||
application/octet-stream bin exe dll
|
||||
application/octet-stream deb
|
||||
application/octet-stream dmg
|
||||
application/octet-stream iso img
|
||||
application/octet-stream msi msp msm
|
||||
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
|
||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
|
||||
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
|
||||
|
||||
audio/midi mid midi kar
|
||||
audio/mpeg mp3
|
||||
audio/ogg ogg
|
||||
audio/x-m4a m4a
|
||||
audio/x-realaudio ra
|
||||
|
||||
video/3gpp 3gpp 3gp
|
||||
video/mp2t ts
|
||||
video/mp4 mp4
|
||||
video/mpeg mpeg mpg
|
||||
video/quicktime mov
|
||||
video/webm webm
|
||||
video/x-flv flv
|
||||
video/x-m4v m4v
|
||||
video/x-mng mng
|
||||
video/x-ms-asf asx asf
|
||||
video/x-ms-wmv wmv
|
||||
video/x-msvideo avi
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*!
|
||||
* AdminLTE v2.4.0
|
||||
* Author: Almsaeed Studio
|
||||
* Website: Almsaeed Studio <https://adminlte.io>
|
||||
@@ -198,7 +198,7 @@ a:focus {
|
||||
margin-left: 230px;
|
||||
border: none;
|
||||
min-height: 50px;
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
}
|
||||
.layout-top-nav .main-header .navbar {
|
||||
margin-left: 0;
|
||||
@@ -727,7 +727,7 @@ a:focus {
|
||||
border-left-width: 0;
|
||||
}
|
||||
.nav-tabs.control-sidebar-tabs > li > a {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
}
|
||||
.nav-tabs.control-sidebar-tabs > li > a,
|
||||
.nav-tabs.control-sidebar-tabs > li > a:hover {
|
||||
@@ -1233,7 +1233,7 @@ a:focus {
|
||||
* ---------------
|
||||
*/
|
||||
.form-control {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
border-color: #d2d6de;
|
||||
}
|
||||
@@ -1287,14 +1287,14 @@ a:focus {
|
||||
}
|
||||
/* Input group */
|
||||
.input-group .input-group-addon {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
border-color: #d2d6de;
|
||||
background-color: #fff;
|
||||
}
|
||||
/* button groups */
|
||||
.btn-group-vertical .btn.btn-flat:first-of-type,
|
||||
.btn-group-vertical .btn.btn-flat:last-of-type {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
}
|
||||
.icheck > label {
|
||||
padding-left: 0;
|
||||
@@ -2026,7 +2026,7 @@ a:focus {
|
||||
}
|
||||
.info-box .progress,
|
||||
.info-box .progress .progress-bar {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
}
|
||||
.info-box .progress .progress-bar {
|
||||
background: #fff;
|
||||
@@ -2177,7 +2177,7 @@ a:focus {
|
||||
* -----------------
|
||||
*/
|
||||
.btn {
|
||||
border-radius: 4px;
|
||||
border-radius: 3px;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border: 1px solid transparent;
|
||||
@@ -2186,7 +2186,7 @@ a:focus {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.btn.btn-flat {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
@@ -2421,7 +2421,7 @@ a:focus {
|
||||
}
|
||||
/* NAV PILLS */
|
||||
.nav-pills > li > a {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
border-top: 3px solid transparent;
|
||||
color: #444;
|
||||
}
|
||||
@@ -2440,7 +2440,7 @@ a:focus {
|
||||
}
|
||||
/* NAV STACKED */
|
||||
.nav-stacked > li > a {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
border-top: 0;
|
||||
border-left: 3px solid transparent;
|
||||
color: #444;
|
||||
@@ -2482,7 +2482,7 @@ a:focus {
|
||||
}
|
||||
.nav-tabs-custom > .nav-tabs > li > a {
|
||||
color: #444;
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
}
|
||||
.nav-tabs-custom > .nav-tabs > li > a.text-muted {
|
||||
color: #999;
|
||||
@@ -2630,7 +2630,7 @@ a:focus {
|
||||
.product-list-in-box > .item {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
}
|
||||
.product-list-in-box > .item:last-of-type {
|
||||
@@ -2967,7 +2967,7 @@ table.text-center th {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.modal-content {
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, 0.125);
|
||||
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.125);
|
||||
border: 0;
|
||||
@@ -4232,7 +4232,7 @@ table.text-center th {
|
||||
.select2-container--default .select2-selection--single,
|
||||
.select2-selection .select2-selection--single {
|
||||
border: 1px solid #d2d6de;
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
padding: 6px 12px;
|
||||
height: 34px;
|
||||
}
|
||||
@@ -4241,7 +4241,7 @@ table.text-center th {
|
||||
}
|
||||
.select2-dropdown {
|
||||
border: 1px solid #d2d6de;
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
}
|
||||
.select2-container--default .select2-results__option--highlighted[aria-selected] {
|
||||
background-color: #3c8dbc;
|
||||
@@ -4293,7 +4293,7 @@ table.text-center th {
|
||||
}
|
||||
.select2-container--default .select2-selection--multiple {
|
||||
border: 1px solid #d2d6de;
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
}
|
||||
.select2-container--default .select2-selection--multiple:focus {
|
||||
border-color: #3c8dbc;
|
||||
@@ -4662,7 +4662,7 @@ table.text-center th {
|
||||
.list-group-unbordered > .list-group-item {
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
/*border-radius: 0;*/
|
||||
border-radius: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Skin: Black
|
||||
* ----------
|
||||
*/
|
||||
.main-header .navbar {
|
||||
background-color: #303643;
|
||||
}
|
||||
.main-header .navbar .nav > li > a {
|
||||
color: #eaeaea;
|
||||
}
|
||||
.main-header .navbar .nav > li > a:hover,
|
||||
.main-header .navbar .nav > li > a:active,
|
||||
.main-header .navbar .nav > li > a:focus,
|
||||
.main-header .navbar .nav .open > a,
|
||||
.main-header .navbar .nav .open > a:hover,
|
||||
.main-header .navbar .nav .open > a:focus,
|
||||
.main-header .navbar .nav > .active > a {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
color: #f6f6f6;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #ffffff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
color: #f6f6f6;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
background-color: #367fa9;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.main-header .navbar .dropdown-menu li.divider {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.main-header .navbar .dropdown-menu li a {
|
||||
color: #fff;
|
||||
}
|
||||
.main-header .navbar .dropdown-menu li a:hover {
|
||||
background: #367fa9;
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
/* background-color: #2A579A; */
|
||||
color: #f6f6f6;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.main-header .logo:hover {
|
||||
/* background-color: #204F93; */
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.main-header li.user-header {
|
||||
background-color: #2A579A;
|
||||
}
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #E3E7EC;
|
||||
}
|
||||
.content-wrapper,
|
||||
.main-footer {
|
||||
border-left: 1px solid #d2d6de;
|
||||
}
|
||||
.user-panel > .info,
|
||||
.user-panel > .info > a {
|
||||
color: #555;
|
||||
}
|
||||
.sidebar-menu > li {
|
||||
-webkit-transition: border-left-color 0.3s ease;
|
||||
-o-transition: border-left-color 0.3s ease;
|
||||
transition: border-left-color 0.3s ease;
|
||||
}
|
||||
.sidebar-menu > li.header {
|
||||
color: #848484;
|
||||
background: #E3E7EC;
|
||||
}
|
||||
.sidebar-menu > li > a {
|
||||
border-left: 3px solid transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
.sidebar-menu > li:hover > a,
|
||||
.sidebar-menu > li.active > a {
|
||||
color: #000;
|
||||
background: #EAEDF1;
|
||||
}
|
||||
.sidebar-menu > li.active {
|
||||
border-left-color: #2A579A;
|
||||
}
|
||||
.sidebar-menu > li.active > a {
|
||||
font-weight: 600;
|
||||
}
|
||||
.sidebar-menu > li.menu-open > a,
|
||||
.sidebar-menu > li > .treeview-menu {
|
||||
background: #EAEDF1;
|
||||
}
|
||||
.sidebar a {
|
||||
color: #555;
|
||||
}
|
||||
.sidebar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.treeview-menu > li > a {
|
||||
color: #555;
|
||||
}
|
||||
.treeview-menu > li.active > a,
|
||||
.treeview-menu > li > a:hover {
|
||||
color: #000;
|
||||
}
|
||||
.sidebar-form {
|
||||
border-radius: 3px;
|
||||
border: 1px solid #d2d6de;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
.sidebar-form input[type="text"],
|
||||
.sidebar-form .btn {
|
||||
box-shadow: none;
|
||||
background-color: #fff;
|
||||
border: 1px solid transparent;
|
||||
height: 35px;
|
||||
}
|
||||
.sidebar-form input[type="text"] {
|
||||
color: #666;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
.sidebar-form input[type="text"]:focus,
|
||||
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.sidebar-form .btn {
|
||||
color: #999;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.main-footer {
|
||||
border-top-color: #d2d6de;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo {
|
||||
background-color: #2A579A;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo:hover {
|
||||
background-color: #3b8ab8;
|
||||
}
|
||||
|
||||
.sidebar-menu .treeview-item.active > a {color:#000;background-color:#fff;}
|
||||
@@ -76,7 +76,6 @@
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
.wrapper,
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #263238;
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Skin: Black
|
||||
* ----------
|
||||
*/
|
||||
.main-header .navbar {
|
||||
background-color: #263238;
|
||||
}
|
||||
.main-header .navbar .nav > li > a {
|
||||
color: #eaeaea;
|
||||
}
|
||||
.main-header .navbar .nav > li > a:hover,
|
||||
.main-header .navbar .nav > li > a:active,
|
||||
.main-header .navbar .nav > li > a:focus,
|
||||
.main-header .navbar .nav .open > a,
|
||||
.main-header .navbar .nav .open > a:hover,
|
||||
.main-header .navbar .nav .open > a:focus,
|
||||
.main-header .navbar .nav > .active > a {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
color: #f6f6f6;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #ffffff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
color: #f6f6f6;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
background-color: #367fa9;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.main-header .navbar .dropdown-menu li.divider {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.main-header .navbar .dropdown-menu li a {
|
||||
color: #fff;
|
||||
}
|
||||
.main-header .navbar .dropdown-menu li a:hover {
|
||||
background: #367fa9;
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
/* background-color: #367fa9; */
|
||||
color: #f6f6f6;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.main-header .logo:hover {
|
||||
/* background-color: #357ca5; */
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.main-header li.user-header {
|
||||
background-color: #3c8dbc;
|
||||
}
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #263238;
|
||||
}
|
||||
.user-panel > .info,
|
||||
.user-panel > .info > a {
|
||||
color: #fff;
|
||||
}
|
||||
.sidebar-menu > li.header {
|
||||
color: #4b646f;
|
||||
background: #1a2226;
|
||||
}
|
||||
.sidebar-menu > li > a {
|
||||
border-left: 3px solid transparent;
|
||||
}
|
||||
.sidebar-menu > li:hover > a,
|
||||
.sidebar-menu > li.active > a {
|
||||
color: #ffffff;
|
||||
background: #2c3b41;
|
||||
/* border-left-color: #3c8dbc; */
|
||||
}
|
||||
.sidebar-menu > li.menu-open > a,
|
||||
.sidebar-menu > li > .treeview-menu {
|
||||
background: #2c3b41;
|
||||
}
|
||||
.sidebar a {
|
||||
color: #eaeaea;
|
||||
}
|
||||
.sidebar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.treeview-menu > li > a {
|
||||
color: #c7d0da;
|
||||
}
|
||||
.treeview-menu > li.active > a,
|
||||
.treeview-menu > li > a:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
.sidebar-form {
|
||||
border-radius: 3px;
|
||||
border: 1px solid #374850;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
.sidebar-form input[type="text"],
|
||||
.sidebar-form .btn {
|
||||
box-shadow: none;
|
||||
background-color: #374850;
|
||||
border: 1px solid transparent;
|
||||
height: 35px;
|
||||
}
|
||||
.sidebar-form input[type="text"] {
|
||||
color: #666;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
.sidebar-form input[type="text"]:focus,
|
||||
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.sidebar-form .btn {
|
||||
color: #999;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo {
|
||||
background-color: #3c8dbc;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo:hover {
|
||||
background-color: #3b8ab8;
|
||||
}
|
||||
|
||||
.sidebar-menu .treeview-item.active > a {color:#fff;background-color:#3c8dbc;}
|
||||
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* http://jeesite.com
|
||||
*/
|
||||
a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sortable {
|
||||
color:#1890ff;
|
||||
}
|
||||
.main-header .navbar {
|
||||
background-color: #1890ff;
|
||||
}
|
||||
.main-header .navbar .nav > li > a {
|
||||
color: #ffffff;
|
||||
}
|
||||
.main-header .navbar .nav > li > a:hover,
|
||||
.main-header .navbar .nav > li > a:active,
|
||||
.main-header .navbar .nav > li > a:focus,
|
||||
.main-header .navbar .nav .open > a,
|
||||
.main-header .navbar .nav .open > a:hover,
|
||||
.main-header .navbar .nav .open > a:focus,
|
||||
.main-header .navbar .nav > .active > a {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
color: #f6f6f6;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #ffffff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
color: #f6f6f6;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
background-color: #367fa9;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.main-header .navbar .dropdown-menu li.divider {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.main-header .navbar .dropdown-menu li a {
|
||||
color: #fff;
|
||||
}
|
||||
.main-header .navbar .dropdown-menu li a:hover {
|
||||
background: #367fa9;
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
background-color: #1890ff;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.main-header .logo:hover {
|
||||
background-color: #1890ff;
|
||||
}
|
||||
.main-header li.user-header {
|
||||
background-color: #1890ff;
|
||||
}
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.content-wrapper,
|
||||
.main-footer {
|
||||
border-left: 1px solid #eeeeee;
|
||||
}
|
||||
.user-panel > .info,
|
||||
.user-panel > .info > a {
|
||||
color: #555;
|
||||
}
|
||||
.sidebar-menu > li {
|
||||
-webkit-transition: border-left-color 0.3s ease;
|
||||
-o-transition: border-left-color 0.3s ease;
|
||||
transition: border-left-color 0.3s ease;
|
||||
}
|
||||
.sidebar-menu > li.header {
|
||||
color: #848484;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
.sidebar-menu > li > a {
|
||||
border-left: 3px solid transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
.sidebar-menu > li:hover > a,
|
||||
.sidebar-menu > li.active > a {
|
||||
color: #000;
|
||||
background: #ffffff;
|
||||
}
|
||||
.sidebar-menu > li.active {
|
||||
border-left-color: #1890ff;
|
||||
}
|
||||
.sidebar-menu > li.active > a {
|
||||
font-weight: 600;
|
||||
}
|
||||
.sidebar-menu > li.menu-open > a,
|
||||
.sidebar-menu > li > .treeview-menu {
|
||||
background: #ffffff;
|
||||
}
|
||||
.sidebar a {
|
||||
color: #555;
|
||||
}
|
||||
.sidebar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.treeview-menu > li > a {
|
||||
color: #555;
|
||||
}
|
||||
.treeview-menu > li.active > a,
|
||||
.treeview-menu > li > a:hover {
|
||||
color: #000;
|
||||
}
|
||||
.sidebar-form {
|
||||
border-radius: 3px;
|
||||
border: 1px solid #d2d6de;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
.sidebar-form input[type="text"],
|
||||
.sidebar-form .btn {
|
||||
box-shadow: none;
|
||||
background-color: #fff;
|
||||
border: 1px solid transparent;
|
||||
height: 35px;
|
||||
}
|
||||
.sidebar-form input[type="text"] {
|
||||
color: #666;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
.sidebar-form input[type="text"]:focus,
|
||||
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.sidebar-form .btn {
|
||||
color: #999;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.main-footer {
|
||||
border-top-color: #d2d6de;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo {
|
||||
background-color: #1890ff;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo:hover {
|
||||
background-color: #3b8ab8;
|
||||
}
|
||||
|
||||
.sidebar-menu .treeview-item.active > a {color:#1890ff;background-color:#e1f1ff;border-right:solid #57a6ee;}
|
||||
|
||||
.content-wrapper, .right-side, body {background-color:#f8f8f8;}
|
||||
|
||||
.btn-primary, .btn-primary:hover, .btn-primary:active,
|
||||
.btn-primary.hover, .btn-primary.focus, .btn-primary:focus,
|
||||
.btn-primary.active.focus, .btn-primary.active:focus, .btn-primary.active:hover,
|
||||
.btn-primary:active.focus, .btn-primary:active:focus, .btn-primary:active:hover,
|
||||
.open>.dropdown-toggle.btn-primary.focus, .open>.dropdown-toggle.btn-primary:focus,
|
||||
.open>.dropdown-toggle.btn-primary:hover, .layui-layer-btn .layui-layer-btn0,
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice,
|
||||
.select2-container--default .select2-results__option--highlighted[aria-selected],
|
||||
.wup_container .placeholder .webuploader-pick {background-color:#1890ff!important;border-color:#1890ff;}
|
||||
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#1890ff;}
|
||||
.form-unit {border-bottom: 1px solid #eee;}
|
||||
|
||||
.tabpanel_mover li {padding:1px 16px 2px 3px;margin:6px 0 6px 6px;border:1px solid #e4e4e4;
|
||||
border-radius:3px;background:#fff;box-shadow:0 0 5px #e6e6e6;}
|
||||
.tabpanel_mover li.active {background-color:#3aa0ff;}
|
||||
.tabpanel_mover li.active div {color:#fff;}
|
||||
.tabpanel_mover li .closer {font:11px/1 FontAwesome;top:6px;right:2px;background:none;opacity:0.7;}
|
||||
.tabpanel_mover li .closer:before {content:"\f00d";}
|
||||
.tabpanel_mover li .closer:hover {background:none;-moz-transform: scale(1.2);-webkit-transform: scale(1.2);
|
||||
-o-transform: scale(1.2);-ms-transform: scale(1.2);transform: scale(1.2);color:#d30606;}
|
||||
.tabpanel_mover li.active .closer:hover {color:#fff;opacity:0.9;}
|
||||
.tabpanel_tab_content {background-color:#fafafa;border-bottom-color:#eeeeee;overflow:visible;}
|
||||
/* .tabpanel_mover li {background:#fff;border-right:1px solid #eee;padding:8px 16px 8px 5px;}
|
||||
.tabpanel_mover li.active {background-color:#fff;border-bottom:3px solid #3aa0ff;}
|
||||
.tabpanel_mover li.active div {color:#0975d9;}
|
||||
.tabpanel_mover li .closer {background:none;font:11px/1 FontAwesome;opacity:0.7;}
|
||||
.tabpanel_mover li .closer:before {content:"\f00d";}
|
||||
.tabpanel_mover li .closer:hover {background:none;-moz-transform: scale(1.2);-webkit-transform: scale(1.2);
|
||||
-o-transform: scale(1.2);-ms-transform: scale(1.2);transform: scale(1.2);color:#d30606;}
|
||||
.tabpanel_tab_content {background-color:#fafafa;border-bottom-color:#eeeeee;overflow:visible;} 替换上面 tab 样式,改变 tab 风格。*/
|
||||
|
||||
/* .main-content {padding:10px;}
|
||||
.ui-layout-container {padding:10px;}
|
||||
.ui-layout-resizer {background:transparent;}
|
||||
.ui-layout-pane {box-shadow:0 0 5px #e0e0e0;}
|
||||
.ui-layout-pane>.main-content {padding:0;}
|
||||
.ui-layout-content>.wrapper>.main-content {padding:0;}
|
||||
.box-main,.nav-main{border-radius:3px;box-shadow:0 0 5px #e0e0e0;} 解开注释,可给内容页面,添加内边距样式 */
|
||||
.box-main>.box-header {border-bottom-color:#eeeeee;}
|
||||
.box-main>.box-header .box-title .fa {color:#1890ff;}
|
||||
.nav-tabs-custom>.nav-tabs>li.active {border-top-color:#3aa0ff;}
|
||||
.form-control:focus,.select2-container--default.select2-container--focus .select2-selection--multiple,
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {border-color:#66afe9!important;}
|
||||
.table thead tr, .ui-jqgrid-htable thead tr, .ui-jqgrid-hdiv, .ui-jqgrid-hbox {background-color:#f6f6f6;}
|
||||
.ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column,
|
||||
.ui-jqgrid .ui-jqgrid-labels th, .ui-jqgrid .ui-widget-content, .ui-jqgrid tr.ui-row-ltr td,
|
||||
.ui-jqgrid tr.ui-row-rtl td, .ui-jqgrid tr.ui-row-ltr td:last-child {border-color:#eaeaea;}
|
||||
.ui-state-hover td, .ui-widget-content .ui-state-hover td, .ui-widget-header .ui-state-hover td,
|
||||
.ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {background:#f5f5f5;}
|
||||
.ui-jqgrid tr.ui-state-highlight.ui-row-ltr td {background-color:#e5f3ff;}
|
||||
/* .ui-jqgrid tr.ui-row-ltr td {border-right:0!important;} 解开注释,可去除表格单元格的竖边框线 */
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
/* background-color: #367fa9; */
|
||||
background-color: #367fa9;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
@@ -56,7 +56,6 @@
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.wrapper,
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #263238;
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* http://jeesite.com
|
||||
*/
|
||||
a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sortable {
|
||||
color:#1e5edb;
|
||||
}
|
||||
.main-header .navbar {
|
||||
background-color: #1951be;
|
||||
}
|
||||
.main-header .navbar .nav > li > a {
|
||||
color: #ffffff;
|
||||
}
|
||||
.main-header .navbar .nav > li > a:hover,
|
||||
.main-header .navbar .nav > li > a:active,
|
||||
.main-header .navbar .nav > li > a:focus,
|
||||
.main-header .navbar .nav .open > a,
|
||||
.main-header .navbar .nav .open > a:hover,
|
||||
.main-header .navbar .nav .open > a:focus,
|
||||
.main-header .navbar .nav > .active > a {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
color: #f6f6f6;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #ffffff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
color: #f6f6f6;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #fff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
background-color: #367fa9;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.main-header .navbar .dropdown-menu li.divider {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.main-header .navbar .dropdown-menu li a {
|
||||
color: #fff;
|
||||
}
|
||||
.main-header .navbar .dropdown-menu li a:hover {
|
||||
background: #367fa9;
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
background-color: #1951be;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.main-header .logo:hover {
|
||||
background-color: #1951be;
|
||||
}
|
||||
.main-header li.user-header {
|
||||
background-color: #1951be;
|
||||
}
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.content-wrapper,
|
||||
.main-footer {
|
||||
border-left: 1px solid #eeeeee;
|
||||
}
|
||||
.user-panel > .info,
|
||||
.user-panel > .info > a {
|
||||
color: #555;
|
||||
}
|
||||
.sidebar-menu > li {
|
||||
-webkit-transition: border-left-color 0.3s ease;
|
||||
-o-transition: border-left-color 0.3s ease;
|
||||
transition: border-left-color 0.3s ease;
|
||||
}
|
||||
.sidebar-menu > li.header {
|
||||
color: #848484;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
.sidebar-menu > li > a {
|
||||
border-left: 3px solid transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
.sidebar-menu > li:hover > a,
|
||||
.sidebar-menu > li.active > a {
|
||||
color: #000;
|
||||
background: #ffffff;
|
||||
}
|
||||
.sidebar-menu > li.active {
|
||||
border-left-color: #1e5edb;
|
||||
}
|
||||
.sidebar-menu > li.active > a {
|
||||
font-weight: 600;
|
||||
}
|
||||
.sidebar-menu > li.menu-open > a,
|
||||
.sidebar-menu > li > .treeview-menu {
|
||||
background: #ffffff;
|
||||
}
|
||||
.sidebar a {
|
||||
color: #555;
|
||||
}
|
||||
.sidebar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.treeview-menu > li > a {
|
||||
color: #555;
|
||||
}
|
||||
.treeview-menu > li.active > a,
|
||||
.treeview-menu > li > a:hover {
|
||||
color: #000;
|
||||
}
|
||||
.sidebar-form {
|
||||
border-radius: 3px;
|
||||
border: 1px solid #d2d6de;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
.sidebar-form input[type="text"],
|
||||
.sidebar-form .btn {
|
||||
box-shadow: none;
|
||||
background-color: #fff;
|
||||
border: 1px solid transparent;
|
||||
height: 35px;
|
||||
}
|
||||
.sidebar-form input[type="text"] {
|
||||
color: #666;
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
.sidebar-form input[type="text"]:focus,
|
||||
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
}
|
||||
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.sidebar-form .btn {
|
||||
color: #999;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.main-footer {
|
||||
border-top-color: #d2d6de;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo {
|
||||
background-color: #1e5edb;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo:hover {
|
||||
background-color: #3b8ab8;
|
||||
}
|
||||
|
||||
.sidebar-menu .treeview-item.active > a {color:#001C6B;background-color:#e1f1ff;border-right:solid #7791ce;}
|
||||
|
||||
.content-wrapper, .right-side, body {background-color:#f8f8f8;}
|
||||
|
||||
.btn-primary, .btn-primary:hover, .btn-primary:active,
|
||||
.btn-primary.hover, .btn-primary.focus, .btn-primary:focus,
|
||||
.btn-primary.active.focus, .btn-primary.active:focus, .btn-primary.active:hover,
|
||||
.btn-primary:active.focus, .btn-primary:active:focus, .btn-primary:active:hover,
|
||||
.open>.dropdown-toggle.btn-primary.focus, .open>.dropdown-toggle.btn-primary:focus,
|
||||
.open>.dropdown-toggle.btn-primary:hover, .layui-layer-btn .layui-layer-btn0,
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice,
|
||||
.select2-container--default .select2-results__option--highlighted[aria-selected],
|
||||
.wup_container .placeholder .webuploader-pick {background-color:#1e5edb!important;border-color:#1e5edb!important;}
|
||||
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#1e5edb;}
|
||||
.form-unit {border-bottom: 1px solid #eee;}
|
||||
|
||||
.tabpanel_mover li {padding:1px 16px 2px 3px;margin:6px 0 6px 6px;border:1px solid #e4e4e4;
|
||||
border-radius:3px;background:#fff;box-shadow:0 0 5px #e6e6e6;}
|
||||
.tabpanel_mover li.active {background-color:#1e5edb;}
|
||||
.tabpanel_mover li.active div {color:#fff;}
|
||||
.tabpanel_mover li .closer {font:11px/1 FontAwesome;top:6px;right:2px;background:none;opacity:0.7;}
|
||||
.tabpanel_mover li .closer:before {content:"\f00d";}
|
||||
.tabpanel_mover li .closer:hover {background:none;-moz-transform: scale(1.2);-webkit-transform: scale(1.2);
|
||||
-o-transform: scale(1.2);-ms-transform: scale(1.2);transform: scale(1.2);color:#d30606;}
|
||||
.tabpanel_mover li.active .closer:hover {color:#fff;opacity:0.9;}
|
||||
.tabpanel_tab_content {background-color:#fafafa;border-bottom-color:#eeeeee;overflow:visible;}
|
||||
/* .tabpanel_mover li {background:#fff;border-right:1px solid #eee;padding:8px 16px 8px 5px;}
|
||||
.tabpanel_mover li.active {background-color:#fff;border-bottom:3px solid #1e5edb;}
|
||||
.tabpanel_mover li.active div {color:#0975d9;}
|
||||
.tabpanel_mover li .closer {background:none;font:11px/1 FontAwesome;opacity:0.7;}
|
||||
.tabpanel_mover li .closer:before {content:"\f00d";}
|
||||
.tabpanel_mover li .closer:hover {background:none;-moz-transform: scale(1.2);-webkit-transform: scale(1.2);
|
||||
-o-transform: scale(1.2);-ms-transform: scale(1.2);transform: scale(1.2);color:#d30606;}
|
||||
.tabpanel_tab_content {background-color:#fafafa;border-bottom-color:#eeeeee;overflow:visible;} 替换上面 tab 样式,改变 tab 风格。*/
|
||||
|
||||
/* .main-content {padding:10px;}
|
||||
.ui-layout-container {padding:10px;}
|
||||
.ui-layout-resizer {background:transparent;}
|
||||
.ui-layout-pane {box-shadow:0 0 5px #e0e0e0;}
|
||||
.ui-layout-pane>.main-content {padding:0;}
|
||||
.ui-layout-content>.wrapper>.main-content {padding:0;}
|
||||
.box-main,.nav-main{border-radius:3px;box-shadow:0 0 5px #e0e0e0;} 解开注释,可给内容页面,添加内边距样式 */
|
||||
.box-main>.box-header {border-bottom-color:#eeeeee;}
|
||||
.box-main>.box-header .box-title .fa {color:#1e5edb;}
|
||||
.nav-tabs-custom>.nav-tabs>li.active {border-top-color:#1e5edb;}
|
||||
.form-control:focus,.select2-container--default.select2-container--focus .select2-selection--multiple,
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {border-color:#6980c3!important;}
|
||||
.table thead tr, .ui-jqgrid-htable thead tr, .ui-jqgrid-hdiv, .ui-jqgrid-hbox {background-color:#f6f6f6;}
|
||||
.ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column,
|
||||
.ui-jqgrid .ui-jqgrid-labels th, .ui-jqgrid .ui-widget-content, .ui-jqgrid tr.ui-row-ltr td,
|
||||
.ui-jqgrid tr.ui-row-rtl td, .ui-jqgrid tr.ui-row-ltr td:last-child {border-color:#eaeaea;}
|
||||
.ui-state-hover td, .ui-widget-content .ui-state-hover td, .ui-widget-header .ui-state-hover td,
|
||||
.ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {background:#f5f5f5;}
|
||||
.ui-jqgrid tr.ui-state-highlight.ui-row-ltr td {background-color:#e5f3ff;}
|
||||
/* .ui-jqgrid tr.ui-row-ltr td {border-right:0!important;} 解开注释,可去除表格单元格的竖边框线 */
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
/* background-color: #008d4c; */
|
||||
background-color: #008d4c;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
@@ -56,7 +56,6 @@
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.wrapper,
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #263238;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
/* background-color: #555299; */
|
||||
background-color: #555299;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
@@ -56,7 +56,6 @@
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.wrapper,
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #263238;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
/* background-color: #d73925; */
|
||||
background-color: #d73925;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
@@ -56,7 +56,6 @@
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.wrapper,
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #263238;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
}
|
||||
.main-header .logo {
|
||||
/* background-color: #e08e0b; */
|
||||
background-color: #e08e0b;
|
||||
color: #ffffff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
@@ -56,7 +56,6 @@
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.wrapper,
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #263238;
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -98,7 +98,7 @@ ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height
|
||||
/* 树搜索相关 */
|
||||
.treeSearchInput {padding:13px 0 0 20px;}
|
||||
.treeSearchInput label {padding:5px 0 3px 0;font-size:13px;font-weight:normal;vertical-align:middle;}
|
||||
.treeSearchInput input {width:140px;vertical-align:middle;line-height:24px;height:26px;border:1px solid #bbb;padding:0 4px;border-radius:4px;}
|
||||
.treeSearchInput input {width:140px;vertical-align:middle;line-height:24px;height:26px;border:1px solid #bbb;padding:0 4px;}
|
||||
.treeSearchInput button {border:1px solid #bbb;vertical-align:middle;height:26px;height:26px\9;font-size:13px;background:#efefef;padding:0 8px;}
|
||||
.treeShowHideButton {position:absolute;right:8px;top:-3px;font-size:12px;color:#333;z-index:3;}
|
||||
.treeShowHideButton label {cursor:pointer;}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.Wdate,.Wdate-date,.Wdate-datetime{background:#fff url(datePicker.png) no-repeat right;}
|
||||
.Wdate,.Wdate-date,.Wdate-datetime{background:#fff url(datePicker.gif) no-repeat right;}
|
||||
.Wdate-date{width:105px!important}.Wdate-datetime{width:147px!important}
|
||||
.WdateFmtErr{font-weight:bold;color:red;}
|
||||
.Wdate::-ms-clear{display:none;}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 682 B |
@@ -26,6 +26,12 @@ public class CodeStatistic {
|
||||
System.out.println("Path: " + path);
|
||||
ArrayList<File> al = getFile(new File(path));
|
||||
for (File f : al) {
|
||||
if (!(f.getPath().contains("4.0\\jeesite\\")
|
||||
|| f.getPath().contains("\\devtools\\")
|
||||
|| f.getPath().contains("\\framework\\"))
|
||||
|| f.getPath().contains("\\target\\")){
|
||||
continue;
|
||||
}
|
||||
if (f.getName().matches(".*\\.java$")
|
||||
|| f.getName().matches(".*\\.html$")
|
||||
|| f.getName().matches(".*\\.js$")){
|
||||
|
||||
33
common/src/test/java/com/jeesite/test/ExcelPoiTest.java
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
|
||||
/**
|
||||
* Excel读写测试
|
||||
* @author ThinkGem
|
||||
* @version 2016年8月11日
|
||||
*/
|
||||
public class ExcelPoiTest {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
File file = new File("e:\\2016年调查表1.xls");
|
||||
HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream(file));
|
||||
HSSFSheet sheet = wb.getSheetAt(2);
|
||||
sheet.getRow(5).getCell(3).setCellValue("山东有限公司");
|
||||
sheet.getRow(5).getCell(7).setCellValue("3799991911");
|
||||
sheet.getRow(8).getCell(3).setCellValue("174");
|
||||
sheet.getRow(8).getCell(7).setCellValue("私营股份有限公司");
|
||||
wb.write(new FileOutputStream("e:\\2016年调查表2.xls"));
|
||||
wb.close();
|
||||
System.out.println("success");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="false">
|
||||
|
||||
<!-- Console log output -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} %-5p [%-39logger{39}] - %m%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
||||
<root level="WARN">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
@@ -1,5 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
@@ -1,8 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -1,4 +0,0 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="jeesite-module-core">
|
||||
<wb-resource deploy-path="/" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="jst.utility"/>
|
||||
<fixed facet="java"/>
|
||||
<installed facet="jst.utility" version="1.0"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
</faceted-project>
|
||||
@@ -1,2 +0,0 @@
|
||||
disabled=06target
|
||||
eclipse.preferences.version=1
|
||||
@@ -1,7 +0,0 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
fullBuildGoals=process-test-resources
|
||||
resolveWorkspaceProjects=true
|
||||
resourceFilterGoals=process-resources resources\:testResources
|
||||
skipCompilerPlugin=true
|
||||
version=1
|
||||
@@ -1,919 +0,0 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE js_gen_table_column;
|
||||
DROP TABLE js_gen_table;
|
||||
DROP TABLE js_sys_company_office;
|
||||
DROP TABLE js_sys_employee_post;
|
||||
DROP TABLE js_sys_user_data_scope;
|
||||
DROP TABLE js_sys_user_role;
|
||||
DROP TABLE js_sys_user;
|
||||
DROP TABLE js_sys_employee;
|
||||
DROP TABLE js_sys_company;
|
||||
DROP TABLE js_sys_area;
|
||||
DROP TABLE js_sys_config;
|
||||
DROP TABLE js_sys_dict_data;
|
||||
DROP TABLE js_sys_dict_type;
|
||||
DROP TABLE js_sys_file_upload;
|
||||
DROP TABLE js_sys_file_entity;
|
||||
DROP TABLE js_sys_job_log;
|
||||
DROP TABLE js_sys_job;
|
||||
DROP TABLE js_sys_lang;
|
||||
DROP TABLE js_sys_log;
|
||||
DROP TABLE js_sys_role_menu;
|
||||
DROP TABLE js_sys_menu;
|
||||
DROP TABLE js_sys_module;
|
||||
DROP TABLE js_sys_msg_inner_record;
|
||||
DROP TABLE js_sys_msg_inner;
|
||||
DROP TABLE js_sys_msg_push;
|
||||
DROP TABLE js_sys_msg_pushed;
|
||||
DROP TABLE js_sys_msg_template;
|
||||
DROP TABLE js_sys_office;
|
||||
DROP TABLE js_sys_post;
|
||||
DROP TABLE js_sys_role_data_scope;
|
||||
DROP TABLE js_sys_role;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar(64) NOT NULL,
|
||||
class_name varchar(100) NOT NULL,
|
||||
comments varchar(500) NOT NULL,
|
||||
parent_table_name varchar(64),
|
||||
parent_table_fk_name varchar(64),
|
||||
data_source_name varchar(64),
|
||||
tpl_category varchar(200),
|
||||
package_name varchar(500),
|
||||
module_name varchar(30),
|
||||
sub_module_name varchar(30),
|
||||
function_name varchar(200),
|
||||
function_name_simple varchar(50),
|
||||
function_author varchar(50),
|
||||
gen_base_dir varchar(1000),
|
||||
options varchar(1000),
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (table_name)
|
||||
);
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
table_name varchar(64) NOT NULL,
|
||||
column_name varchar(64) NOT NULL,
|
||||
column_sort decimal(10),
|
||||
column_type varchar(100) NOT NULL,
|
||||
column_label varchar(50),
|
||||
comments varchar(500) NOT NULL,
|
||||
attr_name varchar(200) NOT NULL,
|
||||
attr_type varchar(200) NOT NULL,
|
||||
is_pk char(1),
|
||||
is_null char(1),
|
||||
is_insert char(1),
|
||||
is_update char(1),
|
||||
is_list char(1),
|
||||
is_query char(1),
|
||||
query_type varchar(200),
|
||||
is_edit char(1),
|
||||
show_type varchar(200),
|
||||
options varchar(1000),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE js_sys_area
|
||||
(
|
||||
area_code varchar(100) NOT NULL,
|
||||
parent_code varchar(64) NOT NULL,
|
||||
parent_codes varchar(1000) NOT NULL,
|
||||
tree_sort decimal(10) NOT NULL,
|
||||
tree_sorts varchar(1000) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level decimal(4) NOT NULL,
|
||||
tree_names varchar(1000) NOT NULL,
|
||||
area_name varchar(100) NOT NULL,
|
||||
area_type char(1),
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (area_code)
|
||||
);
|
||||
|
||||
|
||||
-- 公司表
|
||||
CREATE TABLE js_sys_company
|
||||
(
|
||||
company_code varchar(64) NOT NULL,
|
||||
parent_code varchar(64) NOT NULL,
|
||||
parent_codes varchar(1000) NOT NULL,
|
||||
tree_sort decimal(10) NOT NULL,
|
||||
tree_sorts varchar(1000) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level decimal(4) NOT NULL,
|
||||
tree_names varchar(1000) NOT NULL,
|
||||
view_code varchar(100) NOT NULL,
|
||||
company_name varchar(200) NOT NULL,
|
||||
full_name varchar(200) NOT NULL,
|
||||
area_code varchar(100),
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
extend_s1 varchar(500),
|
||||
extend_s2 varchar(500),
|
||||
extend_s3 varchar(500),
|
||||
extend_s4 varchar(500),
|
||||
extend_s5 varchar(500),
|
||||
extend_s6 varchar(500),
|
||||
extend_s7 varchar(500),
|
||||
extend_s8 varchar(500),
|
||||
extend_i1 decimal(19),
|
||||
extend_i2 decimal(19),
|
||||
extend_i3 decimal(19),
|
||||
extend_i4 decimal(19),
|
||||
extend_f1 decimal(19,4),
|
||||
extend_f2 decimal(19,4),
|
||||
extend_f3 decimal(19,4),
|
||||
extend_f4 decimal(19,4),
|
||||
extend_d1 timestamp,
|
||||
extend_d2 timestamp,
|
||||
extend_d3 timestamp,
|
||||
extend_d4 timestamp,
|
||||
PRIMARY KEY (company_code)
|
||||
);
|
||||
|
||||
|
||||
-- 公司部门关联表
|
||||
CREATE TABLE js_sys_company_office
|
||||
(
|
||||
company_code varchar(64) NOT NULL,
|
||||
office_code varchar(64) NOT NULL,
|
||||
PRIMARY KEY (company_code, office_code)
|
||||
);
|
||||
|
||||
|
||||
-- 参数配置表
|
||||
CREATE TABLE js_sys_config
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
config_name varchar(100) NOT NULL,
|
||||
config_key varchar(100) NOT NULL,
|
||||
config_value varchar(1000),
|
||||
is_sys char(1) NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 字典数据表
|
||||
CREATE TABLE js_sys_dict_data
|
||||
(
|
||||
dict_code varchar(64) NOT NULL,
|
||||
parent_code varchar(64) NOT NULL,
|
||||
parent_codes varchar(1000) NOT NULL,
|
||||
tree_sort decimal(10) NOT NULL,
|
||||
tree_sorts varchar(1000) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level decimal(4) NOT NULL,
|
||||
tree_names varchar(1000) NOT NULL,
|
||||
dict_label varchar(100) NOT NULL,
|
||||
dict_value varchar(100) NOT NULL,
|
||||
dict_type varchar(100) NOT NULL,
|
||||
is_sys char(1) NOT NULL,
|
||||
description varchar(500),
|
||||
css_style varchar(500),
|
||||
css_class varchar(500),
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
extend_s1 varchar(500),
|
||||
extend_s2 varchar(500),
|
||||
extend_s3 varchar(500),
|
||||
extend_s4 varchar(500),
|
||||
extend_s5 varchar(500),
|
||||
extend_s6 varchar(500),
|
||||
extend_s7 varchar(500),
|
||||
extend_s8 varchar(500),
|
||||
extend_i1 decimal(19),
|
||||
extend_i2 decimal(19),
|
||||
extend_i3 decimal(19),
|
||||
extend_i4 decimal(19),
|
||||
extend_f1 decimal(19,4),
|
||||
extend_f2 decimal(19,4),
|
||||
extend_f3 decimal(19,4),
|
||||
extend_f4 decimal(19,4),
|
||||
extend_d1 timestamp,
|
||||
extend_d2 timestamp,
|
||||
extend_d3 timestamp,
|
||||
extend_d4 timestamp,
|
||||
PRIMARY KEY (dict_code)
|
||||
);
|
||||
|
||||
|
||||
-- 字典类型表
|
||||
CREATE TABLE js_sys_dict_type
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
dict_name varchar(100) NOT NULL,
|
||||
dict_type varchar(100) NOT NULL,
|
||||
is_sys char(1) NOT NULL,
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 员工表
|
||||
CREATE TABLE js_sys_employee
|
||||
(
|
||||
emp_code varchar(64) NOT NULL,
|
||||
emp_name varchar(100) NOT NULL,
|
||||
emp_name_en varchar(100),
|
||||
office_code varchar(64) NOT NULL,
|
||||
office_name varchar(100) NOT NULL,
|
||||
company_code varchar(64),
|
||||
company_name varchar(200),
|
||||
status char(1) NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY (emp_code)
|
||||
);
|
||||
|
||||
|
||||
-- 员工与岗位关联表
|
||||
CREATE TABLE js_sys_employee_post
|
||||
(
|
||||
emp_code varchar(64) NOT NULL,
|
||||
post_code varchar(64) NOT NULL,
|
||||
PRIMARY KEY (emp_code, post_code)
|
||||
);
|
||||
|
||||
|
||||
-- 文件实体表
|
||||
CREATE TABLE js_sys_file_entity
|
||||
(
|
||||
file_id varchar(64) NOT NULL,
|
||||
file_md5 varchar(64) NOT NULL UNIQUE,
|
||||
file_path varchar(1000) NOT NULL,
|
||||
file_content_type varchar(200) NOT NULL,
|
||||
file_extension varchar(100) NOT NULL,
|
||||
file_size decimal(31) NOT NULL,
|
||||
PRIMARY KEY (file_id)
|
||||
);
|
||||
|
||||
|
||||
-- 文件上传表
|
||||
CREATE TABLE js_sys_file_upload
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
file_id varchar(64) NOT NULL,
|
||||
file_name varchar(500) NOT NULL,
|
||||
file_type varchar(20) NOT NULL,
|
||||
biz_key varchar(64),
|
||||
biz_type varchar(64),
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 作业调度表
|
||||
CREATE TABLE js_sys_job
|
||||
(
|
||||
job_name varchar(64) NOT NULL,
|
||||
job_group varchar(64) NOT NULL,
|
||||
description varchar(100) NOT NULL,
|
||||
invoke_target varchar(1000) NOT NULL,
|
||||
cron_expression varchar(255) NOT NULL,
|
||||
misfire_instruction decimal(1) NOT NULL,
|
||||
concurrent char(1) NOT NULL,
|
||||
status char(1) NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (job_name, job_group)
|
||||
);
|
||||
|
||||
|
||||
-- 作业调度日志表
|
||||
CREATE TABLE js_sys_job_log
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
job_name varchar(64) NOT NULL,
|
||||
job_group varchar(64) NOT NULL,
|
||||
job_type varchar(50),
|
||||
job_event varchar(200),
|
||||
job_message varchar(500),
|
||||
is_exception char(1),
|
||||
exception_info clob,
|
||||
create_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 国际化语言
|
||||
CREATE TABLE js_sys_lang
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
module_code varchar(64) NOT NULL,
|
||||
lang_code varchar(500) NOT NULL,
|
||||
lang_text varchar(500) NOT NULL,
|
||||
lang_type varchar(50) NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 操作日志表
|
||||
CREATE TABLE js_sys_log
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
log_type varchar(50) NOT NULL,
|
||||
log_title varchar(500) NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_by_name varchar(100) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
request_uri varchar(500),
|
||||
request_method varchar(10),
|
||||
request_params clob,
|
||||
diff_modify_data clob,
|
||||
biz_key varchar(64),
|
||||
biz_type varchar(64),
|
||||
remote_addr varchar(255) NOT NULL,
|
||||
server_addr varchar(255) NOT NULL,
|
||||
is_exception char(1),
|
||||
exception_info clob,
|
||||
user_agent varchar(500),
|
||||
device_name varchar(100),
|
||||
browser_name varchar(100),
|
||||
execute_time decimal(19),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 菜单表
|
||||
CREATE TABLE js_sys_menu
|
||||
(
|
||||
menu_code varchar(64) NOT NULL,
|
||||
parent_code varchar(64) NOT NULL,
|
||||
parent_codes varchar(1000) NOT NULL,
|
||||
tree_sort decimal(10) NOT NULL,
|
||||
tree_sorts varchar(1000) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level decimal(4) NOT NULL,
|
||||
tree_names varchar(1000) NOT NULL,
|
||||
menu_name varchar(100) NOT NULL,
|
||||
menu_type char(1) NOT NULL,
|
||||
menu_href varchar(1000),
|
||||
menu_target varchar(20),
|
||||
menu_icon varchar(100),
|
||||
menu_color varchar(50),
|
||||
permission varchar(1000),
|
||||
weight decimal(4),
|
||||
is_show char(1) NOT NULL,
|
||||
sys_code varchar(64) NOT NULL,
|
||||
module_codes varchar(500) NOT NULL,
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
extend_s1 varchar(500),
|
||||
extend_s2 varchar(500),
|
||||
extend_s3 varchar(500),
|
||||
extend_s4 varchar(500),
|
||||
extend_s5 varchar(500),
|
||||
extend_s6 varchar(500),
|
||||
extend_s7 varchar(500),
|
||||
extend_s8 varchar(500),
|
||||
extend_i1 decimal(19),
|
||||
extend_i2 decimal(19),
|
||||
extend_i3 decimal(19),
|
||||
extend_i4 decimal(19),
|
||||
extend_f1 decimal(19,4),
|
||||
extend_f2 decimal(19,4),
|
||||
extend_f3 decimal(19,4),
|
||||
extend_f4 decimal(19,4),
|
||||
extend_d1 timestamp,
|
||||
extend_d2 timestamp,
|
||||
extend_d3 timestamp,
|
||||
extend_d4 timestamp,
|
||||
PRIMARY KEY (menu_code)
|
||||
);
|
||||
|
||||
|
||||
-- 模块表
|
||||
CREATE TABLE js_sys_module
|
||||
(
|
||||
module_code varchar(64) NOT NULL,
|
||||
module_name varchar(100) NOT NULL,
|
||||
description varchar(500),
|
||||
main_class_name varchar(500),
|
||||
current_version varchar(50),
|
||||
upgrade_info varchar(300),
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (module_code)
|
||||
);
|
||||
|
||||
|
||||
-- 内部消息
|
||||
CREATE TABLE js_sys_msg_inner
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
msg_title varchar(200) NOT NULL,
|
||||
content_level char(1) NOT NULL,
|
||||
content_type char(1),
|
||||
msg_content clob NOT NULL,
|
||||
receive_type char(1) NOT NULL,
|
||||
receive_codes clob NOT NULL,
|
||||
receive_names clob NOT NULL,
|
||||
send_user_code varchar(64) NOT NULL,
|
||||
send_user_name varchar(100) NOT NULL,
|
||||
send_date timestamp NOT NULL,
|
||||
is_attac char(1),
|
||||
notify_types varchar(100) NOT NULL,
|
||||
status char(1) NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 内部消息发送记录表
|
||||
CREATE TABLE js_sys_msg_inner_record
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
msg_inner_id varchar(64) NOT NULL,
|
||||
receive_user_code varchar(64),
|
||||
receive_user_name varchar(100) NOT NULL,
|
||||
read_status char(1) NOT NULL,
|
||||
read_date timestamp,
|
||||
is_star char(1),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 消息推送表
|
||||
CREATE TABLE js_sys_msg_push
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
msg_type varchar(16) NOT NULL,
|
||||
msg_title varchar(200) NOT NULL,
|
||||
msg_content clob NOT NULL,
|
||||
biz_key varchar(64),
|
||||
biz_type varchar(64),
|
||||
receive_code varchar(64) NOT NULL,
|
||||
receive_user_code varchar(64) NOT NULL,
|
||||
receive_user_name varchar(100) NOT NULL,
|
||||
send_user_code varchar(64) NOT NULL,
|
||||
send_user_name varchar(100) NOT NULL,
|
||||
send_date timestamp NOT NULL,
|
||||
is_merge_push char(1),
|
||||
plan_push_date timestamp,
|
||||
push_number int,
|
||||
push_return_code varchar(200),
|
||||
push_return_msg_id varchar(200),
|
||||
push_return_content clob,
|
||||
push_status char(1),
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 消息已推送表
|
||||
CREATE TABLE js_sys_msg_pushed
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
msg_type varchar(16) NOT NULL,
|
||||
msg_title varchar(200) NOT NULL,
|
||||
msg_content clob NOT NULL,
|
||||
biz_key varchar(64),
|
||||
biz_type varchar(64),
|
||||
receive_code varchar(64) NOT NULL,
|
||||
receive_user_code varchar(64) NOT NULL,
|
||||
receive_user_name varchar(100) NOT NULL,
|
||||
send_user_code varchar(64) NOT NULL,
|
||||
send_user_name varchar(100) NOT NULL,
|
||||
send_date timestamp NOT NULL,
|
||||
is_merge_push char(1),
|
||||
plan_push_date timestamp,
|
||||
push_number int,
|
||||
push_return_content clob,
|
||||
push_return_code varchar(200),
|
||||
push_return_msg_id varchar(200),
|
||||
push_status char(1),
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 消息模板
|
||||
CREATE TABLE js_sys_msg_template
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
module_code varchar(64),
|
||||
tpl_key varchar(100) NOT NULL,
|
||||
tpl_name varchar(100) NOT NULL,
|
||||
tpl_type varchar(16) NOT NULL,
|
||||
tpl_content clob NOT NULL,
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 组织机构表
|
||||
CREATE TABLE js_sys_office
|
||||
(
|
||||
office_code varchar(64) NOT NULL,
|
||||
parent_code varchar(64) NOT NULL,
|
||||
parent_codes varchar(1000) NOT NULL,
|
||||
tree_sort decimal(10) NOT NULL,
|
||||
tree_sorts varchar(1000) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level decimal(4) NOT NULL,
|
||||
tree_names varchar(1000) NOT NULL,
|
||||
view_code varchar(100) NOT NULL,
|
||||
office_name varchar(100) NOT NULL,
|
||||
full_name varchar(200) NOT NULL,
|
||||
office_type char(1) NOT NULL,
|
||||
leader varchar(100),
|
||||
phone varchar(100),
|
||||
address varchar(255),
|
||||
zip_code varchar(100),
|
||||
email varchar(300),
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
extend_s1 varchar(500),
|
||||
extend_s2 varchar(500),
|
||||
extend_s3 varchar(500),
|
||||
extend_s4 varchar(500),
|
||||
extend_s5 varchar(500),
|
||||
extend_s6 varchar(500),
|
||||
extend_s7 varchar(500),
|
||||
extend_s8 varchar(500),
|
||||
extend_i1 decimal(19),
|
||||
extend_i2 decimal(19),
|
||||
extend_i3 decimal(19),
|
||||
extend_i4 decimal(19),
|
||||
extend_f1 decimal(19,4),
|
||||
extend_f2 decimal(19,4),
|
||||
extend_f3 decimal(19,4),
|
||||
extend_f4 decimal(19,4),
|
||||
extend_d1 timestamp,
|
||||
extend_d2 timestamp,
|
||||
extend_d3 timestamp,
|
||||
extend_d4 timestamp,
|
||||
PRIMARY KEY (office_code)
|
||||
);
|
||||
|
||||
|
||||
-- 员工岗位表
|
||||
CREATE TABLE js_sys_post
|
||||
(
|
||||
post_code varchar(64) NOT NULL,
|
||||
post_name varchar(100) NOT NULL,
|
||||
post_type varchar(100),
|
||||
post_sort decimal(10),
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY (post_code)
|
||||
);
|
||||
|
||||
|
||||
-- 角色表
|
||||
CREATE TABLE js_sys_role
|
||||
(
|
||||
role_code varchar(64) NOT NULL,
|
||||
role_name varchar(100) NOT NULL,
|
||||
role_type varchar(100),
|
||||
role_sort decimal(10),
|
||||
is_sys char(1),
|
||||
user_type varchar(16),
|
||||
data_scope char(1),
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY (role_code)
|
||||
);
|
||||
|
||||
|
||||
-- 角色数据权限表
|
||||
CREATE TABLE js_sys_role_data_scope
|
||||
(
|
||||
role_code varchar(64) NOT NULL,
|
||||
ctrl_type varchar(20) NOT NULL,
|
||||
ctrl_data varchar(64) NOT NULL,
|
||||
ctrl_permi varchar(64) NOT NULL,
|
||||
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi)
|
||||
);
|
||||
|
||||
|
||||
-- 角色与菜单关联表
|
||||
CREATE TABLE js_sys_role_menu
|
||||
(
|
||||
role_code varchar(64) NOT NULL,
|
||||
menu_code varchar(64) NOT NULL,
|
||||
PRIMARY KEY (role_code, menu_code)
|
||||
);
|
||||
|
||||
|
||||
-- 用户表
|
||||
CREATE TABLE js_sys_user
|
||||
(
|
||||
user_code varchar(100) NOT NULL,
|
||||
login_code varchar(100) NOT NULL,
|
||||
user_name varchar(100) NOT NULL,
|
||||
password varchar(100) NOT NULL,
|
||||
email varchar(300),
|
||||
mobile varchar(100),
|
||||
phone varchar(100),
|
||||
sex char(1),
|
||||
avatar varchar(1000),
|
||||
sign varchar(200),
|
||||
wx_openid varchar(100),
|
||||
mobile_imei varchar(100),
|
||||
user_type varchar(16) NOT NULL,
|
||||
ref_code varchar(64),
|
||||
ref_name varchar(100),
|
||||
mgr_type char(1) NOT NULL,
|
||||
pwd_security_level decimal(1),
|
||||
pwd_update_date timestamp,
|
||||
pwd_update_record varchar(1000),
|
||||
pwd_question varchar(200),
|
||||
pwd_question_answer varchar(200),
|
||||
pwd_question_2 varchar(200),
|
||||
pwd_question_answer_2 varchar(200),
|
||||
pwd_question_3 varchar(200),
|
||||
pwd_question_answer_3 varchar(200),
|
||||
pwd_quest_update_date timestamp,
|
||||
last_login_ip varchar(100),
|
||||
last_login_date timestamp,
|
||||
freeze_date timestamp,
|
||||
freeze_cause varchar(200),
|
||||
user_weight decimal(8) DEFAULT 0,
|
||||
status char NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
extend_s1 varchar(500),
|
||||
extend_s2 varchar(500),
|
||||
extend_s3 varchar(500),
|
||||
extend_s4 varchar(500),
|
||||
extend_s5 varchar(500),
|
||||
extend_s6 varchar(500),
|
||||
extend_s7 varchar(500),
|
||||
extend_s8 varchar(500),
|
||||
extend_i1 decimal(19),
|
||||
extend_i2 decimal(19),
|
||||
extend_i3 decimal(19),
|
||||
extend_i4 decimal(19),
|
||||
extend_f1 decimal(19,4),
|
||||
extend_f2 decimal(19,4),
|
||||
extend_f3 decimal(19,4),
|
||||
extend_f4 decimal(19,4),
|
||||
extend_d1 timestamp,
|
||||
extend_d2 timestamp,
|
||||
extend_d3 timestamp,
|
||||
extend_d4 timestamp,
|
||||
PRIMARY KEY (user_code)
|
||||
);
|
||||
|
||||
|
||||
-- 用户数据权限表
|
||||
CREATE TABLE js_sys_user_data_scope
|
||||
(
|
||||
user_code varchar(100) NOT NULL,
|
||||
ctrl_type varchar(20) NOT NULL,
|
||||
ctrl_data varchar(64) NOT NULL,
|
||||
ctrl_permi varchar(64) NOT NULL,
|
||||
PRIMARY KEY (user_code, ctrl_type, ctrl_data, ctrl_permi)
|
||||
);
|
||||
|
||||
|
||||
-- 用户与角色关联表
|
||||
CREATE TABLE js_sys_user_role
|
||||
(
|
||||
user_code varchar(100) NOT NULL,
|
||||
role_code varchar(64) NOT NULL,
|
||||
PRIMARY KEY (user_code, role_code)
|
||||
);
|
||||
|
||||
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table (parent_table_name);
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column (table_name);
|
||||
CREATE INDEX idx_sys_area_pc ON js_sys_area (parent_code);
|
||||
CREATE INDEX idx_sys_area_ts ON js_sys_area (tree_sort);
|
||||
CREATE INDEX idx_sys_area_status ON js_sys_area (status);
|
||||
CREATE INDEX idx_sys_area_pcs ON js_sys_area (parent_codes);
|
||||
CREATE INDEX idx_sys_area_tss ON js_sys_area (tree_sorts);
|
||||
CREATE INDEX idx_sys_company_cc ON js_sys_company (corp_code);
|
||||
CREATE INDEX idx_sys_company_pc ON js_sys_company (parent_code);
|
||||
CREATE INDEX idx_sys_company_ts ON js_sys_company (tree_sort);
|
||||
CREATE INDEX idx_sys_company_status ON js_sys_company (status);
|
||||
CREATE INDEX idx_sys_company_vc ON js_sys_company (view_code);
|
||||
CREATE INDEX idx_sys_company_pcs ON js_sys_company (parent_codes);
|
||||
CREATE INDEX idx_sys_company_tss ON js_sys_company (tree_sorts);
|
||||
CREATE UNIQUE INDEX idx_sys_config_key ON js_sys_config (config_key);
|
||||
CREATE INDEX idx_sys_dict_data_cc ON js_sys_dict_data (corp_code);
|
||||
CREATE INDEX idx_sys_dict_data_dt ON js_sys_dict_data (dict_type);
|
||||
CREATE INDEX idx_sys_dict_data_pc ON js_sys_dict_data (parent_code);
|
||||
CREATE INDEX idx_sys_dict_data_status ON js_sys_dict_data (status);
|
||||
CREATE INDEX idx_sys_dict_data_pcs ON js_sys_dict_data (parent_codes);
|
||||
CREATE INDEX idx_sys_dict_data_ts ON js_sys_dict_data (tree_sort);
|
||||
CREATE INDEX idx_sys_dict_data_tss ON js_sys_dict_data (tree_sorts);
|
||||
CREATE INDEX idx_sys_dict_data_dv ON js_sys_dict_data (dict_value);
|
||||
CREATE INDEX idx_sys_dict_type_is ON js_sys_dict_type (is_sys);
|
||||
CREATE INDEX idx_sys_dict_type_status ON js_sys_dict_type (status);
|
||||
CREATE INDEX idx_sys_employee_cco ON js_sys_employee (company_code);
|
||||
CREATE INDEX idx_sys_employee_cc ON js_sys_employee (corp_code);
|
||||
CREATE INDEX idx_sys_employee_ud ON js_sys_employee (update_date);
|
||||
CREATE INDEX idx_sys_employee_oc ON js_sys_employee (office_code);
|
||||
CREATE INDEX idx_sys_employee_status ON js_sys_employee (status);
|
||||
CREATE INDEX idx_sys_file_entity_md5 ON js_sys_file_entity (file_md5);
|
||||
CREATE INDEX idx_sys_file_entity_size ON js_sys_file_entity (file_size);
|
||||
CREATE INDEX idx_sys_file_biz_ft ON js_sys_file_upload (file_type);
|
||||
CREATE INDEX idx_sys_file_biz_fi ON js_sys_file_upload (file_id);
|
||||
CREATE INDEX idx_sys_file_biz_status ON js_sys_file_upload (status);
|
||||
CREATE INDEX idx_sys_file_biz_cb ON js_sys_file_upload (create_by);
|
||||
CREATE INDEX idx_sys_file_biz_ud ON js_sys_file_upload (update_date);
|
||||
CREATE INDEX idx_sys_file_biz_bt ON js_sys_file_upload (biz_type);
|
||||
CREATE INDEX idx_sys_file_biz_bk ON js_sys_file_upload (biz_key);
|
||||
CREATE INDEX idx_sys_job_status ON js_sys_job (status);
|
||||
CREATE INDEX idx_sys_job_log_jn ON js_sys_job_log (job_name);
|
||||
CREATE INDEX idx_sys_job_log_jg ON js_sys_job_log (job_group);
|
||||
CREATE INDEX idx_sys_job_log_t ON js_sys_job_log (job_type);
|
||||
CREATE INDEX idx_sys_job_log_e ON js_sys_job_log (job_event);
|
||||
CREATE INDEX idx_sys_job_log_ie ON js_sys_job_log (is_exception);
|
||||
CREATE INDEX idx_sys_lang_code ON js_sys_lang (lang_code);
|
||||
CREATE INDEX idx_sys_lang_type ON js_sys_lang (lang_type);
|
||||
CREATE INDEX idx_sys_log_cb ON js_sys_log (create_by);
|
||||
CREATE INDEX idx_sys_log_cc ON js_sys_log (corp_code);
|
||||
CREATE INDEX idx_sys_log_lt ON js_sys_log (log_type);
|
||||
CREATE INDEX idx_sys_log_bk ON js_sys_log (biz_key);
|
||||
CREATE INDEX idx_sys_log_bt ON js_sys_log (biz_type);
|
||||
CREATE INDEX idx_sys_log_ie ON js_sys_log (is_exception);
|
||||
CREATE INDEX idx_sys_log_cd ON js_sys_log (create_date);
|
||||
CREATE INDEX idx_sys_menu_pc ON js_sys_menu (parent_code);
|
||||
CREATE INDEX idx_sys_menu_ts ON js_sys_menu (tree_sort);
|
||||
CREATE INDEX idx_sys_menu_status ON js_sys_menu (status);
|
||||
CREATE INDEX idx_sys_menu_mt ON js_sys_menu (menu_type);
|
||||
CREATE INDEX idx_sys_menu_pss ON js_sys_menu (parent_codes);
|
||||
CREATE INDEX idx_sys_menu_tss ON js_sys_menu (tree_sorts);
|
||||
CREATE INDEX idx_sys_menu_sc ON js_sys_menu (sys_code);
|
||||
CREATE INDEX idx_sys_menu_is ON js_sys_menu (is_show);
|
||||
CREATE INDEX idx_sys_menu_mcs ON js_sys_menu (module_codes);
|
||||
CREATE INDEX idx_sys_menu_wt ON js_sys_menu (weight);
|
||||
CREATE INDEX idx_sys_module_status ON js_sys_module (status);
|
||||
CREATE INDEX idx_sys_msg_inner_cb ON js_sys_msg_inner (create_by);
|
||||
CREATE INDEX idx_sys_msg_inner_status ON js_sys_msg_inner (status);
|
||||
CREATE INDEX idx_sys_msg_inner_cl ON js_sys_msg_inner (content_level);
|
||||
CREATE INDEX idx_sys_msg_inner_sc ON js_sys_msg_inner (send_user_code);
|
||||
CREATE INDEX idx_sys_msg_inner_sd ON js_sys_msg_inner (send_date);
|
||||
CREATE INDEX idx_sys_msg_inner_r_mi ON js_sys_msg_inner_record (msg_inner_id);
|
||||
CREATE INDEX idx_sys_msg_inner_r_rc ON js_sys_msg_inner_record (receive_user_code);
|
||||
CREATE INDEX idx_sys_msg_inner_r_ruc ON js_sys_msg_inner_record (receive_user_code);
|
||||
CREATE INDEX idx_sys_msg_inner_r_status ON js_sys_msg_inner_record (read_status);
|
||||
CREATE INDEX idx_sys_msg_inner_r_star ON js_sys_msg_inner_record (is_star);
|
||||
CREATE INDEX idx_sys_msg_push_type ON js_sys_msg_push (msg_type);
|
||||
CREATE INDEX idx_sys_msg_push_rc ON js_sys_msg_push (receive_code);
|
||||
CREATE INDEX idx_sys_msg_push_uc ON js_sys_msg_push (receive_user_code);
|
||||
CREATE INDEX idx_sys_msg_push_suc ON js_sys_msg_push (send_user_code);
|
||||
CREATE INDEX idx_sys_msg_push_pd ON js_sys_msg_push (plan_push_date);
|
||||
CREATE INDEX idx_sys_msg_push_ps ON js_sys_msg_push (push_status);
|
||||
CREATE INDEX idx_sys_msg_push_rs ON js_sys_msg_push (read_status);
|
||||
CREATE INDEX idx_sys_msg_push_bk ON js_sys_msg_push (biz_key);
|
||||
CREATE INDEX idx_sys_msg_push_bt ON js_sys_msg_push (biz_type);
|
||||
CREATE INDEX idx_sys_msg_push_imp ON js_sys_msg_push (is_merge_push);
|
||||
CREATE INDEX idx_sys_msg_pushed_type ON js_sys_msg_pushed (msg_type);
|
||||
CREATE INDEX idx_sys_msg_pushed_rc ON js_sys_msg_pushed (receive_code);
|
||||
CREATE INDEX idx_sys_msg_pushed_uc ON js_sys_msg_pushed (receive_user_code);
|
||||
CREATE INDEX idx_sys_msg_pushed_suc ON js_sys_msg_pushed (send_user_code);
|
||||
CREATE INDEX idx_sys_msg_pushed_pd ON js_sys_msg_pushed (plan_push_date);
|
||||
CREATE INDEX idx_sys_msg_pushed_ps ON js_sys_msg_pushed (push_status);
|
||||
CREATE INDEX idx_sys_msg_pushed_rs ON js_sys_msg_pushed (read_status);
|
||||
CREATE INDEX idx_sys_msg_pushed_bk ON js_sys_msg_pushed (biz_key);
|
||||
CREATE INDEX idx_sys_msg_pushed_bt ON js_sys_msg_pushed (biz_type);
|
||||
CREATE INDEX idx_sys_msg_pushed_imp ON js_sys_msg_pushed (is_merge_push);
|
||||
CREATE INDEX idx_sys_msg_tpl_key ON js_sys_msg_template (tpl_key);
|
||||
CREATE INDEX idx_sys_msg_tpl_type ON js_sys_msg_template (tpl_type);
|
||||
CREATE INDEX idx_sys_msg_tpl_status ON js_sys_msg_template (status);
|
||||
CREATE INDEX idx_sys_office_cc ON js_sys_office (corp_code);
|
||||
CREATE INDEX idx_sys_office_pc ON js_sys_office (parent_code);
|
||||
CREATE INDEX idx_sys_office_pcs ON js_sys_office (parent_codes);
|
||||
CREATE INDEX idx_sys_office_status ON js_sys_office (status);
|
||||
CREATE INDEX idx_sys_office_ot ON js_sys_office (office_type);
|
||||
CREATE INDEX idx_sys_office_vc ON js_sys_office (view_code);
|
||||
CREATE INDEX idx_sys_office_ts ON js_sys_office (tree_sort);
|
||||
CREATE INDEX idx_sys_office_tss ON js_sys_office (tree_sorts);
|
||||
CREATE INDEX idx_sys_post_cc ON js_sys_post (corp_code);
|
||||
CREATE INDEX idx_sys_post_status ON js_sys_post (status);
|
||||
CREATE INDEX idx_sys_post_ps ON js_sys_post (post_sort);
|
||||
CREATE INDEX idx_sys_role_cc ON js_sys_role (corp_code);
|
||||
CREATE INDEX idx_sys_role_is ON js_sys_role (is_sys);
|
||||
CREATE INDEX idx_sys_role_status ON js_sys_role (status);
|
||||
CREATE INDEX idx_sys_role_rs ON js_sys_role (role_sort);
|
||||
CREATE INDEX idx_sys_user_lc ON js_sys_user (login_code);
|
||||
CREATE INDEX idx_sys_user_email ON js_sys_user (email);
|
||||
CREATE INDEX idx_sys_user_mobile ON js_sys_user (mobile);
|
||||
CREATE INDEX idx_sys_user_wo ON js_sys_user (wx_openid);
|
||||
CREATE INDEX idx_sys_user_imei ON js_sys_user (mobile_imei);
|
||||
CREATE INDEX idx_sys_user_rt ON js_sys_user (user_type);
|
||||
CREATE INDEX idx_sys_user_rc ON js_sys_user (ref_code);
|
||||
CREATE INDEX idx_sys_user_mt ON js_sys_user (mgr_type);
|
||||
CREATE INDEX idx_sys_user_us ON js_sys_user (user_weight);
|
||||
CREATE INDEX idx_sys_user_ud ON js_sys_user (update_date);
|
||||
CREATE INDEX idx_sys_user_status ON js_sys_user (status);
|
||||
CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code);
|
||||
|
||||
|
||||
|
||||
@@ -1,40 +1,4 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
IF OBJECT_ID('[js_gen_table_column]') IS NOT NULL DROP TABLE [js_gen_table_column];
|
||||
IF OBJECT_ID('[js_gen_table]') IS NOT NULL DROP TABLE [js_gen_table];
|
||||
IF OBJECT_ID('[js_sys_company_office]') IS NOT NULL DROP TABLE [js_sys_company_office];
|
||||
IF OBJECT_ID('[js_sys_employee_post]') IS NOT NULL DROP TABLE [js_sys_employee_post];
|
||||
IF OBJECT_ID('[js_sys_user_data_scope]') IS NOT NULL DROP TABLE [js_sys_user_data_scope];
|
||||
IF OBJECT_ID('[js_sys_user_role]') IS NOT NULL DROP TABLE [js_sys_user_role];
|
||||
IF OBJECT_ID('[js_sys_user]') IS NOT NULL DROP TABLE [js_sys_user];
|
||||
IF OBJECT_ID('[js_sys_employee]') IS NOT NULL DROP TABLE [js_sys_employee];
|
||||
IF OBJECT_ID('[js_sys_company]') IS NOT NULL DROP TABLE [js_sys_company];
|
||||
IF OBJECT_ID('[js_sys_area]') IS NOT NULL DROP TABLE [js_sys_area];
|
||||
IF OBJECT_ID('[js_sys_config]') IS NOT NULL DROP TABLE [js_sys_config];
|
||||
IF OBJECT_ID('[js_sys_dict_data]') IS NOT NULL DROP TABLE [js_sys_dict_data];
|
||||
IF OBJECT_ID('[js_sys_dict_type]') IS NOT NULL DROP TABLE [js_sys_dict_type];
|
||||
IF OBJECT_ID('[js_sys_file_upload]') IS NOT NULL DROP TABLE [js_sys_file_upload];
|
||||
IF OBJECT_ID('[js_sys_file_entity]') IS NOT NULL DROP TABLE [js_sys_file_entity];
|
||||
IF OBJECT_ID('[js_sys_job_log]') IS NOT NULL DROP TABLE [js_sys_job_log];
|
||||
IF OBJECT_ID('[js_sys_job]') IS NOT NULL DROP TABLE [js_sys_job];
|
||||
IF OBJECT_ID('[js_sys_lang]') IS NOT NULL DROP TABLE [js_sys_lang];
|
||||
IF OBJECT_ID('[js_sys_log]') IS NOT NULL DROP TABLE [js_sys_log];
|
||||
IF OBJECT_ID('[js_sys_role_menu]') IS NOT NULL DROP TABLE [js_sys_role_menu];
|
||||
IF OBJECT_ID('[js_sys_menu]') IS NOT NULL DROP TABLE [js_sys_menu];
|
||||
IF OBJECT_ID('[js_sys_module]') IS NOT NULL DROP TABLE [js_sys_module];
|
||||
IF OBJECT_ID('[js_sys_msg_inner_record]') IS NOT NULL DROP TABLE [js_sys_msg_inner_record];
|
||||
IF OBJECT_ID('[js_sys_msg_inner]') IS NOT NULL DROP TABLE [js_sys_msg_inner];
|
||||
IF OBJECT_ID('[js_sys_msg_push]') IS NOT NULL DROP TABLE [js_sys_msg_push];
|
||||
IF OBJECT_ID('[js_sys_msg_pushed]') IS NOT NULL DROP TABLE [js_sys_msg_pushed];
|
||||
IF OBJECT_ID('[js_sys_msg_template]') IS NOT NULL DROP TABLE [js_sys_msg_template];
|
||||
IF OBJECT_ID('[js_sys_office]') IS NOT NULL DROP TABLE [js_sys_office];
|
||||
IF OBJECT_ID('[js_sys_post]') IS NOT NULL DROP TABLE [js_sys_post];
|
||||
IF OBJECT_ID('[js_sys_role_data_scope]') IS NOT NULL DROP TABLE [js_sys_role_data_scope];
|
||||
IF OBJECT_ID('[js_sys_role]') IS NOT NULL DROP TABLE [js_sys_role];
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
@@ -46,7 +10,6 @@ CREATE TABLE [js_gen_table]
|
||||
[comments] nvarchar(500) NOT NULL,
|
||||
[parent_table_name] varchar(64),
|
||||
[parent_table_fk_name] varchar(64),
|
||||
[data_source_name] varchar(64),
|
||||
[tpl_category] varchar(200),
|
||||
[package_name] varchar(500),
|
||||
[module_name] varchar(30),
|
||||
@@ -803,7 +766,7 @@ CREATE INDEX [idx_sys_company_status] ON [js_sys_company] ([status]);
|
||||
CREATE INDEX [idx_sys_company_vc] ON [js_sys_company] ([view_code]);
|
||||
CREATE INDEX [idx_sys_company_pcs] ON [js_sys_company] ([parent_codes]);
|
||||
CREATE INDEX [idx_sys_company_tss] ON [js_sys_company] ([tree_sorts]);
|
||||
CREATE UNIQUE INDEX [idx_sys_config_key] ON [js_sys_config] ([config_key]);
|
||||
CREATE INDEX [idx_sys_config_key] ON [js_sys_config] ([config_key]);
|
||||
CREATE INDEX [idx_sys_dict_data_cc] ON [js_sys_dict_data] ([corp_code]);
|
||||
CREATE INDEX [idx_sys_dict_data_dt] ON [js_sys_dict_data] ([dict_type]);
|
||||
CREATE INDEX [idx_sys_dict_data_pc] ON [js_sys_dict_data] ([parent_code]);
|
||||
|
||||
@@ -1,41 +1,5 @@
|
||||
SET SESSION FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE IF EXISTS js_gen_table_column;
|
||||
DROP TABLE IF EXISTS js_gen_table;
|
||||
DROP TABLE IF EXISTS js_sys_company_office;
|
||||
DROP TABLE IF EXISTS js_sys_employee_post;
|
||||
DROP TABLE IF EXISTS js_sys_user_data_scope;
|
||||
DROP TABLE IF EXISTS js_sys_user_role;
|
||||
DROP TABLE IF EXISTS js_sys_user;
|
||||
DROP TABLE IF EXISTS js_sys_employee;
|
||||
DROP TABLE IF EXISTS js_sys_company;
|
||||
DROP TABLE IF EXISTS js_sys_area;
|
||||
DROP TABLE IF EXISTS js_sys_config;
|
||||
DROP TABLE IF EXISTS js_sys_dict_data;
|
||||
DROP TABLE IF EXISTS js_sys_dict_type;
|
||||
DROP TABLE IF EXISTS js_sys_file_upload;
|
||||
DROP TABLE IF EXISTS js_sys_file_entity;
|
||||
DROP TABLE IF EXISTS js_sys_job_log;
|
||||
DROP TABLE IF EXISTS js_sys_job;
|
||||
DROP TABLE IF EXISTS js_sys_lang;
|
||||
DROP TABLE IF EXISTS js_sys_log;
|
||||
DROP TABLE IF EXISTS js_sys_role_menu;
|
||||
DROP TABLE IF EXISTS js_sys_menu;
|
||||
DROP TABLE IF EXISTS js_sys_module;
|
||||
DROP TABLE IF EXISTS js_sys_msg_inner_record;
|
||||
DROP TABLE IF EXISTS js_sys_msg_inner;
|
||||
DROP TABLE IF EXISTS js_sys_msg_push;
|
||||
DROP TABLE IF EXISTS js_sys_msg_pushed;
|
||||
DROP TABLE IF EXISTS js_sys_msg_template;
|
||||
DROP TABLE IF EXISTS js_sys_office;
|
||||
DROP TABLE IF EXISTS js_sys_post;
|
||||
DROP TABLE IF EXISTS js_sys_role_data_scope;
|
||||
DROP TABLE IF EXISTS js_sys_role;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
@@ -47,7 +11,6 @@ CREATE TABLE js_gen_table
|
||||
comments varchar(500) NOT NULL COMMENT '表说明',
|
||||
parent_table_name varchar(64) COMMENT '关联父表的表名',
|
||||
parent_table_fk_name varchar(64) COMMENT '本表关联父表的外键名',
|
||||
data_source_name varchar(64) COMMENT '数据源名称',
|
||||
tpl_category varchar(200) COMMENT '使用的模板',
|
||||
package_name varchar(500) COMMENT '生成包路径',
|
||||
module_name varchar(30) COMMENT '生成模块名',
|
||||
@@ -505,7 +468,7 @@ CREATE TABLE js_sys_msg_inner_record
|
||||
msg_inner_id varchar(64) NOT NULL COMMENT '所属消息',
|
||||
receive_user_code varchar(64) COMMENT '接受者用户编码',
|
||||
receive_user_name varchar(100) NOT NULL COMMENT '接受者用户姓名',
|
||||
read_status char(1) NOT NULL COMMENT '读取状态(0未送达 1已读 2未读)',
|
||||
read_status char(1) NOT NULL COMMENT '读取状态(0未送达 1未读 2已读)',
|
||||
read_date datetime COMMENT '阅读时间',
|
||||
is_star char(1) COMMENT '是否标星',
|
||||
PRIMARY KEY (id)
|
||||
@@ -535,7 +498,7 @@ CREATE TABLE js_sys_msg_push
|
||||
push_return_content text COMMENT '推送返回的内容信息',
|
||||
push_status char(1) COMMENT '推送状态(0未推送 1成功 2失败)',
|
||||
push_date datetime COMMENT '推送时间',
|
||||
read_status char(1) COMMENT '读取状态(0未送达 1已读 2未读)',
|
||||
read_status char(1) COMMENT '读取状态(0未送达 1未读 2已读)',
|
||||
read_date datetime COMMENT '读取时间',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '消息推送表';
|
||||
@@ -564,7 +527,7 @@ CREATE TABLE js_sys_msg_pushed
|
||||
push_return_msg_id varchar(200) COMMENT '推送返回消息编号',
|
||||
push_status char(1) COMMENT '推送状态(0未推送 1成功 2失败)',
|
||||
push_date datetime COMMENT '推送时间',
|
||||
read_status char(1) COMMENT '读取状态(0未送达 1已读 2未读)',
|
||||
read_status char(1) COMMENT '读取状态(0未送达 1未读 2已读)',
|
||||
read_date datetime COMMENT '读取时间',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '消息已推送表';
|
||||
@@ -805,7 +768,7 @@ CREATE INDEX idx_sys_company_status ON js_sys_company (status ASC);
|
||||
CREATE INDEX idx_sys_company_vc ON js_sys_company (view_code ASC);
|
||||
CREATE INDEX idx_sys_company_pcs ON js_sys_company (parent_codes ASC);
|
||||
CREATE INDEX idx_sys_company_tss ON js_sys_company (tree_sorts ASC);
|
||||
CREATE UNIQUE INDEX idx_sys_config_key ON js_sys_config (config_key ASC);
|
||||
CREATE INDEX idx_sys_config_key ON js_sys_config (config_key ASC);
|
||||
CREATE INDEX idx_sys_dict_data_cc ON js_sys_dict_data (corp_code ASC);
|
||||
CREATE INDEX idx_sys_dict_data_dt ON js_sys_dict_data (dict_type ASC);
|
||||
CREATE INDEX idx_sys_dict_data_pc ON js_sys_dict_data (parent_code ASC);
|
||||
|
||||
@@ -1,40 +1,4 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE js_gen_table_column CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_gen_table CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_company_office CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_employee_post CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_user_data_scope CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_user_role CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_user CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_employee CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_company CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_area CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_config CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_dict_data CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_dict_type CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_file_upload CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_file_entity CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_job_log CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_job CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_lang CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_log CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_role_menu CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_menu CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_module CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_msg_inner_record CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_msg_inner CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_msg_push CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_msg_pushed CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_msg_template CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_office CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_post CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_role_data_scope CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_role CASCADE CONSTRAINTS;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
@@ -46,7 +10,6 @@ CREATE TABLE js_gen_table
|
||||
comments nvarchar2(500) NOT NULL,
|
||||
parent_table_name varchar2(64),
|
||||
parent_table_fk_name varchar2(64),
|
||||
data_source_name varchar2(64),
|
||||
tpl_category varchar2(200),
|
||||
package_name varchar2(500),
|
||||
module_name varchar2(30),
|
||||
@@ -803,7 +766,7 @@ CREATE INDEX idx_sys_company_status ON js_sys_company (status);
|
||||
CREATE INDEX idx_sys_company_vc ON js_sys_company (view_code);
|
||||
CREATE INDEX idx_sys_company_pcs ON js_sys_company (parent_codes);
|
||||
CREATE INDEX idx_sys_company_tss ON js_sys_company (tree_sorts);
|
||||
CREATE UNIQUE INDEX idx_sys_config_key ON js_sys_config (config_key);
|
||||
CREATE INDEX idx_sys_config_key ON js_sys_config (config_key);
|
||||
CREATE INDEX idx_sys_dict_data_cc ON js_sys_dict_data (corp_code);
|
||||
CREATE INDEX idx_sys_dict_data_dt ON js_sys_dict_data (dict_type);
|
||||
CREATE INDEX idx_sys_dict_data_pc ON js_sys_dict_data (parent_code);
|
||||
@@ -925,7 +888,6 @@ COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
|
||||
COMMENT ON COLUMN js_gen_table.comments IS '表说明';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_name IS '关联父表的表名';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_fk_name IS '本表关联父表的外键名';
|
||||
COMMENT ON COLUMN js_gen_table.data_source_name IS '数据源名称';
|
||||
COMMENT ON COLUMN js_gen_table.tpl_category IS '使用的模板';
|
||||
COMMENT ON COLUMN js_gen_table.package_name IS '生成包路径';
|
||||
COMMENT ON COLUMN js_gen_table.module_name IS '生成模块名';
|
||||
@@ -1268,7 +1230,7 @@ COMMENT ON COLUMN js_sys_msg_inner_record.id IS '编号';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.msg_inner_id IS '所属消息';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.receive_user_code IS '接受者用户编码';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.receive_user_name IS '接受者用户姓名';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.read_status IS '读取状态(0未送达 1已读 2未读)';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.read_status IS '读取状态(0未送达 1未读 2已读)';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.read_date IS '阅读时间';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.is_star IS '是否标星';
|
||||
COMMENT ON TABLE js_sys_msg_push IS '消息推送表';
|
||||
@@ -1292,7 +1254,7 @@ COMMENT ON COLUMN js_sys_msg_push.push_return_msg_id IS '推送返回消息编
|
||||
COMMENT ON COLUMN js_sys_msg_push.push_return_content IS '推送返回的内容信息';
|
||||
COMMENT ON COLUMN js_sys_msg_push.push_status IS '推送状态(0未推送 1成功 2失败)';
|
||||
COMMENT ON COLUMN js_sys_msg_push.push_date IS '推送时间';
|
||||
COMMENT ON COLUMN js_sys_msg_push.read_status IS '读取状态(0未送达 1已读 2未读)';
|
||||
COMMENT ON COLUMN js_sys_msg_push.read_status IS '读取状态(0未送达 1未读 2已读)';
|
||||
COMMENT ON COLUMN js_sys_msg_push.read_date IS '读取时间';
|
||||
COMMENT ON TABLE js_sys_msg_pushed IS '消息已推送表';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.id IS '编号';
|
||||
@@ -1315,7 +1277,7 @@ COMMENT ON COLUMN js_sys_msg_pushed.push_return_code IS '推送返回结果码';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.push_return_msg_id IS '推送返回消息编号';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.push_status IS '推送状态(0未推送 1成功 2失败)';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.push_date IS '推送时间';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.read_status IS '读取状态(0未送达 1已读 2未读)';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.read_status IS '读取状态(0未送达 1未读 2已读)';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.read_date IS '读取时间';
|
||||
COMMENT ON TABLE js_sys_msg_template IS '消息模板';
|
||||
COMMENT ON COLUMN js_sys_msg_template.id IS '编号';
|
||||
|
||||
@@ -1,40 +1,4 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE IF EXISTS js_gen_table_column;
|
||||
DROP TABLE IF EXISTS js_gen_table;
|
||||
DROP TABLE IF EXISTS js_sys_company_office;
|
||||
DROP TABLE IF EXISTS js_sys_employee_post;
|
||||
DROP TABLE IF EXISTS js_sys_user_data_scope;
|
||||
DROP TABLE IF EXISTS js_sys_user_role;
|
||||
DROP TABLE IF EXISTS js_sys_user;
|
||||
DROP TABLE IF EXISTS js_sys_employee;
|
||||
DROP TABLE IF EXISTS js_sys_company;
|
||||
DROP TABLE IF EXISTS js_sys_area;
|
||||
DROP TABLE IF EXISTS js_sys_config;
|
||||
DROP TABLE IF EXISTS js_sys_dict_data;
|
||||
DROP TABLE IF EXISTS js_sys_dict_type;
|
||||
DROP TABLE IF EXISTS js_sys_file_upload;
|
||||
DROP TABLE IF EXISTS js_sys_file_entity;
|
||||
DROP TABLE IF EXISTS js_sys_job_log;
|
||||
DROP TABLE IF EXISTS js_sys_job;
|
||||
DROP TABLE IF EXISTS js_sys_lang;
|
||||
DROP TABLE IF EXISTS js_sys_log;
|
||||
DROP TABLE IF EXISTS js_sys_role_menu;
|
||||
DROP TABLE IF EXISTS js_sys_menu;
|
||||
DROP TABLE IF EXISTS js_sys_module;
|
||||
DROP TABLE IF EXISTS js_sys_msg_inner_record;
|
||||
DROP TABLE IF EXISTS js_sys_msg_inner;
|
||||
DROP TABLE IF EXISTS js_sys_msg_push;
|
||||
DROP TABLE IF EXISTS js_sys_msg_pushed;
|
||||
DROP TABLE IF EXISTS js_sys_msg_template;
|
||||
DROP TABLE IF EXISTS js_sys_office;
|
||||
DROP TABLE IF EXISTS js_sys_post;
|
||||
DROP TABLE IF EXISTS js_sys_role_data_scope;
|
||||
DROP TABLE IF EXISTS js_sys_role;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
@@ -46,7 +10,6 @@ CREATE TABLE js_gen_table
|
||||
comments varchar(500) NOT NULL,
|
||||
parent_table_name varchar(64),
|
||||
parent_table_fk_name varchar(64),
|
||||
data_source_name varchar(64),
|
||||
tpl_category varchar(200),
|
||||
package_name varchar(500),
|
||||
module_name varchar(30),
|
||||
@@ -803,7 +766,7 @@ CREATE INDEX idx_sys_company_status ON js_sys_company (status);
|
||||
CREATE INDEX idx_sys_company_vc ON js_sys_company (view_code);
|
||||
CREATE INDEX idx_sys_company_pcs ON js_sys_company (parent_codes);
|
||||
CREATE INDEX idx_sys_company_tss ON js_sys_company (tree_sorts);
|
||||
CREATE UNIQUE INDEX idx_sys_config_key ON js_sys_config (config_key);
|
||||
CREATE INDEX idx_sys_config_key ON js_sys_config (config_key);
|
||||
CREATE INDEX idx_sys_dict_data_cc ON js_sys_dict_data (corp_code);
|
||||
CREATE INDEX idx_sys_dict_data_dt ON js_sys_dict_data (dict_type);
|
||||
CREATE INDEX idx_sys_dict_data_pc ON js_sys_dict_data (parent_code);
|
||||
@@ -925,7 +888,6 @@ COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
|
||||
COMMENT ON COLUMN js_gen_table.comments IS '表说明';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_name IS '关联父表的表名';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_fk_name IS '本表关联父表的外键名';
|
||||
COMMENT ON COLUMN js_gen_table.data_source_name IS '数据源名称';
|
||||
COMMENT ON COLUMN js_gen_table.tpl_category IS '使用的模板';
|
||||
COMMENT ON COLUMN js_gen_table.package_name IS '生成包路径';
|
||||
COMMENT ON COLUMN js_gen_table.module_name IS '生成模块名';
|
||||
@@ -1268,7 +1230,7 @@ COMMENT ON COLUMN js_sys_msg_inner_record.id IS '编号';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.msg_inner_id IS '所属消息';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.receive_user_code IS '接受者用户编码';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.receive_user_name IS '接受者用户姓名';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.read_status IS '读取状态(0未送达 1已读 2未读)';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.read_status IS '读取状态(0未送达 1未读 2已读)';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.read_date IS '阅读时间';
|
||||
COMMENT ON COLUMN js_sys_msg_inner_record.is_star IS '是否标星';
|
||||
COMMENT ON TABLE js_sys_msg_push IS '消息推送表';
|
||||
@@ -1292,7 +1254,7 @@ COMMENT ON COLUMN js_sys_msg_push.push_return_msg_id IS '推送返回消息编
|
||||
COMMENT ON COLUMN js_sys_msg_push.push_return_content IS '推送返回的内容信息';
|
||||
COMMENT ON COLUMN js_sys_msg_push.push_status IS '推送状态(0未推送 1成功 2失败)';
|
||||
COMMENT ON COLUMN js_sys_msg_push.push_date IS '推送时间';
|
||||
COMMENT ON COLUMN js_sys_msg_push.read_status IS '读取状态(0未送达 1已读 2未读)';
|
||||
COMMENT ON COLUMN js_sys_msg_push.read_status IS '读取状态(0未送达 1未读 2已读)';
|
||||
COMMENT ON COLUMN js_sys_msg_push.read_date IS '读取时间';
|
||||
COMMENT ON TABLE js_sys_msg_pushed IS '消息已推送表';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.id IS '编号';
|
||||
@@ -1315,7 +1277,7 @@ COMMENT ON COLUMN js_sys_msg_pushed.push_return_code IS '推送返回结果码';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.push_return_msg_id IS '推送返回消息编号';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.push_status IS '推送状态(0未推送 1成功 2失败)';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.push_date IS '推送时间';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.read_status IS '读取状态(0未送达 1已读 2未读)';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.read_status IS '读取状态(0未送达 1未读 2已读)';
|
||||
COMMENT ON COLUMN js_sys_msg_pushed.read_date IS '读取时间';
|
||||
COMMENT ON TABLE js_sys_msg_template IS '消息模板';
|
||||
COMMENT ON COLUMN js_sys_msg_template.id IS '编号';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.1.3-SNAPSHOT</version>
|
||||
<version>4.0.8-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -23,38 +23,12 @@
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- JDBC device begin -->
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
<artifactId>ojdbc6</artifactId>
|
||||
<version>11.2.0.3</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.jtds</groupId>
|
||||
<artifactId>jtds</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- JDBC device end -->
|
||||
|
||||
<!-- Common -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-common</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Framework -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-framework</artifactId>
|
||||
@@ -84,26 +58,4 @@
|
||||
<url>http://jeesite.com</url>
|
||||
</organization>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliyun-repos</id>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
<snapshots><enabled>false</enabled></snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype-repos-s</id>
|
||||
<name>Sonatype Repository</name>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases><enabled>false</enabled></releases>
|
||||
<snapshots><enabled>true</enabled></snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>aliyun-repos</id>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.autoconfigure.sys;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.jeesite.modules.sys.service.AreaService;
|
||||
import com.jeesite.modules.sys.service.CompanyService;
|
||||
import com.jeesite.modules.sys.service.EmpUserService;
|
||||
import com.jeesite.modules.sys.service.EmployeeService;
|
||||
import com.jeesite.modules.sys.service.LogService;
|
||||
import com.jeesite.modules.sys.service.OfficeService;
|
||||
import com.jeesite.modules.sys.service.PostService;
|
||||
import com.jeesite.modules.sys.service.support.AreaServiceSupport;
|
||||
import com.jeesite.modules.sys.service.support.CompanyServiceSupport;
|
||||
import com.jeesite.modules.sys.service.support.EmpUserServiceSupport;
|
||||
import com.jeesite.modules.sys.service.support.EmployeeServiceSupport;
|
||||
import com.jeesite.modules.sys.service.support.LogServiceSupport;
|
||||
import com.jeesite.modules.sys.service.support.OfficeServiceSupport;
|
||||
import com.jeesite.modules.sys.service.support.PostServiceSupport;
|
||||
|
||||
/**
|
||||
* 系统核心实现类
|
||||
* @author ThinkGem
|
||||
* @version 2018-10-13
|
||||
*/
|
||||
@Configuration
|
||||
public class SysAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public AreaService areaService(){
|
||||
return new AreaServiceSupport();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public CompanyService companyService(){
|
||||
return new CompanyServiceSupport();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public EmployeeService employeeService(){
|
||||
return new EmployeeServiceSupport();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public EmpUserService empUserService(){
|
||||
return new EmpUserServiceSupport();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public LogService logService(){
|
||||
return new LogServiceSupport();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public OfficeService officeService(){
|
||||
return new OfficeServiceSupport();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public PostService postService(){
|
||||
return new PostServiceSupport();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.common.shiro.filter;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.shiro.web.filter.AccessControlFilter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* 内部系统访问过滤器
|
||||
* @author ThinkGem
|
||||
* @version 2018-11-10
|
||||
*/
|
||||
public class InnerFilter extends AccessControlFilter {
|
||||
|
||||
@Override
|
||||
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
|
||||
boolean result = false;
|
||||
String[] prefixes = (String[])mappedValue;
|
||||
if (prefixes == null){
|
||||
prefixes = StringUtils.split(Global.getProperty(
|
||||
"shiro.innerFilterAllowRemoteAddrs", "127.0.0.1"), ",");
|
||||
}
|
||||
if (prefixes != null && request instanceof HttpServletRequest){
|
||||
String ip = ((HttpServletRequest)request).getRemoteAddr();
|
||||
for (String prefix : prefixes){
|
||||
result = StringUtils.startsWithIgnoreCase(ip, StringUtils.trim(prefix));
|
||||
if (result){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
|
||||
return PermissionsAuthorizationFilter.redirectTo403Page(request, response);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,9 @@ import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.shiro.realm.BaseAuthorizingRealm;
|
||||
import com.jeesite.common.shiro.realm.LoginInfo;
|
||||
import com.jeesite.common.web.http.ServletUtils;
|
||||
import com.jeesite.modules.sys.entity.Log;
|
||||
import com.jeesite.modules.sys.utils.LogUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
|
||||
/**
|
||||
* 登出过滤器
|
||||
@@ -38,16 +41,16 @@ public class LogoutFilter extends org.apache.shiro.web.filter.authc.LogoutFilter
|
||||
try {
|
||||
Object principal = subject.getPrincipal();
|
||||
if (principal != null){
|
||||
// // 记录用户退出日志(@Deprecated v4.0.5支持setAuthorizingRealm,之后版本可删除此if子句)
|
||||
// if (authorizingRealm == null){
|
||||
// LogUtils.saveLog(UserUtils.getUser(), ServletUtils.getRequest(),
|
||||
// "系统退出", Log.TYPE_LOGIN_LOGOUT);
|
||||
// }
|
||||
// else{
|
||||
// 退出成功之前初始化授权信息并处理登录后的操作
|
||||
// 记录用户退出日志(@Deprecated v4.0.5支持setAuthorizingRealm,之后版本可删除此if子句)
|
||||
if (authorizingRealm == null){
|
||||
LogUtils.saveLog(UserUtils.getUser(), ServletUtils.getRequest(),
|
||||
"系统退出", Log.TYPE_LOGIN_LOGOUT);
|
||||
}
|
||||
// 退出成功之前初始化授权信息并处理登录后的操作
|
||||
else{
|
||||
authorizingRealm.onLogoutSuccess((LoginInfo)subject.getPrincipal(),
|
||||
(HttpServletRequest)request);
|
||||
// }
|
||||
}
|
||||
}
|
||||
// 退出登录
|
||||
subject.logout();
|
||||
|
||||
@@ -5,10 +5,6 @@ package com.jeesite.common.shiro.realm;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
|
||||
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.codec.Sha1Utils;
|
||||
import com.jeesite.common.utils.SpringUtils;
|
||||
import com.jeesite.modules.sys.entity.Log;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
@@ -22,48 +18,11 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
* @version 2018-7-11
|
||||
*/
|
||||
public class AuthorizingRealm extends BaseAuthorizingRealm {
|
||||
|
||||
public static final String HASH_ALGORITHM = "SHA-1";
|
||||
public static final int HASH_INTERATIONS = 1024;
|
||||
public static final int SALT_SIZE = 8;
|
||||
|
||||
|
||||
private UserService userService;
|
||||
|
||||
public AuthorizingRealm() {
|
||||
super();
|
||||
// 设定密码校验的Hash算法与迭代次数
|
||||
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(HASH_ALGORITHM);
|
||||
matcher.setHashIterations(HASH_INTERATIONS);
|
||||
this.setCredentialsMatcher(matcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成密文密码,生成随机的16位salt并经过1024次 sha-1 hash
|
||||
* @param plainPassword 明文密码
|
||||
* @return 16位salt密钥 + 40位hash密码
|
||||
*/
|
||||
public String encryptPassword(String plainPassword) {
|
||||
String plain = EncodeUtils.decodeHtml(plainPassword);
|
||||
byte[] salt = Sha1Utils.genSalt(SALT_SIZE);
|
||||
byte[] hashPassword = Sha1Utils.sha1(plain.getBytes(), salt, HASH_INTERATIONS);
|
||||
return EncodeUtils.encodeHex(salt) + EncodeUtils.encodeHex(hashPassword);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证密码正确性
|
||||
* @param plainPassword 明文密码
|
||||
* @param password 密文密码
|
||||
* @return 验证成功返回true
|
||||
*/
|
||||
public boolean validatePassword(String plainPassword, String password) {
|
||||
try{
|
||||
String plain = EncodeUtils.decodeHtml(plainPassword);
|
||||
byte[] salt = EncodeUtils.decodeHex(password.substring(0, 16));
|
||||
byte[] hashPassword = Sha1Utils.sha1(plain.getBytes(), salt, HASH_INTERATIONS);
|
||||
return password.equals(EncodeUtils.encodeHex(salt) + EncodeUtils.encodeHex(hashPassword));
|
||||
}catch(Exception e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,8 +19,8 @@ import org.jasig.cas.client.validation.TicketValidationException;
|
||||
import org.jasig.cas.client.validation.TicketValidator;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.lang.ObjectUtils;
|
||||
import com.jeesite.common.shiro.authc.FormToken;
|
||||
import com.jeesite.common.shiro.cas.CasCreateUser;
|
||||
@@ -94,7 +94,7 @@ public class CasAuthorizingRealm extends BaseAuthorizingRealm {
|
||||
// 生成登录信息对象
|
||||
FormToken token = new FormToken();
|
||||
token.setUsername(casPrincipal.getName());
|
||||
Map<String, Object> params = MapUtils.newHashMap();
|
||||
Map<String, Object> params = Maps.newHashMap();
|
||||
params.putAll(casPrincipal.getAttributes());
|
||||
params.put("ticket", ticket);
|
||||
token.setParams(params);
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.jeesite.common.shiro.cas.CasOutHandler;
|
||||
import com.jeesite.common.shiro.config.FilterChainDefinitionMap;
|
||||
import com.jeesite.common.shiro.filter.CasAuthenticationFilter;
|
||||
import com.jeesite.common.shiro.filter.FormAuthenticationFilter;
|
||||
import com.jeesite.common.shiro.filter.InnerFilter;
|
||||
import com.jeesite.common.shiro.filter.LogoutFilter;
|
||||
import com.jeesite.common.shiro.filter.PermissionsAuthorizationFilter;
|
||||
import com.jeesite.common.shiro.filter.RolesAuthorizationFilter;
|
||||
@@ -55,19 +54,12 @@ public class ShiroConfig {
|
||||
@Bean
|
||||
@Order(3000)
|
||||
@ConditionalOnMissingBean(name="shiroFilterProxy")
|
||||
public FilterRegistrationBean<Filter> shiroFilterProxy(ShiroFilterFactoryBean shiroFilter) throws Exception {
|
||||
FilterRegistrationBean<Filter> bean = new FilterRegistrationBean<>();
|
||||
public FilterRegistrationBean shiroFilterProxy(ShiroFilterFactoryBean shiroFilter) throws Exception {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
bean.setFilter((Filter) shiroFilter.getInstance());
|
||||
bean.addUrlPatterns("/*");
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部系统访问过滤器
|
||||
*/
|
||||
private InnerFilter shiroInnerFilter() {
|
||||
return new InnerFilter();
|
||||
}
|
||||
|
||||
/**
|
||||
* CAS登录过滤器
|
||||
@@ -128,7 +120,6 @@ public class ShiroConfig {
|
||||
bean.setLoginUrl(Global.getProperty("shiro.loginUrl"));
|
||||
bean.setSuccessUrl(Global.getProperty("adminPath")+"/index");
|
||||
Map<String, Filter> filters = bean.getFilters();
|
||||
filters.put("inner", shiroInnerFilter());
|
||||
filters.put("cas", shiroCasFilter(casAuthorizingRealm));
|
||||
filters.put("authc", shiroAuthcFilter(authorizingRealm));
|
||||
filters.put("logout", shiroLogoutFilter(authorizingRealm));
|
||||
|
||||
@@ -18,15 +18,15 @@ import com.alibaba.druid.support.http.WebStatFilter;
|
||||
* @version 2017年11月30日
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnProperty(name="state.enabled", havingValue="true", matchIfMissing=true)
|
||||
@ConditionalOnProperty(name="druid.stat.enabled", havingValue="true", matchIfMissing=true)
|
||||
public class DruidStatConfig {
|
||||
|
||||
/**
|
||||
* 注册DruidFilter拦截
|
||||
*/
|
||||
@Bean
|
||||
public FilterRegistrationBean<WebStatFilter> duridFilter() {
|
||||
FilterRegistrationBean<WebStatFilter> bean = new FilterRegistrationBean<>();
|
||||
public FilterRegistrationBean duridFilter() {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
bean.setFilter(new WebStatFilter());
|
||||
bean.addInitParameter("exclusions", "*.css,*.js,*.png,"
|
||||
+ "*.jpg,*.gif,*.jpeg,*.bmp,*.ico,*.swf,*.psd,*.htc,*.htm,*.html,"
|
||||
@@ -40,8 +40,8 @@ public class DruidStatConfig {
|
||||
* 注册DruidServlet
|
||||
*/
|
||||
@Bean
|
||||
public ServletRegistrationBean<StatViewServlet> druidServlet() {
|
||||
ServletRegistrationBean<StatViewServlet> bean = new ServletRegistrationBean<>();
|
||||
public ServletRegistrationBean druidServlet() {
|
||||
ServletRegistrationBean bean = new ServletRegistrationBean();
|
||||
bean.setServlet(new StatViewServlet());
|
||||
bean.addUrlMappings("/druid/*");
|
||||
return bean;
|
||||
|
||||
@@ -3,45 +3,42 @@
|
||||
*/
|
||||
package com.jeesite.modules.config.web;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.web.PageCachingFilter;
|
||||
|
||||
/**
|
||||
* 页面缓存,如果需要,则加入如下依赖并取消下面注释
|
||||
|
||||
1、pom.xml:
|
||||
<dependency>
|
||||
<groupId>net.sf.ehcache</groupId>
|
||||
<artifactId>ehcache-web</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
|
||||
2、application.yml:
|
||||
# 页面缓存配置
|
||||
ehcache:
|
||||
pageCaching:
|
||||
enabled: false
|
||||
urlPatterns: "*.html"
|
||||
|
||||
* Filter 配置
|
||||
* @author ThinkGem
|
||||
* @version 2017年11月30日
|
||||
*/
|
||||
//@Configuration
|
||||
@Configuration
|
||||
public class PageCacheConfig {
|
||||
|
||||
// /**
|
||||
// * PageCache Filter, cache .html suffix.
|
||||
// */
|
||||
// @Bean
|
||||
// @Order(2000)
|
||||
// @ConditionalOnProperty(name = "ehcache.pageCaching.enabled", havingValue = "true")
|
||||
// @ConditionalOnMissingBean(name="pageCachingFilter")
|
||||
// public FilterRegistrationBean<PageCachingFilter> pageCachingFilter(EhCacheManagerFactoryBean ehCacheManager) {
|
||||
// FilterRegistrationBean<PageCachingFilter> bean = new FilterRegistrationBean<>();
|
||||
// SimplePageCachingFilter pageCachingFilter = new SimplePageCachingFilter();
|
||||
// pageCachingFilter.setCacheManager(ehCacheManager.getObject());
|
||||
// bean.setFilter(pageCachingFilter);
|
||||
// bean.addInitParameter("cacheName", "pageCachingFilter");
|
||||
// bean.addUrlPatterns(StringUtils.split(Global.getProperty(
|
||||
// "ehcache.pageCaching.urlPatterns"), ","));
|
||||
// return bean;
|
||||
// }
|
||||
|
||||
/**
|
||||
* PageCache Filter, cache .html suffix.
|
||||
*/
|
||||
@Bean
|
||||
@Order(2000)
|
||||
@ConditionalOnProperty(name = "ehcache.pageCaching.enabled", havingValue = "true")
|
||||
@ConditionalOnMissingBean(name="pageCachingFilter")
|
||||
public FilterRegistrationBean pageCachingFilter(EhCacheManagerFactoryBean ehCacheManager) {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
PageCachingFilter pageCachingFilter = new PageCachingFilter();
|
||||
pageCachingFilter.setCacheManager(ehCacheManager.getObject());
|
||||
bean.setFilter(pageCachingFilter);
|
||||
bean.addInitParameter("cacheName", "pageCachingFilter");
|
||||
bean.addUrlPatterns(StringUtils.split(Global.getProperty(
|
||||
"ehcache.pageCaching.urlPatterns"), ","));
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
@@ -22,7 +22,7 @@ import com.jeesite.modules.sys.interceptor.LogInterceptor;
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@ConditionalOnProperty(name="web.interceptor.log.enabled", havingValue="true", matchIfMissing=true)
|
||||
public class LogInterceptorConfig implements WebMvcConfigurer {
|
||||
public class LogInterceptorConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
@@ -22,7 +22,7 @@ import com.jeesite.modules.sys.interceptor.MobileInterceptor;
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@ConditionalOnProperty(name="web.interceptor.mobile.enabled", havingValue="true", matchIfMissing=false)
|
||||
public class MobileViewInterceptorConfig implements WebMvcConfigurer {
|
||||
public class MobileViewInterceptorConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
|
||||
@@ -14,8 +14,8 @@ import com.jeesite.common.tests.BaseInitDataTests;
|
||||
import com.jeesite.modules.gen.entity.GenTable;
|
||||
import com.jeesite.modules.gen.entity.GenTableColumn;
|
||||
import com.jeesite.modules.gen.service.GenTableService;
|
||||
import com.jeesite.modules.job.dao.JobDao;
|
||||
import com.jeesite.modules.job.entity.JobEntity;
|
||||
import com.jeesite.modules.job.service.JobService;
|
||||
import com.jeesite.modules.msg.task.impl.MsgLocalMergePushTask;
|
||||
import com.jeesite.modules.msg.task.impl.MsgLocalPushTask;
|
||||
import com.jeesite.modules.sys.dao.RoleMenuDao;
|
||||
@@ -86,7 +86,7 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
/**
|
||||
* 区域、行政区划表
|
||||
*/
|
||||
public void initArea(String... prefixes) throws Exception{
|
||||
public void initArea() throws Exception{
|
||||
clearTable(Area.class);
|
||||
initExcelData(Area.class, new MethodCallback() {
|
||||
@Override
|
||||
@@ -95,10 +95,7 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
if("save".equals(action)){
|
||||
Area entity = (Area)params[1];
|
||||
entity.setIsNewRecord(true);
|
||||
if (prefixes == null || prefixes.length == 0
|
||||
|| StringUtils.startsWithAny(entity.getAreaCode(), prefixes)){
|
||||
areaService.save(entity);
|
||||
}
|
||||
areaService.save(entity);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
@@ -374,7 +371,7 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private JobDao jobDao; // 默认情况下job是关闭状态,需要注入jobDao
|
||||
private JobService jobService;
|
||||
/**
|
||||
* 初始化消息推送服务
|
||||
*/
|
||||
@@ -386,7 +383,7 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
job.setConcurrent(Global.NO);
|
||||
job.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING);
|
||||
job.setStatus(JobEntity.STATUS_PAUSED);
|
||||
jobDao.insert(job);
|
||||
jobService.insert(job);
|
||||
job = new JobEntity(MsgLocalMergePushTask.class.getSimpleName(), "SYSTEM");
|
||||
job.setDescription("消息推送服务 (延迟推送)");
|
||||
job.setInvokeTarget("msgLocalMergePushTask.execute()");
|
||||
@@ -394,7 +391,7 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
job.setConcurrent(Global.NO);
|
||||
job.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING);
|
||||
job.setStatus(JobEntity.STATUS_PAUSED);
|
||||
jobDao.insert(job);
|
||||
jobService.insert(job);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package com.jeesite.modules.sys.entity;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.entity.TreeEntity;
|
||||
|
||||
@@ -9,7 +9,7 @@ import javax.validation.constraints.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
|
||||
@@ -61,9 +61,7 @@ import com.jeesite.common.utils.excel.fieldtype.OfficeType;
|
||||
@Column(name="area_name", label="区域名称", isQuery=false),
|
||||
@Column(name="area_type", label="区域类型"),
|
||||
}),
|
||||
},
|
||||
extWhereKeys="dsfOffice, dsfCompany",
|
||||
orderBy="a.user_weight DESC, a.update_date DESC"
|
||||
}, extWhereKeys="dsfOffice, dsfCompany", orderBy="a.user_weight DESC, a.update_date DESC"
|
||||
)
|
||||
public class EmpUser extends User {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
|
||||
@@ -6,7 +6,7 @@ package com.jeesite.modules.sys.entity;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
@@ -47,7 +47,7 @@ public class Office extends TreeEntity<Office> {
|
||||
private String viewCode; // 机构代码(作为显示用,多租户内唯一)
|
||||
private String officeName; // 机构名称
|
||||
private String fullName; // 机构全称
|
||||
private String officeType; // 机构类型(1:省级公司;2:市级公司;3:部门)
|
||||
private String officeType; // 机构类型(1:公司;2:部门;3:小组)
|
||||
private String leader; // 负责人
|
||||
private String phone; // 电话
|
||||
private String address; // 联系地址
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package com.jeesite.modules.sys.entity;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
@@ -16,7 +16,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
@Column(includeEntity=BaseEntity.class),
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
@Column(name="post_code", attrName="postCode", label="岗位编码", isPK=true),
|
||||
@Column(name="post_name", attrName="postName", label="岗位名称"),
|
||||
@Column(name="post_name", attrName="postName", label="岗位名称", queryType=QueryType.LIKE),
|
||||
@Column(name="post_type", attrName="postType", label="岗位分类", comment="岗位分类(高管、中层、基层)"),
|
||||
@Column(name="post_sort", attrName="postSort", label="岗位排序", comment="岗位排序(升序)"),
|
||||
}, orderBy="a.update_date DESC"
|
||||
@@ -57,14 +57,6 @@ public class Post extends DataEntity<Post> {
|
||||
this.postName = postName;
|
||||
}
|
||||
|
||||
public String getPostName_like() {
|
||||
return getSqlMap().getWhere().getValue("post_name", QueryType.LIKE);
|
||||
}
|
||||
|
||||
public void setPostName_like(String roleName) {
|
||||
getSqlMap().getWhere().and("post_name", QueryType.LIKE, roleName);
|
||||
}
|
||||
|
||||
@Length(min=0, max=100, message="岗位分类长度不能超过 100 个字符")
|
||||
public String getPostType() {
|
||||
return postType;
|
||||
|
||||
@@ -5,38 +5,57 @@ package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.service.api.TreeServiceApi;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.service.TreeService;
|
||||
import com.jeesite.modules.sys.dao.AreaDao;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
import com.jeesite.modules.sys.utils.AreaUtils;
|
||||
|
||||
/**
|
||||
* 行政区划Service
|
||||
* @author ThinkGem
|
||||
* @version 2014-8-19
|
||||
*/
|
||||
public interface AreaService extends TreeServiceApi<Area> {
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class AreaService extends TreeService<AreaDao, Area> {
|
||||
|
||||
/**
|
||||
* 获取区划
|
||||
*/
|
||||
@Override
|
||||
public Area get(Area area);
|
||||
public Area get(Area area) {
|
||||
return super.get(area);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区划
|
||||
*/
|
||||
@Override
|
||||
public List<Area> findList(Area area);
|
||||
public List<Area> findList(Area area) {
|
||||
return super.findList(area);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存区划
|
||||
*/
|
||||
@Override
|
||||
public void save(Area area);
|
||||
@Transactional(readOnly=false)
|
||||
public void save(Area area) {
|
||||
super.save(area);
|
||||
AreaUtils.clearCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除区划
|
||||
*/
|
||||
@Override
|
||||
public void delete(Area area);
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(Area area) {
|
||||
super.delete(area);
|
||||
AreaUtils.clearCache();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,50 +5,112 @@ package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.service.api.TreeServiceApi;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.service.TreeService;
|
||||
import com.jeesite.modules.sys.dao.CompanyDao;
|
||||
import com.jeesite.modules.sys.dao.CompanyOfficeDao;
|
||||
import com.jeesite.modules.sys.entity.Company;
|
||||
import com.jeesite.modules.sys.entity.CompanyOffice;
|
||||
import com.jeesite.modules.sys.utils.EmpUtils;
|
||||
|
||||
/**
|
||||
* 公司管理Service
|
||||
* @author ThinkGem
|
||||
* @author thinkgem
|
||||
* @version 2016-4-23
|
||||
*/
|
||||
public interface CompanyService extends TreeServiceApi<Company> {
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class CompanyService extends TreeService<CompanyDao, Company> {
|
||||
|
||||
@Autowired
|
||||
private CompanyOfficeDao companyOfficeDao;
|
||||
|
||||
@Autowired
|
||||
private DataScopeService dataScopeService;
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
*/
|
||||
@Override
|
||||
public Company get(Company company);
|
||||
public Company get(Company company) {
|
||||
return super.get(company);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据权限过滤条件
|
||||
*/
|
||||
@Override
|
||||
public void addDataScopeFilter(Company company, String ctrlPermi);
|
||||
public void addDataScopeFilter(Company company, String ctrlPermi) {
|
||||
company.getSqlMap().getDataScope().addFilter("dsf", "Company", "a.company_code", ctrlPermi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公司列表
|
||||
*/
|
||||
@Override
|
||||
public List<Company> findList(Company company);
|
||||
public List<Company> findList(Company company) {
|
||||
return super.findList(company);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存公司
|
||||
*/
|
||||
@Override
|
||||
public void save(Company company);
|
||||
@Transactional(readOnly=false)
|
||||
public void save(Company company) {
|
||||
if (company.getIsNewRecord()){
|
||||
genIdAndValid(company, company.getViewCode());
|
||||
// 当前新数据授权,如果用户有上级数据权限,则当前数据也有相应的数据权限
|
||||
dataScopeService.insertIfParentExists(company, "Company");
|
||||
}
|
||||
super.save(company);
|
||||
// 重新绑定组织和公司之间的关系
|
||||
if (StringUtils.isBlank(company.getCompanyCode())){
|
||||
return;
|
||||
}
|
||||
CompanyOffice where = new CompanyOffice();
|
||||
where.setCompanyCode(company.getCompanyCode());
|
||||
companyOfficeDao.deleteByEntity(where);
|
||||
if (ListUtils.isNotEmpty(company.getCompanyOfficeList())){
|
||||
companyOfficeDao.insertBatch(company.getCompanyOfficeList());
|
||||
}
|
||||
// 清理公司相关缓存
|
||||
clearCompanyCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公司
|
||||
*/
|
||||
@Override
|
||||
public void delete(Company company);
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(Company company) {
|
||||
super.delete(company);
|
||||
// 清理公司相关缓存
|
||||
clearCompanyCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用当前节点
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(Company company);
|
||||
@Transactional(readOnly=false)
|
||||
public void updateStatus(Company company) {
|
||||
dao.updateStatus(company);
|
||||
// 清理公司相关缓存
|
||||
clearCompanyCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理公司相关缓存
|
||||
*/
|
||||
private void clearCompanyCache(){
|
||||
// EmpUtils.removeCache(EmpUtils.CACHE_COMPANY_LIST);
|
||||
EmpUtils.removeCache(EmpUtils.CACHE_COMPANY_ALL_LIST);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,24 +3,51 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.ConstraintViolationException;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.api.CrudServiceApi;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
import com.jeesite.common.service.ServiceException;
|
||||
import com.jeesite.common.utils.excel.ExcelImport;
|
||||
import com.jeesite.common.validator.ValidatorUtils;
|
||||
import com.jeesite.modules.sys.dao.EmpUserDao;
|
||||
import com.jeesite.modules.sys.entity.EmpUser;
|
||||
import com.jeesite.modules.sys.entity.Employee;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.utils.EmpUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
|
||||
/**
|
||||
* 员工管理Service
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
public interface EmpUserService extends CrudServiceApi<EmpUser> {
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class EmpUserService extends CrudService<EmpUserDao, EmpUser> {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private EmployeeService employeeService;
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
*/
|
||||
@Override
|
||||
public EmpUser get(EmpUser empUser);
|
||||
public EmpUser get(EmpUser empUser) {
|
||||
return super.get(empUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据权限过滤条件
|
||||
@@ -28,37 +55,134 @@ public interface EmpUserService extends CrudServiceApi<EmpUser> {
|
||||
* @param ctrlPermi 控制权限类型(拥有的数据权限:DataScope.CTRL_PERMI_HAVE、可管理的数据权限:DataScope.CTRL_PERMI_HAVE)
|
||||
*/
|
||||
@Override
|
||||
public void addDataScopeFilter(EmpUser empUser, String ctrlPermi);
|
||||
public void addDataScopeFilter(EmpUser empUser, String ctrlPermi) {
|
||||
empUser.getSqlMap().getDataScope().addFilter("dsfOffice",
|
||||
"Office", "e.office_code", "a.create_by", ctrlPermi);
|
||||
if (StringUtils.isNotBlank(EmpUtils.getCompany().getCompanyCode())){
|
||||
empUser.getSqlMap().getDataScope().addFilter("dsfCompany",
|
||||
"Company", "e.company_code", "a.create_by", ctrlPermi);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*/
|
||||
@Override
|
||||
public Page<EmpUser> findPage(EmpUser empUser);
|
||||
public Page<EmpUser> findPage(Page<EmpUser> page, EmpUser empUser) {
|
||||
return super.findPage(page, empUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存用户员工
|
||||
*/
|
||||
@Override
|
||||
public void save(EmpUser user);
|
||||
@Transactional(readOnly=false)
|
||||
public void save(EmpUser user) {
|
||||
// 1、初始化用户信息
|
||||
if (user.getIsNewRecord()){
|
||||
userService.genId(user, user.getLoginCode());
|
||||
user.setUserCode(user.getUserCode()+"_"+IdGen.randomBase62(4).toLowerCase());
|
||||
user.setUserType(EmpUser.USER_TYPE_EMPLOYEE);
|
||||
user.setMgrType(EmpUser.MGR_TYPE_NOT_ADMIN);
|
||||
}
|
||||
Employee employee = user.getEmployee();
|
||||
// 如果员工编码为空,则使用用户编码
|
||||
if (StringUtils.isBlank(employee.getEmpCode())){
|
||||
employee.setEmpCode(user.getUserCode());
|
||||
}
|
||||
// 如果员工姓名为空,则使用昵称名
|
||||
if (StringUtils.isBlank(employee.getEmpName())){
|
||||
employee.setEmpName(user.getUserName());
|
||||
}
|
||||
// 2、保存用户
|
||||
user.setRefCode(employee.getEmpCode());
|
||||
user.setRefName(employee.getEmpName());
|
||||
userService.save(user);
|
||||
// 3、保存员工
|
||||
employee.setIsNewRecord(user.getIsNewRecord());
|
||||
employeeService.save(employee);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户数据
|
||||
* @param file 导入的用户数据文件
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
*/
|
||||
public String importData(MultipartFile file, Boolean isUpdateSupport);
|
||||
@Transactional(readOnly=false)
|
||||
public String importData(MultipartFile file, Boolean isUpdateSupport) {
|
||||
if (file == null){
|
||||
throw new ServiceException("请选择导入的数据文件!");
|
||||
}
|
||||
int successNum = 0; int failureNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
try(ExcelImport ei = new ExcelImport(file, 2, 0)){
|
||||
List<EmpUser> list = ei.getDataList(EmpUser.class);
|
||||
for (EmpUser user : list) {
|
||||
try{
|
||||
// 验证数据文件
|
||||
ValidatorUtils.validateWithException(user);
|
||||
// 验证是否存在这个用户
|
||||
User u = UserUtils.getByLoginCode(user.getLoginCode());
|
||||
if (u == null){
|
||||
this.save(user);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getLoginCode() + " 导入成功");
|
||||
} else if (isUpdateSupport){
|
||||
user.setUserCode(u.getUserCode());
|
||||
this.save(user);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getLoginCode() + " 更新成功");
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getLoginCode() + " 已存在");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、账号 " + user.getLoginCode() + " 导入失败:";
|
||||
if (e instanceof ConstraintViolationException){
|
||||
List<String> messageList = ValidatorUtils.extractPropertyAndMessageAsList((ConstraintViolationException)e, ": ");
|
||||
for (String message : messageList) {
|
||||
msg += message + "; ";
|
||||
}
|
||||
}else{
|
||||
msg += e.getMessage();
|
||||
}
|
||||
failureMsg.append(msg);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureMsg.append(e.getMessage());
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
if (failureNum > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
}else{
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(EmpUser empUser);
|
||||
@Transactional(readOnly=false)
|
||||
public void updateStatus(EmpUser empUser) {
|
||||
userService.delete(empUser);
|
||||
employeeService.delete(empUser.getEmployee());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
@Override
|
||||
public void delete(EmpUser empUser);
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(EmpUser empUser) {
|
||||
userService.delete(empUser);
|
||||
employeeService.delete(empUser.getEmployee());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,8 +5,15 @@ package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.api.CrudServiceApi;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
import com.jeesite.modules.sys.dao.EmployeeDao;
|
||||
import com.jeesite.modules.sys.dao.EmployeePostDao;
|
||||
import com.jeesite.modules.sys.entity.Employee;
|
||||
import com.jeesite.modules.sys.entity.EmployeePost;
|
||||
|
||||
@@ -15,35 +22,68 @@ import com.jeesite.modules.sys.entity.EmployeePost;
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
public interface EmployeeService extends CrudServiceApi<Employee> {
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class EmployeeService extends CrudService<EmployeeDao, Employee> {
|
||||
|
||||
@Autowired
|
||||
private EmployeePostDao employeePostDao;
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
*/
|
||||
@Override
|
||||
public Employee get(Employee employee);
|
||||
public Employee get(Employee employee) {
|
||||
return super.get(employee);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
*/
|
||||
@Override
|
||||
public Page<Employee> findPage(Employee employee);
|
||||
public Page<Employee> findPage(Page<Employee> page, Employee employee) {
|
||||
return super.findPage(page, employee);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
*/
|
||||
@Override
|
||||
public void save(Employee employee);
|
||||
@Transactional(readOnly=false)
|
||||
public void save(Employee employee) {
|
||||
if (employee.getIsNewRecord()){
|
||||
if (dao.get(employee) != null){
|
||||
throw newValidationException("员工编码已存在");
|
||||
}
|
||||
}
|
||||
super.save(employee);
|
||||
// 保存员工岗位
|
||||
EmployeePost where = new EmployeePost();
|
||||
where.setEmpCode(employee.getEmpCode());
|
||||
employeePostDao.deleteByEntity(where);
|
||||
if (ListUtils.isNotEmpty(employee.getEmployeePostList())){
|
||||
for (EmployeePost e : employee.getEmployeePostList()){
|
||||
e.setEmpCode(employee.getEmpCode());
|
||||
}
|
||||
employeePostDao.insertBatch(employee.getEmployeePostList());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@Override
|
||||
public void delete(Employee employee);
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(Employee employee) {
|
||||
super.delete(employee);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前员工关联的岗位信息
|
||||
*/
|
||||
public List<EmployeePost> findEmployeePostList(Employee employee);
|
||||
|
||||
public List<EmployeePost> findEmployeePostList(Employee employee){
|
||||
EmployeePost employeePost = new EmployeePost();
|
||||
employeePost.setEmpCode(employee.getEmpCode());
|
||||
return employeePostDao.findList(employeePost);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,13 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.api.CrudServiceApi;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
import com.jeesite.modules.sys.dao.LogDao;
|
||||
import com.jeesite.modules.sys.entity.Log;
|
||||
|
||||
/**
|
||||
@@ -12,17 +17,36 @@ import com.jeesite.modules.sys.entity.Log;
|
||||
* @author ThinkGem
|
||||
* @version 2014-05-16
|
||||
*/
|
||||
public interface LogService extends CrudServiceApi<Log> {
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class LogService extends CrudService<LogDao, Log> {
|
||||
|
||||
/**
|
||||
* 查询日志记录
|
||||
*/
|
||||
@Override
|
||||
public Page<Log> findPage(Log log);
|
||||
public Page<Log> findPage(Page<Log> page, Log log) {
|
||||
// // 设置默认时间范围,默认当前月
|
||||
// if (log.getCreateDate_gte() == null){
|
||||
// log.setCreateDate_gte(DateUtils.setDays(new Date(), 1));
|
||||
// }
|
||||
// if (log.getCreateDate_lte() == null){
|
||||
// log.setCreateDate_lte(DateUtils.addDays(DateUtils.addMonths(log.getCreateDate_gte(), 1), -1));
|
||||
// }
|
||||
// 普通用户看自己的,管理员看全部的。
|
||||
if (!log.getCurrentUser().isAdmin()){
|
||||
log.setCreateBy(log.getCurrentUser().getUserCode());
|
||||
}
|
||||
return super.findPage(page, log);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 不使用数据库事务,执行插入日志
|
||||
*/
|
||||
public void insertLog(Log entity);
|
||||
@Transactional(readOnly=false, propagation=Propagation.NOT_SUPPORTED)
|
||||
public void insertLog(Log entity) {
|
||||
dao.insert(entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,50 +5,95 @@ package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.service.api.TreeServiceApi;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.service.TreeService;
|
||||
import com.jeesite.modules.sys.dao.OfficeDao;
|
||||
import com.jeesite.modules.sys.entity.Office;
|
||||
import com.jeesite.modules.sys.utils.EmpUtils;
|
||||
|
||||
/**
|
||||
* 机构Service
|
||||
* @author ThinkGem
|
||||
* @version 2016-4-23
|
||||
*/
|
||||
public interface OfficeService extends TreeServiceApi<Office> {
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class OfficeService extends TreeService<OfficeDao, Office> {
|
||||
|
||||
@Autowired
|
||||
private DataScopeService dataScopeService;
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
*/
|
||||
@Override
|
||||
public Office get(Office office);
|
||||
public Office get(Office office) {
|
||||
return super.get(office);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据权限过滤条件
|
||||
*/
|
||||
@Override
|
||||
public void addDataScopeFilter(Office office, String ctrlPermi);
|
||||
public void addDataScopeFilter(Office office, String ctrlPermi) {
|
||||
office.getSqlMap().getDataScope().addFilter("dsf", "Office", "a.office_code", ctrlPermi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组织机构列表
|
||||
*/
|
||||
@Override
|
||||
public List<Office> findList(Office office);
|
||||
public List<Office> findList(Office office) {
|
||||
return super.findList(office);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
*/
|
||||
@Override
|
||||
public void save(Office office);
|
||||
@Transactional(readOnly=false)
|
||||
public void save(Office office) {
|
||||
if (office.getIsNewRecord()){
|
||||
genIdAndValid(office, office.getViewCode());
|
||||
// 当前新数据授权,如果用户有上级数据权限,则当前数据也有相应的数据权限
|
||||
dataScopeService.insertIfParentExists(office, "Office");
|
||||
}
|
||||
super.save(office);
|
||||
// 清理部门相关缓存
|
||||
clearOfficeCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新部门状态
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(Office office);
|
||||
@Transactional(readOnly=false)
|
||||
public void updateStatus(Office office) {
|
||||
super.updateStatus(office);
|
||||
// 清理部门相关缓存
|
||||
clearOfficeCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@Override
|
||||
public void delete(Office office);
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(Office office) {
|
||||
super.delete(office);
|
||||
// 清理部门相关缓存
|
||||
clearOfficeCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理部门相关缓存
|
||||
*/
|
||||
private void clearOfficeCache(){
|
||||
// EmpUtils.removeCache(EmpUtils.CACHE_OFFICE_LIST);
|
||||
EmpUtils.removeCache(EmpUtils.CACHE_OFFICE_ALL_LIST);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.api.CrudServiceApi;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
import com.jeesite.modules.sys.dao.PostDao;
|
||||
import com.jeesite.modules.sys.entity.Post;
|
||||
|
||||
/**
|
||||
@@ -12,41 +16,60 @@ import com.jeesite.modules.sys.entity.Post;
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
public interface PostService extends CrudServiceApi<Post> {
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class PostService extends CrudService<PostDao, Post> {
|
||||
|
||||
/**
|
||||
* 查询岗位
|
||||
*/
|
||||
@Override
|
||||
public Post get(Post post);
|
||||
public Post get(Post post) {
|
||||
return super.get(post);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称查询岗位
|
||||
*/
|
||||
public Post getByPostName(Post post);
|
||||
public Post getByPostName(Post post) {
|
||||
Post where = new Post();
|
||||
where.setPostName(post.getPostName());
|
||||
return dao.getByEntity(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询岗位
|
||||
* 查询可分页的岗位列表
|
||||
*/
|
||||
@Override
|
||||
public Page<Post> findPage(Post post);
|
||||
public Page<Post> findPage(Page<Post> page, Post post) {
|
||||
return super.findPage(page, post);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存岗位
|
||||
*/
|
||||
@Override
|
||||
public void save(Post post);
|
||||
@Transactional(readOnly=false)
|
||||
public void save(Post post) {
|
||||
super.save(post);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新岗位状态
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(Post post);
|
||||
@Transactional(readOnly=false)
|
||||
public void updateStatus(Post post) {
|
||||
super.updateStatus(post);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
@Override
|
||||
public void delete(Post post);
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(Post post) {
|
||||
super.delete(post);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.sys.service.support;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.service.TreeService;
|
||||
import com.jeesite.modules.sys.dao.AreaDao;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
import com.jeesite.modules.sys.service.AreaService;
|
||||
import com.jeesite.modules.sys.utils.AreaUtils;
|
||||
|
||||
/**
|
||||
* 行政区划Service
|
||||
* @author ThinkGem
|
||||
* @version 2014-8-19
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class AreaServiceSupport extends TreeService<AreaDao, Area>
|
||||
implements AreaService {
|
||||
|
||||
/**
|
||||
* 获取区划
|
||||
*/
|
||||
@Override
|
||||
public Area get(Area area) {
|
||||
return super.get(area);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区划
|
||||
*/
|
||||
@Override
|
||||
public List<Area> findList(Area area) {
|
||||
return super.findList(area);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存区划
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
public void save(Area area) {
|
||||
super.save(area);
|
||||
AreaUtils.clearCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除区划
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
public void delete(Area area) {
|
||||
super.delete(area);
|
||||
AreaUtils.clearCache();
|
||||
}
|
||||
|
||||
}
|
||||