Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f18af7130b | ||
|
|
e0780b464d | ||
|
|
926c25c18b | ||
|
|
1b22ee0591 | ||
|
|
4a2a8afe72 | ||
|
|
470a8998fb | ||
|
|
a3199ff716 | ||
|
|
a358118658 | ||
|
|
4733ed375a | ||
|
|
a22a91c482 | ||
|
|
a30f1d51c4 | ||
|
|
96d1d7c4fd | ||
|
|
26f6781a62 | ||
|
|
a861ba7c80 | ||
|
|
a38cdb3e5a | ||
|
|
edb3c078ae | ||
|
|
101484d938 | ||
|
|
31775c0255 | ||
|
|
1b4b70a9ac |
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ package com.jeesite.common.ueditor.define;
|
||||
*/
|
||||
public interface State {
|
||||
|
||||
public boolean isSuccess ();
|
||||
boolean isSuccess();
|
||||
|
||||
public void putInfo( String name, String val );
|
||||
void putInfo(String name, String val);
|
||||
|
||||
public void putInfo ( String name, long val );
|
||||
void putInfo(String name, long val);
|
||||
|
||||
public String toJSONString ();
|
||||
String toJSONString();
|
||||
|
||||
}
|
||||
|
||||
@@ -14,21 +14,21 @@ public interface FieldType {
|
||||
/**
|
||||
* 获取对象值(导入)
|
||||
*/
|
||||
default public Object getValue(String val) {
|
||||
default Object getValue(String val) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对象值(导出)
|
||||
*/
|
||||
default public String setValue(Object val) {
|
||||
default String setValue(Object val) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对象值格式(导出)
|
||||
*/
|
||||
default public String getDataFormat() {
|
||||
default String getDataFormat() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,23 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.common.web.http;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import com.fasterxml.jackson.databind.util.JSONPObject;
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
@@ -29,6 +12,17 @@ import com.jeesite.common.lang.ExceptionUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.mapper.JsonMapper;
|
||||
import com.jeesite.common.mapper.XmlMapper;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
* Http与Servlet工具类.
|
||||
@@ -387,6 +381,18 @@ public class ServletUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请求的域名(含端口)
|
||||
*/
|
||||
public static String getRequestDomain(String url) {
|
||||
String scheme = StringUtils.substringBefore(url, "://");
|
||||
String domain = StringUtils.substringAfter(url, "://");
|
||||
if (StringUtils.contains(domain, "/")) {
|
||||
domain = StringUtils.substringBefore(domain, "/");
|
||||
}
|
||||
return scheme + "://" + domain;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得请求参数值
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ import com.jeesite.modules.cms.entity.Article;
|
||||
@MyBatisDao
|
||||
public interface ArticleDao extends CrudDao<Article> {
|
||||
|
||||
public long updateExpiredWeight(Article article);
|
||||
long updateExpiredWeight(Article article);
|
||||
|
||||
public long updateHitsAddOne(String id);
|
||||
long updateHitsAddOne(String id);
|
||||
|
||||
}
|
||||
@@ -12,4 +12,5 @@
|
||||
5.0.1
|
||||
5.0.2
|
||||
5.1.0
|
||||
5.2.0
|
||||
5.2.0
|
||||
5.2.1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -348,7 +348,14 @@ CREATE TABLE js_sys_job
|
||||
job_group varchar(64) NOT NULL,
|
||||
description vargraphic(100) NOT NULL,
|
||||
invoke_target vargraphic(1000) NOT NULL,
|
||||
job_type vargraphic(10) DEFAULT 'cron' NOT NULL,
|
||||
job_priority decimal(10),
|
||||
start_time timestamp,
|
||||
start_delay decimal(19),
|
||||
repeat_interval decimal(19),
|
||||
repeat_count decimal(10),
|
||||
cron_expression varchar(255) NOT NULL,
|
||||
rule_expression varchar(255),
|
||||
misfire_instruction decimal(1) NOT NULL,
|
||||
concurrent char(1) NOT NULL,
|
||||
instance_name varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL,
|
||||
|
||||
@@ -348,7 +348,14 @@ CREATE TABLE js_sys_job
|
||||
job_group varchar(64) NOT NULL,
|
||||
description varchar(100) NOT NULL,
|
||||
invoke_target varchar(1000) NOT NULL,
|
||||
job_type varchar(10) DEFAULT 'cron' NOT NULL,
|
||||
job_priority decimal(10),
|
||||
start_time datetime,
|
||||
start_delay decimal(19),
|
||||
repeat_interval decimal(19),
|
||||
repeat_count decimal(10),
|
||||
cron_expression varchar(255) NOT NULL,
|
||||
rule_expression varchar(255),
|
||||
misfire_instruction decimal(1) NOT NULL,
|
||||
concurrent char(1) NOT NULL,
|
||||
instance_name varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL,
|
||||
|
||||
@@ -348,7 +348,14 @@ CREATE TABLE [js_sys_job]
|
||||
[job_group] varchar(64) NOT NULL,
|
||||
[description] nvarchar(100) NOT NULL,
|
||||
[invoke_target] nvarchar(1000) NOT NULL,
|
||||
[job_type] nvarchar(10) DEFAULT 'cron' NOT NULL,
|
||||
[job_priority] decimal(10),
|
||||
[start_time] datetime,
|
||||
[start_delay] decimal(19),
|
||||
[repeat_interval] decimal(19),
|
||||
[repeat_count] decimal(10),
|
||||
[cron_expression] varchar(255) NOT NULL,
|
||||
[rule_expression] varchar(255),
|
||||
[misfire_instruction] decimal(1) NOT NULL,
|
||||
[concurrent] char(1) NOT NULL,
|
||||
[instance_name] varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL,
|
||||
|
||||
@@ -349,7 +349,14 @@ CREATE TABLE js_sys_job
|
||||
job_group varchar(64) NOT NULL COMMENT '任务组名',
|
||||
description varchar(100) NOT NULL COMMENT '任务描述',
|
||||
invoke_target varchar(1000) NOT NULL COMMENT '调用目标字符串',
|
||||
job_type varchar(10) DEFAULT 'cron' NOT NULL COMMENT '任务触发类型',
|
||||
job_priority decimal(10) COMMENT '触发器优先级',
|
||||
start_time datetime COMMENT '触发器启动时间',
|
||||
start_delay decimal(19) COMMENT '触发器延迟启动时间',
|
||||
repeat_interval decimal(19) COMMENT '循环间隔时间(毫秒)',
|
||||
repeat_count decimal(10) COMMENT '循环次数( -1 无期限)',
|
||||
cron_expression varchar(255) NOT NULL COMMENT 'Cron执行表达式',
|
||||
rule_expression varchar(255) COMMENT '自定义规则表达式',
|
||||
misfire_instruction decimal(1) NOT NULL COMMENT '计划执行错误策略',
|
||||
concurrent char(1) NOT NULL COMMENT '是否并发执行',
|
||||
instance_name varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL COMMENT '集群的实例名字',
|
||||
|
||||
@@ -348,7 +348,14 @@ CREATE TABLE js_sys_job
|
||||
job_group varchar2(64) NOT NULL,
|
||||
description nvarchar2(100) NOT NULL,
|
||||
invoke_target nvarchar2(1000) NOT NULL,
|
||||
job_type nvarchar2(10) DEFAULT 'cron' NOT NULL,
|
||||
job_priority number(10),
|
||||
start_time timestamp,
|
||||
start_delay number(19),
|
||||
repeat_interval number(19),
|
||||
repeat_count number(10),
|
||||
cron_expression varchar2(255) NOT NULL,
|
||||
rule_expression varchar2(255),
|
||||
misfire_instruction number(1) NOT NULL,
|
||||
concurrent char(1) NOT NULL,
|
||||
instance_name varchar2(64) DEFAULT 'JeeSiteScheduler' NOT NULL,
|
||||
@@ -1233,7 +1240,14 @@ COMMENT ON COLUMN js_sys_job.job_name IS '任务名称';
|
||||
COMMENT ON COLUMN js_sys_job.job_group IS '任务组名';
|
||||
COMMENT ON COLUMN js_sys_job.description IS '任务描述';
|
||||
COMMENT ON COLUMN js_sys_job.invoke_target IS '调用目标字符串';
|
||||
COMMENT ON COLUMN js_sys_job.job_type IS '任务触发类型';
|
||||
COMMENT ON COLUMN js_sys_job.job_priority IS '触发器优先级';
|
||||
COMMENT ON COLUMN js_sys_job.start_time IS '触发器启动时间';
|
||||
COMMENT ON COLUMN js_sys_job.start_delay IS '触发器延迟启动时间';
|
||||
COMMENT ON COLUMN js_sys_job.repeat_interval IS '循环间隔时间(毫秒)';
|
||||
COMMENT ON COLUMN js_sys_job.repeat_count IS '循环次数( -1 无期限)';
|
||||
COMMENT ON COLUMN js_sys_job.cron_expression IS 'Cron执行表达式';
|
||||
COMMENT ON COLUMN js_sys_job.rule_expression IS '自定义规则表达式';
|
||||
COMMENT ON COLUMN js_sys_job.misfire_instruction IS '计划执行错误策略';
|
||||
COMMENT ON COLUMN js_sys_job.concurrent IS '是否并发执行';
|
||||
COMMENT ON COLUMN js_sys_job.instance_name IS '集群的实例名字';
|
||||
|
||||
@@ -348,7 +348,14 @@ CREATE TABLE js_sys_job
|
||||
job_group varchar(64) NOT NULL,
|
||||
description varchar(100) NOT NULL,
|
||||
invoke_target varchar(1000) NOT NULL,
|
||||
job_type varchar(10) DEFAULT 'cron' NOT NULL,
|
||||
job_priority decimal(10),
|
||||
start_time timestamp,
|
||||
start_delay decimal(19),
|
||||
repeat_interval decimal(19),
|
||||
repeat_count decimal(10),
|
||||
cron_expression varchar(255) NOT NULL,
|
||||
rule_expression varchar(255),
|
||||
misfire_instruction decimal(1) NOT NULL,
|
||||
concurrent char(1) NOT NULL,
|
||||
instance_name varchar(64) DEFAULT 'JeeSiteScheduler' NOT NULL,
|
||||
@@ -1233,7 +1240,14 @@ COMMENT ON COLUMN js_sys_job.job_name IS '任务名称';
|
||||
COMMENT ON COLUMN js_sys_job.job_group IS '任务组名';
|
||||
COMMENT ON COLUMN js_sys_job.description IS '任务描述';
|
||||
COMMENT ON COLUMN js_sys_job.invoke_target IS '调用目标字符串';
|
||||
COMMENT ON COLUMN js_sys_job.job_type IS '任务触发类型';
|
||||
COMMENT ON COLUMN js_sys_job.job_priority IS '触发器优先级';
|
||||
COMMENT ON COLUMN js_sys_job.start_time IS '触发器启动时间';
|
||||
COMMENT ON COLUMN js_sys_job.start_delay IS '触发器延迟启动时间';
|
||||
COMMENT ON COLUMN js_sys_job.repeat_interval IS '循环间隔时间(毫秒)';
|
||||
COMMENT ON COLUMN js_sys_job.repeat_count IS '循环次数( -1 无期限)';
|
||||
COMMENT ON COLUMN js_sys_job.cron_expression IS 'Cron执行表达式';
|
||||
COMMENT ON COLUMN js_sys_job.rule_expression IS '自定义规则表达式';
|
||||
COMMENT ON COLUMN js_sys_job.misfire_instruction IS '计划执行错误策略';
|
||||
COMMENT ON COLUMN js_sys_job.concurrent IS '是否并发执行';
|
||||
COMMENT ON COLUMN js_sys_job.instance_name IS '集群的实例名字';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
<!-- MySQL -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- Oracle 11g -->
|
||||
|
||||
@@ -21,6 +21,6 @@ public interface MsgInnerRecordDao extends CrudDao<MsgInnerRecord> {
|
||||
/**
|
||||
* 根据消息编号和接受者用户名更新读取状态
|
||||
*/
|
||||
public long updateReadStatus(MsgInnerRecord msgInnerRecord);
|
||||
long updateReadStatus(MsgInnerRecord msgInnerRecord);
|
||||
|
||||
}
|
||||
@@ -92,7 +92,8 @@ public class MsgInnerService extends CrudService<MsgInnerDao, MsgInner> {
|
||||
}
|
||||
}
|
||||
msgInner.setSendDate(new Date());
|
||||
msgInner.setIsAttac(StringUtils.isNotBlank(ServletUtils.getParameter("msgInner_file"))?Global.YES:Global.NO);
|
||||
msgInner.setIsAttac(msgInner.getDataMap() != null && StringUtils.isNotBlank((String)msgInner.getDataMap().get("msgInner_file"))
|
||||
|| StringUtils.isNotBlank(ServletUtils.getParameter("msgInner_file")) ? Global.YES : Global.NO);
|
||||
super.save(msgInner);
|
||||
// 保存上传附件
|
||||
FileUploadUtils.saveFileUpload(msgInner, msgInner.getId(), "msgInner_file");
|
||||
|
||||
@@ -23,21 +23,21 @@ public interface EmpUserDao extends CrudDao<EmpUser> {
|
||||
/**
|
||||
* 查询全部用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserList(EmpUser empUser);
|
||||
List<EmpUser> findUserList(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据部门编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
|
||||
List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据角色编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
|
||||
List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据岗位编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByPostCodes(EmpUser empUser);
|
||||
List<EmpUser> findUserListByPostCodes(EmpUser empUser);
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -4,11 +4,11 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.service.api.TreeServiceApi;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 行政区划Service
|
||||
* @author ThinkGem
|
||||
@@ -20,24 +20,24 @@ public interface AreaService extends TreeServiceApi<Area> {
|
||||
* 获取区划
|
||||
*/
|
||||
@Override
|
||||
public Area get(Area area);
|
||||
Area get(Area area);
|
||||
|
||||
/**
|
||||
* 查询区划
|
||||
*/
|
||||
@Override
|
||||
public List<Area> findList(Area area);
|
||||
List<Area> findList(Area area);
|
||||
|
||||
/**
|
||||
* 保存区划
|
||||
*/
|
||||
@Override
|
||||
public void save(Area area);
|
||||
void save(Area area);
|
||||
|
||||
/**
|
||||
* 删除区划
|
||||
*/
|
||||
@Override
|
||||
public void delete(Area area);
|
||||
void delete(Area area);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.service.api.TreeServiceApi;
|
||||
import com.jeesite.modules.sys.entity.Company;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司管理Service
|
||||
* @author ThinkGem
|
||||
@@ -20,36 +20,36 @@ public interface CompanyService extends TreeServiceApi<Company> {
|
||||
* 获取单条数据
|
||||
*/
|
||||
@Override
|
||||
public Company get(Company company);
|
||||
Company get(Company company);
|
||||
|
||||
/**
|
||||
* 添加数据权限过滤条件
|
||||
*/
|
||||
@Override
|
||||
public void addDataScopeFilter(Company company, String ctrlPermi);
|
||||
void addDataScopeFilter(Company company, String ctrlPermi);
|
||||
|
||||
/**
|
||||
* 查询公司列表
|
||||
*/
|
||||
@Override
|
||||
public List<Company> findList(Company company);
|
||||
List<Company> findList(Company company);
|
||||
|
||||
/**
|
||||
* 保存公司
|
||||
*/
|
||||
@Override
|
||||
public void save(Company company);
|
||||
void save(Company company);
|
||||
|
||||
/**
|
||||
* 删除公司
|
||||
*/
|
||||
@Override
|
||||
public void delete(Company company);
|
||||
void delete(Company company);
|
||||
|
||||
/**
|
||||
* 停用当前节点
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(Company company);
|
||||
void updateStatus(Company company);
|
||||
|
||||
}
|
||||
@@ -4,13 +4,12 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.api.CrudServiceApi;
|
||||
import com.jeesite.modules.sys.entity.EmpUser;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工管理Service
|
||||
@@ -23,7 +22,7 @@ public interface EmpUserService extends CrudServiceApi<EmpUser> {
|
||||
* 获取单条数据
|
||||
*/
|
||||
@Override
|
||||
public EmpUser get(EmpUser empUser);
|
||||
EmpUser get(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 添加数据权限过滤条件
|
||||
@@ -31,57 +30,57 @@ public interface EmpUserService extends CrudServiceApi<EmpUser> {
|
||||
* @param ctrlPermi 控制权限类型(拥有的数据权限:DataScope.CTRL_PERMI_HAVE、可管理的数据权限:DataScope.CTRL_PERMI_HAVE)
|
||||
*/
|
||||
@Override
|
||||
public void addDataScopeFilter(EmpUser empUser, String ctrlPermi);
|
||||
void addDataScopeFilter(EmpUser empUser, String ctrlPermi);
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*/
|
||||
@Override
|
||||
public Page<EmpUser> findPage(EmpUser empUser);
|
||||
Page<EmpUser> findPage(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 查询全部用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserList(EmpUser empUser);
|
||||
List<EmpUser> findUserList(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据部门编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
|
||||
List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据角色编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
|
||||
List<EmpUser> findUserListByRoleCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 根据岗位编码查询用户,仅返回基本信息
|
||||
*/
|
||||
public List<EmpUser> findUserListByPostCodes(EmpUser empUser);
|
||||
List<EmpUser> findUserListByPostCodes(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 保存用户员工
|
||||
*/
|
||||
@Override
|
||||
public void save(EmpUser user);
|
||||
void save(EmpUser user);
|
||||
|
||||
/**
|
||||
* 导入用户数据
|
||||
* @param file 导入的用户数据文件
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
*/
|
||||
public String importData(MultipartFile file, Boolean isUpdateSupport);
|
||||
String importData(MultipartFile file, Boolean isUpdateSupport);
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(EmpUser empUser);
|
||||
void updateStatus(EmpUser empUser);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
@Override
|
||||
public void delete(EmpUser empUser);
|
||||
void delete(EmpUser empUser);
|
||||
|
||||
}
|
||||
@@ -4,14 +4,14 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.api.CrudServiceApi;
|
||||
import com.jeesite.modules.sys.entity.Employee;
|
||||
import com.jeesite.modules.sys.entity.EmployeeOffice;
|
||||
import com.jeesite.modules.sys.entity.EmployeePost;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工管理Service
|
||||
* @author ThinkGem
|
||||
@@ -23,39 +23,39 @@ public interface EmployeeService extends CrudServiceApi<Employee> {
|
||||
* 获取单条数据
|
||||
*/
|
||||
@Override
|
||||
public Employee get(Employee employee);
|
||||
Employee get(Employee employee);
|
||||
|
||||
/**
|
||||
* 根据工号获取数据
|
||||
*/
|
||||
public Employee getByEmpNo(Employee employee);
|
||||
Employee getByEmpNo(Employee employee);
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
*/
|
||||
@Override
|
||||
public Page<Employee> findPage(Employee employee);
|
||||
Page<Employee> findPage(Employee employee);
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
*/
|
||||
@Override
|
||||
public void save(Employee employee);
|
||||
void save(Employee employee);
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@Override
|
||||
public void delete(Employee employee);
|
||||
void delete(Employee employee);
|
||||
|
||||
/**
|
||||
* 查询当前员工关联的岗位信息
|
||||
*/
|
||||
public List<EmployeePost> findEmployeePostList(Employee employee);
|
||||
List<EmployeePost> findEmployeePostList(Employee employee);
|
||||
|
||||
/**
|
||||
* 查询当前员工关联的附属机构信息
|
||||
*/
|
||||
public List<EmployeeOffice> findEmployeeOfficeList(Employee employee);
|
||||
List<EmployeeOffice> findEmployeeOfficeList(Employee employee);
|
||||
|
||||
}
|
||||
@@ -19,11 +19,11 @@ public interface LogService extends CrudServiceApi<Log> {
|
||||
* 查询日志记录
|
||||
*/
|
||||
@Override
|
||||
public Page<Log> findPage(Log log);
|
||||
Page<Log> findPage(Log log);
|
||||
|
||||
/**
|
||||
* 不使用数据库事务,执行插入日志
|
||||
*/
|
||||
public void insertLog(Log entity);
|
||||
void insertLog(Log entity);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,43 +22,43 @@ public interface OfficeService extends TreeServiceApi<Office> {
|
||||
* 获取单条数据
|
||||
*/
|
||||
@Override
|
||||
public Office get(Office office);
|
||||
Office get(Office office);
|
||||
|
||||
/**
|
||||
* 添加数据权限过滤条件
|
||||
*/
|
||||
@Override
|
||||
public void addDataScopeFilter(Office office, String ctrlPermi);
|
||||
void addDataScopeFilter(Office office, String ctrlPermi);
|
||||
|
||||
/**
|
||||
* 查询组织机构列表
|
||||
*/
|
||||
@Override
|
||||
public List<Office> findList(Office office);
|
||||
List<Office> findList(Office office);
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
*/
|
||||
@Override
|
||||
public void save(Office office);
|
||||
void save(Office office);
|
||||
|
||||
/**
|
||||
* 导入机构数据
|
||||
* @param file 导入的用户数据文件
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
*/
|
||||
public String importData(MultipartFile file, Boolean isUpdateSupport);
|
||||
String importData(MultipartFile file, Boolean isUpdateSupport);
|
||||
|
||||
/**
|
||||
* 更新部门状态
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(Office office);
|
||||
void updateStatus(Office office);
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@Override
|
||||
public void delete(Office office);
|
||||
void delete(Office office);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,35 +19,35 @@ public interface PostService extends CrudServiceApi<Post> {
|
||||
* 查询岗位
|
||||
*/
|
||||
@Override
|
||||
public Post get(Post post);
|
||||
Post get(Post post);
|
||||
|
||||
/**
|
||||
* 根据名称查询岗位
|
||||
*/
|
||||
public Post getByPostName(Post post);
|
||||
Post getByPostName(Post post);
|
||||
|
||||
/**
|
||||
* 查询岗位
|
||||
*/
|
||||
@Override
|
||||
public Page<Post> findPage(Post post);
|
||||
Page<Post> findPage(Post post);
|
||||
|
||||
/**
|
||||
* 保存岗位
|
||||
*/
|
||||
@Override
|
||||
public void save(Post post);
|
||||
void save(Post post);
|
||||
|
||||
/**
|
||||
* 更新岗位状态
|
||||
*/
|
||||
@Override
|
||||
public void updateStatus(Post post);
|
||||
void updateStatus(Post post);
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
*/
|
||||
@Override
|
||||
public void delete(Post post);
|
||||
void delete(Post post);
|
||||
|
||||
}
|
||||
@@ -4,22 +4,18 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.utils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.SetUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.utils.SpringUtils;
|
||||
import com.jeesite.modules.sys.entity.Company;
|
||||
import com.jeesite.modules.sys.entity.Employee;
|
||||
import com.jeesite.modules.sys.entity.EmployeeOffice;
|
||||
import com.jeesite.modules.sys.entity.Office;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.entity.*;
|
||||
import com.jeesite.modules.sys.service.CompanyService;
|
||||
import com.jeesite.modules.sys.service.EmployeeService;
|
||||
import com.jeesite.modules.sys.service.OfficeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 员工部门工具类
|
||||
* @author ThinkGem
|
||||
@@ -55,7 +51,11 @@ public class EmpUtils {
|
||||
*/
|
||||
public static Employee get(User user){
|
||||
if (user != null && User.USER_TYPE_EMPLOYEE.equals(user.getUserType())){
|
||||
return user.getRefObj();
|
||||
Employee employee = user.getRefObj();
|
||||
if (employee == null) {
|
||||
employee = Static.employeeService.get(user.getRefCode());
|
||||
}
|
||||
return employee;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -4,23 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.utils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.ibatis.mapping.SqlCommandType;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
@@ -37,9 +20,23 @@ import com.jeesite.modules.sys.entity.Log;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.service.LogService;
|
||||
import com.jeesite.modules.sys.service.MenuService;
|
||||
|
||||
import eu.bitwalker.useragentutils.UserAgent;
|
||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
import org.apache.ibatis.mapping.SqlCommandType;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 日志工具类
|
||||
@@ -167,7 +164,7 @@ public class LogUtils {
|
||||
};
|
||||
// 如果是BaseEntity的子类,则获取主键名
|
||||
if (superClass != null){
|
||||
Table t = type.getAnnotation(Table.class);
|
||||
Table t = MapperHelper.getTableCache(type);
|
||||
for (Column c : t.columns()){
|
||||
if (c.isPK()){
|
||||
try {
|
||||
@@ -217,8 +214,8 @@ public class LogUtils {
|
||||
if (StringUtils.isBlank(log.getLogTitle())){
|
||||
log.setLogTitle("未知操作");
|
||||
}
|
||||
// 如果有异常,设置异常信息(将异常对象转换为字符串)
|
||||
log.setIsException(throwable != null ? Global.YES : Global.NO);
|
||||
// 如果有异常,并且不是登录登出的日志,则设置异常信息(将异常对象转换为字符串)
|
||||
log.setIsException(throwable != null && !Log.TYPE_LOGIN_LOGOUT.equals(log.getLogType()) ? Global.YES : Global.NO);
|
||||
String message = ExceptionUtils.getExceptionMessage(throwable);
|
||||
if (message != null) {
|
||||
log.setExceptionInfo(message);
|
||||
|
||||
@@ -217,6 +217,13 @@ public class LoginController extends BaseController{
|
||||
if (StringUtils.isBlank(successUrl)){
|
||||
successUrl = (String)request.getAttribute("__url");
|
||||
}
|
||||
if (StringUtils.contains(successUrl, "://")){
|
||||
String domain = ServletUtils.getRequestDomain(successUrl);
|
||||
successUrl = StringUtils.substring(successUrl, domain.length());
|
||||
if (StringUtils.startsWith(successUrl, request.getContextPath())) {
|
||||
successUrl = StringUtils.substringAfter(successUrl, request.getContextPath());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isBlank(successUrl)){
|
||||
successUrl = Global.getProperty("shiro.successUrl");
|
||||
}
|
||||
|
||||
@@ -38,9 +38,10 @@ public class SsoController extends BaseController{
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// String username = "system";
|
||||
// String secretKey = Global.getConfig("shiro.sso.secretKey");
|
||||
// String secretKey = "test"; // 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");
|
||||
// System.out.println("http://192.168.56.1:8980/js/sso/" + username + "/" + token + "?url=/a/sys/office/index&relogin=true");
|
||||
// System.out.println("http://192.168.56.1:3100/js/sso/" + username + "/" + token + "?url=../sys/office/index&relogin=true");
|
||||
// }
|
||||
|
||||
/**
|
||||
|
||||
@@ -399,6 +399,9 @@ shiro:
|
||||
|
||||
# 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链)
|
||||
#allowReferers: http://127.0.0.1,http://localhost
|
||||
|
||||
# 允许重定向的地址,不设置为全部允许,设置this只允许本项目内部跳转,多个用逗号隔开,例如:this,http://*.jeesite.com
|
||||
#allowRedirects: ~
|
||||
|
||||
# 是否在登录后生成新的Session(默认false)
|
||||
isGenerateNewSessionAfterLogin: false
|
||||
@@ -604,6 +607,9 @@ web:
|
||||
|
||||
# 静态文件后缀,过滤静态文件,以提高访问性能。
|
||||
staticFile: .css,.js,.map,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.crx,.xpi,.exe,.ipa,.apk,.otf,.eot,.svg,.ttf,.woff,.woff2
|
||||
|
||||
# 静态资源缓存周期 Cache-Control,单位秒,1年
|
||||
staticCachePeriod: 31536000
|
||||
|
||||
# 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。
|
||||
staticFileExcludeUri: /druid/
|
||||
|
||||
@@ -70,7 +70,7 @@ spring:
|
||||
server-addr: 127.0.0.1:8848
|
||||
file-extension: yml
|
||||
group: jeesite-cloud-50
|
||||
ext-config:
|
||||
extension-configs:
|
||||
- data-id: application.yml
|
||||
group: jeesite-cloud-50
|
||||
|
||||
|
||||
@@ -4,15 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.test;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.entity.DataScope;
|
||||
import com.jeesite.common.entity.Page;
|
||||
@@ -20,18 +11,16 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
import com.jeesite.common.tests.BaseSpringContextTests;
|
||||
import com.jeesite.modules.file.dao.FileUploadDao;
|
||||
import com.jeesite.modules.file.entity.FileUpload;
|
||||
import com.jeesite.modules.sys.dao.AreaDao;
|
||||
import com.jeesite.modules.sys.dao.CompanyDao;
|
||||
import com.jeesite.modules.sys.dao.ConfigDao;
|
||||
import com.jeesite.modules.sys.dao.DictDataDao;
|
||||
import com.jeesite.modules.sys.dao.EmpUserDao;
|
||||
import com.jeesite.modules.sys.dao.UserDao;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
import com.jeesite.modules.sys.entity.Company;
|
||||
import com.jeesite.modules.sys.entity.Config;
|
||||
import com.jeesite.modules.sys.entity.DictData;
|
||||
import com.jeesite.modules.sys.entity.EmpUser;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.dao.*;
|
||||
import com.jeesite.modules.sys.entity.*;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Mapper测试
|
||||
@@ -164,7 +153,8 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
throw new Exception(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public static void main(String[] args) {
|
||||
String a = null, b = null;
|
||||
System.out.println("============ 基本测试 ============");
|
||||
@@ -172,25 +162,25 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
.getWhere().and("name", QueryType.EQ, "abc").toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name = #{sqlMap.where.name#EQ1.val}";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.and("name", QueryType.IN, new String[]{"1", "2", "3"}).toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name IN ( #{sqlMap.where.name#IN1.val[0]},"
|
||||
+ " #{sqlMap.where.name#IN1.val[1]}, #{sqlMap.where.name#IN1.val[2]} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.or("name", QueryType.IN, new String[]{"1", "2", "3"}).toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} OR a.name IN ( #{sqlMap.where.name#IN1.val[0]},"
|
||||
+ " #{sqlMap.where.name#IN1.val[1]}, #{sqlMap.where.name#IN1.val[2]} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
System.out.println("============ 重复赋值测试 ============");
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.and("name", QueryType.LIKE, "abc").and("name", QueryType.LIKE, "def").toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name LIKE #{sqlMap.where.name#LIKE1.val}";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
System.out.println("============ IN、NOT IN 测试 ============");
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.and("name", QueryType.IN, new String[]{"abc","def"})
|
||||
@@ -198,13 +188,13 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name IN ( #{sqlMap.where.name#IN1.val[0]}, #{sqlMap.where.name#IN1.val[1]} )"
|
||||
+ " AND a.name2 NOT IN ( #{sqlMap.where.name2#NOT_IN1.val[0]}, #{sqlMap.where.name2#NOT_IN1.val[1]} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.and("name", QueryType.IN, null).and("name2", QueryType.IN, new String[]{})
|
||||
.and("name3", QueryType.NOT_IN, ListUtils.newArrayList()).toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1}";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
System.out.println("============ 带括号测试 ============");
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.andBracket("name", QueryType.EQ, "abc", 1).or("name", QueryType.EQ, "def", 2)
|
||||
@@ -212,7 +202,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ1.val}"
|
||||
+ " OR a.name = #{sqlMap.where.name#EQ2.val} OR a.name = #{sqlMap.where.name#EQ3.val} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
a = new Config().getSqlMap().getWhere()
|
||||
.andBracket("name", QueryType.EQ, "val1", 1).and("name", QueryType.NE, "val2", 11).endBracket(1)
|
||||
.orBracket("name", QueryType.NE, "val3", 2).and("name", QueryType.NE, "val4", 22).endBracket(2)
|
||||
@@ -222,41 +212,41 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
+ " OR ( a.name != #{sqlMap.where.name#NE2.val} AND a.name != #{sqlMap.where.name#NE22.val} )"
|
||||
+ " OR ( a.name != #{sqlMap.where.name#NE3.val} AND a.name = #{sqlMap.where.name#EQ33.val} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
System.out.println("============ 带括号部分空值测试 ============");
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "def", 2)
|
||||
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ2.val} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.andBracket("name", QueryType.EQ, "abc", 1).or("name", QueryType.EQ, "def", 2)
|
||||
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ1.val}"
|
||||
+ " OR a.name = #{sqlMap.where.name#EQ2.val} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "def", 2)
|
||||
.or("name", QueryType.EQ, "ghi", 3).endBracket().toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND ( a.name = #{sqlMap.where.name#EQ2.val}"
|
||||
+ " OR a.name = #{sqlMap.where.name#EQ3.val} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
System.out.println("============ 带括号全部空值测试 ============");
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "", 2)
|
||||
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} ";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
a = new Config().getSqlMap().getWhere()
|
||||
.andBracket("name", QueryType.EQ, "", 1).or("name", QueryType.EQ, "", 2)
|
||||
.or("name", QueryType.EQ, "", 3).endBracket().toSql();
|
||||
b = "";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
System.out.println("============ 实体嵌套测试 ============");
|
||||
Company company = new Company("1");
|
||||
company.setCreateDate_gte(new Date());
|
||||
@@ -280,7 +270,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
a = new FileUpload().getSqlMap().getWhere().and("u.`user_name`", QueryType.EQ, "user1").toSql();
|
||||
b = "a.`status` != #{STATUS_DELETE} AND u.`user_name` = #{sqlMap.where.u#_user_name_#EQ1.val}";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
System.out.println("============ 联合查询,返回到当前实体测试 ============");
|
||||
FileUpload fileUpload = new FileUpload();
|
||||
fileUpload.getSqlMap().getWhere().and("create_by", QueryType.IN, new String[]{"user1","user2"});
|
||||
@@ -288,7 +278,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
b = "a.`status` != #{STATUS_DELETE} AND a.create_by IN ( #{sqlMap.where.create_by#IN1.val[0]},"
|
||||
+ " #{sqlMap.where.create_by#IN1.val[1]} )";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
|
||||
System.out.println("============ 联合查询,属性为this时也可作为查询条件 ============");
|
||||
FileUpload fileUpload2 = new FileUpload();
|
||||
fileUpload2.setCreateByName("ThinkGem/JeeSite");
|
||||
@@ -297,6 +287,27 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
b = "a.`status` != #{STATUS_DELETE} AND a.create_by IN ( #{sqlMap.where.create_by#IN1.val[0]},"
|
||||
+ " #{sqlMap.where.create_by#IN1.val[1]} ) AND u.`user_name` LIKE #{sqlMap.where#user_name#LIKE1}";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
System.out.println("============ 条件嵌套查询,可替代 andBracket、orBracket、endBracket v5.2.1+ ============");
|
||||
a = new Config("1").getSqlMap().getWhere()
|
||||
.and("name", QueryType.EQ, "abc", 1)
|
||||
.and((w) -> w
|
||||
.or("name", QueryType.EQ, "def", 2)
|
||||
.or("name", QueryType.EQ, "ghi", 3))
|
||||
.and((w) -> w
|
||||
.or((w2) -> w2
|
||||
.and("name", QueryType.EQ, "def", 4)
|
||||
.and("name", QueryType.EQ, "", 5)
|
||||
.and("name", QueryType.EQ_FORCE, "", 6))
|
||||
.or((w2) -> w2
|
||||
.and("name", QueryType.EQ, "def", 7)
|
||||
.and("name", QueryType.EQ, "ghi", 8)))
|
||||
.toSql();
|
||||
b = "a.`id` = #{sqlMap.where#id#EQ1} AND a.name = #{sqlMap.where.name#EQ1.val}" +
|
||||
" AND (a.name = #{sqlMap.where.n#[0].name#EQ2.val} OR a.name = #{sqlMap.where.n#[0].name#EQ3.val})" +
|
||||
" AND ((a.name = #{sqlMap.where.n#[1].n#[0].name#EQ4.val} AND a.name = #{sqlMap.where.n#[1].n#[0].name#EQ_FORCE6.val})" +
|
||||
" OR (a.name = #{sqlMap.where.n#[1].n#[1].name#EQ7.val} AND a.name = #{sqlMap.where.n#[1].n#[1].name#EQ8.val}))";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.2
|
||||
copyrightYear: 2022
|
||||
copyrightYear: 2023
|
||||
|
||||
# 数据库连接
|
||||
jdbc:
|
||||
@@ -13,7 +13,7 @@ jdbc:
|
||||
# Mysql 数据库配置
|
||||
type: mysql
|
||||
driver: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeesite?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://127.0.0.1:3306/jeesite_v5?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 123456
|
||||
testSql: SELECT 1
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.4</version>
|
||||
<version>2.7.8</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Parent</name>
|
||||
@@ -42,19 +42,15 @@
|
||||
<groovy.version>3.0.10</groovy.version>
|
||||
|
||||
<!-- framework version setting -->
|
||||
<mybatis.version>3.5.10</mybatis.version>
|
||||
<mybatis.version>3.5.11</mybatis.version>
|
||||
<mybatis-spring.version>2.0.7</mybatis-spring.version>
|
||||
<jsqlparser.version>4.5</jsqlparser.version>
|
||||
<druid.version>1.2.11</druid.version>
|
||||
<shiro.version>1.10.0</shiro.version>
|
||||
<druid.version>1.2.15</druid.version>
|
||||
<shiro.version>1.11.0</shiro.version>
|
||||
<j2cache.version>2.8.0-release</j2cache.version>
|
||||
<swagger.version>1.6.6</swagger.version>
|
||||
<log4j2.version>2.18.0</log4j2.version>
|
||||
|
||||
<!-- jdbc setting -->
|
||||
<!--<mysql.version>5.1.49</mysql.version>-->
|
||||
<!--<mysql.version>8.0.29</mysql.version>-->
|
||||
|
||||
<!-- environment setting -->
|
||||
<java.version>1.8</java.version>
|
||||
<!--<tomcat.version>9.0.58</tomcat.version>-->
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite</name>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-root</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Root</name>
|
||||
|
||||
@@ -6,7 +6,7 @@ set global read_only=0;
|
||||
|
||||
create user 'jeesite'@'%' identified by 'jeesite';
|
||||
|
||||
create database jeesite DEFAULT CHARSET 'utf8' COLLATE 'utf8_general_ci';
|
||||
create database jeesite DEFAULT CHARSET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
|
||||
|
||||
grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
*/
|
||||
package com.jeesite.modules.test.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.test.entity.TestData;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 测试数据DAO接口
|
||||
* @author ThinkGem
|
||||
@@ -22,6 +22,6 @@ public interface TestDataDao extends CrudDao<TestData> {
|
||||
/**
|
||||
* 演示Map参数和返回值,支持分页
|
||||
*/
|
||||
public List<Map<String, Object>> findListForMap(Map<String, Object> params);
|
||||
List<Map<String, Object>> findListForMap(Map<String, Object> params);
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.2
|
||||
copyrightYear: 2022
|
||||
copyrightYear: 2023
|
||||
|
||||
# 是否演示模式
|
||||
demoMode: false
|
||||
@@ -590,6 +590,9 @@ shiro:
|
||||
# # 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链)
|
||||
# allowReferers: http://127.0.0.1,http://localhost
|
||||
#
|
||||
# # 允许重定向的地址,不设置为全部允许,设置this只允许本项目内部跳转,多个用逗号隔开,例如:this,http://*.jeesite.com
|
||||
# allowRedirects: ~
|
||||
#
|
||||
# # 是否在登录后生成新的Session(默认false)
|
||||
# isGenerateNewSessionAfterLogin: false
|
||||
#
|
||||
|
||||
@@ -6,7 +6,7 @@ set global read_only=0;
|
||||
|
||||
create user 'jeesite'@'%' identified by 'jeesite';
|
||||
|
||||
create database jeesite DEFAULT CHARSET 'utf8' COLLATE 'utf8_general_ci';
|
||||
create database jeesite DEFAULT CHARSET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
|
||||
|
||||
grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
*/
|
||||
package com.jeesite.modules.test.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.test.entity.TestData;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 测试数据DAO接口
|
||||
* @author ThinkGem
|
||||
@@ -22,6 +22,6 @@ public interface TestDataDao extends CrudDao<TestData> {
|
||||
/**
|
||||
* 演示Map参数和返回值,支持分页
|
||||
*/
|
||||
public List<Map<String, Object>> findListForMap(Map<String, Object> params);
|
||||
List<Map<String, Object>> findListForMap(Map<String, Object> params);
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.2
|
||||
copyrightYear: 2022
|
||||
copyrightYear: 2023
|
||||
|
||||
# 是否演示模式
|
||||
demoMode: false
|
||||
|
||||
@@ -6,7 +6,7 @@ set global read_only=0;
|
||||
|
||||
create user 'jeesite'@'%' identified by 'jeesite';
|
||||
|
||||
create database jeesite DEFAULT CHARSET 'utf8' COLLATE 'utf8_general_ci';
|
||||
create database jeesite DEFAULT CHARSET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
|
||||
|
||||
grant all privileges on jeesite.* to 'jeesite'@'%' identified by 'jeesite';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>5.2.0-SNAPSHOT</version>
|
||||
<version>5.2.1-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -22,6 +22,6 @@ public interface TestDataDao extends CrudDao<TestData> {
|
||||
/**
|
||||
* 演示Map参数和返回值,支持分页
|
||||
*/
|
||||
public List<Map<String, Object>> findListForMap(Map<String, Object> params);
|
||||
List<Map<String, Object>> findListForMap(Map<String, Object> params);
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V5.2
|
||||
copyrightYear: 2022
|
||||
copyrightYear: 2023
|
||||
|
||||
# 是否演示模式
|
||||
demoMode: false
|
||||
@@ -590,6 +590,9 @@ shiro:
|
||||
# # 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链)
|
||||
# allowReferers: http://127.0.0.1,http://localhost
|
||||
#
|
||||
# # 允许重定向的地址,不设置为全部允许,设置this只允许本项目内部跳转,多个用逗号隔开,例如:this,http://*.jeesite.com
|
||||
# allowRedirects: ~
|
||||
#
|
||||
# # 是否在登录后生成新的Session(默认false)
|
||||
# isGenerateNewSessionAfterLogin: false
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user