Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d5e0f28ff | ||
|
|
aa50b5a696 | ||
|
|
bf6940ae92 | ||
|
|
055befdb79 | ||
|
|
3ab9e28188 | ||
|
|
d7e2784bac | ||
|
|
d81d10f01a | ||
|
|
203a81f52e | ||
|
|
e75fa7d6d0 | ||
|
|
47d3d5bd78 | ||
|
|
62df63900d | ||
|
|
ed7b9d2922 | ||
|
|
de77f34353 | ||
|
|
28aa05c24e | ||
|
|
d85ed438b0 | ||
|
|
5128a5ff3b | ||
|
|
7ff3a87d9c | ||
|
|
208e04bd54 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,9 +7,7 @@
|
||||
*.epoch
|
||||
*.lic
|
||||
|
||||
**/.settings/**/*
|
||||
!**/.settings/org.eclipse.core.resources.prefs
|
||||
!**/.settings/org.eclipse.wst.common.project.facet.core.xml
|
||||
.settings
|
||||
.apt_generated
|
||||
.factorypath
|
||||
.classpath
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## 引言
|
||||
|
||||
JeeSite 是一个 Java EE 企业级快速开发平台,基于经典技术组合(Spring Boot、Spring MVC、Apache Shiro、MyBatis、Beetl、Bootstrap、AdminLTE)采用经典开发模式,让初学者能够更快的入门并投入到团队开发中去。在线代码生成功能,包括核心模块如:组织机构、角色用户、菜单及按钮授权、数据权限、系统参数、内容管理、工作流等。采用松耦合设计;界面无刷新,一键换肤;众多账号安全设置,密码策略;在线定时任务配置;支持集群,支持SAAS;支持多数据源;支持微服务。
|
||||
JeeSite 是一个 Java EE 企业级快速开发平台,基于经典技术组合(Spring Boot、Spring MVC、Apache Shiro、MyBatis、Beetl、Bootstrap、AdminLTE)采用经典开发模式,让初学者能够更快的入门并投入到团队开发中去。在线代码生成功能,包括核心模块如:组织机构、角色用户、菜单及按钮授权、数据权限、系统参数、内容管理、工作流等。采用松耦合设计;界面无刷新,一键换肤;众多账号安全设置,密码策略;在线定时任务配置;支持集群,支持SAAS;支持多数据源;支持读写分离、分库分表;支持微服务。
|
||||
|
||||
JeeSite 快速开发平台的主要目的是能够让初级的研发人员快速的开发出复杂的业务功能(经典架构会的人多),让开发者注重专注业务,其余有平台来封装技术细节,降低技术难度,从而节省人力成本,缩短项目周期,提高软件安全质量。
|
||||
|
||||
@@ -16,7 +16,8 @@ JeeSite 4.x 的升级,作者结合了多年总结和经验,以及各方面
|
||||
* 持久层:Apache MyBatis 3.4、Hibernate Validation 6.0、Alibaba Druid 1.1
|
||||
* 视图层:Spring MVC 5.0、Beetl 3.0(替换JSP)、Bootstrap 3.3、AdminLTE 2.4
|
||||
* 前端组件:jQuery 1.12、jqGrid 4.7、layer 3.1、zTree 3.5、jquery-validation
|
||||
* 工具组件:Apache Commons、Jackson 2.10、POI 3.16、Quartz 2.3、Flowable 6.4
|
||||
* 工具组件:Apache Commons、Jackson 2.10、POI 3.16、Quartz 2.3
|
||||
* 工作流引擎:Flowable 6.5、符合 BPMN 规范、在线流程设计器、中国式工作流
|
||||
* 技术选型详情:<http://jeesite.com/?t=273599>
|
||||
|
||||
## 内置功能
|
||||
@@ -76,7 +77,7 @@ JeeSite 4.x 的升级,作者结合了多年总结和经验,以及各方面
|
||||
# 技术交流方式
|
||||
|
||||
* QQ 群号:`127515876`、`209330483`、`223507718`、`709534275`、`730390092`、`183903863(外包)`
|
||||
* 问题反馈:<https://gitee.com/thinkgem/jeesite4/issues> [【新手必读】](http://www.dianbo.org/9238/stone/tiwendezhihui.htm)
|
||||
* 问题反馈:<https://gitee.com/thinkgem/jeesite4/issues> [【新手必读】](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md)
|
||||
* 码云Gitee:<https://gitee.com/thinkgem/jeesite4>
|
||||
* GitHub:<https://github.com/thinkgem/jeesite4>
|
||||
* 作者博客:<https://my.oschina.net/thinkgem>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<installed facet="jst.utility" version="1.0"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
</faceted-project>
|
||||
@@ -105,18 +105,19 @@ public class PropertiesUtils {
|
||||
*/
|
||||
public PropertiesUtils(String... configFiles) {
|
||||
for (String location : configFiles) {
|
||||
try {
|
||||
Resource resource = ResourceUtils.getResource(location);
|
||||
if (resource.exists()){
|
||||
if (location.endsWith(".properties")){
|
||||
try (InputStreamReader is = new InputStreamReader(resource.getInputStream(), "UTF-8")){
|
||||
properties.load(is);
|
||||
configSet.add(location);
|
||||
} catch (IOException ex) {
|
||||
logger.error("Load " + location + " failure. ", ex);
|
||||
}
|
||||
Resource resource = ResourceUtils.getResource(location);
|
||||
if (resource.exists()){
|
||||
if (location.endsWith(".properties")){
|
||||
try (InputStreamReader is = new InputStreamReader(resource.getInputStream(), "UTF-8")){
|
||||
properties.load(is);
|
||||
configSet.add(location);
|
||||
} catch (IOException e) {
|
||||
System.err.println("Load " + location + " failure.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
else if (location.endsWith(".yml")){
|
||||
}
|
||||
else if (location.endsWith(".yml")){
|
||||
try {
|
||||
YamlPropertiesFactoryBean bean = new YamlPropertiesFactoryBean();
|
||||
bean.setResources(resource);
|
||||
for (Map.Entry<Object,Object> entry : bean.getObject().entrySet()){
|
||||
@@ -124,12 +125,14 @@ public class PropertiesUtils {
|
||||
ObjectUtils.toString(entry.getValue()));
|
||||
}
|
||||
configSet.add(location);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Load " + location + " failure. ", e);
|
||||
} catch (Exception e) {
|
||||
System.err.println("Load " + location + " failure.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
properties.put("configFiles", StringUtils.join(configFiles, ","));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,8 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.io.PropertiesUtils;
|
||||
import com.jeesite.common.lang.ExceptionUtils;
|
||||
import com.jeesite.common.lang.ObjectUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.mapper.JsonMapper;
|
||||
import com.jeesite.common.mapper.XmlMapper;
|
||||
@@ -184,7 +186,16 @@ public class ServletUtils {
|
||||
resultMap.put("result", result);
|
||||
resultMap.put("message", message);
|
||||
if (data != null){
|
||||
if (data instanceof Map){
|
||||
if (data instanceof Throwable){
|
||||
Throwable ex = (Throwable)data;
|
||||
String exMsg = ExceptionUtils.getExceptionMessage(ex);
|
||||
if (StringUtils.isNotBlank(exMsg)){
|
||||
resultMap.put("message", message + "," + exMsg);
|
||||
}else if (ObjectUtils.toBoolean(PropertiesUtils.getInstance()
|
||||
.getProperty("error.page.printErrorInfo", "true"))){
|
||||
resultMap.put("message", message + "," + ex.getMessage());
|
||||
}
|
||||
}else if (data instanceof Map){
|
||||
resultMap.putAll((Map<String, Object>)data);
|
||||
}else{
|
||||
resultMap.put("data", data);
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="jst.utility"/>
|
||||
<fixed facet="java"/>
|
||||
<installed facet="jst.utility" version="1.0"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
</faceted-project>
|
||||
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.config.web;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
|
||||
/**
|
||||
* 将请求协议转换为 https
|
||||
* @author ThinkGem
|
||||
* @version 2020年1月21日
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnProperty(name="server.schemeHttps", havingValue="true", matchIfMissing=false)
|
||||
public class SchemeHttpsConfig {
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean<Filter> schemeFilterRegistrationBean() {
|
||||
FilterRegistrationBean<Filter> bean = new FilterRegistrationBean<>();
|
||||
bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||
bean.setFilter(new Filter() {
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
chain.doFilter(new HttpServletRequestWrapper((HttpServletRequest) request) {
|
||||
|
||||
@Override
|
||||
public String getScheme() {
|
||||
return "https";
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuffer getRequestURL() {
|
||||
StringBuffer sb = super.getRequestURL();
|
||||
if ("http:".equals(sb.substring(0, 5))){
|
||||
return sb.replace(0, 5, "https:");
|
||||
}else{
|
||||
return sb;
|
||||
}
|
||||
}
|
||||
|
||||
}, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {}
|
||||
});
|
||||
bean.addUrlPatterns("/*");
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -7,6 +7,7 @@ import javax.validation.Valid;
|
||||
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.entity.TreeEntity;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
@@ -32,14 +33,16 @@ import com.jeesite.common.utils.excel.fieldtype.OfficeType;
|
||||
@Column(includeEntity=BaseEntity.class),
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
@Column(name="emp_code", attrName="empCode", label="员工编码", isPK=true),
|
||||
@Column(name="emp_no", attrName="empNo", label="员工工号"),
|
||||
@Column(name="emp_name", attrName="empName", label="员工姓名", queryType=QueryType.LIKE),
|
||||
@Column(name="emp_name_en", attrName="empNameEn", label="英文名", queryType=QueryType.LIKE),
|
||||
}),
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, alias="o",
|
||||
on="o.office_code=e.office_code", attrName="employee.office",
|
||||
columns={
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
@Column(includeEntity=TreeEntity.class),
|
||||
@Column(name="office_code", label="机构编码", isPK=true),
|
||||
@Column(name="parent_codes",label="所有父级编码", queryType=QueryType.LIKE),
|
||||
@Column(name="view_code", label="机构代码"),
|
||||
@Column(name="office_name", label="机构名称", isQuery=false),
|
||||
@Column(name="full_name", label="机构全称"),
|
||||
@@ -53,12 +56,12 @@ import com.jeesite.common.utils.excel.fieldtype.OfficeType;
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Company.class, alias="c",
|
||||
on="c.company_code=e.company_code", attrName="employee.company",
|
||||
columns={
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
@Column(includeEntity=TreeEntity.class),
|
||||
@Column(name="company_code", label="公司编码", isPK=true),
|
||||
@Column(name="parent_codes",label="所有父级编码", queryType=QueryType.LIKE),
|
||||
@Column(name="view_code", label="公司代码"),
|
||||
@Column(name="company_name", label="公司名称", isQuery=false),
|
||||
@Column(name="full_name", label="公司全称"),
|
||||
@Column(name="area_code", attrName="area.areaCode", label="区域编码"),
|
||||
}),
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Area.class, alias="ar",
|
||||
on="ar.area_code = c.area_code", attrName="employee.company.area",
|
||||
|
||||
@@ -38,36 +38,13 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
}, joinTable={
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Office.class, alias="o",
|
||||
on="o.office_code = a.office_code",
|
||||
columns={
|
||||
@Column(name="office_code", label="机构编码", isPK=true),
|
||||
@Column(name="parent_codes",label="所有父级编码", queryType=QueryType.LIKE),
|
||||
@Column(name="view_code", label="机构代码"),
|
||||
@Column(name="office_name", label="机构名称", isQuery=false),
|
||||
@Column(name="full_name", label="机构全称"),
|
||||
@Column(name="office_type", label="机构类型"),
|
||||
@Column(name="leader", label="负责人"),
|
||||
@Column(name="phone", label="电话"),
|
||||
@Column(name="address", label="联系地址"),
|
||||
@Column(name="zip_code", label="邮政编码"),
|
||||
@Column(name="email", label="邮箱"),
|
||||
}),
|
||||
columns={@Column(includeEntity=Office.class)}),
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Company.class, alias="c",
|
||||
on="c.company_code = a.company_code",
|
||||
columns={
|
||||
@Column(name="company_code", label="公司编码", isPK=true),
|
||||
@Column(name="parent_codes",label="所有父级编码", queryType=QueryType.LIKE),
|
||||
@Column(name="view_code", label="公司代码"),
|
||||
@Column(name="company_name", label="公司名称", isQuery=false),
|
||||
@Column(name="full_name", label="公司全称"),
|
||||
@Column(name="area_code", attrName="area.areaCode", label="区域编码"),
|
||||
}),
|
||||
columns={@Column(includeEntity=Company.class)}),
|
||||
@JoinTable(type=Type.LEFT_JOIN, entity=Area.class, alias="ar",
|
||||
on="ar.area_code = c.area_code", attrName="company.area",
|
||||
columns={
|
||||
@Column(name="area_code", label="区域代码", isPK=true),
|
||||
@Column(name="area_name", label="区域名称", isQuery=false),
|
||||
@Column(name="area_type", label="区域类型"),
|
||||
}),
|
||||
columns={@Column(includeEntity=Area.class)}),
|
||||
}, orderBy="a.update_date DESC"
|
||||
)
|
||||
public class Employee extends DataEntity<Employee> {
|
||||
|
||||
@@ -32,6 +32,9 @@ IMPORT_PACKAGE_core=\
|
||||
com.jeesite.common.security.;\
|
||||
com.jeesite.common.web.http.;\
|
||||
com.jeesite.modules.sys.utils.;\
|
||||
com.jeesite.common.entity.;\
|
||||
com.jeesite.common.service.;\
|
||||
com.jeesite.common.utils.;\
|
||||
|
||||
### 资源配置,resource后的属性只限于特定ResourceLoader ####
|
||||
#classpath 跟路径,与框架集成的时候,此配置会被框架代码覆盖而不能生效
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<logger name="org.flowable.ui.modeler.domain" level="DEBUG" />
|
||||
<logger name="org.flowable.idm.engine.impl.persistence" level="DEBUG" />
|
||||
<logger name="org.flowable.task.service.impl.persistence" level="DEBUG" />
|
||||
<logger name="org.flowable.identitylink.service.impl.persistence" level="DEBUG" />
|
||||
<logger name="org.flowable.variable.service.impl.persistence" level="DEBUG" />
|
||||
<logger name="org.flowable.engine.impl.persistence" level="DEBUG" />
|
||||
|
||||
<logger name="com.jeesite" level="DEBUG" />
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
'loading.message':'Loading ...',
|
||||
'loading.submitMessage':'Submission ...',
|
||||
'showMessage.error':'failure,error',
|
||||
'showMessage.success':'success,completion',
|
||||
'showMessage.warning':'no'
|
||||
'showMessage.warning':'no,not,Not,already exists',
|
||||
'showMessage.success':'success,completion'
|
||||
});
|
||||
// ============ layer ============
|
||||
window.layer = window.layer || {};
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
'loading.message':'ローディング...お待ちください...',
|
||||
'loading.submitMessage':'送信中...お待ちください...',
|
||||
'showMessage.error':'失敗,エラー,未完了',
|
||||
'showMessage.success':'成功,完了',
|
||||
'showMessage.warning':'不可,不許可,必須,既に存在,不要,不正確'
|
||||
'showMessage.warning':'不可,不許可,必須,既に存在,不要,不正確',
|
||||
'showMessage.success':'成功,完了'
|
||||
});
|
||||
// ============ layer ============
|
||||
window.layer = window.layer || {};
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
'loading.message':'正在加载,请稍候...',
|
||||
'loading.submitMessage':'正在提交,请稍候...',
|
||||
'showMessage.error':'失败,错误,未完成',
|
||||
'showMessage.success':'成功,完成',
|
||||
'showMessage.warning':'不能,不允许,必须,已存在,不需要,不正确'
|
||||
'showMessage.warning':'不能,不允许,必须,已存在,不需要,不正确',
|
||||
'showMessage.success':'成功,完成'
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
@@ -23,7 +23,7 @@ if (isBlank(message)){
|
||||
|
||||
// 如果是异步请求或是手机端,则直接返回信息
|
||||
if (@ServletUtils.isAjaxRequest(request)) {
|
||||
if (@Global.getConfigToBoolean('error.page.printErrorInfo', 'true')
|
||||
if (@Global.getPropertyToBoolean('error.page.printErrorInfo', 'true')
|
||||
&& !@StringUtils.equals(message, "演示模式,不允许操作!") && ex != null){
|
||||
print(@ServletUtils.renderResult(@Global.FALSE, message, @ExceptionUtils.getStackTraceAsString(ex)));
|
||||
}else{
|
||||
@@ -49,7 +49,7 @@ else {
|
||||
href="http://jeesite.com">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<% if (@Global.getConfigToBoolean('error.page.printErrorInfo', 'true')
|
||||
<% if (@Global.getPropertyToBoolean('error.page.printErrorInfo', 'true')
|
||||
&& !@StringUtils.equals(message, "演示模式,不允许操作!")){ %>
|
||||
<div class="box mt20">
|
||||
${@StringUtils.toHtml(@ExceptionUtils.getStackTraceAsString(ex))}<br/>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<span class="required hide">*</span> ${text('电子邮箱')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-envelope" style="margin-top:-2px;display:block;"></i></span>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
<#form:input path="email" maxlength="300" class="form-control email"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -79,7 +79,7 @@
|
||||
<span class="required hide">*</span> ${text('手机号码')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-mobile" style="margin-top:-2px;display:block;"></i></span>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-mobile"></i></span>
|
||||
<#form:input path="mobile" maxlength="100" class="form-control mobile"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<#form:input path="email" maxlength="300" class="form-control email"/>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-envelope" style="margin-top:-2px;display:block;"></i></span>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,7 +89,7 @@
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<#form:input path="mobile" maxlength="100" class="form-control mobile"/>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-mobile" style="margin-top:-2px;display:block;"></i></span>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-mobile"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<#form:input path="userName" maxlength="32" class="form-control required"/>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-user" style="margin-top:-2px;display:block;"></i></span>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<#form:input path="email" maxlength="300" class="form-control email"/>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-envelope" style="margin-top:-2px;display:block;"></i></span>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-envelope"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,7 +64,7 @@
|
||||
<div class="col-sm-9">
|
||||
<div class="input-group">
|
||||
<#form:input path="mobile" maxlength="100" class="form-control mobile"/>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-mobile" style="margin-top:-2px;display:block;"></i></span>
|
||||
<span class="input-group-addon"><i class="fa fa-fw fa-mobile"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -71,7 +71,10 @@
|
||||
}
|
||||
var li = $("#leftMenu-" + code + " > li");
|
||||
if (!li.hasClass('menu-open')){
|
||||
li = li.eq(0).find('> a').click();
|
||||
li = li.eq(0).find('> a');
|
||||
if (li.data('href') == 'blank'){
|
||||
li.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
window.initMenu = true;
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.test;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.tests.BaseSpringContextTests;
|
||||
import com.jeesite.modules.gen.entity.GenTable;
|
||||
import com.jeesite.modules.gen.entity.GenTableColumn;
|
||||
import com.jeesite.modules.gen.service.GenTableService;
|
||||
|
||||
/**
|
||||
* 代码生成工具(API)
|
||||
* @author ThinkGem
|
||||
* @version 2020-2-1
|
||||
*/
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(classes=ApplicationTest.class)
|
||||
@Rollback(false)
|
||||
public class GenTableToolTest extends BaseSpringContextTests {
|
||||
|
||||
@Autowired
|
||||
private GenTableService genTableService;
|
||||
|
||||
@Test
|
||||
public void execute() throws Exception{
|
||||
GenTable genTable = new GenTable();
|
||||
genTable.setIsNewRecord(true);
|
||||
genTable.setTableName("test_data_demo"); // 表名
|
||||
genTable = genTableService.getFromDb(genTable);
|
||||
genTable.setClassName(StringUtils.capCamelCase(genTable.getTableName())); // 实体类名
|
||||
genTable.setFunctionAuthor("ThinkGem"); // 作者名称
|
||||
genTable.setTplCategory("crud"); // 生成模板:crud、treeGrid、service、dao、query
|
||||
genTable.setPackageName("com.jeesite.modules");// 生成包路径
|
||||
genTable.setModuleName("test"); // 生成模块名
|
||||
genTable.setSubModuleName(""); // 生成子模块名
|
||||
genTable.setFunctionName(genTable.getComments()); // 生成功能名
|
||||
genTable.setFunctionNameSimple(genTable.getComments()); // 功能名(简称)
|
||||
genTable.getOptionMap().put("isHaveDisableEnable", Global.NO); // 是否有停用启用
|
||||
genTable.getOptionMap().put("isHaveDelete", Global.YES); // 是否有删除功能
|
||||
genTable.getOptionMap().put("isFileUpload", Global.NO); // 是否有上传附件
|
||||
genTable.getOptionMap().put("isImageUpload", Global.NO); // 是否有上传图片
|
||||
for(GenTableColumn column : genTable.getColumnList()){
|
||||
// 字段配置(下拉框)
|
||||
if ("trade_type".equals(column.getColumnName())){
|
||||
column.setShowType("select");
|
||||
column.getOptionMap().put("dictType", "sys_menu_type");
|
||||
}
|
||||
}
|
||||
// 删除旧配置
|
||||
genTableService.delete(genTable);
|
||||
// 保存新配置
|
||||
genTable.setIsNewRecord(true);
|
||||
genTableService.save(genTable);
|
||||
// 编译并生成代码
|
||||
genTable.setGenFlag("1"); // 1:编译输出;2:生成文件
|
||||
genTable.setReplaceFile(Global.YES); // 如果存在则替换
|
||||
String result = genTableService.generateCode(genTable);
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
@@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -268,6 +268,30 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- 依赖插件 -->
|
||||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<versionRange>[1.0.0,)</versionRange>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<ignore />
|
||||
</action>
|
||||
</pluginExecution>
|
||||
</pluginExecutions>
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</pluginManagement>
|
||||
@@ -371,8 +395,8 @@
|
||||
</build>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>sonatype-repos-s</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<id>jeesite-repos-s</id>
|
||||
<url>http://maven.jeesite.net/repository/maven-snapshots</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="jst.web"/>
|
||||
<fixed facet="jst.java"/>
|
||||
<installed facet="jst.java" version="1.8"/>
|
||||
<installed facet="jst.web" version="3.1"/>
|
||||
</faceted-project>
|
||||
@@ -26,6 +26,9 @@ server:
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
|
||||
# 将请求协议转换为 https
|
||||
schemeHttps: false
|
||||
|
||||
#======================================#
|
||||
#========== Database sttings ==========#
|
||||
#======================================#
|
||||
@@ -43,7 +46,7 @@ jdbc:
|
||||
|
||||
# # Oracle 数据库配置
|
||||
# type: oracle
|
||||
# driver: oracle.jdbc.driver.OracleDriver
|
||||
# driver: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521/orcl
|
||||
# username: jeesite
|
||||
# password: jeesite
|
||||
@@ -81,7 +84,7 @@ jdbc:
|
||||
# # 最小连接数
|
||||
# minIdle: 3
|
||||
# # 最大连接数
|
||||
# maxActive: 20 # 数据库连接池配置
|
||||
# maxActive: 20
|
||||
#
|
||||
# # 获取连接等待超时时间,单位毫秒(1分钟)(4.0.6+)
|
||||
# maxWait: 60000
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
<% layout('/layouts/default.html', {title: '多表格联动示例', libs: ['layout', 'dataGrid']}){ %>
|
||||
<div class="ui-layout-north">
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-trophy"></i> ${text('岗位列表')}(多表格联动示例)
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-layout-content">
|
||||
<#form:form id="searchForm" model="${post!}" action="${ctx}/sys/post/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize!3}"
|
||||
data-order-by="${parameter.orderBy!'postCode desc'}">
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
<div id="dataGridPage"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-layout-center">
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-user"></i> ${text('用户列表')}(点击岗位查询对应用户)
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-layout-content">
|
||||
<#form:form id="searchForm2" model="${empUser!}" action="${ctx}/sys/empUser/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize!6}"
|
||||
data-order-by="${parameter.orderBy}">
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('岗位')}:</label>
|
||||
<div class="control-inline width-90">
|
||||
<#form:input name="employee.postCode" id="postCode" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid2"></table>
|
||||
<div id="dataGrid2Page"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% } %>
|
||||
<script>
|
||||
// 初始化布局
|
||||
$('body').layout({
|
||||
north__size: 300,
|
||||
onresize: function(){
|
||||
$(window).resize();
|
||||
}
|
||||
});
|
||||
// 初始化DataGrid对象
|
||||
$('#dataGrid').dataGrid({
|
||||
searchForm: $("#searchForm"),
|
||||
dataGridPage: $('#dataGridPage'),
|
||||
autoGridHeight: function(){
|
||||
return $('#searchForm').parent().height() - $('#dataGridPage').height() - 45;
|
||||
},
|
||||
columnModel: [
|
||||
{header:'${text("岗位名称")}', name:'postName', index:'a.post_name', width:200, align:"center"},
|
||||
{header:'${text("岗位编码")}', name:'postCode', index:'a.post_code', width:200, align:"center"},
|
||||
{header:'${text("排序号")}', name:'postSort', index:'a.post_sort', width:80, align:"center"},
|
||||
{header:'${text("岗位分类")}', name:'postType', index:'a.post_type', width:100, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_post_type')}, val, '未知', true);
|
||||
}},
|
||||
{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:150, align:"center"},
|
||||
{header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:200, align:"left"},
|
||||
{header:'${text("状态")}', name:'status', index:'a.status', width:80, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_status')}, val, '未知', true);
|
||||
}}
|
||||
],
|
||||
onSelectRow: function(id, isSelect, event){
|
||||
$('#postCode').val(id);
|
||||
$('#dataGrid2').dataGrid('refresh');
|
||||
},
|
||||
// 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
|
||||
}
|
||||
});
|
||||
// 初始化DataGrid对象
|
||||
$('#dataGrid2').dataGrid({
|
||||
searchForm: $("#searchForm2"),
|
||||
dataGridPage: $('#dataGrid2Page'),
|
||||
autoGridHeight: function(){
|
||||
return $('#searchForm2').parent().height() - $('#dataGrid2Page').height() - 45;
|
||||
},
|
||||
columnModel: [
|
||||
{header:'${text("登录账号")}', name:'loginCode', index:'a.login_code', width:200, align:"center"},
|
||||
{header:'${text("用户昵称")}', name:'userName', index:'a.user_name', width:200, align:"center"},
|
||||
{header:'${text("员工姓名")}', name:'refName', index:'a.ref_name', width:200, align:"center"},
|
||||
{header:'${text("归属机构")}', name:'employee.office.officeName', index:'o.office_name', width:200, align:"center"},
|
||||
{header:'${text("归属公司")}', name:'employee.company.companyName', index:'c.company_name', width:200, align:"center"},
|
||||
{header:'${text("电子邮箱")}', name:'email', index:'a.email', width:200, align:"center"},
|
||||
{header:'${text("手机号码")}', name:'mobile', index:'a.mobile', width:200, align:"center"},
|
||||
{header:'${text("办公电话")}', name:'phone', index:'a.phone', width:200, align:"center"},
|
||||
{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:200, align:"center"},
|
||||
{header:'${text("状态")}', name:'status', index:'a.status', width:140, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_status')}, val, '未知', true);
|
||||
}}
|
||||
],
|
||||
// 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user