From 36ed3f15383c62c23c80ef8b328da6cf2963326a Mon Sep 17 00:00:00 2001 From: "@jyuhsin" <729757837@qq.com> Date: Sat, 20 Sep 2025 15:12:35 +0800 Subject: [PATCH] commit --- .../manage/FamilyActivityApplyController.java | 6 +- .../infoManage/ClubInfoManageController.java | 71 ++++++++++--------- .../zhgh/activity/family/apply/index.html | 14 ++-- .../platform/zhgh/club/common/clubUserJoin.js | 2 +- .../club/infoManage/manage/clubInfoManage.js | 1 + .../platform/zhgh/club/join/apply/index.html | 1 + .../dayofficework/honor/manage/index.html | 2 +- .../zhghh5/activity/family/apply/index.html | 45 ++++++++---- .../platform/zhghh5/club/apply/index.html | 2 + 9 files changed, 86 insertions(+), 58 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java b/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java index a526da6..7849fda 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java @@ -87,12 +87,10 @@ public class FamilyActivityApplyController { cnd.andEX("`year`", "=", year); //查询报名中 if (activityType == 2) { - cnd.and(new Static("now() > activitySignUpStartTime and now() < activitySignUpEndTime")); + cnd.and(new Static("now() < activitySignUpEndTime")); }//查询已结束的 else if (activityType == 3) { - cnd.and(new Static("now() > activityEndTime")); - } else if (activityType == 4) { - cnd.and(new Static("now() < activitySignUpStartTime")); + cnd.and(new Static("now() >= activityEndTime")); } if (AuthUtil.hasRole("H04") && !AuthUtil.hasRoleOr("sysadmin, A06")) { 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 aa22680..18178b2 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 @@ -334,44 +334,45 @@ public class ClubInfoManageController { @At @SaCheckPermission("club.infoManage.manage") @ApiOperation("授权") - public Result doAuthRole(@Valid String userId, @Valid String clubId, @Param("roleCode") @Valid String[] roleCode) { - // 删除原来的身份 - List roleCodes = List.of(RoleConstant.CLUB_PRESIDENT.name(), - RoleConstant.CLUB_VICE_PRESIDENT.name(), - RoleConstant.CLUB_SECRETARY.name(), - RoleConstant.CLUB_VICE_SECRETARY.name(), - RoleConstant.CLUB_OPERATOR.name(), - RoleConstant.CLUB_MEMBER.name()); - for (String code : roleCodes) { - String roleId = sysRoleService.getByCode(code).getId(); - dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", userId).and(Sys_user_role::getClubId, "=", clubId).and(Sys_user_role::getRoleId, "=", roleId)); - } - - // 新增身份 - ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubId).and(ClubUser::getUserId, "=", userId)); - List list = new ArrayList<>(Arrays.asList(roleCode)); - if(list.isEmpty()) { - list.add(RoleConstant.CLUB_MEMBER.name()); - } else { - list.remove(RoleConstant.CLUB_MEMBER.name()); + 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("秘书长只能有一位"); + } } - clubUser.setRoleCode(list); - dao.update(clubUser,"roleCode"); - // 新增权限 - for (String code : roleCode) { - Sys_role sysRole = sysRoleService.getByCode(code); - Sys_user_role userRole = new Sys_user_role(); - userRole.setUserId(userId); - userRole.setRoleId(sysRole.getId()); - userRole.setClubId(clubId); - dao.insert(userRole); - } + ClubUser clubUser = clubInfoManageService.dao().fetch(ClubUser.class, id); - sysUserService.clearCache(); - sysRoleService.clearCache(); - - return Result.success(); + // 先清除所有的角色 + dao.clear(Sys_user_role.class, Cnd.where("userId", "=", clubUser.getUserId()).and("clubId", "=", clubUser.getClubId())); + // 再根据传过来的赋值 + clubUser.setRoleCode(roleCodeList); + dao.update(clubUser); + // 设置角色 + List roles = new ArrayList<>(); + for (String s : roleCodeList) { + Sys_user_role ur = new Sys_user_role(); + ur.setUserId(clubUser.getUserId()); + ur.setClubId(clubUser.getClubId()); + Sys_role sRole = sysRoleService.getByCode(s); + ur.setRoleId(sRole.getId()); + roles.add(ur); + } + dao.insert(roles); + sysUserService.clearCache(); + sysRoleService.clearCache(); + return Result.success(); } /*===============================20250806新增授权 zhaoxinyu==========================================*/ diff --git a/src/main/resources/views/platform/zhgh/activity/family/apply/index.html b/src/main/resources/views/platform/zhgh/activity/family/apply/index.html index 80a4590..630c849 100644 --- a/src/main/resources/views/platform/zhgh/activity/family/apply/index.html +++ b/src/main/resources/views/platform/zhgh/activity/family/apply/index.html @@ -54,8 +54,7 @@ layout("/layouts/platform.html"){ - - + @@ -90,8 +89,13 @@ layout("/layouts/platform.html"){ @@ -143,7 +147,7 @@ layout("/layouts/platform.html"){ return { pageForm: { year: this.$moment().format("YYYY"), - activityType: 4 + activityType: 2 }, tableColumns: [ { label: "活动名称", prop: "activityName", width: 600}, diff --git a/src/main/resources/views/platform/zhgh/club/common/clubUserJoin.js b/src/main/resources/views/platform/zhgh/club/common/clubUserJoin.js index 86af583..729a0ba 100644 --- a/src/main/resources/views/platform/zhgh/club/common/clubUserJoin.js +++ b/src/main/resources/views/platform/zhgh/club/common/clubUserJoin.js @@ -18,7 +18,7 @@ const clubUserJoin = { {{viewData.sex}} - {{viewData.birthday}} + {{$moment(viewData.birthday).format('YYYY-MM-DD')}} {{viewData.mobile}} diff --git a/src/main/resources/views/platform/zhgh/club/infoManage/manage/clubInfoManage.js b/src/main/resources/views/platform/zhgh/club/infoManage/manage/clubInfoManage.js index df86aba..2001195 100644 --- a/src/main/resources/views/platform/zhgh/club/infoManage/manage/clubInfoManage.js +++ b/src/main/resources/views/platform/zhgh/club/infoManage/manage/clubInfoManage.js @@ -131,6 +131,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = { 协会秘书长 协会副秘书长 协会操作员 + 协会会员 diff --git a/src/main/resources/views/platform/zhgh/club/join/apply/index.html b/src/main/resources/views/platform/zhgh/club/join/apply/index.html index fff657f..6410b07 100644 --- a/src/main/resources/views/platform/zhgh/club/join/apply/index.html +++ b/src/main/resources/views/platform/zhgh/club/join/apply/index.html @@ -212,6 +212,7 @@ layout("/layouts/platform.html"){ this.$set(this.formData, "unionName", user.union ? user.union.name : null) this.$set(this.formData, "sex", user.sex) this.$set(this.formData, "birthday", "${@auth.getPrincipalProperty('birthday'),'yyyy-MM-dd'}") + this.$set(this.formData, "mobile", user.mobile) this.$set(this.formData, "nation", user.nation) this.$set(this.formData, "political", user.political) this.$set(this.formData, "education", user.education) diff --git a/src/main/resources/views/platform/zhgh/dayofficework/honor/manage/index.html b/src/main/resources/views/platform/zhgh/dayofficework/honor/manage/index.html index bcfdbe8..58dc8f9 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/honor/manage/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/honor/manage/index.html @@ -316,7 +316,7 @@ layout("/layouts/platform.html"){ if (this.honorTypeList && this.honorLevelList) { this.$set(this.pageForm, "honorType", this.honorTypeList[0].id) this.$set(this.pageForm, "queryTypeCode", this.honorTypeList[0].queryTypeCode) - this.honorPrizeList = await this.getHonorPrize(this.formData.honorType) + this.honorPrizeList = await this.getHonorPrize(this.pageForm.honorType) console.log(this.pageForm) } }, diff --git a/src/main/resources/views/platform/zhghh5/activity/family/apply/index.html b/src/main/resources/views/platform/zhghh5/activity/family/apply/index.html index 9675e36..6f4d76e 100644 --- a/src/main/resources/views/platform/zhghh5/activity/family/apply/index.html +++ b/src/main/resources/views/platform/zhghh5/activity/family/apply/index.html @@ -24,6 +24,11 @@ layout("/layouts/platform_h5.html"){ .van-count-down { color: #fff; } + .item-header .van-tag { + font-size: 12px; + padding: 3px 6px; + border-radius: 6px; + }
@@ -40,10 +45,25 @@ layout("/layouts/platform_h5.html"){ + @@ -105,12 +127,11 @@ layout("/layouts/platform_h5.html"){ totalCount: 0, searchKeyword: '', year: new Date().getFullYear(), - activityType: 4, + activityType: 2, }, typeOptions: [ {text: '全部', value: 1}, - {text: '即将开始', value: 4}, - {text: '报名中', value: 2}, + {text: '即将开始 & 报名中', value: 2}, {text: '已结束', value: 3}, ], infoVisible: false, diff --git a/src/main/resources/views/platform/zhghh5/club/apply/index.html b/src/main/resources/views/platform/zhghh5/club/apply/index.html index 0ba7a24..9e39ed4 100644 --- a/src/main/resources/views/platform/zhghh5/club/apply/index.html +++ b/src/main/resources/views/platform/zhghh5/club/apply/index.html @@ -261,6 +261,8 @@ layout("/layouts/platform_h5.html"){ this.formData.loginName = user.loginname; this.formData.unitName = user.unit ? user.unit.name : null; this.formData.unionName = user.union ? user.union.name : null; + this.formData.birthday = this.$moment(user.birthday).format('YYYY-MM-DD'); + this.formData.mobile = user.mobile; this.formData.sex = user.sex; this.formData.education = user.education; this.formData.technicalTitle = user.technicalTitle;