Merge remote-tracking branch 'origin/main'
This commit is contained in:
+23
@@ -24,6 +24,8 @@ import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
||||
import com.budwk.app.zhgh.activity.basic.param.ActivityUserScopePageParam;
|
||||
import com.budwk.app.zhgh.activity.basic.service.ActivityBasicScopeService;
|
||||
import com.budwk.app.zhgh.activity.basic.template.UserTemp;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@@ -73,6 +75,9 @@ public class ActivityBasicScopeController {
|
||||
@Inject
|
||||
private ActivityBasicScopeService activityBasicScopeService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@@ -244,6 +249,8 @@ public class ActivityBasicScopeController {
|
||||
return Result.success(new NutMap() {{
|
||||
addv("is_A06", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()));
|
||||
addv("is_H04", StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()));
|
||||
addv("is_H02", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()));
|
||||
addv("is_CLUB_PRESIDENT", StpUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name()));
|
||||
addv("is_sysadmin", StpUtil.hasRole(RoleConstant.SYSADMIN.name()));
|
||||
addv("unionid", SecurityUtil.getUnionId());
|
||||
}});
|
||||
@@ -377,8 +384,24 @@ public class ActivityBasicScopeController {
|
||||
try {
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())){
|
||||
boolean isBranchUnionChairman = AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name());
|
||||
boolean isClubPresident = AuthUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name());
|
||||
List<String> manageClubIdList = sysClubService.getMyManageClub().stream().map(SysClub::getId).toList();
|
||||
if (isBranchUnionChairman && isClubPresident) {
|
||||
// Users with both roles can search their union users and their managed club members.
|
||||
SqlExpressionGroup scopeGroup = new SqlExpressionGroup();
|
||||
scopeGroup.or("u.unionid", "=", SecurityUtil.getUnionId());
|
||||
if (Lang.isNotEmpty(manageClubIdList)) {
|
||||
scopeGroup.or("clubuser.clubid", "in", manageClubIdList);
|
||||
}
|
||||
cnd.and(scopeGroup);
|
||||
} else if (isClubPresident) {
|
||||
// Club presidents can only search members from clubs they manage.
|
||||
cnd.and("clubuser.clubid", "in", Lang.isNotEmpty(manageClubIdList) ? manageClubIdList : List.of("__EMPTY_CLUB_ID__"));
|
||||
} else {
|
||||
cnd.andEX("u.unionid", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
}
|
||||
cnd.andEX("u.unionid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnionId());
|
||||
cnd.andEX("u.unitid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnitId());
|
||||
cnd.andEX("u.personType", IN_OR_NIN_OP, activityUserScopePageParam.getPersonTypes());
|
||||
|
||||
+2
-1
@@ -141,7 +141,8 @@ public class ActivityCultureApplyActivityController {
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, tissue);
|
||||
args.set("activity_type", tissue.getActivity_type());
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey(tissue.getActivity_type().equals(40002) ? "FGHWHHD" : "XHWHHD", tissue.getId(), SecurityUtil.getUserId(), args);
|
||||
// ProcessInstance instance = flowEngine.startProcessInstanceByKey(tissue.getActivity_type().equals(40002) ? "FGHWHHD" : "XHWHHD", tissue.getId(), SecurityUtil.getUserId(), args);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("WHHD", tissue.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
|
||||
@@ -82,4 +82,11 @@ public class ClubCommonController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result listManageClubByRole() {
|
||||
// Activity user scope uses manageable clubs, not all clubs the user has joined.
|
||||
return Result.success(sysClubService.getMyManageClub());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -282,7 +282,8 @@ public class ClubInfoManageController {
|
||||
}
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
for (String user : users) {
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()) || !Objects.equals(RoleConstant.CLUB_MEMBER.name(), roleCode)) {
|
||||
// 校工会主席可按校级管理角色录入协会会员并同步用户角色。
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name()) || !Objects.equals(RoleConstant.CLUB_MEMBER.name(), roleCode)) {
|
||||
Sys_user_role sysUserRole = new Sys_user_role();
|
||||
sysUserRole.setUserId(user);
|
||||
sysUserRole.setRoleId(sysRole.getId());
|
||||
|
||||
+3
-1
@@ -118,8 +118,10 @@ public class ClubRefreshReportController {
|
||||
public Object submit(@Param("data") SysClubRefresh clubRefresh) {
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("userId", "=", SecurityUtil.getUserId());
|
||||
// cnd.and("userId", "=", SecurityUtil.getUserId());
|
||||
// cnd.and("clubId", "=", clubRefresh.getClubId());
|
||||
// 只校验当前协会的未完成换届报告申请,避免其他协会记录误拦截。
|
||||
cnd.and(SysClubRefresh::getClubId, "=", clubRefresh.getClubId());
|
||||
if(StrUtil.isNotBlank(clubRefresh.getId())) {
|
||||
cnd.and(SysClubRefresh::getId, "!=", clubRefresh.getId());
|
||||
}
|
||||
|
||||
+2
@@ -119,6 +119,8 @@ public class ClubRuleUpdateController {
|
||||
public Object submit(@Param("data")SysClubRule clubRule) {
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 只校验当前协会的未完成章程备案申请,避免其他协会记录误拦截。
|
||||
cnd.and(SysClubRule::getClubId, "=", clubRule.getClubId());
|
||||
if(StrUtil.isNotBlank(clubRule.getId())) {
|
||||
cnd.and(SysClubRule::getId, "!=", clubRule.getId());
|
||||
}
|
||||
|
||||
+14
-3
@@ -291,8 +291,20 @@ public class ClubStatisticsController {
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("上传资料数据.zip"));
|
||||
LinkedHashMap<String, List<JSONObject>> fileList = new LinkedHashMap<>();
|
||||
|
||||
//查询社团
|
||||
List<SysClub> clubList = sysClubService.query(Cnd.NEW().andEX("id", "=", clubId));
|
||||
// 导出上传资料时只取未删除且注册流程已完成的协会,避免历史删除协会资料被打包。
|
||||
Cnd clubCnd = Cnd.NEW();
|
||||
clubCnd.andEX("id", "=", clubId);
|
||||
clubCnd.and("dismiss", "=", false);
|
||||
List<SysClub> clubList = sysClubService.query(clubCnd);
|
||||
if (!clubList.isEmpty()) {
|
||||
List<ProcessInstance> instanceList = sysClubService.dao().query(
|
||||
ProcessInstance.class,
|
||||
Cnd.where(ProcessInstance::getBusinessNo, "in", clubList.stream().map(SysClub::getId).toList())
|
||||
.and(ProcessInstance::getState, "=", ProcessInstanceStateEnum.FINISHED.getCode())
|
||||
);
|
||||
List<String> passList = instanceList.stream().map(ProcessInstance::getBusinessNo).toList();
|
||||
clubList = clubList.stream().filter(o -> passList.contains(o.getId())).toList();
|
||||
}
|
||||
clubList.forEach(item -> {
|
||||
List<JSONObject> file = new ArrayList<>();
|
||||
file.addAll(Optional.ofNullable(item.getFiles()).orElseGet(ArrayList::new));
|
||||
@@ -301,7 +313,6 @@ public class ClubStatisticsController {
|
||||
file.addAll(Optional.ofNullable(item.getManageFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getYearPlanFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getReplaceReport()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getRulesFile()).orElseGet(ArrayList::new));
|
||||
fileList.put(item.getId(), file);
|
||||
});
|
||||
|
||||
|
||||
+2
-1
@@ -113,7 +113,8 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("c.dismiss", "=", false);
|
||||
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
// 校工会主席在协会管理界面按校级管理角色查看全部协会。
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name())) {
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()));
|
||||
List<Sys_user_role> clubList = dao().query(Sys_user_role.class, Cnd.where("roleId", "in", roleList).and("userId", "=", SecurityUtil.getUserId()).and("clubId", "is not", null));
|
||||
List<String> clubIdList = clubList.stream().map(Sys_user_role::getClubId).toList();
|
||||
|
||||
@@ -114,7 +114,8 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
Cnd cnd = Cnd.where("dismiss", "=", false);
|
||||
cnd.asc("createTime");
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
// 校工会主席在协会管理界面按校级管理角色查看全部协会。
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name())) {
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(),RoleConstant.CLUB_OPERATOR.name()));
|
||||
List<Sys_user_role> clubList = dao().query(Sys_user_role.class, Cnd.where("roleId", "in", roleList).and("userId", "=", SecurityUtil.getUserId()).and("clubId", "is not", null));
|
||||
List<String> clubIdList = clubList.stream().map(Sys_user_role::getClubId).toList();
|
||||
@@ -245,6 +246,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
cnd.andEX("year(info.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.desc("createTime");
|
||||
// cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubRegisterPageVo.class);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,19 @@ const businessTool = {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询当前用户可管理的协会,供活动人员范围筛选使用
|
||||
listManageClubByRole() {
|
||||
return commonUtil
|
||||
.axiosService()
|
||||
.post("/platform/club/common/listManageClubByRole", {})
|
||||
.then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取字典数据,不包含禁用
|
||||
* @param code
|
||||
|
||||
@@ -228,12 +228,12 @@
|
||||
</template>
|
||||
|
||||
<el-row class="query-row"
|
||||
v-if="is_A06===true||is_sysadmin===true||is_H02===true">
|
||||
v-if="is_A06===true||is_sysadmin===true||is_H02===true||is_CLUB_PRESIDENT===true">
|
||||
<el-col class="query-title">协会:</el-col>
|
||||
<el-col class="query-content">
|
||||
<el-select v-model="pageForm.clubId" placeholder="请选择协会" @change="doSearch"
|
||||
filterable
|
||||
:clearable="is_A06===true||is_sysadmin===true||(is_H04===true&&is_H02===true)"
|
||||
:clearable="is_A06===true||is_sysadmin===true||is_CLUB_PRESIDENT===true||(is_H04===true&&is_H02===true)"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in clubOptions"
|
||||
@@ -482,6 +482,9 @@ module.exports = {
|
||||
is_H02() {
|
||||
return this.roleData.is_H02
|
||||
},
|
||||
is_CLUB_PRESIDENT() {
|
||||
return this.roleData.is_CLUB_PRESIDENT
|
||||
},
|
||||
is_sysadmin() {
|
||||
return this.roleData.is_sysadmin
|
||||
},
|
||||
@@ -661,9 +664,13 @@ module.exports = {
|
||||
async created() {
|
||||
this.listSession()
|
||||
await this.getRolesAndUnion()
|
||||
if (this.is_CLUB_PRESIDENT === true && (this.is_sysadmin || this.is_A06 || this.is_H02) === false) {
|
||||
this.clubOptions = await this.$businessTool.listManageClubByRole()
|
||||
} else {
|
||||
this.clubOptions = await this.$businessTool.listCLubByRole()
|
||||
if ((this.is_sysadmin || this.is_A06 || this.is_H02) === false && this.is_H04 === true) {
|
||||
this.unions = this.$businessTool.listUnion(this.unionid)
|
||||
}
|
||||
if ((this.is_sysadmin || this.is_A06 || this.is_H02 || this.is_CLUB_PRESIDENT) === false && this.is_H04 === true) {
|
||||
this.unions = await this.$businessTool.listUnion(this.unionid)
|
||||
this.$set(this.pageForm, "unionId", this.unions[0].id)
|
||||
} else {
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
@@ -673,6 +680,9 @@ module.exports = {
|
||||
this.$set(this.pageForm, "clubId", this.clubOptions[0].id)
|
||||
}
|
||||
}
|
||||
if (this.is_H04 === false && this.is_H02 === false && this.is_CLUB_PRESIDENT === true && this.clubOptions.length === 1) {
|
||||
this.$set(this.pageForm, "clubId", this.clubOptions[0].id)
|
||||
}
|
||||
await this.flushUnits()
|
||||
await this.getActivityGroup()
|
||||
this.personTypeOptions = await this.$businessTool.getDictOptions("USER_PERSON_TYPE")
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
|
||||
<el-table-column v-if="!is_view" label="操作" width="100px">
|
||||
<template v-slot="{row,$index}">
|
||||
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id !== null)" type="danger" icon="el-icon-delete"
|
||||
<el-button size="mini" :disabled="nr.bzs.length<=1 || (!row.canDelete && row.id)" type="danger" icon="el-icon-delete"
|
||||
@click="nr.bzs.splice($index,1)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -3,8 +3,9 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
|
||||
<div>
|
||||
<template>
|
||||
<custom-card>
|
||||
<!-- :define_key="activity_type===40002?'FGHWHHD':'XHWHHD'" -->
|
||||
<snaker-start slot="header" label="文化活动申报"
|
||||
:define_key="activity_type===40002?'FGHWHHD':'XHWHHD'"
|
||||
define_key="WHHD"
|
||||
v-if="activity_type===40002||activity_type===40003"></snaker-start>
|
||||
<el-form :model="formData" :rules="formRules" label-suffix=":" label-width="170px"
|
||||
ref="addForm" v-loading="formLoading">
|
||||
|
||||
@@ -17,7 +17,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="会员信息">
|
||||
<template v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
<template v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_CHAIRMAN'])">
|
||||
<el-button size="small" type="primary" icon="el-icon-download" @click="exportRegistrationDoc">导出登记表</el-button>
|
||||
<el-button @click="openImport" size="small" type="primary">导入成员</el-button>
|
||||
<el-button size="small" type="primary" @click="openUserAdd(true)">录入成员</el-button>
|
||||
|
||||
@@ -57,7 +57,7 @@ const SCHOOL_CLUB_MANAGE_TEMPLATE = {
|
||||
<el-dropdown-item :command="{type:'edit',data:row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])" :command="{type:'delete',data:row}">
|
||||
<el-dropdown-item v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_CHAIRMAN'])" :command="{type:'delete',data:row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
|
||||
Reference in New Issue
Block a user