Merge branch 'master' into v4.1_dev
# Conflicts: # modules/core/src/main/java/com/jeesite/modules/sys/db/InitCoreData.xlsx
This commit is contained in:
@@ -26,7 +26,7 @@ public class TimeUtils {
|
||||
long minute = (ms - day * dd - hour * hh) / mi;
|
||||
long second = (ms - day * dd - hour * hh - minute * mi) / ss;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (ms < 1000) {
|
||||
if (ms >= 0 && ms < 1000) {
|
||||
sb.append(ms).append("毫秒");
|
||||
} else {
|
||||
if (day > 0) {
|
||||
|
||||
@@ -164,7 +164,7 @@ public class JsonMapper extends ObjectMapper {
|
||||
/**
|
||||
* 当JSON里只含有Bean的部分属性時,更新一个已存在Bean,只覆盖该部分的属性.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({ "unchecked", "hiding" })
|
||||
public <T> T update(String jsonString, T object) {
|
||||
try {
|
||||
return (T) this.readerForUpdating(object).readValue(jsonString);
|
||||
|
||||
@@ -193,4 +193,10 @@ th[aria-selected=true] .ui-jqgrid-sortable {color:#1890ff;}
|
||||
.box-main>.box-header .box-title .fa {color:#1890ff;}
|
||||
.form-control:focus,.select2-container--default.select2-container--focus .select2-selection--multiple,
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {border-color:#66afe9!important;}
|
||||
.table thead tr, .ui-jqgrid-htable thead tr, .ui-jqgrid-hdiv, .ui-jqgrid-hbox {background-color:#f6f6f6;}
|
||||
.ui-jqgrid .ui-jqgrid-labels th, .ui-jqgrid tr.ui-row-ltr td, .ui-jqgrid tr.ui-row-rtl td {border-color: #eaeaea;}
|
||||
.ui-state-hover td, .ui-widget-content .ui-state-hover td, .ui-widget-header .ui-state-hover td,
|
||||
.ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {background:#f5f5f5;}
|
||||
.ui-jqgrid tr.ui-state-highlight.ui-row-ltr td {background-color:#e5f3ff;}
|
||||
.ui-jqgrid tr.ui-row-ltr td {border-right:0!important;}
|
||||
.ui-jqgrid tr.ui-row-ltr td:last-child {border-right:1px solid #eaeaea!important;}
|
||||
|
||||
@@ -114,6 +114,7 @@ public class CasAuthorizingRealm extends BaseAuthorizingRealm {
|
||||
// 获取CAS传递过来的用户属性信息
|
||||
user = new User(EncodeUtils.decodeUrl(ObjectUtils.toString(attrs.get("userCode"))));
|
||||
user.setLoginCode(EncodeUtils.decodeUrl(ObjectUtils.toString(attrs.get("loginCode"))));
|
||||
user.setCorpCode_(EncodeUtils.decodeUrl(ObjectUtils.toString(attrs.get("corpCode"))));
|
||||
user.setPassword(EncodeUtils.decodeUrl(ObjectUtils.toString(attrs.get("password"))));
|
||||
user.setUserName(EncodeUtils.decodeUrl(ObjectUtils.toString(attrs.get("userName"))));
|
||||
user.setEmail(EncodeUtils.decodeUrl(ObjectUtils.toString(attrs.get("email"))));
|
||||
@@ -145,7 +146,7 @@ public class CasAuthorizingRealm extends BaseAuthorizingRealm {
|
||||
}
|
||||
|
||||
// 重新获取用户登录
|
||||
user = UserUtils.getByLoginCode(token.getUsername()/*, corpCode*/);
|
||||
user = UserUtils.getByLoginCode(token.getUsername(), user.getCorpCode_());
|
||||
if (user != null) {
|
||||
return user;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -15,6 +15,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import com.jeesite.common.lang.ByteUtils;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
import com.jeesite.common.lang.TimeUtils;
|
||||
import com.jeesite.common.network.IpUtils;
|
||||
import com.jeesite.common.service.BaseService;
|
||||
import com.jeesite.modules.sys.utils.LogUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
@@ -35,8 +36,8 @@ public class LogInterceptor extends BaseService implements HandlerInterceptor {
|
||||
long beginTime = System.currentTimeMillis();// 1、开始时间
|
||||
startTimeThreadLocal.set(beginTime); // 线程绑定变量(该数据只有当前请求的线程可见)
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("开始计时: {} URI: {}", new SimpleDateFormat("hh:mm:ss.SSS")
|
||||
.format(beginTime), request.getRequestURI());
|
||||
logger.debug("开始计时: {} URI: {} IP: {}", new SimpleDateFormat("hh:mm:ss.SSS")
|
||||
.format(beginTime), request.getRequestURI(), IpUtils.getRemoteAddr(request));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,8 @@ public class LoginController extends BaseController{
|
||||
|
||||
// 非授权异常,登录失败,验证码加1。
|
||||
if (!UnauthorizedException.class.getName().equals(exception)){
|
||||
model.addAttribute("isValidCodeLogin", BaseAuthorizingRealm.isValidCodeLogin(username, (String)paramMap.get("deviceType"), "failed"));
|
||||
model.addAttribute("isValidCodeLogin", BaseAuthorizingRealm.isValidCodeLogin(username,
|
||||
(String)paramMap.get("corpCode"), (String)paramMap.get("deviceType"), "failed"));
|
||||
}
|
||||
|
||||
//获取当前会话对象
|
||||
|
||||
@@ -112,21 +112,25 @@ public class OnlineController extends BaseController{
|
||||
list.add(map);
|
||||
}
|
||||
// 本地排序
|
||||
if (StringUtils.isNotBlank(orderBy)){
|
||||
final String[] ss = orderBy.trim().split(" ");
|
||||
if (ss != null && ss.length == 2){
|
||||
Collections.sort(list, new Comparator<Map<String, Object>>() {
|
||||
@Override
|
||||
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
|
||||
String s1 = (String)o1.get(ss[0]);
|
||||
String s2 = (String)o2.get(ss[0]);
|
||||
if ("asc".equals(ss[1])){
|
||||
return s1.compareTo(s2);
|
||||
}else{
|
||||
return s2.compareTo(s1);
|
||||
}
|
||||
}});
|
||||
}
|
||||
if (StringUtils.isBlank(orderBy)){
|
||||
orderBy = "lastAccessTime desc";
|
||||
}
|
||||
final String[] ss = orderBy.trim().split(" ");
|
||||
if (ss != null && ss.length == 2){
|
||||
Collections.sort(list, new Comparator<Map<String, Object>>() {
|
||||
@Override
|
||||
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
|
||||
String s1 = (String)o1.get(ss[0]);
|
||||
String s2 = (String)o2.get(ss[0]);
|
||||
if (s1 == null || s2 == null){
|
||||
return -1;
|
||||
}
|
||||
if ("asc".equals(ss[1])){
|
||||
return s1.compareTo(s2);
|
||||
}else{
|
||||
return s2.compareTo(s1);
|
||||
}
|
||||
}});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class CorpAdminController extends BaseController {
|
||||
if (StringUtils.isBlank(user.getCorpCode_())){
|
||||
return renderResult(Global.FALSE, "租户代码不能为空!");
|
||||
}
|
||||
if (!Global.TRUE.equals(userService.checkLoginCode(oldLoginCode, user.getLoginCode()/*, user.getCorpCode_()*/))) {
|
||||
if (!Global.TRUE.equals(userService.checkLoginCode(oldLoginCode, user.getLoginCode()))) {
|
||||
return renderResult(Global.FALSE, "保存用户'" + user.getLoginCode() + "'失败,登录账号已存在");
|
||||
}
|
||||
if (user.getIsNewRecord()){
|
||||
@@ -237,7 +237,7 @@ public class CorpAdminController extends BaseController {
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
//@RequiresPermissions("user") // 注释掉,允许配置URI控制权限
|
||||
@RequestMapping(value = "treeData")
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> treeData(String pId, String isShowCode) {
|
||||
|
||||
@@ -155,7 +155,7 @@ public class EmpUserController extends BaseController {
|
||||
if (!EmpUser.USER_TYPE_EMPLOYEE.equals(empUser.getUserType())){
|
||||
return renderResult(Global.FALSE, "非法操作,不能够操作此用户!");
|
||||
}
|
||||
if (!Global.TRUE.equals(userService.checkLoginCode(oldLoginCode, empUser.getLoginCode()/*, null*/))) {
|
||||
if (!Global.TRUE.equals(userService.checkLoginCode(oldLoginCode, empUser.getLoginCode()))) {
|
||||
return renderResult(Global.FALSE, text("保存用户失败,登录账号''{0}''已存在", empUser.getLoginCode()));
|
||||
}
|
||||
if (StringUtils.inString(op, Global.OP_ADD, Global.OP_EDIT)
|
||||
|
||||
@@ -162,6 +162,9 @@ user:
|
||||
# 多租户模式(SAAS模式)(专业版)
|
||||
useCorpModel: false
|
||||
|
||||
# 登录账号是否租户内唯一,否则全局唯一
|
||||
loginCodeCorpUnique: false
|
||||
|
||||
# 自助账号服务
|
||||
account:
|
||||
# 注册用户
|
||||
@@ -176,7 +179,7 @@ role:
|
||||
{
|
||||
3: {
|
||||
Office: {
|
||||
#控制类型的类名 : "用来获取控制表名和主键,如果为 NONE,则代表是不控制该类型权限;",
|
||||
#控制类型的类名 : "用来获取控制表名和主键字段名,如果为 NONE,则代表是不控制该类型权限",
|
||||
ctrlTypeClass: "com.jeesite.modules.sys.entity.Office",
|
||||
#控制数据的类名: "指定一个静态类名,方便 ctrlDataAttrName 得到权限数据,如:当前部门编码、公司编码",
|
||||
ctrlDataClass: "com.jeesite.modules.sys.utils.EmpUtils",
|
||||
@@ -277,6 +280,9 @@ job:
|
||||
gen:
|
||||
enabled: true
|
||||
|
||||
# 表名字段名是否强制小写
|
||||
forceLowerCase: true
|
||||
|
||||
# 系统监控
|
||||
state:
|
||||
enabled: true
|
||||
@@ -375,6 +381,7 @@ shiro:
|
||||
# ${adminPath}/cms/category/* = anon
|
||||
# ${adminPath}/cms/article/* = anon
|
||||
# ${adminPath}/cms/link/* = anon
|
||||
# ${adminPath}/sys/corpAdmin/treeData = anon
|
||||
# ${adminPath}/** = user
|
||||
filterChainDefinitions: |
|
||||
/ReportServer/** = user
|
||||
@@ -415,6 +422,7 @@ session:
|
||||
|
||||
# 会话唯一标识SessionId在Cookie中的名称。
|
||||
sessionIdCookieName: jeesite.session.id
|
||||
#sessionIdCookiePath: ${server.servlet.context-path}
|
||||
|
||||
# 共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。
|
||||
#shareSessionIdCookieName: ${session.sessionIdCookieName}
|
||||
@@ -560,7 +568,7 @@ video:
|
||||
|
||||
# 消息提醒中心(专业版)
|
||||
msg:
|
||||
enabled: true
|
||||
enabled: false
|
||||
|
||||
# 是否开启实时发送消息(保存消息后立即检查未读消息并发送),分布式部署下请单独配置消息发送服务,不建议开启此选项。
|
||||
realtime:
|
||||
|
||||
@@ -173,7 +173,7 @@ public class ${ClassName} extends ${table.isTreeEntity?'Tree':'Data'}Entity<${Cl
|
||||
}
|
||||
}
|
||||
// 如果不是基类属性
|
||||
else if(c.columnName != 'id' && !c.isSuperColumn){
|
||||
else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
// 父类对象
|
||||
if(table.parentExists && table.parentTableFkName == c.columnName){
|
||||
%>
|
||||
@@ -268,7 +268,7 @@ public class ${ClassName} extends ${table.isTreeEntity?'Tree':'Data'}Entity<${Cl
|
||||
<%
|
||||
}
|
||||
// 如果不是基类属性
|
||||
}else if(c.columnName != 'id' && !c.isSuperColumn){
|
||||
}else if(!@StringUtils.equalsIgnoreCase(c.columnName, 'id') && !c.isSuperColumn){
|
||||
%>
|
||||
|
||||
<%
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> \${text(${className}.isNewRecord ? '新增${functionNameSimple}' : '编辑${functionNameSimple}')}
|
||||
<i class="fa icon-note"></i> \${text(${className}.isNewRecord ? '新增${functionNameSimple}' : '编辑${functionNameSimple}')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> \${text('${functionNameSimple}管理')}
|
||||
<i class="fa icon-notebook"></i> \${text('${functionNameSimple}管理')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="\${text('查询')}"><i class="fa fa-filter"></i> \${text('查询')}</a>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
for (c in table.columnList){
|
||||
if (c.isEdit == '1'){
|
||||
// 如果是树结构的字段,则自动忽略
|
||||
if(table.isTreeEntity && @StringUtils.inString(c.columnName, 'parent_code',
|
||||
if(table.isTreeEntity && @StringUtils.inStringIgnoreCase(c.columnName, 'parent_code',
|
||||
'parent_codes', 'tree_sorts', 'tree_leaf', 'tree_level', 'tree_names')){
|
||||
}
|
||||
// 如果是隐藏域
|
||||
@@ -41,7 +41,7 @@
|
||||
isNewLine = true;
|
||||
}
|
||||
// 如果是扩展字段,则输出子标题,并且强制换行
|
||||
if (c.columnName == 'extend_s1'){
|
||||
if (@StringUtils.equalsIgnoreCase(c.columnName, 'extend_s1')){
|
||||
isNewLine = true;
|
||||
}
|
||||
// 如果是第一个控件
|
||||
@@ -57,7 +57,7 @@
|
||||
<%
|
||||
}
|
||||
// 如果是扩展字段,则输出子标题,并且强制换行
|
||||
if (c.columnName == 'extend_s1'){
|
||||
if (@StringUtils.equalsIgnoreCase(c.columnName, 'extend_s1')){
|
||||
%>
|
||||
<div class="form-unit">\${text('扩展字段')}</div>
|
||||
<%
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> \${text(${className}.isNewRecord ? '新增${functionNameSimple}' : '详情${functionNameSimple}')}
|
||||
<i class="fa icon-note"></i> \${text(${className}.isNewRecord ? '新增${functionNameSimple}' : '详情${functionNameSimple}')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> \${text('${functionNameSimple}查询')}
|
||||
<i class="fa icon-notebook"></i> \${text('${functionNameSimple}查询')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="\${text('查询')}"><i class="fa fa-filter"></i> \${text('查询')}</a>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="control-inline" title="包含未登录的用户">
|
||||
<#form:checkbox name="isVisitor" value="false" label="查询游客用户"
|
||||
<#form:checkbox name="isVisitor" value="false" label="包含游客用户"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,8 +50,8 @@ $('#dataGrid').dataGrid({
|
||||
{header:'用户名称', name:'userName', index:'a.create_by_name', width:100, align:"center", formatter: function(val, obj, row, act){
|
||||
return '<span title="账号:'+(row.userCode||'')+'">'+(val||'游客');
|
||||
}},
|
||||
{header:'创建时间', name:'startTimestamp', width:100, align:'center'},
|
||||
{header:'最后访问', name:'lastAccessTime', width:100, align:'center'},
|
||||
{header:'创建时间', name:'startTimestamp', firstsortorder:'desc', width:100, align:'center'},
|
||||
{header:'最后访问', name:'lastAccessTime', firstsortorder:'desc', width:100, align:'center'},
|
||||
{header:'超时时间', name:'timeout', width:100, align:'center'},
|
||||
{header:'客户主机', name:'host', width:70, align:'center'},
|
||||
{header:'用户类型', name:'userType', width:50, align:'center', formatter: function(val, obj, row, act){
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> ${user.isNewRecord ? op == 'addCorp' ? '新增租户' : '新增' : '编辑'}管理员
|
||||
<i class="fa icon-badge"></i> ${user.isNewRecord ? op == 'addCorp' ? '新增租户' : '新增' : '编辑'}管理员
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-user"></i> ${@Global.getConfigToBoolean('user.useCorpModel', 'false') ? '租户' : '系统'}管理员
|
||||
<i class="fa icon-badge"></i> ${@Global.getConfigToBoolean('user.useCorpModel', 'false') ? '租户' : '系统'}管理员
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-people"></i> 二级管理员管理数据权限
|
||||
<i class="fa icon-user-female"></i> 二级管理员管理数据权限
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-user"></i> 二级管理员
|
||||
<i class="fa icon-user-female"></i> 二级管理员
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
|
||||
|
||||
@@ -24,15 +24,12 @@
|
||||
<#form:input type="password" name="password" class="form-control required"
|
||||
data-msg-required="${text('请填写登录密码.')}" placeholder="${text('登录密码')}" autocomplete="off"/>
|
||||
</div>
|
||||
<%/*<!-- if(@Global.getConfigToBoolean('user.useCorpModel', 'false')){ %>
|
||||
<% if(@Global.getConfigToBoolean('user.loginCodeCorpUnique', 'false')){ %>
|
||||
<div class="form-group has-feedback">
|
||||
<select name="param_corpCode" class="form-control">
|
||||
<% for(var user in @UserUtils.findCorpList()){ %>
|
||||
<option value="${user.corpCode}">(${user.corpCode}) ${user.corpName}</option>
|
||||
<% } %>
|
||||
</select>
|
||||
<#form:treeselect id="switchCorpSelect" title="${text('登录租户')}" allowClear="false"
|
||||
name="param_corpCode" url="${ctx}/sys/corpAdmin/treeData?isShowCode=true" placeholder="${text('登录租户')}"/>
|
||||
</div>
|
||||
<% } -->*/%>
|
||||
<% } %>
|
||||
<div class="form-group has-feedback" id="isValidCodeLogin" style="display:${isValidCodeLogin?'blank':'none'}">
|
||||
<#form:validcode name="validCode" isRequired="true" isRemote="true" isLazy="true"/>
|
||||
</div>
|
||||
|
||||
@@ -137,6 +137,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
|
||||
System.out.println("============ 联合查询未设定columns和attrName为this时测试 ============");
|
||||
FileUpload fileUpload = new FileUpload();
|
||||
fileUpload.getSqlMap().getWhere().and("u.user_name", QueryType.EQ, "user1");
|
||||
System.out.println(fileUploadDao.findList(fileUpload));
|
||||
|
||||
System.out.println("============ 树结构基本查询测试 ============");
|
||||
@@ -256,7 +257,12 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
+ " AND b.create_date <= #{area.sqlMap.where.create_date#LTE1.val}";
|
||||
System.out.println("a >> "+a);System.out.println("b >> "+b);Assert.assertEquals(a, b);
|
||||
|
||||
System.out.println("============ 联合查询返回到当前实体测试 ============");
|
||||
System.out.println("============ 联合查询,属性名支持指定别名 ============");
|
||||
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"});
|
||||
a = fileUpload.getSqlMap().getWhere().toSql();
|
||||
@@ -264,7 +270,7 @@ public class DaoMapperTest extends BaseSpringContextTests {
|
||||
+ " #{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时也可作为查询条件 ============");
|
||||
System.out.println("============ 联合查询,属性为this时也可作为查询条件 ============");
|
||||
FileUpload fileUpload2 = new FileUpload();
|
||||
fileUpload2.setCreateByName("ThinkGem/JeeSite");
|
||||
fileUpload2.getSqlMap().getWhere().and("create_by", QueryType.IN, new String[]{"user1","user2"});
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.jeesite.modules.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -67,6 +69,16 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
return super.findPage(testData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询子表分页数据
|
||||
* @param page 分页对象
|
||||
* @param testData
|
||||
* @return
|
||||
*/
|
||||
public List<TestDataChild> findSubList(TestDataChild testData) {
|
||||
return testDataChildDao.findList(testData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param testData
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.jeesite.modules.test.web;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -20,6 +22,7 @@ import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.test.entity.TestData;
|
||||
import com.jeesite.modules.test.entity.TestDataChild;
|
||||
import com.jeesite.modules.test.service.TestDataService;
|
||||
|
||||
/**
|
||||
@@ -64,6 +67,16 @@ public class TestDataController extends BaseController {
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询子表列表数据
|
||||
*/
|
||||
@RequiresPermissions("test:testData:view")
|
||||
@RequestMapping(value = "subListData")
|
||||
@ResponseBody
|
||||
public List<TestDataChild> subListData(TestDataChild testDataChild) {
|
||||
return testDataService.findSubList(testDataChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
|
||||
@@ -424,6 +424,7 @@ logging:
|
||||
#
|
||||
# # 会话唯一标识SessionId在Cookie中的名称。
|
||||
# sessionIdCookieName: jeesite.session.id
|
||||
# #sessionIdCookiePath: ${server.servlet.context-path}
|
||||
#
|
||||
# # 共享的SessionId的Cookie名称,保存到跟路径下,第三方应用获取。同一域名下多个项目时需设置共享Cookie的名称。
|
||||
# #shareSessionIdCookieName: ${session.sessionIdCookieName}
|
||||
@@ -569,7 +570,7 @@ logging:
|
||||
|
||||
# 消息提醒中心(专业版)
|
||||
#msg:
|
||||
# enabled: true
|
||||
# enabled: false
|
||||
#
|
||||
# # 是否开启实时发送消息(保存消息后立即检查未读消息并发送),分布式部署下请单独配置消息发送服务,不建议开启此选项。
|
||||
# realtime:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> 数据管理
|
||||
<i class="fa icon-notebook"></i> 数据管理
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> 数据管理
|
||||
<i class="fa icon-notebook"></i> 数据管理
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> ${testData.isNewRecord ? '新增数据' : '编辑数据'}
|
||||
<i class="fa icon-notebook"></i> ${testData.isNewRecord ? '新增数据' : '编辑数据'}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> ${testData.isNewRecord ? '新增数据' : '编辑数据'}
|
||||
<i class="fa icon-notebook"></i> ${testData.isNewRecord ? '新增数据' : '编辑数据'}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> ${testData.isNewRecord ? '新增数据' : '编辑数据'}
|
||||
<i class="fa icon-notebook"></i> ${testData.isNewRecord ? '新增数据' : '编辑数据'}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> ${text(testData.isNewRecord ? '新增数据' : '编辑数据')}
|
||||
<i class="fa icon-note"></i> ${text(testData.isNewRecord ? '新增数据' : '编辑数据')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
@@ -170,7 +170,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-unit">${text('测试数据子表')}</h4>
|
||||
<h4 class="form-unit">${text('子表数据')}</h4>
|
||||
<div class="ml10 mr10">
|
||||
<table id="testDataChildDataGrid"></table>
|
||||
<% if (hasPermi('test:testData:edit')){ %>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> ${text('数据管理')}
|
||||
<i class="fa icon-notebook"></i> ${text('数据管理')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
|
||||
@@ -170,6 +170,45 @@ $('#dataGrid').dataGrid({
|
||||
ondblClickRow: function(id, rownum, colnum, event){
|
||||
js.addTabPage(null, '编辑数据', '${ctx}/test/testData/form?id='+id);
|
||||
},
|
||||
|
||||
// 子表格支持演示
|
||||
subGrid: true,
|
||||
subGridRowExpanded: function (subgridId, rowId) {
|
||||
$('#'+subgridId).html('<h5><i class="icon-docs"></i> 子表数据</h5>'
|
||||
+'<table id="'+subgridId+'_subgrid"></table>');
|
||||
$('#'+subgridId+'_subgrid').dataGrid({
|
||||
url: '${ctx}/test/testData/subListData',
|
||||
postData: {'testData.id': rowId},
|
||||
autoGridHeight: function(){return 'auto'}, // 设置自动高度
|
||||
autoGridWidth: function(){return $("#"+subgridId).width();}, // 设置自动高度
|
||||
// 设置数据表格列
|
||||
columnModel: [
|
||||
{header:'${text("单行文本")}', name:'testInput', width:150},
|
||||
{header:'${text("多行文本")}', name:'testTextarea', width:150},
|
||||
{header:'${text("下拉框")}', name:'testSelect', width:150, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("下拉多选")}', name:'testSelectMultiple', width:150, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("单选框")}', name:'testRadio', width:150, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("复选框")}', name:'testCheckbox', width:150, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("日期时间")}', name:'testDatetime', width:150, align:"center"},
|
||||
{header:'${text("用户名称")}', name:'testUser.userName', width:150, align:"center"},
|
||||
{header:'${text("机构名称")}', name:'testOffice.officeName', width:150, align:"center"},
|
||||
{header:'${text("区域名称")}', name:'testAreaName', width:150, align:"center"}
|
||||
],
|
||||
// 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
// if (data.count == 0){
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> ${text(testTree.isNewRecord ? '新增数据' : '编辑数据')}
|
||||
<i class="fa icon-note"></i> ${text(testTree.isNewRecord ? '新增数据' : '编辑数据')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa fa-list-alt"></i> ${text('数据管理')}
|
||||
<i class="fa icon-notebook"></i> ${text('数据管理')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
|
||||
|
||||
Reference in New Issue
Block a user