Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
743c31d768 | ||
|
|
b169727263 | ||
|
|
3716cdfa87 | ||
|
|
03a0a51de9 | ||
|
|
d5b0aa9a14 | ||
|
|
ef6716e83c | ||
|
|
b5c7fd1a23 | ||
|
|
fbda5d558e | ||
|
|
ed38197ce1 | ||
|
|
6cb76ee31c | ||
|
|
7d73ba299c | ||
|
|
d3b5c67edd | ||
|
|
aed37d61fc | ||
|
|
6b89b2a15b | ||
|
|
c3cf990986 | ||
|
|
2e361e82a0 | ||
|
|
835ef5c82d | ||
|
|
3f51716843 | ||
|
|
05b65b9ac4 | ||
|
|
0dc0d31066 | ||
|
|
47f9f37e25 | ||
|
|
d5944598c2 | ||
|
|
91e418fcec |
60
README.md
60
README.md
@@ -4,8 +4,8 @@
|
||||
</p>
|
||||
<h3 align="center" style="margin:30px 0 30px;font-weight:bold;font-size:30px;">快速开发平台 - Spring Boot</h3>
|
||||
<p align="center">
|
||||
<a href="https://jeesite.com/docs/upgrade/" target="__blank"><img alt="JeeSite-V5.0" src="https://img.shields.io/badge/JeeSite-V5.0-success.svg"></a>
|
||||
<a href="https://spring.io/projects/spring-boot#learn" target="__blank"><img alt="SpringBoot-2.5" src="https://img.shields.io/badge/SpringBoot-2.5-blue.svg"></a>
|
||||
<a href="https://jeesite.com/docs/upgrade/" target="__blank"><img alt="JeeSite-V5.1" src="https://img.shields.io/badge/JeeSite-V5.1-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.6-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>
|
||||
@@ -51,12 +51,14 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
|
||||
|
||||
## 技术选型
|
||||
|
||||
* 主框架:Spring Boot 2.5、Spring Framework 5.3、Apache Shiro 1.9、J2Cache
|
||||
* 主框架:Spring Boot 2.6、Spring Framework 5.3、Apache Shiro 1.9、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
|
||||
* 前端组件:jQuery 3.5、jqGrid 4.7、layer 3.5、zTree 3.5、jQuery Validation
|
||||
* 支持 IE9 及以上版本及其他所有现代浏览器,如:谷歌浏览器、火狐浏览器、国产浏览器 等
|
||||
* 分离前端版:Node.js、TypeScript、Vue3、Vite、Ant Design Vue、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.1.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/>
|
||||
|
||||
## 今后如何升级?
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
Binary file not shown.
@@ -10,4 +10,5 @@
|
||||
4.3.0
|
||||
5.0.0
|
||||
5.0.1
|
||||
5.0.2
|
||||
5.0.2
|
||||
5.1.0
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -375,13 +375,13 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Autowired
|
||||
@Autowired(required = false)
|
||||
private JobDao jobDao; // 默认情况下job是关闭状态,需要注入jobDao
|
||||
/**
|
||||
* 初始化消息推送服务
|
||||
*/
|
||||
public void initJob(){
|
||||
if (!checkTable(JobEntity.class)) {
|
||||
if (jobDao == null || !checkTable(JobEntity.class)) {
|
||||
return;
|
||||
}
|
||||
JobEntity job = new JobEntity(MsgLocalPushTask.class.getSimpleName(), "SYSTEM");
|
||||
|
||||
Binary file not shown.
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
@@ -16,6 +17,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -280,6 +282,12 @@ public class Log extends DataEntity<Log> {
|
||||
String[] values = (String[])paramsMap.get(name);
|
||||
return values != null && values.length > 0 ? values[0] : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date getCreateDate() {
|
||||
return super.getCreateDate();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public String toString() {
|
||||
|
||||
@@ -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
|
||||
@@ -237,6 +235,9 @@ public class LoginController extends BaseController{
|
||||
successUrl = request.getContextPath() + successUrl;
|
||||
}
|
||||
model.addAttribute("__url", successUrl); // 告诉浏览器登录后跳转的页面
|
||||
// 初始密码策略和密码修改策略验证(0:关闭;1:提醒用户;2:强制修改初始或旧密码)
|
||||
String modifyPasswordMsg = PwdUtils.getModifyPasswordMsg(user, model);
|
||||
model.addAttribute("modifyPasswordMsg", modifyPasswordMsg);
|
||||
return ServletUtils.renderObject(response, model);
|
||||
}
|
||||
// 如果是登录操作,则跳转到登录成功页
|
||||
|
||||
@@ -4,19 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.web;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.ObjectUtils;
|
||||
@@ -26,6 +13,18 @@ import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.common.web.http.ServletUtils;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 单点登录Controller
|
||||
@@ -36,7 +35,14 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
@Api(tags = "SSO - 单点登录")
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class SsoController extends BaseController{
|
||||
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// String username = "system";
|
||||
// String secretKey = Global.getConfig("shiro.sso.secretKey");
|
||||
// String token = Md5Utils.md5(secretKey + username + DateUtils.getDate("yyyyMMdd"));
|
||||
// System.out.println("http://127.0.0.1:3100/js/sso/" + username + "/" + token + "?url=../sys/office/index");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 单点登录(如已经登录,则直接跳转)
|
||||
* @param username 登录用户名(loginCode)
|
||||
@@ -81,8 +87,4 @@ public class SsoController extends BaseController{
|
||||
return "error/403";
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// System.out.println(UserUtils.getSsoToken("system"));
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
@@ -660,7 +661,7 @@ file:
|
||||
# 设置允许上传的文件后缀(全局设置)
|
||||
imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
||||
mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
||||
fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||
fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||
|
||||
# 允许上传的文件内容类型(图片、word、excel、ppt)防止修改后缀恶意上传文件(默认不启用验证)
|
||||
# allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,
|
||||
@@ -687,6 +688,9 @@ file:
|
||||
|
||||
# 是否用文件流方式下载(支持断点续传,下载)
|
||||
isFileStreamDown: true
|
||||
|
||||
# 默认的预览类型(true、oss)
|
||||
preview: true
|
||||
|
||||
# 视频转码
|
||||
video:
|
||||
@@ -701,6 +705,10 @@ video:
|
||||
# 将mp4视频的元数据信息转到视频第一帧
|
||||
qtFaststartFile: d:/tools/video/qt-faststart/qt-faststart.exe
|
||||
|
||||
# 文件管理是否启用租户模式
|
||||
filemanager:
|
||||
useCorpModel: false
|
||||
|
||||
#======================================#
|
||||
#========== Message settings ==========#
|
||||
#======================================#
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
package ${packageName}.${moduleName}.web${isNotEmpty(subModuleName)?'.'+subModuleName:''};
|
||||
|
||||
<% if (table.isTreeEntity){ %>
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
<% }else{ %>
|
||||
<% } %>
|
||||
<% if (!table.isTreeEntity || toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
<% } %>
|
||||
@@ -27,8 +28,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
<% if(table.isTreeEntity){ %>
|
||||
<% if(table.isTreeEntity || toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
@@ -36,6 +39,12 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
<% }else{ %>
|
||||
import com.jeesite.common.entity.Page;
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
import com.jeesite.common.utils.excel.ExcelExport;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Type;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
<% } %>
|
||||
<% if (table.tplCategory == 'crud_select'){ %>
|
||||
import com.alibaba.fastjson.JSONValidator;
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
@@ -75,8 +84,8 @@ public class ${ClassName}Controller extends BaseController {
|
||||
return ${className}Service.getAndValid(${className});
|
||||
<% } %>
|
||||
}
|
||||
<% if(table.isTreeEntity){ %>
|
||||
|
||||
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
|
||||
|
||||
/**
|
||||
* 管理主页
|
||||
*/
|
||||
@@ -204,6 +213,50 @@ public class ${ClassName}Controller extends BaseController {
|
||||
${className}Service.save(${className});
|
||||
return renderResult(Global.TRUE, text("保存${functionNameSimple}成功!"));
|
||||
}
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "exportData")
|
||||
public void exportData(${ClassName} ${className}, HttpServletResponse response) {
|
||||
List<${ClassName}> list = ${className}Service.findList(${className});
|
||||
String fileName = "${functionNameSimple}" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
${ClassName} ${className} = new ${ClassName}();
|
||||
List<${ClassName}> list = ListUtils.newArrayList(${className});
|
||||
String fileName = "${functionNameSimple}模板.xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class, Type.IMPORT)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@PostMapping(value = "importData")
|
||||
public String importData(MultipartFile file) {
|
||||
try {
|
||||
String message = ${className}Service.importData(file);
|
||||
return renderResult(Global.TRUE, "posfull:"+message);
|
||||
} catch (Exception ex) {
|
||||
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
|
||||
}
|
||||
}
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,359 +1,375 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>entity</name>
|
||||
<filePath>${baseDir}/src/main/java/${packagePath}/${moduleName}/entity/${subModuleName}</filePath>
|
||||
<fileName>${ClassName}.java</fileName>
|
||||
<content><![CDATA[
|
||||
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
|
||||
|
||||
<% if(table.childList.~size > 0){ %>
|
||||
import javax.validation.Valid;
|
||||
<% } %>
|
||||
<% for(i in table.importList){ %>
|
||||
import ${i};
|
||||
<% } %>
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.common.entity.TreeEntity;
|
||||
<% } %>
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.modules.bpm.entity.BpmTreeEntity;
|
||||
<% }else{ %>
|
||||
import com.jeesite.modules.bpm.entity.BpmEntity;
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* ${functionName}Entity
|
||||
* @author ${functionAuthor}
|
||||
* @version ${functionVersion}
|
||||
*/
|
||||
@Table(name="${table.genTableName}", alias="a", label="${functionNameSimple}信息", columns={
|
||||
<%
|
||||
var isBase = false, isData = false,
|
||||
isTree = false, isExtend = false;
|
||||
// ◆ 生成字段属性
|
||||
for(c in table.columnList){
|
||||
// ● 如果是BaseEntity类属性
|
||||
if(table.isBaseEntity && c.isBaseEntityColumn){
|
||||
if(!isBase){
|
||||
isBase = true;
|
||||
%>
|
||||
@Column(includeEntity=BaseEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是DataEntity类属性
|
||||
}else if(table.isDataEntity && c.isDataEntityColumn){
|
||||
if(!isData){
|
||||
isData = true;
|
||||
%>
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是TreeEntity类属性
|
||||
}else if(table.isTreeEntity && c.isTreeEntityColumn){
|
||||
if(!isTree){
|
||||
isTree = true;
|
||||
%>
|
||||
@Column(includeEntity=TreeEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是Extend类属性
|
||||
}else if(table.isExtendEntity && c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
@Column(includeEntity=Extend.class, attrName="extend"),
|
||||
<%
|
||||
}
|
||||
// ● 其它情况下
|
||||
}else{
|
||||
// 容错,如果没有设置父表的主键属性,则设置
|
||||
if(!@StringUtils.contains(c.attrName, ".")){
|
||||
if (table.parentExists && table.parentTableFkName == c.columnName){
|
||||
for (pk in table.parent.pkList){
|
||||
c.fullAttrName = c.fullAttrName + '.' + pk.attrName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
@Column(name="${c.columnName}", attrName="${c.attrName}", label="${c.columnLabel}"<%
|
||||
if (c.comments != c.columnLabel){
|
||||
print(', comment="'+c.comments+'"');
|
||||
}
|
||||
if (c.isPk == @Global.YES){
|
||||
print(', isPK=true');
|
||||
}else{
|
||||
if (c.isInsert != @Global.YES){
|
||||
print(', isInsert=false');
|
||||
}
|
||||
if (c.isUpdate != @Global.YES){
|
||||
print(', isUpdate=false');
|
||||
}
|
||||
if (c.isQuery == @Global.YES && @StringUtils.inString(c.queryType,
|
||||
'NE', 'GT', 'GTE', 'LT', 'LTE', 'LIKE', 'LEFT_LIKE', 'RIGHT_LIKE')){
|
||||
print(', queryType=QueryType.'+c.queryType);
|
||||
}
|
||||
if (c.isQuery != @Global.YES){
|
||||
print(', isQuery=false');
|
||||
}
|
||||
if (c.attrName == table.treeViewNameAttrName){
|
||||
print(', isTreeName=true');
|
||||
}
|
||||
if (c.isNull == @Global.YES && @StringUtils.inString(c.simpleAttrType,
|
||||
'Long', 'Integer', 'Double', 'BigDecimal', 'Date')){
|
||||
print(', isUpdateForce=true');
|
||||
}
|
||||
}
|
||||
%>),
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}, <%
|
||||
// ◆ 生成关联表
|
||||
var joinTables = '';
|
||||
for(c in table.columnList){
|
||||
if (c.attrType == 'com.jeesite.modules.sys.entity.User'){
|
||||
var joinTable = {
|
||||
%>
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
|
||||
on="u${cLP.index}.user_code = a.${c.columnName}", columns={
|
||||
@Column(name="user_code", label="用户编码", isPK=true),
|
||||
@Column(name="user_name", label="用户名称", isQuery=false),
|
||||
}),
|
||||
<%
|
||||
};
|
||||
joinTables = joinTables + joinTable;
|
||||
}
|
||||
else if (c.attrType == 'com.jeesite.modules.sys.entity.Office'){
|
||||
var joinTable = {
|
||||
%>
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
|
||||
on="u${cLP.index}.office_code = a.${c.columnName}", columns={
|
||||
@Column(name="office_code", label="机构编码", isPK=true),
|
||||
@Column(name="office_name", label="机构名称", isQuery=false),
|
||||
}),
|
||||
<%
|
||||
};
|
||||
joinTables = joinTables + joinTable;
|
||||
}
|
||||
}
|
||||
if (isNotBlank(joinTables)){
|
||||
print('joinTable={');
|
||||
print(joinTables);
|
||||
print('}, ');
|
||||
}
|
||||
// ◆ 生成排序字段
|
||||
%>orderBy="<% if (isTree){
|
||||
%>a.tree_sorts<%
|
||||
for(pk in table.pkList){
|
||||
%>, a.${pk.columnName}<%
|
||||
}
|
||||
}else if(table.parentExists && table.createDateExists){
|
||||
%>a.create_date ASC<%
|
||||
}else if(table.updateDateExists){
|
||||
%>a.update_date DESC<%
|
||||
}else{
|
||||
for(pk in table.pkList){
|
||||
%>${pkLP.index!=1?', ':''}a.${pk.columnName} ${table.parentExists?'ASC':'DESC'}<%
|
||||
}
|
||||
} %>"
|
||||
)
|
||||
public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(table.isTreeEntity?'BpmTree':'Bpm'):table.isTreeEntity?'Tree':'Data'}Entity<${ClassName}> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
<%
|
||||
isExtend = false;
|
||||
// 生成字段属性
|
||||
for(c in table.columnList){
|
||||
// 如果是Extend类属性
|
||||
if(table.isExtendEntity && c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
private Extend extend; // 扩展字段
|
||||
<%
|
||||
}
|
||||
}
|
||||
// 如果不是基类属性
|
||||
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
private ${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}; <% if (isNotBlank(c.comments)){ %>// ${c.comments} 父类<% } %>
|
||||
<%
|
||||
// 其它字段
|
||||
}else{
|
||||
%>
|
||||
private ${c.simpleAttrType} ${c.simpleAttrName}; <%if(isNotBlank(c.comments)){%>// ${c.comments}<%}%>
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 生成子表列表字段
|
||||
for(child in table.childList){
|
||||
%>
|
||||
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
|
||||
<%
|
||||
}
|
||||
|
||||
// 生成构造方法
|
||||
%>
|
||||
|
||||
public ${ClassName}() {
|
||||
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
|
||||
}
|
||||
<%
|
||||
// 生成带主键参数的构造
|
||||
if (!table.parentExists){
|
||||
if (table.pkList.~size == 1){ %>
|
||||
|
||||
public ${ClassName}(String id){
|
||||
super(id);
|
||||
}
|
||||
<% }else{ %>
|
||||
|
||||
public ${ClassName}(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>){
|
||||
<% for(pk in table.pkList){ %>
|
||||
this.${pk.simpleAttrName} = ${pk.simpleAttrName};
|
||||
<% } %>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// 生成父表参数的构造
|
||||
else{
|
||||
for(c in table.columnList){
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
|
||||
public ${ClassName}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}){
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果是树实体,则输出相应方法
|
||||
if (table.isTreeEntity){
|
||||
%>
|
||||
|
||||
@Override
|
||||
public ${ClassName} getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(${ClassName} parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
// 生成属性的get和set方法
|
||||
isExtend = false;
|
||||
for(c in table.columnList){
|
||||
// 如果是Extend类属性
|
||||
if(c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
|
||||
public Extend getExtend() {
|
||||
return extend;
|
||||
}
|
||||
|
||||
public void setExtend(Extend extend) {
|
||||
this.extend = extend;
|
||||
}
|
||||
<%
|
||||
}
|
||||
// 如果不是基类属性
|
||||
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
%>
|
||||
|
||||
<%
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
public ${@StringUtils.cap(table.parent.className)} get${@StringUtils.cap(c.simpleAttrName)}() {
|
||||
return ${c.simpleAttrName};
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}) {
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
// 其它字段
|
||||
}else{
|
||||
for(a in c.simpleAnnotationList){
|
||||
%>
|
||||
@${a}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}() {
|
||||
return ${c.simpleAttrName};
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 生成条件字段get和set方法(范围类型)
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && c.queryType == "BETWEEN"){
|
||||
%>
|
||||
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_gte() {
|
||||
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.GTE);
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}_gte(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
sqlMap.getWhere().and("${c.columnName}", QueryType.GTE, ${c.simpleAttrName});
|
||||
}
|
||||
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_lte() {
|
||||
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.LTE);
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}_lte(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
sqlMap.getWhere().and("${c.columnName}", QueryType.LTE, ${c.simpleAttrName});
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// 生成子表列表get和set方法
|
||||
for(child in table.childList){
|
||||
%>
|
||||
|
||||
@Valid
|
||||
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
|
||||
return ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
|
||||
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
}]]>
|
||||
</content>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>entity</name>
|
||||
<filePath>${baseDir}/src/main/java/${packagePath}/${moduleName}/entity/${subModuleName}</filePath>
|
||||
<fileName>${ClassName}.java</fileName>
|
||||
<content><![CDATA[
|
||||
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
|
||||
|
||||
<% if(table.childList.~size > 0){ %>
|
||||
import javax.validation.Valid;
|
||||
<% } %>
|
||||
<% for(i in table.importList){ %>
|
||||
import ${i};
|
||||
<% } %>
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.common.entity.TreeEntity;
|
||||
<% } %>
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.modules.bpm.entity.BpmTreeEntity;
|
||||
<% }else{ %>
|
||||
import com.jeesite.modules.bpm.entity.BpmEntity;
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelFields;
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* ${functionName}Entity
|
||||
* @author ${functionAuthor}
|
||||
* @version ${functionVersion}
|
||||
*/
|
||||
@Table(name="${table.genTableName}", alias="a", label="${functionNameSimple}信息", columns={
|
||||
<%
|
||||
var isBase = false, isData = false,
|
||||
isTree = false, isExtend = false;
|
||||
// ◆ 生成字段属性
|
||||
for(c in table.columnList){
|
||||
// ● 如果是BaseEntity类属性
|
||||
if(table.isBaseEntity && c.isBaseEntityColumn){
|
||||
if(!isBase){
|
||||
isBase = true;
|
||||
%>
|
||||
@Column(includeEntity=BaseEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是DataEntity类属性
|
||||
}else if(table.isDataEntity && c.isDataEntityColumn){
|
||||
if(!isData){
|
||||
isData = true;
|
||||
%>
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是TreeEntity类属性
|
||||
}else if(table.isTreeEntity && c.isTreeEntityColumn){
|
||||
if(!isTree){
|
||||
isTree = true;
|
||||
%>
|
||||
@Column(includeEntity=TreeEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是Extend类属性
|
||||
}else if(table.isExtendEntity && c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
@Column(includeEntity=Extend.class, attrName="extend"),
|
||||
<%
|
||||
}
|
||||
// ● 其它情况下
|
||||
}else{
|
||||
// 容错,如果没有设置父表的主键属性,则设置
|
||||
if(!@StringUtils.contains(c.attrName, ".")){
|
||||
if (table.parentExists && table.parentTableFkName == c.columnName){
|
||||
for (pk in table.parent.pkList){
|
||||
c.fullAttrName = c.fullAttrName + '.' + pk.attrName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
@Column(name="${c.columnName}", attrName="${c.attrName}", label="${c.columnLabel}"<%
|
||||
if (c.comments != c.columnLabel){
|
||||
print(', comment="'+c.comments+'"');
|
||||
}
|
||||
if (c.isPk == @Global.YES){
|
||||
print(', isPK=true');
|
||||
}else{
|
||||
if (c.isInsert != @Global.YES){
|
||||
print(', isInsert=false');
|
||||
}
|
||||
if (c.isUpdate != @Global.YES){
|
||||
print(', isUpdate=false');
|
||||
}
|
||||
if (c.isQuery == @Global.YES && @StringUtils.inString(c.queryType,
|
||||
'NE', 'GT', 'GTE', 'LT', 'LTE', 'LIKE', 'LEFT_LIKE', 'RIGHT_LIKE')){
|
||||
print(', queryType=QueryType.'+c.queryType);
|
||||
}
|
||||
if (c.isQuery != @Global.YES){
|
||||
print(', isQuery=false');
|
||||
}
|
||||
if (c.attrName == table.treeViewNameAttrName){
|
||||
print(', isTreeName=true');
|
||||
}
|
||||
if (c.isNull == @Global.YES && @StringUtils.inString(c.simpleAttrType,
|
||||
'Long', 'Integer', 'Double', 'BigDecimal', 'Date')){
|
||||
print(', isUpdateForce=true');
|
||||
}
|
||||
}
|
||||
%>),
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}, <%
|
||||
// ◆ 生成关联表
|
||||
var joinTables = '';
|
||||
for(c in table.columnList){
|
||||
if (c.attrType == 'com.jeesite.modules.sys.entity.User'){
|
||||
var joinTable = {
|
||||
%>
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
|
||||
on="u${cLP.index}.user_code = a.${c.columnName}", columns={
|
||||
@Column(name="user_code", label="用户编码", isPK=true),
|
||||
@Column(name="user_name", label="用户名称", isQuery=false),
|
||||
}),
|
||||
<%
|
||||
};
|
||||
joinTables = joinTables + joinTable;
|
||||
}
|
||||
else if (c.attrType == 'com.jeesite.modules.sys.entity.Office'){
|
||||
var joinTable = {
|
||||
%>
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
|
||||
on="u${cLP.index}.office_code = a.${c.columnName}", columns={
|
||||
@Column(name="office_code", label="机构编码", isPK=true),
|
||||
@Column(name="office_name", label="机构名称", isQuery=false),
|
||||
}),
|
||||
<%
|
||||
};
|
||||
joinTables = joinTables + joinTable;
|
||||
}
|
||||
}
|
||||
if (isNotBlank(joinTables)){
|
||||
print('joinTable={');
|
||||
print(joinTables);
|
||||
print('}, ');
|
||||
}
|
||||
// ◆ 生成排序字段
|
||||
%>orderBy="<% if (isTree){
|
||||
%>a.tree_sorts<%
|
||||
for(pk in table.pkList){
|
||||
%>, a.${pk.columnName}<%
|
||||
}
|
||||
}else if(table.parentExists && table.createDateExists){
|
||||
%>a.create_date ASC<%
|
||||
}else if(table.updateDateExists){
|
||||
%>a.update_date DESC<%
|
||||
}else{
|
||||
for(pk in table.pkList){
|
||||
%>${pkLP.index!=1?', ':''}a.${pk.columnName} ${table.parentExists?'ASC':'DESC'}<%
|
||||
}
|
||||
} %>"
|
||||
)
|
||||
public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(table.isTreeEntity?'BpmTree':'Bpm'):table.isTreeEntity?'Tree':'Data'}Entity<${ClassName}> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
<%
|
||||
isExtend = false;
|
||||
// 生成字段属性
|
||||
for(c in table.columnList){
|
||||
// 如果是Extend类属性
|
||||
if(table.isExtendEntity && c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
private Extend extend; // 扩展字段
|
||||
<%
|
||||
}
|
||||
}
|
||||
// 如果不是基类属性
|
||||
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
private ${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}; <% if (isNotBlank(c.comments)){ %>// ${c.comments} 父类<% } %>
|
||||
<%
|
||||
// 其它字段
|
||||
}else{
|
||||
%>
|
||||
private ${c.simpleAttrType} ${c.simpleAttrName}; <%if(isNotBlank(c.comments)){%>// ${c.comments}<%}%>
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 生成子表列表字段
|
||||
for(child in table.childList){
|
||||
%>
|
||||
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
|
||||
<%
|
||||
}
|
||||
|
||||
// 生成构造方法
|
||||
%>
|
||||
|
||||
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
@ExcelFields({
|
||||
<% for(c in table.columnList){ if(c.optionMap['isImportExport'] == @Global.YES){ %>
|
||||
@ExcelField(title="${c.columnLabel}", attrName="${c.attrName}"${
|
||||
isNotBlank(c.optionMap['dictType'])?', dictType="'+c.optionMap['dictType']+'"':''
|
||||
}, align=Align.CENTER, sort=${c.columnSort}${
|
||||
c.showType == 'date'?', dataFormat="yyyy-MM-dd"':c.showType == 'datetime'?', dataFormat="yyyy-MM-dd hh:mm"':''
|
||||
}),
|
||||
<% } } %>
|
||||
})
|
||||
<% } %>
|
||||
public ${ClassName}() {
|
||||
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
|
||||
}
|
||||
<%
|
||||
// 生成带主键参数的构造
|
||||
if (!table.parentExists){
|
||||
if (table.pkList.~size == 1){ %>
|
||||
|
||||
public ${ClassName}(String id){
|
||||
super(id);
|
||||
}
|
||||
<% }else{ %>
|
||||
|
||||
public ${ClassName}(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>){
|
||||
<% for(pk in table.pkList){ %>
|
||||
this.${pk.simpleAttrName} = ${pk.simpleAttrName};
|
||||
<% } %>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// 生成父表参数的构造
|
||||
else{
|
||||
for(c in table.columnList){
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
|
||||
public ${ClassName}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}){
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果是树实体,则输出相应方法
|
||||
if (table.isTreeEntity){
|
||||
%>
|
||||
|
||||
@Override
|
||||
public ${ClassName} getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(${ClassName} parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
// 生成属性的get和set方法
|
||||
isExtend = false;
|
||||
for(c in table.columnList){
|
||||
// 如果是Extend类属性
|
||||
if(c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
|
||||
public Extend getExtend() {
|
||||
return extend;
|
||||
}
|
||||
|
||||
public void setExtend(Extend extend) {
|
||||
this.extend = extend;
|
||||
}
|
||||
<%
|
||||
}
|
||||
// 如果不是基类属性
|
||||
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
%>
|
||||
|
||||
<%
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
public ${@StringUtils.cap(table.parent.className)} get${@StringUtils.cap(c.simpleAttrName)}() {
|
||||
return ${c.simpleAttrName};
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}) {
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
// 其它字段
|
||||
}else{
|
||||
for(a in c.simpleAnnotationList){
|
||||
%>
|
||||
@${a}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}() {
|
||||
return ${c.simpleAttrName};
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 生成条件字段get和set方法(范围类型)
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && c.queryType == "BETWEEN"){
|
||||
%>
|
||||
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_gte() {
|
||||
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.GTE);
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}_gte(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
sqlMap.getWhere().and("${c.columnName}", QueryType.GTE, ${c.simpleAttrName});
|
||||
}
|
||||
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_lte() {
|
||||
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.LTE);
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}_lte(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
sqlMap.getWhere().and("${c.columnName}", QueryType.LTE, ${c.simpleAttrName});
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// 生成子表列表get和set方法
|
||||
for(child in table.childList){
|
||||
%>
|
||||
|
||||
@Valid
|
||||
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
|
||||
return ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
|
||||
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
}]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -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();
|
||||
}
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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>
|
||||
@@ -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[]) {
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
@@ -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) {
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
package ${packageName}.${moduleName}.web${isNotEmpty(subModuleName)?'.'+subModuleName:''};
|
||||
|
||||
<% if (table.isTreeEntity){ %>
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
<% }else{ %>
|
||||
<% } %>
|
||||
<% if (!table.isTreeEntity || toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
<% } %>
|
||||
@@ -27,8 +28,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
<% if(table.isTreeEntity){ %>
|
||||
<% if(table.isTreeEntity || toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
<% } %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
@@ -36,6 +39,12 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
<% }else{ %>
|
||||
import com.jeesite.common.entity.Page;
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
import com.jeesite.common.utils.excel.ExcelExport;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Type;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
<% } %>
|
||||
<% if (table.tplCategory == 'crud_select'){ %>
|
||||
import com.alibaba.fastjson.JSONValidator;
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
@@ -75,8 +84,8 @@ public class ${ClassName}Controller extends BaseController {
|
||||
return ${className}Service.getAndValid(${className});
|
||||
<% } %>
|
||||
}
|
||||
<% if(table.isTreeEntity){ %>
|
||||
|
||||
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
|
||||
|
||||
/**
|
||||
* 管理主页
|
||||
*/
|
||||
@@ -204,6 +213,50 @@ public class ${ClassName}Controller extends BaseController {
|
||||
${className}Service.save(${className});
|
||||
return renderResult(Global.TRUE, text("保存${functionNameSimple}成功!"));
|
||||
}
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "exportData")
|
||||
public void exportData(${ClassName} ${className}, HttpServletResponse response) {
|
||||
List<${ClassName}> list = ${className}Service.findList(${className});
|
||||
String fileName = "${functionNameSimple}" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
${ClassName} ${className} = new ${ClassName}();
|
||||
List<${ClassName}> list = ListUtils.newArrayList(${className});
|
||||
String fileName = "${functionNameSimple}模板.xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class, Type.IMPORT)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@PostMapping(value = "importData")
|
||||
public String importData(MultipartFile file) {
|
||||
try {
|
||||
String message = ${className}Service.importData(file);
|
||||
return renderResult(Global.TRUE, "posfull:"+message);
|
||||
} catch (Exception ex) {
|
||||
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
|
||||
}
|
||||
}
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,356 +1,375 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>entity</name>
|
||||
<filePath>${baseDir}/${moduleName}-client/src/main/java/${packagePath}/${moduleName}/entity/${subModuleName}</filePath>
|
||||
<fileName>${ClassName}.java</fileName>
|
||||
<content><![CDATA[
|
||||
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
|
||||
|
||||
<% for(i in table.importList){ %>
|
||||
import ${i};
|
||||
<% } %>
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.common.entity.TreeEntity;
|
||||
<% } %>
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.modules.bpm.entity.BpmTreeEntity;
|
||||
<% }else{ %>
|
||||
import com.jeesite.modules.bpm.entity.BpmEntity;
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* ${functionName}Entity
|
||||
* @author ${functionAuthor}
|
||||
* @version ${functionVersion}
|
||||
*/
|
||||
@Table(name="${table.genTableName}", alias="a", label="${functionNameSimple}信息", columns={
|
||||
<%
|
||||
var isBase = false, isData = false,
|
||||
isTree = false, isExtend = false;
|
||||
// ◆ 生成字段属性
|
||||
for(c in table.columnList){
|
||||
// ● 如果是BaseEntity类属性
|
||||
if(table.isBaseEntity && c.isBaseEntityColumn){
|
||||
if(!isBase){
|
||||
isBase = true;
|
||||
%>
|
||||
@Column(includeEntity=BaseEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是DataEntity类属性
|
||||
}else if(table.isDataEntity && c.isDataEntityColumn){
|
||||
if(!isData){
|
||||
isData = true;
|
||||
%>
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是TreeEntity类属性
|
||||
}else if(table.isTreeEntity && c.isTreeEntityColumn){
|
||||
if(!isTree){
|
||||
isTree = true;
|
||||
%>
|
||||
@Column(includeEntity=TreeEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是Extend类属性
|
||||
}else if(table.isExtendEntity && c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
@Column(includeEntity=Extend.class, attrName="extend"),
|
||||
<%
|
||||
}
|
||||
// ● 其它情况下
|
||||
}else{
|
||||
// 容错,如果没有设置父表的主键属性,则设置
|
||||
if(!@StringUtils.contains(c.attrName, ".")){
|
||||
if (table.parentExists && table.parentTableFkName == c.columnName){
|
||||
for (pk in table.parent.pkList){
|
||||
c.fullAttrName = c.fullAttrName + '.' + pk.attrName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
@Column(name="${c.columnName}", attrName="${c.attrName}", label="${c.columnLabel}"<%
|
||||
if (c.comments != c.columnLabel){
|
||||
print(', comment="'+c.comments+'"');
|
||||
}
|
||||
if (c.isPk == @Global.YES){
|
||||
print(', isPK=true');
|
||||
}else{
|
||||
if (c.isInsert != @Global.YES){
|
||||
print(', isInsert=false');
|
||||
}
|
||||
if (c.isUpdate != @Global.YES){
|
||||
print(', isUpdate=false');
|
||||
}
|
||||
if (c.isQuery == @Global.YES && @StringUtils.inString(c.queryType,
|
||||
'NE', 'GT', 'GTE', 'LT', 'LTE', 'LIKE', 'LEFT_LIKE', 'RIGHT_LIKE')){
|
||||
print(', queryType=QueryType.'+c.queryType);
|
||||
}
|
||||
if (c.isQuery != @Global.YES){
|
||||
print(', isQuery=false');
|
||||
}
|
||||
if (c.attrName == table.treeViewNameAttrName){
|
||||
print(', isTreeName=true');
|
||||
}
|
||||
if (c.isNull == @Global.YES && @StringUtils.inString(c.simpleAttrType,
|
||||
'Long', 'Integer', 'Double', 'BigDecimal', 'Date')){
|
||||
print(', isUpdateForce=true');
|
||||
}
|
||||
}
|
||||
%>),
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}, <%
|
||||
// ◆ 生成关联表
|
||||
var joinTables = '';
|
||||
for(c in table.columnList){
|
||||
if (c.attrType == 'com.jeesite.modules.sys.entity.User'){
|
||||
var joinTable = {
|
||||
%>
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
|
||||
on="u${cLP.index}.user_code = a.${c.columnName}", columns={
|
||||
@Column(name="user_code", label="用户编码", isPK=true),
|
||||
@Column(name="user_name", label="用户名称", isQuery=false),
|
||||
}),
|
||||
<%
|
||||
};
|
||||
joinTables = joinTables + joinTable;
|
||||
}
|
||||
else if (c.attrType == 'com.jeesite.modules.sys.entity.Office'){
|
||||
var joinTable = {
|
||||
%>
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
|
||||
on="u${cLP.index}.office_code = a.${c.columnName}", columns={
|
||||
@Column(name="office_code", label="机构编码", isPK=true),
|
||||
@Column(name="office_name", label="机构名称", isQuery=false),
|
||||
}),
|
||||
<%
|
||||
};
|
||||
joinTables = joinTables + joinTable;
|
||||
}
|
||||
}
|
||||
if (isNotBlank(joinTables)){
|
||||
print('joinTable={');
|
||||
print(joinTables);
|
||||
print('}, ');
|
||||
}
|
||||
// ◆ 生成排序字段
|
||||
%>orderBy="<% if (isTree){
|
||||
%>a.tree_sorts<%
|
||||
for(pk in table.pkList){
|
||||
%>, a.${pk.columnName}<%
|
||||
}
|
||||
}else if(table.parentExists && table.createDateExists){
|
||||
%>a.create_date ASC<%
|
||||
}else if(table.updateDateExists){
|
||||
%>a.update_date DESC<%
|
||||
}else{
|
||||
for(pk in table.pkList){
|
||||
%>${pkLP.index!=1?', ':''}a.${pk.columnName} ${table.parentExists?'ASC':'DESC'}<%
|
||||
}
|
||||
} %>"
|
||||
)
|
||||
public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(table.isTreeEntity?'BpmTree':'Bpm'):table.isTreeEntity?'Tree':'Data'}Entity<${ClassName}> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
<%
|
||||
isExtend = false;
|
||||
// 生成字段属性
|
||||
for(c in table.columnList){
|
||||
// 如果是Extend类属性
|
||||
if(table.isExtendEntity && c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
private Extend extend; // 扩展字段
|
||||
<%
|
||||
}
|
||||
}
|
||||
// 如果不是基类属性
|
||||
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
private ${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}; <% if (isNotBlank(c.comments)){ %>// ${c.comments} 父类<% } %>
|
||||
<%
|
||||
// 其它字段
|
||||
}else{
|
||||
%>
|
||||
private ${c.simpleAttrType} ${c.simpleAttrName}; <%if(isNotBlank(c.comments)){%>// ${c.comments}<%}%>
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 生成子表列表字段
|
||||
for(child in table.childList){
|
||||
%>
|
||||
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
|
||||
<%
|
||||
}
|
||||
|
||||
// 生成构造方法
|
||||
%>
|
||||
|
||||
public ${ClassName}() {
|
||||
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
|
||||
}
|
||||
<%
|
||||
// 生成带主键参数的构造
|
||||
if (!table.parentExists){
|
||||
if (table.pkList.~size == 1){ %>
|
||||
|
||||
public ${ClassName}(String id){
|
||||
super(id);
|
||||
}
|
||||
<% }else{ %>
|
||||
|
||||
public ${ClassName}(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>){
|
||||
<% for(pk in table.pkList){ %>
|
||||
this.${pk.simpleAttrName} = ${pk.simpleAttrName};
|
||||
<% } %>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// 生成父表参数的构造
|
||||
else{
|
||||
for(c in table.columnList){
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
|
||||
public ${ClassName}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}){
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果是树实体,则输出相应方法
|
||||
if (table.isTreeEntity){
|
||||
%>
|
||||
|
||||
@Override
|
||||
public ${ClassName} getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(${ClassName} parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
// 生成属性的get和set方法
|
||||
isExtend = false;
|
||||
for(c in table.columnList){
|
||||
// 如果是Extend类属性
|
||||
if(c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
|
||||
public Extend getExtend() {
|
||||
return extend;
|
||||
}
|
||||
|
||||
public void setExtend(Extend extend) {
|
||||
this.extend = extend;
|
||||
}
|
||||
<%
|
||||
}
|
||||
// 如果不是基类属性
|
||||
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
%>
|
||||
|
||||
<%
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
public ${@StringUtils.cap(table.parent.className)} get${@StringUtils.cap(c.simpleAttrName)}() {
|
||||
return ${c.simpleAttrName};
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}) {
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
// 其它字段
|
||||
}else{
|
||||
for(a in c.simpleAnnotationList){
|
||||
%>
|
||||
@${a}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}() {
|
||||
return ${c.simpleAttrName};
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 生成条件字段get和set方法(范围类型)
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && c.queryType == "BETWEEN"){
|
||||
%>
|
||||
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_gte() {
|
||||
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.GTE);
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}_gte(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
sqlMap.getWhere().and("${c.columnName}", QueryType.GTE, ${c.simpleAttrName});
|
||||
}
|
||||
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_lte() {
|
||||
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.LTE);
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}_lte(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
sqlMap.getWhere().and("${c.columnName}", QueryType.LTE, ${c.simpleAttrName});
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// 生成子表列表get和set方法
|
||||
for(child in table.childList){
|
||||
%>
|
||||
|
||||
@Valid
|
||||
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
|
||||
return ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
|
||||
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
}]]>
|
||||
</content>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
No deletion without permission, or be held responsible to law. -->
|
||||
<template>
|
||||
<name>entity</name>
|
||||
<filePath>${baseDir}/${moduleName}-client/src/main/java/${packagePath}/${moduleName}/entity/${subModuleName}</filePath>
|
||||
<fileName>${ClassName}.java</fileName>
|
||||
<content><![CDATA[
|
||||
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
|
||||
|
||||
<% if(table.childList.~size > 0){ %>
|
||||
import javax.validation.Valid;
|
||||
<% } %>
|
||||
<% for(i in table.importList){ %>
|
||||
import ${i};
|
||||
<% } %>
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.common.entity.TreeEntity;
|
||||
<% } %>
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||
<% if(table.isTreeEntity){ %>
|
||||
import com.jeesite.modules.bpm.entity.BpmTreeEntity;
|
||||
<% }else{ %>
|
||||
import com.jeesite.modules.bpm.entity.BpmEntity;
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelFields;
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* ${functionName}Entity
|
||||
* @author ${functionAuthor}
|
||||
* @version ${functionVersion}
|
||||
*/
|
||||
@Table(name="${table.genTableName}", alias="a", label="${functionNameSimple}信息", columns={
|
||||
<%
|
||||
var isBase = false, isData = false,
|
||||
isTree = false, isExtend = false;
|
||||
// ◆ 生成字段属性
|
||||
for(c in table.columnList){
|
||||
// ● 如果是BaseEntity类属性
|
||||
if(table.isBaseEntity && c.isBaseEntityColumn){
|
||||
if(!isBase){
|
||||
isBase = true;
|
||||
%>
|
||||
@Column(includeEntity=BaseEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是DataEntity类属性
|
||||
}else if(table.isDataEntity && c.isDataEntityColumn){
|
||||
if(!isData){
|
||||
isData = true;
|
||||
%>
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是TreeEntity类属性
|
||||
}else if(table.isTreeEntity && c.isTreeEntityColumn){
|
||||
if(!isTree){
|
||||
isTree = true;
|
||||
%>
|
||||
@Column(includeEntity=TreeEntity.class),
|
||||
<%
|
||||
}
|
||||
// ● 如果是Extend类属性
|
||||
}else if(table.isExtendEntity && c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
@Column(includeEntity=Extend.class, attrName="extend"),
|
||||
<%
|
||||
}
|
||||
// ● 其它情况下
|
||||
}else{
|
||||
// 容错,如果没有设置父表的主键属性,则设置
|
||||
if(!@StringUtils.contains(c.attrName, ".")){
|
||||
if (table.parentExists && table.parentTableFkName == c.columnName){
|
||||
for (pk in table.parent.pkList){
|
||||
c.fullAttrName = c.fullAttrName + '.' + pk.attrName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
@Column(name="${c.columnName}", attrName="${c.attrName}", label="${c.columnLabel}"<%
|
||||
if (c.comments != c.columnLabel){
|
||||
print(', comment="'+c.comments+'"');
|
||||
}
|
||||
if (c.isPk == @Global.YES){
|
||||
print(', isPK=true');
|
||||
}else{
|
||||
if (c.isInsert != @Global.YES){
|
||||
print(', isInsert=false');
|
||||
}
|
||||
if (c.isUpdate != @Global.YES){
|
||||
print(', isUpdate=false');
|
||||
}
|
||||
if (c.isQuery == @Global.YES && @StringUtils.inString(c.queryType,
|
||||
'NE', 'GT', 'GTE', 'LT', 'LTE', 'LIKE', 'LEFT_LIKE', 'RIGHT_LIKE')){
|
||||
print(', queryType=QueryType.'+c.queryType);
|
||||
}
|
||||
if (c.isQuery != @Global.YES){
|
||||
print(', isQuery=false');
|
||||
}
|
||||
if (c.attrName == table.treeViewNameAttrName){
|
||||
print(', isTreeName=true');
|
||||
}
|
||||
if (c.isNull == @Global.YES && @StringUtils.inString(c.simpleAttrType,
|
||||
'Long', 'Integer', 'Double', 'BigDecimal', 'Date')){
|
||||
print(', isUpdateForce=true');
|
||||
}
|
||||
}
|
||||
%>),
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}, <%
|
||||
// ◆ 生成关联表
|
||||
var joinTables = '';
|
||||
for(c in table.columnList){
|
||||
if (c.attrType == 'com.jeesite.modules.sys.entity.User'){
|
||||
var joinTable = {
|
||||
%>
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
|
||||
on="u${cLP.index}.user_code = a.${c.columnName}", columns={
|
||||
@Column(name="user_code", label="用户编码", isPK=true),
|
||||
@Column(name="user_name", label="用户名称", isQuery=false),
|
||||
}),
|
||||
<%
|
||||
};
|
||||
joinTables = joinTables + joinTable;
|
||||
}
|
||||
else if (c.attrType == 'com.jeesite.modules.sys.entity.Office'){
|
||||
var joinTable = {
|
||||
%>
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, attrName="${c.simpleAttrName}", alias="u${cLP.index}",
|
||||
on="u${cLP.index}.office_code = a.${c.columnName}", columns={
|
||||
@Column(name="office_code", label="机构编码", isPK=true),
|
||||
@Column(name="office_name", label="机构名称", isQuery=false),
|
||||
}),
|
||||
<%
|
||||
};
|
||||
joinTables = joinTables + joinTable;
|
||||
}
|
||||
}
|
||||
if (isNotBlank(joinTables)){
|
||||
print('joinTable={');
|
||||
print(joinTables);
|
||||
print('}, ');
|
||||
}
|
||||
// ◆ 生成排序字段
|
||||
%>orderBy="<% if (isTree){
|
||||
%>a.tree_sorts<%
|
||||
for(pk in table.pkList){
|
||||
%>, a.${pk.columnName}<%
|
||||
}
|
||||
}else if(table.parentExists && table.createDateExists){
|
||||
%>a.create_date ASC<%
|
||||
}else if(table.updateDateExists){
|
||||
%>a.update_date DESC<%
|
||||
}else{
|
||||
for(pk in table.pkList){
|
||||
%>${pkLP.index!=1?', ':''}a.${pk.columnName} ${table.parentExists?'ASC':'DESC'}<%
|
||||
}
|
||||
} %>"
|
||||
)
|
||||
public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(table.isTreeEntity?'BpmTree':'Bpm'):table.isTreeEntity?'Tree':'Data'}Entity<${ClassName}> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
<%
|
||||
isExtend = false;
|
||||
// 生成字段属性
|
||||
for(c in table.columnList){
|
||||
// 如果是Extend类属性
|
||||
if(table.isExtendEntity && c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
private Extend extend; // 扩展字段
|
||||
<%
|
||||
}
|
||||
}
|
||||
// 如果不是基类属性
|
||||
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
private ${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}; <% if (isNotBlank(c.comments)){ %>// ${c.comments} 父类<% } %>
|
||||
<%
|
||||
// 其它字段
|
||||
}else{
|
||||
%>
|
||||
private ${c.simpleAttrType} ${c.simpleAttrName}; <%if(isNotBlank(c.comments)){%>// ${c.comments}<%}%>
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 生成子表列表字段
|
||||
for(child in table.childList){
|
||||
%>
|
||||
private List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List = ListUtils.newArrayList(); // 子表列表
|
||||
<%
|
||||
}
|
||||
|
||||
// 生成构造方法
|
||||
%>
|
||||
|
||||
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
@ExcelFields({
|
||||
<% for(c in table.columnList){ if(c.optionMap['isImportExport'] == @Global.YES){ %>
|
||||
@ExcelField(title="${c.columnLabel}", attrName="${c.attrName}"${
|
||||
isNotBlank(c.optionMap['dictType'])?', dictType="'+c.optionMap['dictType']+'"':''
|
||||
}, align=Align.CENTER, sort=${c.columnSort}${
|
||||
c.showType == 'date'?', dataFormat="yyyy-MM-dd"':c.showType == 'datetime'?', dataFormat="yyyy-MM-dd hh:mm"':''
|
||||
}),
|
||||
<% } } %>
|
||||
})
|
||||
<% } %>
|
||||
public ${ClassName}() {
|
||||
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
|
||||
}
|
||||
<%
|
||||
// 生成带主键参数的构造
|
||||
if (!table.parentExists){
|
||||
if (table.pkList.~size == 1){ %>
|
||||
|
||||
public ${ClassName}(String id){
|
||||
super(id);
|
||||
}
|
||||
<% }else{ %>
|
||||
|
||||
public ${ClassName}(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}${pk.simpleAttrType} ${pk.simpleAttrName}<% } %>){
|
||||
<% for(pk in table.pkList){ %>
|
||||
this.${pk.simpleAttrName} = ${pk.simpleAttrName};
|
||||
<% } %>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// 生成父表参数的构造
|
||||
else{
|
||||
for(c in table.columnList){
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
|
||||
public ${ClassName}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}){
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果是树实体,则输出相应方法
|
||||
if (table.isTreeEntity){
|
||||
%>
|
||||
|
||||
@Override
|
||||
public ${ClassName} getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(${ClassName} parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
// 生成属性的get和set方法
|
||||
isExtend = false;
|
||||
for(c in table.columnList){
|
||||
// 如果是Extend类属性
|
||||
if(c.isExtendColumn){
|
||||
if(!isExtend){
|
||||
isExtend = true;
|
||||
%>
|
||||
|
||||
public Extend getExtend() {
|
||||
return extend;
|
||||
}
|
||||
|
||||
public void setExtend(Extend extend) {
|
||||
this.extend = extend;
|
||||
}
|
||||
<%
|
||||
}
|
||||
// 如果不是基类属性
|
||||
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
%>
|
||||
|
||||
<%
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
public ${@StringUtils.cap(table.parent.className)} get${@StringUtils.cap(c.simpleAttrName)}() {
|
||||
return ${c.simpleAttrName};
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}(${@StringUtils.cap(table.parent.className)} ${c.simpleAttrName}) {
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
// 其它字段
|
||||
}else{
|
||||
for(a in c.simpleAnnotationList){
|
||||
%>
|
||||
@${a}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}() {
|
||||
return ${c.simpleAttrName};
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
this.${c.simpleAttrName} = ${c.simpleAttrName};
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 生成条件字段get和set方法(范围类型)
|
||||
for(c in table.columnList){
|
||||
if(c.isQuery == "1" && c.queryType == "BETWEEN"){
|
||||
%>
|
||||
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_gte() {
|
||||
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.GTE);
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}_gte(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
sqlMap.getWhere().and("${c.columnName}", QueryType.GTE, ${c.simpleAttrName});
|
||||
}
|
||||
|
||||
public ${c.simpleAttrType} get${@StringUtils.cap(c.simpleAttrName)}_lte() {
|
||||
return sqlMap.getWhere().getValue("${c.columnName}", QueryType.LTE);
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(c.simpleAttrName)}_lte(${c.simpleAttrType} ${c.simpleAttrName}) {
|
||||
sqlMap.getWhere().and("${c.columnName}", QueryType.LTE, ${c.simpleAttrName});
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// 生成子表列表get和set方法
|
||||
for(child in table.childList){
|
||||
%>
|
||||
|
||||
@Valid
|
||||
public List<${@StringUtils.cap(child.className)}> get${@StringUtils.cap(child.className)}List() {
|
||||
return ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
|
||||
public void set${@StringUtils.cap(child.className)}List(List<${@StringUtils.cap(child.className)}> ${@StringUtils.uncap(child.className)}List) {
|
||||
this.${@StringUtils.uncap(child.className)}List = ${@StringUtils.uncap(child.className)}List;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
}]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -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();
|
||||
}
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
|
||||
@@ -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();
|
||||
}}
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
<a href="#" class="btn btn-default" id="btnExpandTreeNode" title="\${text('展开一级')}"><i class="fa fa-angle-double-down"></i> \${text('展开')}</a>
|
||||
<a href="#" class="btn btn-default" id="btnCollapseTreeNode" title="\${text('折叠全部')}"><i class="fa fa-angle-double-up"></i> \${text('折叠')}</a>
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<a href="#" class="btn btn-default" id="btnExport"><i class="glyphicon glyphicon-export"></i> ${text('导出')}</a>
|
||||
<% } %>
|
||||
\<% if(hasPermi('${permissionPrefix}:edit')){ %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> ${text('导入')}</a>
|
||||
<% } %>
|
||||
<a href="\${ctx}/${urlPrefix}/form" class="btn btn-default btnTool" title="\${text('新增${functionNameSimple}')}"><i class="fa fa-plus"></i> \${text('新增')}</a>
|
||||
\<% } %>
|
||||
<a href="#" class="btn btn-default" id="btnSetting" title="\${text('设置')}"><i class="fa fa-navicon"></i></a>
|
||||
@@ -30,4 +36,59 @@
|
||||
</div>
|
||||
</div>
|
||||
\<% } %>
|
||||
<% include('/templates/modules/gen/include/dataGridScript.html'){} %>
|
||||
<% include('/templates/modules/gen/include/dataGridScript.html'){} %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<script>
|
||||
$('#btnExport').click(function(){
|
||||
js.ajaxSubmitForm($('#searchForm'), {
|
||||
url:'\${ctx}/${urlPrefix}/exportData',
|
||||
downloadFile:true
|
||||
});
|
||||
});
|
||||
$('#btnImport').click(function(){
|
||||
js.layer.open({
|
||||
type: 1,
|
||||
area: ['400px'],
|
||||
title: '\${text("导入${functionNameSimple}")}',
|
||||
resize: false,
|
||||
scrollbar: true,
|
||||
content: js.template('importTpl'),
|
||||
btn: ['<i class="fa fa-check"></i> \${text("导入")}',
|
||||
'<i class="fa fa-remove"></i> \${text("关闭")}'],
|
||||
btn1: function(index, layero){
|
||||
var form = {
|
||||
inputForm: layero.find('#inputForm'),
|
||||
file: layero.find('#file').val()
|
||||
};
|
||||
if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
|
||||
js.showMessage("\${text('文件不正确,请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
|
||||
return false;
|
||||
}
|
||||
js.ajaxSubmitForm(form.inputForm, function(data){
|
||||
js.showMessage(data.message);
|
||||
if(data.result == Global.TRUE){
|
||||
js.layer.closeAll();
|
||||
}
|
||||
page();
|
||||
}, "json");
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script id="importTpl" type="text/template">//<!--
|
||||
<form id="inputForm" action="\${ctx}/${urlPrefix}/importData" method="post" enctype="multipart/form-data"
|
||||
class="form-horizontal mt20 mb10" style="overflow:auto;max-height:200px;">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-xs-offset-1">
|
||||
<input type="file" id="file" name="file" class="form-file"/>
|
||||
<div class="mt10 pt5" style="color:red">
|
||||
\${text('提示:仅允许导入“xls”或“xlsx”格式文件!')}
|
||||
</div>
|
||||
<div class="mt10 pt5">
|
||||
<a href="\${ctx}/${urlPrefix}/importTemplate" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> \${text('下载模板')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
//--></script><% } %>
|
||||
@@ -31,7 +31,7 @@ cd app
|
||||
jar -xvf web.war
|
||||
rm web.war
|
||||
cd WEB-INF
|
||||
exec ./startup.sh
|
||||
sh ./startup.sh
|
||||
]]>
|
||||
</content>
|
||||
</template>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"},
|
||||
|
||||
@@ -4,7 +4,7 @@ productName: JeeSite Demo
|
||||
companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.0
|
||||
productVersion: V5.1
|
||||
copyrightYear: 2022
|
||||
|
||||
# 数据库连接
|
||||
|
||||
164
parent/pom.xml
164
parent/pom.xml
@@ -1,32 +1,33 @@
|
||||
<?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.6.11</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
<name>JeeSite Parent</name>
|
||||
<url>http://jeesite.com</url>
|
||||
<inceptionYear>2013-Now</inceptionYear>
|
||||
|
||||
|
||||
<properties>
|
||||
|
||||
|
||||
<!-- common version setting -->
|
||||
<commons-io.version>2.11.0</commons-io.version>
|
||||
<commons-text.version>1.9</commons-text.version>
|
||||
<commons-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>
|
||||
<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>
|
||||
@@ -39,81 +40,76 @@
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<pinyin4j.version>2.5.1</pinyin4j.version>
|
||||
<groovy.version>3.0.10</groovy.version>
|
||||
|
||||
|
||||
<!-- framework version setting -->
|
||||
<mybatis.version>3.5.9</mybatis.version>
|
||||
<mybatis.version>3.5.10</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.11</druid.version>
|
||||
<shiro.version>1.9.1</shiro.version>
|
||||
<j2cache.version>2.8.0-release</j2cache.version>
|
||||
<swagger.version>1.6.0</swagger.version>
|
||||
<log4j2.version>2.17.0</log4j2.version>
|
||||
|
||||
<swagger.version>1.6.6</swagger.version>
|
||||
<log4j2.version>2.18.0</log4j2.version>
|
||||
|
||||
<!-- jdbc setting -->
|
||||
<!-- <mysql.version>5.1.49</mysql.version> -->
|
||||
<mysql.version>8.0.29</mysql.version>
|
||||
|
||||
|
||||
<!-- environment setting -->
|
||||
<java.version>1.8</java.version>
|
||||
<!-- <tomcat.version>9.0.58</tomcat.version> -->
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version><!-- 降级到该版本,新版本可能会出现VM崩溃 -->
|
||||
<resource.delimiter>@</resource.delimiter>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version><!-- 其它版本可能会出现VM崩溃 -->
|
||||
<eclipse-plugin-download-sources>false</eclipse-plugin-download-sources>
|
||||
<eclipse-plugin-download-javadocs>false</eclipse-plugin-download-javadocs>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<!-- docker setting -->
|
||||
<docker.dockerHost>http://192.168.56.102:2375</docker.dockerHost>
|
||||
<docker.imageName>thinkgem/${project.artifactId}:5.0</docker.imageName>
|
||||
<docker.run.port>8980:8980</docker.run.port>
|
||||
|
||||
|
||||
</properties>
|
||||
|
||||
|
||||
<build>
|
||||
|
||||
|
||||
<plugins>
|
||||
|
||||
|
||||
<!-- compiler插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- jar插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- resource插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<!-- install插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<!-- clean插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
|
||||
</plugins>
|
||||
|
||||
|
||||
<pluginManagement>
|
||||
|
||||
|
||||
<plugins>
|
||||
|
||||
<!-- compiler插件,设定JDK版本 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<parameters>true</parameters>
|
||||
<showWarnings>true</showWarnings>
|
||||
<!-- <compilerArguments>
|
||||
<verbose /> 输出有关编译器正在执行的操作的消息
|
||||
@@ -126,8 +122,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 +139,7 @@
|
||||
<excludes>
|
||||
<exclude>userfiles/**</exclude>
|
||||
</excludes>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
@@ -149,12 +151,12 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- war插件,war包名称不带版本号 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.2.3</version>
|
||||
<version>3.3.2</version>
|
||||
<configuration>
|
||||
<warSourceExcludes>
|
||||
userfiles/**
|
||||
@@ -163,11 +165,48 @@
|
||||
<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>
|
||||
|
||||
<!-- springboot插件 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>repackage</id>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!--suppress UnresolvedMavenProperty -->
|
||||
<mainClass>${start-class}</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- Eclipse 插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -191,7 +230,7 @@
|
||||
</additionalProjectnatures>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Java Document Generate -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -209,7 +248,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- JavaScript CSS Compress -->
|
||||
<plugin>
|
||||
<groupId>com.jeesite.maven</groupId>
|
||||
@@ -240,7 +279,7 @@
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Eclipse m2e settings only -->
|
||||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
@@ -253,6 +292,7 @@
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<!--suppress UnresolvedMavenProperty -->
|
||||
<versionRange>${maven-dependency-plugin.version}</versionRange>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
@@ -266,7 +306,7 @@
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- Docker 插件 https://github.com/fabric8io/docker-maven-plugin -->
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
@@ -297,11 +337,11 @@
|
||||
</images>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
</plugins>
|
||||
|
||||
|
||||
</pluginManagement>
|
||||
|
||||
|
||||
<!-- 资源文件配置 -->
|
||||
<resources>
|
||||
<resource>
|
||||
@@ -317,24 +357,24 @@
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>thinkgem</id>
|
||||
<name>WangZhen</name>
|
||||
<email>thinkgem at 163.com</email>
|
||||
<roles><role>Project lead</role></roles>
|
||||
<timezone>+8</timezone>
|
||||
<timezone>+8</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
|
||||
<organization>
|
||||
<name>JeeSite</name>
|
||||
<url>http://jeesite.com</url>
|
||||
</organization>
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliyun-repos</id>
|
||||
@@ -359,9 +399,9 @@
|
||||
<url>http://maven.jeesite.net/repository/maven-public</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
|
||||
<profiles>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>javadoc</id>
|
||||
<build>
|
||||
@@ -373,7 +413,7 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>package</id>
|
||||
<build>
|
||||
@@ -385,7 +425,7 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>deploy</id>
|
||||
<build>
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite</name>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-root</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Root</name>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -24,4 +24,4 @@ cd app
|
||||
jar -xvf web.war
|
||||
rm web.war
|
||||
cd WEB-INF
|
||||
exec ./startup.sh
|
||||
sh ./startup.sh
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ productName: JeeSite Demo
|
||||
companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.0
|
||||
productVersion: V5.1
|
||||
copyrightYear: 2022
|
||||
|
||||
# 是否演示模式
|
||||
@@ -825,7 +825,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,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ productName: JeeSite Demo
|
||||
companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.0
|
||||
productVersion: V5.1
|
||||
copyrightYear: 2022
|
||||
|
||||
# 是否演示模式
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ echo "[信息] 本操作主要用于首次安装 JeeSite 或后安装 Module 的
|
||||
echo ""
|
||||
echo "[信息] 在 v4.2 版本以后,官方初始化数据库是比较安全的,官方代码中不会包含任何删除数据表及数据的脚本。"
|
||||
echo ""
|
||||
echo "[信息] 如果你是升级到 v4.2 以后的版本,无法排除你是否升级完整,为安全起见,建议先备份数据库后再操作。"
|
||||
echo "[信息] 如果你是升级到该版本,不排除你是否升级完整,为安全起见,建议先备份数据库后再操作。"
|
||||
echo ""
|
||||
echo -n "请按任意键继续 ... "
|
||||
read text
|
||||
|
||||
@@ -24,4 +24,4 @@ cd app
|
||||
jar -xvf web.war
|
||||
rm web.war
|
||||
cd WEB-INF
|
||||
exec ./startup.sh
|
||||
sh ./startup.sh
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.0.2-SNAPSHOT</version>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ productName: JeeSite Demo
|
||||
companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.0
|
||||
productVersion: V5.1
|
||||
copyrightYear: 2022
|
||||
|
||||
# 是否演示模式
|
||||
@@ -39,18 +39,18 @@ server:
|
||||
# # 线程数最大和最小个数
|
||||
# threads:
|
||||
# max: 200
|
||||
# min-spare: 10
|
||||
|
||||
# min-spare: 10
|
||||
|
||||
# 当 Nginx 为 https,tomcat 为 http 时,设置该选项为 true
|
||||
schemeHttps: false
|
||||
|
||||
|
||||
#======================================#
|
||||
#========== Database sttings ==========#
|
||||
#======================================#
|
||||
|
||||
# 数据库连接
|
||||
jdbc:
|
||||
|
||||
jdbc:
|
||||
|
||||
# Mysql 数据库配置
|
||||
type: mysql
|
||||
driver: com.mysql.cj.jdbc.Driver
|
||||
@@ -82,7 +82,7 @@ jdbc:
|
||||
# username: jeesite
|
||||
# password: jeesite
|
||||
# testSql: SELECT 1
|
||||
|
||||
|
||||
# # PostgreSql 数据库配置
|
||||
# type: postgresql
|
||||
# driver: org.postgresql.Driver
|
||||
@@ -101,7 +101,7 @@ jdbc:
|
||||
|
||||
# 连接信息加密
|
||||
encrypt:
|
||||
|
||||
|
||||
# 加密连接用户名
|
||||
username: false
|
||||
# 加密连接密码
|
||||
@@ -109,7 +109,7 @@ jdbc:
|
||||
|
||||
# 数据库连接池配置
|
||||
pool:
|
||||
|
||||
|
||||
# 初始化连接数
|
||||
init: 1
|
||||
# 最小空闲连接数
|
||||
@@ -119,29 +119,29 @@ jdbc:
|
||||
|
||||
# # 获取连接等待超时时间,单位毫秒(1分钟)(4.0.6+)
|
||||
# maxWait: 60000
|
||||
#
|
||||
#
|
||||
# # 从池中取出和归还连接前进行检验,如果检验失败,则从池中去除连接并尝试取出另一个(4.0.6+)
|
||||
# testOnBorrow: false
|
||||
# testOnReturn: false
|
||||
#
|
||||
#
|
||||
# # 间隔多久才进行一次检测,检测需要关闭的空闲连接,单位毫秒(1分钟)(4.0.6+)
|
||||
# timeBetweenEvictionRunsMillis: 60000
|
||||
#
|
||||
#
|
||||
# # 一个连接在池中最小空闲的时间,单位毫秒(20分钟)(4.0.6+)
|
||||
# minEvictableIdleTimeMillis: 1200000
|
||||
# # 一个连接在池中最大空闲的时间,单位毫秒(30分钟)(4.1.2+)
|
||||
# maxEvictableIdleTimeMillis: 1800000
|
||||
#
|
||||
#
|
||||
# # 连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作(4.1.8+)
|
||||
# keepAlive: false
|
||||
#
|
||||
#
|
||||
# # 是否自动回收泄露的连接和超时时间,单位秒(35分钟)(4.0.6+)
|
||||
# removeAbandoned: false
|
||||
# removeAbandonedTimeout: 2100
|
||||
#
|
||||
# # Oracle 下会自动开启 PSCache,并指定每个连接上 PSCache 大小。若不指定,则与 maxActive 相同(4.1.5+)
|
||||
# maxPoolPreparedStatementPerConnectionSize: ~
|
||||
#
|
||||
#
|
||||
# # 设置连接属性,可获取到表的 remark (备注)
|
||||
# remarksReporting: false
|
||||
|
||||
@@ -154,7 +154,7 @@ jdbc:
|
||||
#
|
||||
# # 多数据源名称列表,多个用逗号隔开,使用方法:@MyBatisDao(dataSourceName="ds2")
|
||||
# dataSourceNames: ds_read_01, ds_read_02
|
||||
#
|
||||
#
|
||||
# # 默认数据源的从库01
|
||||
# ds_read_01:
|
||||
# type: mysql
|
||||
@@ -167,7 +167,7 @@ jdbc:
|
||||
# init: 1
|
||||
# minIdle: 3
|
||||
# maxActive: 20
|
||||
#
|
||||
#
|
||||
# # 默认数据源的从库02
|
||||
# ds_read_02:
|
||||
# type: mysql
|
||||
@@ -229,9 +229,9 @@ jdbc:
|
||||
|
||||
# # 事务超时时间,单位秒(30分钟)(v4.1.5+)
|
||||
# transactionTimeout: 1800
|
||||
#
|
||||
#
|
||||
# # 表名和字段名(前缀|后缀)是否强制大写(v4.1.8+)
|
||||
# tableAndColumn:
|
||||
# tableAndColumn:
|
||||
# prefixSuffix: "`|`"
|
||||
# forceUpperCase: true
|
||||
#
|
||||
@@ -243,15 +243,15 @@ jdbc:
|
||||
#======================================#
|
||||
|
||||
spring:
|
||||
|
||||
|
||||
# 应用程序名称
|
||||
application:
|
||||
name: jeesite-web
|
||||
|
||||
|
||||
# 环境名称(注意:不可设置为 test 它是单元测试专用的名称)
|
||||
profiles:
|
||||
active: default
|
||||
|
||||
|
||||
# 打印横幅
|
||||
main:
|
||||
bannerMode: "off"
|
||||
@@ -260,7 +260,7 @@ spring:
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ANT_PATH_MATCHER
|
||||
|
||||
|
||||
# # Redis 连接参数 (RedisProperties)
|
||||
# redis:
|
||||
# host: 127.0.0.1
|
||||
@@ -292,7 +292,7 @@ spring:
|
||||
# 日志配置
|
||||
logging:
|
||||
config: classpath:config/logback-spring.xml
|
||||
|
||||
|
||||
#======================================#
|
||||
#========== System settings ===========#
|
||||
#======================================#
|
||||
@@ -305,16 +305,16 @@ logging:
|
||||
|
||||
# 分页相关
|
||||
#page:
|
||||
#
|
||||
#
|
||||
# # 默认每页显示的数据条数
|
||||
# pageSize: 20
|
||||
#
|
||||
#
|
||||
# # 每页最大条数,防止分页过大导致系统缓慢或内存溢出
|
||||
# maxPageSize: 999
|
||||
|
||||
# 用户相关
|
||||
user:
|
||||
|
||||
|
||||
# # 指定超级管理员编号(研发团队使用的账号)
|
||||
# superAdminCode: system
|
||||
#
|
||||
@@ -323,13 +323,13 @@ user:
|
||||
#
|
||||
# # 系统管理员角色编号(客户方管理员使用的角色)
|
||||
# corpAdminRoleCode: corpAdmin
|
||||
#
|
||||
#
|
||||
# # 二级管理员的控制权限类型(1拥有的权限 2管理的权限,管理功能包括:用户管理、组织机构、公司管理等)(v4.1.5+)
|
||||
# adminCtrlPermi: 2
|
||||
|
||||
|
||||
# 多租户模式(SAAS模式)(专业版)
|
||||
useCorpModel: false
|
||||
|
||||
|
||||
# # 登录账号是否租户内唯一,否则全局唯一
|
||||
# loginCodeCorpUnique: false
|
||||
#
|
||||
@@ -388,9 +388,9 @@ user:
|
||||
# # 以方便读取树结构数据权限的表时包含子节点,举例如下:
|
||||
# # ctrlDataAttrName: "officeCodesAndChildren", ctrlDataParentCodesAttrName: ""
|
||||
# dataScopeApiMode: false
|
||||
|
||||
# 角色管理
|
||||
#role:
|
||||
|
||||
# 角色管理
|
||||
#role:
|
||||
# # 扩展数据权限定义:3:本部门;4:本公司;5:本部门和本公司
|
||||
# extendDataScopes: >
|
||||
# {
|
||||
@@ -444,22 +444,22 @@ user:
|
||||
# 国际化管理(专业版)
|
||||
lang:
|
||||
enabled: false
|
||||
|
||||
|
||||
# # 默认语言(4.1.3+)
|
||||
# defaultLocale: zh_CN
|
||||
# # 默认时区(4.1.3+)
|
||||
# defaultTimeZone: GMT+08:00
|
||||
|
||||
|
||||
# 任务调度(标准版)
|
||||
job:
|
||||
enabled: false
|
||||
|
||||
|
||||
# # 是否自动启动任务调度(可关闭)
|
||||
# autoStartup: true
|
||||
#
|
||||
# # 任务调度启动延迟设置(单位:秒)(建议设置项目启动完成后的时间)
|
||||
# startupDelay: 60
|
||||
#
|
||||
#
|
||||
# # 任务调度线程池
|
||||
# threadPool:
|
||||
# threadCount: 10
|
||||
@@ -499,7 +499,7 @@ job:
|
||||
# 代码生成
|
||||
gen:
|
||||
enabled: true
|
||||
|
||||
|
||||
# # 表名字段名是否强制小写
|
||||
# forceLowerCase: true
|
||||
|
||||
@@ -513,7 +513,7 @@ state:
|
||||
|
||||
# Shiro 相关
|
||||
shiro:
|
||||
|
||||
|
||||
# 主页路径
|
||||
defaultPath: ${shiro.loginUrl}
|
||||
|
||||
@@ -549,36 +549,36 @@ shiro:
|
||||
#secretKey: thinkgem,jeesite,com
|
||||
secretKey: Base64
|
||||
#secretKey: ~
|
||||
|
||||
|
||||
# 记住我密钥设置,你可以通过 com.jeesite.test.RememberMeKeyGen 类快速生成一个秘钥。
|
||||
# 若不设置,则每次启动系统后自动生成一个新秘钥,这样会导致每次重启后,客户端记录的用户信息将失效。
|
||||
rememberMe:
|
||||
secretKey: ~
|
||||
|
||||
|
||||
# # 指定获取客户端IP的Header名称,防止IP伪造。指定为空,则使用原生方法获取IP。
|
||||
# remoteAddrHeaderName: X-Forwarded-For
|
||||
#
|
||||
#
|
||||
# # 允许的请求方法设定,解决安全审计问题(BPM设计器用到了PUT或DELETE方法)
|
||||
# allowRequestMethods: GET, POST, OPTIONS, PUT, DELETE
|
||||
#
|
||||
#
|
||||
# # 是否允许账号多地登录,如果设置为false,同一个设备类型的其它地点登录的相同账号被踢下线
|
||||
# isAllowMultiAddrLogin: true
|
||||
#
|
||||
#
|
||||
# # 是否允许多账号多设备登录,如果设置为false,其它地点登录的相同账号全部登录设备将被踢下线
|
||||
# isAllowMultiDeviceLogin: true
|
||||
#
|
||||
#
|
||||
# # 是否允许刷新主框架页,如果设置为false,刷新主页将导致重新登录。如安全性比较高的,如银行个人首页不允许刷新。
|
||||
# isAllowRefreshIndex: true
|
||||
#
|
||||
#
|
||||
# # 是否允许嵌入到外部网站iframe中(true:不限制,false:不允许)
|
||||
# isAllowExternalSiteIframe: true
|
||||
#
|
||||
#
|
||||
# # 设定允许获取的资源列表(v4.2.3)
|
||||
# #contentSecurityPolicy: "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; img-src 'self' 'unsafe-inline' 'unsafe-eval' data:"
|
||||
|
||||
# # 是否允许跨域访问 CORS,如果允许,设置允许的域名。v4.2.3 开始支持多个域名和模糊匹配,例如:http://*.jeesite.com,http://*.jeesite.net
|
||||
# accessControlAllowOrigin: '*'
|
||||
#
|
||||
#
|
||||
# # 允许跨域访问时 CORS,可以获取和返回的方法和请求头
|
||||
# accessControlAllowMethods: GET, POST, OPTIONS
|
||||
# accessControlAllowHeaders: content-type, x-requested-with, x-ajax, x-token, x-remember
|
||||
@@ -586,7 +586,7 @@ shiro:
|
||||
|
||||
# # 是否允许接收跨域的Cookie凭证数据 CORS
|
||||
# accessControlAllowCredentials: false
|
||||
#
|
||||
#
|
||||
# # 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链)
|
||||
# allowReferers: http://127.0.0.1,http://localhost
|
||||
#
|
||||
@@ -615,45 +615,45 @@ shiro:
|
||||
# ${adminPath}/sys/corpAdmin/treeData = anon
|
||||
# ${adminPath}/${spring.application.name}/swagger/** = anon
|
||||
# ${adminPath}/** = user
|
||||
|
||||
|
||||
# Session 相关
|
||||
session:
|
||||
|
||||
|
||||
# 会话超时时间,单位:毫秒,10m=600000, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms, 12h=43200000ms, 1day=86400000ms
|
||||
# 注意:如果超时超过30m,你还需要同步修改当前配置文件的属性:j2cache.caffeine.region.sessionCache 超时时间,大于这个值。
|
||||
|
||||
|
||||
# 游客会话超时时间:只访问了系统,但未登录系统的用户为游客,游客默认超时时间为10分钟,如:未登录系统时的图片验证码有效时间。
|
||||
sessionTimeout: 180000
|
||||
|
||||
|
||||
# 登录系统后的用户超时时间(不明确 param_deviceType 参数的,默认设备为 pc 登录)
|
||||
pcSessionTimeout: 1800000
|
||||
|
||||
|
||||
# # 手机APP设备会话超时参数设置,登录请求参数加 param_deviceType=mobileApp 时有效,一般情况无需设置
|
||||
# mobileAppSessionTimeout: 1800000
|
||||
#
|
||||
#
|
||||
# # 定时清理失效会话,清理用户直接关闭浏览器造成的孤立会话(设置为 0 关闭,微服务下只开启 core 即可)
|
||||
# sessionTimeoutClean: 1200000
|
||||
#
|
||||
#
|
||||
# # 会话唯一标识SessionId在Cookie中的名称。
|
||||
# sessionIdCookieName: jeesite.session.id
|
||||
# #sessionIdCookiePath: ${server.servlet.context-path}
|
||||
#
|
||||
#
|
||||
# # 共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。
|
||||
# shareSessionIdCookieName: ${session.sessionIdCookieName}
|
||||
#
|
||||
#
|
||||
# # 其它 SimpleCookie 参数(v4.2.3)
|
||||
# sessionIdCookieSecure: false
|
||||
# sessionIdCookieHttpOnly: true
|
||||
# sessionIdCookieSameSite: LAX
|
||||
#
|
||||
#
|
||||
# # 设置接收 SessionId 请求参数和请求头的名称
|
||||
# sessionIdParamName: __sid
|
||||
# sessionIdHeaderName: x-token
|
||||
#
|
||||
#
|
||||
# # 当直接通过 __sid 参数浏览器访问页面时,可将直接将 __sid 写入 Cookie 应用于后面的访问
|
||||
# # 访问地址举例:http://host/js/a/index?__sid=123456&__cookie=true
|
||||
# writeCookieParamName: __cookie
|
||||
#
|
||||
#
|
||||
# # 记住我的请求参数和请求头的名称(v4.2.3)
|
||||
# rememberMeHeaderName: x-remember
|
||||
|
||||
@@ -666,7 +666,7 @@ session:
|
||||
# #[cacheName]: size, xxxx[s|m|h|d]
|
||||
# default: 10000, 1h
|
||||
# sessionCache: 100000, 12h
|
||||
#
|
||||
#
|
||||
# # 二级缓存
|
||||
# redis:
|
||||
# # 存储模式 (generic|hash)
|
||||
@@ -682,7 +682,7 @@ session:
|
||||
# maxPoolSize: 20
|
||||
# keepAliveSeconds: 60
|
||||
# queueCapacity: 1000
|
||||
#
|
||||
#
|
||||
# # 通知订阅
|
||||
# broadcast:
|
||||
# # 缓存清理模式
|
||||
@@ -693,19 +693,19 @@ session:
|
||||
|
||||
# MyBatis 相关
|
||||
mybatis:
|
||||
|
||||
|
||||
# @MyBatisDao、Aliases 扫描基础包,如果多个,用“,”分隔
|
||||
scanBasePackage: com.jeesite.modules
|
||||
|
||||
|
||||
# # TypeHandlers 扫描基础包,如果多个,用“,”分隔
|
||||
# scanTypeHandlersPackage: ~
|
||||
#
|
||||
#
|
||||
# # 是否开启 JDBC 管理事务,默认 Spring 管理事务 v4.2.3
|
||||
# jdbcTransaction: false
|
||||
#
|
||||
# # 批量插入和更新的分批默认大小(防止库一次性接受不了太大的sql语句)
|
||||
# defaultBatchSize: 500
|
||||
|
||||
|
||||
# Mapper文件刷新线程
|
||||
mapper:
|
||||
refresh:
|
||||
@@ -713,25 +713,25 @@ mybatis:
|
||||
# delaySeconds: 60
|
||||
# sleepSeconds: 3
|
||||
# mappingPath: mappings
|
||||
|
||||
|
||||
# Web 相关
|
||||
web:
|
||||
|
||||
# # AJAX 接受参数名和请求头名(v4.3.0)
|
||||
# ajaxParamName: __ajax
|
||||
# ajaxHeaderName: x-ajax
|
||||
#
|
||||
#
|
||||
# # MVC 视图相关
|
||||
# view:
|
||||
#
|
||||
#
|
||||
# # 系统主题名称,主题视图优先级最高,如果主题下无这个视图文件则访问默认视图
|
||||
# # 引入页面头部:'/themes/'+themeName+'/include/header.html'
|
||||
# # 引入页面尾部:'/themes/'+themeName+'/include/footer.html'
|
||||
# themeName: default
|
||||
#
|
||||
#
|
||||
# # 使用智能参数接收器,同时支持 JSON 和 FormData 的参数接受
|
||||
# smartMethodArgumentResolver: true
|
||||
#
|
||||
#
|
||||
# # 使用 .json、.xml 后缀匹配返回视图数据(Spring官方已不推荐使用)
|
||||
# favorPathExtension: false
|
||||
# # 使用 __ajax=json、__ajax=xml 后缀匹配返回视图数据
|
||||
@@ -741,7 +741,7 @@ web:
|
||||
|
||||
# MVC 拦截器
|
||||
interceptor:
|
||||
|
||||
|
||||
# 后台管理日志记录拦截器
|
||||
log:
|
||||
enabled: true
|
||||
@@ -758,46 +758,46 @@ web:
|
||||
${adminPath}/file/**,
|
||||
${adminPath}/tags/*,
|
||||
${adminPath}/msg/**
|
||||
|
||||
|
||||
# 前台自动切换到手机视图拦截器
|
||||
mobile:
|
||||
enabled: false
|
||||
addPathPatterns: >
|
||||
${frontPath}/**
|
||||
excludePathPatterns: ~
|
||||
|
||||
|
||||
# # 静态文件后缀,过滤静态文件,以提高访问性能。
|
||||
# staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
#
|
||||
#
|
||||
# # 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。
|
||||
# staticFileExcludeUri: /druid/
|
||||
#
|
||||
#
|
||||
# # 静态资源路径前缀,可做 CDN 加速优化,默认前面增加 ctxPath 前缀,如果前面写 “//” 两个斜杠 或 包含 “://” 不加 ctxPath。
|
||||
# staticPrefix: /static
|
||||
#
|
||||
#
|
||||
# # 严格模式(更严格的数据安全验证)
|
||||
# strictMode: false
|
||||
#
|
||||
#
|
||||
# # 自定义正则表达式验证(主键、登录名)
|
||||
# validator:
|
||||
# id: '[a-zA-Z0-9_\-/#\u4e00-\u9fa5]{0,64}'
|
||||
# user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}'
|
||||
#
|
||||
#
|
||||
# # 默认的日期格式(JsonMapper)
|
||||
# json:
|
||||
# defaultDateFormat: yyyy-MM-dd HH:mm:ss
|
||||
#
|
||||
#
|
||||
# # 默认不启用(为兼用旧版保留,建议使用 CORS)
|
||||
# jsonp:
|
||||
# enabled: false
|
||||
# callback: __callback
|
||||
|
||||
# 核心模块的Web功能(仅作为微服务时设为false)
|
||||
core:
|
||||
core:
|
||||
enabled: true
|
||||
|
||||
|
||||
# 在线API文档工具
|
||||
swagger:
|
||||
swagger:
|
||||
enabled: true
|
||||
|
||||
# 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false)
|
||||
@@ -812,47 +812,47 @@ error:
|
||||
# 文件上传
|
||||
file:
|
||||
enabled: true
|
||||
|
||||
|
||||
# # 文件上传根路径,设置路径中不允许包含“userfiles”,在指定目录中系统会自动创建userfiles目录,如果不设置默认为contextPath路径
|
||||
# #baseDir: D:/jeesite
|
||||
#
|
||||
#
|
||||
# # 上传文件的相对路径(支持:yyyy, MM, dd, HH, mm, ss, E)
|
||||
# uploadPath: '{yyyy}{MM}/'
|
||||
#
|
||||
#
|
||||
# # 上传单个文件最大字节(500M),在这之上还有 > Tomcat限制 > Nginx限制,等,此设置会覆盖 spring.http.multipart.maxFileSize 设置
|
||||
# maxFileSize: '500*1024*1024'
|
||||
#
|
||||
#
|
||||
# # 设置允许上传的文件后缀(全局设置)
|
||||
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,
|
||||
# mediaAllowSuffixes: .flv,.swf,.mkv,webm,.mid,.mov,.mp3,.mp4,.m4v,.mpc,.mpeg,.mpg,.swf,.wav,.wma,.wmv,.avi,.rm,.rmi,.rmvb,.aiff,.asf,.ogg,.ogv,
|
||||
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||
#
|
||||
# fileAllowSuffixes: .doc,.docx,.rtf,.xls,.xlsx,.csv,.ppt,.pptx,.pdf,.vsd,.txt,.md,.xml,.rar,.zip,.7z,.tar,.tgz,.jar,.gz,.gzip,.bz2,.cab,.iso,.ipa,.apk,
|
||||
#
|
||||
# # 允许上传的文件内容类型(图片、word、excel、ppt)防止修改后缀恶意上传文件(默认不启用验证)
|
||||
# #allowContentTypes: image/jpeg,image/gif,image/bmp,image/png,image/x-png,
|
||||
# # application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,
|
||||
# # application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
|
||||
# # application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation
|
||||
#
|
||||
#
|
||||
# # 上传图片自动压缩宽高,指定为 -1 不进行压缩(全局设置) v4.1.7
|
||||
# imageMaxWidth: 1024
|
||||
# imageMaxHeight: 768
|
||||
#
|
||||
#
|
||||
# # 是否启用秒传
|
||||
# checkmd5: true
|
||||
#
|
||||
#
|
||||
# # 是否开启分片上传
|
||||
# chunked: true
|
||||
# # 分片大小,单位字节(10M)
|
||||
# chunkSize: '10*1024*1024'
|
||||
# # 最大上传线程数
|
||||
# threads: 3
|
||||
#
|
||||
#
|
||||
# # 是否启用检查点(支持断点续传,上传)
|
||||
# checkpoint: true
|
||||
#
|
||||
# # 是否用文件流方式下载(支持断点续传,下载)
|
||||
# isFileStreamDown: true
|
||||
|
||||
|
||||
# 视频转码
|
||||
#video:
|
||||
#
|
||||
@@ -877,7 +877,7 @@ file:
|
||||
# 消息提醒中心(专业版)
|
||||
msg:
|
||||
enabled: false
|
||||
|
||||
|
||||
# # 是否开启实时发送消息(保存消息后立即检查未读消息并发送),分布式部署下请单独配置消息发送服务,不建议开启此选项。
|
||||
# realtime:
|
||||
# # 是否开启
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user