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

@@ -11,3 +11,6 @@
5.0.0
5.0.1
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;
/**
@@ -281,6 +283,12 @@ public class Log extends DataEntity<Log> {
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() {
// return ReflectionToStringBuilder.toString(this);

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
@@ -37,6 +36,14 @@ import com.jeesite.modules.sys.utils.UserUtils;
@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:
@@ -399,6 +400,9 @@ shiro:
# 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链
#allowReferers: http://127.0.0.1,http://localhost
# 允许重定向的地址不设置为全部允许设置this只允许本项目内部跳转多个用逗号隔开例如this,http://*.jeesite.com
#allowRedirects: ~
# 是否在登录后生成新的Session默认false
isGenerateNewSessionAfterLogin: false
@@ -604,6 +608,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,
@@ -688,6 +695,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,7 +84,7 @@ 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

@@ -29,6 +29,11 @@ import com.jeesite.modules.bpm.entity.BpmTreeEntity;
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
@@ -210,6 +215,17 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
// 生成构造方法
%>
<% 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<% } %>);
}

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,7 +84,7 @@ 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

@@ -8,6 +8,9 @@
<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};
<% } %>
@@ -26,6 +29,11 @@ import com.jeesite.modules.bpm.entity.BpmTreeEntity;
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
@@ -207,6 +215,17 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
// 生成构造方法
%>
<% 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<% } %>);
}

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>
@@ -31,3 +37,58 @@
</div>
\<% } %>
<% 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测试
@@ -165,6 +154,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
}
}
@Test
public static void main(String[] args) {
String a = null, b = null;
System.out.println("============ 基本测试 ============");
@@ -298,6 +288,27 @@ public class DaoMapperTest extends BaseSpringContextTests {
+ " #{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,17 +1,18 @@
<?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>
@@ -22,15 +23,15 @@
<!-- 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>
@@ -41,26 +42,27 @@
<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>
@@ -91,18 +93,6 @@
<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>
@@ -113,7 +103,9 @@
<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>
@@ -154,7 +152,7 @@
<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>
@@ -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>

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
# 表单请求数据的最大大小
@@ -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

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