diff --git a/src/main/java/com/budwk/app/base/constant/RoleConstant.java b/src/main/java/com/budwk/app/base/constant/RoleConstant.java index 3f28ab7..e8f9f00 100644 --- a/src/main/java/com/budwk/app/base/constant/RoleConstant.java +++ b/src/main/java/com/budwk/app/base/constant/RoleConstant.java @@ -56,6 +56,7 @@ RoleConstant { TEACHER_CONGRESS_DELEGATION_HEAD("教代会代表团团长"), TEACHER_CONGRESS_VICE_DELEGATION_HEAD("教代会代表团副团长"), TEACHER_CONGRESS_DELEGATION_CONTACT("教代会代表团联络人"), + TEACHER_CONGRESS_DELEGATION_QUALIFICATION("教代会代表资格审查员"), PROPOSAL_COMMITTEE_DIRECTOR("提案委员会主任"), PROPOSAL_COMMITTEE_DEPUTY_DIRECTOR("提案委员会副主任"), diff --git a/src/main/java/com/budwk/app/flow/handler/FlowQualificationReviewGroupByArgsAssignmentHandler.java b/src/main/java/com/budwk/app/flow/handler/FlowQualificationReviewGroupByArgsAssignmentHandler.java new file mode 100644 index 0000000..7fe6c08 --- /dev/null +++ b/src/main/java/com/budwk/app/flow/handler/FlowQualificationReviewGroupByArgsAssignmentHandler.java @@ -0,0 +1,61 @@ +package com.budwk.app.flow.handler; + +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.constant.RoleConstant; +import com.budwk.app.base.exception.BaseException; +import com.budwk.app.flow.engine.AssignmentHandler; +import com.budwk.app.flow.engine.core.Execution; +import com.budwk.app.flow.engine.core.ServiceContext; +import com.budwk.app.flow.engine.model.TaskModel; +import com.budwk.app.sys.models.Sys_role; +import com.budwk.app.sys.models.Sys_user_role; +import com.budwk.app.sys.services.SysRoleService; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.lang.Lang; + +import java.util.List; + +/** + * @version 1.0 + * @Author FKY + * @name:FlowQualificationReviewGroupByArgsAssignmentHandler + * @Date 2025/12/9 10:21 + * @注释 获取代表资格审查组成员 + */ +public class FlowQualificationReviewGroupByArgsAssignmentHandler implements AssignmentHandler { + + @Override + public List assign(TaskModel model, Execution execution) { + String sessionId = execution.getArgs().getStr("sessionId"); + + if (StrUtil.isBlank(sessionId)) { + throw new BaseException("参数 sessionId 不能为空"); + } + + SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class); + Sys_role role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_QUALIFICATION); + + List roles = ServiceContext.find(Dao.class).query( + Sys_user_role.class, + Cnd.where(Sys_user_role::getRoleId, "=", role.getId()) + .and(Sys_user_role::getTcSessionId, "=", sessionId) + ); + + if (Lang.isEmpty(roles)) { + throw new RuntimeException("未获取到当前届次的代表资格审查小组,无法流转到下一步,请联系校工会进行设置。"); + } + return roles.stream().map(Sys_user_role::getUserId).toList(); + } + + + @Override + public String getMessage() { + return "获取代表资格审查组成员(通用版本,根据args中的sessionId)"; + } + + @Override + public int getOrder() { + return AssignmentHandler.super.getOrder(); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/service/impl/ActivityReimbursementServiceImpl.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/service/impl/ActivityReimbursementServiceImpl.java index a7ac654..842d2c7 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/service/impl/ActivityReimbursementServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/service/impl/ActivityReimbursementServiceImpl.java @@ -2,8 +2,10 @@ package com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.service.i import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.result.Result; import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.models.ActivityReimbursementInfo; import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.service.ActivityReimbursementService; @@ -87,10 +89,12 @@ public class ActivityReimbursementServiceImpl extends BaseServiceImpl delegationList = listMap(delegationSql); - //查询所有的团长、副团长 + //查询所有的团长 Sys_role tzRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD); Sql tzSql = Sqls.create(""" SELECT @@ -142,6 +142,25 @@ public class TeacherCongressDelegateServiceImpl extends BaseServiceImpl tzList = listMap(tzSql); + //查询所有的副团长 + Sys_role ftzRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_VICE_DELEGATION_HEAD); + Sql ftzSql = Sqls.create(""" + SELECT + t2.id, + t2.username, + t2.sex, + t1.tcDelegationId + FROM + sys_user_role t1 + LEFT JOIN sys_user t2 ON t2.id = t1.userId + WHERE + t1.tcSessionId = @sessionId + AND t1.roleId IN (@ftzRoles) + """); + ftzSql.setParam("sessionId", pageForm.getSessionId()); + ftzSql.setParam("ftzRoles", List.of(ftzRole.getId())); + List ftzList = listMap(ftzSql); + //查询代表 Sql delegateSql = Sqls.create(""" SELECT @@ -161,6 +180,7 @@ public class TeacherCongressDelegateServiceImpl extends BaseServiceImpl tz.getString("tcDelegationId").equals(delegation.getString("id"))).toList()); + delegation.put("ftz", ftzList.stream().filter(ftz -> ftz.getString("tcDelegationId").equals(delegation.getString("id"))).toList()); //过滤本代表团的代表 List delegateList = delegateAllList.stream().filter(delegate -> delegate.getString("delegationId").equals(delegation.getString("id"))).toList(); //按5人平均分组 diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/institution/service/impl/TeacherCongressInstitutionUserServiceImpl.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/institution/service/impl/TeacherCongressInstitutionUserServiceImpl.java index b13bea8..87a633e 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/institution/service/impl/TeacherCongressInstitutionUserServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/institution/service/impl/TeacherCongressInstitutionUserServiceImpl.java @@ -82,6 +82,23 @@ public class TeacherCongressInstitutionUserServiceImpl extends BaseServiceImpl - + @@ -225,10 +225,17 @@ layout("/layouts/platform.html"){ budgetOption: [] } }, + watch: { + 'formData.activityType': function(newVal, oldVal) { + if (newVal !== oldVal) { + this.$set(this.formData, "deductionBudgetId", null) + this.getBudgetByYear() + } + } + }, methods: { getBudgetByYear() { this.budgetOption = [] - this.$set(this.formData, "deductionBudgetId", null) let outlayManageSource = "" if (this.formData.activityType === "SCHOOL_UNION") { outlayManageSource = "ACTIVITY_BUDGET_TYPE_ONE" @@ -237,13 +244,15 @@ layout("/layouts/platform.html"){ } else if (this.formData.activityType === "CLUB") { outlayManageSource = "ACTIVITY_BUDGET_TYPE_THREE" } - this.$axios.post('/platform/activityReimbursement/apply/getBudgetByYear', { + + return this.$axios.post('/platform/activityReimbursement/apply/getBudgetByYear', { outlayManageSource: outlayManageSource, clubId: this.formData.clubId }).then(res => { if (res.code === 0) { this.budgetOption = res.data } + return res.data }) }, // 保存 @@ -309,11 +318,15 @@ layout("/layouts/platform.html"){ }) }) }, - // 设置申报主体名称 setDeclareUnitName(val) { const club = this.clubList.find(v => v.id === val) this.$set(this.formData, "declareUnitName", club ? club.clubName : null) + + // 清空当前预算选择,因为社团变更会影响可选的预算 + this.$set(this.formData, "deductionBudgetId", null) + + // 获取新的预算数据 this.getBudgetByYear() }, // 申请类型选中 @@ -323,25 +336,43 @@ layout("/layouts/platform.html"){ } else if (val === "BRANCH_UNION") { this.$set(this.formData, "declareUnitName", this.$store.state.user.union.name) this.$set(this.formData, "unionId", this.$store.state.user.union.id) + } else if (val === "CLUB") { + // 当活动类型变为社团时,清空已选择的预算 + this.$set(this.formData, "deductionBudgetId", null) } + + this.$set(this.formData, "deductionBudgetId", null) this.getBudgetByYear() }, - findOne(id) { - this.$axios.post("/platform/activityDeclare/mine/findOne", {id}) - .then((res) => { - if (res.code === 0) { - this.formData = res.data - if (res.data.clubId) { - this.setDeclareUnitName(res.data.clubId) - } + async findOne(id) { + try { + const res = await this.$axios.post("/platform/activityDeclare/mine/findOne", {id}) + if (res.code === 0) { - if (res.data.planStartTime && res.data.planEndTime) { - this.$set(this.formData, "planDate", [res.data.planStartTime, res.data.planEndTime]) - } - } else { - this.$message.error(res.msg) + const originalBudgetId = res.data.deductionBudgetId + + this.formData = {...res.data} + this.$set(this.formData, "deductionBudgetId", null) // 先清空 + + if (res.data.clubId) { + this.setDeclareUnitName(res.data.clubId) } - }) + + await this.getBudgetByYear() + + // 预算数据加载完成后,再设置选中的预算ID + if (originalBudgetId) { + this.$set(this.formData, "deductionBudgetId", originalBudgetId) + } + if (res.data.planStartTime && res.data.planEndTime) { + this.$set(this.formData, "planDate", [res.data.planStartTime, res.data.planEndTime]) + } + } else { + this.$message.error(res.msg) + } + } catch (error) { + this.$message.error("获取数据失败:" + error.message) + } }, async initActivityTypeList() { this.activityDeclareReimbursementList = await this.$businessTool.getEnumOptions("ActivityDeclareReimbursement") diff --git a/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/branchunion/index.html b/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/branchunion/index.html index 360e116..7117d20 100644 --- a/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/branchunion/index.html +++ b/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/branchunion/index.html @@ -75,6 +75,9 @@ layout("/layouts/platform.html"){ + + + + +