优化 DataScope 数据权限,移除 apiMode 参数,增加 apiMode 方法;

优化 DataScope 数据权限,增加 debug、joinMode、ruleSql 方法,方便动态调用
优化 扩展查询 SQL 实现,使用 sqlMap().getColumn().addExtSql 替代 extColumnKeys;
优化 扩展查询 SQL 实现,使用 sqlMap().getTable().addExtSql 替代 extFormKeys;
优化 扩展查询 SQL 实现,使用 sqlMap().getWhere().addExtSql 替代 extWhereKeys;
新增 扩展更新 SQL 语句,sqlMap().getUpdate().addExtColumnSql 和 addExtWhereSql
This commit is contained in:
thinkgem
2025-04-02 16:39:01 +08:00
parent c0637ebf0d
commit 6715af11da
7 changed files with 127 additions and 89 deletions

View File

@@ -45,7 +45,7 @@ import java.util.List;
@Column(name="area_type", label="区域类型"),
@Column(name="tree_names", label="区域全称"),
}),
}, extWhereKeys="dsf", orderBy="a.tree_sorts, a.company_code"
}, orderBy="a.tree_sorts, a.company_code"
)
public class Company extends TreeEntity<Company> {

View File

@@ -80,9 +80,6 @@ import jakarta.validation.Valid;
// @Column(name="user_name", attrName="createByName", label="用户名称", isQuery=false),
// }),
},
// extFromKeys="dsfOfficeFrom, dsfCompanyFrom",
// extWhereKeys="dsfOfficeWhere, dsfCompanyWhere",
extWhereKeys="dsfOffice, dsfCompany",
orderBy="a.user_weight DESC, a.update_date DESC"
)
public class EmpUser extends User {

View File

@@ -42,7 +42,7 @@ import jakarta.validation.constraints.Size;
@Column(name="zip_code", attrName="zipCode", label="邮政编码", queryType=QueryType.LIKE),
@Column(name="email", attrName="email", label="邮箱", queryType=QueryType.LIKE),
@Column(includeEntity=Extend.class, attrName="extend"),
}, extWhereKeys="dsf", orderBy="a.tree_sorts, a.office_code"
}, orderBy="a.tree_sorts, a.office_code"
)
@Schema
public class Office extends TreeEntity<Office> {

View File

@@ -5,7 +5,6 @@
package com.jeesite.modules.sys.web.user;
import com.alibaba.fastjson.JSONValidator;
import com.jeesite.common.cache.CacheUtils;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
@@ -196,7 +195,9 @@ public class EmpUserController extends BaseController {
if (StringUtils.inString(op, Global.OP_ADD, Global.OP_EDIT) && subject.isPermitted("sys:empUser:edit")){
empUserService.save(empUser);
}
if (StringUtils.inString(op, Global.OP_ADD, Global.OP_AUTH) && subject.isPermitted("sys:empUser:authRole")){
/*if (StringUtils.inString(op, Global.OP_AUTH) && Global.getConfigToBoolean("user.postRolePermi", "false")) {
return renderResult(Global.FALSE, text("启用岗位角色后,将不允许单独对用户修改角色", empUser.getUserName()));
} else */if (StringUtils.inString(op, Global.OP_ADD, Global.OP_AUTH) && subject.isPermitted("sys:empUser:authRole")){
userService.saveAuth(empUser);
}
return renderResult(Global.TRUE, text("保存用户''{0}''成功", empUser.getUserName()));