This commit is contained in:
=
2026-03-16 10:53:03 +08:00
14 changed files with 1208 additions and 123 deletions
@@ -68,6 +68,20 @@ public class ExecutiveCommitteeConfigController {
""").setParam("sessionId",sessionId);
List<NutMap> listMap = committeeConfigService.listMap(sql);
config.setUnionQuotaList(listMap);
Sql sql2 = Sqls.create("""
SELECT
dbt.id as delegationId,
dbt.name as delegationName,
dbt.code as delegationCode,
(SELECT count(1) FROM teacher_congress_delegate WHERE delegationId =dbt.id) AS dbCount,
0 as quotaCount
FROM
teacher_congress_delegation dbt
WHERE dbt.sessionId = @sessionId
ORDER BY CODE ASC
""").setParam("sessionId", sessionId);
List<NutMap> listMap2 = committeeConfigService.listMap(sql2);
config.setDelegationQuotaList(listMap2);
}
return Result.success(config);
}
@@ -15,6 +15,7 @@ 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;
@@ -40,13 +41,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
@@ -60,9 +61,8 @@ public class ExecutiveCommitteeDelegationOnePushController {
public void index() {
}
@At
@ApiOperation("查询某个分工会的一次推选的委员")
@ApiOperation("查询某个代表团的团长一次推选的委员")
@SaCheckPermission("executiveCommittee.delegationOnePush")
public Result pageData(PageForm pageForm,
String teacherMeetId,
@@ -91,13 +91,19 @@ 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()) ||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
cnd.andEX("t3.id", "=", unionId);
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.andEX("t1.delegationId", "=", delegationId);
}else{
cnd.andEX("t3.id", "=", SecurityUtil.getUnionId());
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("t1.delegationId", "=", delegationId);
cnd.andEX("t3.id", "=", unionId);
cnd.andEX("t1.addType", "=", 1);
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup();
@@ -115,10 +121,11 @@ public class ExecutiveCommitteeDelegationOnePushController {
@ApiOperation("查询可以推选委员和已经推选的人员")
@SaCheckPermission("executiveCommittee.delegationOnePush")
public Result getDelegationUser(String teacherMeetId) {
if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
return Result.error("没有权限,只有分工会主席才能推选");
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("没有权限,只有代表团团长才能推选");
}
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
Cnd.where(ExecutiveCommitteeConfig::getTeacherMeetId, "=", teacherMeetId));
@@ -137,6 +144,11 @@ public class ExecutiveCommitteeDelegationOnePushController {
List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW());
List<String> 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.*,
@@ -148,33 +160,29 @@ 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<NutMap> userData = baseService.listMap(sql);
List<NutMap> 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")));
List<NutMap> 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")));
}
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 {
if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
return Result.error("没有权限,只有分工会主席才能推选");
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("没有权限,只有代表团团长才能推选");
}
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
@@ -188,20 +196,19 @@ public class ExecutiveCommitteeDelegationOnePushController {
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
return Result.error("一次预选已结束");
}
List<NutMap> unionQuotaList = config.getUnionQuotaList();
List<NutMap> delegationQuotaList = config.getDelegationQuotaList();
NutMap unionQuota = unionQuotaList.stream().filter(v -> v.getString("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null);
if (ObjectUtil.isEmpty(unionQuota)) {
return Result.error("请先配置分工会人数");
NutMap delegationQuota = delegationQuotaList.stream().filter(v -> v.getString("delegationId").equals(db.getDelegationId())).findFirst().orElse(null);
if (ObjectUtil.isEmpty(delegationQuota)) {
return Result.error("请先配置代表团人数");
}
int dbCount = dao.count(ExecutiveCommitteeOnePush.class,
Cnd.where("unionId", "=", SecurityUtil.getUnionId())
Cnd.where("delegationId", "=", db.getDelegationId())
.and("teacherMeetId", "=", teacherMeetId)
.and("addType", "=", 1));
assert unionQuota != null;
if (dbCount + userValue.length > unionQuota.getInt("quotaCount")) {
return Result.error("推选人数限制" + unionQuota.getInt("quotaCount") + "");
if (dbCount + userValue.length > delegationQuota.getInt("quotaCount")) {
return Result.error("推选人数限制" + delegationQuota.getInt("quotaCount") + "");
}
Sql sql = Sqls.create("""
SELECT
@@ -229,7 +236,6 @@ 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")));
@@ -247,7 +253,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));
@@ -0,0 +1,197 @@
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import com.budwk.app.base.constant.RoleConstant;
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.service.BaseService;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeOnePush;
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeUnionPushInfo;
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;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhf
* @date 2026/3/13 16:09
* @description 党委书记审核
*/
@IocBean
@At("/platform/executiveCommittee/pushDwSjAudit")
@Ok("json:full")
@Slf4j
@Api(tags = "两委会委员推选-党委书记审查")
public class ExecutiveCommitteePushDwSjAuditController {
@Inject
private BaseService baseService;
@Inject
private FlowCommonService flowCommonService;
@Inject
private FlowEngine flowEngine;
@At("")
@SaCheckPermission("executiveCommittee.pushDwSjAudit")
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/pushDwSjAudit/index.html")
public void index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("executiveCommittee.pushDwSjAudit")
public Result pageData(PageForm pageForm,
@Param(value = "teacherMeetId") String teacherMeetId,
@Param(value = "unionId") String unionId,
@Param(value = "approval") Boolean approval) {
Sql sql = Sqls.create("""
SELECT
info.*,
tcd.loginName,
tcd.userName,
tcd.age,
tcd.sex,
tcd.unitName,
tcd.unionName,
ion.`name` delegationName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
FROM
wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
LEFT JOIN executive_committee_union_push_info info ON info.id = ins.businessNo
LEFT JOIN teacher_congress_delegate tcd on tcd.sessionId=@sessionId and tcd.userId=info.userId
LEFT JOIN teacher_congress_delegation ion on ion.id=tcd.delegationId
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
$condition
""").setParam("sessionId", teacherMeetId);
Cnd cnd = Cnd.NEW();
cnd.and("t.taskName", "=", "4d57210e-076e-4446-a3b3-139397e4e6de");
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
cnd.andEX("info.teacherMeetId", "=", teacherMeetId);
cnd.andEX("info.unionId", "=", unionId);
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("info.userName", pageForm.getSearchKeyword());
group.orLike("info.loginName", pageForm.getSearchKeyword());
cnd.and(group);
}
cnd.groupBy("t.id");
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.desc("t.createdAt");
} else {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
sql.setCondition(cnd);
Pagination<NutMap> pageVO = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pageVO);
}
@At
@ApiOperation("提交")
@SaCheckPermission("executiveCommittee.pushDwSjAudit")
public Result executeTask(@Param("data") String data) {
Dict args = Json.fromJson(Dict.class, data);
flowCommonService.executeTask(args);
List<ExecutiveCommitteeOnePush> pushArrayList = new ArrayList<>();
if (args.getInt("submitType") == 1) {
ExecutiveCommitteeUnionPushInfo pushInfo = baseService.dao().fetch(ExecutiveCommitteeUnionPushInfo.class, args.getStr("bizId"));
Teacher_congress_delegate delegate = baseService.dao().fetch(Teacher_congress_delegate.class,
Cnd.where(Teacher_congress_delegate::getUserId, "=", pushInfo.getUserId())
.and(Teacher_congress_delegate::getSessionId, "=", pushInfo.getTeacherMeetId()));
ExecutiveCommitteeOnePush onePush = new ExecutiveCommitteeOnePush();
onePush.setUserId(pushInfo.getUserId());
onePush.setTeacherMeetId(pushInfo.getTeacherMeetId());
onePush.setUnionId(delegate.getUnionId());
onePush.setUnitId(delegate.getUnitId());
onePush.setDelegationId(delegate.getDelegationId());
onePush.setUserName(delegate.getUserName());
onePush.setLoginName(delegate.getLoginName());
String firstLetter = String.valueOf(getFirstLetter(delegate.getUserName()));
onePush.setFirstLetter(firstLetter);
onePush.setAddType(3);
onePush.setPushDate(DateUtil.date());
pushArrayList.add(onePush);
}
baseService.dao().insert(pushArrayList);
return Result.success();
}
public static char getFirstLetter(String str) {
if (str == null || str.isEmpty()) {
throw new IllegalArgumentException("字符串不能为空");
}
char firstChar = str.charAt(0);
if (Validator.isChinese(String.valueOf(firstChar))) {
return Character.toUpperCase(PinyinUtil.getPinyin(firstChar).charAt(0));
} else if (Character.isLetter(firstChar)) {
return Character.toUpperCase(firstChar);
} else {
return firstChar;
}
}
}
@@ -0,0 +1,291 @@
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
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.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
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.executiveCommittee.models.ExecutiveCommitteeUnionPushInfo;
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;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
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.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zhf
* @date 2026/3/13 11:32
* @description 分工会推选
*/
@IocBean
@At("/platform/executiveCommittee/unionPush")
@Ok("json:full")
@Slf4j
@Api(tags = "两委会委员推选-分工会推选")
public class ExecutiveCommitteeUnionPushController {
@Inject
private Dao dao;
@Inject
private BaseService baseService;
@Inject
private FlowEngine flowEngine;
@At("")
@SaCheckPermission("executiveCommittee.unionPush")
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/unionPush/index.html")
public void index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("executiveCommittee.unionPush")
public Result pageData(PageForm pageForm,
@Param(value = "teacherMeetId") String teacherMeetId,
@Param(value = "unionId") String unionId) {
Sql sql = Sqls.create("""
SELECT
info.*,
tcd.loginName,
tcd.userName,
tcd.age,
tcd.sex,
tcd.unitName,
tcd.unionName,
ion.`name` delegationName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
IFNULL(GROUP_CONCAT(DISTINCT t.displayName),'结束') curTaskName,
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
FROM
executive_committee_union_push_info info
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN teacher_congress_delegate tcd on tcd.sessionId=@sessionId and tcd.userId=info.userId
LEFT JOIN teacher_congress_delegation ion on ion.id=tcd.delegationId
$condition
""").setParam("sessionId", teacherMeetId);
Cnd cnd = Cnd.NEW();
cnd.andEX("info.teacherMeetId", "=", teacherMeetId);
cnd.andEX("info.unionId", "=", unionId);
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("info.userName", pageForm.getSearchKeyword());
group.orLike("info.loginName", pageForm.getSearchKeyword());
cnd.and(group);
}
cnd.desc("info.createdAt");
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if (AuthUtil.hasRole(RoleConstant.UNIT_PARTY_SECRETARY.name())) {
cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId());
} else {
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
}
}
cnd.groupBy("info.id");
sql.setCondition(cnd);
Pagination<NutMap> pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ApiOperation("查询可以推选委员和已经推选的人员")
@SaCheckPermission("executiveCommittee.unionPush")
public Result getUnionUser(String teacherMeetId) {
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
Cnd.where(ExecutiveCommitteeConfig::getTeacherMeetId, "=", teacherMeetId));
if (ObjectUtil.isEmpty(config)) {
return Result.error("请先配置基础信息");
}
if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) {
return Result.error("请等待一次预选开始时间");
}
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
return Result.error("一次预选已结束");
}
List<ExecutiveCommitteeOnePush> userValue = dao.query(ExecutiveCommitteeOnePush.class,
Cnd.where("teacherMeetId", "=", teacherMeetId));
List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW());
List<String> userIds = onePushList.stream().map(v -> v.getUserId()).collect(Collectors.toList());
List<ExecutiveCommitteeUnionPushInfo> pushInfoList = dao.query(ExecutiveCommitteeUnionPushInfo.class, Cnd.where(ExecutiveCommitteeUnionPushInfo::getTeacherMeetId, "=", teacherMeetId));
List<String> unionPushUserIds = pushInfoList.stream().map(v -> v.getUserId()).toList();
Cnd cnd = Cnd.NEW();
cnd.andEX("db.sessionId", "=", teacherMeetId);
cnd.andEX("db.userId", "not in", userIds);
cnd.andEX("db.userId", "not in", unionPushUserIds);
cnd.andEX("db.userId", "!=", SecurityUtil.getUserId());
cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
Sql sql = Sqls.create("""
SELECT
db.*,
u.professionalTitle,
u.professionalLevel,
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
FROM
teacher_congress_delegate db
LEFT JOIN `vw_user` u ON db.userId = u.id
$condition
""");
sql.setCondition(cnd);
List<NutMap> userData = baseService.listMap(sql);
List<NutMap> unionQuotaList = config.getUnionQuotaList();
NutMap unionQuota = unionQuotaList.stream().filter(v -> v.getString("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
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("executiveCommittee.unionPush")
@SLog(tag = "执委会推选-分工会推选委员", msg = "推选委员")
public Result addPush(@Param("userValue") String[] userValue,
String teacherMeetId) {
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
Cnd.where("teacherMeetId", "=", teacherMeetId));
if (ObjectUtil.isEmpty(config)) {
return Result.error("请先配置基础信息");
}
if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) {
return Result.error("请等待一次预选开始时间");
}
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
return Result.error("一次预选已结束");
}
List<NutMap> unionQuotaList = config.getUnionQuotaList();
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(ExecutiveCommitteeUnionPushInfo.class,
Cnd.where(ExecutiveCommitteeUnionPushInfo::getUnionId, "=", SecurityUtil.getUnionId())
.and(ExecutiveCommitteeUnionPushInfo::getTeacherMeetId, "=", teacherMeetId));
if (dbCount + userValue.length > unionQuota.getInt("quotaCount")) {
return Result.error("推选人数限制" + unionQuota.getInt("quotaCount") + "");
}
Sql sql = Sqls.create("""
SELECT
t1.*
FROM
teacher_congress_delegate t1
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t1.sessionId", "=", teacherMeetId);
cnd.andEX("t1.userId", "in", userValue);
sql.setCondition(cnd);
List<Teacher_congress_delegate> dbList = baseService.listVO(sql, Teacher_congress_delegate.class);
List<ExecutiveCommitteeUnionPushInfo> list = new ArrayList<>();
for (String id : userValue) {
Teacher_congress_delegate jdhDb = dbList.stream().filter(v -> v.getUserId().equals(id)).findFirst().orElse(null);
if (ObjectUtil.isEmpty(jdhDb)) {
return Result.error("请选择正确的代表!");
}
ExecutiveCommitteeUnionPushInfo pushInfo = new ExecutiveCommitteeUnionPushInfo();
pushInfo.setPushDate(DateUtil.date());
pushInfo.setUserId(jdhDb.getUserId());
pushInfo.setUnionId(jdhDb.getUnionId());
pushInfo.setUnitId(jdhDb.getUnitId());
pushInfo.setTeacherMeetId(teacherMeetId);
list.add(pushInfo);
}
dao.insert(list);
list.forEach(ExecutiveCommitteeUnionPushInfo -> {
// 开启流程实例
Dict args = Dict.create();
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
args.set(FlowConst.FORM_DATA, ExecutiveCommitteeUnionPushInfo);
ProcessInstance instance = flowEngine.startProcessInstanceByKey("LWHHY", ExecutiveCommitteeUnionPushInfo.getId(), SecurityUtil.getUserId(), args);
// 自动完成第一个申请任务
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
for (ProcessTask task : doingTaskList) {
args.put(FlowConst.NEXT_NODE_OPERATOR, ExecutiveCommitteeUnionPushInfo.getUserId());
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
}
});
return Result.success();
}
@At
@ApiOperation("删除")
@SaCheckPermission("executiveCommittee.unionPush")
@SLog(tag = "删除推选代表", msg = "删除推选代表")
public Result doDelete(String id){
baseService.dao().delete(ExecutiveCommitteeUnionPushInfo.class, id);
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
return Result.success();
}
}
@@ -51,6 +51,11 @@ public class ExecutiveCommitteeConfig extends BaseModel implements Serializable
@ColDefine(type = ColType.INT)
private Integer unionQuotaCount;
@Column
@Comment("代表团推荐名额总数")
@ColDefine(type = ColType.INT)
private Integer delegationQuotaCount;
@Column
@Comment("一次预选开始时间")
@ColDefine(type = ColType.DATETIME)
@@ -76,4 +81,9 @@ public class ExecutiveCommitteeConfig extends BaseModel implements Serializable
@ColDefine(type = ColType.MYSQL_JSON)
private List<NutMap> unionQuotaList;
@Column
@Comment("各代表团名额数")
@ColDefine(type = ColType.MYSQL_JSON)
private List<NutMap> delegationQuotaList;
}
@@ -0,0 +1,52 @@
package com.budwk.app.zhgh.democratic.executiveCommittee.models;
import cn.hutool.core.date.DateTime;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @author zhf
* @date 2026/3/13 14:32
* @description 分工会推选记录表
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("executive_committee_union_push_info")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("分工会推选记录表")
public class ExecutiveCommitteeUnionPushInfo extends BaseModel {
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("代表用户ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("所属教代会ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String teacherMeetId;
@Column
@Comment("所属分工会")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("单位ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unitId;
@Column
@Comment("推选时间")
@ColDefine(type = ColType.DATETIME)
private DateTime pushDate;
}
+1 -1
View File
@@ -59,4 +59,4 @@ create index qz_ft_jg on sys_qrtz_fired_triggers(SCHED_NAME,JOB_GROUP)
/*QUARTZ_52*/
create index qz_ft_t_g on sys_qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
/*QUARTZ_53*/
create index qz_ft_tg on sys_qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP)
create index qz_ft_tg on sys_qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP)
+1 -1
View File
@@ -59,4 +59,4 @@ create index qz_ft_jg on sys_qrtz_fired_triggers(SCHED_NAME,JOB_GROUP)
/*QUARTZ_52*/
create index qz_ft_t_g on sys_qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
/*QUARTZ_53*/
create index qz_ft_tg on sys_qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP)
create index qz_ft_tg on sys_qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP)
@@ -4,7 +4,7 @@ const DELEGATION_ONE_PUSH_FORMAL_DIALOG = {
<el-dialog
:close-on-click-modal="false"
:visible.sync="dialogVisible"
title="分工会推选委员"
title="代表团推选委员"
width="70%"
>
@@ -3,8 +3,8 @@ layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<custom-card>
<template slot="header" class="mb10">
<search @search="fetchConfig">
<search-item label="教代会届次">
<el-select
@@ -23,82 +23,112 @@ layout("/layouts/platform.html"){
</el-select>
</search-item>
</search>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="基础信息"></table-tool>
<el-form ref="form" label-width="140px" :model="formData" :rules="formRules">
<el-form-item prop="prepareGroupQuotaCount" label="筹备组推荐名额数">
<el-input-number v-model="formData.prepareGroupQuotaCount" placeholder="请填写筹备组推荐名额数"
style="width: 100%"></el-input-number>
</el-form-item>
</template>
<el-form-item prop="unionQuotaCount" label="分工会推荐总数">
<el-input-number v-model="formData.unionQuotaCount"
placeholder="请填写分工会推荐名额总数" style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item prop="committeeQuotaCount" label="委员会预选人数">
<el-input-number v-model="formData.committeeQuotaCount"
placeholder="请填写委员会预选人数" style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item prop="firstTime" label="第一次预选时间">
<el-date-picker
v-model="formData.firstTime"
style="width: 100%"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
start-placeholder="请选择开始日期"
end-placeholder="请选择结束日期"
></el-date-picker>
</el-form-item>
<el-form-item prop="secondTime" label="第次预选时间">
<el-date-picker
v-model="formData.secondTime"
style="width: 100%"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
start-placeholder="请选择开始日期"
end-placeholder="请选择结束日期"
></el-date-picker>
</el-form-item>
</el-form>
<table-tool label="分工会名额分配"></table-tool>
<el-table :data="formData.unionQuotaList" show-summar size="mini" max-height="500">
<el-table-column
align="center"
header-align="center"
type="index"
:index="indexMethod"
label="序号"
width="80px"
></el-table-column>
<el-table-column
v-for="column in tableColumns"
:key="column.prop"
align="center"
header-align="center"
:label="column.label"
:prop="column.prop"
show-overflow-tooltip
>
<template v-if="column.prop === 'quotaCount'" #default="{ row }">
<el-input-number
v-model="row.quotaCount"
:precision="0"
:step="1"
:min="0"
:max="100"
></el-input-number>
</template>
</el-table-column>
</el-table>
<el-row type="flex" justify="end" class="mt20">
<el-button type="primary" @click="onHandle">提 交</el-button>
</el-row>
<table-tool label="基础信息"></table-tool>
<el-form ref="formRef" label-width="140px" :model="formData" :rules="formRules">
<el-form-item prop="prepareGroupQuotaCount" label="筹备组推荐名额数">
<el-input-number v-model="formData.prepareGroupQuotaCount" placeholder="请填写筹备组推荐名额数"
style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item prop="unionQuotaCount" label="分工会推荐总数">
<el-input-number v-model="formData.unionQuotaCount"
placeholder="请填写分工会推荐名额总数" style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item prop="delegationQuotaCount" label="代表团推荐总数">
<el-input-number v-model="formData.delegationQuotaCount"
placeholder="请填写代表团推荐名额总数" style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item prop="committeeQuotaCount" label="委员会预选人数">
<el-input-number v-model="formData.committeeQuotaCount"
placeholder="请填写委员会预选人数" style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item prop="firstTime" label="第次预选时间">
<el-date-picker
v-model="formData.firstTime"
style="width: 100%"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
start-placeholder="请选择开始日期"
end-placeholder="请选择结束日期"
></el-date-picker>
</el-form-item>
<el-form-item prop="secondTime" label="第二次预选时间">
<el-date-picker
v-model="formData.secondTime"
style="width: 100%"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
start-placeholder="请选择开始日期"
end-placeholder="请选择结束日期"
></el-date-picker>
</el-form-item>
</el-form>
<table-tool label="分工会名额分配"></table-tool>
<el-table :data="formData.unionQuotaList" show-summar size="mini" max-height="500">
<el-table-column
align="center"
header-align="center"
type="index"
:index="indexMethod"
label="序号"
width="80px"
></el-table-column>
<el-table-column
v-for="column in tableColumns"
:key="column.prop"
align="center"
header-align="center"
:label="column.label"
:prop="column.prop"
show-overflow-tooltip
>
<template v-if="column.prop === 'quotaCount'" #default="{ row }">
<el-input-number
v-model="row.quotaCount"
:precision="0"
:step="1"
:min="0"
:max="100"
></el-input-number>
</template>
</el-table-column>
</el-table>
<table-tool label="代表团名额分配"></table-tool>
<el-table :data="formData.delegationQuotaList" show-summar size="mini" max-height="500">
<el-table-column
type="index"
:index="indexMethod"
label="序号"
width="80px"
></el-table-column>
<el-table-column
v-for="column in delegationTableColumns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
show-overflow-tooltip
>
<template v-if="column.prop === 'quotaCount'" #default="{ row }">
<el-input-number
v-model="row.quotaCount"
:precision="0"
:step="1"
:min="0"
:max="100"
></el-input-number>
</template>
</el-table-column>
</el-table>
<template slot="footer">
<el-button type="primary" @click="onHandle">提 交</el-button>
</template>
</custom-card>
</el-card>
</guava>
</div>
<script>
@@ -117,13 +147,19 @@ layout("/layouts/platform.html"){
{prop: 'dbCount', label: '代表人数', sortable: true},
{prop: 'quotaCount', label: '分配人数', sortable: true}
],
delegationTableColumns: [
{prop: 'delegationName', label: '代表团名称', sortable: true},
{prop: 'dbCount', label: '代表人数', sortable: true},
{prop: 'quotaCount', label: '分配人数', sortable: true}
],
formData: {},
formRules: {
prepareGroupQuotaCount: [{required: true, message: '必填', trigger: ['blur']}],
committeeQuotaCount: [{required: true, message: '必填', trigger: ['blur']}],
unionQuotaCount: [{required: true, message: '必填', trigger: ['blur']}],
firstTime: [{required: true, message: '必填', trigger: ['blur']}],
secondTime: [{required: true, message: '必填', trigger: ['blur']}]
prepareGroupQuotaCount: [{required: true, message: '必填', trigger: ["change", "blur"]}],
committeeQuotaCount: [{required: true, message: '必填', trigger: ["change", "blur"]}],
unionQuotaCount: [{required: true, message: '必填', trigger: ["change", "blur"]}],
delegationQuotaCount: [{required: true, message: '必填', trigger: ["change", "blur"]}],
firstTime: [{required: true, message: '必填', trigger: ["change", "blur"]}],
secondTime: [{required: true, message: '必填', trigger: ["change", "blur"]}]
}
}
},
@@ -147,7 +183,7 @@ layout("/layouts/platform.html"){
},
onHandle() {
this.$refs['form'].validate(async (valid) => {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm('您确定要提交吗?', '提示', {
confirmButtonText: '确定',
@@ -159,6 +195,11 @@ layout("/layouts/platform.html"){
this.$message.warning('各分工会名额分配数之和不能超过' + this.formData.unionQuotaCount)
return
}
const delegationTotal = this.formData.delegationQuotaList.reduce((sum, item) => sum + (item.quotaCount || 0), 0)
if (delegationTotal > this.formData.delegationQuotaCount) {
this.$message.warning('各代表团名额分配数之和不能超过' + this.formData.delegationQuotaCount)
return
}
if (this.formData.firstTime && this.formData.firstTime.length > 1) {
this.$set(this.formData, 'firstStartTime', this.formData.firstTime[0])
this.$set(this.formData, 'firstEndTime', this.formData.firstTime[1])
@@ -169,6 +210,7 @@ layout("/layouts/platform.html"){
}
this.$set(this.formData, 'teacherMeetId', this.pageForm.sessionId)
this.$set(this.formData, 'unionQuotaList', JSON.stringify(this.formData.unionQuotaList))
this.$set(this.formData, 'delegationQuotaList', JSON.stringify(this.formData.delegationQuotaList))
const resp = await this.$axios.post('/platform/executiveCommittee/executiveCommitteeConfig/onHandle', this.formData)
if (resp.code === 0) {
await this.fetchConfig()
@@ -0,0 +1,174 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="姓名/工号">
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名或工号" clearable>
</el-input>
</search-item>
<search-item label="教代会">
<el-select
v-model="pageForm.teacherMeetId"
filterable
placeholder="请选择教代会"
style="width:100%;"
@change="getAllDelegation(pageForm.teacherMeetId);doSearch()"
>
<el-option
v-for="item in teacherMeets"
:key="item.id"
:label="item.fullName"
:value="item.id"
></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="上报列表">
<el-radio-group v-model="pageForm.approval" size="small"
@change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table
ref="tableRef"
:data="tableData"
row-key="id"
@sort-change="pageOrder"
>
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号"
fixed
type="index"
width="50"></el-table-column>
<el-table-column label="工号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="代表团" prop="delegationName"></el-table-column>
<el-table-column label="所属工会" prop="unionName"></el-table-column>
<el-table-column label="所属单位" prop="unitName"></el-table-column>
<el-table-column prop="curTaskName" label="当前节点" width="120" fixed="right"></el-table-column>
<el-table-column prop="instanceState" label="流程状态" fixed="right">
<template slot-scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="250" fixed="right">
<template scope="{row}">
<el-button v-if="row.taskState === 10" @click="handleTaskAction(1,row)" size="mini"
type="primary">
通过
</el-button>
<el-button v-if="row.taskState === 10" @click="handleTaskAction(2,row)" size="mini"
type="danger">
返回修改
</el-button>
<el-button v-if="row.canRevoke||[45].includes(row.instanceState)" @click="onRevoke(row)"
size="mini"
type="danger">撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
</div>
<script>
new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
teacherMeetId: null,
unionId: null,
approval: false,
},
teacherMeets: [],
unionOptions: [],
delegations: []
}
},
async created() {
this.unionOptions = await this.$businessTool.listUnion()
await this.getAllJdh()
},
methods: {
handleTaskAction(tf_type, row) {
this.$confirm("您确定要" + (tf_type === 1 ? "通过" : "返回修改") + "吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.formData = {
bizId: row.id,
userId: row.userId,
processTaskId: row.taskId,
taskKey: row.taskKey,
taskName: row.taskName,
instanceId: row.instanceId,
submitType: tf_type,
}
this.$axios.post("/platform/executiveCommittee/pushDwSjAudit/executeTask", {
data: JSON.stringify({
...this.formData,
})
}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
getAllDelegation(id) {
this.$axios.post("/platform/teacherCongress/common/listDelegation", {sessionId: id}).then(resp => {
if (resp.code === 0) {
this.delegations = resp.data
}
})
},
getAllJdh() {
this.$axios.post("/platform/teacherCongress/common/listSession", {}).then(resp => {
if (resp.code === 0) {
this.teacherMeets = resp.data
if (this.teacherMeets && this.teacherMeets.length > 0) {
this.$set(this.pageForm, 'teacherMeetId', this.teacherMeets[0].id)
this.getAllDelegation(this.teacherMeets[0].id)
this.pageData()
}
}
})
},
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,196 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="姓名/工号">
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名或工号" clearable>
</el-input>
</search-item>
<search-item label="教代会">
<el-select
v-model="pageForm.teacherMeetId"
filterable
placeholder="请选择教代会"
style="width:100%;"
@change="getAllDelegation(pageForm.teacherMeetId);doSearch()"
>
<el-option
v-for="item in teacherMeets"
:key="item.id"
:label="item.fullName"
:value="item.id"
></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="上报列表">
<el-button
icon="el-icon-check"
size="small"
type="primary"
@click="$refs.pushFormalRef.onOpen(pageForm.teacherMeetId)"
>委员推选
</el-button>
</table-tool>
<el-table
ref="tableRef"
:data="tableData"
row-key="id"
@sort-change="pageOrder"
>
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号"
fixed
type="index"
width="50"></el-table-column>
<el-table-column label="工号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="代表团" prop="delegationName"></el-table-column>
<el-table-column label="所属工会" prop="unionName"></el-table-column>
<el-table-column label="所属单位" prop="unitName"></el-table-column>
<el-table-column prop="curTaskName" label="当前节点" width="120" fixed="right"></el-table-column>
<el-table-column prop="instanceState" label="流程状态" fixed="right">
<template slot-scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="100" fixed="right">
<template scope="{row}">
<el-button
v-if="row.instanceState!=20"
size="mini"
type="danger"
@click="onDelete(row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<union-push-formal-dialog ref="pushFormalRef" @refresh="doSearch"></union-push-formal-dialog>
</div>
<script>
<!--#include("pushFormalDialog.js"){}#-->
new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
teacherMeetId: null,
unionId: null
},
teacherMeets: [],
unionOptions: [],
delegations: []
}
},
components: {
"union-push-formal-dialog": UNION_PUSH_FORMAL_DIALOG
},
async created() {
this.unionOptions = await this.$businessTool.listUnion()
await this.getAllJdh()
},
methods: {
getAllDelegation(id) {
this.$axios.post("/platform/teacherCongress/common/listDelegation", {sessionId: id}).then(resp => {
if (resp.code === 0) {
this.delegations = resp.data
}
})
},
getAllJdh() {
this.$axios.post("/platform/teacherCongress/common/listSession", {}).then(resp => {
if (resp.code === 0) {
this.teacherMeets = resp.data
if (this.teacherMeets && this.teacherMeets.length > 0) {
this.$set(this.pageForm, 'teacherMeetId', this.teacherMeets[0].id)
this.getAllDelegation(this.teacherMeets[0].id)
this.pageData()
}
}
})
},
onDelete(row) {
this.$confirm('确定要删除该条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await this.$axios.post('/platform/executiveCommittee/unionPush/doDelete', {
id: row.id,
teacherMeetId: this.pageForm.teacherMeetId
})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
}
})
},
}
})
</script>
<style>
.pushFormDialog .el-transfer-panel__item.el-checkbox {
height: auto;
display: block;
margin-right: 0;
padding: 0 15px;
}
.pushFormDialog .el-checkbox__input {
vertical-align: top;
margin-top: 5px;
}
.pushFormDialog .transfer-item {
padding: 5px;
font-size: 12px;
border-bottom: 1px solid #f0f0f0;
}
.pushFormDialog .el-transfer-panel {
height: 60vh;
width: unset !important;
flex: 2 !important;
}
.pushFormDialog .el-transfer-panel__body {
height: calc(100% - 40px) !important;
display: flex;
flex-direction: column;
}
.pushFormDialog .el-transfer-panel__list.is-filterable {
flex: 1;
}
</style>
<!--#
}
#-->
@@ -0,0 +1,104 @@
const UNION_PUSH_FORMAL_DIALOG = {
template: /*language=HTML*/ `
<div class="pushFormDialog">
<el-dialog
:close-on-click-modal="false"
:visible.sync="dialogVisible"
title="分工会推选委员"
width="70%"
>
<el-transfer
ref="transfer"
v-model="userValue"
:data="userData"
filter-placeholder="请按姓名模糊搜索"
:filter-method="filterMethod"
:props="{key: 'userId',label: 'name'}"
:right-default-checked="rightChecked"
:titles="['可推选人员名单', '当前选择']"
filterable
class="transfer-high"
>
<div slot-scope="{ option }">
<div class="transfer-item">
<div class="transfer-item-name">{{ option.userName }} - {{ option.loginName
}} - {{option.unitName}} - {{option.unionName}}
</div>
<div class="transfer-item-details">
<span class="detail-item">
{{option.sex}}
</span>
<span class="detail-item">{{ option.age }}岁</span>
<span class="detail-item">{{ option.professionalTitle }}</span>
</div>
</div>
</div>
</el-transfer>
<span slot="footer">
<span style="color:red;font-size: 15px; display:flex;text-align: right;">推选名额:{{quotaCount}}个</span>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="onConfirm">确 定</el-button>
</span>
</span>
</el-dialog>
</div>
`,
data() {
return {
dialogVisible: false,
userValue: [],
userData: [],
rightChecked: [],
attendanceRightChecked: [],
teacherMeetId: null,
quotaCount: 0
}
},
methods: {
async onOpen(teacherMeetId) {
this.teacherMeetId = teacherMeetId
this.userValue = []
this.userData = []
const {
code,
msg,
data
} = await this.$axios.post('/platform/executiveCommittee/unionPush/getUnionUser', {teacherMeetId: teacherMeetId})
if (code === 0) {
data.userData.forEach(v => {
this.userData.push({userId: v.userId, ...v})
})
this.quotaCount = data.quotaCount
this.dialogVisible = true
} else {
this.$message.error(msg)
}
},
filterMethod(query, item) {
return item.userName.indexOf(query) > -1
},
async onConfirm() {
const {
code,
msg
} = await this.$axios.post('/platform/executiveCommittee/unionPush/addPush', {
userValue: JSON.stringify(this.userValue),
teacherMeetId: this.teacherMeetId
})
if (code === 0) {
this.dialogVisible = false
this.$message.success(msg)
this.$emit('refresh')
} else {
this.$message.error(msg)
}
}
},
style: /*language=CSS*/ `
`
}
@@ -231,7 +231,6 @@ layout("/layouts/platform.html"){
}
this.$refs.auditInfoRef.onOpen(row)
})
},
onView(row) {
this.$refs.guava.edit(() => {