diff --git a/src/main/java/com/budwk/app/zhgh/club/controller/apply/ClubUserJoinApplyController.java b/src/main/java/com/budwk/app/zhgh/club/controller/apply/ClubUserJoinApplyController.java index 0b72999..aa60855 100644 --- a/src/main/java/com/budwk/app/zhgh/club/controller/apply/ClubUserJoinApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/club/controller/apply/ClubUserJoinApplyController.java @@ -104,10 +104,13 @@ public class ClubUserJoinApplyController { return Result.error("您已经是该协会成员,无需重复申请!"); } - //查询协会操作员 + //查询协会操作员、会长、秘书长、副会长 String operatorLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_OPERATOR, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId())); String presidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_PRESIDENT, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId())); - if (StrUtil.isAllBlank(operatorLoginName, presidentLoginName)) { + String secretaryLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_SECRETARY, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId())); + String vicePresidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_VICE_PRESIDENT, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId())); + + if (StrUtil.isAllBlank(operatorLoginName, presidentLoginName, secretaryLoginName, vicePresidentLoginName)) { return Result.error("该协会未配置审批人,请联系校工会!"); } @@ -118,15 +121,31 @@ public class ClubUserJoinApplyController { Sys_user applyUser = dao.fetch(Sys_user.class, clubUserApply.getUserId()); + List assignments = new ArrayList<>(); if (StrUtil.isNotBlank(operatorLoginName)) { - bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(operatorLoginName), null); - // 发送消息 -// sysMsgService.sendMsg(operatorLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId()); - }else{ - bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(presidentLoginName), null); - // 发送消息 -// sysMsgService.sendMsg(presidentLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId()); + assignments.add(operatorLoginName); } + if (StrUtil.isNotBlank(secretaryLoginName)) { + assignments.add(secretaryLoginName); + } + if (StrUtil.isNotBlank(vicePresidentLoginName)) { + assignments.add(vicePresidentLoginName); + } + if (StrUtil.isNotBlank(presidentLoginName)) { + assignments.add(presidentLoginName); + } + + bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), assignments, null); + +// if (StrUtil.isNotBlank(operatorLoginName)) { +// bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(operatorLoginName), null); +// // 发送消息 +//// sysMsgService.sendMsg(operatorLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId()); +// }else{ +// bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(presidentLoginName), null); +// // 发送消息 +//// sysMsgService.sendMsg(presidentLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId()); +// } return Result.success(); } diff --git a/src/main/java/com/budwk/app/zhgh/club/controller/apply/ClubUserJoinApprovalController.java b/src/main/java/com/budwk/app/zhgh/club/controller/apply/ClubUserJoinApprovalController.java index f83f343..42bc1c7 100644 --- a/src/main/java/com/budwk/app/zhgh/club/controller/apply/ClubUserJoinApprovalController.java +++ b/src/main/java/com/budwk/app/zhgh/club/controller/apply/ClubUserJoinApprovalController.java @@ -107,6 +107,7 @@ public class ClubUserJoinApprovalController { cnd.and(Cnd.likeEX("u.loginName", pageForm.getLoginName())); cnd.andEX("u.unionId","=",pageForm.getUnionId()); cnd.andEX("u.unitId","=",pageForm.getUnitId()); + cnd.andEX("info.clubId","=",pageForm.getClubId()); sql.setCondition(cnd); Pagination pageVO = clubUserJoinService.listPageVO(pageForm, sql, ClubUserJoinPageVo.class); diff --git a/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubInfoManageController.java b/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubInfoManageController.java index 18178b2..aa271a0 100644 --- a/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubInfoManageController.java +++ b/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubInfoManageController.java @@ -335,22 +335,24 @@ public class ClubInfoManageController { @SaCheckPermission("club.infoManage.manage") @ApiOperation("授权") public Result doAuthRole(@Valid String id, @Valid String clubId, @Param("roleCode") @Valid String[] roleCodes) { - List roleCodeList = Arrays.asList(roleCodes); - //查询社团是否存在会长或者秘书长 - if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_PRESIDENT.name())) { - int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId) - .and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_PRESIDENT.name())))); - if (count > 0) { - return Result.error("会长只能有一位"); - } - } - if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_SECRETARY.name())) { - int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId) - .and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_SECRETARY.name())))); - if (count > 0) { - return Result.error("秘书长只能有一位"); - } - } + List roleCodeList = Arrays.asList(roleCodes); + //查询社团是否存在会长或者秘书长 + if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_PRESIDENT.name())) { + int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId) + .and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_PRESIDENT.name()))) + .and("id", "!=", id)); + if (count > 0) { + return Result.error("会长只能有一位"); + } + } + if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_SECRETARY.name())) { + int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId) + .and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_SECRETARY.name()))) + .and("id", "!=", id)); + if (count > 0) { + return Result.error("秘书长只能有一位"); + } + } ClubUser clubUser = clubInfoManageService.dao().fetch(ClubUser.class, id); diff --git a/src/main/java/com/budwk/app/zhgh/club/param/ClubUserJoinPageForm.java b/src/main/java/com/budwk/app/zhgh/club/param/ClubUserJoinPageForm.java index 1fab84f..ddedb8c 100644 --- a/src/main/java/com/budwk/app/zhgh/club/param/ClubUserJoinPageForm.java +++ b/src/main/java/com/budwk/app/zhgh/club/param/ClubUserJoinPageForm.java @@ -13,5 +13,6 @@ public class ClubUserJoinPageForm extends PageForm { private String userName; private String unionId; private String unitId; + private String clubId; } diff --git a/src/main/resources/views/platform/zhgh/club/join/clubApproval/index.html b/src/main/resources/views/platform/zhgh/club/join/clubApproval/index.html index ec79490..73d84fc 100644 --- a/src/main/resources/views/platform/zhgh/club/join/clubApproval/index.html +++ b/src/main/resources/views/platform/zhgh/club/join/clubApproval/index.html @@ -31,6 +31,11 @@ layout("/layouts/platform.html"){ + + + + + @@ -121,6 +126,7 @@ layout("/layouts/platform.html"){ }, unionList: [], unitList: [], + clubList: [], showApprovalForm: false } }, @@ -174,6 +180,7 @@ layout("/layouts/platform.html"){ async created() { this.unitList = await this.$businessTool.listUnit() this.unionList = await this.$businessTool.listUnion() + this.clubList = await this.$businessTool.listClub() this.pageData() } })