Compare commits

...
3 Commits
47 changed files with 102 additions and 131 deletions
@@ -34,7 +34,7 @@ public class FlowClubPresidentByArgsAssignmentHandler implements AssignmentHandl
} }
CommonService commonService = ServiceContext.find(CommonService.class); CommonService commonService = ServiceContext.find(CommonService.class);
List<Sys_user> users = commonService.findUserInfoByRoleCode(Sys_user_role::getClubId, clubId, RoleConstant.CLUB_PRESIDENT); List<Sys_user> users = commonService.findUserInfoByRoleCode(Sys_user_role::getClubId, clubId, RoleConstant.CLUB_MANAGER);
if(Lang.isEmpty(users)) { if(Lang.isEmpty(users)) {
throw new BaseException("未查询到相关审批人"); throw new BaseException("未查询到相关审批人");
@@ -45,7 +45,7 @@ public class FlowClubPresidentByArgsAssignmentHandler implements AssignmentHandl
@Override @Override
public String getMessage() { public String getMessage() {
return "获取协会会长(根据args中的clubId)"; return "获取协会负责人(根据args中的clubId)";
} }
@Override @Override
@@ -206,7 +206,7 @@ public class ActivityBasicScopeController {
if (!StpUtil.hasRole(RoleConstant.SYSADMIN.name()) && !StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) { if (!StpUtil.hasRole(RoleConstant.SYSADMIN.name()) && !StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
SqlExpressionGroup group = new SqlExpressionGroup(); SqlExpressionGroup group = new SqlExpressionGroup();
group.or("creator", "=", SecurityUtil.getUserId()); group.or("creator", "=", SecurityUtil.getUserId());
if(AuthUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name())) { if(AuthUtil.hasRole(RoleConstant.CLUB_MANAGER.name())) {
group.or("groupName", "like", "%社%"); group.or("groupName", "like", "%社%");
} }
cnd.and(group); cnd.and(group);
@@ -250,7 +250,7 @@ public class ActivityBasicScopeController {
addv("is_A06", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())); addv("is_A06", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()));
addv("is_H04", StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())); addv("is_H04", StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()));
addv("is_H02", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())); addv("is_H02", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()));
addv("is_CLUB_PRESIDENT", StpUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name())); addv("is_CLUB_MANAGER", StpUtil.hasRole(RoleConstant.CLUB_MANAGER.name()));
addv("is_sysadmin", StpUtil.hasRole(RoleConstant.SYSADMIN.name())); addv("is_sysadmin", StpUtil.hasRole(RoleConstant.SYSADMIN.name()));
addv("unionid", SecurityUtil.getUnionId()); addv("unionid", SecurityUtil.getUnionId());
}}); }});
@@ -383,25 +383,9 @@ public class ActivityBasicScopeController {
try { try {
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())){ if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.CLUB_MANAGER.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", "=", SecurityUtil.getUnionId());
} }
}
cnd.andEX("u.unionid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnionId()); cnd.andEX("u.unionid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnionId());
cnd.andEX("u.unitid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnitId()); cnd.andEX("u.unitid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnitId());
cnd.andEX("u.personType", IN_OR_NIN_OP, activityUserScopePageParam.getPersonTypes()); cnd.andEX("u.personType", IN_OR_NIN_OP, activityUserScopePageParam.getPersonTypes());
@@ -131,7 +131,7 @@ public class ActivityCultureServiceImpl extends BaseServiceImpl<ActivityTissue>
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
group.or("tissue.unionId", "=", SecurityUtil.getUnionId()); group.or("tissue.unionId", "=", SecurityUtil.getUnionId());
} }
if (AuthUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name())) { if (AuthUtil.hasRole(RoleConstant.CLUB_MANAGER.name())) {
List<SysClub> myManageClub = sysClubService.getMyManageClub(); List<SysClub> myManageClub = sysClubService.getMyManageClub();
List<String> clubIds = myManageClub.stream().map(SysClub::getId).collect(Collectors.toList()); List<String> clubIds = myManageClub.stream().map(SysClub::getId).collect(Collectors.toList());
group.or("tissue.clubId", "in", clubIds); group.or("tissue.clubId", "in", clubIds);
@@ -57,7 +57,7 @@ public class CommonPageParam extends PageForm {
RoleConstant.BRANCH_UNION_OPERATOR.name())) { RoleConstant.BRANCH_UNION_OPERATOR.name())) {
group.or(prefix + "unionid", "=", SecurityUtil.getUnionId()); group.or(prefix + "unionid", "=", SecurityUtil.getUnionId());
} }
if (AuthUtil.hasRoleOr(RoleConstant.CLUB_MANAGER.name(), RoleConstant.CLUB_PRESIDENT.name())) { if (AuthUtil.hasRoleOr(RoleConstant.CLUB_MANAGER.name())) {
// cnd.and(prefix + "clubId", "=", ); // cnd.and(prefix + "clubId", "=", );
group.or(prefix + "clubId", "in", SecurityUtil.getClubIds()); group.or(prefix + "clubId", "in", SecurityUtil.getClubIds());
} }
@@ -145,7 +145,7 @@ public class YearPlanController {
@SaCheckPermission("planSummary.yearPlan.manage") @SaCheckPermission("planSummary.yearPlan.manage")
public Result queryClub() { public Result queryClub() {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name()) && AuthUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name())) { if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name()) && AuthUtil.hasRole(RoleConstant.CLUB_MANAGER.name())) {
List<SysClub> clubList = sysClubService.getMyManageClub(); List<SysClub> clubList = sysClubService.getMyManageClub();
List<String> list = clubList.stream().map(SysClub::getId).toList(); List<String> list = clubList.stream().map(SysClub::getId).toList();
cnd.and(SysClub::getId, "in", list); cnd.and(SysClub::getId, "in", list);
@@ -71,7 +71,7 @@ public class YearPlanServiceImpl extends BaseServiceImpl<YearPlan> implements Ye
if(AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { if(AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
group.or("yp.tissueId", "=", SecurityUtil.getUnionId()); group.or("yp.tissueId", "=", SecurityUtil.getUnionId());
} }
if(AuthUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name())) { if(AuthUtil.hasRole(RoleConstant.CLUB_MANAGER.name())) {
List<SysClub> clubList = sysClubService.getMyManageClub(); List<SysClub> clubList = sysClubService.getMyManageClub();
List<String> list = clubList.stream().map(SysClub::getId).toList(); List<String> list = clubList.stream().map(SysClub::getId).toList();
group.or("yp.tissueId", "in", list); group.or("yp.tissueId", "in", list);
@@ -68,7 +68,7 @@ public class YearSummaryServiceImpl extends BaseServiceImpl<YearSummary> impleme
if(AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { if(AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
group.or("ys.tissueId", "=", SecurityUtil.getUnionId()); group.or("ys.tissueId", "=", SecurityUtil.getUnionId());
} }
if(AuthUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name())) { if(AuthUtil.hasRole(RoleConstant.CLUB_MANAGER.name())) {
List<SysClub> clubList = sysClubService.getMyManageClub(); List<SysClub> clubList = sysClubService.getMyManageClub();
List<String> list = clubList.stream().map(SysClub::getId).toList(); List<String> list = clubList.stream().map(SysClub::getId).toList();
group.or("ys.tissueId", "in", list); group.or("ys.tissueId", "in", list);
@@ -132,7 +132,7 @@ public class TrainSignUpActivityStatisticsController {
result.add(activity); result.add(activity);
} }
} }
if(AuthUtil.hasRoleOr(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_OPERATOR.name())) { if(AuthUtil.hasRoleOr(RoleConstant.CLUB_MANAGER.name(), RoleConstant.CLUB_OPERATOR.name())) {
if(clubIds.stream().anyMatch(activity.getHostUnits()::contains) || clubIds.stream().anyMatch(activity.getHelpUnits()::contains)) { if(clubIds.stream().anyMatch(activity.getHostUnits()::contains) || clubIds.stream().anyMatch(activity.getHelpUnits()::contains)) {
result.add(activity); result.add(activity);
} }
@@ -63,7 +63,7 @@ public class ClubUserMineClubController {
FROM FROM
sys_club club sys_club club
LEFT JOIN club_user uc ON club.id = uc.clubId LEFT JOIN club_user uc ON club.id = uc.clubId
LEFT JOIN club_user presidentCu ON presidentCu.clubId = club.id AND JSON_CONTAINS(presidentCu.roleCode, '"CLUB_PRESIDENT"') LEFT JOIN club_user presidentCu ON presidentCu.clubId = club.id AND JSON_CONTAINS(presidentCu.roleCode, '"CLUB_MANAGER"')
LEFT JOIN sys_user presidentUser ON presidentUser.id = presidentCu.userId LEFT JOIN sys_user presidentUser ON presidentUser.id = presidentCu.userId
LEFT JOIN club_user secretaryCu ON secretaryCu.clubId = club.id AND JSON_CONTAINS(secretaryCu.roleCode, '"CLUB_SECRETARY"') LEFT JOIN club_user secretaryCu ON secretaryCu.clubId = club.id AND JSON_CONTAINS(secretaryCu.roleCode, '"CLUB_SECRETARY"')
LEFT JOIN sys_user secretaryUser ON secretaryUser.id = secretaryCu.userId LEFT JOIN sys_user secretaryUser ON secretaryUser.id = secretaryCu.userId
@@ -62,7 +62,7 @@ public class ClubCommonController {
public Result listClubByRole() { public Result listClubByRole() {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT); Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_MANAGER);
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId())); List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList(); List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
cnd.and("c.id", "in", myClubId); cnd.and("c.id", "in", myClubId);
@@ -63,7 +63,7 @@ public class ClubEvaluateClubAuditController {
@At @At
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.evaluate.clubAudit") @SaCheckPermission("club.evaluate.clubAudit")
@SLog(tag = "协会管理系统-协会评优", msg = "会长审核评优申请") @SLog(tag = "协会管理系统-协会评优", msg = "协会负责人审核评优申请")
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) { public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
approvalParam.getBpmTaskApprovalTypeEnum(); approvalParam.getBpmTaskApprovalTypeEnum();
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam); Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
@@ -80,7 +80,7 @@ public class ClubEvaluateClubAuditController {
@At @At
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.evaluate.clubAudit") @SaCheckPermission("club.evaluate.clubAudit")
@SLog(tag = "协会管理系统-协会评优", msg = "会长撤回评优申请") @SLog(tag = "协会管理系统-协会评优", msg = "协会负责人撤回评优申请")
public Result revoke(@Valid String taskId) { public Result revoke(@Valid String taskId) {
bpmService.revokeTask(taskId); bpmService.revokeTask(taskId);
return Result.success(); return Result.success();
@@ -57,7 +57,7 @@ public class ClubExamineClubAuditController {
@At @At
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.examine.clubAudit") @SaCheckPermission("club.examine.clubAudit")
@SLog(tag = "协会管理系统-协会年审", msg = "会长审核年度考核") @SLog(tag = "协会管理系统-协会年审", msg = "协会负责人审核年度考核")
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) { public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
approvalParam.getBpmTaskApprovalTypeEnum(); approvalParam.getBpmTaskApprovalTypeEnum();
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam); Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
@@ -74,7 +74,7 @@ public class ClubExamineClubAuditController {
@At @At
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.examine.clubAudit") @SaCheckPermission("club.examine.clubAudit")
@SLog(tag = "协会管理系统-协会年审", msg = "会长撤回年度考核") @SLog(tag = "协会管理系统-协会年审", msg = "协会负责人撤回年度考核")
public Result revoke(@Valid String taskId) { public Result revoke(@Valid String taskId) {
bpmService.revokeTask(taskId); bpmService.revokeTask(taskId);
return Result.success(); return Result.success();
@@ -196,12 +196,12 @@ public class ClubInfoManageController {
@SLog(tag = "协会管理系统-信息管理", msg = "修改身份") @SLog(tag = "协会管理系统-信息管理", msg = "修改身份")
public Result updateRoleCode(@Param("id") String id, @Valid String[] roleCodes, @Valid String clubId) { public Result updateRoleCode(@Param("id") String id, @Valid String[] roleCodes, @Valid String clubId) {
List<String> roleCodeList = Arrays.asList(roleCodes); List<String> roleCodeList = Arrays.asList(roleCodes);
//查询社团是否存在会长或者秘书长 //查询社团是否存在协会负责人或者秘书长
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_PRESIDENT.name())) { if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_MANAGER.name())) {
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId) int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_PRESIDENT.name())))); .and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_MANAGER.name()))));
if (count > 0) { if (count > 0) {
// return Result.error("会长只能有一位"); // return Result.error("协会负责人只能有一位");
} }
} }
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_SECRETARY.name())) { if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_SECRETARY.name())) {
@@ -272,12 +272,12 @@ public class ClubInfoManageController {
@SLog(tag = "协会管理系统-信息管理", msg = "添加协会成员") @SLog(tag = "协会管理系统-信息管理", msg = "添加协会成员")
public Result userDoAdd(@Valid String clubId, @Valid String[] users, @Valid String roleCode, @Valid Boolean payed) { public Result userDoAdd(@Valid String clubId, @Valid String[] users, @Valid String roleCode, @Valid Boolean payed) {
//查询社团是否存在会长或者秘书长 //查询社团是否存在协会负责人或者秘书长
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name()).contains(roleCode)) { if (List.of(RoleConstant.CLUB_MANAGER.name(), RoleConstant.CLUB_SECRETARY.name()).contains(roleCode)) {
int count = clubInfoManageService.dao().count(ClubUser.class, Cnd.where("clubId", "=", clubId) int count = clubInfoManageService.dao().count(ClubUser.class, Cnd.where("clubId", "=", clubId)
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(roleCode)))); .and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(roleCode))));
if (count > 0) { if (count > 0) {
return Result.error((Objects.equals(roleCode, RoleConstant.CLUB_PRESIDENT.name()) ? "会长" : "秘书长") + "只能有一位"); return Result.error((Objects.equals(roleCode, RoleConstant.CLUB_MANAGER.name()) ? "协会负责人" : "秘书长") + "只能有一位");
} }
} }
Sys_role sysRole = sysRoleService.getByCode(roleCode); Sys_role sysRole = sysRoleService.getByCode(roleCode);
@@ -295,7 +295,7 @@ public class ClubInfoManageController {
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("clubId", "=", clubId).and("userId", "=", user)); ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("clubId", "=", clubId).and("userId", "=", user));
if(clubUser != null) { if(clubUser != null) {
List<String> roleCodeList = clubUser.getRoleCode(); List<String> roleCodeList = clubUser.getRoleCode();
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()).contains(roleCode)) { if (List.of(RoleConstant.CLUB_MANAGER.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()).contains(roleCode)) {
roleCodeList.remove(RoleConstant.CLUB_MEMBER.name()); roleCodeList.remove(RoleConstant.CLUB_MEMBER.name());
} }
if(!roleCodeList.contains(roleCode)) { if(!roleCodeList.contains(roleCode)) {
@@ -98,7 +98,7 @@ public class ClubStatisticsController {
cnd.and("id", auditState ? "in" : "not in", registers.stream().map(SysClubExamineRegister::getClubId).toList()); cnd.and("id", auditState ? "in" : "not in", registers.stream().map(SysClubExamineRegister::getClubId).toList());
}*/ }*/
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())) {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT); Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_MANAGER);
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId())); List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList(); List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
cnd.and("id", "in", myClubId); cnd.and("id", "in", myClubId);
@@ -136,7 +136,7 @@ public class ClubStatisticsController {
$condition $condition
ORDER BY ORDER BY
CASE CASE
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_PRESIDENT"') THEN 1 WHEN JSON_CONTAINS(c.roleCode, '"CLUB_MANAGER"') THEN 1
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2 WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_SECRETARY"') THEN 3 WHEN JSON_CONTAINS(c.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4 WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
@@ -186,7 +186,7 @@ public class ClubStatisticsController {
$condition $condition
ORDER BY ORDER BY
CASE CASE
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_PRESIDENT"') THEN 1 WHEN JSON_CONTAINS(c.roleCode, '"CLUB_MANAGER"') THEN 1
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2 WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_SECRETARY"') THEN 3 WHEN JSON_CONTAINS(c.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4 WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
@@ -196,7 +196,7 @@ public class ClubStatisticsController {
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
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())) {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT); Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_MANAGER);
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId())); List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList(); List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
cnd.and("c.clubId", "in", myClubId); cnd.and("c.clubId", "in", myClubId);
@@ -371,7 +371,7 @@ public class ClubStatisticsController {
sum( CASE WHEN su.userState in ('退休') $myCondition THEN 1 ELSE 0 END ) AS retire, sum( CASE WHEN su.userState in ('退休') $myCondition THEN 1 ELSE 0 END ) AS retire,
sum( CASE WHEN su.sex like '%男%' $myCondition THEN 1 ELSE 0 END ) AS man, sum( CASE WHEN su.sex like '%男%' $myCondition THEN 1 ELSE 0 END ) AS man,
sum( CASE WHEN su.sex like '%女%' $myCondition THEN 1 ELSE 0 END ) AS woman, sum( CASE WHEN su.sex like '%女%' $myCondition THEN 1 ELSE 0 END ) AS woman,
sum( CASE WHEN ('CLUB_PRESIDENT' MEMBER OF (cu.roleCode) or 'CLUB_VICE_PRESIDENT' MEMBER OF (cu.roleCode) or 'CLUB_SECRETARY' MEMBER OF (cu.roleCode) or 'CLUB_VICE_SECRETARY' MEMBER OF (cu.roleCode)) AND 1 = 1 $myCondition THEN 1 ELSE 0 END ) AS governing_body sum( CASE WHEN ('CLUB_MANAGER' MEMBER OF (cu.roleCode) or 'CLUB_VICE_PRESIDENT' MEMBER OF (cu.roleCode) or 'CLUB_SECRETARY' MEMBER OF (cu.roleCode) or 'CLUB_VICE_SECRETARY' MEMBER OF (cu.roleCode)) AND 1 = 1 $myCondition THEN 1 ELSE 0 END ) AS governing_body
FROM FROM
sys_club club sys_club club
LEFT JOIN club_user cu ON cu.clubId = club.id LEFT JOIN club_user cu ON cu.clubId = club.id
@@ -389,7 +389,7 @@ public class ClubStatisticsController {
cnd.and("club.id", auditState ? "in" : "not in", businessNoList); cnd.and("club.id", auditState ? "in" : "not in", businessNoList);
} }
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())) {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT); Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_MANAGER);
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId())); List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList(); List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
cnd.and("club.id", "in", myClubId); cnd.and("club.id", "in", myClubId);
@@ -108,7 +108,7 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
AND NOT JSON_CONTAINS(cl.roleCode, '"CLUB_MEMBER"') AND NOT JSON_CONTAINS(cl.roleCode, '"CLUB_MEMBER"')
ORDER BY ORDER BY
CASE CASE
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_PRESIDENT"') THEN 1 WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_MANAGER"') THEN 1
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2 WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_SECRETARY"') THEN 3 WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4 WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
@@ -86,7 +86,7 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
GROUP_CONCAT(secretaryUser.username) AS clubSecretary GROUP_CONCAT(secretaryUser.username) AS clubSecretary
FROM FROM
sys_club c sys_club c
LEFT JOIN club_user presidentCu on presidentCu.clubId = c.id AND JSON_CONTAINS(presidentCu.roleCode, '"CLUB_PRESIDENT"') LEFT JOIN club_user presidentCu on presidentCu.clubId = c.id AND JSON_CONTAINS(presidentCu.roleCode, '"CLUB_MANAGER"')
LEFT JOIN sys_user presidentUser on presidentUser.id = presidentCu.userId LEFT JOIN sys_user presidentUser on presidentUser.id = presidentCu.userId
LEFT JOIN club_user secretaryCu on secretaryCu.clubId = c.id AND JSON_CONTAINS(secretaryCu.roleCode, '"CLUB_SECRETARY"') LEFT JOIN club_user secretaryCu on secretaryCu.clubId = c.id AND JSON_CONTAINS(secretaryCu.roleCode, '"CLUB_SECRETARY"')
LEFT JOIN sys_user secretaryUser on secretaryUser.id = secretaryCu.userId LEFT JOIN sys_user secretaryUser on secretaryUser.id = secretaryCu.userId
@@ -115,7 +115,7 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode()); cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
// 校工会主席在协会管理界面按校级管理角色查看全部协会。 // 校工会主席在协会管理界面按校级管理角色查看全部协会。
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.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<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_MANAGER.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<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(); List<String> clubIdList = clubList.stream().map(Sys_user_role::getClubId).toList();
@@ -167,7 +167,7 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
sql.setVar("order", """ sql.setVar("order", """
ORDER BY ORDER BY
CASE CASE
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_PRESIDENT"') THEN 1 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MANAGER"') THEN 1
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
@@ -261,7 +261,7 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
FROM FROM
sys_club c sys_club c
LEFT JOIN club_user scu ON scu.clubId = c.id LEFT JOIN club_user scu ON scu.clubId = c.id
AND JSON_CONTAINS(scu.roleCode, '"CLUB_PRESIDENT"') AND JSON_CONTAINS(scu.roleCode, '"CLUB_MANAGER"')
LEFT JOIN vw_user u ON u.id = scu.userId LEFT JOIN vw_user u ON u.id = scu.userId
WHERE WHERE
c.id = @clubId c.id = @clubId
@@ -288,7 +288,7 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
WHERE scu.clubId = @clubId WHERE scu.clubId = @clubId
ORDER BY ORDER BY
CASE CASE
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_PRESIDENT"') THEN 1 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MANAGER"') THEN 1
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
@@ -68,7 +68,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
SELECT SELECT
club.*, club.*,
u.username as concatPersonName, u.username as concatPersonName,
(select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and JSON_CONTAINS(u.roleCode, '"CLUB_PRESIDENT"'))) as clubLeader, (select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and JSON_CONTAINS(u.roleCode, '"CLUB_MANAGER"'))) as clubLeader,
(select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and JSON_CONTAINS(u.roleCode, '"CLUB_SECRETARY"'))) as clubSecretary, (select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and JSON_CONTAINS(u.roleCode, '"CLUB_SECRETARY"'))) as clubSecretary,
(SELECT count( DISTINCT scu.userId ) FROM club_user scu WHERE scu.clubId = club.id ) currentPeopleNum (SELECT count( DISTINCT scu.userId ) FROM club_user scu WHERE scu.clubId = club.id ) currentPeopleNum
FROM FROM
@@ -116,7 +116,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
// 校工会主席在协会管理界面按校级管理角色查看全部协会。 // 校工会主席在协会管理界面按校级管理角色查看全部协会。
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.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<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_MANAGER.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<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(); List<String> clubIdList = clubList.stream().map(Sys_user_role::getClubId).toList();
@@ -150,7 +150,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
cnd.and("instance.state", "=", ProcessInstanceStateEnum.FINISHED.getCode()); cnd.and("instance.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())) {
cnd.and("ur.userId", "=", SecurityUtil.getUserId()); cnd.and("ur.userId", "=", SecurityUtil.getUserId());
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<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_MANAGER.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()));
cnd.and("ur.roleId", "in", roleList); cnd.and("ur.roleId", "in", roleList);
} }
cnd.and("ex.year", "=", year); cnd.and("ex.year", "=", year);
@@ -73,7 +73,7 @@ public class SysClubUserServiceImpl extends BaseServiceImpl<ClubUser> implements
WHERE scu.clubId = @clubId WHERE scu.clubId = @clubId
ORDER BY ORDER BY
CASE CASE
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_PRESIDENT"') THEN 1 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MANAGER"') THEN 1
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4 WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
@@ -128,7 +128,7 @@ public class SysClubUserServiceImpl extends BaseServiceImpl<ClubUser> implements
@Override @Override
public String getClubLeader(String clubId) { public String getClubLeader(String clubId) {
List<Sys_user> userList = commonService.findUserInfoByRoleCode("clubId", clubId, RoleConstant.CLUB_PRESIDENT.name()); List<Sys_user> userList = commonService.findUserInfoByRoleCode("clubId", clubId, RoleConstant.CLUB_MANAGER.name());
return userList.stream().map(Sys_user::getLoginname).collect(Collectors.joining(",")); return userList.stream().map(Sys_user::getLoginname).collect(Collectors.joining(","));
} }
@@ -138,7 +138,7 @@ public class ArticleFirstExamineController {
} }
assignments.add(branchUnionApprovalLoginName); assignments.add(branchUnionApprovalLoginName);
} else if (result.equals("BACK_TO_CLUB")) { } else if (result.equals("BACK_TO_CLUB")) {
String branchClubApprovalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_PRESIDENT, Cnd.where(Sys_user_role::getClubId, "=", article.getClubId())); String branchClubApprovalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_MANAGER, Cnd.where(Sys_user_role::getClubId, "=", article.getClubId()));
if (StrUtil.isBlank(branchClubApprovalLoginName)) { if (StrUtil.isBlank(branchClubApprovalLoginName)) {
return Result.error("协会未配置审批人,请联系协会!"); return Result.error("协会未配置审批人,请联系协会!");
} }
@@ -157,7 +157,7 @@ public class ActivityBudgetApplyController {
public Result listClub(){ public Result listClub(){
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT); Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_MANAGER);
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId())); List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList(); List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
cnd.and("id", "in", myClubId); cnd.and("id", "in", myClubId);
@@ -99,7 +99,7 @@ public class ActivityBudgetServiceImpl extends BaseServiceImpl<ActivityBudget> i
group1.and("info.unionId", "=", SecurityUtil.getUnionId()); group1.and("info.unionId", "=", SecurityUtil.getUnionId());
group.or(group1); group.or(group1);
} }
if (AuthUtil.hasRoleOr(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name())) { if (AuthUtil.hasRoleOr(RoleConstant.CLUB_MANAGER.name(), RoleConstant.CLUB_SECRETARY.name())) {
List<SysClub> myManageClub = sysClubService.getMyManageClub(); List<SysClub> myManageClub = sysClubService.getMyManageClub();
List<String> clubIds = myManageClub.stream().map(SysClub::getId).toList(); List<String> clubIds = myManageClub.stream().map(SysClub::getId).toList();
SqlExpressionGroup group1 = new SqlExpressionGroup(); SqlExpressionGroup group1 = new SqlExpressionGroup();
@@ -66,7 +66,7 @@ public class OutlayManageClubController {
"""); """);
cnd.andEX("year", "=", year); cnd.andEX("year", "=", year);
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT); Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_MANAGER);
List<Sys_user_role> userRoles = baseService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId())); List<Sys_user_role> userRoles = baseService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList(); List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
cnd.andEX("clubId", "in", myClubId); cnd.andEX("clubId", "in", myClubId);
@@ -74,7 +74,7 @@ public class OutlayManageClubUseDetailController {
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.andEX("clubId", "=", clubId); cnd.andEX("clubId", "=", clubId);
} else { } else {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT); Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_MANAGER);
List<Sys_user_role> userRoles = baseService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId())); List<Sys_user_role> userRoles = baseService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList(); List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
cnd.andEX("clubId", "in", myClubId); cnd.andEX("clubId", "in", myClubId);
@@ -123,7 +123,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
.and("unionId", "=", StrUtil.isNotBlank(unionId) ? unionId : SecurityUtil.getUnionId())); .and("unionId", "=", StrUtil.isNotBlank(unionId) ? unionId : SecurityUtil.getUnionId()));
map.put("budgetMoney", ObjectUtil.isNotEmpty(union) ? union.getTotalQuota().subtract(union.getUsedQuota()) : 0); map.put("budgetMoney", ObjectUtil.isNotEmpty(union) ? union.getTotalQuota().subtract(union.getUsedQuota()) : 0);
} else if (outlayManageSource.equals("ACTIVITY_BUDGET_TYPE_THREE")) { } else if (outlayManageSource.equals("ACTIVITY_BUDGET_TYPE_THREE")) {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT); Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_MANAGER);
List<Sys_user_role> userRoles = dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId())); List<Sys_user_role> userRoles = dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList(); List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
@@ -21,7 +21,7 @@
</el-select> </el-select>
</el-row> </el-row>
<el-row class="query-row" v-if="is_A06 === true || is_sysadmin === true || is_H02 === true"> <el-row class="query-row" v-if="is_A06 === true || is_sysadmin === true || is_H02 === true || is_CLUB_MANAGER === true">
<el-col class="query-title hidden-xs-only">会员类型:</el-col> <el-col class="query-title hidden-xs-only">会员类型:</el-col>
<el-col class="query-content"> <el-col class="query-content">
<el-tag <el-tag
@@ -53,7 +53,7 @@
</el-col> </el-col>
</el-row> </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="is_A06 === true || is_sysadmin === true || is_H04 === true || is_CLUB_MANAGER === true">
<el-col class="query-title">教职工类别:</el-col> <el-col class="query-title">教职工类别:</el-col>
<el-col class="query-content"> <el-col class="query-content">
<el-tag <el-tag
@@ -92,7 +92,7 @@
</el-col> </el-col>
</el-row> </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="is_A06 === true || is_sysadmin === true || is_H04 === true || is_CLUB_MANAGER === true">
<el-col class="query-title">在职状态:</el-col> <el-col class="query-title">在职状态:</el-col>
<el-col class="query-content"> <el-col class="query-content">
<el-tag <el-tag
@@ -130,7 +130,7 @@
</el-col> </el-col>
</el-row> </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="is_A06 === true || is_sysadmin === true || is_H04 === true || is_CLUB_MANAGER === true">
<el-col class="query-title">部门查询:</el-col> <el-col class="query-title">部门查询:</el-col>
<el-col class="query-content"> <el-col class="query-content">
<el-row :gutter="20"> <el-row :gutter="20">
@@ -144,7 +144,7 @@
flushUnits() flushUnits()
doSearch() doSearch()
" "
:clearable="is_A06 === true || is_sysadmin === true" :clearable="is_A06 === true || is_sysadmin === true || is_CLUB_MANAGER === true"
filterable filterable
placeholder="所属工会" placeholder="所属工会"
style="width: 100%" style="width: 100%"
@@ -170,7 +170,7 @@
</el-col> </el-col>
</el-row> </el-row>
<template v-if="is_A06 === true || is_sysadmin === true"> <template v-if="is_A06 === true || is_sysadmin === true || is_CLUB_MANAGER === true">
<!--<el-row class="query-row"> <!--<el-row class="query-row">
<el-col class="query-title">活动部门:</el-col> <el-col class="query-title">活动部门:</el-col>
<el-col class="query-content"> <el-col class="query-content">
@@ -228,12 +228,12 @@
</template> </template>
<el-row class="query-row" <el-row class="query-row"
v-if="is_A06===true||is_sysadmin===true||is_H02===true||is_CLUB_PRESIDENT===true"> v-if="is_A06===true||is_sysadmin===true||is_H02===true||is_CLUB_MANAGER===true">
<el-col class="query-title">协会:</el-col> <el-col class="query-title">协会:</el-col>
<el-col class="query-content"> <el-col class="query-content">
<el-select v-model="pageForm.clubId" placeholder="请选择协会" @change="doSearch" <el-select v-model="pageForm.clubId" placeholder="请选择协会" @change="doSearch"
filterable filterable
:clearable="is_A06===true||is_sysadmin===true||is_CLUB_PRESIDENT===true||(is_H04===true&&is_H02===true)" :clearable="is_A06===true||is_sysadmin===true||is_CLUB_MANAGER===true||(is_H04===true&&is_H02===true)"
style="width: 100%"> style="width: 100%">
<el-option <el-option
v-for="item in clubOptions" v-for="item in clubOptions"
@@ -265,7 +265,7 @@
</el-col> </el-col>
</el-row> </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="is_A06 === true || is_sysadmin === true || is_H04 === true || is_CLUB_MANAGER === true">
<el-col class="query-title">年龄范围:</el-col> <el-col class="query-title">年龄范围:</el-col>
<el-col class="query-content"> <el-col class="query-content">
<el-row type="flex" style="align-items: center"> <el-row type="flex" style="align-items: center">
@@ -317,7 +317,7 @@
align="center" align="center"
header-align="center" header-align="center"
show-overflow-tooltip show-overflow-tooltip
v-for="column in tableColumns" v-for="column in visibleTableColumns"
></el-table-column> ></el-table-column>
</el-table> </el-table>
<el-row class="el-pagination-container"> <el-row class="el-pagination-container">
@@ -470,6 +470,9 @@ module.exports = {
} }
}, },
computed: { computed: {
visibleTableColumns() {
return this.tableColumns.filter(column => column.prop !== "mobile" || this.is_CLUB_MANAGER !== true)
},
is_H10() { is_H10() {
return this.roleData.is_H10 return this.roleData.is_H10
}, },
@@ -482,8 +485,8 @@ module.exports = {
is_H02() { is_H02() {
return this.roleData.is_H02 return this.roleData.is_H02
}, },
is_CLUB_PRESIDENT() { is_CLUB_MANAGER() {
return this.roleData.is_CLUB_PRESIDENT return this.roleData.is_CLUB_MANAGER
}, },
is_sysadmin() { is_sysadmin() {
return this.roleData.is_sysadmin return this.roleData.is_sysadmin
@@ -564,7 +567,7 @@ module.exports = {
}, },
async flushUnits() { async flushUnits() {
this.$set(this.pageForm, "unitId", "") this.$set(this.pageForm, "unitId", "")
if (this.is_sysadmin || this.is_A06) { if (this.is_sysadmin || this.is_A06 || this.is_CLUB_MANAGER) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId) this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
// this.activityUnits = await getActivityUnits(this.pageForm.activityUnionId) // this.activityUnits = await getActivityUnits(this.pageForm.activityUnionId)
} else { } else {
@@ -664,25 +667,22 @@ module.exports = {
async created() { async created() {
this.listSession() this.listSession()
await this.getRolesAndUnion() await this.getRolesAndUnion()
if (this.is_CLUB_PRESIDENT === true && (this.is_sysadmin || this.is_A06 || this.is_H02) === false) { if (this.is_CLUB_MANAGER === true) {
this.clubOptions = await this.$businessTool.listManageClubByRole() this.clubOptions = await this.$businessTool.listClub()
} else { } else {
this.clubOptions = await this.$businessTool.listCLubByRole() this.clubOptions = await this.$businessTool.listCLubByRole()
} }
if ((this.is_sysadmin || this.is_A06 || this.is_H02 || this.is_CLUB_PRESIDENT) === false && this.is_H04 === true) { if ((this.is_sysadmin || this.is_A06 || this.is_H02 || this.is_CLUB_MANAGER) === false && this.is_H04 === true) {
this.unions = await this.$businessTool.listUnion(this.unionid) this.unions = await this.$businessTool.listUnion(this.unionid)
this.$set(this.pageForm, "unionId", this.unions[0].id) this.$set(this.pageForm, "unionId", this.unions[0].id)
} else { } else {
this.unions = await this.$businessTool.listUnion() this.unions = await this.$businessTool.listUnion()
} }
if (this.is_H04 === false && this.is_H02 === true) { if (this.is_H04 === false && this.is_H02 === true && this.is_CLUB_MANAGER !== true) {
if (this.clubOptions.length > 0) { if (this.clubOptions.length > 0) {
this.$set(this.pageForm, "clubId", this.clubOptions[0].id) 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.flushUnits()
await this.getActivityGroup() await this.getActivityGroup()
this.personTypeOptions = await this.$businessTool.getDictOptions("USER_PERSON_TYPE") this.personTypeOptions = await this.$businessTool.getDictOptions("USER_PERSON_TYPE")
@@ -403,7 +403,7 @@ layout("/layouts/platform.html"){
} }
}) })
} }
if (this.$auth.hasRoleOr(["CLUB_PRESIDENT"])) { if (this.$auth.hasRoleOr(["CLUB_MANAGER"])) {
this.activityDeclareReimbursementList.map(v => { this.activityDeclareReimbursementList.map(v => {
if (["CLUB"].includes(v.name)) { if (["CLUB"].includes(v.name)) {
activityDeclareReimbursementList.push(v) activityDeclareReimbursementList.push(v)
@@ -40,7 +40,7 @@ layout("/layouts/platform.html"){
</search-item> </search-item>
</template> </template>
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, CLUB_MANAGER, CLUB_PRESIDENT')"> <template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, CLUB_MANAGER')">
<search-item label="所属协会"> <search-item label="所属协会">
<el-select clearable filterable placeholder="所属协会" <el-select clearable filterable placeholder="所属协会"
style="width: 100%;" v-model="pageForm.clubId"> style="width: 100%;" v-model="pageForm.clubId">
@@ -206,7 +206,7 @@ layout("/layouts/platform.html"){
this.unions = await this.$businessTool.listUnion() this.unions = await this.$businessTool.listUnion()
this.clubs = await this.$businessTool.listClub() this.clubs = await this.$businessTool.listClub()
} else { } else {
if (this.$auth.hasRoleOr('CLUB_MANAGER, CLUB_PRESIDENT')) { if (this.$auth.hasRoleOr('CLUB_MANAGER')) {
this.clubs = await this.$businessTool.listClub() this.clubs = await this.$businessTool.listClub()
} }
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id) this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
@@ -379,7 +379,7 @@ layout("/layouts/platform.html"){
hasClubRole() { hasClubRole() {
return this.$auth.hasRoleOr([ return this.$auth.hasRoleOr([
"CLUB_REIMBURSEMENT_MANAGER", "CLUB_REIMBURSEMENT_MANAGER",
"CLUB_PRESIDENT" "CLUB_MANAGER"
]); ]);
}, },
@@ -606,7 +606,7 @@ layout("/layouts/platform.html"){
budgetTypeCloseOption.push(typeTwoOption) budgetTypeCloseOption.push(typeTwoOption)
} }
} }
if (this.$auth.hasRoleOr(["CLUB_REIMBURSEMENT_MANAGER", "CLUB_PRESIDENT"])) { if (this.$auth.hasRoleOr(["CLUB_REIMBURSEMENT_MANAGER", "CLUB_MANAGER"])) {
const typeThreeOption = resp.find(v => v.code === "ACTIVITY_BUDGET_TYPE_THREE") const typeThreeOption = resp.find(v => v.code === "ACTIVITY_BUDGET_TYPE_THREE")
if (typeThreeOption && !budgetTypeCloseOption.some(existing => existing.code === "ACTIVITY_BUDGET_TYPE_THREE")) { if (typeThreeOption && !budgetTypeCloseOption.some(existing => existing.code === "ACTIVITY_BUDGET_TYPE_THREE")) {
budgetTypeCloseOption.push(typeThreeOption) budgetTypeCloseOption.push(typeThreeOption)
@@ -41,7 +41,7 @@ layout("/layouts/platform.html"){
</search-item> </search-item>
</template> </template>
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, CLUB_MANAGER, CLUB_PRESIDENT')"> <template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, CLUB_MANAGER')">
<search-item label="所属协会"> <search-item label="所属协会">
<el-select clearable filterable placeholder="所属协会" <el-select clearable filterable placeholder="所属协会"
style="width: 100%;" v-model="pageForm.clubId"> style="width: 100%;" v-model="pageForm.clubId">
@@ -217,7 +217,7 @@ layout("/layouts/platform.html"){
this.unions = await this.$businessTool.listUnion() this.unions = await this.$businessTool.listUnion()
this.clubs = await this.$businessTool.listClub() this.clubs = await this.$businessTool.listClub()
} else { } else {
if (this.$auth.hasRoleOr('CLUB_MANAGER, CLUB_PRESIDENT')) { if (this.$auth.hasRoleOr('CLUB_MANAGER')) {
this.clubs = await this.$businessTool.listClub() this.clubs = await this.$businessTool.listClub()
} }
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id) this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
@@ -7,7 +7,7 @@ const basicForm = {
style="width: 100%"> style="width: 100%">
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('SCHOOL_UNION_ADMIN')" label="校工会" value="40001"></el-option> <el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('SCHOOL_UNION_ADMIN')" label="校工会" value="40001"></el-option>
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('BRANCH_UNION_CHAIRMAN')" label="分工会" value="40002"></el-option> <el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('BRANCH_UNION_CHAIRMAN')" label="分工会" value="40002"></el-option>
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_PRESIDENT')" label="协会/社团" value="40003"></el-option> <el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_MANAGER')" label="协会/社团" value="40003"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -41,7 +41,7 @@ layout("/layouts/platform.html"){
</el-option> </el-option>
</el-select> </el-select>
</search-item> </search-item>
<search-item v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_PRESIDENT')" label="协会/社团:"> <search-item v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_MANAGER')" label="协会/社团:">
<el-select v-model="pageForm.tissueIdByClub" placeholder="请选择所属协会/社团" filterable clearable <el-select v-model="pageForm.tissueIdByClub" placeholder="请选择所属协会/社团" filterable clearable
@change="doSearch" style="width: 100%"> @change="doSearch" style="width: 100%">
<el-option <el-option
@@ -11,7 +11,7 @@ const basicForm = {
style="width: 100%"> style="width: 100%">
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('SCHOOL_UNION_ADMIN')" label="校工会" value="40001"></el-option> <el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('SCHOOL_UNION_ADMIN')" label="校工会" value="40001"></el-option>
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('BRANCH_UNION_CHAIRMAN')" label="分工会" value="40002"></el-option> <el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('BRANCH_UNION_CHAIRMAN')" label="分工会" value="40002"></el-option>
<el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_PRESIDENT')" label="协会/社团" value="40003"></el-option> <el-option v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_MANAGER')" label="协会/社团" value="40003"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="formData.summaryFrom === '40002'" prop="tissueId" label="所属工会"> <el-form-item v-if="formData.summaryFrom === '40002'" prop="tissueId" label="所属工会">
@@ -38,7 +38,7 @@ layout("/layouts/platform.html"){
</el-option> </el-option>
</el-select> </el-select>
</search-item> </search-item>
<search-item v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_PRESIDENT')" label="协会/社团:"> <search-item v-if="$auth.hasRole('SYSADMIN') || $auth.hasRole('CLUB_MANAGER')" label="协会/社团:">
<el-select v-model="pageForm.tissueIdByClub" placeholder="请选择所属协会/社团" filterable clearable <el-select v-model="pageForm.tissueIdByClub" placeholder="请选择所属协会/社团" filterable clearable
@change="doSearch" style="width: 100%"> @change="doSearch" style="width: 100%">
<el-option <el-option
@@ -103,7 +103,7 @@ layout("/layouts/platform.html"){
<template #edit> <template #edit>
<add-activity <add-activity
:is_a06="$auth.hasRole('SCHOOL_UNION_ADMIN')" :is_a06="$auth.hasRole('SCHOOL_UNION_ADMIN')"
:is_club="$auth.hasRole('CLUB_PRESIDENT')" :is_club="$auth.hasRole('CLUB_MANAGER')"
:is_sysadmin="$auth.hasRole('SYSADMIN')" :is_sysadmin="$auth.hasRole('SYSADMIN')"
:unionid="user.union.id" :unionid="user.union.id"
@flip="flip" @flip="flip"
@@ -1,14 +1,13 @@
const CLUB_ROLE_CONSTANT = { const CLUB_ROLE_CONSTANT = {
CLUB_MEMBER: "CLUB_MEMBER", CLUB_MEMBER: "CLUB_MEMBER",
CLUB_MANAGER: "CLUB_MANAGER", CLUB_MANAGER: "CLUB_MANAGER",
CLUB_PRESIDENT: "CLUB_PRESIDENT",
CLUB_VICE_PRESIDENT: "CLUB_VICE_PRESIDENT", CLUB_VICE_PRESIDENT: "CLUB_VICE_PRESIDENT",
CLUB_SECRETARY: "CLUB_SECRETARY", CLUB_SECRETARY: "CLUB_SECRETARY",
CLUB_VICE_SECRETARY: "CLUB_VICE_SECRETARY", CLUB_VICE_SECRETARY: "CLUB_VICE_SECRETARY",
getRoleName(roleCode) { getRoleName(roleCode) {
switch (roleCode) { switch (roleCode) {
case this.CLUB_PRESIDENT: case this.CLUB_MANAGER:
return "会长" return "协会负责人"
case this.CLUB_VICE_PRESIDENT: case this.CLUB_VICE_PRESIDENT:
return "副会长" return "副会长"
case this.CLUB_SECRETARY: case this.CLUB_SECRETARY:
@@ -83,7 +83,7 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
<el-form-item label="身份" prop="nowRoleCode"> <el-form-item label="身份" prop="nowRoleCode">
<el-checkbox-group v-model="formData.nowRoleCode"> <el-checkbox-group v-model="formData.nowRoleCode">
<el-checkbox label="CLUB_PRESIDENT">协会会长</el-checkbox> <el-checkbox label="CLUB_MANAGER">协会负责人</el-checkbox>
<el-checkbox label="CLUB_VICE_PRESIDENT">协会副会长</el-checkbox> <el-checkbox label="CLUB_VICE_PRESIDENT">协会副会长</el-checkbox>
<el-checkbox label="CLUB_SECRETARY">协会秘书长</el-checkbox> <el-checkbox label="CLUB_SECRETARY">协会秘书长</el-checkbox>
<el-checkbox label="CLUB_VICE_SECRETARY">协会副秘书长</el-checkbox> <el-checkbox label="CLUB_VICE_SECRETARY">协会副秘书长</el-checkbox>
@@ -91,10 +91,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
</el-form-item> </el-form-item>
<el-form-item label="身份" prop="roleCode"> <el-form-item label="身份" prop="roleCode">
<el-radio-group v-model="formData.roleCode" size="medium"> <el-radio-group v-model="formData.roleCode" size="medium">
<el-radio v-if="!addMember" border label="CLUB_PRESIDENT">会长</el-radio> <el-radio v-if="!addMember" border label="CLUB_MANAGER">协会负责人</el-radio>
<el-radio v-if="!addMember" border label="CLUB_VICE_PRESIDENT">副会长</el-radio>
<el-radio v-if="!addMember" border label="CLUB_SECRETARY">秘书长</el-radio>
<el-radio v-if="!addMember" border label="CLUB_VICE_SECRETARY">副秘书长</el-radio>
<el-radio v-if="addMember" border label="CLUB_MEMBER">会员</el-radio> <el-radio v-if="addMember" border label="CLUB_MEMBER">会员</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@@ -127,13 +124,10 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
</el-form-item> </el-form-item>
<el-form-item prop="roleCode" label="身份"> <el-form-item prop="roleCode" label="身份">
<el-checkbox-group v-model="roleCodeFormData.roleCode"> <el-checkbox-group v-model="roleCodeFormData.roleCode">
<el-checkbox label="CLUB_PRESIDENT">协会会长</el-checkbox>
<el-checkbox label="CLUB_VICE_PRESIDENT">协会副会长</el-checkbox>
<el-checkbox label="CLUB_SECRETARY">协会秘书长</el-checkbox>
<el-checkbox label="CLUB_VICE_SECRETARY">协会副秘书长</el-checkbox>
<el-checkbox label="CLUB_OPERATOR">协会操作员</el-checkbox> <el-checkbox label="CLUB_OPERATOR">协会操作员</el-checkbox>
<el-checkbox label="CLUB_REIMBURSEMENT_MANAGER">协会报销负责人</el-checkbox> <el-checkbox label="CLUB_REIMBURSEMENT_MANAGER">协会报销负责人</el-checkbox>
<el-checkbox label="CLUB_MEMBER">协会会员</el-checkbox> <el-checkbox label="CLUB_MEMBER">协会会员</el-checkbox>
<el-checkbox label="CLUB_MANAGER">协会负责人</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -204,13 +198,6 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
async userDoAdd() { async userDoAdd() {
const valid = await this.$refs.userForm.validate() const valid = await this.$refs.userForm.validate()
if (!valid) return if (!valid) return
if (this.formData.roleCode === "CLUB_PRESIDENT" || this.formData.roleCode === "CLUB_SECRETARY") {
const str = this.formData.roleCode === "CLUB_PRESIDENT" ? "会长" : "秘书长"
if (this.formData.users.length > 1) {
this.$message.warning(str + "只能有一位")
return
}
}
const resp = await this.$axios.post("/platform/club/infoManage/manage/userDoAdd", { const resp = await this.$axios.post("/platform/club/infoManage/manage/userDoAdd", {
clubId: this.parentNode.currentTreeData.id, clubId: this.parentNode.currentTreeData.id,
users: JSON.stringify(this.formData.users), users: JSON.stringify(this.formData.users),
@@ -228,7 +215,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
openUserAdd(flag) { openUserAdd(flag) {
this.userOptions = [] this.userOptions = []
this.addMember = flag this.addMember = flag
this.$set(this.formData, "roleCode", flag ? "CLUB_MEMBER" : "CLUB_PRESIDENT") this.$set(this.formData, "roleCode", flag ? "CLUB_MEMBER" : "CLUB_MANAGER")
this.$set(this.formData, "users", []) this.$set(this.formData, "users", [])
this.$set(this.formData, "payed", false) this.$set(this.formData, "payed", false)
this.addDialogVisible = true this.addDialogVisible = true
@@ -266,6 +253,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
}, },
updateRoleCode(row) { updateRoleCode(row) {
this.roleCodeFormData = clone(row) this.roleCodeFormData = clone(row)
this.roleCodeFormData.roleCode = (this.roleCodeFormData.roleCode || []).filter(code => code === "CLUB_MANAGER")
this.roleCodeDialogVisible = true this.roleCodeDialogVisible = true
}, },
onRoleCode() { onRoleCode() {
@@ -29,7 +29,7 @@ const SCHOOL_CLUB_MANAGE_TEMPLATE = {
<el-table-column :index="indexMethod" label="序号" type="index" width="70"></el-table-column> <el-table-column :index="indexMethod" label="序号" type="index" width="70"></el-table-column>
<el-table-column label="协会编码" sortable prop="clubCode"></el-table-column> <el-table-column label="协会编码" sortable prop="clubCode"></el-table-column>
<el-table-column label="协会名称" prop="clubName" sortable></el-table-column> <el-table-column label="协会名称" prop="clubName" sortable></el-table-column>
<el-table-column label="会长" prop="clubLeader" show-overflow-tooltip></el-table-column> <el-table-column label="协会负责人" prop="clubLeader" show-overflow-tooltip></el-table-column>
<el-table-column label="秘书长" prop="clubSecretary" show-overflow-tooltip></el-table-column> <el-table-column label="秘书长" prop="clubSecretary" show-overflow-tooltip></el-table-column>
<el-table-column label="当前人数" show-overflow-tooltip prop="currentNum"></el-table-column> <el-table-column label="当前人数" show-overflow-tooltip prop="currentNum"></el-table-column>
<el-table-column label="成立时间" show-overflow-tooltip prop="foundTime"></el-table-column> <el-table-column label="成立时间" show-overflow-tooltip prop="foundTime"></el-table-column>
@@ -43,7 +43,7 @@ layout("/layouts/platform.html"){
<el-table-column label="协会编码" sortable prop="clubCode"></el-table-column> <el-table-column label="协会编码" sortable prop="clubCode"></el-table-column>
<el-table-column label="协会名称" prop="clubName" show-overflow-tooltip width="200px"></el-table-column> <el-table-column label="协会名称" prop="clubName" show-overflow-tooltip width="200px"></el-table-column>
<el-table-column label="成立时间" prop="foundTime"></el-table-column> <el-table-column label="成立时间" prop="foundTime"></el-table-column>
<el-table-column label="会长" prop="clubLeader" show-overflow-tooltip></el-table-column> <el-table-column label="协会负责人" prop="clubLeader" show-overflow-tooltip></el-table-column>
<el-table-column label="秘书长" prop="clubSecretary" show-overflow-tooltip></el-table-column> <el-table-column label="秘书长" prop="clubSecretary" show-overflow-tooltip></el-table-column>
<el-table-column sortable label="当前人数" show-overflow-tooltip prop="currentPeopleNum"></el-table-column> <el-table-column sortable label="当前人数" show-overflow-tooltip prop="currentPeopleNum"></el-table-column>
<el-table-column label="操作" width="250px"> <el-table-column label="操作" width="250px">
@@ -39,7 +39,7 @@ layout("/layouts/platform.html"){
<el-table-column label="协会名称" prop="clubName" show-overflow-tooltip <el-table-column label="协会名称" prop="clubName" show-overflow-tooltip
width="200px"></el-table-column> width="200px"></el-table-column>
<el-table-column label="成立时间" prop="foundTime"></el-table-column> <el-table-column label="成立时间" prop="foundTime"></el-table-column>
<el-table-column label="会长" prop="clubLeader" show-overflow-tooltip></el-table-column> <el-table-column label="协会负责人" prop="clubLeader" show-overflow-tooltip></el-table-column>
<el-table-column label="秘书长" prop="clubSecretary" show-overflow-tooltip></el-table-column> <el-table-column label="秘书长" prop="clubSecretary" show-overflow-tooltip></el-table-column>
<el-table-column sortable label="当前人数" show-overflow-tooltip <el-table-column sortable label="当前人数" show-overflow-tooltip
prop="currentPeopleNum"></el-table-column> prop="currentPeopleNum"></el-table-column>
@@ -4,7 +4,7 @@ const CLUB_MANAGER_TEMPLATE = {
<el-table-column label="是否必填" prop="roleCode" width="130px"> <el-table-column label="是否必填" prop="roleCode" width="130px">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="text-danger" <span class="text-danger"
v-if="scope.row.roleCode === 'CLUB_PRESIDENT' v-if="scope.row.roleCode === 'CLUB_MANAGER'
|| scope.row.roleCode === 'CLUB_SECRETARY'">必填</span> || scope.row.roleCode === 'CLUB_SECRETARY'">必填</span>
<span v-else>非必填</span> <span v-else>非必填</span>
</template> </template>
@@ -58,7 +58,7 @@ const CLUB_MANAGER_TEMPLATE = {
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
:disabled="scope.row.roleCode === 'CLUB_PRESIDENT'" :disabled="scope.row.roleCode === 'CLUB_MANAGER'"
@click="deleteRow(scope.row, scope.$index)" @click="deleteRow(scope.row, scope.$index)"
size="mini" type="danger">删除 size="mini" type="danger">删除
</el-button> </el-button>
@@ -70,13 +70,13 @@ const CLUB_MANAGER_TEMPLATE = {
return { return {
deleteIds: [], deleteIds: [],
managePerson: [ managePerson: [
{ roleCode: "CLUB_PRESIDENT" }, { roleCode: "CLUB_MANAGER" },
{ roleCode: "CLUB_VICE_PRESIDENT" }, { roleCode: "CLUB_VICE_PRESIDENT" },
{ roleCode: "CLUB_SECRETARY" }, { roleCode: "CLUB_SECRETARY" },
{ roleCode: "CLUB_VICE_SECRETARY" } { roleCode: "CLUB_VICE_SECRETARY" }
], ],
roleList: [ roleList: [
{ id: "CLUB_PRESIDENT", name: "会长" }, { id: "CLUB_MANAGER", name: "协会负责人" },
{ id: "CLUB_VICE_PRESIDENT", name: "副会长" }, { id: "CLUB_VICE_PRESIDENT", name: "副会长" },
{ id: "CLUB_SECRETARY", name: "秘书长" }, { id: "CLUB_SECRETARY", name: "秘书长" },
{ id: "CLUB_VICE_SECRETARY", name: "副秘书长" } { id: "CLUB_VICE_SECRETARY", name: "副秘书长" }
@@ -101,9 +101,9 @@ layout("/layouts/platform.html"){
async doHandle(type) { async doHandle(type) {
let formData = {} let formData = {}
try { try {
/*let hz = this.$refs.clubManagerRef.managePerson.filter((o) => o.roleCode === CLUB_ROLE_CONSTANT.CLUB_PRESIDENT) /*let hz = this.$refs.clubManagerRef.managePerson.filter((o) => o.roleCode === CLUB_ROLE_CONSTANT.CLUB_MANAGER)
if (hz.length !== 1) { if (hz.length !== 1) {
this.$message.warning({ title: "警告", message: "会长需要1人" }) this.$message.warning({ title: "警告", message: "协会负责人需要1人" })
return return
} }
let msz = this.$refs.clubManagerRef.managePerson.filter((o) => o.roleCode === CLUB_ROLE_CONSTANT.CLUB_SECRETARY) let msz = this.$refs.clubManagerRef.managePerson.filter((o) => o.roleCode === CLUB_ROLE_CONSTANT.CLUB_SECRETARY)
@@ -266,7 +266,7 @@ layout("/layouts/platform.html"){
} }
}) })
} }
if (this.$auth.hasRoleOr(['CLUB_PRESIDENT'])) { if (this.$auth.hasRoleOr(['CLUB_MANAGER'])) {
data.map(v => { data.map(v => {
if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) { if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) {
budgetTypeOption.push(v) budgetTypeOption.push(v)
@@ -322,7 +322,7 @@ layout("/layouts/platform.html"){
} }
}) })
} }
if (this.$auth.hasRoleOr(["CLUB_MANAGER", "CLUB_PRESIDENT"])) { if (this.$auth.hasRoleOr(["CLUB_MANAGER"])) {
this.budgetTypeOption.map(v => { this.budgetTypeOption.map(v => {
if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) { if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) {
budgetTypeOption.push(v) budgetTypeOption.push(v)
@@ -521,7 +521,7 @@ layout("/layouts/platform.html"){
} }
}) })
} }
if (this.$auth.hasRoleOr(["CLUB_MANAGER", "CLUB_PRESIDENT"])) { if (this.$auth.hasRoleOr(["CLUB_MANAGER"])) {
this.budgetTypeOption.map(v => { this.budgetTypeOption.map(v => {
if (["UNION_REIMBURSE_FUND_SOURCE_3"].includes(v.code)) { if (["UNION_REIMBURSE_FUND_SOURCE_3"].includes(v.code)) {
budgetTypeOption.push(v) budgetTypeOption.push(v)
@@ -406,7 +406,7 @@ layout("/layouts/platform_h5.html"){
} }
}) })
} }
if (this.$auth.hasRoleOr(["CLUB_MANAGER", "CLUB_PRESIDENT"])) { if (this.$auth.hasRoleOr(["CLUB_MANAGER"])) {
this.budgetTypeOption.map(v => { this.budgetTypeOption.map(v => {
if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) { if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) {
budgetTypeOption.push(v) budgetTypeOption.push(v)
@@ -935,7 +935,7 @@ layout("/layouts/platform_h5.html"){
}); });
} }
if (this.$auth.hasRoleOr(["CLUB_MANAGER", "CLUB_PRESIDENT"])) { if (this.$auth.hasRoleOr(["CLUB_MANAGER"])) {
this.reimburseFundSourceColumns.map(item => { this.reimburseFundSourceColumns.map(item => {
if (item.value === "UNION_REIMBURSE_FUND_SOURCE_3") { if (item.value === "UNION_REIMBURSE_FUND_SOURCE_3") {
filteredSources.push(item); filteredSources.push(item);