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.
@@ -11,3 +11,4 @@
|
||||
5.0.0
|
||||
5.0.1
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -281,6 +283,12 @@ public class Log extends DataEntity<Log> {
|
||||
return values != null && values.length > 0 ? values[0] : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
public Date getCreateDate() {
|
||||
return super.getCreateDate();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public String toString() {
|
||||
// return ReflectionToStringBuilder.toString(this);
|
||||
|
||||
@@ -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
|
||||
@@ -37,6 +36,13 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class SsoController extends BaseController{
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// String username = "system";
|
||||
// String secretKey = 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,
|
||||
@@ -688,6 +689,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,7 +84,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
return ${className}Service.getAndValid(${className});
|
||||
<% } %>
|
||||
}
|
||||
<% if(table.isTreeEntity){ %>
|
||||
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
|
||||
|
||||
/**
|
||||
* 管理主页
|
||||
@@ -204,6 +213,50 @@ public class ${ClassName}Controller extends BaseController {
|
||||
${className}Service.save(${className});
|
||||
return renderResult(Global.TRUE, text("保存${functionNameSimple}成功!"));
|
||||
}
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "exportData")
|
||||
public void exportData(${ClassName} ${className}, HttpServletResponse response) {
|
||||
List<${ClassName}> list = ${className}Service.findList(${className});
|
||||
String fileName = "${functionNameSimple}" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
${ClassName} ${className} = new ${ClassName}();
|
||||
List<${ClassName}> list = ListUtils.newArrayList(${className});
|
||||
String fileName = "${functionNameSimple}模板.xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class, Type.IMPORT)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@PostMapping(value = "importData")
|
||||
public String importData(MultipartFile file) {
|
||||
try {
|
||||
String message = ${className}Service.importData(file);
|
||||
return renderResult(Global.TRUE, "posfull:"+message);
|
||||
} catch (Exception ex) {
|
||||
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
|
||||
}
|
||||
}
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,11 @@ import com.jeesite.modules.bpm.entity.BpmTreeEntity;
|
||||
import com.jeesite.modules.bpm.entity.BpmEntity;
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelFields;
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* ${functionName}Entity
|
||||
@@ -210,6 +215,17 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
|
||||
// 生成构造方法
|
||||
%>
|
||||
|
||||
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
@ExcelFields({
|
||||
<% for(c in table.columnList){ if(c.optionMap['isImportExport'] == @Global.YES){ %>
|
||||
@ExcelField(title="${c.columnLabel}", attrName="${c.attrName}"${
|
||||
isNotBlank(c.optionMap['dictType'])?', dictType="'+c.optionMap['dictType']+'"':''
|
||||
}, align=Align.CENTER, sort=${c.columnSort}${
|
||||
c.showType == 'date'?', dataFormat="yyyy-MM-dd"':c.showType == 'datetime'?', dataFormat="yyyy-MM-dd hh:mm"':''
|
||||
}),
|
||||
<% } } %>
|
||||
})
|
||||
<% } %>
|
||||
public ${ClassName}() {
|
||||
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
|
||||
}
|
||||
|
||||
@@ -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,7 +84,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
return ${className}Service.getAndValid(${className});
|
||||
<% } %>
|
||||
}
|
||||
<% if(table.isTreeEntity){ %>
|
||||
<% if(table.isTreeEntity || isNotBlank(table.optionMap['leftTreeRightTableUrl'])){ %>
|
||||
|
||||
/**
|
||||
* 管理主页
|
||||
@@ -204,6 +213,50 @@ public class ${ClassName}Controller extends BaseController {
|
||||
${className}Service.save(${className});
|
||||
return renderResult(Global.TRUE, text("保存${functionNameSimple}成功!"));
|
||||
}
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "exportData")
|
||||
public void exportData(${ClassName} ${className}, HttpServletResponse response) {
|
||||
List<${ClassName}> list = ${className}Service.findList(${className});
|
||||
String fileName = "${functionNameSimple}" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
${ClassName} ${className} = new ${ClassName}();
|
||||
List<${ClassName}> list = ListUtils.newArrayList(${className});
|
||||
String fileName = "${functionNameSimple}模板.xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("${functionNameSimple}", ${ClassName}.class, Type.IMPORT)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequiresPermissions("${permissionPrefix}:edit")
|
||||
@PostMapping(value = "importData")
|
||||
public String importData(MultipartFile file) {
|
||||
try {
|
||||
String message = ${className}Service.importData(file);
|
||||
return renderResult(Global.TRUE, "posfull:"+message);
|
||||
} catch (Exception ex) {
|
||||
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
|
||||
}
|
||||
}
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
<content><![CDATA[
|
||||
package ${packageName}.${moduleName}.entity${isNotBlank(subModuleName)?'.'+subModuleName:''};
|
||||
|
||||
<% if(table.childList.~size > 0){ %>
|
||||
import javax.validation.Valid;
|
||||
<% } %>
|
||||
<% for(i in table.importList){ %>
|
||||
import ${i};
|
||||
<% } %>
|
||||
@@ -26,6 +29,11 @@ import com.jeesite.modules.bpm.entity.BpmTreeEntity;
|
||||
import com.jeesite.modules.bpm.entity.BpmEntity;
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelFields;
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* ${functionName}Entity
|
||||
@@ -207,6 +215,17 @@ public class ${ClassName} extends ${toBoolean(table.optionMap['isBpmForm'])?(tab
|
||||
// 生成构造方法
|
||||
%>
|
||||
|
||||
<% if(!table.parentExists && toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
@ExcelFields({
|
||||
<% for(c in table.columnList){ if(c.optionMap['isImportExport'] == @Global.YES){ %>
|
||||
@ExcelField(title="${c.columnLabel}", attrName="${c.attrName}"${
|
||||
isNotBlank(c.optionMap['dictType'])?', dictType="'+c.optionMap['dictType']+'"':''
|
||||
}, align=Align.CENTER, sort=${c.columnSort}${
|
||||
c.showType == 'date'?', dataFormat="yyyy-MM-dd"':c.showType == 'datetime'?', dataFormat="yyyy-MM-dd hh:mm"':''
|
||||
}),
|
||||
<% } } %>
|
||||
})
|
||||
<% } %>
|
||||
public ${ClassName}() {
|
||||
this(<% for(pk in table.pkList){ %>${pkLP.index!=1?', ':''}null<% } %>);
|
||||
}
|
||||
|
||||
@@ -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,13 +36,20 @@ $('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();
|
||||
<% 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();
|
||||
}}
|
||||
}, tree, loadTree = function(){
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
<a href="#" class="btn btn-default" id="btnExpandTreeNode" title="\${text('展开一级')}"><i class="fa fa-angle-double-down"></i> \${text('展开')}</a>
|
||||
<a href="#" class="btn btn-default" id="btnCollapseTreeNode" title="\${text('折叠全部')}"><i class="fa fa-angle-double-up"></i> \${text('折叠')}</a>
|
||||
<% } %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<a href="#" class="btn btn-default" id="btnExport"><i class="glyphicon glyphicon-export"></i> ${text('导出')}</a>
|
||||
<% } %>
|
||||
\<% if(hasPermi('${permissionPrefix}:edit')){ %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<a href="#" class="btn btn-default" id="btnImport"><i class="glyphicon glyphicon-import"></i> ${text('导入')}</a>
|
||||
<% } %>
|
||||
<a href="\${ctx}/${urlPrefix}/form" class="btn btn-default btnTool" title="\${text('新增${functionNameSimple}')}"><i class="fa fa-plus"></i> \${text('新增')}</a>
|
||||
\<% } %>
|
||||
<a href="#" class="btn btn-default" id="btnSetting" title="\${text('设置')}"><i class="fa fa-navicon"></i></a>
|
||||
@@ -31,3 +37,58 @@
|
||||
</div>
|
||||
\<% } %>
|
||||
<% include('/templates/modules/gen/include/dataGridScript.html'){} %>
|
||||
<% if(toBoolean(table.optionMap['isImportExport'])){ %>
|
||||
<script>
|
||||
$('#btnExport').click(function(){
|
||||
js.ajaxSubmitForm($('#searchForm'), {
|
||||
url:'\${ctx}/${urlPrefix}/exportData',
|
||||
downloadFile:true
|
||||
});
|
||||
});
|
||||
$('#btnImport').click(function(){
|
||||
js.layer.open({
|
||||
type: 1,
|
||||
area: ['400px'],
|
||||
title: '\${text("导入${functionNameSimple}")}',
|
||||
resize: false,
|
||||
scrollbar: true,
|
||||
content: js.template('importTpl'),
|
||||
btn: ['<i class="fa fa-check"></i> \${text("导入")}',
|
||||
'<i class="fa fa-remove"></i> \${text("关闭")}'],
|
||||
btn1: function(index, layero){
|
||||
var form = {
|
||||
inputForm: layero.find('#inputForm'),
|
||||
file: layero.find('#file').val()
|
||||
};
|
||||
if (form.file == '' || (!js.endWith(form.file, '.xls') && !js.endWith(form.file, '.xlsx'))){
|
||||
js.showMessage("\${text('文件不正确,请选择后缀为“xls”或“xlsx”的文件。')}", null, 'warning');
|
||||
return false;
|
||||
}
|
||||
js.ajaxSubmitForm(form.inputForm, function(data){
|
||||
js.showMessage(data.message);
|
||||
if(data.result == Global.TRUE){
|
||||
js.layer.closeAll();
|
||||
}
|
||||
page();
|
||||
}, "json");
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script id="importTpl" type="text/template">//<!--
|
||||
<form id="inputForm" action="\${ctx}/${urlPrefix}/importData" method="post" enctype="multipart/form-data"
|
||||
class="form-horizontal mt20 mb10" style="overflow:auto;max-height:200px;">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-xs-offset-1">
|
||||
<input type="file" id="file" name="file" class="form-file"/>
|
||||
<div class="mt10 pt5" style="color:red">
|
||||
\${text('提示:仅允许导入“xls”或“xlsx”格式文件!')}
|
||||
</div>
|
||||
<div class="mt10 pt5">
|
||||
<a href="\${ctx}/${urlPrefix}/importTemplate" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> \${text('下载模板')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
//--></script><% } %>
|
||||
@@ -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
|
||||
|
||||
# 数据库连接
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
<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>
|
||||
@@ -26,7 +27,7 @@
|
||||
<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>
|
||||
@@ -41,14 +42,14 @@
|
||||
<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> -->
|
||||
@@ -58,9 +59,14 @@
|
||||
<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>
|
||||
@@ -91,18 +97,6 @@
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<!-- install插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<!-- clean插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<pluginManagement>
|
||||
@@ -113,7 +107,9 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<parameters>true</parameters>
|
||||
<showWarnings>true</showWarnings>
|
||||
<!-- <compilerArguments>
|
||||
<verbose /> 输出有关编译器正在执行的操作的消息
|
||||
@@ -126,8 +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>
|
||||
@@ -154,7 +156,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.2.3</version>
|
||||
<version>3.3.2</version>
|
||||
<configuration>
|
||||
<warSourceExcludes>
|
||||
userfiles/**
|
||||
@@ -163,11 +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>
|
||||
@@ -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>
|
||||
|
||||
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
|
||||
|
||||
# 是否演示模式
|
||||
@@ -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,
|
||||
|
||||
@@ -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