Merge remote-tracking branch 'origin/main'

This commit is contained in:
@jyuhsin
2025-12-24 18:16:00 +08:00
14 changed files with 176 additions and 26 deletions
@@ -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("提案委员会副主任"),
@@ -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
* @nameFlowQualificationReviewGroupByArgsAssignmentHandler
* @Date 2025/12/9 10:21
* @注释 获取代表资格审查组成员
*/
public class FlowQualificationReviewGroupByArgsAssignmentHandler implements AssignmentHandler {
@Override
public List<String> 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<Sys_user_role> 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();
}
}
@@ -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<ActivityRe
cnd.and("YEAR(ab.applyDate)", "=", DateUtil.thisYear());
cnd.and("ins.state", "=", 20);
cnd.and("ab.outlayManageSource", "=", outlayManageSource);
if (Objects.equals("ACTIVITY_BUDGET_TYPE_TWO", outlayManageSource)) {
cnd.and("ab.unionId", "=", SecurityUtil.getUnionId());
} else if (Objects.equals("ACTIVITY_BUDGET_TYPE_THREE", outlayManageSource)) {
cnd.and("ab.clubId", "=", clubId);
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
if (Objects.equals("ACTIVITY_BUDGET_TYPE_TWO", outlayManageSource)) {
cnd.and("ab.unionId", "=", SecurityUtil.getUnionId());
} else if (Objects.equals("ACTIVITY_BUDGET_TYPE_THREE", outlayManageSource)) {
cnd.and("ab.clubId", "=", clubId);
}
}
sql.setCondition(cnd);
List<NutMap> budgetList = listMap(sql);
@@ -123,7 +123,7 @@ public class TeacherCongressDelegateServiceImpl extends BaseServiceImpl<Teacher_
delegationSql.setParam("sessionId", pageForm.getSessionId());
List<NutMap> 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<Teacher_
tzSql.setParam("tzRoles", List.of(tzRole.getId()));
List<NutMap> 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<NutMap> ftzList = listMap(ftzSql);
//查询代表
Sql delegateSql = Sqls.create("""
SELECT
@@ -161,6 +180,7 @@ public class TeacherCongressDelegateServiceImpl extends BaseServiceImpl<Teacher_
for (NutMap delegation : delegationList) {
delegation.put("tz", tzList.stream().filter(tz -> tz.getString("tcDelegationId").equals(delegation.getString("id"))).toList());
delegation.put("ftz", ftzList.stream().filter(ftz -> ftz.getString("tcDelegationId").equals(delegation.getString("id"))).toList());
//过滤本代表团的代表
List<NutMap> delegateList = delegateAllList.stream().filter(delegate -> delegate.getString("delegationId").equals(delegation.getString("id"))).toList();
//按5人平均分组
@@ -82,6 +82,23 @@ public class TeacherCongressInstitutionUserServiceImpl extends BaseServiceImpl<T
}
}
// 🔄 设置教代会代表资格审查小组
if (institution.getCode().contains("TEACHER_CONGRESS_INSTITUTION_QUALIFICATION_LEADERSHIP_GROUP")) {
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_QUALIFICATION);
int existsRole = dao().count(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", userId)
.and(Sys_user_role::getTcSessionId, "=", sessionId)
.and(Sys_user_role::getRoleId, "=", sysRole.getId())
);
if (existsRole == 0) {
Sys_user_role insertSysUserRole = new Sys_user_role();
insertSysUserRole.setRoleId(sysRole.getId());
insertSysUserRole.setUserId(userId);
insertSysUserRole.setTcSessionId(sessionId);
dao().insert(insertSysUserRole);
sysRoleService.clearCache();
sysUserService.clearCache();
}
}
}
@@ -74,7 +74,7 @@ layout("/layouts/platform.html"){
</el-descriptions-item>
<el-descriptions-item label="申请时间">
<el-form-item prop="applyTime">
<el-input disabled type="text" v-model="formData.applyTime"></el-input>
<el-input disabled type="text" v-model="$moment(formData.applyTime).format('YYYY-MM-DD')"></el-input>
</el-form-item>
</el-descriptions-item>
@@ -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")
@@ -75,6 +75,9 @@ layout("/layouts/platform.html"){
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
<template scope="{row}" v-else-if="column.prop=='applyTime'">
<span>{{ $moment(row.applyTime).format('YYYY-MM-DD')}}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200px">
<template slot-scope="{row}">
@@ -62,6 +62,9 @@ layout("/layouts/platform.html"){
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
<template scope="{row}" v-else-if="column.prop=='applyTime'">
<span>{{ $moment(row.applyTime).format('YYYY-MM-DD')}}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200px">
<template slot-scope="{row}">
@@ -16,7 +16,7 @@ const INFO = {
</el-descriptions-item>
<el-descriptions-item label="联系方式">{{ viewData.mobile }}</el-descriptions-item>
<el-descriptions-item label="申请时间">{{ viewData.applyTime }}</el-descriptions-item>
<el-descriptions-item label="申请时间">{{ $moment(viewData.applyTime).format('YYYY-MM-DD') }}</el-descriptions-item>
<el-descriptions-item label="活动计划时间">{{ $moment(viewData.planStartTime).format('YYYY-MM-DD') + ' ~ ' + $moment(viewData.planEndTime).format('YYYY-MM-DD') }}
</el-descriptions-item>
@@ -82,6 +82,9 @@ layout("/layouts/platform.html"){
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
<template scope="{row}" v-else-if="column.prop=='applyTime'">
<span>{{ $moment(row.applyTime).format('YYYY-MM-DD')}}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
@@ -75,6 +75,9 @@ layout("/layouts/platform.html"){
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
<template scope="{row}" v-else-if="column.prop=='applyTime'">
<span>{{ $moment(row.applyTime).format('YYYY-MM-DD')}}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200px">
<template slot-scope="{row}">
@@ -75,6 +75,9 @@ layout("/layouts/platform.html"){
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
<template scope="{row}" v-else-if="column.prop=='applyTime'">
<span>{{ $moment(row.applyTime).format('YYYY-MM-DD')}}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200px">
<template slot-scope="{row}">
@@ -238,7 +238,7 @@ layout("/layouts/platform.html"){
} else {
tf_helpunitreply = 'NO_HELP_UNIT'
}
const loading = createLoading('提交中')
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
@@ -412,7 +412,7 @@ layout("/layouts/platform_h5.html"){
} else if (this.viewData.userNumberLimit === 2) {
//分工会人数限制
const union = this.viewData.unionUserNumberLimit.find(v => v.id === this.$store.state.user.union.id)
this.viewData.unionTeamNum = union.limitNum
this.viewData.unionLimitNum = union.limitNum
}
if (this.viewData.signUpMethod === 3) {
this.listTeamUserUnion()
@@ -768,6 +768,7 @@ layout("/layouts/platform_h5.html"){
},
created() {
this.init()
}
})
</script>