Compare commits

..

52 Commits

Author SHA1 Message Date
thinkgem
f18af7130b 5.2.1 2023-01-30 16:43:46 +08:00
thinkgem
e0780b464d 操作日志中的登录失败不标记为异常日志 2023-01-30 16:24:34 +08:00
thinkgem
926c25c18b sqlMap.where 新增 条件嵌套查询,可替代 andBracket、orBracket、endBracket 2023-01-29 14:37:16 +08:00
thinkgem
1b22ee0591 update db jeesite_v5 2023-01-28 16:36:13 +08:00
thinkgem
4a2a8afe72 spring-boot 2.7.8、mybatis 3.5.11、shiro 1.11.0、druid 1.2.15... 2023-01-28 11:36:01 +08:00
thinkgem
470a8998fb 增加 Table 注解缓存 2023-01-28 10:32:02 +08:00
thinkgem
a3199ff716 增加 web.staticCachePeriod 参数 2023-01-10 12:56:08 +08:00
thinkgem
a358118658 代码优化 2023-01-04 11:01:11 +08:00
thinkgem
4733ed375a copyrightYear: 2023 2022-12-30 11:26:07 +08:00
thinkgem
a22a91c482 新增允许重定向的地址限定,不设置为全部允许,设置this只允许本项目内部跳转,多个用逗号隔开,例如:this,http://*.jeesite.com 2022-12-23 13:54:24 +08:00
thinkgem
a30f1d51c4 内部消息和文件管理 去掉菜单的IFRAME 2022-12-23 13:53:02 +08:00
thinkgem
96d1d7c4fd 登录后重定向地址不允许跳转到外部地址 2022-12-15 23:27:18 +08:00
thinkgem
26f6781a62 任务调度表增加一些字段 2022-12-08 16:44:12 +08:00
thinkgem
a861ba7c80 next 2022-12-07 11:33:39 +08:00
thinkgem
a38cdb3e5a 方便requestbody数据是否有附件校验 2022-12-05 13:17:30 +08:00
thinkgem
edb3c078ae update config 2022-11-02 16:55:25 +08:00
thinkgem
101484d938 update 2022-11-02 16:53:25 +08:00
thinkgem
31775c0255 update 2022-10-25 13:44:36 +08:00
thinkgem
1b4b70a9ac 微服务下偶尔会获取不到Employee数据问题 2022-10-25 13:43:49 +08:00
thinkgem
e31a810437 update README.md 2022-10-16 20:56:51 +08:00
thinkgem
fdedcc4f79 更新5.2.0生成模板 2022-10-16 17:25:09 +08:00
thinkgem
7c6e79b06b shiro 1.10.0 2022-10-14 16:59:48 +08:00
thinkgem
d0e0cbdf7a commons-text 1.10.0 2022-10-14 16:57:41 +08:00
thinkgem
bb5db42ed5 5.2.0 2022-10-13 10:00:22 +08:00
thinkgem
b40fc1c35c upgrade spring boot 2.7 2022-10-12 13:53:05 +08:00
thinkgem
21fcae1e97 调整 setDrawerProps resetFields 顺序 2022-10-09 16:26:34 +08:00
thinkgem
0150e054c2 update 2022-09-30 10:18:26 +08:00
thinkgem
d8c85389b7 cloud生成模板树表import修正 2022-09-30 10:06:15 +08:00
thinkgem
9c5b2d232c update 2022-09-30 10:05:18 +08:00
thinkgem
743c31d768 update pom.xml 2022-09-20 08:48:47 +08:00
thinkgem
b169727263 新增左树右表和导入导出代码生成模板 2022-09-15 14:28:40 +08:00
thinkgem
3716cdfa87 5.1.0 2022-09-13 14:48:22 +08:00
thinkgem
03a0a51de9 fix 7z 2022-09-08 18:17:17 +08:00
thinkgem
d5b0aa9a14 spring boot 2.6.11、mybatis 3.5.10、jsqlparser 4.5、fastjson noneautotype、druid 1.2.11 2022-09-02 17:43:05 +08:00
thinkgem
ef6716e83c 将初始密码提醒和强制修改初始密码消息反馈给分离端 2022-09-01 17:04:52 +08:00
thinkgem
b5c7fd1a23 remove JaxbMapper.java 2022-09-01 17:03:46 +08:00
thinkgem
fbda5d558e add sso demo 2022-08-30 21:43:49 +08:00
thinkgem
ed38197ce1 update README.md 2022-08-26 14:39:15 +08:00
thinkgem
6cb76ee31c 新增 job.jobStore.misfireThreshold 参数 2022-08-19 19:17:23 +08:00
thinkgem
7d73ba299c spring boot 2.6.10 2022-08-11 12:19:12 +08:00
thinkgem
d3b5c67edd 日志记录创建时间增加秒 2022-08-11 00:03:03 +08:00
thinkgem
aed37d61fc 细节微调 2022-08-09 16:44:27 +08:00
thinkgem
6b89b2a15b 删除无用注释 2022-08-08 21:09:24 +08:00
thinkgem
c3cf990986 支持OSS对象存储的文件预览 2022-08-08 12:33:35 +08:00
thinkgem
2e361e82a0 replace ad 2022-08-05 16:31:01 +08:00
thinkgem
835ef5c82d 重命名ur是sql关键词,导致jsqlparser不能解析 2022-08-02 10:29:58 +08:00
thinkgem
3f51716843 代码优化 2022-08-01 09:04:15 +08:00
thinkgem
05b65b9ac4 spring boot 2.5.14 2022-07-25 13:43:38 +08:00
thinkgem
0dc0d31066 new version 2022-07-12 15:45:07 +08:00
thinkgem
47f9f37e25 update 2022-07-06 14:32:45 +08:00
thinkgem
d5944598c2 update InitCoreData.java. 2022-07-06 14:32:29 +08:00
thinkgem
91e418fcec 优化配置 2022-07-04 15:49:06 +08:00
91 changed files with 2623 additions and 1740 deletions

View File

@@ -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>
@@ -41,7 +41,7 @@ JeeSite 功能全,知识点非常多,也非常少。因为她使用的都是
JeeSite 是一个低代码开发平台具有较高的封装度、扩展性封装不是限制你去做一些事情而是在便捷的同时也具有较好的扩展性在不具备一些功能的情况下JeeSite 提供了扩展接口,提供了原生调用方法。
大家都在用 Spring也在学习 Spring 的优点Spring 提供了较好的扩展性,可又有多少人去修改它的源代码呢,退一步说,大家去修改了 Spring 的源码反而会对未来升级造成很大困扰您说不是呢这样的例子很多所以不要纠结我们非常注重这一点JeeSite 也一样具备强大的扩展性。
大家都在用 Spring也在学习 Spring 的优点Spring 提供了较好的扩展性,可又有多少人去修改它的源代码呢,退一步说,大家去修改了 Spring 的源码反而会对未来升级造成很大困扰您说不是呢这样的例子很多所以不要纠结我们非常注重这一点JeeSite 也一样具备强大的扩展性。
* 至今 JeeSite 平台架构已经非常稳定。
* JeeSite 精益求精,用心打磨每一个细节。
@@ -51,12 +51,14 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
## 技术选型
* 主框架Spring Boot 2.5、Spring Framework 5.3、Apache Shiro 1.9、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<https://gitee.com/thinkgem/jeesite-vue>
@@ -86,12 +88,13 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
### 本地运行
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.0_dev.zip> 并解压
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/>
### 快速运行
@@ -100,6 +103,7 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
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/>
### 容器运行
@@ -113,45 +117,65 @@ 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/manager3/>
* 在线作业调度:<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/>
* 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/>
## 授权协议声明
@@ -169,7 +193,7 @@ thinkgem/jeesite-web && docker logs -f jeesite-web
## 技术服务与支持
* 没有资金的支撑就很难得到发展,特别是一个好的产品,如果 JeeSite 帮助了您,请为我们点赞。支持我们,您可以得到一些回报,有了这些我们会把公益事业做的更好,回报社区和社会请给我们一些动力吧,在此非常感谢已支持我们的朋友!
* 没有资金的支撑就很难得到发展,特别是一个好的产品,如果 JeeSite 帮助了您,请为我们点赞。支持我们,您可以获得更多回馈,我们会把公益事业做的更好,开放更多资源,回报社区和社会请给我们一些动力吧,在此非常感谢已支持我们的朋友!
* **联系我们**:请访问技术支持服务页面:<https://jeesite.com/docs/support/>
## 今后如何升级?

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

View File

@@ -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;
}
}

View File

@@ -6,12 +6,12 @@ package com.jeesite.common.ueditor.define;
*/
public interface State {
public boolean isSuccess ();
boolean isSuccess();
public void putInfo( String name, String val );
void putInfo(String name, String val);
public void putInfo ( String name, long val );
void putInfo(String name, long val);
public String toJSONString ();
String toJSONString();
}

View File

@@ -14,21 +14,21 @@ public interface FieldType {
/**
* 获取对象值(导入)
*/
default public Object getValue(String val) {
default Object getValue(String val) {
return null;
}
/**
* 获取对象值(导出)
*/
default public String setValue(Object val) {
default String setValue(Object val) {
return null;
}
/**
* 获取对象值格式(导出)
*/
default public String getDataFormat() {
default String getDataFormat() {
return null;
}

View File

@@ -4,23 +4,6 @@
*/
package com.jeesite.common.web.http;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
import java.util.TreeMap;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.Validate;
import org.springframework.http.MediaType;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.fasterxml.jackson.databind.util.JSONPObject;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.MapUtils;
@@ -29,6 +12,17 @@ import com.jeesite.common.lang.ExceptionUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.common.mapper.XmlMapper;
import org.apache.commons.lang3.Validate;
import org.springframework.http.MediaType;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.Map.Entry;
/**
* Http与Servlet工具类.
@@ -387,6 +381,18 @@ public class ServletUtils {
return null;
}
/**
* 获取请求的域名(含端口)
*/
public static String getRequestDomain(String url) {
String scheme = StringUtils.substringBefore(url, "://");
String domain = StringUtils.substringAfter(url, "://");
if (StringUtils.contains(domain, "/")) {
domain = StringUtils.substringBefore(domain, "/");
}
return scheme + "://" + domain;
}
/**
* 获得请求参数值
*/

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

View File

@@ -16,8 +16,8 @@ import com.jeesite.modules.cms.entity.Article;
@MyBatisDao
public interface ArticleDao extends CrudDao<Article> {
public long updateExpiredWeight(Article article);
long updateExpiredWeight(Article article);
public long updateHitsAddOne(String id);
long updateHitsAddOne(String id);
}

View File

@@ -10,4 +10,7 @@
4.3.0
5.0.0
5.0.1
5.0.2
5.0.2
5.1.0
5.2.0
5.2.1

File diff suppressed because it is too large Load Diff

View File

@@ -348,7 +348,14 @@ CREATE TABLE js_sys_job
job_group varchar(64) NOT NULL,
description vargraphic(100) NOT NULL,
invoke_target vargraphic(1000) NOT NULL,
job_type vargraphic(10) DEFAULT 'cron' NOT NULL,
job_priority decimal(10),
start_time timestamp,
start_delay decimal(19),
repeat_interval decimal(19),
repeat_count decimal(10),
cron_expression varchar(255) NOT NULL,
rule_expression varchar(255),
misfire_instruction decimal(1) NOT NULL,
concurrent char(1) NOT NULL,
instance_name varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL,

View File

@@ -348,7 +348,14 @@ CREATE TABLE js_sys_job
job_group varchar(64) NOT NULL,
description varchar(100) NOT NULL,
invoke_target varchar(1000) NOT NULL,
job_type varchar(10) DEFAULT 'cron' NOT NULL,
job_priority decimal(10),
start_time datetime,
start_delay decimal(19),
repeat_interval decimal(19),
repeat_count decimal(10),
cron_expression varchar(255) NOT NULL,
rule_expression varchar(255),
misfire_instruction decimal(1) NOT NULL,
concurrent char(1) NOT NULL,
instance_name varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL,

View File

@@ -348,7 +348,14 @@ CREATE TABLE [js_sys_job]
[job_group] varchar(64) NOT NULL,
[description] nvarchar(100) NOT NULL,
[invoke_target] nvarchar(1000) NOT NULL,
[job_type] nvarchar(10) DEFAULT 'cron' NOT NULL,
[job_priority] decimal(10),
[start_time] datetime,
[start_delay] decimal(19),
[repeat_interval] decimal(19),
[repeat_count] decimal(10),
[cron_expression] varchar(255) NOT NULL,
[rule_expression] varchar(255),
[misfire_instruction] decimal(1) NOT NULL,
[concurrent] char(1) NOT NULL,
[instance_name] varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL,

View File

@@ -349,7 +349,14 @@ CREATE TABLE js_sys_job
job_group varchar(64) NOT NULL COMMENT '任务组名',
description varchar(100) NOT NULL COMMENT '任务描述',
invoke_target varchar(1000) NOT NULL COMMENT '调用目标字符串',
job_type varchar(10) DEFAULT 'cron' NOT NULL COMMENT '任务触发类型',
job_priority decimal(10) COMMENT '触发器优先级',
start_time datetime COMMENT '触发器启动时间',
start_delay decimal(19) COMMENT '触发器延迟启动时间',
repeat_interval decimal(19) COMMENT '循环间隔时间(毫秒)',
repeat_count decimal(10) COMMENT '循环次数( -1 无期限)',
cron_expression varchar(255) NOT NULL COMMENT 'Cron执行表达式',
rule_expression varchar(255) COMMENT '自定义规则表达式',
misfire_instruction decimal(1) NOT NULL COMMENT '计划执行错误策略',
concurrent char(1) NOT NULL COMMENT '是否并发执行',
instance_name varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL COMMENT '集群的实例名字',

View File

@@ -348,7 +348,14 @@ CREATE TABLE js_sys_job
job_group varchar2(64) NOT NULL,
description nvarchar2(100) NOT NULL,
invoke_target nvarchar2(1000) NOT NULL,
job_type nvarchar2(10) DEFAULT 'cron' NOT NULL,
job_priority number(10),
start_time timestamp,
start_delay number(19),
repeat_interval number(19),
repeat_count number(10),
cron_expression varchar2(255) NOT NULL,
rule_expression varchar2(255),
misfire_instruction number(1) NOT NULL,
concurrent char(1) NOT NULL,
instance_name varchar2(64) DEFAULT 'JeeSiteScheduler' NOT NULL,
@@ -1233,7 +1240,14 @@ COMMENT ON COLUMN js_sys_job.job_name IS '任务名称';
COMMENT ON COLUMN js_sys_job.job_group IS '任务组名';
COMMENT ON COLUMN js_sys_job.description IS '任务描述';
COMMENT ON COLUMN js_sys_job.invoke_target IS '调用目标字符串';
COMMENT ON COLUMN js_sys_job.job_type IS '任务触发类型';
COMMENT ON COLUMN js_sys_job.job_priority IS '触发器优先级';
COMMENT ON COLUMN js_sys_job.start_time IS '触发器启动时间';
COMMENT ON COLUMN js_sys_job.start_delay IS '触发器延迟启动时间';
COMMENT ON COLUMN js_sys_job.repeat_interval IS '循环间隔时间(毫秒)';
COMMENT ON COLUMN js_sys_job.repeat_count IS '循环次数( -1 无期限)';
COMMENT ON COLUMN js_sys_job.cron_expression IS 'Cron执行表达式';
COMMENT ON COLUMN js_sys_job.rule_expression IS '自定义规则表达式';
COMMENT ON COLUMN js_sys_job.misfire_instruction IS '计划执行错误策略';
COMMENT ON COLUMN js_sys_job.concurrent IS '是否并发执行';
COMMENT ON COLUMN js_sys_job.instance_name IS '集群的实例名字';

View File

@@ -348,7 +348,14 @@ CREATE TABLE js_sys_job
job_group varchar(64) NOT NULL,
description varchar(100) NOT NULL,
invoke_target varchar(1000) NOT NULL,
job_type varchar(10) DEFAULT 'cron' NOT NULL,
job_priority decimal(10),
start_time timestamp,
start_delay decimal(19),
repeat_interval decimal(19),
repeat_count decimal(10),
cron_expression varchar(255) NOT NULL,
rule_expression varchar(255),
misfire_instruction decimal(1) NOT NULL,
concurrent char(1) NOT NULL,
instance_name varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL,
@@ -1233,7 +1240,14 @@ COMMENT ON COLUMN js_sys_job.job_name IS '任务名称';
COMMENT ON COLUMN js_sys_job.job_group IS '任务组名';
COMMENT ON COLUMN js_sys_job.description IS '任务描述';
COMMENT ON COLUMN js_sys_job.invoke_target IS '调用目标字符串';
COMMENT ON COLUMN js_sys_job.job_type IS '任务触发类型';
COMMENT ON COLUMN js_sys_job.job_priority IS '触发器优先级';
COMMENT ON COLUMN js_sys_job.start_time IS '触发器启动时间';
COMMENT ON COLUMN js_sys_job.start_delay IS '触发器延迟启动时间';
COMMENT ON COLUMN js_sys_job.repeat_interval IS '循环间隔时间(毫秒)';
COMMENT ON COLUMN js_sys_job.repeat_count IS '循环次数( -1 无期限)';
COMMENT ON COLUMN js_sys_job.cron_expression IS 'Cron执行表达式';
COMMENT ON COLUMN js_sys_job.rule_expression IS '自定义规则表达式';
COMMENT ON COLUMN js_sys_job.misfire_instruction IS '计划执行错误策略';
COMMENT ON COLUMN js_sys_job.concurrent IS '是否并发执行';
COMMENT ON COLUMN js_sys_job.instance_name IS '集群的实例名字';

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -25,8 +25,8 @@
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Oracle 11g -->

View File

@@ -4,35 +4,22 @@
*/
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.msg.service.MsgInnerService;
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 {

View File

@@ -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;
}

View File

@@ -21,6 +21,6 @@ public interface MsgInnerRecordDao extends CrudDao<MsgInnerRecord> {
/**
* 根据消息编号和接受者用户名更新读取状态
*/
public long updateReadStatus(MsgInnerRecord msgInnerRecord);
long updateReadStatus(MsgInnerRecord msgInnerRecord);
}

View File

@@ -92,7 +92,8 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
}
}
msgInner.setSendDate(new Date());
msgInner.setIsAttac(StringUtils.isNotBlank(ServletUtils.getParameter("msgInner_file"))?Global.YES:Global.NO);
msgInner.setIsAttac(msgInner.getDataMap() != null && StringUtils.isNotBlank((String)msgInner.getDataMap().get("msgInner_file"))
|| StringUtils.isNotBlank(ServletUtils.getParameter("msgInner_file")) ? Global.YES : Global.NO);
super.save(msgInner);
// 保存上传附件
FileUploadUtils.saveFileUpload(msgInner, msgInner.getId(), "msgInner_file");

View File

@@ -23,21 +23,21 @@ public interface EmpUserDao extends CrudDao<EmpUser> {
/**
* 查询全部用户,仅返回基本信息
*/
public List<EmpUser> findUserList(EmpUser empUser);
List<EmpUser> findUserList(EmpUser empUser);
/**
* 根据部门编码查询用户,仅返回基本信息
*/
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
/**
* 根据角色编码查询用户,仅返回基本信息
*/
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
/**
* 根据岗位编码查询用户,仅返回基本信息
*/
public List<EmpUser> findUserListByPostCodes(EmpUser empUser);
List<EmpUser> findUserListByPostCodes(EmpUser empUser);
}

View File

@@ -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");

View File

@@ -4,6 +4,7 @@
*/
package com.jeesite.modules.sys.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.entity.BaseEntity;
@@ -16,6 +17,7 @@ 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;
/**
@@ -280,6 +282,12 @@ public class Log extends DataEntity<Log> {
String[] values = (String[])paramsMap.get(name);
return values != null && values.length > 0 ? values[0] : null;
}
@Override
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date getCreateDate() {
return super.getCreateDate();
}
// @Override
// public String toString() {

View File

@@ -4,11 +4,11 @@
*/
package com.jeesite.modules.sys.service;
import java.util.List;
import com.jeesite.common.service.api.TreeServiceApi;
import com.jeesite.modules.sys.entity.Area;
import java.util.List;
/**
* 行政区划Service
* @author ThinkGem
@@ -20,24 +20,24 @@ public interface AreaService extends TreeServiceApi<Area> {
* 获取区划
*/
@Override
public Area get(Area area);
Area get(Area area);
/**
* 查询区划
*/
@Override
public List<Area> findList(Area area);
List<Area> findList(Area area);
/**
* 保存区划
*/
@Override
public void save(Area area);
void save(Area area);
/**
* 删除区划
*/
@Override
public void delete(Area area);
void delete(Area area);
}

View File

@@ -4,11 +4,11 @@
*/
package com.jeesite.modules.sys.service;
import java.util.List;
import com.jeesite.common.service.api.TreeServiceApi;
import com.jeesite.modules.sys.entity.Company;
import java.util.List;
/**
* 公司管理Service
* @author ThinkGem
@@ -20,36 +20,36 @@ public interface CompanyService extends TreeServiceApi<Company> {
* 获取单条数据
*/
@Override
public Company get(Company company);
Company get(Company company);
/**
* 添加数据权限过滤条件
*/
@Override
public void addDataScopeFilter(Company company, String ctrlPermi);
void addDataScopeFilter(Company company, String ctrlPermi);
/**
* 查询公司列表
*/
@Override
public List<Company> findList(Company company);
List<Company> findList(Company company);
/**
* 保存公司
*/
@Override
public void save(Company company);
void save(Company company);
/**
* 删除公司
*/
@Override
public void delete(Company company);
void delete(Company company);
/**
* 停用当前节点
*/
@Override
public void updateStatus(Company company);
void updateStatus(Company company);
}

View File

@@ -4,13 +4,12 @@
*/
package com.jeesite.modules.sys.service;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
import com.jeesite.common.entity.Page;
import com.jeesite.common.service.api.CrudServiceApi;
import com.jeesite.modules.sys.entity.EmpUser;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 员工管理Service
@@ -23,7 +22,7 @@ public interface EmpUserService extends CrudServiceApi<EmpUser> {
* 获取单条数据
*/
@Override
public EmpUser get(EmpUser empUser);
EmpUser get(EmpUser empUser);
/**
* 添加数据权限过滤条件
@@ -31,57 +30,57 @@ public interface EmpUserService extends CrudServiceApi<EmpUser> {
* @param ctrlPermi 控制权限类型拥有的数据权限DataScope.CTRL_PERMI_HAVE、可管理的数据权限DataScope.CTRL_PERMI_HAVE
*/
@Override
public void addDataScopeFilter(EmpUser empUser, String ctrlPermi);
void addDataScopeFilter(EmpUser empUser, String ctrlPermi);
/**
* 分页查询数据
*/
@Override
public Page<EmpUser> findPage(EmpUser empUser);
Page<EmpUser> findPage(EmpUser empUser);
/**
* 查询全部用户,仅返回基本信息
*/
public List<EmpUser> findUserList(EmpUser empUser);
List<EmpUser> findUserList(EmpUser empUser);
/**
* 根据部门编码查询用户,仅返回基本信息
*/
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
/**
* 根据角色编码查询用户,仅返回基本信息
*/
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
/**
* 根据岗位编码查询用户,仅返回基本信息
*/
public List<EmpUser> findUserListByPostCodes(EmpUser empUser);
List<EmpUser> findUserListByPostCodes(EmpUser empUser);
/**
* 保存用户员工
*/
@Override
public void save(EmpUser user);
void save(EmpUser user);
/**
* 导入用户数据
* @param file 导入的用户数据文件
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
*/
public String importData(MultipartFile file, Boolean isUpdateSupport);
String importData(MultipartFile file, Boolean isUpdateSupport);
/**
* 更新状态
*/
@Override
public void updateStatus(EmpUser empUser);
void updateStatus(EmpUser empUser);
/**
* 删除用户
*/
@Override
public void delete(EmpUser empUser);
void delete(EmpUser empUser);
}

View File

@@ -4,14 +4,14 @@
*/
package com.jeesite.modules.sys.service;
import java.util.List;
import com.jeesite.common.entity.Page;
import com.jeesite.common.service.api.CrudServiceApi;
import com.jeesite.modules.sys.entity.Employee;
import com.jeesite.modules.sys.entity.EmployeeOffice;
import com.jeesite.modules.sys.entity.EmployeePost;
import java.util.List;
/**
* 员工管理Service
* @author ThinkGem
@@ -23,39 +23,39 @@ public interface EmployeeService extends CrudServiceApi<Employee> {
* 获取单条数据
*/
@Override
public Employee get(Employee employee);
Employee get(Employee employee);
/**
* 根据工号获取数据
*/
public Employee getByEmpNo(Employee employee);
Employee getByEmpNo(Employee employee);
/**
* 查询分页数据
*/
@Override
public Page<Employee> findPage(Employee employee);
Page<Employee> findPage(Employee employee);
/**
* 保存数据(插入或更新)
*/
@Override
public void save(Employee employee);
void save(Employee employee);
/**
* 删除数据
*/
@Override
public void delete(Employee employee);
void delete(Employee employee);
/**
* 查询当前员工关联的岗位信息
*/
public List<EmployeePost> findEmployeePostList(Employee employee);
List<EmployeePost> findEmployeePostList(Employee employee);
/**
* 查询当前员工关联的附属机构信息
*/
public List<EmployeeOffice> findEmployeeOfficeList(Employee employee);
List<EmployeeOffice> findEmployeeOfficeList(Employee employee);
}

View File

@@ -19,11 +19,11 @@ public interface LogService extends CrudServiceApi<Log> {
* 查询日志记录
*/
@Override
public Page<Log> findPage(Log log);
Page<Log> findPage(Log log);
/**
* 不使用数据库事务,执行插入日志
*/
public void insertLog(Log entity);
void insertLog(Log entity);
}

View File

@@ -22,43 +22,43 @@ public interface OfficeService extends TreeServiceApi<Office> {
* 获取单条数据
*/
@Override
public Office get(Office office);
Office get(Office office);
/**
* 添加数据权限过滤条件
*/
@Override
public void addDataScopeFilter(Office office, String ctrlPermi);
void addDataScopeFilter(Office office, String ctrlPermi);
/**
* 查询组织机构列表
*/
@Override
public List<Office> findList(Office office);
List<Office> findList(Office office);
/**
* 保存数据(插入或更新)
*/
@Override
public void save(Office office);
void save(Office office);
/**
* 导入机构数据
* @param file 导入的用户数据文件
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
*/
public String importData(MultipartFile file, Boolean isUpdateSupport);
String importData(MultipartFile file, Boolean isUpdateSupport);
/**
* 更新部门状态
*/
@Override
public void updateStatus(Office office);
void updateStatus(Office office);
/**
* 删除数据
*/
@Override
public void delete(Office office);
void delete(Office office);
}

View File

@@ -19,35 +19,35 @@ public interface PostService extends CrudServiceApi<Post> {
* 查询岗位
*/
@Override
public Post get(Post post);
Post get(Post post);
/**
* 根据名称查询岗位
*/
public Post getByPostName(Post post);
Post getByPostName(Post post);
/**
* 查询岗位
*/
@Override
public Page<Post> findPage(Post post);
Page<Post> findPage(Post post);
/**
* 保存岗位
*/
@Override
public void save(Post post);
void save(Post post);
/**
* 更新岗位状态
*/
@Override
public void updateStatus(Post post);
void updateStatus(Post post);
/**
* 删除岗位
*/
@Override
public void delete(Post post);
void delete(Post post);
}

View File

@@ -4,22 +4,18 @@
*/
package com.jeesite.modules.sys.utils;
import java.util.List;
import java.util.Set;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.SetUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.utils.SpringUtils;
import com.jeesite.modules.sys.entity.Company;
import com.jeesite.modules.sys.entity.Employee;
import com.jeesite.modules.sys.entity.EmployeeOffice;
import com.jeesite.modules.sys.entity.Office;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.entity.*;
import com.jeesite.modules.sys.service.CompanyService;
import com.jeesite.modules.sys.service.EmployeeService;
import com.jeesite.modules.sys.service.OfficeService;
import java.util.List;
import java.util.Set;
/**
* 员工部门工具类
* @author ThinkGem
@@ -55,7 +51,11 @@ public class EmpUtils {
*/
public static Employee get(User user){
if (user != null && User.USER_TYPE_EMPLOYEE.equals(user.getUserType())){
return user.getRefObj();
Employee employee = user.getRefObj();
if (employee == null) {
employee = Static.employeeService.get(user.getRefCode());
}
return employee;
}
return null;
}

View File

@@ -4,23 +4,6 @@
*/
package com.jeesite.modules.sys.utils;
import java.lang.reflect.Method;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.method.HandlerMethod;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.BaseEntity;
@@ -37,9 +20,23 @@ import com.jeesite.modules.sys.entity.Log;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.service.LogService;
import com.jeesite.modules.sys.service.MenuService;
import eu.bitwalker.useragentutils.UserAgent;
import io.netty.util.concurrent.DefaultThreadFactory;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.method.HandlerMethod;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* 日志工具类
@@ -167,7 +164,7 @@ public class LogUtils {
};
// 如果是BaseEntity的子类则获取主键名
if (superClass != null){
Table t = type.getAnnotation(Table.class);
Table t = MapperHelper.getTableCache(type);
for (Column c : t.columns()){
if (c.isPK()){
try {
@@ -217,8 +214,8 @@ public class LogUtils {
if (StringUtils.isBlank(log.getLogTitle())){
log.setLogTitle("未知操作");
}
// 如果有异常,设置异常信息(将异常对象转换为字符串)
log.setIsException(throwable != null ? Global.YES : Global.NO);
// 如果有异常,并且不是登录登出的日志,则设置异常信息(将异常对象转换为字符串)
log.setIsException(throwable != null && !Log.TYPE_LOGIN_LOGOUT.equals(log.getLogType()) ? Global.YES : Global.NO);
String message = ExceptionUtils.getExceptionMessage(throwable);
if (message != null) {
log.setExceptionInfo(message);

View File

@@ -4,13 +4,20 @@
*/
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 com.fasterxml.jackson.annotation.JsonView;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.shiro.filter.FormFilter;
import com.jeesite.common.shiro.realm.BaseAuthorizingRealm;
import com.jeesite.common.shiro.realm.LoginInfo;
import com.jeesite.common.web.BaseController;
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;
@@ -25,19 +32,10 @@ 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;
import com.jeesite.common.shiro.filter.FormFilter;
import com.jeesite.common.shiro.realm.BaseAuthorizingRealm;
import com.jeesite.common.shiro.realm.LoginInfo;
import com.jeesite.common.web.BaseController;
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.PwdUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 登录Controller
@@ -219,6 +217,13 @@ public class LoginController extends BaseController{
if (StringUtils.isBlank(successUrl)){
successUrl = (String)request.getAttribute("__url");
}
if (StringUtils.contains(successUrl, "://")){
String domain = ServletUtils.getRequestDomain(successUrl);
successUrl = StringUtils.substring(successUrl, domain.length());
if (StringUtils.startsWith(successUrl, request.getContextPath())) {
successUrl = StringUtils.substringAfter(successUrl, request.getContextPath());
}
}
if (StringUtils.isBlank(successUrl)){
successUrl = Global.getProperty("shiro.successUrl");
}
@@ -237,6 +242,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);
}
// 如果是登录操作,则跳转到登录成功页
@@ -379,6 +387,9 @@ public class LoginController extends BaseController{
public String switchSkin(@PathVariable String skinName, HttpServletRequest request, HttpServletResponse response) {
if (StringUtils.isNotBlank(skinName) && !"select".equals(skinName)){
CookieUtils.setCookie(response, "skinName", skinName);
if (ServletUtils.isAjaxRequest(request)) {
return renderResult(response, Global.TRUE, text("主题切换成功"));
}
return REDIRECT + adminPath + "/index";
}
return "modules/sys/switchSkin";

View File

@@ -4,19 +4,6 @@
*/
package com.jeesite.modules.sys.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authc.AuthenticationException;
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.RequestParam;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.ObjectUtils;
@@ -26,6 +13,18 @@ import com.jeesite.common.web.BaseController;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.utils.UserUtils;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authc.AuthenticationException;
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.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 单点登录Controller
@@ -36,7 +35,15 @@ import com.jeesite.modules.sys.utils.UserUtils;
@Api(tags = "SSO - 单点登录")
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class SsoController extends BaseController{
// public static void main(String[] args) {
// String username = "system";
// String secretKey = "test"; // Global.getConfig("shiro.sso.secretKey");
// String token = Md5Utils.md5(secretKey + username + DateUtils.getDate("yyyyMMdd"));
// System.out.println("http://192.168.56.1:8980/js/sso/" + username + "/" + token + "?url=/a/sys/office/index&relogin=true");
// System.out.println("http://192.168.56.1:3100/js/sso/" + username + "/" + token + "?url=../sys/office/index&relogin=true");
// }
/**
* 单点登录(如已经登录,则直接跳转)
* @param username 登录用户名loginCode
@@ -81,8 +88,4 @@ public class SsoController extends BaseController{
return "error/403";
}
// public static void main(String[] args) {
// System.out.println(UserUtils.getSsoToken("system"));
// }
}

View File

@@ -1,3 +0,0 @@
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.jeesite.autoconfigure.sys.SysAutoConfiguration

View File

@@ -0,0 +1 @@
com.jeesite.autoconfigure.sys.SysAutoConfiguration

View File

@@ -8,10 +8,9 @@ DIRECT_BYTE_OUTPUT = FALSE
HTML_TAG_SUPPORT = true
HTML_TAG_FLAG = #
HTML_TAG_BINDING_ATTRIBUTE = var,export
HTML_TAG_ATTR_CONVERT=org.beetl.core.text.DefaultAttributeNameConvert
HTML_TAG_ATTR_CONVERT=com.jeesite.common.beetl.text.BlankAttributeNameConvert
NATIVE_CALL = TRUE
TEMPLATE_CHARSET = UTF-8
#ERROR_HANDLER = org.beetl.core.ConsoleErrorHandler
ERROR_HANDLER = com.jeesite.common.beetl.handler.LoggerErrorHandler
NATIVE_SECUARTY_MANAGER = org.beetl.core.DefaultNativeSecurityManager
RESOURCE_LOADER = org.beetl.core.resource.ClasspathResourceLoader

View File

@@ -287,7 +287,8 @@ job:
isClustered: true
dataSourceName: job
clusterCheckinInterval: 1000
#className: org.springframework.scheduling.quartz.LocalDataSourceJobStore
className: org.springframework.scheduling.quartz.LocalDataSourceJobStore
misfireThreshold: 1000
# 调度日志配置
log:
@@ -398,6 +399,9 @@ shiro:
# 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链
#allowReferers: http://127.0.0.1,http://localhost
# 允许重定向的地址不设置为全部允许设置this只允许本项目内部跳转多个用逗号隔开例如this,http://*.jeesite.com
#allowRedirects: ~
# 是否在登录后生成新的Session默认false
isGenerateNewSessionAfterLogin: false
@@ -603,6 +607,9 @@ web:
# 静态文件后缀,过滤静态文件,以提高访问性能。
staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
# 静态资源缓存周期 Cache-Control单位秒1年
staticCachePeriod: 31536000
# 静态文件后缀排除的url路径指定哪些uri路径不进行静态文件过滤。
staticFileExcludeUri: /druid/
@@ -660,7 +667,7 @@ file:
# 设置允许上传的文件后缀(全局设置)
imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
# 允许上传的文件内容类型图片、word、excel、ppt防止修改后缀恶意上传文件默认不启用验证
# allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,
@@ -687,6 +694,9 @@ file:
# 是否用文件流方式下载(支持断点续传,下载)
isFileStreamDown: true
# 默认的预览类型true、oss
preview: true
# 视频转码
video:
@@ -701,6 +711,10 @@ video:
# 将mp4视频的元数据信息转到视频第一帧
qtFaststartFile: d:/tools/video/qt-faststart/qt-faststart.exe
# 文件管理是否启用租户模式
filemanager:
useCorpModel: false
#======================================#
#========== Message settings ==========#
#======================================#

View File

@@ -62,10 +62,10 @@ sys.error.returnButton=Previous page
sys.file.uploadFileIsEmpty=No files to upload!
sys.file.uploadValidNotBlank=File md5 and file name cannot be empty!
sys.file.uploadValidImage=Can only upload images ({0})
sys.file.uploadValidVideo=Can only upload video ({0})
sys.file.uploadValidFile=Can only upload document ({0})
sys.file.uploadValidAll=Format incorrect ({0})
sys.file.uploadValidImage=Can only upload images
sys.file.uploadValidVideo=Can only upload video
sys.file.uploadValidFile=Can only upload document
sys.file.uploadValidAll=File format is not allowed
sys.file.uploadValidSize=Size cannot exceed {0}
sys.file.uploadValidContent=File content format not allowed!
sys.file.uploadSuccessSeconds=Seconds upload success , time {0}

View File

@@ -62,10 +62,10 @@ sys.error.returnButton=前のページに戻る
sys.file.uploadFileIsEmpty=サーバーに該当ファイルはありません。
sys.file.uploadValidNotBlank=ファイル検証番号とファイル名を入力してください。
sys.file.uploadValidImage=画像のみアップロードできます{0}
sys.file.uploadValidVideo=動画のみアップロードできます{0}
sys.file.uploadValidFile=文書のみをアップロードできます{0}
sys.file.uploadValidAll=フォーマットが正しくありません{0}
sys.file.uploadValidImage=画像のみアップロードできます
sys.file.uploadValidVideo=動画のみアップロードできます
sys.file.uploadValidFile=文書のみをアップロードできます
sys.file.uploadValidAll=フォーマットが正しくありません
sys.file.uploadValidSize=サイズは{0}を超過できません
sys.file.uploadValidContent=ファイルコンテンツフォーマットは許可されていません。
sys.file.uploadSuccessSeconds=セカンドアップロード成功,時間{0}

View File

@@ -62,10 +62,10 @@ sys.error.returnButton=返回上一页
sys.file.uploadFileIsEmpty=服务器上没有这个文件!
sys.file.uploadValidNotBlank=文件校验码和文件名不能为空!
sys.file.uploadValidImage=只能上传图片{0}
sys.file.uploadValidVideo=只能上传视频{0}
sys.file.uploadValidFile=只能上传文档{0}
sys.file.uploadValidAll=格式不正确({0}
sys.file.uploadValidImage=只能上传图片
sys.file.uploadValidVideo=只能上传视频
sys.file.uploadValidFile=只能上传文档
sys.file.uploadValidAll=文件格式不允许
sys.file.uploadValidSize=大小不能超过{0}
sys.file.uploadValidContent=文件内容格式不允许!
sys.file.uploadSuccessSeconds=秒传成功,用时{0}

View File

@@ -7,7 +7,7 @@
SELECT ${sqlMap.column.toSql()}
FROM ${sqlMap.table.toSql()}
<if test="roleCode != null and roleCode != ''">
JOIN ${_prefix}sys_user_role ur ON ur.user_code = a.user_code
JOIN ${_prefix}sys_user_role ur2 ON ur2.user_code = a.user_code
</if>
<if test="employee.postCode != null and employee.postCode != ''">
JOIN ${_prefix}sys_employee_post ep ON e.emp_code = ep.emp_code
@@ -15,7 +15,7 @@
<where>
${sqlMap.where.toSql()}
<if test="roleCode != null and roleCode != ''">
AND ur.role_code = #{roleCode}
AND ur2.role_code = #{roleCode}
</if>
<if test="employee.postCode != null and employee.postCode != ''">
AND (
@@ -81,8 +81,8 @@
SELECT
<include refid="userColumns"/>
FROM ${_prefix}sys_user a
JOIN ${_prefix}sys_user_role ur ON ur.user_code = a.user_code
JOIN ${_prefix}sys_role r ON r.role_code = ur.role_code
JOIN ${_prefix}sys_user_role ur2 ON ur2.user_code = a.user_code
JOIN ${_prefix}sys_role r ON r.role_code = ur2.role_code
WHERE a.status = #{STATUS_NORMAL}
AND a.user_type = #{USER_TYPE_EMPLOYEE}
<if test="global.useCorpModel">

View File

@@ -10,8 +10,8 @@
<template>crud/service.xml</template>
<template>crud/controller.xml</template>
<template>crud/viewList.xml</template>
<template>crud/viewIndex.xml</template>
<template>crud/viewForm.xml</template>
<template>crud/viewIndex.xml</template>
<childTable>
<template>category-ref:dao</template>
</childTable>
@@ -22,8 +22,9 @@
<template>crud/controller.xml</template>
<template>crud/vueApi.xml</template>
<template>crud/vueList.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueForm.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueImport.xml</template>
<childTable>
<template>category-ref:dao</template>
</childTable>
@@ -31,8 +32,9 @@
<category value="crud_only_vue" label="单表/主子表 增删改查仅Vue">
<template>crud/vueApi.xml</template>
<template>crud/vueList.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueForm.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueImport.xml</template>
</category>
<category value="crud_select" label="单表/主子表 (增删改查,含 listselect 选择页面)">
<template>category-ref:crud</template>
@@ -70,6 +72,7 @@
<template>crud/vueList.xml</template>
<template>crud/vueIndex.xml</template>
<template>crud/vueForm.xml</template>
<template>crud/vueImport.xml</template>
<childTable>
<template>crud_cloud/mapper.xml</template>
<template>crud_cloud/entity.xml</template>

View File

@@ -9,9 +9,10 @@
package ${packageName}.${moduleName}.web${isNotEmpty(subModuleName)?'.'+subModuleName:''};
<% if (table.isTreeEntity){ %>
import java.util.List;
import java.util.Map;
<% }else{ %>
<% } %>
<% if (!table.isTreeEntity || toBoolean(table.optionMap['isImportExport'])){ %>
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
<% } %>
@@ -27,8 +28,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
<% if(table.isTreeEntity){ %>
<% if(table.isTreeEntity || toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.collect.ListUtils;
<% } %>
<% if(table.isTreeEntity){ %>
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.idgen.IdGen;
@@ -36,6 +39,12 @@ import com.jeesite.modules.sys.utils.UserUtils;
<% }else{ %>
import com.jeesite.common.entity.Page;
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.lang.DateUtils;
import com.jeesite.common.utils.excel.ExcelExport;
import com.jeesite.common.utils.excel.annotation.ExcelField.Type;
import org.springframework.web.multipart.MultipartFile;
<% } %>
<% if (table.tplCategory == 'crud_select'){ %>
import com.alibaba.fastjson.JSONValidator;
import com.jeesite.common.codec.EncodeUtils;
@@ -75,8 +84,8 @@ public class ${ClassName}Controller extends BaseController {
return ${className}Service.getAndValid(${className});
<% } %>
}
<% if(table.isTreeEntity){ %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
/**
* 管理主页
*/
@@ -204,6 +213,50 @@ public class ${ClassName}Controller extends BaseController {
${className}Service.save(${className});
return renderResult(Global.TRUE, text("保存${functionNameSimple}成功!"));
}
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
/**
* 导出数据
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "exportData")
public void exportData(${ClassName} ${className}, HttpServletResponse response) {
List<${ClassName}> list = ${className}Service.findList(${className});
String fileName = "${functionNameSimple}" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class)){
ee.setDataList(list).write(response, fileName);
}
}
/**
* 下载模板
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "importTemplate")
public void importTemplate(HttpServletResponse response) {
${ClassName} ${className} = new ${ClassName}();
List<${ClassName}> list = ListUtils.newArrayList(${className});
String fileName = "${functionNameSimple}模板.xlsx";
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class, Type.IMPORT)){
ee.setDataList(list).write(response, fileName);
}
}
/**
* 导入数据
*/
@ResponseBody
@RequiresPermissions("${permissionPrefix}:edit")
@PostMapping(value = "importData")
public String importData(MultipartFile file) {
try {
String message = ${className}Service.importData(file);
return renderResult(Global.TRUE, "posfull:"+message);
} catch (Exception ex) {
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
}
}
<% } %>
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
/**

View File

@@ -1,359 +1,375 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>entity</name>
<filePath>${baseDir}/src/main/java/${packagePath}/${moduleName}/entity/${subModuleName}</filePath>
<fileName>${ClassName}.java</fileName>
<content><![CDATA[
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
<% if(table.childList.~size > 0){ %>
import javax.validation.Valid;
<% } %>
<% for(i in table.importList){ %>
import ${i};
<% } %>
import com.jeesite.common.entity.DataEntity;
<% if(table.isTreeEntity){ %>
import com.jeesite.common.entity.TreeEntity;
<% } %>
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<% if(table.isTreeEntity){ %>
import com.jeesite.modules.bpm.entity.BpmTreeEntity;
<% }else{ %>
import com.jeesite.modules.bpm.entity.BpmEntity;
<% } %>
<% } %>
/**
* ${functionName}Entity
* @author ${functionAuthor}
* @version ${functionVersion}
*/
@Table(name="${table.genTableName}", alias="a", label="${functionNameSimple}信息", columns={
<%
var isBase = false, isData = false,
isTree = false, isExtend = false;
// ◆ 生成字段属性
for(c in table.columnList){
// ● 如果是BaseEntity类属性
if(table.isBaseEntity && c.isBaseEntityColumn){
if(!isBase){
isBase = true;
%>
@Column(includeEntity=BaseEntity.class),
<%
}
// ● 如果是DataEntity类属性
}else if(table.isDataEntity && c.isDataEntityColumn){
if(!isData){
isData = true;
%>
@Column(includeEntity=DataEntity.class),
<%
}
// ● 如果是TreeEntity类属性
}else if(table.isTreeEntity && c.isTreeEntityColumn){
if(!isTree){
isTree = true;
%>
@Column(includeEntity=TreeEntity.class),
<%
}
// ● 如果是Extend类属性
}else if(table.isExtendEntity && c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
@Column(includeEntity=Extend.class, attrName="extend"),
<%
}
// ● 其它情况下
}else{
// 容错,如果没有设置父表的主键属性,则设置
if(!@StringUtils.contains(c.attrName, ".")){
if (table.parentExists && table.parentTableFkName == c.columnName){
for (pk in table.parent.pkList){
c.fullAttrName = c.fullAttrName + '.' + pk.attrName;
break;
}
}
}
%>
@Column(name="${c.columnName}", attrName="${c.attrName}", label="${c.columnLabel}"<%
if (c.comments != c.columnLabel){
print(', comment="'+c.comments+'"');
}
if (c.isPk == @Global.YES){
print(', isPK=true');
}else{
if (c.isInsert != @Global.YES){
print(', isInsert=false');
}
if (c.isUpdate != @Global.YES){
print(', isUpdate=false');
}
if (c.isQuery == @Global.YES && @StringUtils.inString(c.queryType,
'NE', 'GT', 'GTE', 'LT', 'LTE', 'LIKE', 'LEFT_LIKE', 'RIGHT_LIKE')){
print(', queryType=QueryType.'+c.queryType);
}
if (c.isQuery != @Global.YES){
print(', isQuery=false');
}
if (c.attrName == table.treeViewNameAttrName){
print(', isTreeName=true');
}
if (c.isNull == @Global.YES && @StringUtils.inString(c.simpleAttrType,
'Long', 'Integer', 'Double', 'BigDecimal', 'Date')){
print(', isUpdateForce=true');
}
}
%>),
<%
}
}
%>
}, <%
// ◆ 生成关联表
var joinTables = '';
for(c in table.columnList){
if (c.attrType == 'com.jeesite.modules.sys.entity.User'){
var joinTable = {
%>
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
on="u${cLP.index}.user_code = a.${c.columnName}", columns={
@Column(name="user_code", label="用户编码", isPK=true),
@Column(name="user_name", label="用户名称", isQuery=false),
}),
<%
};
joinTables = joinTables + joinTable;
}
else if (c.attrType == 'com.jeesite.modules.sys.entity.Office'){
var joinTable = {
%>
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
on="u${cLP.index}.office_code = a.${c.columnName}", columns={
@Column(name="office_code", label="机构编码", isPK=true),
@Column(name="office_name", label="机构名称", isQuery=false),
}),
<%
};
joinTables = joinTables + joinTable;
}
}
if (isNotBlank(joinTables)){
print('joinTable={');
print(joinTables);
print('}, ');
}
// ◆ 生成排序字段
%>orderBy="<% if (isTree){
%>a.tree_sorts<%
for(pk in table.pkList){
%>, a.${pk.columnName}<%
}
}else if(table.parentExists && table.createDateExists){
%>a.create_date ASC<%
}else if(table.updateDateExists){
%>a.update_date DESC<%
}else{
for(pk in table.pkList){
%>${pkLP.index!=1?', ':''}a.${pk.columnName} ${table.parentExists?'ASC':'DESC'}<%
}
} %>"
)
public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(table.isTreeEntity?'BpmTree':'Bpm'):table.isTreeEntity?'Tree':'Data'}Entity<${ClassName}> {
private static final long serialVersionUID = 1L;
<%
isExtend = false;
// 生成字段属性
for(c in table.columnList){
// 如果是Extend类属性
if(table.isExtendEntity && c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
private Extend extend; // 扩展字段
<%
}
}
// 如果不是基类属性
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
// 父类对象
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
private ${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}; <% if (isNotBlank(c.comments)){ %>// ${c.comments} 父类<% } %>
<%
// 其它字段
}else{
%>
private ${c.simpleAttrType} ${c.simpleAttrName}; <%if(isNotBlank(c.comments)){%>// ${c.comments}<%}%>
<%
}
}
}
// 生成子表列表字段
for(child in table.childList){
%>
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
<%
}
// 生成构造方法
%>
public ${ClassName}() {
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
}
<%
// 生成带主键参数的构造
if (!table.parentExists){
if (table.pkList.~size == 1){ %>
public ${ClassName}(String id){
super(id);
}
<% }else{ %>
public ${ClassName}(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>){
<% for(pk in table.pkList){ %>
this.${pk.simpleAttrName} = ${pk.simpleAttrName};
<% } %>
}
<%
}
}
// 生成父表参数的构造
else{
for(c in table.columnList){
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
public ${ClassName}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}){
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
}
}
}
// 如果是树实体,则输出相应方法
if (table.isTreeEntity){
%>
@Override
public ${ClassName} getParent() {
return parent;
}
@Override
public void setParent(${ClassName} parent) {
this.parent = parent;
}
<%
}
// 生成属性的get和set方法
isExtend = false;
for(c in table.columnList){
// 如果是Extend类属性
if(c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
public Extend getExtend() {
return extend;
}
public void setExtend(Extend extend) {
this.extend = extend;
}
<%
}
// 如果不是基类属性
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
%>
<%
// 父类对象
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
public ${@StringUtils.cap(table.parent.className)} get${@StringUtils.cap(c.simpleAttrName)}() {
return ${c.simpleAttrName};
}
public void set${@StringUtils.cap(c.simpleAttrName)}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}) {
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
// 其它字段
}else{
for(a in c.simpleAnnotationList){
%>
@${a}
<%
}
%>
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}() {
return ${c.simpleAttrName};
}
public void set${@StringUtils.cap(c.simpleAttrName)}(${c.simpleAttrType} ${c.simpleAttrName}) {
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
}
}
}
// 生成条件字段get和set方法范围类型
for(c in table.columnList){
if(c.isQuery == "1" && c.queryType == "BETWEEN"){
%>
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_gte() {
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.GTE);
}
public void set${@StringUtils.cap(c.simpleAttrName)}_gte(${c.simpleAttrType} ${c.simpleAttrName}) {
sqlMap.getWhere().and("${c.columnName}", QueryType.GTE, ${c.simpleAttrName});
}
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_lte() {
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.LTE);
}
public void set${@StringUtils.cap(c.simpleAttrName)}_lte(${c.simpleAttrType} ${c.simpleAttrName}) {
sqlMap.getWhere().and("${c.columnName}", QueryType.LTE, ${c.simpleAttrName});
}
<%
}
}
// 生成子表列表get和set方法
for(child in table.childList){
%>
@Valid
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
return ${@StringUtils.uncap(child.className)}List;
}
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
}
<% } %>
}]]>
</content>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>entity</name>
<filePath>${baseDir}/src/main/java/${packagePath}/${moduleName}/entity/${subModuleName}</filePath>
<fileName>${ClassName}.java</fileName>
<content><![CDATA[
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
<% if(table.childList.~size > 0){ %>
import javax.validation.Valid;
<% } %>
<% for(i in table.importList){ %>
import ${i};
<% } %>
import com.jeesite.common.entity.DataEntity;
<% if(table.isTreeEntity){ %>
import com.jeesite.common.entity.TreeEntity;
<% } %>
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<% if(table.isTreeEntity){ %>
import com.jeesite.modules.bpm.entity.BpmTreeEntity;
<% }else{ %>
import com.jeesite.modules.bpm.entity.BpmEntity;
<% } %>
<% } %>
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.utils.excel.annotation.ExcelField;
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
import com.jeesite.common.utils.excel.annotation.ExcelFields;
<% } %>
/**
* ${functionName}Entity
* @author ${functionAuthor}
* @version ${functionVersion}
*/
@Table(name="${table.genTableName}", alias="a", label="${functionNameSimple}信息", columns={
<%
var isBase = false, isData = false,
isTree = false, isExtend = false;
// ◆ 生成字段属性
for(c in table.columnList){
// ● 如果是BaseEntity类属性
if(table.isBaseEntity && c.isBaseEntityColumn){
if(!isBase){
isBase = true;
%>
@Column(includeEntity=BaseEntity.class),
<%
}
// ● 如果是DataEntity类属性
}else if(table.isDataEntity && c.isDataEntityColumn){
if(!isData){
isData = true;
%>
@Column(includeEntity=DataEntity.class),
<%
}
// ● 如果是TreeEntity类属性
}else if(table.isTreeEntity && c.isTreeEntityColumn){
if(!isTree){
isTree = true;
%>
@Column(includeEntity=TreeEntity.class),
<%
}
// ● 如果是Extend类属性
}else if(table.isExtendEntity && c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
@Column(includeEntity=Extend.class, attrName="extend"),
<%
}
// ● 其它情况下
}else{
// 容错,如果没有设置父表的主键属性,则设置
if(!@StringUtils.contains(c.attrName, ".")){
if (table.parentExists && table.parentTableFkName == c.columnName){
for (pk in table.parent.pkList){
c.fullAttrName = c.fullAttrName + '.' + pk.attrName;
break;
}
}
}
%>
@Column(name="${c.columnName}", attrName="${c.attrName}", label="${c.columnLabel}"<%
if (c.comments != c.columnLabel){
print(', comment="'+c.comments+'"');
}
if (c.isPk == @Global.YES){
print(', isPK=true');
}else{
if (c.isInsert != @Global.YES){
print(', isInsert=false');
}
if (c.isUpdate != @Global.YES){
print(', isUpdate=false');
}
if (c.isQuery == @Global.YES && @StringUtils.inString(c.queryType,
'NE', 'GT', 'GTE', 'LT', 'LTE', 'LIKE', 'LEFT_LIKE', 'RIGHT_LIKE')){
print(', queryType=QueryType.'+c.queryType);
}
if (c.isQuery != @Global.YES){
print(', isQuery=false');
}
if (c.attrName == table.treeViewNameAttrName){
print(', isTreeName=true');
}
if (c.isNull == @Global.YES && @StringUtils.inString(c.simpleAttrType,
'Long', 'Integer', 'Double', 'BigDecimal', 'Date')){
print(', isUpdateForce=true');
}
}
%>),
<%
}
}
%>
}, <%
// ◆ 生成关联表
var joinTables = '';
for(c in table.columnList){
if (c.attrType == 'com.jeesite.modules.sys.entity.User'){
var joinTable = {
%>
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
on="u${cLP.index}.user_code = a.${c.columnName}", columns={
@Column(name="user_code", label="用户编码", isPK=true),
@Column(name="user_name", label="用户名称", isQuery=false),
}),
<%
};
joinTables = joinTables + joinTable;
}
else if (c.attrType == 'com.jeesite.modules.sys.entity.Office'){
var joinTable = {
%>
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
on="u${cLP.index}.office_code = a.${c.columnName}", columns={
@Column(name="office_code", label="机构编码", isPK=true),
@Column(name="office_name", label="机构名称", isQuery=false),
}),
<%
};
joinTables = joinTables + joinTable;
}
}
if (isNotBlank(joinTables)){
print('joinTable={');
print(joinTables);
print('}, ');
}
// ◆ 生成排序字段
%>orderBy="<% if (isTree){
%>a.tree_sorts<%
for(pk in table.pkList){
%>, a.${pk.columnName}<%
}
}else if(table.parentExists && table.createDateExists){
%>a.create_date ASC<%
}else if(table.updateDateExists){
%>a.update_date DESC<%
}else{
for(pk in table.pkList){
%>${pkLP.index!=1?', ':''}a.${pk.columnName} ${table.parentExists?'ASC':'DESC'}<%
}
} %>"
)
public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(table.isTreeEntity?'BpmTree':'Bpm'):table.isTreeEntity?'Tree':'Data'}Entity<${ClassName}> {
private static final long serialVersionUID = 1L;
<%
isExtend = false;
// 生成字段属性
for(c in table.columnList){
// 如果是Extend类属性
if(table.isExtendEntity && c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
private Extend extend; // 扩展字段
<%
}
}
// 如果不是基类属性
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
// 父类对象
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
private ${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}; <% if (isNotBlank(c.comments)){ %>// ${c.comments} 父类<% } %>
<%
// 其它字段
}else{
%>
private ${c.simpleAttrType} ${c.simpleAttrName}; <%if(isNotBlank(c.comments)){%>// ${c.comments}<%}%>
<%
}
}
}
// 生成子表列表字段
for(child in table.childList){
%>
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
<%
}
// 生成构造方法
%>
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
@ExcelFields({
<% for(c in table.columnList){ if(c.optionMap['isImportExport'] == @Global.YES){ %>
@ExcelField(title="${c.columnLabel}", attrName="${c.attrName}"${
isNotBlank(c.optionMap['dictType'])?', dictType="'+c.optionMap['dictType']+'"':''
}, align=Align.CENTER, sort=${c.columnSort}${
c.showType == 'date'?', dataFormat="yyyy-MM-dd"':c.showType == 'datetime'?', dataFormat="yyyy-MM-dd hh:mm"':''
}),
<% } } %>
})
<% } %>
public ${ClassName}() {
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
}
<%
// 生成带主键参数的构造
if (!table.parentExists){
if (table.pkList.~size == 1){ %>
public ${ClassName}(String id){
super(id);
}
<% }else{ %>
public ${ClassName}(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>){
<% for(pk in table.pkList){ %>
this.${pk.simpleAttrName} = ${pk.simpleAttrName};
<% } %>
}
<%
}
}
// 生成父表参数的构造
else{
for(c in table.columnList){
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
public ${ClassName}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}){
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
}
}
}
// 如果是树实体,则输出相应方法
if (table.isTreeEntity){
%>
@Override
public ${ClassName} getParent() {
return parent;
}
@Override
public void setParent(${ClassName} parent) {
this.parent = parent;
}
<%
}
// 生成属性的get和set方法
isExtend = false;
for(c in table.columnList){
// 如果是Extend类属性
if(c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
public Extend getExtend() {
return extend;
}
public void setExtend(Extend extend) {
this.extend = extend;
}
<%
}
// 如果不是基类属性
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
%>
<%
// 父类对象
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
public ${@StringUtils.cap(table.parent.className)} get${@StringUtils.cap(c.simpleAttrName)}() {
return ${c.simpleAttrName};
}
public void set${@StringUtils.cap(c.simpleAttrName)}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}) {
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
// 其它字段
}else{
for(a in c.simpleAnnotationList){
%>
@${a}
<%
}
%>
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}() {
return ${c.simpleAttrName};
}
public void set${@StringUtils.cap(c.simpleAttrName)}(${c.simpleAttrType} ${c.simpleAttrName}) {
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
}
}
}
// 生成条件字段get和set方法范围类型
for(c in table.columnList){
if(c.isQuery == "1" && c.queryType == "BETWEEN"){
%>
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_gte() {
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.GTE);
}
public void set${@StringUtils.cap(c.simpleAttrName)}_gte(${c.simpleAttrType} ${c.simpleAttrName}) {
sqlMap.getWhere().and("${c.columnName}", QueryType.GTE, ${c.simpleAttrName});
}
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_lte() {
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.LTE);
}
public void set${@StringUtils.cap(c.simpleAttrName)}_lte(${c.simpleAttrType} ${c.simpleAttrName}) {
sqlMap.getWhere().and("${c.columnName}", QueryType.LTE, ${c.simpleAttrName});
}
<%
}
}
// 生成子表列表get和set方法
for(child in table.childList){
%>
@Valid
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
return ${@StringUtils.uncap(child.className)}List;
}
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
}
<% } %>
}]]>
</content>
</template>

View File

@@ -23,9 +23,11 @@ import ${packageName}.${moduleName}.dao${isNotEmpty(subModuleName)?'.'+subModule
import java.util.Map;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.service.ServiceException;
import com.jeesite.modules.bpm.utils.BpmUtils;
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm']) || toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.service.ServiceException;
<% } %>
<% if(toBoolean(table.optionMap['isImageUpload']) || toBoolean(table.optionMap['isFileUpload'])){ %>
import com.jeesite.modules.file.utils.FileUploadUtils;
<% } %>
@@ -33,6 +35,14 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
import ${packageName}.${moduleName}.entity${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${@StringUtils.cap(child.className)};
import ${packageName}.${moduleName}.dao${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${@StringUtils.cap(child.className)}Dao;
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.config.Global;
import com.jeesite.common.validator.ValidatorUtils;
import com.jeesite.common.utils.excel.ExcelImport;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
<% } %>
/**
* ${functionName}Service
@@ -180,6 +190,57 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
}
<% } %>
}
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
/**
* 导入数据
* @param file 导入的数据文件
*/
@Transactional
public String importData(MultipartFile file) {
if (file == null){
throw new ServiceException(text("请选择导入的数据文件!"));
}
int successNum = 0; int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
try(ExcelImport ei = new ExcelImport(file, 2, 0)){
List<${ClassName}> list = ei.getDataList(${ClassName}.class);
for (${ClassName} ${className} : list) {
try{
ValidatorUtils.validateWithException(${className});
this.save(${className});
successNum++;
successMsg.append("<br/>" + successNum + "、编号 " + ${className}.getId() + " 导入成功");
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、编号 " + ${className}.getId() + " 导入失败:";
if (e instanceof ConstraintViolationException){
ConstraintViolationException cve = (ConstraintViolationException)e;
for (ConstraintViolation<?> violation : cve.getConstraintViolations()) {
msg += Global.getText(violation.getMessage()) + " ("+violation.getPropertyPath()+")";
}
}else{
msg += e.getMessage();
}
failureMsg.append(msg);
logger.error(msg, e);
}
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
failureMsg.append(e.getMessage());
return failureMsg.toString();
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}else{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
<% } %>
/**
* 更新状态

View File

@@ -15,11 +15,20 @@ import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
<% if(table.isTreeEntity){ %>
import { TreeDataModel, TreeModel } from '../model/baseModel';
<% }else if(isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
import { BasicModel, Page, TreeDataModel } from '../model/baseModel';
<% }else{ %>
import { BasicModel, Page } from '../model/baseModel';
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';
const { ctxPath, adminPath } = useGlobSetting();
<% }else{ %>
const { adminPath } = useGlobSetting();
<% } %>
export interface ${ClassName} extends ${table.isTreeEntity?'Tree':'Basic'}Model<${ClassName}> {
<%
@@ -87,6 +96,20 @@ export const ${className}CreateNextNode = (params?: ${ClassName} | any) =>
export const ${className}Save = (params?: any, data?: ${ClassName} | any) =>
defHttp.postJson<${ClassName}>({ url: adminPath + '/${urlPrefix}/save', params, data });
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
export const ${className}ImportData = (
params: UploadFileParams,
onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
defHttp.uploadFile<UploadApiResult>(
{
url: ctxPath + adminPath + '/${urlPrefix}/importData',
onUploadProgress,
},
params,
);
<% } %>
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
export const ${className}Disable = (params?: ${ClassName} | any) =>
@@ -98,7 +121,11 @@ export const ${className}Enable = (params?: ${ClassName} | any) =>
export const ${className}Delete = (params?: ${ClassName} | any) =>
defHttp.get<${ClassName}>({ url: adminPath + '/${urlPrefix}/delete', params });
<% if(table.isTreeEntity){ %>
<% if(isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
export const ${className}TreeData = (params?: any) =>
defHttp.get<TreeDataModel[]>({ url: adminPath + '${table.optionMap['leftTreeRightTableUrl']}', params });
<% }else if(table.isTreeEntity){ %>
export const ${className}TreeData = (params?: any) =>
defHttp.get<TreeDataModel[]>({ url: adminPath + '/${urlPrefix}/treeData', params });

View File

@@ -552,8 +552,8 @@ for (c in table.columnList){
<% } %>
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
resetFields();
setDrawerProps({ loading: true });
await resetFields();
const res = await ${className}Form(data);
record.value = (res.${className} || {}) as ${ClassName};
record.value.__t = new Date().getTime();

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>formImport</name>
<filePath>${frontDir}/src/views/${urlPrefix}</filePath>
<fileName>formImport.vue</fileName>
<content><![CDATA[
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author ${functionAuthor}
-->
<template>
<BasicModal
v-bind="$attrs"
:title="t('导入${functionNameSimple}')"
:okText="t('导入')"
@register="registerModal"
@ok="handleSubmit"
:minHeight="120"
:width="400"
>
<Upload
accept=".xls,.xlsx"
:file-list="fileList"
:remove="handleRemove"
:before-upload="beforeUpload"
>
<a-button> <Icon icon="ant-design:upload-outlined" /> {{ t('选择文件') }} </a-button>
<span class="ml-4">{{ uploadInfo }}</span>
</Upload>
<div class="ml-4 mt-4">
{{ t('提示仅允许导入“xls”或“xlsx”格式文件') }}
</div>
<div class="mt-4">
<a-button @click="handleDownloadTemplate()" type="text">
<Icon icon="fa:file-excel-o" />
{{ t('下载模板') }}
</a-button>
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { Upload } from 'ant-design-vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useMessage } from '/@/hooks/web/useMessage';
import { useGlobSetting } from '/@/hooks/setting';
import { downloadByUrl } from '/@/utils/file/download';
import { Icon } from '/@/components/Icon';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { ${className}ImportData } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}');
const { showMessage, showMessageModal } = useMessage();
const fileList = ref([]);
const uploadInfo = ref('');
const beforeUpload = (file: never) => {
fileList.value = [file];
return false;
};
const handleRemove = () => {
fileList.value = [];
};
const [registerModal, { setModalProps, closeModal }] = useModalInner(() => {
fileList.value = [];
uploadInfo.value = '';
});
async function handleDownloadTemplate() {
const { ctxAdminPath } = useGlobSetting();
downloadByUrl({
url: ctxAdminPath + '/${urlPrefix}/importTemplate',
target: '_self',
});
}
function onUploadProgress(progressEvent: ProgressEvent) {
const complete = ((progressEvent.loaded / progressEvent.total) * 100) | 0;
if (complete != 100) {
uploadInfo.value = t('正在导入,请稍后') + ' ' + complete + '%...';
} else {
uploadInfo.value = '';
}
}
async function handleSubmit() {
try {
if (fileList.value.length == 0) {
showMessage(t('请选择要导入的数据文件'));
return;
}
setModalProps({ confirmLoading: true });
const params = {
file: fileList.value[0],
};
const { data } = await ${className}ImportData(params, onUploadProgress);
showMessageModal({ content: data.message });
setTimeout(closeModal);
emit('success');
} catch (error: any) {
if (error && error.errorFields) {
showMessage(t('您填写的信息有误,请根据提示修正。'));
}
console.log('error', error);
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>
<% } %>
<% %>
]]>
</content>
</template>

View File

@@ -6,7 +6,7 @@
<filePath>${frontDir}/src/views/${urlPrefix}</filePath>
<fileName>index.vue</fileName>
<content><![CDATA[
<% if(table.isTreeEntity){ %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
@@ -40,7 +40,7 @@
import { ${className}TreeData } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
import ListView from './list.vue';
const { t } = useI18n('sys.menu');
const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}');
const treeCode = ref<string>('');
function handleSelect(keys: string[]) {

View File

@@ -27,6 +27,14 @@
<Icon icon="bi:chevron-double-up" /> {{ t('折叠') }}
</a-button>
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<a-button type="default" @click="handleExport()">
<Icon icon="ant-design:download-outlined" /> {{ t('导出') }}
</a-button>
<a-button type="default" @click="handleImport()">
<Icon icon="ant-design:upload-outlined" /> {{ t('导入') }}
</a-button>
<% } %>
<a-button type="primary" @click="handleForm({})" v-auth="'${permissionPrefix}:edit'">
<Icon icon="fluent:add-12-filled" /> {{ t('新增') }}
</a-button>
@@ -72,6 +80,9 @@ if(table.isTreeEntity){
</template>
</BasicTable>
<InputForm @register="registerDrawer" @success="handleSuccess" />
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<FormImport @register="registerImportModal" @success="handleSuccess" />
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<BpmRuntimeTrace @register="registerTraceModal" />
<% } %>
@@ -83,9 +94,14 @@ if(table.isTreeEntity){
});
</script>
<script lang="ts" setup>
import { defineComponent<% if(table.isTreeEntity){ %>, watch, nextTick<% } %> } from 'vue';
import { defineComponent<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>, watch<% }
%><% if(table.isTreeEntity){ %>, nextTick<% } %> } from 'vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useMessage } from '/@/hooks/web/useMessage';
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
import { useGlobSetting } from '/@/hooks/setting';
import { downloadByUrl } from '/@/utils/file/download';
<% } %>
import { router } from '/@/router';
import { Icon } from '/@/components/Icon';
import { BasicTable, BasicColumn, useTable } from '/@/components/Table';
@@ -116,14 +132,19 @@ for(c in table.columnList){
import { areaTreeData } from '/@/api/sys/area';
<% } %>
import { useDrawer } from '/@/components/Drawer';
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<% if(toBoolean(table.optionMap['isBpmForm']) || toBoolean(table.optionMap['isImportExport'])){ %>
import { useModal } from '/@/components/Modal';
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
import { BpmRuntimeTrace } from '/@/components/Bpm';
<% } %>
import { FormProps } from '/@/components/Form';
import InputForm from './form.vue';
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
import FormImport from './formImport.vue';
<% } %>
<% if(table.isTreeEntity){ %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
const props = defineProps({
treeCode: String,
});
@@ -232,7 +253,7 @@ if(table.isTreeEntity){
dataIndex: '${c.attrName}',
width: 230,
align: 'left',
slots: { customRender: 'firstColumn' },
slot: 'firstColumn',
},
<%
firstColumn = false;
@@ -277,7 +298,7 @@ for(c in table.columnList){
dictType: '${c.optionMap['dictType']}',
<% } %>
<% if(firstColumn){ %>
slots: { customRender: 'firstColumn' },
slot: 'firstColumn',
<% } %>
},
<%
@@ -360,14 +381,9 @@ for(c in table.columnList){
};
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerTable, { reload<% if(table.isTreeEntity){ %>, expandAll, collapseAll, expandCollapse<% } %> }] = useTable({
const [registerTable, { reload<% if(table.isTreeEntity){ %>, expandAll, collapseAll, expandCollapse<% } %>, getForm }] = useTable({
api: ${className}ListData,
beforeFetch: (params) => {
<% if(table.isTreeEntity){ %>
<% for(pk in table.pkList){ %>
params.${pk.attrName} = props.treeCode;
<% } %>
<% } %>
return params;
},
columns: tableColumns,
@@ -381,14 +397,25 @@ for(c in table.columnList){
<% } %>
canResize: true,
});
<% if(table.isTreeEntity){ %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableFk'])){ %>
watch(
() => props.treeCode,
() => {
async () => {
await getForm().setFieldsValue({
<% if (isNotBlank(table.optionMap['leftTreeRightTableFk'])) { %>
'${table.optionMap['leftTreeRightTableFk']}': props.treeCode,
<% }else if(table.isTreeEntity){ %>
<% for(pk in table.pkList){ %>
'${pk.attrName}': props.treeCode,
<% } %>
<% } %>
});
reload();
},
);
<% } %>
<% if(table.isTreeEntity){ %>
function fetchSuccess() {
if (props.treeCode) {
@@ -400,6 +427,22 @@ for(c in table.columnList){
function handleForm(record: Recordable) {
openDrawer(true, record);
}
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
async function handleExport() {
const { ctxAdminPath } = useGlobSetting();
downloadByUrl({
url: ctxAdminPath + '/${urlPrefix}/exportData',
target: '_self',
});
}
const [registerImportModal, { openModal: importModal }] = useModal();
function handleImport() {
importModal(true, {});
}
<% } %>
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
async function handleDisable(record: Recordable) {

View File

@@ -10,7 +10,7 @@ package ${packageName}.${moduleName}.api${isNotEmpty(subModuleName)?'.'+subModul
import org.springframework.web.bind.annotation.RequestMapping;
import com.jeesite.common.service.rest.CrudServiceRest;
import com.jeesite.common.service.rest.${table.isTreeEntity?'Tree':'Crud'}ServiceRest;
import ${packageName}.${moduleName}.entity${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${ClassName};
/**

View File

@@ -9,9 +9,10 @@
package ${packageName}.${moduleName}.web${isNotEmpty(subModuleName)?'.'+subModuleName:''};
<% if (table.isTreeEntity){ %>
import java.util.List;
import java.util.Map;
<% }else{ %>
<% } %>
<% if (!table.isTreeEntity || toBoolean(table.optionMap['isImportExport'])){ %>
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
<% } %>
@@ -27,8 +28,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
<% if(table.isTreeEntity){ %>
<% if(table.isTreeEntity || toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.collect.ListUtils;
<% } %>
<% if(table.isTreeEntity){ %>
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.idgen.IdGen;
@@ -36,6 +39,12 @@ import com.jeesite.modules.sys.utils.UserUtils;
<% }else{ %>
import com.jeesite.common.entity.Page;
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.lang.DateUtils;
import com.jeesite.common.utils.excel.ExcelExport;
import com.jeesite.common.utils.excel.annotation.ExcelField.Type;
import org.springframework.web.multipart.MultipartFile;
<% } %>
<% if (table.tplCategory == 'crud_select'){ %>
import com.alibaba.fastjson.JSONValidator;
import com.jeesite.common.codec.EncodeUtils;
@@ -75,8 +84,8 @@ public class ${ClassName}Controller extends BaseController {
return ${className}Service.getAndValid(${className});
<% } %>
}
<% if(table.isTreeEntity){ %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
/**
* 管理主页
*/
@@ -204,6 +213,50 @@ public class ${ClassName}Controller extends BaseController {
${className}Service.save(${className});
return renderResult(Global.TRUE, text("保存${functionNameSimple}成功!"));
}
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
/**
* 导出数据
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "exportData")
public void exportData(${ClassName} ${className}, HttpServletResponse response) {
List<${ClassName}> list = ${className}Service.findList(${className});
String fileName = "${functionNameSimple}" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class)){
ee.setDataList(list).write(response, fileName);
}
}
/**
* 下载模板
*/
@RequiresPermissions("${permissionPrefix}:view")
@RequestMapping(value = "importTemplate")
public void importTemplate(HttpServletResponse response) {
${ClassName} ${className} = new ${ClassName}();
List<${ClassName}> list = ListUtils.newArrayList(${className});
String fileName = "${functionNameSimple}模板.xlsx";
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class, Type.IMPORT)){
ee.setDataList(list).write(response, fileName);
}
}
/**
* 导入数据
*/
@ResponseBody
@RequiresPermissions("${permissionPrefix}:edit")
@PostMapping(value = "importData")
public String importData(MultipartFile file) {
try {
String message = ${className}Service.importData(file);
return renderResult(Global.TRUE, "posfull:"+message);
} catch (Exception ex) {
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
}
}
<% } %>
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
/**

View File

@@ -1,356 +1,375 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>entity</name>
<filePath>${baseDir}/${moduleName}-client/src/main/java/${packagePath}/${moduleName}/entity/${subModuleName}</filePath>
<fileName>${ClassName}.java</fileName>
<content><![CDATA[
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
<% for(i in table.importList){ %>
import ${i};
<% } %>
import com.jeesite.common.entity.DataEntity;
<% if(table.isTreeEntity){ %>
import com.jeesite.common.entity.TreeEntity;
<% } %>
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<% if(table.isTreeEntity){ %>
import com.jeesite.modules.bpm.entity.BpmTreeEntity;
<% }else{ %>
import com.jeesite.modules.bpm.entity.BpmEntity;
<% } %>
<% } %>
/**
* ${functionName}Entity
* @author ${functionAuthor}
* @version ${functionVersion}
*/
@Table(name="${table.genTableName}", alias="a", label="${functionNameSimple}信息", columns={
<%
var isBase = false, isData = false,
isTree = false, isExtend = false;
// ◆ 生成字段属性
for(c in table.columnList){
// ● 如果是BaseEntity类属性
if(table.isBaseEntity && c.isBaseEntityColumn){
if(!isBase){
isBase = true;
%>
@Column(includeEntity=BaseEntity.class),
<%
}
// ● 如果是DataEntity类属性
}else if(table.isDataEntity && c.isDataEntityColumn){
if(!isData){
isData = true;
%>
@Column(includeEntity=DataEntity.class),
<%
}
// ● 如果是TreeEntity类属性
}else if(table.isTreeEntity && c.isTreeEntityColumn){
if(!isTree){
isTree = true;
%>
@Column(includeEntity=TreeEntity.class),
<%
}
// ● 如果是Extend类属性
}else if(table.isExtendEntity && c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
@Column(includeEntity=Extend.class, attrName="extend"),
<%
}
// ● 其它情况下
}else{
// 容错,如果没有设置父表的主键属性,则设置
if(!@StringUtils.contains(c.attrName, ".")){
if (table.parentExists && table.parentTableFkName == c.columnName){
for (pk in table.parent.pkList){
c.fullAttrName = c.fullAttrName + '.' + pk.attrName;
break;
}
}
}
%>
@Column(name="${c.columnName}", attrName="${c.attrName}", label="${c.columnLabel}"<%
if (c.comments != c.columnLabel){
print(', comment="'+c.comments+'"');
}
if (c.isPk == @Global.YES){
print(', isPK=true');
}else{
if (c.isInsert != @Global.YES){
print(', isInsert=false');
}
if (c.isUpdate != @Global.YES){
print(', isUpdate=false');
}
if (c.isQuery == @Global.YES && @StringUtils.inString(c.queryType,
'NE', 'GT', 'GTE', 'LT', 'LTE', 'LIKE', 'LEFT_LIKE', 'RIGHT_LIKE')){
print(', queryType=QueryType.'+c.queryType);
}
if (c.isQuery != @Global.YES){
print(', isQuery=false');
}
if (c.attrName == table.treeViewNameAttrName){
print(', isTreeName=true');
}
if (c.isNull == @Global.YES && @StringUtils.inString(c.simpleAttrType,
'Long', 'Integer', 'Double', 'BigDecimal', 'Date')){
print(', isUpdateForce=true');
}
}
%>),
<%
}
}
%>
}, <%
// ◆ 生成关联表
var joinTables = '';
for(c in table.columnList){
if (c.attrType == 'com.jeesite.modules.sys.entity.User'){
var joinTable = {
%>
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
on="u${cLP.index}.user_code = a.${c.columnName}", columns={
@Column(name="user_code", label="用户编码", isPK=true),
@Column(name="user_name", label="用户名称", isQuery=false),
}),
<%
};
joinTables = joinTables + joinTable;
}
else if (c.attrType == 'com.jeesite.modules.sys.entity.Office'){
var joinTable = {
%>
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
on="u${cLP.index}.office_code = a.${c.columnName}", columns={
@Column(name="office_code", label="机构编码", isPK=true),
@Column(name="office_name", label="机构名称", isQuery=false),
}),
<%
};
joinTables = joinTables + joinTable;
}
}
if (isNotBlank(joinTables)){
print('joinTable={');
print(joinTables);
print('}, ');
}
// ◆ 生成排序字段
%>orderBy="<% if (isTree){
%>a.tree_sorts<%
for(pk in table.pkList){
%>, a.${pk.columnName}<%
}
}else if(table.parentExists && table.createDateExists){
%>a.create_date ASC<%
}else if(table.updateDateExists){
%>a.update_date DESC<%
}else{
for(pk in table.pkList){
%>${pkLP.index!=1?', ':''}a.${pk.columnName} ${table.parentExists?'ASC':'DESC'}<%
}
} %>"
)
public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(table.isTreeEntity?'BpmTree':'Bpm'):table.isTreeEntity?'Tree':'Data'}Entity<${ClassName}> {
private static final long serialVersionUID = 1L;
<%
isExtend = false;
// 生成字段属性
for(c in table.columnList){
// 如果是Extend类属性
if(table.isExtendEntity && c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
private Extend extend; // 扩展字段
<%
}
}
// 如果不是基类属性
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
// 父类对象
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
private ${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}; <% if (isNotBlank(c.comments)){ %>// ${c.comments} 父类<% } %>
<%
// 其它字段
}else{
%>
private ${c.simpleAttrType} ${c.simpleAttrName}; <%if(isNotBlank(c.comments)){%>// ${c.comments}<%}%>
<%
}
}
}
// 生成子表列表字段
for(child in table.childList){
%>
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
<%
}
// 生成构造方法
%>
public ${ClassName}() {
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
}
<%
// 生成带主键参数的构造
if (!table.parentExists){
if (table.pkList.~size == 1){ %>
public ${ClassName}(String id){
super(id);
}
<% }else{ %>
public ${ClassName}(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>){
<% for(pk in table.pkList){ %>
this.${pk.simpleAttrName} = ${pk.simpleAttrName};
<% } %>
}
<%
}
}
// 生成父表参数的构造
else{
for(c in table.columnList){
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
public ${ClassName}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}){
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
}
}
}
// 如果是树实体,则输出相应方法
if (table.isTreeEntity){
%>
@Override
public ${ClassName} getParent() {
return parent;
}
@Override
public void setParent(${ClassName} parent) {
this.parent = parent;
}
<%
}
// 生成属性的get和set方法
isExtend = false;
for(c in table.columnList){
// 如果是Extend类属性
if(c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
public Extend getExtend() {
return extend;
}
public void setExtend(Extend extend) {
this.extend = extend;
}
<%
}
// 如果不是基类属性
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
%>
<%
// 父类对象
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
public ${@StringUtils.cap(table.parent.className)} get${@StringUtils.cap(c.simpleAttrName)}() {
return ${c.simpleAttrName};
}
public void set${@StringUtils.cap(c.simpleAttrName)}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}) {
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
// 其它字段
}else{
for(a in c.simpleAnnotationList){
%>
@${a}
<%
}
%>
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}() {
return ${c.simpleAttrName};
}
public void set${@StringUtils.cap(c.simpleAttrName)}(${c.simpleAttrType} ${c.simpleAttrName}) {
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
}
}
}
// 生成条件字段get和set方法范围类型
for(c in table.columnList){
if(c.isQuery == "1" && c.queryType == "BETWEEN"){
%>
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_gte() {
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.GTE);
}
public void set${@StringUtils.cap(c.simpleAttrName)}_gte(${c.simpleAttrType} ${c.simpleAttrName}) {
sqlMap.getWhere().and("${c.columnName}", QueryType.GTE, ${c.simpleAttrName});
}
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_lte() {
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.LTE);
}
public void set${@StringUtils.cap(c.simpleAttrName)}_lte(${c.simpleAttrType} ${c.simpleAttrName}) {
sqlMap.getWhere().and("${c.columnName}", QueryType.LTE, ${c.simpleAttrName});
}
<%
}
}
// 生成子表列表get和set方法
for(child in table.childList){
%>
@Valid
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
return ${@StringUtils.uncap(child.className)}List;
}
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
}
<% } %>
}]]>
</content>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
No deletion without permission, or be held responsible to law. -->
<template>
<name>entity</name>
<filePath>${baseDir}/${moduleName}-client/src/main/java/${packagePath}/${moduleName}/entity/${subModuleName}</filePath>
<fileName>${ClassName}.java</fileName>
<content><![CDATA[
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
<% if(table.childList.~size > 0){ %>
import javax.validation.Valid;
<% } %>
<% for(i in table.importList){ %>
import ${i};
<% } %>
import com.jeesite.common.entity.DataEntity;
<% if(table.isTreeEntity){ %>
import com.jeesite.common.entity.TreeEntity;
<% } %>
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
<% if(table.isTreeEntity){ %>
import com.jeesite.modules.bpm.entity.BpmTreeEntity;
<% }else{ %>
import com.jeesite.modules.bpm.entity.BpmEntity;
<% } %>
<% } %>
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.utils.excel.annotation.ExcelField;
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
import com.jeesite.common.utils.excel.annotation.ExcelFields;
<% } %>
/**
* ${functionName}Entity
* @author ${functionAuthor}
* @version ${functionVersion}
*/
@Table(name="${table.genTableName}", alias="a", label="${functionNameSimple}信息", columns={
<%
var isBase = false, isData = false,
isTree = false, isExtend = false;
// ◆ 生成字段属性
for(c in table.columnList){
// ● 如果是BaseEntity类属性
if(table.isBaseEntity && c.isBaseEntityColumn){
if(!isBase){
isBase = true;
%>
@Column(includeEntity=BaseEntity.class),
<%
}
// ● 如果是DataEntity类属性
}else if(table.isDataEntity && c.isDataEntityColumn){
if(!isData){
isData = true;
%>
@Column(includeEntity=DataEntity.class),
<%
}
// ● 如果是TreeEntity类属性
}else if(table.isTreeEntity && c.isTreeEntityColumn){
if(!isTree){
isTree = true;
%>
@Column(includeEntity=TreeEntity.class),
<%
}
// ● 如果是Extend类属性
}else if(table.isExtendEntity && c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
@Column(includeEntity=Extend.class, attrName="extend"),
<%
}
// ● 其它情况下
}else{
// 容错,如果没有设置父表的主键属性,则设置
if(!@StringUtils.contains(c.attrName, ".")){
if (table.parentExists && table.parentTableFkName == c.columnName){
for (pk in table.parent.pkList){
c.fullAttrName = c.fullAttrName + '.' + pk.attrName;
break;
}
}
}
%>
@Column(name="${c.columnName}", attrName="${c.attrName}", label="${c.columnLabel}"<%
if (c.comments != c.columnLabel){
print(', comment="'+c.comments+'"');
}
if (c.isPk == @Global.YES){
print(', isPK=true');
}else{
if (c.isInsert != @Global.YES){
print(', isInsert=false');
}
if (c.isUpdate != @Global.YES){
print(', isUpdate=false');
}
if (c.isQuery == @Global.YES && @StringUtils.inString(c.queryType,
'NE', 'GT', 'GTE', 'LT', 'LTE', 'LIKE', 'LEFT_LIKE', 'RIGHT_LIKE')){
print(', queryType=QueryType.'+c.queryType);
}
if (c.isQuery != @Global.YES){
print(', isQuery=false');
}
if (c.attrName == table.treeViewNameAttrName){
print(', isTreeName=true');
}
if (c.isNull == @Global.YES && @StringUtils.inString(c.simpleAttrType,
'Long', 'Integer', 'Double', 'BigDecimal', 'Date')){
print(', isUpdateForce=true');
}
}
%>),
<%
}
}
%>
}, <%
// ◆ 生成关联表
var joinTables = '';
for(c in table.columnList){
if (c.attrType == 'com.jeesite.modules.sys.entity.User'){
var joinTable = {
%>
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
on="u${cLP.index}.user_code = a.${c.columnName}", columns={
@Column(name="user_code", label="用户编码", isPK=true),
@Column(name="user_name", label="用户名称", isQuery=false),
}),
<%
};
joinTables = joinTables + joinTable;
}
else if (c.attrType == 'com.jeesite.modules.sys.entity.Office'){
var joinTable = {
%>
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
on="u${cLP.index}.office_code = a.${c.columnName}", columns={
@Column(name="office_code", label="机构编码", isPK=true),
@Column(name="office_name", label="机构名称", isQuery=false),
}),
<%
};
joinTables = joinTables + joinTable;
}
}
if (isNotBlank(joinTables)){
print('joinTable={');
print(joinTables);
print('}, ');
}
// ◆ 生成排序字段
%>orderBy="<% if (isTree){
%>a.tree_sorts<%
for(pk in table.pkList){
%>, a.${pk.columnName}<%
}
}else if(table.parentExists && table.createDateExists){
%>a.create_date ASC<%
}else if(table.updateDateExists){
%>a.update_date DESC<%
}else{
for(pk in table.pkList){
%>${pkLP.index!=1?', ':''}a.${pk.columnName} ${table.parentExists?'ASC':'DESC'}<%
}
} %>"
)
public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(table.isTreeEntity?'BpmTree':'Bpm'):table.isTreeEntity?'Tree':'Data'}Entity<${ClassName}> {
private static final long serialVersionUID = 1L;
<%
isExtend = false;
// 生成字段属性
for(c in table.columnList){
// 如果是Extend类属性
if(table.isExtendEntity && c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
private Extend extend; // 扩展字段
<%
}
}
// 如果不是基类属性
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
// 父类对象
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
private ${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}; <% if (isNotBlank(c.comments)){ %>// ${c.comments} 父类<% } %>
<%
// 其它字段
}else{
%>
private ${c.simpleAttrType} ${c.simpleAttrName}; <%if(isNotBlank(c.comments)){%>// ${c.comments}<%}%>
<%
}
}
}
// 生成子表列表字段
for(child in table.childList){
%>
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
<%
}
// 生成构造方法
%>
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
@ExcelFields({
<% for(c in table.columnList){ if(c.optionMap['isImportExport'] == @Global.YES){ %>
@ExcelField(title="${c.columnLabel}", attrName="${c.attrName}"${
isNotBlank(c.optionMap['dictType'])?', dictType="'+c.optionMap['dictType']+'"':''
}, align=Align.CENTER, sort=${c.columnSort}${
c.showType == 'date'?', dataFormat="yyyy-MM-dd"':c.showType == 'datetime'?', dataFormat="yyyy-MM-dd hh:mm"':''
}),
<% } } %>
})
<% } %>
public ${ClassName}() {
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
}
<%
// 生成带主键参数的构造
if (!table.parentExists){
if (table.pkList.~size == 1){ %>
public ${ClassName}(String id){
super(id);
}
<% }else{ %>
public ${ClassName}(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>){
<% for(pk in table.pkList){ %>
this.${pk.simpleAttrName} = ${pk.simpleAttrName};
<% } %>
}
<%
}
}
// 生成父表参数的构造
else{
for(c in table.columnList){
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
public ${ClassName}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}){
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
}
}
}
// 如果是树实体,则输出相应方法
if (table.isTreeEntity){
%>
@Override
public ${ClassName} getParent() {
return parent;
}
@Override
public void setParent(${ClassName} parent) {
this.parent = parent;
}
<%
}
// 生成属性的get和set方法
isExtend = false;
for(c in table.columnList){
// 如果是Extend类属性
if(c.isExtendColumn){
if(!isExtend){
isExtend = true;
%>
public Extend getExtend() {
return extend;
}
public void setExtend(Extend extend) {
this.extend = extend;
}
<%
}
// 如果不是基类属性
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
%>
<%
// 父类对象
if(table.parentExists && table.parentTableFkName == c.columnName){
%>
public ${@StringUtils.cap(table.parent.className)} get${@StringUtils.cap(c.simpleAttrName)}() {
return ${c.simpleAttrName};
}
public void set${@StringUtils.cap(c.simpleAttrName)}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}) {
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
// 其它字段
}else{
for(a in c.simpleAnnotationList){
%>
@${a}
<%
}
%>
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}() {
return ${c.simpleAttrName};
}
public void set${@StringUtils.cap(c.simpleAttrName)}(${c.simpleAttrType} ${c.simpleAttrName}) {
this.${c.simpleAttrName} = ${c.simpleAttrName};
}
<%
}
}
}
// 生成条件字段get和set方法范围类型
for(c in table.columnList){
if(c.isQuery == "1" && c.queryType == "BETWEEN"){
%>
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_gte() {
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.GTE);
}
public void set${@StringUtils.cap(c.simpleAttrName)}_gte(${c.simpleAttrType} ${c.simpleAttrName}) {
sqlMap.getWhere().and("${c.columnName}", QueryType.GTE, ${c.simpleAttrName});
}
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_lte() {
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.LTE);
}
public void set${@StringUtils.cap(c.simpleAttrName)}_lte(${c.simpleAttrType} ${c.simpleAttrName}) {
sqlMap.getWhere().and("${c.columnName}", QueryType.LTE, ${c.simpleAttrName});
}
<%
}
}
// 生成子表列表get和set方法
for(child in table.childList){
%>
@Valid
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
return ${@StringUtils.uncap(child.className)}List;
}
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
}
<% } %>
}]]>
</content>
</template>

View File

@@ -25,8 +25,10 @@ import ${packageName}.${moduleName}.api${isNotEmpty(subModuleName)?'.'+subModule
import java.util.Map;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.modules.bpm.utils.BpmUtils;
<% } %>
<% if(toBoolean(table.optionMap['isBpmForm']) || toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.service.ServiceException;
import com.jeesite.modules.bpm.utils.client.BpmUtils;
<% } %>
<% if(toBoolean(table.optionMap['isImageUpload']) || toBoolean(table.optionMap['isFileUpload'])){ %>
import com.jeesite.modules.file.utils.FileUploadUtils;
@@ -35,6 +37,14 @@ import com.jeesite.modules.file.utils.FileUploadUtils;
import ${packageName}.${moduleName}.entity${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${@StringUtils.cap(child.className)};
import ${packageName}.${moduleName}.dao${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${@StringUtils.cap(child.className)}Dao;
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
import com.jeesite.common.config.Global;
import com.jeesite.common.validator.ValidatorUtils;
import com.jeesite.common.utils.excel.ExcelImport;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
<% } %>
import io.seata.spring.annotation.GlobalTransactional;
@@ -187,6 +197,58 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
}
<% } %>
}
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
/**
* 导入数据
* @param file 导入的数据文件
*/
@Transactional
@GlobalTransactional
public String importData(MultipartFile file) {
if (file == null){
throw new ServiceException(text("请选择导入的数据文件!"));
}
int successNum = 0; int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
try(ExcelImport ei = new ExcelImport(file, 2, 0)){
List<${ClassName}> list = ei.getDataList(${ClassName}.class);
for (${ClassName} ${className} : list) {
try{
ValidatorUtils.validateWithException(${className});
this.save(${className});
successNum++;
successMsg.append("<br/>" + successNum + "、编号 " + ${className}.getId() + " 导入成功");
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、编号 " + ${className}.getId() + " 导入失败:";
if (e instanceof ConstraintViolationException){
ConstraintViolationException cve = (ConstraintViolationException)e;
for (ConstraintViolation<?> violation : cve.getConstraintViolations()) {
msg += Global.getText(violation.getMessage()) + " ("+violation.getPropertyPath()+")";
}
}else{
msg += e.getMessage();
}
failureMsg.append(msg);
logger.error(msg, e);
}
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
failureMsg.append(e.getMessage());
return failureMsg.toString();
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}else{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
<% } %>
/**
* 更新状态

View File

@@ -1,6 +1,6 @@
<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law. */%>
<% if(table.isTreeEntity){ %>
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
\<% layout('/layouts/default.html', {title: '${functionNameSimple}管理', libs: ['layout','zTree']}){ %>
<div class="ui-layout-west">
<div class="main-content">
@@ -36,12 +36,19 @@ $('body').layout({
var win = $("#mainFrame")[0].contentWindow;
// 树结构初始化加载
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{enable:true}},
async:{enable:true,autoParam:["id=parentCode"],url:"\${ctx}/${urlPrefix}/treeData"},
async:{enable:true,autoParam:["id=parentCode"],url:"\${ctx}${
isNotBlank(table.optionMap['leftTreeRightTableUrl'])
?table.optionMap['leftTreeRightTableUrl']
:'/'+urlPrefix+'/treeData'}"},
callback:{onClick:function(event, treeId, treeNode){
tree.expandNode(treeNode);
//win.$('button[type=reset]').click();
<% for(pk in table.pkList){ %>
<% if (isNotBlank(table.optionMap['leftTreeRightTableFk'])) { %>
win.$('#searchForm [name="${table.optionMap['leftTreeRightTableFk']}"]').val(treeNode.id);
<% }else{ %>
<% for(pk in table.pkList){ %>
win.$('#${pk.attrName}').val(treeNode.id);
<% } %>
<% } %>
win.page();
}}

View File

@@ -14,7 +14,13 @@
<a href="#" class="btn btn-default" id="btnExpandTreeNode" title="\${text('展开一级')}"><i class="fa fa-angle-double-down"></i> \${text('展开')}</a>
<a href="#" class="btn btn-default" id="btnCollapseTreeNode" title="\${text('折叠全部')}"><i class="fa fa-angle-double-up"></i> \${text('折叠')}</a>
<% } %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<a href="#" class="btn btn-default" id="btnExport"><i class="glyphicon glyphicon-export"></i> ${text('导出')}</a>
<% } %>
\<% if(hasPermi('${permissionPrefix}:edit')){ %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> ${text('导入')}</a>
<% } %>
<a href="\${ctx}/${urlPrefix}/form" class="btn btn-default btnTool" title="\${text('新增${functionNameSimple}')}"><i class="fa fa-plus"></i> \${text('新增')}</a>
\<% } %>
<a href="#" class="btn btn-default" id="btnSetting" title="\${text('设置')}"><i class="fa fa-navicon"></i></a>
@@ -30,4 +36,59 @@
</div>
</div>
\<% } %>
<% include('/templates/modules/gen/include/dataGridScript.html'){} %>
<% include('/templates/modules/gen/include/dataGridScript.html'){} %>
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
<script>
$('#btnExport').click(function(){
js.ajaxSubmitForm($('#searchForm'), {
url:'\${ctx}/${urlPrefix}/exportData',
downloadFile:true
});
});
$('#btnImport').click(function(){
js.layer.open({
type: 1,
area: ['400px'],
title: '\${text("导入${functionNameSimple}")}',
resize: false,
scrollbar: true,
content: js.template('importTpl'),
btn: ['<i class="fa fa-check"></i> \${text("导入")}',
'<i class="fa fa-remove"></i> \${text("关闭")}'],
btn1: function(index, layero){
var form = {
inputForm: layero.find('#inputForm'),
file: layero.find('#file').val()
};
if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
js.showMessage("\${text('文件不正确请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
return false;
}
js.ajaxSubmitForm(form.inputForm, function(data){
js.showMessage(data.message);
if(data.result == Global.TRUE){
js.layer.closeAll();
}
page();
}, "json");
return true;
}
});
});
</script>
<script id="importTpl" type="text/template">//<!--
<form id="inputForm" action="\${ctx}/${urlPrefix}/importData" method="post" enctype="multipart/form-data"
class="form-horizontal mt20 mb10" style="overflow:auto;max-height:200px;">
<div class="row">
<div class="col-xs-12 col-xs-offset-1">
<input type="file" id="file" name="file" class="form-file"/>
<div class="mt10 pt5" style="color:red">
\${text('提示仅允许导入“xls”或“xlsx”格式文件')}
</div>
<div class="mt10 pt5">
<a href="\${ctx}/${urlPrefix}/importTemplate" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> \${text('')}</a>
</div>
</div>
</div>
</form>
//--></script><% } %>

View File

@@ -31,7 +31,7 @@ cd app
jar -xvf web.war
rm web.war
cd WEB-INF
exec ./startup.sh
sh ./startup.sh
]]>
</content>
</template>

View File

@@ -70,7 +70,7 @@ spring:
server-addr: 127.0.0.1:8848
file-extension: yml
group: jeesite-cloud-50
ext-config:
extension-configs:
- data-id: application.yml
group: jeesite-cloud-50

View File

@@ -65,7 +65,7 @@
<label class="control-label col-sm-4" title="">
<span class="required ">*</span> 排序号:<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="treeSort" maxlength="10" class="form-control required digits"/>
<#form:input path="treeSort" maxlength="9" class="form-control required digits"/>
</div>
</div>
</div>

View File

@@ -62,7 +62,7 @@
<label class="control-label col-sm-4" title="">
<span class="required ">*</span> ${text('排序号')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="treeSort" maxlength="10" class="form-control required digits"/>
<#form:input path="treeSort" maxlength="9" class="form-control required digits"/>
</div>
</div>
</div>

View File

@@ -62,7 +62,7 @@
<label class="control-label col-sm-4" title="">
<span class="required ">*</span> ${text('排序号')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:input path="treeSort" maxlength="10" class="form-control required digits"/>
<#form:input path="treeSort" maxlength="9" class="form-control required digits"/>
</div>
</div>
</div>

View File

@@ -175,7 +175,7 @@ $('#corpCode_').change(function(){
var roleGrid = $("#roleGrid").dataGrid({
url: '${ctx}/sys/role/treeData',
postData: [
{name:'isAll',value:'true'} //<% // 显示所有角色(与上方两个条件互斥) %>
{name:'isAll', value:'true'}
],
columnModel: [
{header:'${text("角色名称")}', name:'name', sortable:false, width:100, align:"center"},

View File

@@ -4,15 +4,6 @@
*/
package com.jeesite.test;
import java.util.Date;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.entity.DataScope;
import com.jeesite.common.entity.Page;
@@ -20,18 +11,16 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.common.tests.BaseSpringContextTests;
import com.jeesite.modules.file.dao.FileUploadDao;
import com.jeesite.modules.file.entity.FileUpload;
import com.jeesite.modules.sys.dao.AreaDao;
import com.jeesite.modules.sys.dao.CompanyDao;
import com.jeesite.modules.sys.dao.ConfigDao;
import com.jeesite.modules.sys.dao.DictDataDao;
import com.jeesite.modules.sys.dao.EmpUserDao;
import com.jeesite.modules.sys.dao.UserDao;
import com.jeesite.modules.sys.entity.Area;
import com.jeesite.modules.sys.entity.Company;
import com.jeesite.modules.sys.entity.Config;
import com.jeesite.modules.sys.entity.DictData;
import com.jeesite.modules.sys.entity.EmpUser;
import com.jeesite.modules.sys.entity.User;
import com.jeesite.modules.sys.dao.*;
import com.jeesite.modules.sys.entity.*;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import java.util.Date;
import java.util.List;
/**
* Mapper测试
@@ -164,7 +153,8 @@ public class DaoMapperTest extends BaseSpringContextTests {
throw new Exception(e);
}
}
@Test
public static void main(String[] args) {
String a = null, b = null;
System.out.println("============ 基本测试 ============");
@@ -172,25 +162,25 @@ public class DaoMapperTest extends BaseSpringContextTests {
.getWhere().and("name", QueryType.EQ, "abc").toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name = #{sqlMap.where.name#EQ1.val}";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
a = new Config("1").getSqlMap().getWhere()
.and("name", QueryType.IN, new String[]{"1", "2", "3"}).toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name IN ( #{sqlMap.where.name#IN1.val[0]},"
+ " #{sqlMap.where.name#IN1.val[1]}, #{sqlMap.where.name#IN1.val[2]} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
a = new Config("1").getSqlMap().getWhere()
.or("name", QueryType.IN, new String[]{"1", "2", "3"}).toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} OR a.name IN ( #{sqlMap.where.name#IN1.val[0]},"
+ " #{sqlMap.where.name#IN1.val[1]}, #{sqlMap.where.name#IN1.val[2]} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ 重复赋值测试 ============");
a = new Config("1").getSqlMap().getWhere()
.and("name", QueryType.LIKE, "abc").and("name", QueryType.LIKE, "def").toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name LIKE #{sqlMap.where.name#LIKE1.val}";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ IN、NOT IN 测试 ============");
a = new Config("1").getSqlMap().getWhere()
.and("name", QueryType.IN, new String[]{"abc","def"})
@@ -198,13 +188,13 @@ public class DaoMapperTest extends BaseSpringContextTests {
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name IN ( #{sqlMap.where.name#IN1.val[0]}, #{sqlMap.where.name#IN1.val[1]} )"
+ " AND a.name2 NOT IN ( #{sqlMap.where.name2#NOT_IN1.val[0]}, #{sqlMap.where.name2#NOT_IN1.val[1]} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
a = new Config("1").getSqlMap().getWhere()
.and("name", QueryType.IN, null).and("name2", QueryType.IN, new String[]{})
.and("name3", QueryType.NOT_IN, ListUtils.newArrayList()).toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1}";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ 带括号测试 ============");
a = new Config("1").getSqlMap().getWhere()
.andBracket("name", QueryType.EQ, "abc", 1).or("name", QueryType.EQ, "def", 2)
@@ -212,7 +202,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ1.val}"
+ " OR a.name = #{sqlMap.where.name#EQ2.val} OR a.name = #{sqlMap.where.name#EQ3.val} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
a = new Config().getSqlMap().getWhere()
.andBracket("name", QueryType.EQ, "val1", 1).and("name", QueryType.NE, "val2", 11).endBracket(1)
.orBracket("name", QueryType.NE, "val3", 2).and("name", QueryType.NE, "val4", 22).endBracket(2)
@@ -222,41 +212,41 @@ public class DaoMapperTest extends BaseSpringContextTests {
+ " OR ( a.name != #{sqlMap.where.name#NE2.val} AND a.name != #{sqlMap.where.name#NE22.val} )"
+ " OR ( a.name != #{sqlMap.where.name#NE3.val} AND a.name = #{sqlMap.where.name#EQ33.val} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ 带括号部分空值测试 ============");
a = new Config("1").getSqlMap().getWhere()
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "def", 2)
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ2.val} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
a = new Config("1").getSqlMap().getWhere()
.andBracket("name", QueryType.EQ, "abc", 1).or("name", QueryType.EQ, "def", 2)
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ1.val}"
+ " OR a.name = #{sqlMap.where.name#EQ2.val} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
a = new Config("1").getSqlMap().getWhere()
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "def", 2)
.or("name", QueryType.EQ, "ghi", 3).endBracket().toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ2.val}"
+ " OR a.name = #{sqlMap.where.name#EQ3.val} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ 带括号全部空值测试 ============");
a = new Config("1").getSqlMap().getWhere()
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "", 2)
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} ";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
a = new Config().getSqlMap().getWhere()
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "", 2)
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
b = "";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ 实体嵌套测试 ============");
Company company = new Company("1");
company.setCreateDate_gte(new Date());
@@ -280,7 +270,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
a = new FileUpload().getSqlMap().getWhere().and("u.`user_name`", QueryType.EQ, "user1").toSql();
b = "a.`status` != #{STATUS_DELETE} AND u.`user_name` = #{sqlMap.where.u#_user_name_#EQ1.val}";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ 联合查询,返回到当前实体测试 ============");
FileUpload fileUpload = new FileUpload();
fileUpload.getSqlMap().getWhere().and("create_by", QueryType.IN, new String[]{"user1","user2"});
@@ -288,7 +278,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
b = "a.`status` != #{STATUS_DELETE} AND a.create_by IN ( #{sqlMap.where.create_by#IN1.val[0]},"
+ " #{sqlMap.where.create_by#IN1.val[1]} )";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ 联合查询属性为this时也可作为查询条件 ============");
FileUpload fileUpload2 = new FileUpload();
fileUpload2.setCreateByName("ThinkGem/JeeSite");
@@ -297,6 +287,27 @@ public class DaoMapperTest extends BaseSpringContextTests {
b = "a.`status` != #{STATUS_DELETE} AND a.create_by IN ( #{sqlMap.where.create_by#IN1.val[0]},"
+ " #{sqlMap.where.create_by#IN1.val[1]} ) AND u.`user_name` LIKE #{sqlMap.where#user_name#LIKE1}";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.out.println("============ 条件嵌套查询,可替代 andBracket、orBracket、endBracket v5.2.1+ ============");
a = new Config("1").getSqlMap().getWhere()
.and("name", QueryType.EQ, "abc", 1)
.and((w) -> w
.or("name", QueryType.EQ, "def", 2)
.or("name", QueryType.EQ, "ghi", 3))
.and((w) -> w
.or((w2) -> w2
.and("name", QueryType.EQ, "def", 4)
.and("name", QueryType.EQ, "", 5)
.and("name", QueryType.EQ_FORCE, "", 6))
.or((w2) -> w2
.and("name", QueryType.EQ, "def", 7)
.and("name", QueryType.EQ, "ghi", 8)))
.toSql();
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name = #{sqlMap.where.name#EQ1.val}" +
" AND (a.name = #{sqlMap.where.n#[0].name#EQ2.val} OR a.name = #{sqlMap.where.n#[0].name#EQ3.val})" +
" AND ((a.name = #{sqlMap.where.n#[1].n#[0].name#EQ4.val} AND a.name = #{sqlMap.where.n#[1].n#[0].name#EQ_FORCE6.val})" +
" OR (a.name = #{sqlMap.where.n#[1].n#[1].name#EQ7.val} AND a.name = #{sqlMap.where.n#[1].n#[1].name#EQ8.val}))";
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
System.exit(0);
}

View File

@@ -4,8 +4,8 @@ productName: JeeSite Demo
companyName: ThinkGem
# 产品版本、版权年份
productVersion: V5.0
copyrightYear: 2022
productVersion: V5.2
copyrightYear: 2023
# 数据库连接
jdbc:
@@ -13,7 +13,7 @@ jdbc:
# Mysql 数据库配置
type: mysql
driver: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/jeesite?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai
url: jdbc:mysql://127.0.0.1:3306/jeesite_v5?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai
username: root
password: 123456
testSql: SELECT 1

View File

@@ -1,36 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.13</version>
<version>2.7.8</version>
<relativePath />
</parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JeeSite Parent</name>
<url>http://jeesite.com</url>
<inceptionYear>2013-Now</inceptionYear>
<properties>
<!-- common version setting -->
<commons-io.version>2.11.0</commons-io.version>
<commons-text.version>1.9</commons-text.version>
<commons-text.version>1.10.0</commons-text.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<commons-email.version>1.5</commons-email.version>
<fst.version>2.57</fst.version>
<fastjson.version>1.2.83</fastjson.version>
<!-- <jackson.version>2.12.6</jackson.version> -->
<!-- <activation.version>1.1.1</activation.version> -->
<fastjson.version>1.2.83_noneautotype</fastjson.version>
<!--<jackson.version>2.12.6</jackson.version>-->
<!--<activation.version>1.1.1</activation.version>-->
<UserAgentUtils.version>1.21</UserAgentUtils.version>
<!-- <metadata-extractor.version>2.11.0</metadata-extractor.version> -->
<!--<metadata-extractor.version>2.11.0</metadata-extractor.version>-->
<thumbnailator.version>0.4.17</thumbnailator.version>
<twelvemonkeys.version>3.8.2</twelvemonkeys.version>
<blade-patchca.version>1.1.2</blade-patchca.version>
@@ -39,81 +40,72 @@
<poi.version>4.1.2</poi.version>
<pinyin4j.version>2.5.1</pinyin4j.version>
<groovy.version>3.0.10</groovy.version>
<!-- framework version setting -->
<mybatis.version>3.5.9</mybatis.version>
<mybatis.version>3.5.11</mybatis.version>
<mybatis-spring.version>2.0.7</mybatis-spring.version>
<jsqlparser.version>4.4</jsqlparser.version>
<druid.version>1.2.10</druid.version>
<shiro.version>1.9.0</shiro.version>
<jsqlparser.version>4.5</jsqlparser.version>
<druid.version>1.2.15</druid.version>
<shiro.version>1.11.0</shiro.version>
<j2cache.version>2.8.0-release</j2cache.version>
<swagger.version>1.6.0</swagger.version>
<log4j2.version>2.17.0</log4j2.version>
<!-- jdbc setting -->
<!-- <mysql.version>5.1.49</mysql.version> -->
<mysql.version>8.0.29</mysql.version>
<swagger.version>1.6.6</swagger.version>
<log4j2.version>2.18.0</log4j2.version>
<!-- environment setting -->
<java.version>1.8</java.version>
<!-- <tomcat.version>9.0.58</tomcat.version> -->
<!--<tomcat.version>9.0.58</tomcat.version>-->
<maven.test.skip>true</maven.test.skip>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version><!-- 降级到该版本新版本可能会出现VM崩溃 -->
<resource.delimiter>@</resource.delimiter>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version><!-- 其它版本可能会出现VM崩溃 -->
<eclipse-plugin-download-sources>false</eclipse-plugin-download-sources>
<eclipse-plugin-download-javadocs>false</eclipse-plugin-download-javadocs>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- docker setting -->
<docker.dockerHost>http://192.168.56.102:2375</docker.dockerHost>
<docker.imageName>thinkgem/${project.artifactId}:5.0</docker.imageName>
<docker.run.port>8980:8980</docker.run.port>
</properties>
<build>
<plugins>
<!-- compiler插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<!-- jar插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<!-- resource插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<!-- install插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
</plugin>
<!-- clean插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!-- compiler插件设定JDK版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<parameters>true</parameters>
<showWarnings>true</showWarnings>
<!-- <compilerArguments>
<verbose /> 输出有关编译器正在执行的操作的消息
@@ -126,8 +118,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifest>
<!--suppress UnresolvedMavenProperty -->
<mainClass>${start-class}</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
@@ -137,7 +135,7 @@
<excludes>
<exclude>userfiles/**</exclude>
</excludes>
<finalName>${project.artifactId}</finalName>
<finalName>${project.artifactId}</finalName>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
@@ -149,12 +147,12 @@
</execution>
</executions>
</plugin>
<!-- war插件war包名称不带版本号 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<version>3.3.2</version>
<configuration>
<warSourceExcludes>
userfiles/**
@@ -163,11 +161,55 @@
<warName>${project.artifactId}</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifest>
<!--suppress UnresolvedMavenProperty -->
<mainClass>${start-class}</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<!-- resource插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<propertiesEncoding>${project.build.sourceEncoding}</propertiesEncoding>
<delimiters>
<delimiter>${resource.delimiter}</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
<!-- exec插件 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- springboot插件 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<mainClass>${start-class}</mainClass>
</configuration>
</plugin>
<!-- Eclipse 插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -191,7 +233,7 @@
</additionalProjectnatures>
</configuration>
</plugin>
<!-- Java Document Generate -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -209,7 +251,7 @@
</execution>
</executions>
</plugin>
<!-- JavaScript CSS Compress -->
<plugin>
<groupId>com.jeesite.maven</groupId>
@@ -240,7 +282,7 @@
</excludes>
</configuration>
</plugin>
<!-- Eclipse m2e settings only -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
@@ -253,6 +295,7 @@
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<!--suppress UnresolvedMavenProperty -->
<versionRange>${maven-dependency-plugin.version}</versionRange>
<goals>
<goal>copy-dependencies</goal>
@@ -266,7 +309,7 @@
</lifecycleMappingMetadata>
</configuration>
</plugin>
<!-- Docker 插件 https://github.com/fabric8io/docker-maven-plugin -->
<plugin>
<groupId>io.fabric8</groupId>
@@ -297,11 +340,11 @@
</images>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<!-- 资源文件配置 -->
<resources>
<resource>
@@ -317,24 +360,24 @@
</excludes>
</resource>
</resources>
</build>
<developers>
<developers>
<developer>
<id>thinkgem</id>
<name>WangZhen</name>
<email>thinkgem at 163.com</email>
<roles><role>Project lead</role></roles>
<timezone>+8</timezone>
<timezone>+8</timezone>
</developer>
</developers>
<organization>
<name>JeeSite</name>
<url>http://jeesite.com</url>
</organization>
<repositories>
<repository>
<id>aliyun-repos</id>
@@ -359,9 +402,9 @@
<url>http://maven.jeesite.net/repository/maven-public</url>
</pluginRepository>
</pluginRepositories>
<profiles>
<profile>
<id>javadoc</id>
<build>
@@ -373,7 +416,7 @@
</plugins>
</build>
</profile>
<profile>
<id>package</id>
<build>
@@ -385,7 +428,7 @@
</plugins>
</build>
</profile>
<profile>
<id>deploy</id>
<build>

View File

@@ -5,7 +5,7 @@
<groupId>com.jeesite</groupId>
<artifactId>jeesite</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JeeSite</name>

View File

@@ -5,7 +5,7 @@
<groupId>com.jeesite</groupId>
<artifactId>jeesite-root</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JeeSite Root</name>

View File

@@ -18,4 +18,4 @@ ENTRYPOINT jar -xvf app.war && rm app.war && cd WEB-INF && sh startup.sh
EXPOSE 8980
#docker run -p 8980:8980 thinkgem/jeesite-web:5.0
#docker run -p 8980:8980 thinkgem/jeesite-web:5.1

View File

@@ -24,4 +24,4 @@ cd app
jar -xvf web.war
rm web.war
cd WEB-INF
exec ./startup.sh
sh ./startup.sh

View File

@@ -6,7 +6,7 @@ set global read_only=0;
create user 'jeesite'@'%' identified by 'jeesite';
create database jeesite DEFAULT CHARSET 'utf8' COLLATE 'utf8_general_ci';
create database jeesite DEFAULT CHARSET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite';

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

View File

@@ -4,13 +4,13 @@
*/
package com.jeesite.modules.test.dao;
import java.util.List;
import java.util.Map;
import com.jeesite.common.dao.CrudDao;
import com.jeesite.common.mybatis.annotation.MyBatisDao;
import com.jeesite.modules.test.entity.TestData;
import java.util.List;
import java.util.Map;
/**
* 测试数据DAO接口
* @author ThinkGem
@@ -22,6 +22,6 @@ public interface TestDataDao extends CrudDao<TestData> {
/**
* 演示Map参数和返回值支持分页
*/
public List<Map<String, Object>> findListForMap(Map<String, Object> params);
List<Map<String, Object>> findListForMap(Map<String, Object> params);
}

View File

@@ -8,8 +8,8 @@ productName: JeeSite Demo
companyName: ThinkGem
# 产品版本、版权年份
productVersion: V5.0
copyrightYear: 2022
productVersion: V5.2
copyrightYear: 2023
# 是否演示模式
demoMode: false
@@ -27,7 +27,7 @@ server:
servlet:
context-path: /js
register-default-servlet: false
encoding.enabled: true
# encoding.enabled: true
tomcat:
uri-encoding: UTF-8
# 表单请求数据的最大大小
@@ -590,6 +590,9 @@ shiro:
# # 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链
# allowReferers: http://127.0.0.1,http://localhost
#
# # 允许重定向的地址不设置为全部允许设置this只允许本项目内部跳转多个用逗号隔开例如this,http://*.jeesite.com
# allowRedirects: ~
#
# # 是否在登录后生成新的Session默认false
# isGenerateNewSessionAfterLogin: false
#
@@ -825,7 +828,7 @@ file:
# # 设置允许上传的文件后缀(全局设置)
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
#
# # 允许上传的文件内容类型图片、word、excel、ppt防止修改后缀恶意上传文件默认不启用验证
# #allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,

View File

@@ -6,7 +6,7 @@ set global read_only=0;
create user 'jeesite'@'%' identified by 'jeesite';
create database jeesite DEFAULT CHARSET 'utf8' COLLATE 'utf8_general_ci';
create database jeesite DEFAULT CHARSET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite';

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

View File

@@ -4,13 +4,13 @@
*/
package com.jeesite.modules.test.dao;
import java.util.List;
import java.util.Map;
import com.jeesite.common.dao.CrudDao;
import com.jeesite.common.mybatis.annotation.MyBatisDao;
import com.jeesite.modules.test.entity.TestData;
import java.util.List;
import java.util.Map;
/**
* 测试数据DAO接口
* @author ThinkGem
@@ -22,6 +22,6 @@ public interface TestDataDao extends CrudDao<TestData> {
/**
* 演示Map参数和返回值支持分页
*/
public List<Map<String, Object>> findListForMap(Map<String, Object> params);
List<Map<String, Object>> findListForMap(Map<String, Object> params);
}

View File

@@ -8,8 +8,8 @@ productName: JeeSite Demo
companyName: ThinkGem
# 产品版本、版权年份
productVersion: V5.0
copyrightYear: 2022
productVersion: V5.2
copyrightYear: 2023
# 是否演示模式
demoMode: false

View File

@@ -39,7 +39,7 @@
var windowHeight = $(window).height(),
headerHeight = $('.box-header').outerHeight() || 0,
footerHeight = $('.box-footer').outerHeight() || 0,
height = windowHeight - headerHeight - footerHeight - 13;
height = windowHeight - headerHeight - footerHeight - 20;
return height < 300 ? 300 : height;
}
});
@@ -59,7 +59,7 @@
var windowHeight = $(window).height(),
headerHeight = $('.box-header').outerHeight() || 0,
footerHeight = $('.box-footer').outerHeight() || 0,
height = windowHeight - headerHeight - footerHeight - 13;
height = windowHeight - headerHeight - footerHeight - 20;
return height < 300 ? 300 : height;
}
});

View File

@@ -18,4 +18,4 @@ ENTRYPOINT jar -xvf app.war && rm app.war && cd WEB-INF && sh startup.sh
EXPOSE 8980
#docker run -p 8980:8980 thinkgem/jeesite-web:5.0
#docker run -p 8980:8980 thinkgem/jeesite-web:5.1

View File

@@ -12,7 +12,7 @@ echo [
echo.
echo [<5B><>Ϣ] <20><> v4.2 <20><EFBFBD>Ժ󣬹ٷ<F3A3ACB9><D9B7><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF>DZȽϰ<C8BD>ȫ<EFBFBD>ģ<EFBFBD><C4A3>ٷ<EFBFBD><D9B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĽű<C4BD><C5B1><EFBFBD>
echo.
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> v4.2 <20>Ժ<EFBFBD><D4BA>İ<EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD><EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
echo [<5B><>Ϣ] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
echo.
pause

View File

@@ -13,7 +13,7 @@ echo "[信息] 本操作主要用于首次安装 JeeSite 或后安装 Module 的
echo ""
echo "[信息] 在 v4.2 版本以后,官方初始化数据库是比较安全的,官方代码中不会包含任何删除数据表及数据的脚本。"
echo ""
echo "[信息] 如果你是升级到 v4.2 以后的版本,无法排除你是否升级完整,为安全起见,建议先备份数据库后再操作。"
echo "[信息] 如果你是升级到版本,排除你是否升级完整,为安全起见,建议先备份数据库后再操作。"
echo ""
echo -n "请按任意键继续 ... "
read text

View File

@@ -24,4 +24,4 @@ cd app
jar -xvf web.war
rm web.war
cd WEB-INF
exec ./startup.sh
sh ./startup.sh

View File

@@ -6,7 +6,7 @@ set global read_only=0;
create user 'jeesite'@'%' identified by 'jeesite';
create database jeesite DEFAULT CHARSET 'utf8' COLLATE 'utf8_general_ci';
create database jeesite DEFAULT CHARSET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite';

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.2.1-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

View File

@@ -22,6 +22,6 @@ public interface TestDataDao extends CrudDao<TestData> {
/**
* 演示Map参数和返回值支持分页
*/
public List<Map<String, Object>> findListForMap(Map<String, Object> params);
List<Map<String, Object>> findListForMap(Map<String, Object> params);
}

View File

@@ -8,8 +8,8 @@ productName: JeeSite Demo
companyName: ThinkGem
# 产品版本、版权年份
productVersion: V5.0
copyrightYear: 2022
productVersion: V5.2
copyrightYear: 2023
# 是否演示模式
demoMode: false
@@ -27,7 +27,7 @@ server:
servlet:
context-path: /js
register-default-servlet: false
encoding.enabled: true
# encoding.enabled: true
tomcat:
uri-encoding: UTF-8
# 表单请求数据的最大大小
@@ -39,18 +39,18 @@ server:
# # 线程数最大和最小个数
# threads:
# max: 200
# min-spare: 10
# min-spare: 10
# 当 Nginx 为 httpstomcat 为 http 时,设置该选项为 true
schemeHttps: false
#======================================#
#========== Database sttings ==========#
#======================================#
# 数据库连接
jdbc:
jdbc:
# Mysql 数据库配置
type: mysql
driver: com.mysql.cj.jdbc.Driver
@@ -82,7 +82,7 @@ jdbc:
# username: jeesite
# password: jeesite
# testSql: SELECT 1
# # PostgreSql 数据库配置
# type: postgresql
# driver: org.postgresql.Driver
@@ -101,7 +101,7 @@ jdbc:
# 连接信息加密
encrypt:
# 加密连接用户名
username: false
# 加密连接密码
@@ -109,7 +109,7 @@ jdbc:
# 数据库连接池配置
pool:
# 初始化连接数
init: 1
# 最小空闲连接数
@@ -119,29 +119,29 @@ jdbc:
# # 获取连接等待超时时间单位毫秒1分钟4.0.6+
# maxWait: 60000
#
#
# # 从池中取出和归还连接前进行检验如果检验失败则从池中去除连接并尝试取出另一个4.0.6+
# testOnBorrow: false
# testOnReturn: false
#
#
# # 间隔多久才进行一次检测检测需要关闭的空闲连接单位毫秒1分钟4.0.6+
# timeBetweenEvictionRunsMillis: 60000
#
#
# # 一个连接在池中最小空闲的时间单位毫秒20分钟4.0.6+
# minEvictableIdleTimeMillis: 1200000
# # 一个连接在池中最大空闲的时间单位毫秒30分钟4.1.2+
# maxEvictableIdleTimeMillis: 1800000
#
#
# # 连接池中的minIdle数量以内的连接空闲时间超过minEvictableIdleTimeMillis则会执行keepAlive操作4.1.8+
# keepAlive: false
#
#
# # 是否自动回收泄露的连接和超时时间单位秒35分钟4.0.6+
# removeAbandoned: false
# removeAbandonedTimeout: 2100
#
# # Oracle 下会自动开启 PSCache并指定每个连接上 PSCache 大小。若不指定,则与 maxActive 相同4.1.5+
# maxPoolPreparedStatementPerConnectionSize: ~
#
#
# # 设置连接属性,可获取到表的 remark (备注)
# remarksReporting: false
@@ -154,7 +154,7 @@ jdbc:
#
# # 多数据源名称列表,多个用逗号隔开,使用方法:@MyBatisDao(dataSourceName="ds2")
# dataSourceNames: ds_read_01, ds_read_02
#
#
# # 默认数据源的从库01
# ds_read_01:
# type: mysql
@@ -167,7 +167,7 @@ jdbc:
# init: 1
# minIdle: 3
# maxActive: 20
#
#
# # 默认数据源的从库02
# ds_read_02:
# type: mysql
@@ -229,9 +229,9 @@ jdbc:
# # 事务超时时间单位秒30分钟v4.1.5+
# transactionTimeout: 1800
#
#
# # 表名和字段名(前缀|后缀是否强制大写v4.1.8+
# tableAndColumn:
# tableAndColumn:
# prefixSuffix: "`|`"
# forceUpperCase: true
#
@@ -243,15 +243,15 @@ jdbc:
#======================================#
spring:
# 应用程序名称
application:
name: jeesite-web
# 环境名称(注意:不可设置为 test 它是单元测试专用的名称)
profiles:
active: default
# 打印横幅
main:
bannerMode: "off"
@@ -260,7 +260,7 @@ spring:
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
# # Redis 连接参数 RedisProperties
# redis:
# host: 127.0.0.1
@@ -292,7 +292,7 @@ spring:
# 日志配置
logging:
config: classpath:config/logback-spring.xml
#======================================#
#========== System settings ===========#
#======================================#
@@ -305,16 +305,16 @@ logging:
# 分页相关
#page:
#
#
# # 默认每页显示的数据条数
# pageSize: 20
#
#
# # 每页最大条数,防止分页过大导致系统缓慢或内存溢出
# maxPageSize: 999
# 用户相关
user:
# # 指定超级管理员编号(研发团队使用的账号)
# superAdminCode: system
#
@@ -323,13 +323,13 @@ user:
#
# # 系统管理员角色编号(客户方管理员使用的角色)
# corpAdminRoleCode: corpAdmin
#
#
# # 二级管理员的控制权限类型1拥有的权限 2管理的权限管理功能包括用户管理、组织机构、公司管理等v4.1.5+
# adminCtrlPermi: 2
# 多租户模式SAAS模式专业版
useCorpModel: false
# # 登录账号是否租户内唯一,否则全局唯一
# loginCodeCorpUnique: false
#
@@ -388,9 +388,9 @@ user:
# # 以方便读取树结构数据权限的表时包含子节点,举例如下:
# # ctrlDataAttrName: "officeCodesAndChildren", ctrlDataParentCodesAttrName: ""
# dataScopeApiMode: false
# 角色管理
#role:
# 角色管理
#role:
# # 扩展数据权限定义3本部门4本公司5本部门和本公司
# extendDataScopes: >
# {
@@ -444,22 +444,22 @@ user:
# 国际化管理(专业版)
lang:
enabled: false
# # 默认语言4.1.3+
# defaultLocale: zh_CN
# # 默认时区4.1.3+
# defaultTimeZone: GMT+08:00
# 任务调度(标准版)
job:
enabled: false
# # 是否自动启动任务调度(可关闭)
# autoStartup: true
#
# # 任务调度启动延迟设置(单位:秒)(建议设置项目启动完成后的时间)
# startupDelay: 60
#
#
# # 任务调度线程池
# threadPool:
# threadCount: 10
@@ -499,7 +499,7 @@ job:
# 代码生成
gen:
enabled: true
# # 表名字段名是否强制小写
# forceLowerCase: true
@@ -513,7 +513,7 @@ state:
# Shiro 相关
shiro:
# 主页路径
defaultPath: ${shiro.loginUrl}
@@ -549,36 +549,36 @@ shiro:
#secretKey: thinkgem,jeesite,com
secretKey: Base64
#secretKey: ~
# 记住我密钥设置,你可以通过 com.jeesite.test.RememberMeKeyGen 类快速生成一个秘钥。
# 若不设置,则每次启动系统后自动生成一个新秘钥,这样会导致每次重启后,客户端记录的用户信息将失效。
rememberMe:
secretKey: ~
# # 指定获取客户端IP的Header名称防止IP伪造。指定为空则使用原生方法获取IP。
# remoteAddrHeaderName: X-Forwarded-For
#
#
# # 允许的请求方法设定解决安全审计问题BPM设计器用到了PUT或DELETE方法
# allowRequestMethods: GET, POST, OPTIONS, PUT, DELETE
#
#
# # 是否允许账号多地登录如果设置为false同一个设备类型的其它地点登录的相同账号被踢下线
# isAllowMultiAddrLogin: true
#
#
# # 是否允许多账号多设备登录如果设置为false其它地点登录的相同账号全部登录设备将被踢下线
# isAllowMultiDeviceLogin: true
#
#
# # 是否允许刷新主框架页如果设置为false刷新主页将导致重新登录。如安全性比较高的如银行个人首页不允许刷新。
# isAllowRefreshIndex: true
#
#
# # 是否允许嵌入到外部网站iframe中true不限制false不允许
# isAllowExternalSiteIframe: true
#
#
# # 设定允许获取的资源列表v4.2.3
# #contentSecurityPolicy: "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; img-src 'self' 'unsafe-inline' 'unsafe-eval' data:"
# # 是否允许跨域访问 CORS如果允许设置允许的域名。v4.2.3 开始支持多个域名和模糊匹配例如http://*.jeesite.com,http://*.jeesite.net
# accessControlAllowOrigin: '*'
#
#
# # 允许跨域访问时 CORS可以获取和返回的方法和请求头
# accessControlAllowMethods: GET, POST, OPTIONS
# accessControlAllowHeaders: content-type, x-requested-with, x-ajax, x-token, x-remember
@@ -586,10 +586,13 @@ shiro:
# # 是否允许接收跨域的Cookie凭证数据 CORS
# accessControlAllowCredentials: false
#
#
# # 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链
# allowReferers: http://127.0.0.1,http://localhost
#
# # 允许重定向的地址不设置为全部允许设置this只允许本项目内部跳转多个用逗号隔开例如this,http://*.jeesite.com
# allowRedirects: ~
#
# # 是否在登录后生成新的Session默认false
# isGenerateNewSessionAfterLogin: false
#
@@ -615,45 +618,45 @@ shiro:
# ${adminPath}/sys/corpAdmin/treeData = anon
# ${adminPath}/${spring.application.name}/swagger/** = anon
# ${adminPath}/** = user
# Session 相关
session:
# 会话超时时间单位毫秒10m=600000, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms, 12h=43200000ms, 1day=86400000ms
# 注意如果超时超过30m你还需要同步修改当前配置文件的属性j2cache.caffeine.region.sessionCache 超时时间,大于这个值。
# 游客会话超时时间只访问了系统但未登录系统的用户为游客游客默认超时时间为10分钟未登录系统时的图片验证码有效时间。
sessionTimeout: 180000
# 登录系统后的用户超时时间(不明确 param_deviceType 参数的,默认设备为 pc 登录)
pcSessionTimeout: 1800000
# # 手机APP设备会话超时参数设置登录请求参数加 param_deviceType=mobileApp 时有效,一般情况无需设置
# mobileAppSessionTimeout: 1800000
#
#
# # 定时清理失效会话,清理用户直接关闭浏览器造成的孤立会话(设置为 0 关闭,微服务下只开启 core 即可)
# sessionTimeoutClean: 1200000
#
#
# # 会话唯一标识SessionId在Cookie中的名称。
# sessionIdCookieName: jeesite.session.id
# #sessionIdCookiePath: ${server.servlet.context-path}
#
#
# # 共享的SessionId的Cookie名称保存到跟路径下第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。
# shareSessionIdCookieName: ${session.sessionIdCookieName}
#
#
# # 其它 SimpleCookie 参数v4.2.3
# sessionIdCookieSecure: false
# sessionIdCookieHttpOnly: true
# sessionIdCookieSameSite: LAX
#
#
# # 设置接收 SessionId 请求参数和请求头的名称
# sessionIdParamName: __sid
# sessionIdHeaderName: x-token
#
#
# # 当直接通过 __sid 参数浏览器访问页面时,可将直接将 __sid 写入 Cookie 应用于后面的访问
# # 访问地址举例http://host/js/a/index?__sid=123456&__cookie=true
# writeCookieParamName: __cookie
#
#
# # 记住我的请求参数和请求头的名称v4.2.3
# rememberMeHeaderName: x-remember
@@ -666,7 +669,7 @@ session:
# #[cacheName]: size, xxxx[s|m|h|d]
# default: 10000, 1h
# sessionCache: 100000, 12h
#
#
# # 二级缓存
# redis:
# # 存储模式 generic|hash
@@ -682,7 +685,7 @@ session:
# maxPoolSize: 20
# keepAliveSeconds: 60
# queueCapacity: 1000
#
#
# # 通知订阅
# broadcast:
# # 缓存清理模式
@@ -693,19 +696,19 @@ session:
# MyBatis 相关
mybatis:
# @MyBatisDao、Aliases 扫描基础包,如果多个,用“,”分隔
scanBasePackage: com.jeesite.modules
# # TypeHandlers 扫描基础包,如果多个,用“,”分隔
# scanTypeHandlersPackage: ~
#
#
# # 是否开启 JDBC 管理事务,默认 Spring 管理事务 v4.2.3
# jdbcTransaction: false
#
# # 批量插入和更新的分批默认大小防止库一次性接受不了太大的sql语句
# defaultBatchSize: 500
# Mapper文件刷新线程
mapper:
refresh:
@@ -713,25 +716,25 @@ mybatis:
# delaySeconds: 60
# sleepSeconds: 3
# mappingPath: mappings
# Web 相关
web:
# # AJAX 接受参数名和请求头名v4.3.0
# ajaxParamName: __ajax
# ajaxHeaderName: x-ajax
#
#
# # MVC 视图相关
# view:
#
#
# # 系统主题名称,主题视图优先级最高,如果主题下无这个视图文件则访问默认视图
# # 引入页面头部:'/themes/'+themeName+'/include/header.html'
# # 引入页面尾部:'/themes/'+themeName+'/include/footer.html'
# themeName: default
#
#
# # 使用智能参数接收器,同时支持 JSON 和 FormData 的参数接受
# smartMethodArgumentResolver: true
#
#
# # 使用 .json、.xml 后缀匹配返回视图数据Spring官方已不推荐使用
# favorPathExtension: false
# # 使用 __ajax=json、__ajax=xml 后缀匹配返回视图数据
@@ -741,7 +744,7 @@ web:
# MVC 拦截器
interceptor:
# 后台管理日志记录拦截器
log:
enabled: true
@@ -758,46 +761,46 @@ web:
${adminPath}/file/**,
${adminPath}/tags/*,
${adminPath}/msg/**
# 前台自动切换到手机视图拦截器
mobile:
enabled: false
addPathPatterns: >
${frontPath}/**
excludePathPatterns: ~
# # 静态文件后缀,过滤静态文件,以提高访问性能。
# staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
#
#
# # 静态文件后缀排除的url路径指定哪些uri路径不进行静态文件过滤。
# staticFileExcludeUri: /druid/
#
#
# # 静态资源路径前缀,可做 CDN 加速优化,默认前面增加 ctxPath 前缀,如果前面写 “//” 两个斜杠 或 包含 “://” 不加 ctxPath。
# staticPrefix: /static
#
#
# # 严格模式(更严格的数据安全验证)
# strictMode: false
#
#
# # 自定义正则表达式验证(主键、登录名)
# validator:
# id: '[a-zA-Z0-9_\-/#\u4e00-\u9fa5]{0,64}'
# user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}'
#
#
# # 默认的日期格式JsonMapper
# json:
# defaultDateFormat: yyyy-MM-dd HH:mm:ss
#
#
# # 默认不启用(为兼用旧版保留,建议使用 CORS
# jsonp:
# enabled: false
# callback: __callback
# 核心模块的Web功能仅作为微服务时设为false
core:
core:
enabled: true
# 在线API文档工具
swagger:
swagger:
enabled: true
# 错误页面500.html是否输出错误信息正式环境为提供安全性可设置为false
@@ -812,47 +815,47 @@ error:
# 文件上传
file:
enabled: true
# # 文件上传根路径设置路径中不允许包含“userfiles”在指定目录中系统会自动创建userfiles目录如果不设置默认为contextPath路径
# #baseDir: D:/jeesite
#
#
# # 上传文件的相对路径支持yyyy, MM, dd, HH, mm, ss, E
# uploadPath: '{yyyy}{MM}/'
#
#
# # 上传单个文件最大字节500M在这之上还有 > Tomcat限制 > Nginx限制此设置会覆盖 spring.http.multipart.maxFileSize 设置
# maxFileSize: '500*1024*1024'
#
#
# # 设置允许上传的文件后缀(全局设置)
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
#
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
#
# # 允许上传的文件内容类型图片、word、excel、ppt防止修改后缀恶意上传文件默认不启用验证
# #allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,
# # application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,
# # application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
# # application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation
#
#
# # 上传图片自动压缩宽高,指定为 -1 不进行压缩(全局设置) v4.1.7
# imageMaxWidth: 1024
# imageMaxHeight: 768
#
#
# # 是否启用秒传
# checkmd5: true
#
#
# # 是否开启分片上传
# chunked: true
# # 分片大小单位字节10M
# chunkSize: '10*1024*1024'
# # 最大上传线程数
# threads: 3
#
#
# # 是否启用检查点(支持断点续传,上传)
# checkpoint: true
#
# # 是否用文件流方式下载(支持断点续传,下载)
# isFileStreamDown: true
# 视频转码
#video:
#
@@ -877,7 +880,7 @@ file:
# 消息提醒中心(专业版)
msg:
enabled: false
# # 是否开启实时发送消息(保存消息后立即检查未读消息并发送),分布式部署下请单独配置消息发送服务,不建议开启此选项。
# realtime:
# # 是否开启

View File

@@ -39,7 +39,7 @@
var windowHeight = $(window).height(),
headerHeight = $('.box-header').outerHeight() || 0,
footerHeight = $('.box-footer').outerHeight() || 0,
height = windowHeight - headerHeight - footerHeight - 13;
height = windowHeight - headerHeight - footerHeight - 20;
return height < 300 ? 300 : height;
}
});
@@ -59,7 +59,7 @@
var windowHeight = $(window).height(),
headerHeight = $('.box-header').outerHeight() || 0,
footerHeight = $('.box-footer').outerHeight() || 0,
height = windowHeight - headerHeight - footerHeight - 13;
height = windowHeight - headerHeight - footerHeight - 20;
return height < 300 ? 300 : height;
}
});