两委委员会推选,分工会推选

This commit is contained in:
=
2025-11-16 17:16:09 +08:00
parent 6f9f3bd1b4
commit 63b7814e71
10 changed files with 113 additions and 101 deletions
@@ -56,19 +56,17 @@ public class ExecutiveCommitteeConfigController {
config = new ExecutiveCommitteeConfig(); config = new ExecutiveCommitteeConfig();
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
dbt.id as delegationId, sun.id as unionId,
dbt.name as delegationName, sun.name as unionName,
dbt.code as delegationCode, sun.unionCode ,
(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 vw_user where sun.id = unionId) 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 0 as quotaCount
FROM FROM
teacher_congress_delegation dbt sys_union sun
WHERE dbt.sessionId = @sessionId ORDER BY unionCode ASC
ORDER BY CODE ASC """);
""").setParam("sessionId", sessionId);
List<NutMap> listMap = committeeConfigService.listMap(sql); List<NutMap> listMap = committeeConfigService.listMap(sql);
config.setDelegationQuotaList(listMap); config.setUnionQuotaList(listMap);
} }
return Result.success(config); return Result.success(config);
} }
@@ -41,13 +41,13 @@ import java.util.stream.Collectors;
/** /**
* @author zhf * @author zhf
* @date 2025/8/25 15:18 * @date 2025/8/25 15:18
* @description 团长一次推选 * @description 分工会一次推选
*/ */
@IocBean @IocBean
@At("/platform/executiveCommittee/delegationOnePush") @At("/platform/executiveCommittee/delegationOnePush")
@Ok("json:full") @Ok("json:full")
@Slf4j @Slf4j
@Api(tags = "执委会推选-团长一次推选") @Api(tags = "执委会推选-分工会主席一次推选")
public class ExecutiveCommitteeDelegationOnePushController { public class ExecutiveCommitteeDelegationOnePushController {
@Inject @Inject
@@ -61,8 +61,9 @@ public class ExecutiveCommitteeDelegationOnePushController {
public void index() { public void index() {
} }
@At @At
@ApiOperation("查询某个代表团的团长一次推选的委员") @ApiOperation("查询某个分工会的一次推选的委员")
@SaCheckPermission("executiveCommittee.delegationOnePush") @SaCheckPermission("executiveCommittee.delegationOnePush")
public Result pageData(PageForm pageForm, public Result pageData(PageForm pageForm,
String teacherMeetId, String teacherMeetId,
@@ -91,19 +92,13 @@ public class ExecutiveCommitteeDelegationOnePushController {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId); cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
if (StpUtil.hasRole(RoleConstant.SYSADMIN.name()) || if (StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) { StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
cnd.andEX("t1.delegationId", "=", delegationId); StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
}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", "=", unionId); cnd.andEX("t3.id", "=", unionId);
}else{
cnd.andEX("t3.id", "=", SecurityUtil.getUnionId());
}
cnd.andEX("t1.delegationId", "=", delegationId);
cnd.andEX("t1.addType", "=", 1); cnd.andEX("t1.addType", "=", 1);
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup(); SqlExpressionGroup group = new SqlExpressionGroup();
@@ -121,11 +116,10 @@ public class ExecutiveCommitteeDelegationOnePushController {
@ApiOperation("查询可以推选委员和已经推选的人员") @ApiOperation("查询可以推选委员和已经推选的人员")
@SaCheckPermission("executiveCommittee.delegationOnePush") @SaCheckPermission("executiveCommittee.delegationOnePush")
public Result getDelegationUser(String teacherMeetId) { public Result getDelegationUser(String teacherMeetId) {
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
if (ObjectUtil.isEmpty(db)) { return Result.error("没有权限,只有分工会主席才能推选");
return Result.error("没有权限,只有代表团团长才能推选");
} }
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
Cnd.where(ExecutiveCommitteeConfig::getTeacherMeetId, "=", teacherMeetId)); Cnd.where(ExecutiveCommitteeConfig::getTeacherMeetId, "=", teacherMeetId));
@@ -144,11 +138,6 @@ public class ExecutiveCommitteeDelegationOnePushController {
List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW()); List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW());
List<String> userIds = onePushList.stream().map(v -> v.getUserId()).collect(Collectors.toList()); 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(""" Sql sql = Sqls.create("""
SELECT SELECT
db.*, db.*,
@@ -160,29 +149,33 @@ public class ExecutiveCommitteeDelegationOnePushController {
LEFT JOIN `vw_user` u ON db.userId = u.id LEFT JOIN `vw_user` u ON db.userId = u.id
$condition $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); sql.setCondition(cnd);
List<NutMap> userData = baseService.listMap(sql); List<NutMap> userData = baseService.listMap(sql);
List<NutMap> delegationQuotaList = config.getDelegationQuotaList(); List<NutMap> unionQuotaList = config.getUnionQuotaList();
NutMap delegationQuota = delegationQuotaList.stream().filter(v -> v.get("delegationId").equals(db.getDelegationId())).findFirst().orElse(null); NutMap unionQuota = unionQuotaList.stream().filter(v -> v.get("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null);
if (Lang.isNotEmpty(delegationQuota)) { if (Lang.isNotEmpty(unionQuota)) {
return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", delegationQuota.getInt("quotaCount"))); return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", unionQuota.getInt("quotaCount")));
} }
return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", 0)); return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", 0));
} }
@At @At
@SaCheckPermission("executiveCommittee.delegationOnePush") @SaCheckPermission("executiveCommittee.delegationOnePush")
@SLog(tag = "执委会推选-团长推选委员", msg = "推选委员") @SLog(tag = "执委会推选-分工会主席推选委员", msg = "推选委员")
public Result addOnePush(@Param("userValue") String[] userValue, public Result addOnePush(@Param("userValue") String[] userValue,
String teacherMeetId) { String teacherMeetId) {
try { try {
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
if (ObjectUtil.isEmpty(db)) { return Result.error("没有权限,只有分工会主席才能推选");
return Result.error("没有权限,只有代表团团长才能推选");
} }
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
@@ -196,19 +189,20 @@ public class ExecutiveCommitteeDelegationOnePushController {
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) { if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
return Result.error("一次预选已结束"); return Result.error("一次预选已结束");
} }
List<NutMap> delegationQuotaList = config.getDelegationQuotaList(); List<NutMap> unionQuotaList = config.getUnionQuotaList();
NutMap delegationQuota = delegationQuotaList.stream().filter(v -> v.getString("delegationId").equals(db.getDelegationId())).findFirst().orElse(null); NutMap unionQuota = unionQuotaList.stream().filter(v -> v.getString("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null);
if (ObjectUtil.isEmpty(delegationQuota)) { if (ObjectUtil.isEmpty(unionQuota)) {
return Result.error("请先配置代表团人数"); return Result.error("请先配置分工会人数");
} }
int dbCount = dao.count(ExecutiveCommitteeOnePush.class, int dbCount = dao.count(ExecutiveCommitteeOnePush.class,
Cnd.where("delegationId", "=", db.getDelegationId()) Cnd.where("unionId", "=", SecurityUtil.getUnionId())
.and("teacherMeetId", "=", teacherMeetId) .and("teacherMeetId", "=", teacherMeetId)
.and("addType", "=", 1)); .and("addType", "=", 1));
if (dbCount + userValue.length > delegationQuota.getInt("quotaCount")) { assert unionQuota != null;
return Result.error("推选人数限制" + delegationQuota.getInt("quotaCount") + ""); if (dbCount + userValue.length > unionQuota.getInt("quotaCount")) {
return Result.error("推选人数限制" + unionQuota.getInt("quotaCount") + "");
} }
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -236,6 +230,7 @@ public class ExecutiveCommitteeDelegationOnePushController {
onePush.setUserName(jdhDb.getString("userName")); onePush.setUserName(jdhDb.getString("userName"));
onePush.setLoginName(jdhDb.getString("loginName")); onePush.setLoginName(jdhDb.getString("loginName"));
onePush.setDelegationId(jdhDb.getString("delegationId")); onePush.setDelegationId(jdhDb.getString("delegationId"));
onePush.setUnionId(jdhDb.getString("unionId"));
onePush.setUnitId(jdhDb.getString("unitId")); onePush.setUnitId(jdhDb.getString("unitId"));
onePush.setTeacherMeetId(teacherMeetId); onePush.setTeacherMeetId(teacherMeetId);
String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName"))); String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName")));
@@ -253,7 +248,7 @@ public class ExecutiveCommitteeDelegationOnePushController {
@At @At
@SaCheckPermission("executiveCommittee.delegationOnePush") @SaCheckPermission("executiveCommittee.delegationOnePush")
@SLog(tag = "执委会推选-团长推选委员", msg = "删除推选的人") @SLog(tag = "执委会推选-分工会主席推选委员", msg = "删除推选的人")
public Result doDelete(@Valid String id, @Valid String teacherMeetId) { public Result doDelete(@Valid String id, @Valid String teacherMeetId) {
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
Cnd.where("teacherMeetId", "=", teacherMeetId)); Cnd.where("teacherMeetId", "=", teacherMeetId));
@@ -1,10 +1,12 @@
package com.budwk.app.zhgh.democratic.executiveCommittee.controller; package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog; 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.param.PageForm;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService; import com.budwk.app.base.service.BaseService;
@@ -34,7 +36,7 @@ import java.util.stream.Collectors;
/** /**
* @author zhf * @author zhf
* @date 2025/6/23 15:25 * @date 2025/6/23 15:25
* @description 团长二次推选 * @description 分工会二次推选
*/ */
@At("/platform/executiveCommittee/delegationTwoPush") @At("/platform/executiveCommittee/delegationTwoPush")
@Ok("json:full") @Ok("json:full")
@@ -87,7 +89,13 @@ public class ExecutiveCommitteeDelegationTwoPushController {
cnd.andEX("t1.pushUserId", "=", SecurityUtil.getUserId()); cnd.andEX("t1.pushUserId", "=", SecurityUtil.getUserId());
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId); cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
cnd.andEX("t2.delegationId", "=", delegationId); cnd.andEX("t2.delegationId", "=", delegationId);
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); cnd.andEX("t4.id", "=", unionId);
} else {
cnd.andEX("t4.id", "=", SecurityUtil.getUnionId());
}
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup group = new SqlExpressionGroup(); SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("t2.userName", pageForm.getSearchKeyword()); group.orLike("t2.userName", pageForm.getSearchKeyword());
@@ -101,13 +109,12 @@ public class ExecutiveCommitteeDelegationTwoPushController {
@At @At
@SaCheckPermission("executiveCommittee.delegationTwoPush") @SaCheckPermission("executiveCommittee.delegationTwoPush")
@SLog(type = "执委会推选-团长二次推选", tag = "查询可以二次推选的名单", param = true, result = true) @SLog(type = "执委会推选-分工会二次推选", tag = "查询可以二次推选的名单", param = true, result = true)
public Result getDelegationUser(String teacherMeetId) { public Result getDelegationUser(String teacherMeetId) {
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
if (ObjectUtil.isEmpty(db)) { return Result.error("没有权限,只有分工会主席才能推选");
return Result.error("没有权限,只有代表团团长才能推选");
} }
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
Cnd.where("teacherMeetId", "=", teacherMeetId)); Cnd.where("teacherMeetId", "=", teacherMeetId));
@@ -125,10 +132,7 @@ public class ExecutiveCommitteeDelegationTwoPushController {
.and("pushUserId", "=", SecurityUtil.getUserId())); .and("pushUserId", "=", SecurityUtil.getUserId()));
List<String> userIds = userValue.stream().map(v -> v.getUserId()).collect(Collectors.toList()); List<String> 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(""" Sql sql = Sqls.create("""
SELECT SELECT
t1.*, t1.*,
@@ -144,23 +148,26 @@ public class ExecutiveCommitteeDelegationTwoPushController {
LEFT JOIN `vw_user` t2 ON t1.userId = t2.id LEFT JOIN `vw_user` t2 ON t1.userId = t2.id
$condition $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); sql.setCondition(cnd);
List<NutMap> userData = baseService.listMap(sql); List<NutMap> 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 @At
@SaCheckPermission("executiveCommittee.delegationTwoPush") @SaCheckPermission("executiveCommittee.delegationTwoPush")
@ApiOperation("推选委员") @ApiOperation("推选委员")
@SLog(tag = "执委会推选-团长二次推选", msg = "推选委员") @SLog(tag = "执委会推选-分工会二次推选", msg = "推选委员")
public Result addOnePush(@Param("userValue") String[] userValue, public Result addOnePush(@Param("userValue") String[] userValue,
String teacherMeetId) { String teacherMeetId) {
try { try {
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class, if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId) StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())); StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
if (ObjectUtil.isEmpty(db)) { return Result.error("没有权限,只有分工会主席才能推选");
return Result.error("没有权限,只有代表团团长才能推选");
} }
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
@@ -193,7 +200,8 @@ public class ExecutiveCommitteeDelegationTwoPushController {
ExecutiveCommitteeTwoPush twoPush = new ExecutiveCommitteeTwoPush(); ExecutiveCommitteeTwoPush twoPush = new ExecutiveCommitteeTwoPush();
twoPush.setPushDate(DateUtil.date()); twoPush.setPushDate(DateUtil.date());
twoPush.setUserId(id); twoPush.setUserId(id);
twoPush.setPushDelegationId(db.getDelegationId()); twoPush.setPushDelegationId(jdhDb.getDelegationId());
twoPush.setPushUnionId(SecurityUtil.getUnionId());
twoPush.setPushUserId(SecurityUtil.getUserId()); twoPush.setPushUserId(SecurityUtil.getUserId());
twoPush.setPushUserName(SecurityUtil.getUserUsername()); twoPush.setPushUserName(SecurityUtil.getUserUsername());
twoPush.setPushLoginName(SecurityUtil.getUserLoginname()); twoPush.setPushLoginName(SecurityUtil.getUserLoginname());
@@ -211,7 +219,7 @@ public class ExecutiveCommitteeDelegationTwoPushController {
@At @At
@ApiOperation("删除推选人员") @ApiOperation("删除推选人员")
@SaCheckPermission("executiveCommittee.delegationTwoPush") @SaCheckPermission("executiveCommittee.delegationTwoPush")
@SLog(tag = "执委会推选-团长二次推选", msg = "删除推选人员") @SLog(tag = "执委会推选-分工会二次推选", msg = "删除推选人员")
public Result doDelete(@Valid String id, @Valid String teacherMeetId) { public Result doDelete(@Valid String id, @Valid String teacherMeetId) {
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class, ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
Cnd.where("teacherMeetId", "=", teacherMeetId)); Cnd.where("teacherMeetId", "=", teacherMeetId));
@@ -182,6 +182,7 @@ public class ExecutiveCommitteePushController {
onePush.setUserName(jdhDb.getString("userName")); onePush.setUserName(jdhDb.getString("userName"));
onePush.setLoginName(jdhDb.getString("loginName")); onePush.setLoginName(jdhDb.getString("loginName"));
onePush.setDelegationId(jdhDb.getString("delegationId")); onePush.setDelegationId(jdhDb.getString("delegationId"));
onePush.setUnionId(jdhDb.getString("unionId"));
onePush.setUnitId(jdhDb.getString("unitId")); onePush.setUnitId(jdhDb.getString("unitId"));
onePush.setTeacherMeetId(teacherMeetId); onePush.setTeacherMeetId(teacherMeetId);
String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName"))); String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName")));
@@ -47,9 +47,9 @@ public class ExecutiveCommitteeConfig extends BaseModel implements Serializable
private Integer committeeQuotaCount; private Integer committeeQuotaCount;
@Column @Column
@Comment("代表团推荐名额总数") @Comment("分工会推荐名额总数")
@ColDefine(type = ColType.INT) @ColDefine(type = ColType.INT)
private Integer delegationQuotaCount; private Integer unionQuotaCount;
@Column @Column
@Comment("一次预选开始时间") @Comment("一次预选开始时间")
@@ -72,8 +72,8 @@ public class ExecutiveCommitteeConfig extends BaseModel implements Serializable
private DateTime secondEndTime; private DateTime secondEndTime;
@Column @Column
@Comment("代表团名额数") @Comment("分工会名额数")
@ColDefine(type = ColType.MYSQL_JSON) @ColDefine(type = ColType.MYSQL_JSON)
private List<NutMap> delegationQuotaList; private List<NutMap> unionQuotaList;
} }
@@ -42,6 +42,11 @@ public class ExecutiveCommitteeOnePush extends BaseModel implements Serializable
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String delegationId; private String delegationId;
@Column
@Comment("所属分工会")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column @Column
@Comment("姓名") @Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 20) @ColDefine(type = ColType.VARCHAR, width = 20)
@@ -37,6 +37,11 @@ public class ExecutiveCommitteeTwoPush extends BaseModel implements Serializable
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
private String teacherMeetId; private String teacherMeetId;
@Column
@Comment("推选的分工会")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String pushUnionId;
@Column @Column
@Comment("推选的代表团") @Comment("推选的代表团")
@ColDefine(type = ColType.VARCHAR, width = 32) @ColDefine(type = ColType.VARCHAR, width = 32)
@@ -4,7 +4,7 @@ const DELEGATION_ONE_PUSH_FORMAL_DIALOG = {
<el-dialog <el-dialog
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
title="团长推选委员" title="分工会推选委员"
width="70%" width="70%"
> >
@@ -24,7 +24,7 @@ const DELEGATION_ONE_PUSH_FORMAL_DIALOG = {
<div slot-scope="{ option }"> <div slot-scope="{ option }">
<div class="transfer-item"> <div class="transfer-item">
<div class="transfer-item-name">{{ option.userName }} - {{ option.loginName <div class="transfer-item-name">{{ option.userName }} - {{ option.loginName
}} - {{option.unitName}} }} - {{option.unitName}} - {{option.unionName}}
</div> </div>
<div class="transfer-item-details"> <div class="transfer-item-details">
<span class="detail-item"> <span class="detail-item">
@@ -4,7 +4,7 @@ const DELEGATION_TWO_PUSH_FORMAL_DIALOG = {
<el-dialog <el-dialog
:close-on-click-modal="false" :close-on-click-modal="false"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
title="团长最终投票" title="分工会最终投票"
width="70%" width="70%"
> >
@@ -36,7 +36,7 @@ const DELEGATION_TWO_PUSH_FORMAL_DIALOG = {
</div> </div>
</el-transfer> </el-transfer>
<span slot="footer"> <span slot="footer">
<span style="color:red;font-size: 15px; display:flex;text-align: right;">投票名额:{{delegationQuotaCount}}个</span> <span style="color:red;font-size: 15px; display:flex;text-align: right;">投票名额:{{committeeQuotaCount}}个</span>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="onConfirm">确 定</el-button> <el-button type="primary" @click="onConfirm">确 定</el-button>
@@ -53,7 +53,7 @@ const DELEGATION_TWO_PUSH_FORMAL_DIALOG = {
rightChecked: [], rightChecked: [],
attendanceRightChecked: [], attendanceRightChecked: [],
teacherMeetId: null, teacherMeetId: null,
delegationQuotaCount: 0 committeeQuotaCount: 0
} }
}, },
methods: { methods: {
@@ -70,7 +70,7 @@ const DELEGATION_TWO_PUSH_FORMAL_DIALOG = {
data.userData.forEach(v => { data.userData.forEach(v => {
this.userData.push({userId: v.userId, ...v}) this.userData.push({userId: v.userId, ...v})
}) })
this.delegationQuotaCount = data.delegationQuotaCount this.committeeQuotaCount = data.committeeQuotaCount
this.dialogVisible = true this.dialogVisible = true
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@@ -32,9 +32,9 @@ layout("/layouts/platform.html"){
style="width: 100%"></el-input-number> style="width: 100%"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="delegationQuotaCount" label="代表团推荐总数"> <el-form-item prop="unionQuotaCount" label="分工会推荐总数">
<el-input-number v-model="formData.delegationQuotaCount" <el-input-number v-model="formData.unionQuotaCount"
placeholder="请填写代表团推荐名额总数" style="width: 100%"></el-input-number> placeholder="请填写分工会推荐名额总数" style="width: 100%"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="committeeQuotaCount" label="委员会预选人数"> <el-form-item prop="committeeQuotaCount" label="委员会预选人数">
<el-input-number v-model="formData.committeeQuotaCount" <el-input-number v-model="formData.committeeQuotaCount"
@@ -63,8 +63,8 @@ layout("/layouts/platform.html"){
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<table-tool label="代表团名额分配"></table-tool> <table-tool label="分工会名额分配"></table-tool>
<el-table :data="formData.delegationQuotaList" show-summar size="mini" max-height="500"> <el-table :data="formData.unionQuotaList" show-summar size="mini" max-height="500">
<el-table-column <el-table-column
align="center" align="center"
header-align="center" header-align="center"
@@ -108,20 +108,20 @@ layout("/layouts/platform.html"){
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
teacherMeets:[], teacherMeets: [],
pageForm: { pageForm: {
sessionId: '' sessionId: ''
}, },
tableColumns: [ tableColumns: [
{prop: 'delegationName', label: '代表团名称', sortable: true}, {prop: 'unionName', label: '分工会名称', sortable: true},
{prop: 'dbCount', label: '代表人数', sortable: true}, {prop: 'memberCount', label: '代表人数', sortable: true},
{prop: 'quotaCount', label: '分配人数', sortable: true} {prop: 'quotaCount', label: '分配人数', sortable: true}
], ],
formData: {}, formData: {},
formRules: { formRules: {
prepareGroupQuotaCount: [{required: true, message: '必填', trigger: ['blur']}], prepareGroupQuotaCount: [{required: true, message: '必填', trigger: ['blur']}],
committeeQuotaCount: [{required: true, message: '必填', trigger: ['blur']}], committeeQuotaCount: [{required: true, message: '必填', trigger: ['blur']}],
delegationQuotaCount: [{required: true, message: '必填', trigger: ['blur']}], unionQuotaCount: [{required: true, message: '必填', trigger: ['blur']}],
firstTime: [{required: true, message: '必填', trigger: ['blur']}], firstTime: [{required: true, message: '必填', trigger: ['blur']}],
secondTime: [{required: true, message: '必填', trigger: ['blur']}] secondTime: [{required: true, message: '必填', trigger: ['blur']}]
} }
@@ -154,9 +154,9 @@ layout("/layouts/platform.html"){
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
const total = this.formData.delegationQuotaList.reduce((sum, item) => sum + (item.quotaCount || 0), 0) const total = this.formData.unionQuotaList.reduce((sum, item) => sum + (item.quotaCount || 0), 0)
if (total > this.formData.delegationQuotaCount) { if (total > this.formData.unionQuotaCount) {
this.$message.warning('各代表团名额分配数之和不能超过' + this.formData.delegationQuotaCount) this.$message.warning('各分工会名额分配数之和不能超过' + this.formData.unionQuotaCount)
return return
} }
if (this.formData.firstTime && this.formData.firstTime.length > 1) { if (this.formData.firstTime && this.formData.firstTime.length > 1) {
@@ -168,7 +168,7 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'secondEndTime', this.formData.secondTime[1]) this.$set(this.formData, 'secondEndTime', this.formData.secondTime[1])
} }
this.$set(this.formData, 'teacherMeetId', this.pageForm.sessionId) this.$set(this.formData, 'teacherMeetId', this.pageForm.sessionId)
this.$set(this.formData, 'delegationQuotaList', JSON.stringify(this.formData.delegationQuotaList)) this.$set(this.formData, 'unionQuotaList', JSON.stringify(this.formData.unionQuotaList))
const resp = await this.$axios.post('/platform/executiveCommittee/executiveCommitteeConfig/onHandle', this.formData) const resp = await this.$axios.post('/platform/executiveCommittee/executiveCommitteeConfig/onHandle', this.formData)
if (resp.code === 0) { if (resp.code === 0) {
await this.fetchConfig() await this.fetchConfig()