Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e31a810437 | ||
|
|
fdedcc4f79 | ||
|
|
7c6e79b06b | ||
|
|
d0e0cbdf7a | ||
|
|
bb5db42ed5 | ||
|
|
b40fc1c35c | ||
|
|
21fcae1e97 | ||
|
|
0150e054c2 | ||
|
|
d8c85389b7 | ||
|
|
9c5b2d232c | ||
|
|
743c31d768 | ||
|
|
b169727263 | ||
|
|
3716cdfa87 | ||
|
|
03a0a51de9 | ||
|
|
d5b0aa9a14 | ||
|
|
ef6716e83c | ||
|
|
b5c7fd1a23 | ||
|
|
fbda5d558e | ||
|
|
ed38197ce1 | ||
|
|
6cb76ee31c | ||
|
|
7d73ba299c | ||
|
|
d3b5c67edd | ||
|
|
aed37d61fc | ||
|
|
6b89b2a15b | ||
|
|
c3cf990986 | ||
|
|
2e361e82a0 | ||
|
|
835ef5c82d | ||
|
|
3f51716843 | ||
|
|
05b65b9ac4 | ||
|
|
0dc0d31066 | ||
|
|
47f9f37e25 | ||
|
|
d5944598c2 | ||
|
|
91e418fcec | ||
|
|
b8162c5d69 | ||
|
|
dce899c3f4 | ||
|
|
26d8ae7486 | ||
|
|
4c26dd9abf | ||
|
|
67063a6dd7 | ||
|
|
0a123a137b | ||
|
|
8c7540f838 | ||
|
|
a9e728f3a6 | ||
|
|
6a2655b7e1 | ||
|
|
7a4499640c | ||
|
|
e03991b347 | ||
|
|
f470fcfdfd | ||
|
|
208fbb7320 | ||
|
|
9dc50ca0d9 | ||
|
|
1e21b15201 | ||
|
|
5f61c98b49 | ||
|
|
63dc0f8935 | ||
|
|
6e0632b694 | ||
|
|
5090fd0d44 | ||
|
|
109919d715 | ||
|
|
02c635c8af | ||
|
|
21a94f701d | ||
|
|
9f2f393d3f | ||
|
|
8fd22731f8 | ||
|
|
0c477d19df | ||
|
|
d19d9f0bfe | ||
|
|
a99b658ba7 | ||
|
|
630af59c3b | ||
|
|
441fea32fb | ||
|
|
cb8a4d2f73 | ||
|
|
f5031e51ac | ||
|
|
0840bb590d | ||
|
|
42341583ed | ||
|
|
ab1f973765 | ||
|
|
4ae255ae45 | ||
|
|
22751ae9e8 | ||
|
|
4154cc5328 | ||
|
|
edd04b116b | ||
|
|
d8138e7098 | ||
|
|
c0078030f4 | ||
|
|
faa2cdb3b3 | ||
|
|
537ed1f0ea | ||
|
|
a516967393 | ||
|
|
39d42657e4 | ||
|
|
9d295eda35 | ||
|
|
7484c990d7 | ||
|
|
b704cdc55b | ||
|
|
b16d6bd4bd | ||
|
|
858b04ff75 | ||
|
|
c5eded94c0 | ||
|
|
5c39029c62 | ||
|
|
c06e83f3b2 | ||
|
|
91f41a886f | ||
|
|
6dce23a32f | ||
|
|
93a09be05d | ||
|
|
07e705fee7 | ||
|
|
a612ce1acb | ||
|
|
401f5d0efd | ||
|
|
46f508ea38 | ||
|
|
6257b8ace7 | ||
|
|
b31364a794 | ||
|
|
a0d6ef9097 | ||
|
|
ddc67f0189 | ||
|
|
1cbb9c8c4f | ||
|
|
0bcf6e8921 | ||
|
|
318c751ec2 | ||
|
|
5398f57fe1 | ||
|
|
1054c544bf | ||
|
|
8ff65b3b26 | ||
|
|
1e8f06c019 | ||
|
|
320f891278 | ||
|
|
4163d48838 | ||
|
|
35834e1e8d | ||
|
|
3d3ec2a152 | ||
|
|
627cd062c6 |
2
LICENSE
2
LICENSE
@@ -220,4 +220,4 @@
|
||||
|
||||
官方网址:http://jeesite.com
|
||||
|
||||
技术服务:http://s.jeesite.com
|
||||
联系我们:http://s.jeesite.com
|
||||
|
||||
96
README.md
96
README.md
@@ -4,8 +4,8 @@
|
||||
</p>
|
||||
<h3 align="center" style="margin:30px 0 30px;font-weight:bold;font-size:30px;">快速开发平台 - Spring Boot</h3>
|
||||
<p align="center">
|
||||
<a href="https://jeesite.com/docs/upgrade/" target="__blank"><img alt="JeeSite-V5.0" src="https://img.shields.io/badge/JeeSite-V5.0-success.svg"></a>
|
||||
<a href="https://spring.io/projects/spring-boot#learn" target="__blank"><img alt="SpringBoot-2.5" src="https://img.shields.io/badge/SpringBoot-2.5-blue.svg"></a>
|
||||
<a href="https://jeesite.com/docs/upgrade/" target="__blank"><img alt="JeeSite-V5.2" src="https://img.shields.io/badge/JeeSite-V5.2-success.svg"></a>
|
||||
<a href="https://spring.io/projects/spring-boot#learn" target="__blank"><img alt="SpringBoot-2.7" src="https://img.shields.io/badge/SpringBoot-2.7-blue.svg"></a>
|
||||
<a href="https://gitee.com/thinkgem/jeesite4/stargazers" target="__blank"><img alt="star" src="https://gitee.com/thinkgem/jeesite4/badge/star.svg?theme=dark"></a>
|
||||
<a href="https://gitee.com/thinkgem/jeesite4/members" target="__blank"><img alt="fork" src="https://gitee.com/thinkgem/jeesite4/badge/fork.svg?theme=dark"></a>
|
||||
</p>
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
## 平台介绍
|
||||
|
||||
JeeSite 快速开发平台,不仅仅是一个后台开发框架,它是一个企业级快速开发解决方案,后端基于经典组合 Spring Boot、Shiro、MyBatis,前端采用 Beetl、Bootstrap、AdminLTE 经典开发模式,或者分离版 Vue3、Vite、Ant Design Vue、TypeScript、Vben Admin 最先进技术栈。提供在线代码生成功能,包括模块如:组织机构、角色用户、菜单及按钮授权、数据权限、系统参数、内容管理、工作流等。采用松耦合设计,微内核和插件架构,模块增减便捷;界面无刷新,一键换肤;众多账号安全设置,密码策略;文件在线预览;消息推送;多元化第三方登录;在线定时任务配置;支持集群,支持SAAS;支持多数据源;支持读写分离、分库分表;支持微服务应用。
|
||||
JeeSite 快速开发平台,不仅仅是一个后台开发框架,它是一个企业级快速开发解决方案,后端基于经典组合 Spring Boot、Shiro、MyBatis,前端采用 Beetl、Bootstrap、AdminLTE 经典开发模式,或者分离版 Vue3、Vite、Ant Design Vue、TypeScript、Vben Admin 最先进技术栈。提供在线代码生成功能,可自动创建业务模块工程和微服务模块工程,自动生成前端代码和后端代码;包括功能模块如:组织机构、角色用户、菜单及按钮授权、数据权限、系统参数、内容管理、工作流等。采用松耦合设计,微内核和插件架构,模块增减便捷;界面无刷新,一键换肤;众多账号安全设置,密码策略;文件在线预览;消息推送;多元化第三方登录;在线定时任务配置;支持集群,支持SAAS;支持多数据源;支持读写分离、分库分表;支持微服务应用。
|
||||
|
||||
JeeSite 快速开发平台的主要目的是能够让初级的研发人员快速的开发出复杂的业务功能,中高级人员有时间做一些更有用的事情。让开发者注重专注业务,其余有平台来封装技术细节,降低技术难度,从而节省人力成本,缩短项目周期,提高软件安全质量。
|
||||
|
||||
@@ -41,7 +41,7 @@ JeeSite 功能全,知识点非常多,也非常少。因为她使用的都是
|
||||
|
||||
JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,封装不是限制你去做一些事情,而是在便捷的同时,也具有较好的扩展性,在不具备一些功能的情况下,JeeSite 提供了扩展接口,提供了原生调用方法。
|
||||
|
||||
大家都在用 Spring,也在学习 Spring 的优点,Spring 提供了较好的扩展性,可又有多少人去修改它的源代码呢,退一步说,大家去修改了 Spring 的源码,反而会对未来升级造成很大困扰,您说不是呢?这样的例子很多,所以不要纠结,我们非常注重着一块,JeeSite 也一样具备强大的扩展性。
|
||||
大家都在用 Spring,也在学习 Spring 的优点,Spring 提供了较好的扩展性,可又有多少人去修改它的源代码呢,退一步说,大家去修改了 Spring 的源码,反而会对未来升级造成很大困扰,您说不是呢?这样的例子很多,所以不要纠结,我们非常注重这一点,JeeSite 也一样具备强大的扩展性。
|
||||
|
||||
* 至今 JeeSite 平台架构已经非常稳定。
|
||||
* JeeSite 精益求精,用心打磨每一个细节。
|
||||
@@ -51,14 +51,16 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
|
||||
|
||||
## 技术选型
|
||||
|
||||
* 主框架:Spring Boot 2.5、Spring Framework 5.3、Apache Shiro 1.8、J2Cache
|
||||
* 主框架:Spring Boot 2.7、Spring Framework 5.3、Apache Shiro 1.10、J2Cache
|
||||
* 持久层:Apache MyBatis 3.5、Hibernate Validator 6.2、Alibaba Druid 1.2
|
||||
* 视图层:Spring MVC 5.3、Beetl 3.3(替换JSP)、Bootstrap 3.3、AdminLTE 2.4
|
||||
* 视图层:Spring MVC 5.3、Beetl 3.10(替换JSP)、Bootstrap 3.3、AdminLTE 2.4
|
||||
* 前端组件:jQuery 3.5、jqGrid 4.7、layer 3.5、zTree 3.5、jQuery Validation
|
||||
* 支持 IE9 及以上版本及其他所有现代浏览器,如:谷歌浏览器、火狐浏览器、国产浏览器 等
|
||||
* 分离前端版:Node.js、TypeScript、Vue3、Vite、Ant Design Vue3、Vue Vben Admin
|
||||
* 工作流引擎:Flowable 6.6、符合 BPMN 规范、在线流程设计器、中国式流程、退回、撤回、自由流
|
||||
* Bootstrap 版 支持 IE9 及以上版本及其他所有现代浏览器,如:谷歌、火狐、国产浏览器 等
|
||||
* Vue3 版 支持现代浏览器,如:谷歌 Chrome 86+、火狐、国产浏览器 等
|
||||
* 技术选型(详细):<http://jeesite.com/docs/technology/>
|
||||
* JeeSite Vue:<http://jeesite.com/docs/jeesite-vue/>
|
||||
* JeeSite Vue:<https://gitee.com/thinkgem/jeesite-vue>
|
||||
|
||||
## 更多介绍
|
||||
|
||||
@@ -75,65 +77,105 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
|
||||
* Flowable业务流程模块(BPM):<http://jeesite.com/docs/bpm/>
|
||||
* 内容管理模块(CMS):<https://gitee.com/thinkgem/jeesite4-cms>
|
||||
* 手机端移动端:<https://gitee.com/thinkgem/jeesite4-uniapp>
|
||||
* Vue3分离版本:<http://jeesite.com/docs/jeesite-vue/>
|
||||
* Vue3分离版本:<https://gitee.com/thinkgem/jeesite-vue>
|
||||
|
||||
## 快速体验
|
||||
|
||||
### 在线演示
|
||||
|
||||
1. 地址:<http://demo.jeesite.com/>
|
||||
2. 账号:system
|
||||
3. 密码:admin
|
||||
|
||||
### 本地运行
|
||||
|
||||
1. 环境准备:`JDK 1.8 or 11、17`、`Maven 3.6+`、`MySQL 5.7 or 8.0`([支持更多数据库](https://jeesite.com/docs/technology/#_8、已支持数据库))
|
||||
2. 执行命令:`git clone https://gitee.com/thinkgem/jeesite4.git` 下载源码(master分支)
|
||||
1. 环境准备:`JDK 1.8 or 11、17`、`Maven 3.6+`、使用 `MySQL 5.7 or 8.0` 数据库、[其它数据库](https://jeesite.com/docs/technology/#_8、已支持数据库)
|
||||
2. 下载源码:<https://gitee.com/thinkgem/jeesite4/repository/archive/v5.2.zip> 并解压
|
||||
3. 打开文件:`/web/src/main/resources/config/application.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. 部署常见问题:<https://jeesite.com/docs/faq/>
|
||||
8. 分离端安装:<https://jeesite.com/docs/vue-install-deploy/>
|
||||
|
||||
### 快速运行
|
||||
|
||||
1. 环境准备:`JDK 1.8 or 11、17`、`Maven 3.6+`、无需准备数据库(使用内嵌 H2 DB)
|
||||
2. 下载源码:<https://gitee.com/thinkgem/jeesite4/repository/archive/v5.0_dev.zip> 并解压
|
||||
3. 执行脚本:`/web-fast/bin/run-tomcat.bat` 启动服务即可(自动初始化库)
|
||||
4. 浏览器访问:<http://127.0.0.1:8980/js/> 账号 system 密码 admin
|
||||
5. 部署常见问题:<https://jeesite.com/docs/faq/>
|
||||
8. 分离端安装:<https://jeesite.com/docs/vue-install-deploy/>
|
||||
|
||||
### 容器运行
|
||||
|
||||
- 拉取 Docker 镜像:
|
||||
```
|
||||
docker pull thinkgem/jeesite-web
|
||||
```
|
||||
- 启动脚本:
|
||||
```
|
||||
docker run -d -p 8980:8980 --name jeesite-web -v /data:/data \
|
||||
thinkgem/jeesite-web && docker logs -f jeesite-web
|
||||
```
|
||||
- 浏览器访问:<http://127.0.0.1:8980/js/> 账号 system 密码 admin
|
||||
- 分离端安装:<https://jeesite.com/docs/vue-install-deploy/>
|
||||
|
||||
### 开发环境
|
||||
|
||||
1. 部署运行文档:<https://jeesite.com/docs/install-deploy/>
|
||||
2. 部署常见问题:<https://jeesite.com/docs/faq/>
|
||||
3. 分离端安装:<https://jeesite.com/docs/vue-install-deploy/>
|
||||
|
||||
## 技术文章
|
||||
|
||||
* 菜单和按钮权限:<https://jeesite.com/docs/permi-shiro/>
|
||||
* 强大的数据权限:<https://jeesite.com/docs/service-datascope/#数据权限>
|
||||
* 表结构数据字典:<https://jeesite.com/docs/code-gen/#表结构数据字典>
|
||||
* 表单组件封装:<https://jeesite.com/docs/views-beetl/>
|
||||
* 持久层设计:<https://jeesite.com/docs/dao-mybatis/>
|
||||
* JS脚本工具:<https://jeesite.com/docs/jeesite-js/>
|
||||
* 后端工具:<https://jeesite.com/docs/sys-utils/>
|
||||
* 表单组件:<https://jeesite.com/docs/views-beetl/>
|
||||
* 表格组件:<https://jeesite.com/docs/datagrid/>
|
||||
* js工具:<https://jeesite.com/docs/jeesite-js/>
|
||||
|
||||
## 专题文章
|
||||
|
||||
* 自定义主题:<https://jeesite.com/docs/custom-views/>
|
||||
* 国际化多语言:<https://jeesite.com/docs/i18n-locale/>
|
||||
* 接口文档:<https://jeesite.com/docs/mobile-rest-api/>
|
||||
* BPM工作流引擎:<https://jeesite.com/docs/bpm/>
|
||||
* 用户类型:<https://jeesite.com/docs/user-type/>
|
||||
* 树表结构设计:<https://jeesite.com/docs/tree-table-use/>
|
||||
* 单点登录:<https://jeesite.com/docs/sso-cas/>
|
||||
* 国际化:<https://jeesite.com/docs/i18n-locale/>
|
||||
* 对象存储:<https://jeesite.com/docs/oss-client/>
|
||||
* 文件在线预览:<https://jeesite.com/docs/filepreview/>
|
||||
* 报表设计器:<https://jeesite.com/docs/ureport/>
|
||||
* 大屏设计器:<https://jeesite.com/docs/visual/>
|
||||
* 三员管理员:<https://jeesite.com/docs/3manager/>
|
||||
* 在线作业调度:<https://jeesite.com/docs/job/>
|
||||
* 消息推送:<https://jeesite.com/docs/msg-push-use/>
|
||||
* 单点登录:<https://jeesite.com/docs/sso-cas/>
|
||||
* 在线任务调度:<https://jeesite.com/docs/job/>
|
||||
* 对象存储:<https://jeesite.com/docs/oss-client/>
|
||||
* 大屏设计器:<https://jeesite.com/docs/visual/>
|
||||
* 报表设计器:<https://jeesite.com/docs/ureport/>
|
||||
* 文件在线预览:<https://jeesite.com/docs/filepreview/>
|
||||
* 三员管理员:<https://jeesite.com/docs/manager3/>
|
||||
* 手机端框架:<https://jeesite.com/docs/uniapp/>
|
||||
* 统一认证服务:<https://jeesite.com/docs/oauth2-server/>
|
||||
* 树表结构设计:<https://jeesite.com/docs/tree-table-use/>
|
||||
|
||||
## 云服务架构
|
||||
|
||||
* 多租户、SaaS服务:<https://jeesite.com/docs/saas-corp-use/>
|
||||
* 集群、负载均衡、高可用:<https://jeesite.com/docs/cluster/>
|
||||
* Spring Cloud:<https://jeesite.com/docs/springcloud/>
|
||||
* 分布式事务 LCN:<https://jeesite.com/docs/springcloud-lcn/>
|
||||
* Spring Cloud 微服务:<https://jeesite.com/docs/springcloud/>
|
||||
* 分布式事务 Seata:<https://jeesite.com/docs/springcloud-seata/>
|
||||
* 读写分离、分库分表:<https://jeesite.com/docs/sharding/>
|
||||
|
||||
## 前后分离版
|
||||
|
||||
* Vue 版介绍:<https://jeesite.com/docs/jeesite-vue/>
|
||||
* Vue 安装部署:<https://jeesite.com/docs/vue-install-deploy/>
|
||||
* Vue 参数配置:<https://jeesite.com/docs/vue-settings/>
|
||||
* Vue 前端权限:<https://jeesite.com/docs/vue-auth/>
|
||||
* Vue 源码解析:<https://jeesite.com/docs/vue-crud-view/>
|
||||
* Vue 表单组件:<https://jeesite.com/docs/vue-basic-form/>
|
||||
* Vue 表格组件:<https://jeesite.com/docs/vue-basic-table/>
|
||||
* Vue 常用组件:<https://jeesite.com/docs/vue-comp/>
|
||||
* Vue 图标组件:<https://jeesite.com/docs/vue-icon/>
|
||||
* Vue 国际化多语言:<https://jeesite.com/docs/vue-i18n/>
|
||||
* Vue 样式库:<https://jeesite.com/docs/vue-style/>
|
||||
|
||||
## 授权协议声明
|
||||
|
||||
@@ -151,7 +193,7 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
|
||||
|
||||
## 技术服务与支持
|
||||
|
||||
* 没有资金的支撑就很难得到发展,特别是一个好的产品,如果 JeeSite 帮助了您,请为我们点赞。支持我们,您可以得到一些回报,有了这些我们会把公益事业做的更好,回报社区和社会,请给我们一些动力吧,在此非常感谢已支持我们的朋友!
|
||||
* 没有资金的支撑就很难得到发展,特别是一个好的产品,如果 JeeSite 帮助了您,请为我们点赞。支持我们,您可以获得更多回馈,我们会把公益事业做的更好,开放更多资源,回报社区和社会。请给我们一些动力吧,在此非常感谢已支持我们的朋友!
|
||||
* **联系我们**:请访问技术支持服务页面:<https://jeesite.com/docs/support/>
|
||||
|
||||
## 今后如何升级?
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.1-SNAPSHOT</version>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,11 +17,14 @@
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- Servlet Api -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Apache Commons -->
|
||||
<dependency>
|
||||
@@ -240,6 +243,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
@@ -258,19 +262,9 @@
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
|
||||
@@ -74,15 +74,15 @@ public class DesUtils {
|
||||
String encData = "";
|
||||
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
|
||||
int firstLength = 0, secondLength = 0, thirdLength = 0;
|
||||
if (firstKey != null && !firstKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey)) {
|
||||
firstKeyBt = getKeyBytes(firstKey);
|
||||
firstLength = firstKeyBt.size();
|
||||
}
|
||||
if (secondKey != null && !secondKey.equals("")) {
|
||||
if (secondKey != null && !"".equals(secondKey)) {
|
||||
secondKeyBt = getKeyBytes(secondKey);
|
||||
secondLength = secondKeyBt.size();
|
||||
}
|
||||
if (thirdKey != null && !thirdKey.equals("")) {
|
||||
if (thirdKey != null && !"".equals(thirdKey)) {
|
||||
thirdKeyBt = getKeyBytes(thirdKey);
|
||||
thirdLength = thirdKeyBt.size();
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class DesUtils {
|
||||
if (leng < 4) {
|
||||
int[] bt = strToBt(data);
|
||||
int[] encByte = null;
|
||||
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !firstKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(firstKey)) {
|
||||
int[] tempBt;
|
||||
int x, y, z;
|
||||
tempBt = bt;
|
||||
@@ -106,7 +106,7 @@ public class DesUtils {
|
||||
}
|
||||
encByte = tempBt;
|
||||
} else {
|
||||
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) {
|
||||
int[] tempBt;
|
||||
int x, y;
|
||||
tempBt = bt;
|
||||
@@ -118,7 +118,7 @@ public class DesUtils {
|
||||
}
|
||||
encByte = tempBt;
|
||||
} else {
|
||||
if (firstKey != null && !firstKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey)) {
|
||||
int[] tempBt;
|
||||
int x = 0;
|
||||
tempBt = bt;
|
||||
@@ -138,7 +138,7 @@ public class DesUtils {
|
||||
String tempData = data.substring(i * 4 + 0, i * 4 + 4);
|
||||
int[] tempByte = strToBt(tempData);
|
||||
int[] encByte = null;
|
||||
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) {
|
||||
int[] tempBt;
|
||||
int x, y, z;
|
||||
tempBt = tempByte;
|
||||
@@ -153,7 +153,7 @@ public class DesUtils {
|
||||
}
|
||||
encByte = tempBt;
|
||||
} else {
|
||||
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) {
|
||||
int[] tempBt;
|
||||
int x, y;
|
||||
tempBt = tempByte;
|
||||
@@ -165,7 +165,7 @@ public class DesUtils {
|
||||
}
|
||||
encByte = tempBt;
|
||||
} else {
|
||||
if (firstKey != null && !firstKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey)) {
|
||||
int[] tempBt;
|
||||
int x;
|
||||
tempBt = tempByte;
|
||||
@@ -182,7 +182,7 @@ public class DesUtils {
|
||||
String remainderData = data.substring(iterator * 4 + 0, leng);
|
||||
int[] tempByte = strToBt(remainderData);
|
||||
int[] encByte = null;
|
||||
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) {
|
||||
int[] tempBt;
|
||||
int x, y, z;
|
||||
tempBt = tempByte;
|
||||
@@ -197,7 +197,7 @@ public class DesUtils {
|
||||
}
|
||||
encByte = tempBt;
|
||||
} else {
|
||||
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) {
|
||||
int[] tempBt;
|
||||
int x, y;
|
||||
tempBt = tempByte;
|
||||
@@ -209,7 +209,7 @@ public class DesUtils {
|
||||
}
|
||||
encByte = tempBt;
|
||||
} else {
|
||||
if (firstKey != null && !firstKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey)) {
|
||||
int[] tempBt;
|
||||
int x;
|
||||
tempBt = tempByte;
|
||||
@@ -237,15 +237,15 @@ public class DesUtils {
|
||||
String decStr = "";
|
||||
List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null;
|
||||
int firstLength = 0, secondLength = 0, thirdLength = 0;
|
||||
if (firstKey != null && !firstKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey)) {
|
||||
firstKeyBt = getKeyBytes(firstKey);
|
||||
firstLength = firstKeyBt.size();
|
||||
}
|
||||
if (secondKey != null && !secondKey.equals("")) {
|
||||
if (secondKey != null && !"".equals(secondKey)) {
|
||||
secondKeyBt = getKeyBytes(secondKey);
|
||||
secondLength = secondKeyBt.size();
|
||||
}
|
||||
if (thirdKey != null && !thirdKey.equals("")) {
|
||||
if (thirdKey != null && !"".equals(thirdKey)) {
|
||||
thirdKeyBt = getKeyBytes(thirdKey);
|
||||
thirdLength = thirdKeyBt.size();
|
||||
}
|
||||
@@ -261,7 +261,7 @@ public class DesUtils {
|
||||
intByte[j] = Integer.parseInt(strByte.substring(j, j + 1));
|
||||
}
|
||||
int[] decByte = null;
|
||||
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey) && thirdKey != null && !"".equals(thirdKey)) {
|
||||
int[] tempBt;
|
||||
int x, y, z;
|
||||
tempBt = intByte;
|
||||
@@ -276,7 +276,7 @@ public class DesUtils {
|
||||
}
|
||||
decByte = tempBt;
|
||||
} else {
|
||||
if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey) && secondKey != null && !"".equals(secondKey)) {
|
||||
int[] tempBt;
|
||||
int x, y, z;
|
||||
tempBt = intByte;
|
||||
@@ -288,7 +288,7 @@ public class DesUtils {
|
||||
}
|
||||
decByte = tempBt;
|
||||
} else {
|
||||
if (firstKey != null && !firstKey.equals("")) {
|
||||
if (firstKey != null && !"".equals(firstKey)) {
|
||||
int[] tempBt;
|
||||
int x, y, z;
|
||||
tempBt = intByte;
|
||||
@@ -382,37 +382,37 @@ public class DesUtils {
|
||||
*/
|
||||
public String bt4ToHex(String binary) {
|
||||
String hex = "";
|
||||
if (binary.equalsIgnoreCase("0000")) {
|
||||
if ("0000".equalsIgnoreCase(binary)) {
|
||||
hex = "0";
|
||||
} else if (binary.equalsIgnoreCase("0001")) {
|
||||
} else if ("0001".equalsIgnoreCase(binary)) {
|
||||
hex = "1";
|
||||
} else if (binary.equalsIgnoreCase("0010")) {
|
||||
} else if ("0010".equalsIgnoreCase(binary)) {
|
||||
hex = "2";
|
||||
} else if (binary.equalsIgnoreCase("0011")) {
|
||||
} else if ("0011".equalsIgnoreCase(binary)) {
|
||||
hex = "3";
|
||||
} else if (binary.equalsIgnoreCase("0100")) {
|
||||
} else if ("0100".equalsIgnoreCase(binary)) {
|
||||
hex = "4";
|
||||
} else if (binary.equalsIgnoreCase("0101")) {
|
||||
} else if ("0101".equalsIgnoreCase(binary)) {
|
||||
hex = "5";
|
||||
} else if (binary.equalsIgnoreCase("0110")) {
|
||||
} else if ("0110".equalsIgnoreCase(binary)) {
|
||||
hex = "6";
|
||||
} else if (binary.equalsIgnoreCase("0111")) {
|
||||
} else if ("0111".equalsIgnoreCase(binary)) {
|
||||
hex = "7";
|
||||
} else if (binary.equalsIgnoreCase("1000")) {
|
||||
} else if ("1000".equalsIgnoreCase(binary)) {
|
||||
hex = "8";
|
||||
} else if (binary.equalsIgnoreCase("1001")) {
|
||||
} else if ("1001".equalsIgnoreCase(binary)) {
|
||||
hex = "9";
|
||||
} else if (binary.equalsIgnoreCase("1010")) {
|
||||
} else if ("1010".equalsIgnoreCase(binary)) {
|
||||
hex = "A";
|
||||
} else if (binary.equalsIgnoreCase("1011")) {
|
||||
} else if ("1011".equalsIgnoreCase(binary)) {
|
||||
hex = "B";
|
||||
} else if (binary.equalsIgnoreCase("1100")) {
|
||||
} else if ("1100".equalsIgnoreCase(binary)) {
|
||||
hex = "C";
|
||||
} else if (binary.equalsIgnoreCase("1101")) {
|
||||
} else if ("1101".equalsIgnoreCase(binary)) {
|
||||
hex = "D";
|
||||
} else if (binary.equalsIgnoreCase("1110")) {
|
||||
} else if ("1110".equalsIgnoreCase(binary)) {
|
||||
hex = "E";
|
||||
} else if (binary.equalsIgnoreCase("1111")) {
|
||||
} else if ("1111".equalsIgnoreCase(binary)) {
|
||||
hex = "F";
|
||||
}
|
||||
|
||||
@@ -426,51 +426,51 @@ public class DesUtils {
|
||||
*/
|
||||
public String hexToBt4(String hex) {
|
||||
String binary = "";
|
||||
if (hex.equalsIgnoreCase("0")) {
|
||||
if ("0".equalsIgnoreCase(hex)) {
|
||||
binary = "0000";
|
||||
} else if (hex.equalsIgnoreCase("1")) {
|
||||
} else if ("1".equalsIgnoreCase(hex)) {
|
||||
binary = "0001";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("2")) {
|
||||
if ("2".equalsIgnoreCase(hex)) {
|
||||
binary = "0010";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("3")) {
|
||||
if ("3".equalsIgnoreCase(hex)) {
|
||||
binary = "0011";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("4")) {
|
||||
if ("4".equalsIgnoreCase(hex)) {
|
||||
binary = "0100";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("5")) {
|
||||
if ("5".equalsIgnoreCase(hex)) {
|
||||
binary = "0101";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("6")) {
|
||||
if ("6".equalsIgnoreCase(hex)) {
|
||||
binary = "0110";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("7")) {
|
||||
if ("7".equalsIgnoreCase(hex)) {
|
||||
binary = "0111";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("8")) {
|
||||
if ("8".equalsIgnoreCase(hex)) {
|
||||
binary = "1000";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("9")) {
|
||||
if ("9".equalsIgnoreCase(hex)) {
|
||||
binary = "1001";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("A")) {
|
||||
if ("A".equalsIgnoreCase(hex)) {
|
||||
binary = "1010";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("B")) {
|
||||
if ("B".equalsIgnoreCase(hex)) {
|
||||
binary = "1011";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("C")) {
|
||||
if ("C".equalsIgnoreCase(hex)) {
|
||||
binary = "1100";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("D")) {
|
||||
if ("D".equalsIgnoreCase(hex)) {
|
||||
binary = "1101";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("E")) {
|
||||
if ("E".equalsIgnoreCase(hex)) {
|
||||
binary = "1110";
|
||||
}
|
||||
if (hex.equalsIgnoreCase("F")) {
|
||||
if ("F".equalsIgnoreCase(hex)) {
|
||||
binary = "1111";
|
||||
}
|
||||
return binary;
|
||||
|
||||
@@ -4,23 +4,14 @@
|
||||
*/
|
||||
package com.jeesite.common.collect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
|
||||
import com.jeesite.common.callback.MethodCallback;
|
||||
import com.jeesite.common.lang.ObjectUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.reflect.ReflectUtils;
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* List工具类
|
||||
@@ -346,27 +337,38 @@ public class ListUtils extends org.apache.commons.collections.ListUtils {
|
||||
* @author ThinkGem
|
||||
*/
|
||||
public static <T> void pageList(List<T> list, int pageSize, MethodCallback pageCallback){
|
||||
if (list != null && list.size() > 0){
|
||||
if (list == null || pageSize == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int count = list.size(), pageNo = 1;
|
||||
int totalPage = (count + pageSize - 1) / pageSize;
|
||||
|
||||
while(true){
|
||||
int count = list.size();
|
||||
|
||||
// 执行回调,分页后的数据
|
||||
List<T> pageList = getPageList(list, pageNo, pageSize, totalPage);
|
||||
if (pageList.size() > 0){
|
||||
pageCallback.execute(pageList, pageNo, pageSize, totalPage);
|
||||
}
|
||||
|
||||
// 如果为最后一页,则跳出循环
|
||||
if (pageNo >= totalPage){
|
||||
break;
|
||||
}
|
||||
|
||||
// 页数加一继续下一页
|
||||
pageNo++;
|
||||
if (count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (count <= pageSize) {
|
||||
pageCallback.execute(list, 1, pageSize, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
int pageNo = 1, totalPage = (count + pageSize - 1) / pageSize;
|
||||
|
||||
while(true){
|
||||
|
||||
// 执行回调,分页后的数据
|
||||
List<T> pageList = getPageList(list, pageNo, pageSize, totalPage);
|
||||
if (pageList.size() > 0){
|
||||
pageCallback.execute(pageList, pageNo, pageSize, totalPage);
|
||||
}
|
||||
|
||||
// 如果为最后一页,则跳出循环
|
||||
if (pageNo >= totalPage){
|
||||
break;
|
||||
}
|
||||
|
||||
// 页数加一继续下一页
|
||||
pageNo++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -655,7 +655,12 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
|
||||
*/
|
||||
public static String getContentType(String fileName) {
|
||||
if (mimetypesFileTypeMap == null){
|
||||
mimetypesFileTypeMap = new MimetypesFileTypeMap();
|
||||
try {
|
||||
mimetypesFileTypeMap = new MimetypesFileTypeMap(ResourceUtils
|
||||
.getResourceFileStream("/META-INF/jeesite.mime.types"));
|
||||
}catch (IOException e) {
|
||||
mimetypesFileTypeMap = new MimetypesFileTypeMap();
|
||||
}
|
||||
}
|
||||
return mimetypesFileTypeMap.getContentType(fileName);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public class PropertiesUtils {
|
||||
YamlPropertiesFactoryBean bean = new YamlPropertiesFactoryBean();
|
||||
bean.setResources(resource);
|
||||
for (Map.Entry<Object,Object> entry : bean.getObject().entrySet()){
|
||||
properties.put(ObjectUtils.toString(entry.getKey()),
|
||||
properties.put(getStandardKey(ObjectUtils.toString(entry.getKey())),
|
||||
ObjectUtils.toString(entry.getValue()));
|
||||
}
|
||||
configSet.add(location);
|
||||
@@ -181,7 +181,7 @@ public class PropertiesUtils {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
String value = properties.getProperty(key);
|
||||
String value = properties.getProperty(getStandardKey(key));
|
||||
if (value != null){
|
||||
Matcher m = p1.matcher(value);
|
||||
while(m.find()) {
|
||||
@@ -231,6 +231,30 @@ public class PropertiesUtils {
|
||||
return ObjectUtils.toLong(getProperty(key, defValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取标准key,去减号并将后一个字母转换为大写
|
||||
* @author Think Gem
|
||||
*/
|
||||
private String getStandardKey(String key) {
|
||||
if (key.startsWith("spring.shardingsphere.")) {
|
||||
return key;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
boolean upperCase = false;
|
||||
for (int i = 0; i < key.length(); i++) {
|
||||
char c = key.charAt(i);
|
||||
if (c == '-') {
|
||||
upperCase = true;
|
||||
} else if (upperCase) {
|
||||
sb.append(Character.toUpperCase(c));
|
||||
upperCase = false;
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置环境属性
|
||||
* @param environment
|
||||
|
||||
@@ -171,7 +171,7 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
return ObjectUtils.serializeFst(object);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("serialize", e.getMessage());
|
||||
logger.error("serialize: {}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
return ObjectUtils.unserializeFst(bytes);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("unserialize", e.getMessage());
|
||||
logger.error("unserialize: {}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -214,7 +214,7 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
}
|
||||
long totalTime = System.currentTimeMillis() - beginTime;
|
||||
if (totalTime > 30000){
|
||||
logger.warn(object.getClass() + " serialize time: " + TimeUtils.formatDateAgo(totalTime));
|
||||
logger.warn(object.getClass() + " serialize time: " + TimeUtils.formatTime(totalTime));
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
@@ -240,13 +240,14 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
}
|
||||
long totalTime = System.currentTimeMillis() - beginTime;
|
||||
if (totalTime > 30000 && object != null){
|
||||
logger.warn(object.getClass() + " unserialize time: " + TimeUtils.formatDateAgo(totalTime));
|
||||
logger.warn(object.getClass() + " unserialize time: " + TimeUtils.formatTime(totalTime));
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
private static ThreadLocal<FSTConfiguration> fstConfiguration =
|
||||
new NamedThreadLocal<FSTConfiguration>("FSTConfiguration") {
|
||||
@Override
|
||||
public FSTConfiguration initialValue() {
|
||||
return FSTConfiguration.createDefaultConfiguration();
|
||||
}
|
||||
@@ -265,7 +266,7 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
byte[] bytes = fstConfiguration.get().asByteArray(object);
|
||||
long totalTime = System.currentTimeMillis() - beginTime;
|
||||
if (totalTime > 30000){
|
||||
logger.warn(object.getClass() + " fst serialize time: " + TimeUtils.formatDateAgo(totalTime));
|
||||
logger.warn(object.getClass() + " fst serialize time: " + TimeUtils.formatTime(totalTime));
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
@@ -283,7 +284,7 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
|
||||
Object object = fstConfiguration.get().asObject(bytes);
|
||||
long totalTime = System.currentTimeMillis() - beginTime;
|
||||
if (totalTime > 30000 && object != null){
|
||||
logger.warn(object.getClass() + " fst unserialize time: " + TimeUtils.formatDateAgo(totalTime));
|
||||
logger.warn(object.getClass() + " fst unserialize time: " + TimeUtils.formatTime(totalTime));
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,31 @@ import java.util.Date;
|
||||
*/
|
||||
public class TimeUtils {
|
||||
|
||||
public static final String[] CN = new String[] {"毫秒", "秒", "分", "时", "天"};
|
||||
public static final String[] EN = new String[] {" millisecond ", " second", " minute", " hour", " day"};
|
||||
|
||||
public static final String[] AGO_CN = new String[] {"刚刚", "秒前", "分钟前", "小时前", "天前"};
|
||||
public static final String[] AGO_EN = new String[] {"just now", " seconds ago", " minutes ago", " hours ago", " days ago"};
|
||||
|
||||
/**
|
||||
* 将毫秒数转换为:xx天,xx时,xx分,xx秒(v5.1 替换为 formatTime)
|
||||
*/
|
||||
@Deprecated
|
||||
public static String formatDateAgo(long millisecond) {
|
||||
return formatTime(millisecond, CN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将毫秒数转换为:xx天,xx时,xx分,xx秒
|
||||
*/
|
||||
public static String formatDateAgo(long millisecond) {
|
||||
public static String formatTime(long millisecond) {
|
||||
return formatTime(millisecond, CN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将毫秒数转换为:xx天,xx时,xx分,xx秒
|
||||
*/
|
||||
public static String formatTime(long millisecond, String[] lang) {
|
||||
long ms = millisecond;
|
||||
int ss = 1000;
|
||||
int mi = ss * 60;
|
||||
@@ -28,19 +49,19 @@ public class TimeUtils {
|
||||
long second = (ms - day * dd - hour * hh - minute * mi) / ss;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (ms >= 0 && ms < 1000) {
|
||||
sb.append(ms).append("毫秒");
|
||||
sb.append(ms).append(lang[0]);
|
||||
} else {
|
||||
if (day > 0) {
|
||||
sb.append(day).append("天");
|
||||
sb.append(day).append(lang[4]);
|
||||
}
|
||||
if (hour > 0) {
|
||||
sb.append(hour).append("时");
|
||||
sb.append(hour).append(lang[3]);
|
||||
}
|
||||
if (minute > 0) {
|
||||
sb.append(minute).append("分");
|
||||
sb.append(minute).append(lang[2]);
|
||||
}
|
||||
if (second > 0) {
|
||||
sb.append(second).append("秒");
|
||||
sb.append(second).append(lang[1]);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
@@ -57,32 +78,39 @@ public class TimeUtils {
|
||||
* 将过去的时间转为为,刚刚,xx秒,xx分钟,xx小时前、xx天前,大于3天的显示日期
|
||||
*/
|
||||
public static String formatTimeAgo(Date dateTime) {
|
||||
return formatTimeAgo(dateTime, AGO_CN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将过去的时间转为为,刚刚,xx秒,xx分钟,xx小时前、xx天前,大于3天的显示日期
|
||||
*/
|
||||
public static String formatTimeAgo(Date dateTime, String[] lang) {
|
||||
String interval = null;
|
||||
// 得出的时间间隔是毫秒
|
||||
long time = System.currentTimeMillis() - dateTime.getTime();
|
||||
// 如果时间间隔小于10秒则显示“刚刚”time/10得出的时间间隔的单位是秒
|
||||
if (time / 1000 < 10 && time / 1000 >= 0) {
|
||||
interval = "刚刚";
|
||||
interval = lang[0];
|
||||
}
|
||||
// 如果时间间隔大于24小时则显示多少天前
|
||||
else if (time / 3600000 < 24 * 4 && time / 3600000 >= 24) {
|
||||
int d = (int) (time / (3600000 * 24));// 得出的时间间隔的单位是天
|
||||
interval = d + "天前";
|
||||
interval = d + lang[4];
|
||||
}
|
||||
// 如果时间间隔小于24小时则显示多少小时前
|
||||
else if (time / 3600000 < 24 && time / 3600000 >= 1) {
|
||||
int h = (int) (time / 3600000);// 得出的时间间隔的单位是小时
|
||||
interval = h + "小时前";
|
||||
interval = h + lang[3];
|
||||
}
|
||||
// 如果时间间隔小于60分钟则显示多少分钟前
|
||||
else if (time / 60000 < 60 && time / 60000 >= 1) {
|
||||
int m = (int) ((time % 3600000) / 60000);// 得出的时间间隔的单位是分钟
|
||||
interval = m + "分钟前";
|
||||
interval = m + lang[2];
|
||||
}
|
||||
// 如果时间间隔小于60秒则显示多少秒前
|
||||
else if (time / 1000 < 60 && time / 1000 >= 10) {
|
||||
int se = (int) ((time % 60000) / 1000);
|
||||
interval = se + "秒前";
|
||||
interval = se + lang[1];
|
||||
}
|
||||
// 大于3天的,则显示正常的时间,但是不显示秒
|
||||
else {
|
||||
|
||||
@@ -76,7 +76,7 @@ public class WorkDayUtils {
|
||||
* @return
|
||||
*/
|
||||
public String getChineseWeek(Calendar date) {
|
||||
final String dayNames[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
|
||||
final String[] dayNames = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
|
||||
int dayOfWeek = date.get(Calendar.DAY_OF_WEEK);
|
||||
// System.out.println(dayNames[dayOfWeek - 1]);
|
||||
return dayNames[dayOfWeek - 1];
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2005-2012 springside.org.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
*/
|
||||
package com.jeesite.common.mapper;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import javax.xml.bind.annotation.XmlAnyElement;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import com.jeesite.common.lang.ExceptionUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.reflect.ReflectUtils;
|
||||
|
||||
/**
|
||||
* 使用Jaxb2.0实现XML<->Java Object的Mapper.
|
||||
*
|
||||
* 在创建时需要设定所有需要序列化的Root对象的Class.
|
||||
* 特别支持Root对象是Collection的情形.
|
||||
*
|
||||
* @author calvin
|
||||
* @version 2013-01-15
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class JaxbMapper {
|
||||
|
||||
private static ConcurrentMap<Class, JAXBContext> jaxbContexts = new ConcurrentHashMap<Class, JAXBContext>();
|
||||
|
||||
/**
|
||||
* Java Object->Xml without encoding.
|
||||
*/
|
||||
public static String toXml(Object root) {
|
||||
Class clazz = ReflectUtils.getUserClass(root);
|
||||
return toXml(root, clazz, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Java Object->Xml with encoding.
|
||||
*/
|
||||
public static String toXml(Object root, String encoding) {
|
||||
Class clazz = ReflectUtils.getUserClass(root);
|
||||
return toXml(root, clazz, encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Java Object->Xml with encoding.
|
||||
*/
|
||||
public static String toXml(Object root, Class clazz, String encoding) {
|
||||
try {
|
||||
StringWriter writer = new StringWriter();
|
||||
createMarshaller(clazz, encoding).marshal(root, writer);
|
||||
return writer.toString();
|
||||
} catch (JAXBException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Java Collection->Xml without encoding, 特别支持Root Element是Collection的情形.
|
||||
*/
|
||||
public static String toXml(Collection<?> root, String rootName, Class clazz) {
|
||||
return toXml(root, rootName, clazz, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Java Collection->Xml with encoding, 特别支持Root Element是Collection的情形.
|
||||
*/
|
||||
public static String toXml(Collection<?> root, String rootName, Class clazz, String encoding) {
|
||||
try {
|
||||
CollectionWrapper wrapper = new CollectionWrapper();
|
||||
wrapper.collection = root;
|
||||
|
||||
JAXBElement<CollectionWrapper> wrapperElement = new JAXBElement<CollectionWrapper>(new QName(rootName),
|
||||
CollectionWrapper.class, wrapper);
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
createMarshaller(clazz, encoding).marshal(wrapperElement, writer);
|
||||
|
||||
return writer.toString();
|
||||
} catch (JAXBException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Xml->Java Object.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T fromXml(String xml, Class<T> clazz) {
|
||||
try {
|
||||
StringReader reader = new StringReader(xml);
|
||||
return (T) createUnmarshaller(clazz).unmarshal(reader);
|
||||
} catch (JAXBException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建Marshaller并设定encoding(可为null).
|
||||
* 线程不安全,需要每次创建或pooling。
|
||||
*/
|
||||
public static Marshaller createMarshaller(Class clazz, String encoding) {
|
||||
try {
|
||||
JAXBContext jaxbContext = getJaxbContext(clazz);
|
||||
|
||||
Marshaller marshaller = jaxbContext.createMarshaller();
|
||||
|
||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
||||
|
||||
if (StringUtils.isNotBlank(encoding)) {
|
||||
marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding);
|
||||
}
|
||||
|
||||
return marshaller;
|
||||
} catch (JAXBException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建UnMarshaller.
|
||||
* 线程不安全,需要每次创建或pooling。
|
||||
*/
|
||||
public static Unmarshaller createUnmarshaller(Class clazz) {
|
||||
try {
|
||||
JAXBContext jaxbContext = getJaxbContext(clazz);
|
||||
return jaxbContext.createUnmarshaller();
|
||||
} catch (JAXBException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected static JAXBContext getJaxbContext(Class clazz) {
|
||||
if (clazz == null){
|
||||
throw new RuntimeException("'clazz' must not be null");
|
||||
}
|
||||
JAXBContext jaxbContext = jaxbContexts.get(clazz);
|
||||
if (jaxbContext == null) {
|
||||
try {
|
||||
jaxbContext = JAXBContext.newInstance(clazz, CollectionWrapper.class);
|
||||
jaxbContexts.putIfAbsent(clazz, jaxbContext);
|
||||
} catch (JAXBException ex) {
|
||||
// throw new HttpMessageConversionException("Could not instantiate JAXBContext for class [" + clazz
|
||||
// + "]: " + ex.getMessage(), ex);
|
||||
throw new RuntimeException("Could not instantiate JAXBContext for class [" + clazz
|
||||
+ "]: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
return jaxbContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装Root Element 是 Collection的情况.
|
||||
*/
|
||||
public static class CollectionWrapper {
|
||||
|
||||
@XmlAnyElement
|
||||
protected Collection<?> collection;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class VideoUtils {
|
||||
log.error("视频剪切图片失败", e);
|
||||
}
|
||||
}
|
||||
log.debug("视频剪切图片" + (statusTemp ? "成功" : "失败") + ",用时:" + TimeUtils.formatDateAgo(System.currentTimeMillis() - startTime));
|
||||
log.debug("视频剪切图片" + (statusTemp ? "成功" : "失败") + ",用时:" + TimeUtils.formatTime(System.currentTimeMillis() - startTime));
|
||||
return statusTemp;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public class VideoUtils {
|
||||
}
|
||||
log.debug("删除临时文件");
|
||||
FileUtils.deleteFile(tempFile);
|
||||
log.debug("视频转换" + (statusTemp ? "成功" : "失败") + ",用时:" + TimeUtils.formatDateAgo(System.currentTimeMillis() - startTime));
|
||||
log.debug("视频转换" + (statusTemp ? "成功" : "失败") + ",用时:" + TimeUtils.formatTime(System.currentTimeMillis() - startTime));
|
||||
return statusTemp;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public class VideoUtils {
|
||||
command.add(getFfmpegFile());
|
||||
command.add("-i");
|
||||
command.add(inputFile);
|
||||
if ((imgFileExtension.toLowerCase()).equals("gif")) {
|
||||
if ("gif".equals(imgFileExtension.toLowerCase())) {
|
||||
command.add("-vframes");
|
||||
command.add("30");
|
||||
command.add("-f");
|
||||
|
||||
@@ -15,9 +15,24 @@ import com.jeesite.common.io.PropertiesUtils;
|
||||
* 发送电子邮件
|
||||
*/
|
||||
public class EmailUtils {
|
||||
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(EmailUtils.class);
|
||||
|
||||
/**
|
||||
* 发送邮件
|
||||
* @return
|
||||
*/
|
||||
public static boolean send(String toAddress, String subject, String content) {
|
||||
PropertiesUtils props = PropertiesUtils.getInstance();
|
||||
String fromAddress = props.getProperty("msg.email.fromAddress");
|
||||
String fromPassword = props.getProperty("msg.email.fromPassword");
|
||||
String fromHostName = props.getProperty("msg.email.fromHostName");
|
||||
Integer smtpPort = props.getPropertyToInteger("msg.email.smtpPort", "25");
|
||||
String sslOnConnect = props.getProperty("msg.email.sslOnConnect", "false");
|
||||
String sslSmtpPort = props.getProperty("msg.email.sslSmtpPort");
|
||||
return send(fromAddress, fromPassword, fromHostName, smtpPort, sslOnConnect, sslSmtpPort, toAddress, subject, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送邮件
|
||||
* @param toAddress 接收地址
|
||||
@@ -25,16 +40,12 @@ public class EmailUtils {
|
||||
* @param content 内容
|
||||
* @return
|
||||
*/
|
||||
public static boolean send(String toAddress, String subject, String content) {
|
||||
PropertiesUtils props = PropertiesUtils.getInstance();
|
||||
String fromAddress = props.getProperty("msg.email.fromAddress");
|
||||
String fromPassword = props.getProperty("msg.email.fromPassword");
|
||||
String fromHostName = props.getProperty("msg.email.fromHostName");
|
||||
String sslOnConnect = props.getProperty("msg.email.sslOnConnect", "false");
|
||||
String sslSmtpPort = props.getProperty("msg.email.sslSmtpPort");
|
||||
return send(fromAddress, fromPassword, fromHostName, sslOnConnect, sslSmtpPort, toAddress, subject, content);
|
||||
@Deprecated
|
||||
public static boolean send(String fromAddress, String fromPassword, String fromHostName,
|
||||
String sslOnConnect, String sslSmtpPort, String toAddress, String subject, String content) {
|
||||
return send(fromAddress, fromPassword, fromHostName, 25, sslOnConnect, sslSmtpPort, toAddress, subject, content);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送邮件
|
||||
* @param toAddress 接收地址
|
||||
@@ -42,16 +53,18 @@ public class EmailUtils {
|
||||
* @param content 内容
|
||||
* @return
|
||||
*/
|
||||
public static boolean send(String fromAddress, String fromPassword, String fromHostName,
|
||||
String sslOnConnect, String sslSmtpPort, String toAddress, String subject, String content) {
|
||||
public static boolean send(String fromAddress, String fromPassword, String fromHostName, Integer smtpPort,
|
||||
String sslOnConnect, String sslSmtpPort, String toAddress, String subject, String content) {
|
||||
try {
|
||||
HtmlEmail htmlEmail = new HtmlEmail();
|
||||
// 发送地址
|
||||
htmlEmail.setFrom(fromAddress);
|
||||
// 密码校验
|
||||
htmlEmail.setAuthentication(fromAddress, fromPassword);
|
||||
// 发送服务器协议
|
||||
// 发送服务器主机名
|
||||
htmlEmail.setHostName(fromHostName);
|
||||
// 发送服务器端口
|
||||
htmlEmail.setSmtpPort(smtpPort);
|
||||
|
||||
// SSL
|
||||
if ("true".equals(sslOnConnect)) {
|
||||
@@ -69,7 +82,7 @@ public class EmailUtils {
|
||||
|
||||
// 其他信息
|
||||
htmlEmail.setCharset(EncodeUtils.UTF_8);
|
||||
|
||||
|
||||
// 发送
|
||||
htmlEmail.send();
|
||||
return true;
|
||||
@@ -78,10 +91,10 @@ public class EmailUtils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// EmailUtils.send("jeesite_demo@163.com", "jeesitedemo1234", "smtp.163.com",
|
||||
// "false", "465", "jeesite_demo@163.com", "测试邮件", "测试<b>邮件</b>的内容");
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -2227,7 +2227,7 @@ public class DiffMatchPatch {
|
||||
if (m.group(2).length() == 0) {
|
||||
patch.start1--;
|
||||
patch.length1 = 1;
|
||||
} else if (m.group(2).equals("0")) {
|
||||
} else if ("0".equals(m.group(2))) {
|
||||
patch.length1 = 0;
|
||||
} else {
|
||||
patch.start1--;
|
||||
@@ -2238,7 +2238,7 @@ public class DiffMatchPatch {
|
||||
if (m.group(4).length() == 0) {
|
||||
patch.start2--;
|
||||
patch.length2 = 1;
|
||||
} else if (m.group(4).equals("0")) {
|
||||
} else if ("0".equals(m.group(4))) {
|
||||
patch.length2 = 0;
|
||||
} else {
|
||||
patch.start2--;
|
||||
|
||||
@@ -123,7 +123,7 @@ public class PinyinUtils {
|
||||
if (input == null){
|
||||
return null;
|
||||
}
|
||||
char c[] = input.toCharArray();
|
||||
char[] c = input.toCharArray();
|
||||
for (int i = 0; i < c.length; i++) {
|
||||
if (c[i] == ' ') {
|
||||
c[i] = '\u3000';
|
||||
|
||||
@@ -24,7 +24,7 @@ public class IdcardUtils extends StringUtils {
|
||||
public static final int CHINA_ID_MAX_LENGTH = 18;
|
||||
|
||||
/** 省、直辖市代码表 */
|
||||
public static final String cityCode[] = { "11", "12", "13", "14", "15",
|
||||
public static final String[] cityCode = { "11", "12", "13", "14", "15",
|
||||
"21", "22", "23", "31", "32", "33", "34", "35", "36", "37", "41",
|
||||
"42", "43", "44", "45", "46", "50", "51", "52", "53", "54", "61",
|
||||
"62", "63", "64", "65", "71", "81", "82", "91" };
|
||||
@@ -177,7 +177,7 @@ public class IdcardUtils extends StringUtils {
|
||||
}
|
||||
String[] cardval = validateIdCard10(card);
|
||||
if (cardval != null) {
|
||||
if (cardval[2].equals("true")) {
|
||||
if ("true".equals(cardval[2])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -272,14 +272,14 @@ public class IdcardUtils extends StringUtils {
|
||||
if (card.length() != 8 && card.length() != 9 && idCard.length() != 10) {
|
||||
return null;
|
||||
}
|
||||
if (idCard.matches("^[a-zA-Z][0-9]{9}$")) { // 台湾
|
||||
if (idCard.matches("^[a-zA-Z][0-9]{9}$")) {
|
||||
info[0] = "台湾";
|
||||
System.out.println("11111");
|
||||
String char2 = idCard.substring(1, 2);
|
||||
if (char2.equals("1")) {
|
||||
if ("1".equals(char2)) {
|
||||
info[1] = "M";
|
||||
System.out.println("MMMMMMM");
|
||||
} else if (char2.equals("2")) {
|
||||
} else if ("2".equals(char2)) {
|
||||
info[1] = "F";
|
||||
System.out.println("FFFFFFF");
|
||||
} else {
|
||||
@@ -289,10 +289,10 @@ public class IdcardUtils extends StringUtils {
|
||||
return info;
|
||||
}
|
||||
info[2] = validateTWCard(idCard) ? "true" : "false";
|
||||
} else if (idCard.matches("^[1|5|7][0-9]{6}\\(?[0-9A-Z]\\)?$")) { // 澳门
|
||||
} else if (idCard.matches("^[1|5|7][0-9]{6}\\(?[0-9A-Z]\\)?$")) {
|
||||
info[0] = "澳门";
|
||||
info[1] = "N";
|
||||
} else if (idCard.matches("^[A-Z]{1,2}[0-9]{6}\\(?[0-9A]\\)?$")) { // 香港
|
||||
} else if (idCard.matches("^[A-Z]{1,2}[0-9]{6}\\(?[0-9A]\\)?$")) {
|
||||
info[0] = "香港";
|
||||
info[1] = "N";
|
||||
info[2] = validateHKCard(idCard) ? "true" : "false";
|
||||
@@ -361,7 +361,7 @@ public class IdcardUtils extends StringUtils {
|
||||
sum = sum + Integer.valueOf(c + "") * iflag;
|
||||
iflag--;
|
||||
}
|
||||
if (end.toUpperCase().equals("A")) {
|
||||
if ("A".equals(end.toUpperCase())) {
|
||||
sum = sum + 10;
|
||||
} else {
|
||||
sum = sum + Integer.valueOf(end);
|
||||
|
||||
@@ -97,7 +97,6 @@ public class ExcelExport implements Closeable{
|
||||
* 构造函数
|
||||
* @param title 表格标题,传“空值”,表示无标题
|
||||
* @param cls 实体对象,通过annotation.ExportField获取标题
|
||||
* @param type 导出类型(1:导出数据)
|
||||
*/
|
||||
public ExcelExport(String title, Class<?> cls){
|
||||
this(title, cls, Type.EXPORT);
|
||||
|
||||
@@ -168,7 +168,7 @@ public abstract class ExcelReader extends DefaultHandler {
|
||||
// 将单元格内容加入rowlist中,在这之前先去掉字符串前后的空白符
|
||||
} else if ("v".equals(name)) {
|
||||
String value = lastContents.trim();
|
||||
value = value.equals("") ? " " : value;
|
||||
value = "".equals(value) ? " " : value;
|
||||
try {
|
||||
// 日期格式处理
|
||||
if (dateFlag) {
|
||||
@@ -188,7 +188,7 @@ public abstract class ExcelReader extends DefaultHandler {
|
||||
curCol++;
|
||||
} else {
|
||||
// 如果标签名称为 row ,这说明已到行尾,调用 optRows() 方法
|
||||
if (name.equals("row")) {
|
||||
if ("row".equals(name)) {
|
||||
getRows(sheetIndex + 1, curRow, rowList);
|
||||
rowList.clear();
|
||||
curRow++;
|
||||
|
||||
@@ -23,6 +23,7 @@ public class MoneyType implements FieldType {
|
||||
/**
|
||||
* 获取对象值(导入)
|
||||
*/
|
||||
@Override
|
||||
public Object getValue(String val) {
|
||||
return val == null ? StringUtils.EMPTY : StringUtils.replace(val, ",", StringUtils.EMPTY);
|
||||
}
|
||||
@@ -30,6 +31,7 @@ public class MoneyType implements FieldType {
|
||||
/**
|
||||
* 获取对象值(导出)
|
||||
*/
|
||||
@Override
|
||||
public String setValue(Object val) {
|
||||
return val == null ? StringUtils.EMPTY : nf.format(val);
|
||||
}
|
||||
@@ -37,6 +39,7 @@ public class MoneyType implements FieldType {
|
||||
/**
|
||||
* 获取对象值格式(导出)
|
||||
*/
|
||||
@Override
|
||||
public String getDataFormat() {
|
||||
return "0.00";
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ public class BookMark {
|
||||
// Get the first node and catch it's reference for return if
|
||||
// the first child node is a style node (w:rPr).
|
||||
childNode = parentNode.getFirstChild();
|
||||
if (childNode != null && childNode.getNodeName().equals("w:rPr")) {
|
||||
if (childNode != null && "w:rPr".equals(childNode.getNodeName())) {
|
||||
styleNode = childNode;
|
||||
} else {
|
||||
// If the first node was not a style node and there are other
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* http://jeesite.com
|
||||
*/
|
||||
a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sortable {
|
||||
color: #42a4e0;
|
||||
}
|
||||
.main-header .navbar {
|
||||
background: #1a1a1a;
|
||||
}
|
||||
.main-header .navbar .nav > li > a {
|
||||
color: #b9b9b9;
|
||||
}
|
||||
.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.3);
|
||||
color: #f6f6f6;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle {
|
||||
color: #ffffff;
|
||||
}
|
||||
.main-header .navbar .sidebar-toggle:hover {
|
||||
color: #f6f6f6;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.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: transparent;
|
||||
color: #fff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.main-header .logo:hover {
|
||||
background-color: #000;
|
||||
}
|
||||
.main-header li.user-header {
|
||||
background-color: #000;
|
||||
}
|
||||
.content-header {
|
||||
background: transparent;
|
||||
}
|
||||
.sidebar,
|
||||
.left-side {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
.content-wrapper,
|
||||
.main-footer {
|
||||
border-left: 1px solid #303030;
|
||||
}
|
||||
.user-panel > .info,
|
||||
.user-panel > .info > a {
|
||||
color: #eee;
|
||||
}
|
||||
.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: #1a1a1a;
|
||||
}
|
||||
.sidebar-menu > li > a {
|
||||
border-left: 3px solid transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
.sidebar-menu > li:hover > a,
|
||||
.sidebar-menu > li.active > a {
|
||||
color: #cccccc;
|
||||
background: #1a1a1a;
|
||||
}
|
||||
.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: #1a1a1a;
|
||||
}
|
||||
.sidebar a {
|
||||
color: #d3d3d3;
|
||||
}
|
||||
.sidebar a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.treeview-menu > li > a {
|
||||
color: #d3d3d3;
|
||||
}
|
||||
.treeview-menu > li.active > a,
|
||||
.treeview-menu > li > a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.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: #303030;
|
||||
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: #303030;
|
||||
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: #303030;
|
||||
border-radius: 4px;
|
||||
background-color: #1a1a1a;
|
||||
color: #ddd;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo {
|
||||
background-color: #1e5edb;
|
||||
color: #fff;
|
||||
border-bottom: 0 solid transparent;
|
||||
}
|
||||
.skin-blue.layout-top-nav .main-header > .logo:hover {
|
||||
background-color: #3b8ab8;
|
||||
}
|
||||
|
||||
.sidebar-menu {padding:0 8px 0 7px;}
|
||||
.sidebar-menu li>a>.pull-right-container {left:0;}
|
||||
.sidebar-menu .treeview-item.active>a {color: #fff;background-color:#2975bc;border-right:0;border-radius:6px;}
|
||||
|
||||
/* 页签添加内边距 */
|
||||
.content-wrapper, .tabpanel_content, .tabpanel_content .html_content, body {background-color:#000;}
|
||||
.box-main, .nav-main, .ui-layout-pane, iframe {border-radius:5px;}
|
||||
.tabpanel_content .html_content {padding:14px 14px 13px 15px;}
|
||||
.tabpanel_tab_content {border-bottom:0;}
|
||||
.ui-layout-resizer {background:none;}
|
||||
.content {padding:0!important}
|
||||
|
||||
/* 页签-无界风格 */
|
||||
.tabpanel_mover li {height:26px;padding:2px 16px 2px 3px;margin:11px 0 0px 9px;border:0;border-radius:4px;background:#1a1a1a;}
|
||||
.tabpanel_mover li .title {padding-left:0;text-align:center;color:#ddd;}
|
||||
.tabpanel_mover li.active {background-color:#2975bc;}
|
||||
.tabpanel_mover li.active div {color:#fff;}
|
||||
.tabpanel_mover li .closer {font:11px/1 FontAwesome;top:6px;right:4px;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:transparent;border-bottom-color:#eeeeee;overflow:visible;}
|
||||
.tabpanel_tab_content .tabpanel_left_scroll, .tabpanel_tab_content .tabpanel_right_scroll {top:12px;}
|
||||
.tabpanel_tab_content .tabpanel_mover {margin:0 5px;}
|
||||
|
||||
/* 页签-下划线风格
|
||||
.tabpanel_mover li {background:#fff;border:0;padding:5px 16px 5px 3px;}
|
||||
.tabpanel_mover li .title {padding-left:0;text-align:center;}
|
||||
.tabpanel_mover li.active {background-color:#fff;border-bottom:2px solid #3aa0ff;}
|
||||
.tabpanel_mover li.active div {color:#0975d9;}
|
||||
.tabpanel_mover li .closer {background:none;font:11px/1 FontAwesome;opacity:0.6;right:3px;top:10px;}
|
||||
.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 {height:32px;line-height:32px;border:0;background-color:#fff;overflow:visible;}
|
||||
.tabpanel_tab_content .tabpanel_move_content {min-height:32px;}
|
||||
.tabpanel_tab_content .tabpanel_left_scroll, .tabpanel_tab_content .tabpanel_right_scroll {top:4px;} */
|
||||
|
||||
#page-loading {color:#ddd;border-color:#505050;background:#343434;padding:7px}
|
||||
::-webkit-scrollbar {background:#2a2a2a;}
|
||||
::-webkit-scrollbar-thumb {background:#6a6a6a;}
|
||||
|
||||
.btn-default {background-color:#323232;border-color:#323232;color:#b5b5b5;}
|
||||
.btn-default.active, .btn-default:active {background-color:#3e3e3e;border-color:#3e3e3e;color:#dfdfdf;}
|
||||
.btn-default:hover, .btn-default:active, .btn-default.hover, .btn-default:focus,
|
||||
.btn-default.active.focus, .btn-default.active:focus, .btn-default.active:hover, .btn-default:active.focus,
|
||||
.btn-default:active:focus, .btn-default:active:hover, .open>.dropdown-toggle.btn-default.focus,
|
||||
.open>.dropdown-toggle.btn-default:focus, .open>.dropdown-toggle.btn-default:hover {
|
||||
background-color:#3e3e3e;border-color:#3e3e3e;color:#eee;}
|
||||
.input-group-btn .btn, .treeSearchInput button, .treeSearchInput button:hover, .treeSearchInput button:focus {
|
||||
background-color:#1a1a1a;border-color:#3c3c3c;color:#ddd;}
|
||||
.treeExpandCollapse, .treeExpandCollapse a {background-color:#1a1a1a;color:#8d8d8d;}
|
||||
|
||||
.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:#2975bc;}
|
||||
.form-unit {border-bottom:1px solid #4e4e4e;}
|
||||
|
||||
.form-inline .form-more {background-color:#1a1a1a;border-bottom-color:#393939;}
|
||||
.form-control, .input-group .input-group-addon, input, select, textarea, pre {background-color:#1a1a1a;border-color:#414141!important;color:#ddd}
|
||||
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {background-color:#2a2a2a;}
|
||||
.select2-container .select2-selection--single, .select2-container .select2-selection--multiple,
|
||||
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single,
|
||||
.select2-container--default .select2-selection--multiple {background-color:#1a1a1a!important;border-color:#383838;color:#ddd}
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {color:#ddd}
|
||||
.treeselect .form-control, .form-control.laydate {background-color:#1a1a1a!important;color:#ddd}
|
||||
.select2-dropdown {background-color:#1a1a1a;border-color:#414141!important;color:#ddd;}
|
||||
.select2-container--default .select2-results__option[aria-selected=true] {background-color:#3c3c3c;color:#ddd;}
|
||||
|
||||
.navbar-custom-menu>.navbar-nav>li>.dropdown-menu,
|
||||
.main-header .navbar .dropdown-menu li.divider {background-color:#1a1a1a;border-color:#414141!important;}
|
||||
.main-header .navbar .dropdown-menu li a {color:#ddd!important;}
|
||||
.main-header .navbar .dropdown-menu li a:hover {background: #4c4c4c!important;}
|
||||
.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a {border-color:#414141!important;}
|
||||
.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>h4 {color:#ddd!important;}
|
||||
.navbar-nav>.messages-menu>.dropdown-menu>li.header,.main-header .navbar .dropdown-menu li a,
|
||||
.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a, .navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,
|
||||
.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a {background-color:#1a1a1a!important;border-color:#414141!important;color:#c6c6c6!important;}
|
||||
|
||||
.error-page > .error-content, .error-page > .copyright {color:#9d9d9d;}
|
||||
.sort-highlight, .tags-input {background:#262626;border-color:#4e4e4e;}
|
||||
.todo-list>li {background:#262626;color:#ddd;border-left-color:#4e4e4e;}
|
||||
.alert-default {background:#1a1a1a;border-color:#3c3c3c;color:#7c7c7c;}
|
||||
.strength .strength_meter {border-color:#3c3c3c!important;}
|
||||
.bg-teal-gradient {background:#34b3b3!important;}
|
||||
.info-box {background:#1a1a1a;color:#ddd;}
|
||||
|
||||
.box, .nav-tabs-custom {background:#1a1a1a!important;color:#ddd!important;box-shadow:none;}
|
||||
.box-trees {background:#2a2a2a!important;}
|
||||
.box-header, .nav-tabs-custom>.nav-tabs>li.header {color:#c8c8c8;}
|
||||
.box-header.with-border {border-bottom-color:#3a3a3a;}
|
||||
.box-footer {background-color:#282828;border-top:#3c3c3c;}
|
||||
.box-footer .knob-label {background:#282828;color:#ddd;}
|
||||
.box-main>.box-header, .nav-main>.nav-tabs {border-bottom-color:#3a3a3a;color:#ddd}
|
||||
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {border-bottom-color:#1a1a1a;}
|
||||
.nav-tabs-custom>.tab-content {background-color:#1a1a1a;color:#ddd;}
|
||||
.nav-tabs-custom>.nav-tabs {border-bottom-color:#3a3a3a;}
|
||||
.nav-tabs-custom>.nav-tabs>li>a {color:#8d8d8d;}
|
||||
.nav-tabs-custom>.nav-tabs>li.active>a {border-right-color:#3a3a3a;border-left-color:#3a3a3a;}
|
||||
.nav-tabs-custom>.nav-tabs>li.active>a, .nav-tabs-custom>.nav-tabs>li.active:hover>a {background-color:#1a1a1a;color:#ddd;}
|
||||
.nav-tabs-custom>.nav-tabs>li:first-of-type.active>a,
|
||||
.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type.active>a {border-left-color:#3a3a3a;}
|
||||
.nav-main>.nav-tabs>li>a:hover {color:#ddd;}
|
||||
.box-main>.box-header .box-title .fa {color:#2975bc;}
|
||||
.nav-tabs-custom>.nav-tabs>li.active {border-top-color:#3aa0ff;}
|
||||
.nav-main>.nav-tabs.pull-right>li:first-of-type.active>a {border-color:#3c3c3c;}
|
||||
.form-control:focus,.select2-container--default.select2-container--focus .select2-selection--multiple,
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field,
|
||||
.select2-container--default.select2-container--focus .select2-selection--single,
|
||||
.select2-container--default.select2-container--focus .select2-selection--multiple {border-color:#40a9ff!important;box-shadow:0 0 0 2px rgba(24,144,255,.2);}
|
||||
.table thead tr, .ui-jqgrid-htable thead tr, .ui-jqgrid-hdiv, .ui-jqgrid-hbox {background-color: #1f1f1f;color:#b3b3b3;}
|
||||
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {border-color:#3e3e3e;}
|
||||
.table-striped>tbody>tr:nth-of-type(odd) {background-color:#262626;}
|
||||
.table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th {background-color:#323232;}
|
||||
.ui-jqgrid .ui-jqgrid-labels th, .ui-jqgrid tr.ui-row-ltr td, .ui-jqgrid tr.ui-row-rtl td, .ui-jqgrid tr.ui-row-ltr td:last-child,
|
||||
.ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column,
|
||||
.ui-jqgrid.ui-widget-content, .ui-jqgrid .ui-widget-content {border-color:#333;}
|
||||
.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:#222;}
|
||||
.ui-jqgrid tr.ui-state-highlight.ui-row-ltr td {background-color:#1f1f1f;}
|
||||
/* .ui-jqgrid tr.ui-row-ltr td {border-right:0!important;} 解开注释,可去除表格单元格的竖边框线 */
|
||||
.ui-jqgrid .ui-jqgrid-frozen .ui-jqgrid-htable th div {height:46px!important;}
|
||||
.ui-jqgrid .ui-jqgrid-htable th div {padding:15px 0 15px 2px;}
|
||||
.ui-jqgrid tr.jqgrow td {height: 49px;}
|
||||
|
||||
.ui-jqgrid .frozen-left th.ui-th-ltr, .ui-jqgrid .frozen-left tr.ui-row-ltr td {border-right-color:#333}
|
||||
.ui-jqgrid .frozen-right th.ui-th-ltr, .ui-jqgrid .frozen-right tr.ui-row-ltr td {border-left-color:#333}
|
||||
.ui-jqgrid tr.jqgroup td, .ui-jqgrid tr.footrow td, .ui-jqgrid tr.jqfoot td {background:#323232;}
|
||||
.ui-jqgrid .actions .moreItems {background:#1a1a1a;border-color:#3c3c3c;box-shadow:none;}
|
||||
.ui-jqgrid .actions .moreItems a {color:#ddd;}
|
||||
.ui-jqgrid .editgrid tr.ui-state-hover.ui-row-ltr td,
|
||||
.ui-jqgrid .editgrid tr.ui-state-highlight.ui-row-ltr td {background-color:#1a1a1a!important;}
|
||||
|
||||
.ui-jqgrid .ui-priority-secondary {background-color:#111;}
|
||||
.ui-widget-content {background-color:#1a1a1a;}
|
||||
|
||||
.pagination>li>a, .pagination>li>span {background:#262626;color:#ddd;border-color:#525252;}
|
||||
.pagination>li>a:focus, .pagination>li>a:hover, .pagination>li>span:focus, .pagination>li>span:hover,
|
||||
.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span,
|
||||
.pagination>.active>span:focus, .pagination>.active>span:hover {background:#3aa0ff;color:#fff;border-color:#3aa0ff;}
|
||||
.pagination>.disabled>a, .pagination>.disabled>a:focus, .pagination>.disabled>a:hover, .pagination>.disabled>span,
|
||||
.pagination>.disabled>span:focus, .pagination>.disabled>span:hover {background:#262626;color:#747474;border-color:#525252;}
|
||||
|
||||
.table-form input, .table-form select, .table-form textarea,
|
||||
.table-form .form-control, .table-form .select2-selection,
|
||||
.table-form .form-control:focus, .table-form .select2-container--default.select2-container--focus .select2-selection--single,
|
||||
.table-form .select2-container--default.select2-container--focus .select2-selection--multiple {border-bottom-color:#494949}
|
||||
.table-form .ui-jqgrid tr.ui-row-ltr td input,
|
||||
.table-form .ui-jqgrid tr.ui-row-ltr td select,
|
||||
.table-form .ui-jqgrid tr.ui-row-ltr td textarea,
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight.ui-row-ltr td,
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight.ui-row-ltr td input,
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight.ui-row-ltr td select,
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight.ui-row-ltr td textarea,
|
||||
.table-form .ui-jqgrid tr.ui-row-ltr.ui-priority-secondary td input,
|
||||
.table-form .ui-jqgrid tr.ui-row-ltr.ui-priority-secondary td select,
|
||||
.table-form .ui-jqgrid tr.ui-row-ltr.ui-priority-secondary td textarea,
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight.ui-row-ltr.ui-priority-secondary td,
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight.ui-row-ltr.ui-priority-secondary td input,
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight.ui-row-ltr.ui-priority-secondary td select,
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight.ui-row-ltr.ui-priority-secondary td textarea {color:#ddd!important;}
|
||||
.table-form .ui-jqgrid tr.ui-state-highlight {background-color:#1a1a1a!important;}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
common/src/main/resources/static/icheck/1.0/minimal/dark.png
Normal file
BIN
common/src/main/resources/static/icheck/1.0/minimal/dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
common/src/main/resources/static/icheck/1.0/minimal/dark.psd
Normal file
BIN
common/src/main/resources/static/icheck/1.0/minimal/dark.psd
Normal file
Binary file not shown.
@@ -24,4 +24,7 @@
|
||||
.icheckbox_minimal-grey,
|
||||
.iradio_minimal-grey {background-image:url(grey@2x.png);
|
||||
-webkit-background-size:200px 20px;background-size:200px 20px;}
|
||||
}
|
||||
}
|
||||
|
||||
.skin-dark .icheckbox_minimal-grey,
|
||||
.skin-dark .iradio_minimal-grey {background-image:url(dark.png);}
|
||||
@@ -116,3 +116,8 @@ ul.ztree.zTreeDragUL {margin:0;padding:0;position:absolute;width:auto;height:aut
|
||||
.ztree li span.button.chk[class$="focus"]:before {font-weight:bold;}
|
||||
.ztree li span.button.chk[class$="disable"]:before {color:#aaa;}
|
||||
.ztree li a.curSelectedNode, .ztree li a.tmpTargetNode_inner {height:26px;}
|
||||
|
||||
.skin-dark .ztree li a {color:#ddd}
|
||||
.skin-dark .ztree li span.button:before {color:#aaa}
|
||||
.skin-dark .ztree li a.curSelectedNode {background-color:#2975bc;color:#eee;}
|
||||
.skin-dark .ztree li a.curSelectedNode span.button:before {color:#eee;}
|
||||
|
||||
@@ -1251,7 +1251,7 @@
|
||||
,showBottom: true //是否显示底部栏
|
||||
,isPreview: true //是否显示值预览
|
||||
,btns: ['clear', 'now', 'confirm'] //右下角显示的按钮,会按照数组顺序排列
|
||||
,lang: 'cn' //语言,只支持cn/en,即中文和英文
|
||||
,lang: window.lang || 'zh_CN' //语言,只支持cn/en,即中文和英文
|
||||
,theme: 'default' //主题
|
||||
,position: null //控件定位方式定位, 默认absolute,支持:fixed/absolute/static
|
||||
,calendar: false //是否开启公历重要节日,仅支持中文版
|
||||
@@ -1266,7 +1266,7 @@
|
||||
var that = this
|
||||
,options = that.config
|
||||
,text = {
|
||||
cn: {
|
||||
zh_CN: {
|
||||
weeks: ['日', '一', '二', '三', '四', '五', '六']
|
||||
,time: ['时', '分', '秒']
|
||||
,timeTips: '选择时间'
|
||||
@@ -1303,7 +1303,7 @@
|
||||
,preview: 'The selected result'
|
||||
}
|
||||
};
|
||||
return text[options.lang] || text['cn'];
|
||||
return text[options.lang] || text['zh_CN'];
|
||||
};
|
||||
|
||||
//初始准备
|
||||
|
||||
@@ -169,3 +169,19 @@ html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
||||
.laydate-theme-grid .laydate-year-list>li{height: 43px; line-height: 43px;}
|
||||
.laydate-theme-grid .laydate-month-list>li{height: 71px; line-height: 71px;}
|
||||
|
||||
.skin-dark .layui-laydate,
|
||||
.skin-dark .layui-laydate-hint,
|
||||
.skin-dark .layui-laydate-list,
|
||||
.skin-dark .layui-laydate-footer span,
|
||||
.skin-dark .laydate-time-list li ol {background:#1a1a1a;border-color:#484848;color:#ddd;}
|
||||
.skin-dark .layui-laydate-header {border-bottom-color:#484848;}
|
||||
.skin-dark .layui-laydate-footer {border-top-color:#484848;}
|
||||
.skin-dark .layui-laydate-content th {color:#9c9c9c;}
|
||||
.skin-dark .layui-laydate-content td {color:#aaa;}
|
||||
.skin-dark .layui-laydate-content .laydate-day-prev,
|
||||
.skin-dark .layui-laydate-content .laydate-day-next {color:#5a5a5a}
|
||||
.skin-dark .layui-laydate-footer span {background:transparent;}
|
||||
.skin-dark .layui-laydate-content td:hover,
|
||||
.skin-dark .layui-laydate-list li:hover,
|
||||
.skin-dark .laydate-footer-btns span {background-color:#444;border-color:#444;color:#b5b5b5;}
|
||||
.skin-dark .layui-laydate .laydate-btns-confirm {background-color:#139ce0;border-color:#139ce0;color:#fff;}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 14 KiB |
@@ -150,3 +150,7 @@ html #layuicss-layer{display:none;position:absolute;width:1989px;}
|
||||
.layui-layer-btn .layui-layer-btn0{border-color:#1e5edb;background-color:#1e5edb;}
|
||||
.layui-layer-btn a {height:auto;padding:1px 14px;font-size:14px;background-color:#f4f4f4;}
|
||||
.layui-layer.toast-top-full-width {min-width:60%;}
|
||||
|
||||
.skin-dark .layui-layer {background:#1a1a1a;color:#ddd;}
|
||||
.skin-dark .layui-layer-title {background:#262626;border-bottom-color:#484848;color:#bcbcbc;}
|
||||
.skin-dark .layui-layer-btn a {background-color:#444;border-color:#444;color:#b5b5b5;}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.1-SNAPSHOT</version>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
<properties>
|
||||
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
@@ -30,12 +26,6 @@
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
|
||||
Binary file not shown.
@@ -4,19 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
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.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
@@ -31,8 +18,19 @@ import com.jeesite.modules.cms.entity.Category;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
|
||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 文章表Service
|
||||
@@ -40,7 +38,6 @@ import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
|
||||
@Autowired
|
||||
@@ -120,7 +117,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
* @param article
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateExpiredWeight(Article article) {
|
||||
// 更新过期的权重,间隔为“6”个小时
|
||||
Date updateExpiredWeightDate = CmsUtils.getCache("updateExpiredWeightDateByArticle");
|
||||
@@ -137,7 +134,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
* @param article
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void save(Article article) {
|
||||
Global.assertDemoMode();
|
||||
// 设置内容状态
|
||||
@@ -177,7 +174,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
* @param article
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateStatus(Article article) {
|
||||
super.updateStatus(article);
|
||||
}
|
||||
@@ -185,7 +182,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
/**
|
||||
* 获取文章获取文章并点击数加一
|
||||
*/
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateHitsAddOne(String id) {
|
||||
dao.updateHitsAddOne(id);
|
||||
}
|
||||
@@ -195,7 +192,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
* @param article
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void delete(Article article) {
|
||||
super.delete(article);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
public class CategoryService extends TreeService<CategoryDao, Category> {
|
||||
|
||||
/**
|
||||
@@ -59,7 +58,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
|
||||
* @param category
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void save(Category category) {
|
||||
if (StringUtils.isNotBlank(category.getViewConfig())){
|
||||
category.setViewConfig(StringEscapeUtils.unescapeHtml4(category.getViewConfig()));
|
||||
@@ -85,7 +84,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
|
||||
* @param category
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateStatus(Category category) {
|
||||
super.updateStatus(category);
|
||||
}
|
||||
@@ -95,7 +94,7 @@ public class CategoryService extends TreeService<CategoryDao, Category> {
|
||||
* @param category
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void delete(Category category) {
|
||||
super.delete(category);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class CommentService extends CrudService<CommentDao, Comment> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
|
||||
* @param comment
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Comment comment) {
|
||||
super.save(comment);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
|
||||
* @param comment
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Comment comment) {
|
||||
super.updateStatus(comment);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class CommentService extends CrudService<CommentDao, Comment> {
|
||||
* @param comment
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Comment comment) {
|
||||
super.delete(comment);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.jeesite.modules.sys.entity.DictData;
|
||||
* @version 2020-7-7
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
public class FileTempleteService {
|
||||
|
||||
// public List<String> getTempleteContent(String prefix) throws IOException {
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class ReportService extends CrudService<ReportDao, Report> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
|
||||
* @param report
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Report report) {
|
||||
super.save(report);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
|
||||
* @param report
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Report report) {
|
||||
super.updateStatus(report);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class ReportService extends CrudService<ReportDao, Report> {
|
||||
* @param report
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Report report) {
|
||||
super.delete(report);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
public class SiteService extends CrudService<SiteDao, Site> {
|
||||
|
||||
/**
|
||||
@@ -49,7 +48,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
|
||||
* @param site
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void save(Site site) {
|
||||
super.save(site);
|
||||
CmsUtils.removeCache("siteList");
|
||||
@@ -62,7 +61,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
|
||||
* @param site
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void updateStatus(Site site) {
|
||||
super.updateStatus(site);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
|
||||
* @param site
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void delete(Site site) {
|
||||
super.delete(site);
|
||||
}
|
||||
@@ -82,7 +81,7 @@ public class SiteService extends CrudService<SiteDao, Site> {
|
||||
* @param site
|
||||
* @param isRe
|
||||
*/
|
||||
@Transactional(readOnly = false)
|
||||
@Transactional
|
||||
public void delete(Site site, Boolean isRe) {
|
||||
site.setStatus(isRe != null && isRe ? Site.STATUS_NORMAL : Site.STATUS_DELETE);
|
||||
super.delete(site);
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.jeesite.modules.cms.entity.Tag;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class TagService extends CrudService<TagDao, Tag> {
|
||||
|
||||
/**
|
||||
@@ -47,7 +46,7 @@ public class TagService extends CrudService<TagDao, Tag> {
|
||||
* @param tag
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Tag tag) {
|
||||
super.save(tag);
|
||||
}
|
||||
@@ -57,7 +56,7 @@ public class TagService extends CrudService<TagDao, Tag> {
|
||||
* @param tag
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Tag tag) {
|
||||
super.updateStatus(tag);
|
||||
}
|
||||
@@ -67,7 +66,7 @@ public class TagService extends CrudService<TagDao, Tag> {
|
||||
* @param tag
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Tag tag) {
|
||||
super.delete(tag);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
* @version 2020-7-24
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
|
||||
|
||||
/**
|
||||
@@ -48,7 +47,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
|
||||
* @param visitLog
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(VisitLog visitLog) {
|
||||
super.save(visitLog);
|
||||
// 保存上传图片
|
||||
@@ -62,7 +61,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
|
||||
* @param visitLog
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(VisitLog visitLog) {
|
||||
super.updateStatus(visitLog);
|
||||
}
|
||||
@@ -72,7 +71,7 @@ public class VisitLogService extends CrudService<VisitLogDao, VisitLog> {
|
||||
* @param visitLog
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(VisitLog visitLog) {
|
||||
super.delete(visitLog);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class FrontSearchController extends BaseController{
|
||||
parmas.put("siteCode", siteCode);
|
||||
}
|
||||
page = articleService.searchPage(page, q, qand, qnot, bd, ed, parmas);
|
||||
page.setPageInfo("匹配结果,共耗时 " + TimeUtils.formatDateAgo(System.currentTimeMillis() - start) + "。");
|
||||
page.setPageInfo("匹配结果,共耗时 " + TimeUtils.formatTime(System.currentTimeMillis() - start) + "。");
|
||||
model.addAttribute("page", page);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,4 +9,7 @@
|
||||
4.2.3
|
||||
4.3.0
|
||||
5.0.0
|
||||
5.0.1
|
||||
5.0.1
|
||||
5.0.2
|
||||
5.1.0
|
||||
5.2.0
|
||||
@@ -77,12 +77,11 @@
|
||||
<label class="control-label col-sm-4" title="${text('数值越大排序越靠前,可设置权重过期时间')}。">
|
||||
${text('权重/排序')}: <i class="fa icon-question"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="form-inline">
|
||||
<div class="form-inline m0">
|
||||
<#form:input path="weight" class="form-control width-90 digits" maxlength="10"/>
|
||||
<#form:checkbox id="weightTop" label="${text('置顶')}" value="${article.weight==9999 ?'1' : ''}"
|
||||
class="form-control" style="vertical-align:middle;"/>
|
||||
</div>
|
||||
<span class="help-block"> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@ $('#dataGrid').dataGrid({
|
||||
// {header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
|
||||
{header:'${text("操作")}', name:'actions', width:150, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
<% if(hasPermi('cms:article:edit')){ %>
|
||||
//<% if(hasPermi('cms:article:edit')){ %>
|
||||
actions.push('<a href="${ctx}/cms/article/form?id='+row.id+'" class="btnList" title="${text("编辑文章")}"><i class="fa fa-pencil"></i></a> ');
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctx}/cms/article/disable?id='+row.id+'" class="btnList" title="${text("停用文章")}" data-confirm="${text("确认要停用该文章吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||
@@ -82,7 +82,7 @@ $('#dataGrid').dataGrid({
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctxFront}/view-'+row.category.categoryCode+'-'+row.id+'" target="_blank" title="${text("预览文章")}"><i class="fa fa-globe"></i></a> ');
|
||||
}
|
||||
<% } %>
|
||||
//<% } %>
|
||||
return actions.join('');
|
||||
}}
|
||||
],
|
||||
|
||||
@@ -87,7 +87,7 @@ $('#dataGrid').dataGrid({
|
||||
}},
|
||||
{header:'${text("操作")}', name:'actions', width:150, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
<% if(hasPermi('cms:category:edit')){ %>
|
||||
//<% if(hasPermi('cms:category:edit')){ %>
|
||||
actions.push('<a href="${ctx}/cms/category/form?categoryCode='+row.categoryCode+'" class="btnList" title="${text("编辑栏目表")}"><i class="fa fa-pencil"></i></a> ');
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctx}/cms/category/disable?categoryCode='+row.categoryCode+'" class="btnList" title="${text("停用栏目表")}" data-confirm="${text("确认要停用该栏目表吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||
@@ -100,7 +100,7 @@ $('#dataGrid').dataGrid({
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctxFront}/list-'+row.categoryCode+'" target="_blank" title="${text("访问栏目")}"><i class="fa fa-globe"></i></a> ');
|
||||
}
|
||||
<% } %>
|
||||
//<% } %>
|
||||
return actions.join('');
|
||||
}}
|
||||
],
|
||||
|
||||
@@ -13,43 +13,43 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<#form:form id="searchForm" model="${report}" action="${ctx}/cms/report/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报来源')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportSource" maxlength="1" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报内容')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportContent" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报的URL')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportUrl" maxlength="1000" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报类型')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportType" maxlength="1" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报原因')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportCause" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<#form:form id="searchForm" model="${report}" action="${ctx}/cms/report/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报来源')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportSource" maxlength="1" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报内容')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportContent" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报的URL')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportUrl" maxlength="1000" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报类型')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportType" maxlength="1" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('举报原因')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="reportCause" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
<div id="dataGridPage"></div>
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@ $('#dataGrid').dataGrid({
|
||||
{header:'${text('举报原因')}', name:'reportCause', index:'a.report_cause', width:150, align:"left"},
|
||||
{header:'${text('操作')}', name:'actions', width:120, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
<% if(hasPermi('cms:report:edit')){ %>
|
||||
//<% if(hasPermi('cms:report:edit')){ %>
|
||||
actions.push('<a href="${ctx}/cms/report/form?id='+row.id+'" class="btnList" title="${text('编辑内容举报表')}"><i class="fa fa-pencil"></i></a> ');
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctx}/cms/report/disable?id='+row.id+'" class="btnList" title="${text('停用内容举报表')}" data-confirm="${text('确认要停用该内容举报表吗?')}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||
@@ -79,7 +79,7 @@ $('#dataGrid').dataGrid({
|
||||
actions.push('<a href="${ctx}/cms/report/enable?id='+row.id+'" class="btnList" title="${text('启用内容举报表')}" data-confirm="${text('确认要启用该内容举报表吗?')}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
||||
}
|
||||
actions.push('<a href="${ctx}/cms/report/delete?id='+row.id+'" class="btnList" title="${text('删除内容举报表')}" data-confirm="${text('确认要删除该内容举报表吗?')}"><i class="fa fa-trash-o"></i></a> ');
|
||||
<% } %>
|
||||
//<% } %>
|
||||
return actions.join('');
|
||||
}}
|
||||
],
|
||||
|
||||
@@ -13,37 +13,37 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<#form:form id="searchForm" model="${site}" action="${ctx}/cms/site/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('站点名称')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="siteName" maxlength="100" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('站点标题')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="title" maxlength="100" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('站点域名')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="domain" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('状态')}:</label>
|
||||
<div class="control-inline width-90">
|
||||
<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<#form:form id="searchForm" model="${site}" action="${ctx}/cms/site/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('站点名称')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="siteName" maxlength="100" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('站点标题')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="title" maxlength="100" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('站点域名')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="domain" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('状态')}:</label>
|
||||
<div class="control-inline width-90">
|
||||
<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
<div id="dataGridPage"></div>
|
||||
</div>
|
||||
@@ -69,7 +69,7 @@ $('#dataGrid').dataGrid({
|
||||
{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
|
||||
{header:'${text("操作")}', name:'actions', width:150, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
<% if(hasPermi('cms:site:edit')){ %>
|
||||
//<% if(hasPermi('cms:site:edit')){ %>
|
||||
actions.push('<a href="${ctx}/cms/site/form?siteCode='+row.siteCode+'" class="btnList" title="${text("编辑站点")}"><i class="fa fa-pencil"></i></a> ');
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctx}/cms/site/disable?siteCode='+row.siteCode+'" class="btnList" title="${text("停用站点")}" data-confirm="${text("确认要停用该站点吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||
@@ -81,7 +81,7 @@ $('#dataGrid').dataGrid({
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctxFront}/index-'+row.siteCode+'" target="_blank" title="${text("访问站点")}"><i class="fa fa-globe"></i></a> ');
|
||||
}
|
||||
<% } %>
|
||||
//<% } %>
|
||||
return actions.join('');
|
||||
}}
|
||||
],
|
||||
|
||||
@@ -13,50 +13,50 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<#form:form id="searchForm" model="${visitLog}" action="${ctx}/cms/visitLog/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('请求的URL地址')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="requestUrl" maxlength="1000" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('受访域名')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="requestUrlHost" maxlength="128" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('来源页面/上一个页面')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="sourceReferer" maxlength="1000" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('来源域名')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="sourceRefererHost" maxlength="128" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('搜索的关键词')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="searchWord" maxlength="200" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<#form:form id="searchForm" model="${visitLog}" action="${ctx}/cms/visitLog/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('请求的URL地址')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="requestUrl" maxlength="1000" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('受访域名')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="requestUrlHost" maxlength="128" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('来源页面/上一个页面')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="sourceReferer" maxlength="1000" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('来源域名')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="sourceRefererHost" maxlength="128" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('搜索的关键词')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="searchWord" maxlength="200" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
<div id="dataGridPage"></div>
|
||||
</div>
|
||||
@@ -91,7 +91,7 @@ $('#dataGrid').dataGrid({
|
||||
|
||||
{header:'${text('操作')}', name:'actions', width:120, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
<% if(hasPermi('cms:visitLog:edit')){ %>
|
||||
//<% if(hasPermi('cms:visitLog:edit')){ %>
|
||||
actions.push('<a href="${ctx}/cms/visitLog/form?id='+row.id+'" class="btnList" title="${text('编辑访问日志表')}"><i class="fa fa-pencil"></i></a> ');
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctx}/cms/visitLog/disable?id='+row.id+'" class="btnList" title="${text('停用访问日志表')}" data-confirm="${text('确认要停用该访问日志表吗?')}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||
@@ -100,7 +100,7 @@ $('#dataGrid').dataGrid({
|
||||
actions.push('<a href="${ctx}/cms/visitLog/enable?id='+row.id+'" class="btnList" title="${text('启用访问日志表')}" data-confirm="${text('确认要启用该访问日志表吗?')}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
||||
}
|
||||
actions.push('<a href="${ctx}/cms/visitLog/delete?id='+row.id+'" class="btnList" title="${text('删除访问日志表')}" data-confirm="${text('确认要删除该访问日志表吗?')}"><i class="fa fa-trash-o"></i></a> ');
|
||||
<% } %>
|
||||
//<% } %>
|
||||
return actions.join('');
|
||||
}}
|
||||
],
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.1-SNAPSHOT</version>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -95,12 +95,6 @@
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
|
||||
@@ -4,34 +4,24 @@
|
||||
*/
|
||||
package com.jeesite.autoconfigure.sys;
|
||||
|
||||
import com.jeesite.common.mybatis.MyBatisFactoryBean;
|
||||
import com.jeesite.modules.msg.service.MsgInnerService;
|
||||
import com.jeesite.modules.sys.service.*;
|
||||
import com.jeesite.modules.sys.service.support.*;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.jeesite.common.mybatis.MyBatisFactoryBean;
|
||||
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(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
@ConditionalOnBean(MyBatisFactoryBean.class)
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public class SysAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@@ -76,4 +66,10 @@ public class SysAutoConfiguration {
|
||||
return new PostServiceSupport();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public MsgInnerService msgInnerService(){
|
||||
return new MsgInnerService();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ public class AuthorizingRealm extends BaseAuthorizingRealm {
|
||||
* @param plainPassword 明文密码
|
||||
* @return 16位salt密钥 + 40位hash密码
|
||||
*/
|
||||
@Override
|
||||
public String encryptPassword(String plainPassword) {
|
||||
String plain = EncodeUtils.decodeHtml(plainPassword);
|
||||
byte[] salt = Sha1Utils.genSalt(SALT_SIZE);
|
||||
@@ -85,6 +86,7 @@ public class AuthorizingRealm extends BaseAuthorizingRealm {
|
||||
* @param password 密文密码
|
||||
* @return 验证成功返回true
|
||||
*/
|
||||
@Override
|
||||
public boolean validatePassword(String plainPassword, String password) {
|
||||
try{
|
||||
String plain = EncodeUtils.decodeHtml(plainPassword);
|
||||
|
||||
@@ -27,6 +27,7 @@ public class AreaType implements FieldType {
|
||||
/**
|
||||
* 获取对象值(导入)
|
||||
*/
|
||||
@Override
|
||||
public Object getValue(String val) {
|
||||
for (Area e : list){
|
||||
if (StringUtils.trimToEmpty(val).equals(e.getAreaName())){
|
||||
@@ -39,6 +40,7 @@ public class AreaType implements FieldType {
|
||||
/**
|
||||
* 获取对象值(导出)
|
||||
*/
|
||||
@Override
|
||||
public String setValue(Object val) {
|
||||
if (val != null && ((Area)val).getAreaName() != null){
|
||||
return ((Area)val).getAreaName();
|
||||
|
||||
@@ -27,6 +27,7 @@ public class CompanyType implements FieldType {
|
||||
/**
|
||||
* 获取对象值(导入)
|
||||
*/
|
||||
@Override
|
||||
public Object getValue(String val) {
|
||||
for (Company e : list){
|
||||
if (StringUtils.trimToEmpty(val).equals(e.getCompanyName())){
|
||||
@@ -39,6 +40,7 @@ public class CompanyType implements FieldType {
|
||||
/**
|
||||
* 设置对象值(导出)
|
||||
*/
|
||||
@Override
|
||||
public String setValue(Object val) {
|
||||
if (val != null && ((Company)val).getCompanyName() != null){
|
||||
return ((Company)val).getCompanyName();
|
||||
|
||||
@@ -27,6 +27,7 @@ public class OfficeType implements FieldType {
|
||||
/**
|
||||
* 获取对象值(导入)
|
||||
*/
|
||||
@Override
|
||||
public Object getValue(String val) {
|
||||
for (Office e : list){
|
||||
if (StringUtils.trimToEmpty(val).equals(e.getOfficeName())){
|
||||
@@ -39,6 +40,7 @@ public class OfficeType implements FieldType {
|
||||
/**
|
||||
* 设置对象值(导出)
|
||||
*/
|
||||
@Override
|
||||
public String setValue(Object val) {
|
||||
if (val != null && ((Office)val).getOfficeName() != null){
|
||||
return ((Office)val).getOfficeName();
|
||||
|
||||
@@ -31,6 +31,7 @@ public class PostListType implements FieldType {
|
||||
/**
|
||||
* 获取对象值(导入)
|
||||
*/
|
||||
@Override
|
||||
public Object getValue(String val) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
for (String s : StringUtils.split(val, ",")) {
|
||||
@@ -46,6 +47,7 @@ public class PostListType implements FieldType {
|
||||
/**
|
||||
* 设置对象值(导出)
|
||||
*/
|
||||
@Override
|
||||
public String setValue(Object val) {
|
||||
if (val != null) {
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -31,6 +31,7 @@ public class RoleListType implements FieldType {
|
||||
/**
|
||||
* 获取对象值(导入)
|
||||
*/
|
||||
@Override
|
||||
public Object getValue(String val) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
for (String s : StringUtils.split(val, ",")) {
|
||||
@@ -46,6 +47,7 @@ public class RoleListType implements FieldType {
|
||||
/**
|
||||
* 设置对象值(导出)
|
||||
*/
|
||||
@Override
|
||||
public String setValue(Object val) {
|
||||
if (val != null) {
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSource
|
||||
import org.apache.shiro.web.filter.InvalidRequestFilter;
|
||||
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -52,6 +53,7 @@ import com.jeesite.common.shiro.web.WebSecurityManager;
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public class ShiroConfig {
|
||||
|
||||
/**
|
||||
@@ -62,7 +64,7 @@ public class ShiroConfig {
|
||||
@ConditionalOnMissingBean(name="shiroFilterProxy")
|
||||
public FilterRegistrationBean<Filter> shiroFilterProxy(ShiroFilterFactoryBean shiroFilter) throws Exception {
|
||||
FilterRegistrationBean<Filter> bean = new FilterRegistrationBean<>();
|
||||
bean.setFilter((Filter) shiroFilter.getInstance());
|
||||
bean.setFilter(shiroFilter.getObject());
|
||||
bean.addUrlPatterns("/*");
|
||||
bean.setOrder(Ordered.HIGHEST_PRECEDENCE + 5000);
|
||||
return bean;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.config.web;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* 是否启用默认 Servlet 映射(启用后可访问 webapp 下的静态资源)
|
||||
* @author ThinkGem
|
||||
* @version 2022年4月18日
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnProperty(name="server.servlet.register-default-servlet", havingValue="true", matchIfMissing=false)
|
||||
public class DefaultServletConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
|
||||
configurer.enable();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,14 +4,20 @@
|
||||
*/
|
||||
package com.jeesite.modules.config.web;
|
||||
|
||||
import com.alibaba.druid.support.http.StatViewServlet;
|
||||
import com.alibaba.druid.support.http.WebStatFilter;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
import com.jeesite.common.web.http.ServletUtils;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.alibaba.druid.support.http.StatViewServlet;
|
||||
import com.alibaba.druid.support.http.WebStatFilter;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Druid 配置
|
||||
@@ -44,7 +50,19 @@ public class DruidStatConfig {
|
||||
@Bean
|
||||
public ServletRegistrationBean<StatViewServlet> druidServlet() {
|
||||
ServletRegistrationBean<StatViewServlet> bean = new ServletRegistrationBean<>();
|
||||
bean.setServlet(new StatViewServlet());
|
||||
bean.setServlet(new StatViewServlet(){
|
||||
@Override
|
||||
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
String requestURI = request.getRequestURI();
|
||||
if (requestURI.endsWith("/druid/js/common.js")) {
|
||||
String text = Utils.readFromResource("support/http/resources/js/common.js");
|
||||
text = text.replaceAll("<a.*?banner\"></a><br/>", "JeeSite 数据监控, ");
|
||||
ServletUtils.renderString(response, text, "text/javascript;charset=UTF-8");
|
||||
return;
|
||||
}
|
||||
super.service(request, response);
|
||||
}
|
||||
});
|
||||
bean.addUrlMappings("/druid/*");
|
||||
return bean;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.msg.dao;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.msg.entity.MsgInner;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 内部消息DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.msg.entity.MsgInner;
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface MsgInnerDao extends CrudDao<MsgInner> {
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.msg.dao;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.msg.entity.MsgInnerRecord;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 内部消息发送记录表DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.msg.entity.MsgInnerRecord;
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface MsgInnerRecordDao extends CrudDao<MsgInnerRecord> {
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,18 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.msg.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.callback.MethodCallback;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
@@ -28,25 +16,27 @@ import com.jeesite.modules.msg.dao.MsgInnerRecordDao;
|
||||
import com.jeesite.modules.msg.entity.MsgInner;
|
||||
import com.jeesite.modules.msg.entity.MsgInnerRecord;
|
||||
import com.jeesite.modules.msg.entity.MsgPush;
|
||||
import com.jeesite.modules.msg.entity.content.AppMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.BaseMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.EmailMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.PcMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.SmsMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.*;
|
||||
import com.jeesite.modules.msg.utils.MsgPushUtils;
|
||||
import com.jeesite.modules.sys.entity.EmpUser;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.service.EmpUserService;
|
||||
|
||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 内部消息Service
|
||||
* @author ThinkGem
|
||||
* @version 2019-03-12
|
||||
*/
|
||||
@Service
|
||||
@Transactional(readOnly=true)
|
||||
public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
|
||||
@Autowired
|
||||
@@ -70,8 +60,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param msgInner 查询条件
|
||||
* @param msgInner.page 分页对象
|
||||
* @param msgInner 查询条件;.page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@@ -91,7 +80,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(MsgInner msgInner) {
|
||||
if (msgInner.getIsNewRecord()){
|
||||
User user = msgInner.getCurrentUser();
|
||||
@@ -193,15 +182,11 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
}
|
||||
}
|
||||
});
|
||||
ListUtils.pageList(recordList, 100, new MethodCallback() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object execute(Object... objs) {
|
||||
return msgInnerRecordDao.insertBatch((List<MsgInnerRecord>)objs[0]);
|
||||
}
|
||||
});
|
||||
msgInnerRecordDao.insertBatch(recordList, null);
|
||||
// 手动触发消息推送任务
|
||||
if (Global.TRUE.equals(Global.getProperty("msg.realtime.enabled"))){
|
||||
msgPushThreadPool.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
MsgPushUtils.getMsgPushTask().execute();
|
||||
@@ -216,7 +201,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
/**
|
||||
* 根据消息编号和接受者用户名读取内部消息
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void readMsgInnerRecord(MsgInner msgInner){
|
||||
MsgInnerRecord msgInnerRecord = new MsgInnerRecord();
|
||||
msgInnerRecord.setMsgInnerId(msgInner.getId());
|
||||
@@ -234,7 +219,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(MsgInner msgInner) {
|
||||
super.updateStatus(msgInner);
|
||||
}
|
||||
@@ -244,7 +229,7 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
* @param msgInner
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(MsgInner msgInner) {
|
||||
super.delete(msgInner);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -33,6 +34,7 @@ import com.jeesite.modules.msg.service.MsgInnerService;
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/msg/msgInner")
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class MsgInnerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.TreeDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 行政区划DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.sys.entity.Area;
|
||||
* @version 2017-03-22
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface AreaDao extends TreeDao<Area> {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.TreeDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.Company;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 公司管理DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.sys.entity.Company;
|
||||
* @version 2017-03-12
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface CompanyDao extends TreeDao<Company> {
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.CompanyOffice;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 公司机构DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.sys.entity.CompanyOffice;
|
||||
* @version 2017-03-23
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface CompanyOfficeDao extends CrudDao<CompanyOffice> {
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import java.util.List;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.EmpUser;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 员工管理DAO接口
|
||||
@@ -16,6 +17,7 @@ import com.jeesite.modules.sys.entity.EmpUser;
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface EmpUserDao extends CrudDao<EmpUser> {
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.Employee;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 员工管理DAO接口
|
||||
@@ -16,6 +17,7 @@ import com.jeesite.modules.sys.entity.Employee;
|
||||
* 但是,在 4.2.0+ 版本中,新增了 userTypeMap 指定 service,所以无需设置 entity 类型。
|
||||
*/
|
||||
@MyBatisDao(entity = Employee.class)
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface EmployeeDao extends CrudDao<Employee> {
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.EmployeeOffice;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 员工附属机构关系表DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.sys.entity.EmployeeOffice;
|
||||
* @version 2019-04-29
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface EmployeeOfficeDao extends CrudDao<EmployeeOffice> {
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.EmployeePost;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 员工岗位DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.sys.entity.EmployeePost;
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface EmployeePostDao extends CrudDao<EmployeePost> {
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.Log;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 日志DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.sys.entity.Log;
|
||||
* @version 2017-03-19
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface LogDao extends CrudDao<Log> {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.TreeDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.Office;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 组织机构DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.sys.entity.Office;
|
||||
* @version 2017-03-23
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface OfficeDao extends TreeDao<Office> {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.dao;
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.Post;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* 岗位管理DAO接口
|
||||
@@ -14,6 +15,7 @@ import com.jeesite.modules.sys.entity.Post;
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@MyBatisDao
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public interface PostDao extends CrudDao<Post> {
|
||||
|
||||
}
|
||||
@@ -375,13 +375,13 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Autowired
|
||||
@Autowired(required = false)
|
||||
private JobDao jobDao; // 默认情况下job是关闭状态,需要注入jobDao
|
||||
/**
|
||||
* 初始化消息推送服务
|
||||
*/
|
||||
public void initJob(){
|
||||
if (!checkTable(JobEntity.class)) {
|
||||
if (jobDao == null || !checkTable(JobEntity.class)) {
|
||||
return;
|
||||
}
|
||||
JobEntity job = new JobEntity(MsgLocalPushTask.class.getSimpleName(), "SYSTEM");
|
||||
|
||||
Binary file not shown.
@@ -4,13 +4,7 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.entity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
@@ -21,6 +15,11 @@ import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 操作日志Entity
|
||||
* @author ThinkGem
|
||||
@@ -234,7 +233,7 @@ public class Log extends DataEntity<Log> {
|
||||
if (executeTime == null) {
|
||||
executeTime = 0L;
|
||||
}
|
||||
return TimeUtils.formatDateAgo(executeTime);
|
||||
return TimeUtils.formatTime(executeTime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,10 +282,16 @@ public class Log extends DataEntity<Log> {
|
||||
String[] values = (String[])paramsMap.get(name);
|
||||
return values != null && values.length > 0 ? values[0] : null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ReflectionToStringBuilder.toString(this);
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date getCreateDate() {
|
||||
return super.getCreateDate();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public String toString() {
|
||||
// return ReflectionToStringBuilder.toString(this);
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -4,8 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.interceptor;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -16,7 +14,6 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.ByteUtils;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.lang.TimeUtils;
|
||||
import com.jeesite.common.network.IpUtils;
|
||||
@@ -44,8 +41,7 @@ public class LogInterceptor extends BaseService implements HandlerInterceptor {
|
||||
long beginTime = System.currentTimeMillis();// 1、开始时间
|
||||
startTimeThreadLocal.set(beginTime); // 线程绑定变量(该数据只有当前请求的线程可见)
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("开始计时: {} URI: {} IP: {}", new SimpleDateFormat("hh:mm:ss.SSS")
|
||||
.format(beginTime), request.getRequestURI(), IpUtils.getRemoteAddr(request));
|
||||
logger.debug("请求开始 URI: {}, IP: {}", request.getRequestURI(), IpUtils.getRemoteAddr(request));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -53,8 +49,8 @@ public class LogInterceptor extends BaseService implements HandlerInterceptor {
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
|
||||
ModelAndView modelAndView) throws Exception {
|
||||
if (modelAndView != null){
|
||||
logger.info("ViewName: " + modelAndView.getViewName() + " <<<<<<<<< " + request.getRequestURI() + " >>>>>>>>> " + handler);
|
||||
if (modelAndView != null && logger.isDebugEnabled()){
|
||||
logger.debug("ViewName: " + modelAndView.getViewName() + " <<< " + request.getRequestURI() + " >>> " + handler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,11 +75,12 @@ public class LogInterceptor extends BaseService implements HandlerInterceptor {
|
||||
LogUtils.saveLog(UserUtils.getUser(), request, handler, ex, null, null, executeTime);
|
||||
|
||||
// 打印JVM信息。
|
||||
if (logger.isDebugEnabled()){
|
||||
if (logger.isInfoEnabled()){
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
logger.debug("计时结束: {} 用时: {} URI: {} 总内存: {} 已用内存: {}",
|
||||
DateUtils.formatDate(endTime, "hh:mm:ss.SSS"), TimeUtils.formatDateAgo(executeTime), request.getRequestURI(),
|
||||
ByteUtils.formatByteSize(runtime.totalMemory()), ByteUtils.formatByteSize(runtime.totalMemory()-runtime.freeMemory()));
|
||||
long totalMemory = runtime.totalMemory();
|
||||
logger.info("请求完成 URI: {}, 用时: {}, 总内存: {}, 剩余: {}", request.getRequestURI(),
|
||||
TimeUtils.formatTime(executeTime), ByteUtils.formatByteSize(totalMemory),
|
||||
ByteUtils.formatByteSize(totalMemory-(totalMemory-runtime.freeMemory())));
|
||||
}
|
||||
MDC.remove(TRACE_ID);
|
||||
}
|
||||
|
||||
@@ -4,22 +4,20 @@
|
||||
*/
|
||||
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;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 行政区划Service
|
||||
* @author ThinkGem
|
||||
* @version 2014-8-19
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class AreaServiceSupport extends TreeService<AreaDao, Area>
|
||||
implements AreaService {
|
||||
|
||||
@@ -43,7 +41,7 @@ public class AreaServiceSupport extends TreeService<AreaDao, Area>
|
||||
* 保存区划
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Area area) {
|
||||
super.save(area);
|
||||
AreaUtils.clearCache();
|
||||
@@ -53,7 +51,7 @@ public class AreaServiceSupport extends TreeService<AreaDao, Area>
|
||||
* 删除区划
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Area area) {
|
||||
super.delete(area);
|
||||
AreaUtils.clearCache();
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service.support;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
@@ -19,13 +13,17 @@ import com.jeesite.modules.sys.entity.CompanyOffice;
|
||||
import com.jeesite.modules.sys.service.CompanyService;
|
||||
import com.jeesite.modules.sys.service.DataScopeService;
|
||||
import com.jeesite.modules.sys.utils.EmpUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司管理Service
|
||||
* @author ThinkGem
|
||||
* @version 2016-4-23
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
implements CompanyService{
|
||||
|
||||
@@ -64,7 +62,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
* 保存公司
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Company company) {
|
||||
if (company.getIsNewRecord()){
|
||||
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息
|
||||
@@ -85,7 +83,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
list.forEach(e -> {
|
||||
e.setCompanyCode(company.getCompanyCode());
|
||||
});
|
||||
companyOfficeDao.insertBatch(list);
|
||||
companyOfficeDao.insertBatch(list, null);
|
||||
}
|
||||
// 清理公司相关缓存
|
||||
clearCompanyCache();
|
||||
@@ -95,7 +93,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
* 删除公司
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Company company) {
|
||||
super.delete(company);
|
||||
// 清理公司相关缓存
|
||||
@@ -106,7 +104,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
|
||||
* 停用当前节点
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Company company) {
|
||||
dao.updateStatus(company);
|
||||
// 清理公司相关缓存
|
||||
|
||||
@@ -4,16 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service.support;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
@@ -33,13 +23,20 @@ import com.jeesite.modules.sys.service.EmployeeService;
|
||||
import com.jeesite.modules.sys.service.UserService;
|
||||
import com.jeesite.modules.sys.utils.EmpUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工管理Service
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
implements EmpUserService{
|
||||
|
||||
@@ -55,8 +52,8 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
*/
|
||||
@PostConstruct
|
||||
private void corpModelValid() throws Exception{
|
||||
if (Global.isUseCorpModel() != Global.getPropertyToBoolean("user.useCorpModel", "false")){
|
||||
throw new Exception("\n\nuser.useCorpModel=true? 你开启了多租户模式,视乎你的当前版本不是JeeSite专业版。\n");
|
||||
if (!Global.isUseCorpModel().equals(Global.getPropertyToBoolean("user.useCorpModel", "false"))){
|
||||
throw new Exception("\n\nuser.useCorpModel=true? 你开启了多租户模式,似乎你的当前版本不是JeeSite专业版。\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +67,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
|
||||
/**
|
||||
* 添加数据权限过滤条件
|
||||
* @param entity 控制对象
|
||||
* @param empUser 控制对象
|
||||
* @param ctrlPermi 控制权限类型(拥有的数据权限:DataScope.CTRL_PERMI_HAVE、可管理的数据权限:DataScope.CTRL_PERMI_HAVE)
|
||||
*/
|
||||
@Override
|
||||
@@ -94,6 +91,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
/**
|
||||
* 查询全部用户,仅返回基本信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmpUser> findUserList(EmpUser empUser){
|
||||
return dao.findUserList(empUser);
|
||||
}
|
||||
@@ -101,6 +99,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
/**
|
||||
* 根据部门编码查询用户,仅返回基本信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser){
|
||||
return dao.findUserListByOfficeCodes(empUser);
|
||||
}
|
||||
@@ -108,6 +107,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
/**
|
||||
* 根据角色编码查询用户,仅返回基本信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser){
|
||||
return dao.findUserListByRoleCodes(empUser);
|
||||
}
|
||||
@@ -115,6 +115,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
/**
|
||||
* 根据岗位编码查询用户,仅返回基本信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmpUser> findUserListByPostCodes(EmpUser empUser){
|
||||
return dao.findUserListByPostCodes(empUser);
|
||||
}
|
||||
@@ -123,12 +124,15 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
* 保存用户员工
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(EmpUser user) {
|
||||
// 1、初始化用户信息
|
||||
if (user.getIsNewRecord()){
|
||||
userService.genId(user, user.getLoginCode());
|
||||
user.setUserCode(user.getUserCode()+"_"+IdGen.randomBase62(4).toLowerCase());
|
||||
// 如果没有设置用户编码,则根据登录名生成一个
|
||||
if (StringUtils.isBlank(user.getUserCode())){
|
||||
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);
|
||||
}
|
||||
@@ -161,7 +165,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
employeeOffice.setId(IdGen.nextId());
|
||||
employeeOffice.setEmpCode(employee.getEmpCode());
|
||||
});
|
||||
employeeOfficeDao.insertBatch(employee.getEmployeeOfficeList());
|
||||
employeeOfficeDao.insertBatch(employee.getEmployeeOfficeList(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +174,8 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
* @param file 导入的用户数据文件
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
@Override
|
||||
@Transactional
|
||||
public String importData(MultipartFile file, Boolean isUpdateSupport) {
|
||||
if (file == null){
|
||||
throw new ServiceException(text("请选择导入的数据文件!"));
|
||||
@@ -241,7 +246,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
* 更新状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(EmpUser empUser) {
|
||||
userService.updateStatus(empUser);
|
||||
employeeService.updateStatus(empUser.getEmployee());
|
||||
@@ -251,7 +256,7 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
* 删除用户
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(EmpUser empUser) {
|
||||
userService.delete(empUser);
|
||||
employeeService.delete(empUser.getEmployee());
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service.support;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
@@ -19,13 +14,16 @@ import com.jeesite.modules.sys.entity.Employee;
|
||||
import com.jeesite.modules.sys.entity.EmployeeOffice;
|
||||
import com.jeesite.modules.sys.entity.EmployeePost;
|
||||
import com.jeesite.modules.sys.service.EmployeeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工管理Service
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
implements EmployeeService{
|
||||
|
||||
@@ -64,7 +62,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
* 保存数据(插入或更新)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Employee employee) {
|
||||
if (employee.getIsNewRecord()){
|
||||
if (dao.get(employee) != null){
|
||||
@@ -80,7 +78,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
for (EmployeePost e : employee.getEmployeePostList()){
|
||||
e.setEmpCode(employee.getEmpCode());
|
||||
}
|
||||
employeePostDao.insertBatch(employee.getEmployeePostList());
|
||||
employeePostDao.insertBatch(employee.getEmployeePostList(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +86,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
* 删除数据
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Employee employee) {
|
||||
super.delete(employee);
|
||||
}
|
||||
@@ -96,6 +94,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
/**
|
||||
* 查询当前员工关联的岗位信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmployeePost> findEmployeePostList(Employee employee){
|
||||
EmployeePost employeePost = new EmployeePost();
|
||||
employeePost.setEmpCode(employee.getEmpCode());
|
||||
@@ -105,6 +104,7 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
|
||||
/**
|
||||
* 查询当前员工关联的附属机构信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmployeeOffice> findEmployeeOfficeList(Employee employee){
|
||||
EmployeeOffice employeeOffice = new EmployeeOffice();
|
||||
employeeOffice.setEmpCode(employee.getEmpCode());
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.jeesite.modules.sys.service.LogService;
|
||||
* @author ThinkGem
|
||||
* @version 2014-05-16
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class LogServiceSupport extends CrudService<LogDao, Log>
|
||||
implements LogService{
|
||||
|
||||
@@ -44,7 +43,8 @@ public class LogServiceSupport extends CrudService<LogDao, Log>
|
||||
/**
|
||||
* 不使用数据库事务,执行插入日志
|
||||
*/
|
||||
@Transactional(readOnly=false)//, propagation=Propagation.NOT_SUPPORTED)
|
||||
@Override
|
||||
@Transactional//(propagation = Propagation.NOT_SUPPORTED)
|
||||
public void insertLog(Log entity) {
|
||||
DataSourceHolder.setJdbcTransaction(false);
|
||||
dao.insert(entity);
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.jeesite.modules.sys.utils.EmpUtils;
|
||||
* @author ThinkGem
|
||||
* @version 2016-4-23
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
implements OfficeService{
|
||||
|
||||
@@ -65,7 +64,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
* 保存数据(插入或更新)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Office office) {
|
||||
if (office.getIsNewRecord()){
|
||||
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息
|
||||
@@ -83,7 +82,8 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
* @param file 导入的机构数据文件
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
*/
|
||||
@Transactional(readOnly=false)
|
||||
@Override
|
||||
@Transactional
|
||||
public String importData(MultipartFile file, Boolean isUpdateSupport) {
|
||||
if (file == null){
|
||||
throw new ServiceException(text("请选择导入的数据文件!"));
|
||||
@@ -145,7 +145,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
* 更新部门状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Office office) {
|
||||
super.updateStatus(office);
|
||||
// 清理部门相关缓存
|
||||
@@ -156,7 +156,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
|
||||
* 删除数据
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Office office) {
|
||||
super.delete(office);
|
||||
// 清理部门相关缓存
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.jeesite.modules.sys.utils.CorpUtils;
|
||||
* @author ThinkGem
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@Transactional(readOnly=true)
|
||||
public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
implements PostService{
|
||||
|
||||
@@ -36,6 +35,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
/**
|
||||
* 根据名称查询岗位
|
||||
*/
|
||||
@Override
|
||||
public Post getByPostName(Post post) {
|
||||
Post where = new Post();
|
||||
where.setPostName(post.getPostName());
|
||||
@@ -54,7 +54,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
* 保存岗位
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void save(Post post) {
|
||||
if (post.getIsNewRecord()){
|
||||
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息
|
||||
@@ -81,7 +81,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
* 更新岗位状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void updateStatus(Post post) {
|
||||
super.updateStatus(post);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class PostServiceSupport extends CrudService<PostDao, Post>
|
||||
* 删除岗位
|
||||
*/
|
||||
@Override
|
||||
@Transactional(readOnly=false)
|
||||
@Transactional
|
||||
public void delete(Post post) {
|
||||
super.delete(post);
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public class LogUtils {
|
||||
}
|
||||
// 如果是修改类型的日志,则获取修改前后的差异数据
|
||||
if (Log.TYPE_UPDATE.equals(log.getLogType()) && sourceData != null && targetData != null) {
|
||||
log.setDiffModifyData(DiffDataUtils.getDiffData(sourceData, targetData));
|
||||
log.setDiffModifyData(DiffDataUtils.compareToString(sourceData, targetData));
|
||||
}
|
||||
// 保存日志信息
|
||||
log.setIsNewRecord(true);
|
||||
|
||||
@@ -48,9 +48,9 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
* @version 2020-9-20
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "/account")
|
||||
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||
@Api(tags = "Account - 账号服务")
|
||||
@RequestMapping(value = "/account")
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class AccountController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -40,8 +41,9 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
* @version 2014-8-19
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Area - 行政区划")
|
||||
@RequestMapping(value = "${adminPath}/sys/area")
|
||||
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class AreaController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.jeesite.modules.sys.web;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -21,6 +22,7 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
* @version 20167-8-27
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Cache - 缓存管理")
|
||||
@RequestMapping(value = "${adminPath}/sys/cache")
|
||||
public class CacheController extends BaseController {
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -38,8 +39,9 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
* @version 2014-8-19
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Company - 公司管理")
|
||||
@RequestMapping(value = "${adminPath}/sys/company")
|
||||
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class CompanyController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.jeesite.modules.sys.web;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -27,8 +28,9 @@ import com.jeesite.modules.sys.service.LogService;
|
||||
* @version 2013-6-2
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Log - 访问日志")
|
||||
@RequestMapping(value = "${adminPath}/sys/log")
|
||||
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class LogController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -4,24 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.web;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.AuthorizationInfo;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.session.Session;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.web.util.WebUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
@@ -33,8 +15,27 @@ import com.jeesite.common.web.CookieUtils;
|
||||
import com.jeesite.common.web.http.ServletUtils;
|
||||
import com.jeesite.modules.sys.entity.Menu;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.utils.CorpUtils;
|
||||
import com.jeesite.modules.sys.utils.PwdUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.AuthorizationInfo;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.session.Session;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.web.util.WebUtils;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 登录Controller
|
||||
@@ -42,7 +43,9 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
* @version 2020-9-19
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Login - 登录公共")
|
||||
@RequestMapping(value = "${adminPath}")
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public class LoginController extends BaseController{
|
||||
|
||||
/**
|
||||
@@ -108,12 +111,12 @@ public class LoginController extends BaseController{
|
||||
LoginInfo loginInfo = UserUtils.getLoginInfo();
|
||||
|
||||
// 如果已经登录,则跳转到管理首页
|
||||
if(loginInfo != null){
|
||||
String queryString = request.getQueryString();
|
||||
queryString = queryString == null ? "" : "?" + queryString;
|
||||
ServletUtils.redirectUrl(request, response, adminPath + "/index" + queryString);
|
||||
return null;
|
||||
}
|
||||
// if(loginInfo != null){ // 注释掉,已经登录的账号,正常返回登录失败信息,方便前端判断。
|
||||
// String queryString = request.getQueryString();
|
||||
// queryString = queryString == null ? "" : "?" + queryString;
|
||||
// ServletUtils.redirectUrl(request, response, adminPath + "/index" + queryString);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// 获取登录失败数据
|
||||
model.addAllAttributes(FormFilter.getLoginFailureData(request, response));
|
||||
@@ -156,24 +159,18 @@ public class LoginController extends BaseController{
|
||||
|
||||
// 验证下用户权限,以便调用doGetAuthorizationInfo方法,保存单点登录登出句柄
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
if (subject == null || !subject.isPermitted("user")){
|
||||
if (subject != null){
|
||||
subject.logout();
|
||||
}
|
||||
if (!subject.isPermitted("user")){
|
||||
subject.logout();
|
||||
String queryString = request.getQueryString();
|
||||
queryString = queryString == null ? "" : "?" + queryString;
|
||||
ServletUtils.redirectUrl(request, response, adminPath + "/login" + queryString);
|
||||
return null;
|
||||
}
|
||||
|
||||
//获取登录用户信息
|
||||
// 获取登录用户信息,未加载shiro模块时会为空,直接访问则提示操作权限不足。
|
||||
LoginInfo loginInfo = UserUtils.getLoginInfo();
|
||||
|
||||
// 未加载shiro模块时会为空,直接访问则提示操作权限不足。
|
||||
if(loginInfo == null){
|
||||
if (subject != null){
|
||||
subject.logout();
|
||||
}
|
||||
subject.logout();
|
||||
String queryString = request.getQueryString();
|
||||
queryString = queryString == null ? "" : "?" + queryString;
|
||||
ServletUtils.redirectUrl(request, response, adminPath + "/login" + queryString);
|
||||
@@ -189,12 +186,16 @@ public class LoginController extends BaseController{
|
||||
ServletUtils.redirectUrl(request, response, adminPath + "/login" + queryString);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 获取当前会话对象,并返回一些数据
|
||||
Session session = UserUtils.getSession();
|
||||
model.addAttribute("user", user); // 设置当前用户信息
|
||||
model.addAttribute("demoMode", Global.isDemoMode());
|
||||
model.addAttribute("useCorpModel", Global.isUseCorpModel());
|
||||
model.addAttribute("currentCorpCode", CorpUtils.getCurrentCorpCode());
|
||||
model.addAttribute("currentCorpName", CorpUtils.getCurrentCorpName());
|
||||
model.addAttribute("sysCode", session.getAttribute("sysCode"));
|
||||
|
||||
//获取当前会话对象
|
||||
Session session = UserUtils.getSession();
|
||||
|
||||
// 是否是登录操作
|
||||
boolean isLogin = Global.TRUE.equals(session.getAttribute(BaseAuthorizingRealm.IS_LOGIN_OPER));
|
||||
if (isLogin){
|
||||
@@ -234,6 +235,9 @@ public class LoginController extends BaseController{
|
||||
successUrl = request.getContextPath() + successUrl;
|
||||
}
|
||||
model.addAttribute("__url", successUrl); // 告诉浏览器登录后跳转的页面
|
||||
// 初始密码策略和密码修改策略验证(0:关闭;1:提醒用户;2:强制修改初始或旧密码)
|
||||
String modifyPasswordMsg = PwdUtils.getModifyPasswordMsg(user, model);
|
||||
model.addAttribute("modifyPasswordMsg", modifyPasswordMsg);
|
||||
return ServletUtils.renderObject(response, model);
|
||||
}
|
||||
// 如果是登录操作,则跳转到登录成功页
|
||||
@@ -371,12 +375,14 @@ public class LoginController extends BaseController{
|
||||
/**
|
||||
* 切换主题风格
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
//@RequiresPermissions("user")
|
||||
@RequestMapping(value = "switchSkin/{skinName}")
|
||||
public String switchSkin(@PathVariable String skinName, HttpServletRequest request, HttpServletResponse response) {
|
||||
LoginInfo loginInfo = UserUtils.getLoginInfo();
|
||||
if (StringUtils.isNotBlank(skinName) && !"select".equals(skinName)){
|
||||
CookieUtils.setCookie(response, "skinName_" + loginInfo.getId(), skinName);
|
||||
CookieUtils.setCookie(response, "skinName", skinName);
|
||||
if (ServletUtils.isAjaxRequest(request)) {
|
||||
return renderResult(response, Global.TRUE, text("主题切换成功"));
|
||||
}
|
||||
return REDIRECT + adminPath + "/index";
|
||||
}
|
||||
return "modules/sys/switchSkin";
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -41,8 +42,9 @@ import com.jeesite.modules.sys.web.user.EmpUserController;
|
||||
* @version 2014-8-19
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Office - 组织机构")
|
||||
@RequestMapping(value = "${adminPath}/sys/office")
|
||||
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class OfficeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.session.Session;
|
||||
import org.apache.shiro.subject.PrincipalCollection;
|
||||
@@ -42,8 +43,9 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
* @version 2022-3-10
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Online - 在线用户")
|
||||
@RequestMapping(value = "${adminPath}/sys/online")
|
||||
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class OnlineController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
@@ -105,7 +107,7 @@ public class OnlineController extends BaseController{
|
||||
}
|
||||
map.put("startTimestamp", DateUtils.formatDateTime(session.getStartTimestamp()));
|
||||
map.put("lastAccessTime", DateUtils.formatDateTime(session.getLastAccessTime()));
|
||||
map.put("timeout", TimeUtils.formatDateAgo(session.getTimeout()-(currentTime-session.getLastAccessTime().getTime())));
|
||||
map.put("timeout", TimeUtils.formatTime(session.getTimeout()-(currentTime-session.getLastAccessTime().getTime())));
|
||||
map.put("userCode", session.getAttribute("userCode"));
|
||||
map.put("userName", session.getAttribute("userName"));
|
||||
map.put("userType", session.getAttribute("userType"));
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -36,8 +37,9 @@ import com.jeesite.modules.sys.service.PostService;
|
||||
* @version 2017-03-25
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Post - 岗位管理")
|
||||
@RequestMapping(value = "${adminPath}/sys/post")
|
||||
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class PostController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user