校工会活动管理员设置活动组别,可以查看且设置所有人
This commit is contained in:
+21
-6
@@ -199,7 +199,7 @@ public class ActivityBasicScopeController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!StpUtil.hasRole(RoleConstant.SYSADMIN.name()) && !StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if (!canViewAllScopeUsers()) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.or("creator", "=", SecurityUtil.getUserId());
|
||||
if(AuthUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name())) {
|
||||
@@ -234,16 +234,17 @@ public class ActivityBasicScopeController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断用户权限及获取工会id
|
||||
* 获取参加人员范围弹窗所需的当前用户角色和所属工会信息。
|
||||
* 无请求参数;返回 Result,data 中包含校工会管理员、校工会活动管理员、分工会角色、
|
||||
* 系统管理员判断结果及当前用户所属工会 id,供前端控制全校人员筛选条件。
|
||||
*
|
||||
* @return java.lang.Object
|
||||
* @author zhf
|
||||
* @description
|
||||
* @return 当前用户的活动人员范围权限信息
|
||||
*/
|
||||
@At
|
||||
public Result getRolesAndUnion() {
|
||||
return Result.success(new NutMap() {{
|
||||
addv("is_A06", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()));
|
||||
addv("is_school_union_activity_admin", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ACTIVITY_ADMIN.name()));
|
||||
addv("is_H04", AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_WENTI_SPORTS.name(), RoleConstant.BRANCH_UNION_XJSHAN_PROMOTION.name(), RoleConstant.BRANCH_UNION_WENTI_WY.name()));
|
||||
addv("is_sysadmin", StpUtil.hasRole(RoleConstant.SYSADMIN.name()));
|
||||
addv("unionid", SecurityUtil.getUnionId());
|
||||
@@ -377,7 +378,7 @@ public class ActivityBasicScopeController {
|
||||
|
||||
try {
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())){
|
||||
if (!canViewAllScopeUsers()) {
|
||||
cnd.andEX("u.unionid", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
cnd.andEX("u.unionid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnionId());
|
||||
@@ -398,6 +399,20 @@ public class ActivityBasicScopeController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前用户是否拥有活动参加人员范围的全校人员查看权限。
|
||||
* 系统管理员、校工会管理员和校工会活动管理员可查看全部人员,其他角色仍按所属工会限制。
|
||||
*
|
||||
* @return true 表示可查看全校人员,false 表示仅可查看所属工会人员
|
||||
*/
|
||||
private boolean canViewAllScopeUsers() {
|
||||
return AuthUtil.hasRoleOr(
|
||||
RoleConstant.SYSADMIN.name(),
|
||||
RoleConstant.SCHOOL_UNION_ADMIN.name(),
|
||||
RoleConstant.SCHOOL_UNION_ACTIVITY_ADMIN.name()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
|
||||
+12
-2
@@ -71,7 +71,15 @@ public class ActivityBasicScopeUserDataController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询已加入活动分组的人员。
|
||||
* pageForm 传递分页、排序和姓名/工号关键字;unionId、unitId、personType、userState、groupId
|
||||
* 分别传递工会、单位、教职工类别、在职状态和活动分组筛选值;existsLoginNameRedisKey
|
||||
* 用于限制导入核对产生的工号集合。返回 Result,data 为包含 list 和 totalCount 的分页结果。
|
||||
* 校工会活动管理员可查看全部活动分组人员,但删除权限仍沿用原有创建人限制。
|
||||
*
|
||||
* @return 活动分组人员分页结果
|
||||
*/
|
||||
@At
|
||||
@SaCheckPermission("activity.basic.user")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@@ -116,8 +124,10 @@ public class ActivityBasicScopeUserDataController {
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("u.personType", "=", personType);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
// 校工会活动管理员在设置参加人员范围时,可查看其他管理员已建立的人员分组。
|
||||
if (!StpUtil.hasRole(RoleConstant.SYSADMIN.name()) &&
|
||||
!StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
!StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) &&
|
||||
!StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ACTIVITY_ADMIN.name())) {
|
||||
cnd.and("aus.creator", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
if (StrUtil.isNotBlank(existsLoginNameRedisKey)) {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item" v-if="is_sysadmin || is_A06">
|
||||
<div class="search-item" v-if="has_school_scope_view_permission">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select
|
||||
@@ -196,6 +196,12 @@ module.exports = {
|
||||
is_A06() {
|
||||
return this.roleData.is_A06
|
||||
},
|
||||
is_school_union_activity_admin() {
|
||||
return this.roleData.is_school_union_activity_admin
|
||||
},
|
||||
has_school_scope_view_permission() {
|
||||
return this.is_sysadmin || this.is_A06 || this.is_school_union_activity_admin
|
||||
},
|
||||
is_H04() {
|
||||
return this.roleData.is_H04
|
||||
},
|
||||
@@ -292,7 +298,7 @@ module.exports = {
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if (this.is_A06 || this.is_sysadmin) {
|
||||
if (this.has_school_scope_view_permission) {
|
||||
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
|
||||
// this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId)
|
||||
} else {
|
||||
@@ -328,11 +334,11 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getRolesAndUnion()
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
// this.ActivityUnions = await getActivityUnions()
|
||||
await this.flushUnits()
|
||||
await this.getActivityGroup()
|
||||
await this.getRolesAndUnion()
|
||||
this.viewGroupName()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</el-select>
|
||||
</el-row>
|
||||
|
||||
<el-row class="query-row" v-if="is_A06 === true || is_sysadmin === true || is_H04 === true">
|
||||
<el-row class="query-row" v-if="has_school_scope_view_permission === true || is_H04 === true">
|
||||
<el-col class="query-title hidden-xs-only">会员类型:</el-col>
|
||||
<el-col class="query-content">
|
||||
<el-tag
|
||||
@@ -53,7 +53,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="query-row" v-if="is_A06 === true || is_sysadmin === true || is_H04 === true">
|
||||
<el-row class="query-row" v-if="has_school_scope_view_permission === true || is_H04 === true">
|
||||
<el-col class="query-title">教职工类别:</el-col>
|
||||
<el-col class="query-content">
|
||||
<el-tag
|
||||
@@ -92,7 +92,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="query-row" v-if="is_A06 === true || is_sysadmin === true || is_H04 === true">
|
||||
<el-row class="query-row" v-if="has_school_scope_view_permission === true || is_H04 === true">
|
||||
<el-col class="query-title">在职状态:</el-col>
|
||||
<el-col class="query-content">
|
||||
<el-tag
|
||||
@@ -130,7 +130,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="query-row" v-if="is_A06 === true || is_sysadmin === true || is_H04 === true">
|
||||
<el-row class="query-row" v-if="has_school_scope_view_permission === true || is_H04 === true">
|
||||
<el-col class="query-title">部门查询:</el-col>
|
||||
<el-col class="query-content">
|
||||
<el-row :gutter="20">
|
||||
@@ -144,7 +144,7 @@
|
||||
flushUnits()
|
||||
doSearch()
|
||||
"
|
||||
:clearable="is_A06 === true || is_sysadmin === true"
|
||||
:clearable="has_school_scope_view_permission === true"
|
||||
filterable
|
||||
placeholder="所属工会"
|
||||
style="width: 100%"
|
||||
@@ -170,7 +170,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<template v-if="is_A06 === true || is_sysadmin === true">
|
||||
<template v-if="has_school_scope_view_permission === true">
|
||||
<!--<el-row class="query-row">
|
||||
<el-col class="query-title">活动部门:</el-col>
|
||||
<el-col class="query-content">
|
||||
@@ -265,7 +265,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="query-row" v-if="is_A06 === true || is_sysadmin === true || is_H04 === true">
|
||||
<el-row class="query-row" v-if="has_school_scope_view_permission === true || is_H04 === true">
|
||||
<el-col class="query-title">年龄范围:</el-col>
|
||||
<el-col class="query-content">
|
||||
<el-row type="flex" style="align-items: center">
|
||||
@@ -476,6 +476,12 @@ module.exports = {
|
||||
is_A06() {
|
||||
return this.roleData.is_A06
|
||||
},
|
||||
is_school_union_activity_admin() {
|
||||
return this.roleData.is_school_union_activity_admin
|
||||
},
|
||||
has_school_scope_view_permission() {
|
||||
return this.is_sysadmin || this.is_A06 || this.is_school_union_activity_admin
|
||||
},
|
||||
is_H04() {
|
||||
return this.roleData.is_H04
|
||||
},
|
||||
@@ -561,7 +567,7 @@ module.exports = {
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if (this.is_sysadmin || this.is_A06) {
|
||||
if (this.has_school_scope_view_permission) {
|
||||
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
|
||||
// this.activityUnits = await getActivityUnits(this.pageForm.activityUnionId)
|
||||
} else {
|
||||
@@ -662,7 +668,7 @@ module.exports = {
|
||||
this.listSession()
|
||||
await this.getRolesAndUnion()
|
||||
this.clubOptions = await this.$businessTool.listCLubByRole()
|
||||
if ((this.is_sysadmin || this.is_A06 || this.is_H02) === false && this.is_H04 === true) {
|
||||
if ((this.has_school_scope_view_permission || this.is_H02) === false && this.is_H04 === true) {
|
||||
this.unions = this.$businessTool.listUnion(this.unionid)
|
||||
this.$set(this.pageForm, "unionId", this.unions[0].id)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user