From b7996979a20ad1e3ed4810e3e2e170c0090cdcb2 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 17 Nov 2025 08:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A4=E5=A7=94=E5=A7=94=E5=91=98=E6=8E=A8?= =?UTF-8?q?=E9=80=89-=E4=BB=A3=E8=A1=A8=E5=9B=A2=E6=8E=A8=E9=80=89?= =?UTF-8?q?=E6=94=B9=E6=88=90=E5=88=86=E5=B7=A5=E4=BC=9A=E6=8E=A8=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/FellowshipApplyController.java | 11 ++ .../fellowship/models/FellowshipCourse.java | 6 ++ .../LeadThoughtApplyMineController.java | 1 - .../LeadThoughtQueryController.java | 2 + .../ExerciseCardMineController.java | 13 +-- .../ExecutiveCommitteeConfigController.java | 28 +++-- ...eCommitteeDelegationOnePushController.java | 80 +++++++------- ...eCommitteeDelegationTwoPushController.java | 50 +++++---- .../ExecutiveCommitteePushController.java | 1 + .../models/ExecutiveCommitteeConfig.java | 8 +- .../models/ExecutiveCommitteeOnePush.java | 5 + .../models/ExecutiveCommitteeTwoPush.java | 5 + .../ExecutiveCommitteeMemberServiceImpl.java | 1 - .../activity/fellowship/manage/basicForm.js | 4 +- .../activity/fellowship/manage/customForm.js | 100 +++++++++++++++++- .../activity/leadthought/query/index.html | 9 +- .../delegationOnePush/onePushFormalDialog.js | 4 +- .../delegationTwoPush/twoPushFormalDialog.js | 8 +- .../executiveCommitteeConfig/index.html | 26 ++--- 19 files changed, 237 insertions(+), 125 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/activity/fellowship/controller/manage/FellowshipApplyController.java b/src/main/java/com/budwk/app/zhgh/activity/fellowship/controller/manage/FellowshipApplyController.java index 8de3fc7a..9515eeca 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/fellowship/controller/manage/FellowshipApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/fellowship/controller/manage/FellowshipApplyController.java @@ -8,6 +8,7 @@ import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; +import com.budwk.app.base.utils.ConditionGroupUtil; import com.budwk.app.sys.models.Sys_dict; import com.budwk.app.sys.models.Sys_user; import com.budwk.app.sys.services.SysDictService; @@ -234,6 +235,15 @@ public class FellowshipApplyController { if (DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) { return Result.error("报名已结束"); } + //新增:基于条件组的用户资格验证 + if (course.getMatchCnd() != null) { + Cnd userCnd = Cnd.where("id", "=", SecurityUtil.getUserId()); + ConditionGroupUtil.applyConditionGroup(userCnd, course.getMatchCnd()); + int userCount = dao.count(Sys_user.class, userCnd); + if (userCount == 0) { + return Result.error("您不符合该活动的报名条件"); + } + } //判断活动组别 int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getActivityGroupId()).and("userId", "=", SecurityUtil.getUserId())); @@ -269,6 +279,7 @@ public class FellowshipApplyController { return Result.error("您所在的分工会名额不足"); } + return Result.success(); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/com/budwk/app/zhgh/activity/fellowship/models/FellowshipCourse.java b/src/main/java/com/budwk/app/zhgh/activity/fellowship/models/FellowshipCourse.java index b75b702c..bdb95a01 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/fellowship/models/FellowshipCourse.java +++ b/src/main/java/com/budwk/app/zhgh/activity/fellowship/models/FellowshipCourse.java @@ -1,6 +1,7 @@ package com.budwk.app.zhgh.activity.fellowship.models; import com.budwk.app.base.model.BaseModel; +import com.budwk.app.base.param.ConditionGroup; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -160,4 +161,9 @@ public class FellowshipCourse extends BaseModel implements Serializable { private String courseTimeName; + @Column + @Comment("条件") + @ColDefine(type = ColType.MYSQL_JSON) + private ConditionGroup matchCnd; + } diff --git a/src/main/java/com/budwk/app/zhgh/activity/leadthought/controller/LeadThoughtApplyMineController.java b/src/main/java/com/budwk/app/zhgh/activity/leadthought/controller/LeadThoughtApplyMineController.java index fb3c4b41..f1048430 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/leadthought/controller/LeadThoughtApplyMineController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/leadthought/controller/LeadThoughtApplyMineController.java @@ -105,7 +105,6 @@ public class LeadThoughtApplyMineController { @At @ApiOperation("获取填报信息") - @SaCheckPermission("leadThought.mine") public Result findOne(String id) { return Result.success(leadThoughtInfoService.findOne(id)); } diff --git a/src/main/java/com/budwk/app/zhgh/activity/leadthought/controller/LeadThoughtQueryController.java b/src/main/java/com/budwk/app/zhgh/activity/leadthought/controller/LeadThoughtQueryController.java index fa9a21dc..63033204 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/leadthought/controller/LeadThoughtQueryController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/leadthought/controller/LeadThoughtQueryController.java @@ -106,6 +106,8 @@ public class LeadThoughtQueryController { $condition """); Cnd cnd = Cnd.NEW(); + // 只查询流程实例状态为20的数据(已完成状态) + cnd.and("ins.state", "=", 20); pageForm.buildSearch(cnd, "info."); sql.setCondition(cnd); Pagination pagination = leadThoughtInfoService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardMineController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardMineController.java index d899b1b1..3cd31d55 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardMineController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardMineController.java @@ -4,8 +4,6 @@ import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaMode; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.excel.EasyExcel; import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; @@ -23,25 +21,18 @@ import lombok.extern.slf4j.Slf4j; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; import org.nutz.dao.Dao; -import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; -import org.nutz.lang.Lang; -import org.nutz.lang.util.NutMap; -import org.nutz.mvc.annotation.AdaptBy; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; -import org.nutz.mvc.upload.TempFile; -import org.nutz.mvc.upload.UploadAdaptor; + import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.net.URLEncoder; -import java.util.ArrayList; import java.util.Map; /** @@ -104,7 +95,7 @@ public class ExerciseCardMineController { public void doExportApply(@Valid String id, HttpServletResponse response) { ExerciseCard info = dao.fetch(ExerciseCard.class, id); Map docData = BeanUtil.beanToMap(info); - docData.put("time", DateUtil.format(new java.util.Date(), "yyyy年MM月dd日")); + docData.put("time", DateUtil.format(new java.util.Date(), "yyyy-MM-dd")); String fileName = Globals.AppName + "【" + info.getUserName() + "】健身卡充值证明.docx"; try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeConfigController.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeConfigController.java index b53dbf70..600c32e8 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeConfigController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeConfigController.java @@ -54,21 +54,19 @@ public class ExecutiveCommitteeConfigController { ExecutiveCommitteeConfig config = committeeConfigService.fetch(Cnd.where("teacherMeetId", "=", sessionId)); if(config == null) { config = new ExecutiveCommitteeConfig(); - Sql sql = Sqls.create(""" - SELECT - dbt.id as delegationId, - dbt.name as delegationName, - dbt.code as delegationCode, - (SELECT count( 1 ) FROM vw_user where unitId IN ( SELECT unitId FROM teacher_congress_delegation_unit unit WHERE unit.delegationId = dbt.id ) and member = 1) as memberCount, - (SELECT count( 1 ) FROM teacher_congress_delegate where unitId IN ( SELECT unitId FROM teacher_congress_delegation_unit unit WHERE unit.delegationId = dbt.id ) and sessionId=@sessionId) as dbCount, - 0 as quotaCount - FROM - teacher_congress_delegation dbt - WHERE dbt.sessionId = @sessionId - ORDER BY CODE ASC - """).setParam("sessionId", sessionId); - List listMap = committeeConfigService.listMap(sql); - config.setDelegationQuotaList(listMap); + Sql sql = Sqls.create(""" + SELECT + sun.id as unionId, + sun.name as unionName, + sun.unionCode , + (SELECT count( 1 ) FROM vw_user where sun.id = unionId) as memberCount, + 0 as quotaCount + FROM + sys_union sun + ORDER BY unionCode ASC + """); + List listMap = committeeConfigService.listMap(sql); + config.setUnionQuotaList(listMap); } return Result.success(config); } diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeDelegationOnePushController.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeDelegationOnePushController.java index 9d67f241..369dfcc6 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeDelegationOnePushController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeDelegationOnePushController.java @@ -15,7 +15,6 @@ import com.budwk.app.base.service.BaseService; import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig; import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeOnePush; -import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -41,13 +40,13 @@ import java.util.stream.Collectors; /** * @author zhf * @date 2025/8/25 15:18 - * @description 团长一次推选 + * @description 分工会一次推选 */ @IocBean @At("/platform/executiveCommittee/delegationOnePush") @Ok("json:full") @Slf4j -@Api(tags = "执委会推选-团长一次推选") +@Api(tags = "执委会推选-分工会主席一次推选") public class ExecutiveCommitteeDelegationOnePushController { @Inject @@ -61,8 +60,9 @@ public class ExecutiveCommitteeDelegationOnePushController { public void index() { } + @At - @ApiOperation("查询某个代表团的团长一次推选的委员") + @ApiOperation("查询某个分工会的一次推选的委员") @SaCheckPermission("executiveCommittee.delegationOnePush") public Result pageData(PageForm pageForm, String teacherMeetId, @@ -91,19 +91,13 @@ public class ExecutiveCommitteeDelegationOnePushController { Cnd cnd = Cnd.NEW(); cnd.andEX("t1.teacherMeetId", "=", teacherMeetId); if (StpUtil.hasRole(RoleConstant.SYSADMIN.name()) || - StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) { - cnd.andEX("t1.delegationId", "=", delegationId); + StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) || + StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { + cnd.andEX("t3.id", "=", unionId); }else{ - Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, - Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) - .and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); - if (ObjectUtil.isEmpty(db)) { - return Result.error("没有权限,只有代表团团长才能推选"); - } - cnd.andEX("t1.delegationId", "=", db.getDelegationId()); + cnd.andEX("t3.id", "=", SecurityUtil.getUnionId()); } - - cnd.andEX("t3.id", "=", unionId); + cnd.andEX("t1.delegationId", "=", delegationId); cnd.andEX("t1.addType", "=", 1); if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { SqlExpressionGroup group = new SqlExpressionGroup(); @@ -121,11 +115,10 @@ public class ExecutiveCommitteeDelegationOnePushController { @ApiOperation("查询可以推选委员和已经推选的人员") @SaCheckPermission("executiveCommittee.delegationOnePush") public Result getDelegationUser(String teacherMeetId) { - Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, - Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) - .and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); - if (ObjectUtil.isEmpty(db)) { - return Result.error("没有权限,只有代表团团长才能推选"); + if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) || + StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) || + StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) { + return Result.error("没有权限,只有分工会主席才能推选"); } ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, Cnd.where(ExecutiveCommitteeConfig::getTeacherMeetId, "=", teacherMeetId)); @@ -144,11 +137,6 @@ public class ExecutiveCommitteeDelegationOnePushController { List onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW()); List userIds = onePushList.stream().map(v -> v.getUserId()).collect(Collectors.toList()); - Cnd cnd = Cnd.NEW(); - cnd.andEX("db.sessionId", "=", teacherMeetId); - cnd.andEX("db.userId", "not in", userIds); - cnd.andEX("db.userId", "!=", SecurityUtil.getUserId()); - cnd.and("db.delegationId", "=", db.getDelegationId()); Sql sql = Sqls.create(""" SELECT db.*, @@ -160,29 +148,33 @@ public class ExecutiveCommitteeDelegationOnePushController { LEFT JOIN `vw_user` u ON db.userId = u.id $condition """); + Cnd cnd = Cnd.NEW(); + cnd.andEX("db.sessionId", "=", teacherMeetId); + cnd.andEX("db.userId", "not in", userIds); + cnd.andEX("db.userId", "!=", SecurityUtil.getUserId()); + cnd.and("db.unionId", "=", SecurityUtil.getUnionId()); sql.setCondition(cnd); List userData = baseService.listMap(sql); - List delegationQuotaList = config.getDelegationQuotaList(); - NutMap delegationQuota = delegationQuotaList.stream().filter(v -> v.get("delegationId").equals(db.getDelegationId())).findFirst().orElse(null); - if (Lang.isNotEmpty(delegationQuota)) { - return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", delegationQuota.getInt("quotaCount"))); + List unionQuotaList = config.getUnionQuotaList(); + NutMap unionQuota = unionQuotaList.stream().filter(v -> v.get("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null); + if (Lang.isNotEmpty(unionQuota)) { + return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", unionQuota.getInt("quotaCount"))); } return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", 0)); } @At @SaCheckPermission("executiveCommittee.delegationOnePush") - @SLog(tag = "执委会推选-团长推选委员", msg = "推选委员") + @SLog(tag = "执委会推选-分工会主席推选委员", msg = "推选委员") public Result addOnePush(@Param("userValue") String[] userValue, String teacherMeetId) { try { - Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, - Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) - .and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); - if (ObjectUtil.isEmpty(db)) { - return Result.error("没有权限,只有代表团团长才能推选"); + if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) || + StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) || + StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) { + return Result.error("没有权限,只有分工会主席才能推选"); } ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, @@ -196,19 +188,20 @@ public class ExecutiveCommitteeDelegationOnePushController { if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) { return Result.error("一次预选已结束"); } - List delegationQuotaList = config.getDelegationQuotaList(); + List unionQuotaList = config.getUnionQuotaList(); - NutMap delegationQuota = delegationQuotaList.stream().filter(v -> v.getString("delegationId").equals(db.getDelegationId())).findFirst().orElse(null); - if (ObjectUtil.isEmpty(delegationQuota)) { - return Result.error("请先配置代表团人数"); + NutMap unionQuota = unionQuotaList.stream().filter(v -> v.getString("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null); + if (ObjectUtil.isEmpty(unionQuota)) { + return Result.error("请先配置分工会人数"); } int dbCount = dao.count(ExecutiveCommitteeOnePush.class, - Cnd.where("delegationId", "=", db.getDelegationId()) + Cnd.where("unionId", "=", SecurityUtil.getUnionId()) .and("teacherMeetId", "=", teacherMeetId) .and("addType", "=", 1)); - if (dbCount + userValue.length > delegationQuota.getInt("quotaCount")) { - return Result.error("推选人数限制" + delegationQuota.getInt("quotaCount") + "人"); + assert unionQuota != null; + if (dbCount + userValue.length > unionQuota.getInt("quotaCount")) { + return Result.error("推选人数限制" + unionQuota.getInt("quotaCount") + "人"); } Sql sql = Sqls.create(""" SELECT @@ -236,6 +229,7 @@ public class ExecutiveCommitteeDelegationOnePushController { onePush.setUserName(jdhDb.getString("userName")); onePush.setLoginName(jdhDb.getString("loginName")); onePush.setDelegationId(jdhDb.getString("delegationId")); + onePush.setUnionId(jdhDb.getString("unionId")); onePush.setUnitId(jdhDb.getString("unitId")); onePush.setTeacherMeetId(teacherMeetId); String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName"))); @@ -253,7 +247,7 @@ public class ExecutiveCommitteeDelegationOnePushController { @At @SaCheckPermission("executiveCommittee.delegationOnePush") - @SLog(tag = "执委会推选-团长推选委员", msg = "删除推选的人") + @SLog(tag = "执委会推选-分工会主席推选委员", msg = "删除推选的人") public Result doDelete(@Valid String id, @Valid String teacherMeetId) { ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, Cnd.where("teacherMeetId", "=", teacherMeetId)); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeDelegationTwoPushController.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeDelegationTwoPushController.java index 712a5ce1..eb096aba 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeDelegationTwoPushController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteeDelegationTwoPushController.java @@ -1,10 +1,12 @@ package com.budwk.app.zhgh.democratic.executiveCommittee.controller; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; import com.budwk.app.base.service.BaseService; @@ -34,7 +36,7 @@ import java.util.stream.Collectors; /** * @author zhf * @date 2025/6/23 15:25 - * @description 团长二次推选 + * @description 分工会二次推选 */ @At("/platform/executiveCommittee/delegationTwoPush") @Ok("json:full") @@ -87,7 +89,13 @@ public class ExecutiveCommitteeDelegationTwoPushController { cnd.andEX("t1.pushUserId", "=", SecurityUtil.getUserId()); cnd.andEX("t1.teacherMeetId", "=", teacherMeetId); cnd.andEX("t2.delegationId", "=", delegationId); - cnd.andEX("t4.id", "=", unionId); + if (StpUtil.hasRole(RoleConstant.SYSADMIN.name()) || + StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) || + StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { + cnd.andEX("t4.id", "=", unionId); + } else { + cnd.andEX("t4.id", "=", SecurityUtil.getUnionId()); + } if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { SqlExpressionGroup group = new SqlExpressionGroup(); group.orLike("t2.userName", pageForm.getSearchKeyword()); @@ -101,13 +109,12 @@ public class ExecutiveCommitteeDelegationTwoPushController { @At @SaCheckPermission("executiveCommittee.delegationTwoPush") - @SLog(type = "执委会推选-团长二次推选", tag = "查询可以二次推选的名单", param = true, result = true) + @SLog(type = "执委会推选-分工会二次推选", tag = "查询可以二次推选的名单", param = true, result = true) public Result getDelegationUser(String teacherMeetId) { - Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, - Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) - .and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); - if (ObjectUtil.isEmpty(db)) { - return Result.error("没有权限,只有代表团团长才能推选"); + if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) || + StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) || + StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) { + return Result.error("没有权限,只有分工会主席才能推选"); } ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, Cnd.where("teacherMeetId", "=", teacherMeetId)); @@ -125,10 +132,7 @@ public class ExecutiveCommitteeDelegationTwoPushController { .and("pushUserId", "=", SecurityUtil.getUserId())); List userIds = userValue.stream().map(v -> v.getUserId()).collect(Collectors.toList()); - Cnd cnd = Cnd.NEW(); - cnd.andEX("t1.teacherMeetId", "=", teacherMeetId); - cnd.andEX("t1.userId", "not in", userIds); - cnd.andEX("t1.userId", "!=", SecurityUtil.getUserId()); + Sql sql = Sqls.create(""" SELECT t1.*, @@ -144,23 +148,26 @@ public class ExecutiveCommitteeDelegationTwoPushController { LEFT JOIN `vw_user` t2 ON t1.userId = t2.id $condition """); + Cnd cnd = Cnd.NEW(); + cnd.andEX("t1.teacherMeetId", "=", teacherMeetId); + cnd.andEX("t1.userId", "not in", userIds); + cnd.andEX("t1.userId", "!=", SecurityUtil.getUserId()); sql.setCondition(cnd); List userData = baseService.listMap(sql); - return Result.success(Map.of("userData", userData, "userValue", userValue,"delegationQuotaCount",config.getDelegationQuotaCount())); + return Result.success(Map.of("userData", userData, "userValue", userValue, "committeeQuotaCount", config.getCommitteeQuotaCount())); } @At @SaCheckPermission("executiveCommittee.delegationTwoPush") @ApiOperation("推选委员") - @SLog(tag = "执委会推选-团长二次推选", msg = "推选委员") + @SLog(tag = "执委会推选-分工会二次推选", msg = "推选委员") public Result addOnePush(@Param("userValue") String[] userValue, String teacherMeetId) { try { - Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, - Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) - .and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); - if (ObjectUtil.isEmpty(db)) { - return Result.error("没有权限,只有代表团团长才能推选"); + if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) || + StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) || + StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) { + return Result.error("没有权限,只有分工会主席才能推选"); } ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, @@ -193,7 +200,8 @@ public class ExecutiveCommitteeDelegationTwoPushController { ExecutiveCommitteeTwoPush twoPush = new ExecutiveCommitteeTwoPush(); twoPush.setPushDate(DateUtil.date()); twoPush.setUserId(id); - twoPush.setPushDelegationId(db.getDelegationId()); + twoPush.setPushDelegationId(jdhDb.getDelegationId()); + twoPush.setPushUnionId(SecurityUtil.getUnionId()); twoPush.setPushUserId(SecurityUtil.getUserId()); twoPush.setPushUserName(SecurityUtil.getUserUsername()); twoPush.setPushLoginName(SecurityUtil.getUserLoginname()); @@ -211,7 +219,7 @@ public class ExecutiveCommitteeDelegationTwoPushController { @At @ApiOperation("删除推选人员") @SaCheckPermission("executiveCommittee.delegationTwoPush") - @SLog(tag = "执委会推选-团长二次推选", msg = "删除推选人员") + @SLog(tag = "执委会推选-分工会二次推选", msg = "删除推选人员") public Result doDelete(@Valid String id, @Valid String teacherMeetId) { ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, Cnd.where("teacherMeetId", "=", teacherMeetId)); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteePushController.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteePushController.java index 610c9013..73a754ae 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteePushController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/controller/ExecutiveCommitteePushController.java @@ -182,6 +182,7 @@ public class ExecutiveCommitteePushController { onePush.setUserName(jdhDb.getString("userName")); onePush.setLoginName(jdhDb.getString("loginName")); onePush.setDelegationId(jdhDb.getString("delegationId")); + onePush.setUnionId(jdhDb.getString("unionId")); onePush.setUnitId(jdhDb.getString("unitId")); onePush.setTeacherMeetId(teacherMeetId); String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName"))); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeConfig.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeConfig.java index 0f599436..98306646 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeConfig.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeConfig.java @@ -47,9 +47,9 @@ public class ExecutiveCommitteeConfig extends BaseModel implements Serializable private Integer committeeQuotaCount; @Column - @Comment("代表团推荐名额总数") + @Comment("分工会推荐名额总数") @ColDefine(type = ColType.INT) - private Integer delegationQuotaCount; + private Integer unionQuotaCount; @Column @Comment("一次预选开始时间") @@ -72,8 +72,8 @@ public class ExecutiveCommitteeConfig extends BaseModel implements Serializable private DateTime secondEndTime; @Column - @Comment("各代表团名额数") + @Comment("各分工会名额数") @ColDefine(type = ColType.MYSQL_JSON) - private List delegationQuotaList; + private List unionQuotaList; } diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeOnePush.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeOnePush.java index 9c9961ad..0c60b2dc 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeOnePush.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeOnePush.java @@ -42,6 +42,11 @@ public class ExecutiveCommitteeOnePush extends BaseModel implements Serializable @ColDefine(type = ColType.VARCHAR, width = 32) private String delegationId; + @Column + @Comment("所属分工会") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String unionId; + @Column @Comment("姓名") @ColDefine(type = ColType.VARCHAR, width = 20) diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeTwoPush.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeTwoPush.java index 5a92fcf3..87794f72 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeTwoPush.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/models/ExecutiveCommitteeTwoPush.java @@ -37,6 +37,11 @@ public class ExecutiveCommitteeTwoPush extends BaseModel implements Serializable @ColDefine(type = ColType.VARCHAR, width = 32) private String teacherMeetId; + @Column + @Comment("推选的分工会") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String pushUnionId; + @Column @Comment("推选的代表团") @ColDefine(type = ColType.VARCHAR, width = 32) diff --git a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/service/impl/ExecutiveCommitteeMemberServiceImpl.java b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/service/impl/ExecutiveCommitteeMemberServiceImpl.java index f18c2fc8..1989e861 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/service/impl/ExecutiveCommitteeMemberServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/executiveCommittee/service/impl/ExecutiveCommitteeMemberServiceImpl.java @@ -10,7 +10,6 @@ import org.nutz.dao.Sqls; import org.nutz.dao.sql.Sql; import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.ioc.loader.annotation.IocBean; -import org.nutz.lang.Strings; /** * @author zhf diff --git a/src/main/resources/views/platform/zhgh/activity/fellowship/manage/basicForm.js b/src/main/resources/views/platform/zhgh/activity/fellowship/manage/basicForm.js index b75110c6..ed35712a 100644 --- a/src/main/resources/views/platform/zhgh/activity/fellowship/manage/basicForm.js +++ b/src/main/resources/views/platform/zhgh/activity/fellowship/manage/basicForm.js @@ -198,7 +198,7 @@ const basicForm = { - +