This commit is contained in:
2025-11-25 19:18:07 +08:00
parent f49054ac92
commit 21e24ef703
21 changed files with 643 additions and 47 deletions
@@ -1,5 +1,6 @@
package com.budwk.app.flow.handler; package com.budwk.app.flow.handler;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.flow.engine.AssignmentHandler; import com.budwk.app.flow.engine.AssignmentHandler;
import com.budwk.app.flow.engine.core.Execution; import com.budwk.app.flow.engine.core.Execution;
@@ -27,6 +28,10 @@ public class FlowUnitPartySecretaryHandler implements AssignmentHandler {
@Override @Override
public List<String> assign(TaskModel model, Execution execution) { public List<String> assign(TaskModel model, Execution execution) {
String unitId = SecurityUtil.getUnitId(); String unitId = SecurityUtil.getUnitId();
String argsUnitId = execution.getArgs().getStr("argsUnitId");
if (StrUtil.isNotBlank(argsUnitId)){
unitId = argsUnitId;
}
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class); SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
Sys_role role = sysRoleService.getByCode(RoleConstant.UNIT_PARTY_SECRETARY); Sys_role role = sysRoleService.getByCode(RoleConstant.UNIT_PARTY_SECRETARY);
@@ -45,7 +50,7 @@ public class FlowUnitPartySecretaryHandler implements AssignmentHandler {
@Override @Override
public String getMessage() { public String getMessage() {
return "获取当前登录用户所在单位党委书记"; return "获取当前登录用户所在单位党委书记(如果argsUnitId存在则查询argsUnitId单位的党委书记)";
} }
@Override @Override
@@ -25,6 +25,7 @@ import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_con
import com.budwk.app.zhgh.democratic.teachercongress.delegate.param.*; import com.budwk.app.zhgh.democratic.teachercongress.delegate.param.*;
import com.budwk.app.zhgh.democratic.teachercongress.delegate.service.TeacherCongressDelegateService; import com.budwk.app.zhgh.democratic.teachercongress.delegate.service.TeacherCongressDelegateService;
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation; import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_union;
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_unit; import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_unit;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -249,7 +250,7 @@ public class TeacherCongressDelegateManageController {
vw_user u vw_user u
LEFT JOIN teacher_congress_delegate tcd ON tcd.userId = u.id LEFT JOIN teacher_congress_delegate tcd ON tcd.userId = u.id
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("u.username", param.getKeyWord()); seg.orLike("u.username", param.getKeyWord());
@@ -478,5 +479,46 @@ public class TeacherCongressDelegateManageController {
return Result.success(excelImportRes); return Result.success(excelImportRes);
} }
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("tc.delegate.manage")
public Result doAllocateDelegation(String sessionId) {
List<Teacher_congress_delegate> delegateList = dao.query(Teacher_congress_delegate.class,
Cnd.where(Teacher_congress_delegate::getSessionId, "=", sessionId)
.and(Teacher_congress_delegate::getDelegationId, "is", null));
for (Teacher_congress_delegate delegate : delegateList) {
Teacher_congress_delegation_unit delegation_unit = dao.fetch(Teacher_congress_delegation_unit.class,
Cnd.where(Teacher_congress_delegation_unit::getUnitId, "=", delegate.getUnitId())
.and(Teacher_congress_delegation_union::getSessionId, "=", sessionId));
if (ObjectUtil.isNotEmpty(delegation_unit)) {
delegate.setDelegationId(delegation_unit.getDelegationId());
dao.update(delegate);
Sys_user_role userRole = new Sys_user_role();
userRole.setTcDelegationId(delegation_unit.getDelegationId());
Sys_role sys_role = dao.fetch(Sys_role.class, Cnd.where(Sys_role::getCode, "=", RoleConstant.TEACHER_CONGRESS_DELEGATE_FORMAL.name()));
if (sys_role.getId().equals(delegate.getRoleId())) {
delegate.setRoleId(sys_role.getId());
userRole.setRoleId(sys_role.getId());
}
Sys_role sys_role2 = dao.fetch(Sys_role.class, Cnd.where(Sys_role::getCode, "=", RoleConstant.TEACHER_CONGRESS_DELEGATE_ATTENDANCE.name()));
if (sys_role2.getId().equals(delegate.getRoleId())) {
delegate.setRoleId(sys_role2.getId());
userRole.setRoleId(sys_role2.getId());
}
userRole.setTcDelegationId(delegate.getDelegationId());
dao.insert(userRole);
}
sysUserService.clearCache();
}
return Result.success();
}
} }
@@ -49,6 +49,7 @@ import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
@@ -132,7 +133,7 @@ public class TeacherCongressDelegatePushController {
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("info.sessionId", "=", sessionId); cnd.andEX("info.sessionId", "=", sessionId);
cnd.andEX("info.unionId", "=", unionId); cnd.andEX("info.pushUnionId", "=", unionId);
if (!"全部".equals(isFormalOrAttendance)) { if (!"全部".equals(isFormalOrAttendance)) {
cnd.and("info.representativeType", "=", isFormalOrAttendance); cnd.and("info.representativeType", "=", isFormalOrAttendance);
@@ -146,7 +147,7 @@ public class TeacherCongressDelegatePushController {
cnd.desc("info.createdAt"); cnd.desc("info.createdAt");
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) { if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
if (AuthUtil.hasRole(RoleConstant.UNIT_PARTY_SECRETARY.name())) { if (AuthUtil.hasRole(RoleConstant.UNIT_PARTY_SECRETARY.name())) {
cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId()); cnd.andEX("info.pushUnionId", "=", SecurityUtil.getUnionId());
} else { } else {
cnd.and("info.createdBy", "=", SecurityUtil.getUserId()); cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
} }
@@ -174,12 +175,17 @@ public class TeacherCongressDelegatePushController {
cndx.andEX("unionId", "=", SecurityUtil.getUnionId()); cndx.andEX("unionId", "=", SecurityUtil.getUnionId());
List<TeacherCongressDelegatePush> delegateList = dao.query(TeacherCongressDelegatePush.class, cndx); List<TeacherCongressDelegatePush> delegateList = dao.query(TeacherCongressDelegatePush.class, cndx);
List<String> userIds = delegateList.stream().map(TeacherCongressDelegatePush::getUserId).toList(); List<String> userIds = delegateList.stream().map(TeacherCongressDelegatePush::getUserId).toList();
Teacher_congress_quota_allocation quota_allocation = dao.fetch(Teacher_congress_quota_allocation.class,
Cnd.where(Teacher_congress_quota_allocation::getUnionId, "=", SecurityUtil.getUnionId())
.and(Teacher_congress_quota_allocation::getSessionId, "=", sessionId));
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
u.id AS userId, u.id AS userId,
u.loginname as loginName, u.loginname as loginName,
u.username as userName, u.username as userName,
u.professionalTitle, u.professionalTitle,
u.professionalLevel, u.professionalLevel,
u.sex, u.sex,
u.birthday, u.birthday,
@@ -202,7 +208,21 @@ public class TeacherCongressDelegatePushController {
cnd.and("tcdp.id", "is", null); cnd.and("tcdp.id", "is", null);
cnd.and("u.unionId", "=", SecurityUtil.getUnionId()); cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
sql.setCondition(cnd); sql.setCondition(cnd);
List userList = baseService.listMap(sql); List<NutMap> userList = baseService.listMap(sql);
TeacherCongressDelegatePush oredElse = delegateList.stream().filter(d -> d.getLoginName().equals(quota_allocation.getSchoolLeadersLoginName())).findFirst().orElse(null);
if (Lang.isNotEmpty(oredElse)) {
View_user schoolLeader = dao.fetch(View_user.class, Cnd.where(View_user::getLoginname, "=", quota_allocation.getSchoolLeadersLoginName()));
userList.add(0, NutMap.NEW().setv("userId", schoolLeader.getId())
.setv("loginName", schoolLeader.getLoginname())
.setv("userName", schoolLeader.getUsername())
.setv("professionalTitle", schoolLeader.getProfessionalTitle())
.setv("professionalLevel", schoolLeader.getProfessionalLevel())
.setv("sex", schoolLeader.getSex())
.setv("nation", schoolLeader.getNation())
);
}
return Result.success(Map.of("userData", userList, "userValue", delegateList)); return Result.success(Map.of("userData", userList, "userValue", delegateList));
} }
@@ -212,6 +232,9 @@ public class TeacherCongressDelegatePushController {
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@ApiOperation("推选代表") @ApiOperation("推选代表")
public Object addPreselectionDb(@Param("userValue") String[] userValue, String sessionId, String representativeType) { public Object addPreselectionDb(@Param("userValue") String[] userValue, String sessionId, String representativeType) {
Teacher_congress_quota_allocation quota_allocation = dao.fetch(Teacher_congress_quota_allocation.class,
Cnd.where(Teacher_congress_quota_allocation::getUnionId, "=", SecurityUtil.getUnionId())
.and(Teacher_congress_quota_allocation::getSessionId, "=", sessionId));
List<TeacherCongressDelegatePush> list = new ArrayList<>(); List<TeacherCongressDelegatePush> list = new ArrayList<>();
for (String id : userValue) { for (String id : userValue) {
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", id)); View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", id));
@@ -230,6 +253,8 @@ public class TeacherCongressDelegatePushController {
tmd.setPolitical(user.getPolitical()); tmd.setPolitical(user.getPolitical());
tmd.setProfessionalTitle(user.getProfessionalTitle()); tmd.setProfessionalTitle(user.getProfessionalTitle());
tmd.setProfessionalLevel(user.getProfessionalLevel()); tmd.setProfessionalLevel(user.getProfessionalLevel());
tmd.setPushUnionId(SecurityUtil.getUnionId());
tmd.setPushUnitId(SecurityUtil.getUnitId());
tmd.setBirthday(user.getBirthday()); tmd.setBirthday(user.getBirthday());
tmd.setUnitId(user.getUnitId()); tmd.setUnitId(user.getUnitId());
@@ -244,6 +269,9 @@ public class TeacherCongressDelegatePushController {
tmd.setIntermediateBelow(false); tmd.setIntermediateBelow(false);
tmd.setCadre(false); tmd.setCadre(false);
tmd.setWorker(false); tmd.setWorker(false);
if (Lang.isNotEmpty(quota_allocation.getSchoolLeadersLoginName()) && quota_allocation.getSchoolLeadersLoginName().equals(user.getLoginname())) {
tmd.setSchoolLeader(true);
}
tmd.setMobile(user.getMobile()); tmd.setMobile(user.getMobile());
@@ -310,7 +338,7 @@ public class TeacherCongressDelegatePushController {
@At @At
@ApiOperation("本单位代表上报情况") @ApiOperation("本单位代表上报情况")
@SaCheckPermission(value = {"tc.delegate.push", "tc.delegate.push.dwSjAudit"}, mode = SaMode.OR) @SaCheckPermission(value = {"tc.delegate.push", "tc.delegate.push.dwSjAudit"}, mode = SaMode.OR)
public Result selfUnionPushMetric(String sessionId, String unionId,String submitType) { public Result selfUnionPushMetric(String sessionId, String unionId, String submitType) {
if (StrUtil.isBlank(unionId)) { if (StrUtil.isBlank(unionId)) {
unionId = SecurityUtil.getUnionId(); unionId = SecurityUtil.getUnionId();
} }
@@ -334,9 +362,9 @@ public class TeacherCongressDelegatePushController {
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
SqlExpressionGroup group = new SqlExpressionGroup(); SqlExpressionGroup group = new SqlExpressionGroup();
if (submitType.equals("JG")){ if (submitType.equals("JG")) {
group.or("t.taskName", "=", "tcDelegatePushDwSjTj"); group.or("t.taskName", "=", "tcDelegatePushDwSjTj");
}else{ } else {
group.or("t.taskName", "=", "tcDelegatePushUnion"); group.or("t.taskName", "=", "tcDelegatePushUnion");
} }
group.or("t.taskName", "=", "tcDelegatePushZg"); group.or("t.taskName", "=", "tcDelegatePushZg");
@@ -345,6 +373,7 @@ public class TeacherCongressDelegatePushController {
cnd.and("ins.state", "!=", ProcessInstanceStateEnum.REJECT.getCode()); cnd.and("ins.state", "!=", ProcessInstanceStateEnum.REJECT.getCode());
cnd.andEX("info.sessionId", "=", sessionId); cnd.andEX("info.sessionId", "=", sessionId);
cnd.andEX("info.unionId", "=", unionId); cnd.andEX("info.unionId", "=", unionId);
cnd.andEX("info.schoolLeader", "!=", 1);
cnd.andEX("info.representativeType", "=", "正式代表"); cnd.andEX("info.representativeType", "=", "正式代表");
sql.setCondition(cnd); sql.setCondition(cnd);
List<NutMap> writeList = baseService.listMap(sql); List<NutMap> writeList = baseService.listMap(sql);
@@ -154,7 +154,7 @@ public class TeacherCongressDelegatePushDwSjAuditController {
} }
teacherCongressDelegatePushService.batchSubmit("XY", sessionId); teacherCongressDelegatePushService.batchSubmit("XY", sessionId);
return null; return Result.success();
} }
@@ -0,0 +1,149 @@
package com.budwk.app.zhgh.democratic.teachercongress.delegate.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
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.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
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.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @author zhf
* @date 2025/11/25 15:24
* @description 推选统计
*/
@IocBean
@At("/platform/teacherCongress/delegate/push/statistics")
@Ok("json:full")
@Slf4j
@Api(value = "/platform/teacherCongress/delegate/push/statistics", tags = "推选统计")
public class TeacherCongressDelegatePushStatisticsController {
@At("")
@Ok("beetl:/platform/zhgh/democratic/teachercongress/delegate/push/statistics.html")
@SaCheckPermission("tc.delegate.push.statistics")
public void index() {
}
@Inject
private BaseService baseService;
@At
@ApiOperation("分页查询")
@SaCheckPermission("tc.delegate.push.statistics")
public Result getData(@Param(value = "sessionId") String sessionId,
@Param(value = "unionId") String unionId) {
Sql sql = Sqls.create("""
SELECT
un.id unionId,
tcqa.sessionId,
un.`name` unionName,
tcqa.allocationNum,
su.username schoolLeadersUserName,
(SELECT COUNT(*) FROM teacher_congress_delegate_push WHERE sessionId = tcqa.sessionId AND pushUnionId = un.id) unionPushCount
FROM
`teacher_congress_quota_allocation` tcqa
LEFT JOIN sys_union un ON un.id = tcqa.unionId
LEFT JOIN sys_user su ON su.loginname=tcqa.schoolLeadersLoginName
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("un.id", "=", unionId);
cnd.and("tcqa.sessionId", "=", sessionId);
cnd.asc("un.unionCode");
sql.setCondition(cnd);
List<NutMap> map = baseService.listMap(sql);
Sql sql2 = getSql(new PageForm(), sessionId, null);
List<NutMap> map2 = baseService.listMap(sql2);
for (NutMap nutMap : map) {
int sjWshCount = map2.stream().filter(m -> StrUtil.isNotBlank(m.getString("taskKey"))
&& m.getString("taskKey").equals("tcDelegatePushDwSj")
&& m.getString("pushUnionId").equals(nutMap.getString("unionId"))).toList().size();
nutMap.setv("sjWshCount", sjWshCount);
}
return Result.success(map);
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("tc.delegate.push.statistics")
public Result pageData(PageForm pageForm,
@Param(value = "sessionId") String sessionId,
@Param(value = "unionId") String unionId) {
Sql sql = getSql(pageForm, sessionId, unionId);
Pagination<NutMap> pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
public Sql getSql(PageForm pageForm, String sessionId, String unionId) {
Sql sql = Sqls.create("""
SELECT
info.*,
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,
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
teacher_congress_delegate_push 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
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("info.sessionId", "=", sessionId);
cnd.andEX("info.pushUnionId", "=", 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");
sql.setCondition(cnd);
return sql;
}
}
@@ -13,6 +13,7 @@ import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.sys.views.View_user; import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.TeacherCongressDelegatePush; import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.TeacherCongressDelegatePush;
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_quota_allocation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
@@ -124,11 +125,12 @@ public class TeacherCongressDelegatePushWriteController {
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId); dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.AGREE.getCode()); dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.AGREE.getCode());
dict.set(FlowConst.EXT_ENABLE_OPERATOR,true); dict.set(FlowConst.EXT_ENABLE_OPERATOR,true);
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", teacherCongressDelegatePush.getUserId()));
if (List.of("563dcfc5033d4631bc7f6482b2d427b9","9b2650eec5114a18a0d2a09803800a39").contains(user.getUnionId())){ if (List.of("563dcfc5033d4631bc7f6482b2d427b9","9b2650eec5114a18a0d2a09803800a39").contains(teacherCongressDelegatePush.getPushUnionId())){
dict.set("tf_type","JG"); dict.set("tf_type","JG");
}else{ }else{
dict.set("tf_type","XY"); dict.set("tf_type","XY");
dict.set("argsUnitId",teacherCongressDelegatePush.getPushUnitId());
} }
flowCommonService.executeTask(dict); flowCommonService.executeTask(dict);
return Result.success(); return Result.success();
@@ -259,16 +259,16 @@ public class TeacherCongressDelegatePushZgAuditController {
delegate.setSessionId(delegatePush.getSessionId()); delegate.setSessionId(delegatePush.getSessionId());
Teacher_congress_delegation_unit delegation_unit = baseService.dao().fetch(Teacher_congress_delegation_unit.class, /* Teacher_congress_delegation_unit delegation_unit = baseService.dao().fetch(Teacher_congress_delegation_unit.class,
Cnd.where(Teacher_congress_delegation_unit::getUnitId, "=", user.getUnitId()) Cnd.where(Teacher_congress_delegation_unit::getUnitId, "=", user.getUnitId())
.and(Teacher_congress_delegation_union::getSessionId, "=", delegatePush.getSessionId())); .and(Teacher_congress_delegation_union::getSessionId, "=", delegatePush.getSessionId()));*/
if (ObjectUtil.isNotEmpty(delegation_unit)) { /* if (ObjectUtil.isNotEmpty(delegation_unit)) {
delegate.setDelegationId(delegation_unit.getDelegationId()); delegate.setDelegationId(delegation_unit.getDelegationId());
userRole.setTcDelegationId(delegation_unit.getDelegationId()); userRole.setTcDelegationId(delegation_unit.getDelegationId());
} else { } else {
return Result.error(user.getUnitName() + "没有设置到代表团,请先在代表团管理里设置。"); return Result.error(user.getUnitName() + "没有设置到代表团,请先在代表团管理里设置。");
} }*/
if ("正式代表".equals(delegatePush.getRepresentativeType())) { if ("正式代表".equals(delegatePush.getRepresentativeType())) {
Sys_role sys_role = baseService.dao().fetch(Sys_role.class, Cnd.where(Sys_role::getCode, "=", RoleConstant.TEACHER_CONGRESS_DELEGATE_FORMAL.name())); Sys_role sys_role = baseService.dao().fetch(Sys_role.class, Cnd.where(Sys_role::getCode, "=", RoleConstant.TEACHER_CONGRESS_DELEGATE_FORMAL.name()));
delegate.setRoleId(sys_role.getId()); delegate.setRoleId(sys_role.getId());
@@ -283,7 +283,7 @@ public class TeacherCongressDelegatePushZgAuditController {
userRole.setUserId(user.getId()); userRole.setUserId(user.getId());
userRole.setTcSessionId(delegatePush.getSessionId()); userRole.setTcSessionId(delegatePush.getSessionId());
baseService.dao().insert(delegate); baseService.dao().insert(delegate);
baseService.dao().insert(userRole); // baseService.dao().insert(userRole);
} }
flowCommonService.executeTask(args); flowCommonService.executeTask(args);
@@ -186,6 +186,15 @@ public class TeacherCongressDelegatePush extends BaseModel {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date pushTime; private Date pushTime;
@Column
@Comment("推送分工会")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String pushUnionId;
@Column
@Comment("推送单位")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String pushUnitId;
@Column @Column
@Comment("教代会代表类型") @Comment("教代会代表类型")
@@ -67,10 +67,11 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (submitType.equals("XY")){ if (submitType.equals("XY")){
cnd.and("t.taskName", "=", "tcDelegatePushDwSjTj"); cnd.and("t.taskName", "=", "tcDelegatePushDwSjTj");
cnd.and("info.pushUnitId","=",SecurityUtil.getUnitId());
}else{ }else{
cnd.and("t.taskName", "=", "tcDelegatePushUnion"); cnd.and("t.taskName", "=", "tcDelegatePushUnion");
cnd.and("info.pushUnionId","=",SecurityUtil.getUnionId());
} }
sql.setCondition(cnd); sql.setCondition(cnd);
List<NutMap> delegatePushList = listMap(sql); List<NutMap> delegatePushList = listMap(sql);
@@ -126,6 +127,7 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.andEX("info.sessionId", "=", sessionId); cnd.andEX("info.sessionId", "=", sessionId);
cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId()); cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId());
cnd.andEX("info.schoolLeader", "!=", 1);
SqlExpressionGroup group = new SqlExpressionGroup(); SqlExpressionGroup group = new SqlExpressionGroup();
if (submitType.equals("XY")){ if (submitType.equals("XY")){
group.or("t.taskName", "=", "tcDelegatePushDwSjTj"); group.or("t.taskName", "=", "tcDelegatePushDwSjTj");
@@ -188,6 +190,7 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl<Teac
tips.append("45岁以下教师代表数不满足分配名额数!"); tips.append("45岁以下教师代表数不满足分配名额数!");
} }
if (StrUtil.isNotBlank(tips)) { if (StrUtil.isNotBlank(tips)) {
return tips.toString(); return tips.toString();
} }
@@ -3,6 +3,7 @@ package com.budwk.app.zhgh.democratic.teachercongress.prepare.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
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;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_quota_allocation; import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_quota_allocation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -20,6 +21,7 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* @author zhf * @author zhf
@@ -63,12 +65,14 @@ public class TeacherCongressQuotaAllocationController {
tcqa.workerNum, tcqa.workerNum,
tcqa.femaleNum, tcqa.femaleNum,
tcqa.less45Num, tcqa.less45Num,
su.username schoolLeadersUserName,
COALESCE(u_count, 0) AS memberCount, COALESCE(u_count, 0) AS memberCount,
COALESCE(db_count, 0) AS dbCount COALESCE(db_count, 0) AS dbCount
FROM FROM
sys_union un sys_union un
LEFT JOIN teacher_congress_quota_allocation tcqa ON tcqa.sessionId = @sessionId LEFT JOIN teacher_congress_quota_allocation tcqa ON tcqa.sessionId = @sessionId
AND tcqa.unionId = un.id AND tcqa.unionId = un.id
LEFT JOIN sys_user su ON su.loginname=tcqa.schoolLeadersLoginName
LEFT JOIN (SELECT unionId, COUNT(id) AS u_count FROM vw_user WHERE member = 1 GROUP BY unionId) u ON u.unionId = un.id LEFT JOIN (SELECT unionId, COUNT(id) AS u_count FROM vw_user WHERE member = 1 GROUP BY unionId) u ON u.unionId = un.id
LEFT JOIN (SELECT unionId, COUNT(id) AS db_count FROM teacher_congress_delegate WHERE sessionId = @sessionId GROUP BY unionId) db ON db.unionId = un.id LEFT JOIN (SELECT unionId, COUNT(id) AS db_count FROM teacher_congress_delegate WHERE sessionId = @sessionId GROUP BY unionId) db ON db.unionId = un.id
$condition $condition
@@ -102,7 +106,8 @@ public class TeacherCongressQuotaAllocationController {
t2.cadreNum, t2.cadreNum,
t2.workerNum, t2.workerNum,
t2.femaleNum, t2.femaleNum,
t2.less45Num t2.less45Num,
t2.schoolLeadersLoginName
FROM FROM
`sys_union` un `sys_union` un
LEFT JOIN (SELECT unionId, COUNT(id) AS u_count FROM vw_user WHERE member = 1 GROUP BY unionId) u ON u.unionId = un.id LEFT JOIN (SELECT unionId, COUNT(id) AS u_count FROM vw_user WHERE member = 1 GROUP BY unionId) u ON u.unionId = un.id
@@ -132,4 +137,18 @@ public class TeacherCongressQuotaAllocationController {
return Result.success(); return Result.success();
} }
@At
@SaCheckPermission("tc.prepare.quotaAllocation")
@ApiOperation("根据届次找出分配的领导")
public Result getSchoolLeaders(String sessionId){
List<Teacher_congress_quota_allocation> allocationList = dao.query(Teacher_congress_quota_allocation.class, Cnd.where(Teacher_congress_quota_allocation::getSessionId, "=", sessionId));
List<String> loginNames = allocationList.stream()
.map(Teacher_congress_quota_allocation::getSchoolLeadersLoginName)
.filter(Objects::nonNull)
.toList();
List<Sys_user> sysUserList = dao.query(Sys_user.class, Cnd.where(Sys_user::getLoginname, "in", loginNames));
return Result.success(sysUserList);
}
} }
@@ -89,6 +89,11 @@ public class Teacher_congress_quota_allocation extends BaseModel {
@Default("0") @Default("0")
private Integer less45Num; private Integer less45Num;
@Column
@Comment("校领导loginname")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String schoolLeadersLoginName;
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 356 KiB

@@ -115,7 +115,6 @@ module.exports = {
}, },
created() { created() {
this.clearOptions() this.clearOptions()
console.log(this.placeholder)
} }
} }
</script> </script>
@@ -86,7 +86,7 @@ layout("/layouts/v4/baseLayout.html"){
</div> </div>
<!-- <jcdt :list="websiteNews.grassroots"></jcdt>--> <jcdt :list="websiteNews.grassroots"></jcdt>
</div> </div>
</div> </div>
@@ -36,7 +36,7 @@
} }
.v4-header { .v4-header {
background-color: rgb(0, 109, 185); background-color: #811A1E;
box-shadow: 0 2px 10px rgba(0, 109, 185, 0.3); box-shadow: 0 2px 10px rgba(0, 109, 185, 0.3);
padding: 0 24px; padding: 0 24px;
height: 64px; height: 64px;
@@ -10,21 +10,25 @@ layout("/layouts/platform.html"){
</search-item> </search-item>
<search-item label="教代会"> <search-item label="教代会">
<el-select v-model="pageForm.sessionId" @change="sessionChange"> <el-select v-model="pageForm.sessionId" @change="sessionChange">
<el-option v-for="item in sessionOptions" :label="item.fullName" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in sessionOptions" :label="item.fullName" :value="item.id"
:key="item.id"></el-option>
</el-select> </el-select>
</search-item> </search-item>
<search-item label="代表团"> <search-item label="代表团">
<el-select v-model="pageForm.delegationId" filterable @change="delegationChange" clearable style="width: 100%"> <el-select v-model="pageForm.delegationId" filterable @change="delegationChange" clearable
style="width: 100%">
<el-option v-for="i in delegationOptions" :label="i.name" :key="i.id" :value="i.id"></el-option> <el-option v-for="i in delegationOptions" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select> </el-select>
</search-item> </search-item>
<search-item label="所属工会"> <search-item label="所属工会">
<el-select placeholder="请选择所属工会" v-model="pageForm.unionId" filterable @change="listUnit" clearable style="width: 100%"> <el-select placeholder="请选择所属工会" v-model="pageForm.unionId" filterable @change="listUnit"
clearable style="width: 100%">
<el-option v-for="i in unionOptions" :label="i.name" :key="i.id" :value="i.id"></el-option> <el-option v-for="i in unionOptions" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select> </el-select>
</search-item> </search-item>
<search-item label="所属单位"> <search-item label="所属单位">
<el-select placeholder="请选择所属单位" v-model="pageForm.unitId" filterable clearable style="width: 100%"> <el-select placeholder="请选择所属单位" v-model="pageForm.unitId" filterable clearable
style="width: 100%">
<el-option v-for="i in unitOptions" :label="i.name" :key="i.id" :value="i.id"></el-option> <el-option v-for="i in unitOptions" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select> </el-select>
</search-item> </search-item>
@@ -38,20 +42,29 @@ layout("/layouts/platform.html"){
<el-card shadow="never"> <el-card shadow="never">
<table-tool> <table-tool>
<el-button size="small" type="primary" icon="el-icon-plus" @click="excelImportDialog = true">导入代表</el-button> <el-button size="small" type="primary" icon="el-icon-plus" @click="doAllocateDelegation">
<el-button size="small" type="primary" icon="el-icon-plus" @click="$refs.addFormRef.onOpen(pageForm.sessionId,pageForm.delegationId)">新增代表</el-button> 根据单位分配代表团
</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" @click="excelImportDialog = true">导入代表
</el-button>
<el-button size="small" type="primary" icon="el-icon-plus"
@click="$refs.addFormRef.onOpen(pageForm.sessionId,pageForm.delegationId)">新增代表
</el-button>
<el-button <el-button
size="small" size="small"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
@click="batchDelete()" @click="batchDelete()"
:disabled="$refs.tableRef && $refs.tableRef.selection.length===0" :disabled="$refs.tableRef && $refs.tableRef.selection.length===0"
> >
批量删除 批量删除
</el-button> </el-button>
<el-button size="small" type="primary" icon="el-icon-plus" @click="$refs.adjustFormRef.onOpen(pageForm.sessionId)">代表调整</el-button> <el-button size="small" type="primary" icon="el-icon-plus"
@click="$refs.adjustFormRef.onOpen(pageForm.sessionId)">代表调整
</el-button>
</table-tool> </table-tool>
<el-table :data="tableData" @sort-change="pageOrder" header-align="center" row-key="id" ref="tableRef" style="width: 100%"> <el-table :data="tableData" @sort-change="pageOrder" header-align="center" row-key="id" ref="tableRef"
style="width: 100%">
<el-table-column type="selection" width="55" reserve-selection fixed="left"></el-table-column> <el-table-column type="selection" width="55" reserve-selection fixed="left"></el-table-column>
<el-table-column type="index" width="55" label="序号" :index="indexMethod" fixed="left"></el-table-column> <el-table-column type="index" width="55" label="序号" :index="indexMethod" fixed="left"></el-table-column>
<el-table-column label="工号" prop="loginName" fixed="left"></el-table-column> <el-table-column label="工号" prop="loginName" fixed="left"></el-table-column>
@@ -61,19 +74,22 @@ layout("/layouts/platform.html"){
<el-table-column label="联系方式" prop="mobile"></el-table-column> <el-table-column label="联系方式" prop="mobile"></el-table-column>
<el-table-column label="代表团" prop="delegationId" width="150" show-overflow-tooltip sortable> <el-table-column label="代表团" prop="delegationId" width="150" show-overflow-tooltip sortable>
<template scope="{row}"> <template scope="{row}">
<dict-tag :options="delegationOptions" :value="row.delegationId" option_value="id" option_label="name"></dict-tag> <dict-tag :options="delegationOptions" :value="row.delegationId" option_value="id"
option_label="name"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所属工会" prop="unionName" show-overflow-tooltip sortable></el-table-column> <el-table-column label="所属工会" prop="unionName" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="所属单位" prop="unitName" show-overflow-tooltip sortable></el-table-column> <el-table-column label="所属单位" prop="unitName" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="届次" prop="sessionId"> <el-table-column label="届次" prop="sessionId">
<template scope="{row}"> <template scope="{row}">
<dict-tag :options="sessionOptions" :value="row.sessionId" option_value="id" option_label="fullName"></dict-tag> <dict-tag :options="sessionOptions" :value="row.sessionId" option_value="id"
option_label="fullName"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="代表身份" prop="roleId" sortable> <el-table-column label="代表身份" prop="roleId" sortable>
<template scope="{row}"> <template scope="{row}">
<dict-tag :options="roleOptions" :value="row.roleId" option_value="id" option_label="name"></dict-tag> <dict-tag :options="roleOptions" :value="row.roleId" option_value="id"
option_label="name"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
@@ -139,6 +155,20 @@ layout("/layouts/platform.html"){
} }
}, },
methods: { methods: {
doAllocateDelegation() {
this.$confirm("确定要一键给没有代表团的代表,根据单位所在代表团设置代表团吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post(loc() + "/doAllocateDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
sessionChange() { sessionChange() {
this.pageForm.delegationId = null this.pageForm.delegationId = null
this.delegationOptions = [] this.delegationOptions = []
@@ -154,7 +184,7 @@ layout("/layouts/platform.html"){
listDelegation() { listDelegation() {
this.delegationOptions = [] this.delegationOptions = []
this.pageForm.delegationId = null this.pageForm.delegationId = null
this.$axios.post("/platform/teacherCongress/common/listDelegation", { sessionId: this.pageForm.sessionId }).then((res) => { this.$axios.post("/platform/teacherCongress/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.delegationOptions = res.data this.delegationOptions = res.data
} }
@@ -184,7 +214,7 @@ layout("/layouts/platform.html"){
cancelButtonText: "取消", cancelButtonText: "取消",
type: "info" type: "info"
}).then(() => { }).then(() => {
this.$axios.post(loc() + "/delete", { data: JSON.stringify({ ids: ids }) }).then((res) => { this.$axios.post(loc() + "/delete", {data: JSON.stringify({ids: ids})}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success(res.msg) this.$message.success(res.msg)
this.doSearch() this.doSearch()
@@ -147,7 +147,7 @@ layout("/layouts/platform.html"){
></el-checkbox> ></el-checkbox>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工代会代表" prop="isGdh" min-width="100"> <!-- <el-table-column label="工代会代表" prop="isGdh" min-width="100">
<template v-slot="{row}"> <template v-slot="{row}">
<el-checkbox <el-checkbox
v-if="row" v-if="row"
@@ -155,7 +155,7 @@ layout("/layouts/platform.html"){
style="pointer-events:none" style="pointer-events:none"
></el-checkbox> ></el-checkbox>
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column label="代表类型" prop="representativeType" show-overflow-tooltip <el-table-column label="代表类型" prop="representativeType" show-overflow-tooltip
width="100"></el-table-column> width="100"></el-table-column>
<el-table-column prop="taskName" label="当前节点" width="120" fixed="right"></el-table-column> <el-table-column prop="taskName" label="当前节点" width="120" fixed="right"></el-table-column>
@@ -0,0 +1,142 @@
<!--#include('auditInfo.js'){}#-->
const PushStatisticsTable = {
template: /*language=HTML*/ `
<div>
<el-table
ref="tableRef"
:data="tableData"
row-key="id"
@sort-change="pageOrder"
>
<el-table-column type="index" width="55" label="序号" :index="indexMethod"
fixed="left"></el-table-column>
<el-table-column label="姓名" prop="userName" width="100" fixed="left"></el-table-column>
<el-table-column label="年龄" prop="age" width="80"></el-table-column>
<el-table-column label="性别" prop="sex" width="80" fixed="left"></el-table-column>
<el-table-column label="职务" prop="position" min-width="100"></el-table-column>
<el-table-column label="职称" prop="professionalTitle" min-width="100"></el-table-column>
<el-table-column label="校级领导" prop="schoolLeader" min-width="100">
<template v-slot="{row}">
<el-checkbox
v-if="row"
v-model="row.schoolLeader"
style="pointer-events:none"
></el-checkbox>
</template>
</el-table-column>
<el-table-column label="高级职称" prop="seniorTeacher" width="80">
<template v-slot="{row}">
<el-checkbox
v-if="row"
v-model="row.seniorTeacher"
style="pointer-events:none"
></el-checkbox>
</template>
</el-table-column>
<el-table-column label="中级职称及以下" prop="intermediateBelow" width="120">
<template v-slot="{row}">
<el-checkbox
v-if="row"
v-model="row.intermediateBelow"
style="pointer-events:none"
></el-checkbox>
</template>
</el-table-column>
<el-table-column label="干部" prop="cadre" width="80">
<template v-slot="{row}">
<el-checkbox
v-if="row"
v-model="row.cadre"
style="pointer-events:none"
></el-checkbox>
</template>
</el-table-column>
<el-table-column label="工人" prop="worker" width="80">
<template v-slot="{row}">
<el-checkbox
v-if="row"
v-model="row.worker"
style="pointer-events:none"
></el-checkbox>
</template>
</el-table-column>
<el-table-column label="教代会代表" prop="isJdh" min-width="100">
<template v-slot="{row}">
<el-checkbox
v-if="row"
v-model="row.isJdh"
style="pointer-events:none"
></el-checkbox>
</template>
</el-table-column>
<!-- <el-table-column label="工代会代表" prop="isGdh" min-width="100">
<template v-slot="{row}">
<el-checkbox
v-if="row"
v-model="row.isGdh"
style="pointer-events:none"
></el-checkbox>
</template>
</el-table-column>-->
<el-table-column label="代表类型" prop="representativeType" show-overflow-tooltip
width="100"></el-table-column>
<el-table-column prop="taskName" 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="操作" fixed="right" width="100">
<template slot-scope="{row}">
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :close-on-click-modal="false"
append-to-body
:visible.sync="viewDialog"
title="查看"
top="50px"
width="60%">
<div style="max-height: 75vh;overflow-y: auto">
<audit-info ref="auditInfoRef">
</audit-info>
</div>
</el-dialog>
</div>
`,
mixins: [initTableMixins],
data() {
return {
pageForm: {},
pageDataUrl:"/platform/teacherCongress/delegate/push/statistics/pageData",
viewDialog:false,
}
},
components: {
'audit-info': auditInfo
},
methods: {
openView(row) {
this.$set(this.pageForm, "sessionId", row.sessionId)
this.$set(this.pageForm, "unionId", row.unionId)
this.pageData()
},
onView(row){
this.viewDialog=true
this.$nextTick(()=>{
this.$refs.auditInfoRef.onOpen(row)
})
/* setTimeout(()=>{
this.$refs.auditInfoRef.onOpen(row)
},1000)*/
}
}
}
@@ -0,0 +1,119 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="教代会">
<el-select v-model="pageForm.sessionId">
<el-option v-for="item in sessionOptions" :label="item.fullName" :value="item.id"
:key="item.id"></el-option>
</el-select>
</search-item>
<search-item label="分工会">
<el-select v-model="pageForm.unionId" filterable clearable style="width: 100%">
<el-option v-for="i in unionOptions" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool>
</table-tool>
<el-table
ref="tableRef"
:data="tableData"
row-key="id"
>
<el-table-column type="index" width="55" label="序号" :index="indexMethod"
fixed="left"></el-table-column>
<el-table-column prop="unionName" label="工会名称"></el-table-column>
<el-table-column prop="allocationNum" label="名额分配人数(领导)">
<template slot-scope="{row}">
{{row.allocationNum}}
<template v-if="row.schoolLeadersUserName">{{row.schoolLeadersUserName}}</template>
</template>
</el-table-column>
<el-table-column prop="unionPushCount" label="分工会推选人数"></el-table-column>
<el-table-column prop="sjWshCount" label="党委书记未审核数量"></el-table-column>
<el-table-column label="操作">
<template slot-scope="{row}">
<el-button type="primary" size="mini" @click="onView(row)">查看推选情况</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<template #view>
<push-statistics-table ref="pushStatisticsTable"></push-statistics-table>
</template>
</guava>
</div>
<script>
<!--#include('push-statistics-table.js'){}#-->
new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
sessionOptions: [],
unionOptions: [],
}
},
components: {
"push-statistics-table": PushStatisticsTable
},
methods: {
onView(row) {
this.$refs.guava.view(() => {
this.$refs.pushStatisticsTable.openView(row)
})
},
listUnion() {
this.$businessTool.listUnion().then((res) => {
this.unionOptions = res
})
},
listSession() {
this.$axios.post("/platform/teacherCongress/common/listSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions && this.sessionOptions.length > 0) {
this.pageForm.sessionId = this.sessionOptions[0].id
this.doSearch()
}
}
})
},
doSearch() {
this.getData()
},
getData() {
this.$axios.post("/platform/teacherCongress/delegate/push/statistics/getData", this.pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data
}
})
}
},
created() {
this.listSession()
this.listUnion()
}
})
</script>
<!--#
}
#-->
@@ -22,7 +22,8 @@ layout("/layouts/platform.html"){
</el-select> </el-select>
</search-item> </search-item>
<search-item label="所属工会"> <search-item label="所属工会">
<el-select clearable filterable placeholder="请选择所属工会" style="width: 100%" v-model="pageForm.unionId"> <el-select clearable filterable placeholder="请选择所属工会" style="width: 100%"
v-model="pageForm.unionId">
<el-option :key="item.id" :label="item.name" :value="item.id" <el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unionOptions"></el-option> v-for="item in unionOptions"></el-option>
</el-select> </el-select>
@@ -44,15 +45,18 @@ layout("/layouts/platform.html"){
<el-table-column type="index" width="50" :index="indexMethod" label="序号"></el-table-column> <el-table-column type="index" width="50" :index="indexMethod" label="序号"></el-table-column>
<el-table-column prop="unionName" label="工会名称"></el-table-column> <el-table-column prop="unionName" label="工会名称"></el-table-column>
<el-table-column prop="memberCount" label="会员人数"></el-table-column> <el-table-column prop="memberCount" label="会员人数"></el-table-column>
<!-- <el-table-column prop="dbCount" label="代表人数"></el-table-column>--> <!-- <el-table-column prop="dbCount" label="代表人数"></el-table-column>-->
<el-table-column prop="allocationNum" label="名额分配人数"></el-table-column> <el-table-column prop="allocationNum" label="名额分配人数"></el-table-column>
<el-table-column prop="seniorTeaNum" label="高级职称代表数"></el-table-column> <el-table-column prop="seniorTeaNum" label="高级职称代表数"></el-table-column>
<el-table-column prop="intermediateBelowNum" label="中级职称及以下代表数"></el-table-column> <el-table-column prop="intermediateBelowNum" label="中级职称及以下代表数"></el-table-column>
<el-table-column prop="cadreNum" label="干部代表数"></el-table-column> <el-table-column prop="cadreNum" label="干部代表数"></el-table-column>
<el-table-column prop="workerNum" label="工人代表数"></el-table-column> <el-table-column prop="workerNum" label="工人代表数"></el-table-column>
<!-- <el-table-column prop="ordinaryTeaNum" label="专任教师代表数"></el-table-column>--> <!-- <el-table-column prop="ordinaryTeaNum" label="专任教师代表数"></el-table-column>-->
<el-table-column prop="femaleNum" label="女代表数"></el-table-column> <el-table-column prop="femaleNum" label="女代表数"></el-table-column>
<el-table-column prop="less45Num" label="45岁以下代表数"></el-table-column> <el-table-column prop="less45Num" label="45岁以下代表数"></el-table-column>
<el-table-column prop="schoolLeadersUserName" label="分配校领导">
</el-table-column>
</el-table> </el-table>
</el-card> </el-card>
@@ -184,6 +184,25 @@ const MANUAL_ALLOCATION_DIALOG = {
></el-input-number> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolLeadersLoginName" label="分配校领导">
<template slot-scope="{row}">
<el-select
v-model="row.schoolLeadersLoginName"
filterable
remote
reserve-keyword
placeholder="请输入姓名查询"
:remote-method="schoolLeaderRemoteMethod"
style="width: 100%">
<el-option
v-for="item in schoolLeaders"
:key="item.loginname"
:label="item.username+'('+item.loginname+')'"
:value="item.loginname">
</el-option>
</el-select>
</template>
</el-table-column>
</el-table> </el-table>
<el-row class="mt20" justify="end" type="flex"> <el-row class="mt20" justify="end" type="flex">
@@ -213,7 +232,8 @@ const MANUAL_ALLOCATION_DIALOG = {
{label: "工人代表数", value: "workerNum"}, {label: "工人代表数", value: "workerNum"},
{label: "女代表数", value: "femaleNum"}, {label: "女代表数", value: "femaleNum"},
{label: "45岁以下代表数", value: "less45Num"}, {label: "45岁以下代表数", value: "less45Num"},
] ],
schoolLeaders: []
} }
}, },
methods: { methods: {
@@ -225,6 +245,10 @@ const MANUAL_ALLOCATION_DIALOG = {
sums[index] = '占代表总数的'; sums[index] = '占代表总数的';
return; return;
} }
if (index === 10) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property])); const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) { if (!values.every(value => isNaN(value))) {
if (index === 2) { if (index === 2) {
@@ -259,7 +283,6 @@ const MANUAL_ALLOCATION_DIALOG = {
}, 0); }, 0);
sums[index] = ((part / total) * 100).toFixed(2) + ' %' sums[index] = ((part / total) * 100).toFixed(2) + ' %'
console.log(((part / total) * 100).toFixed(2))
} }
} else { } else {
sums[index] = null; sums[index] = null;
@@ -342,6 +365,20 @@ const MANUAL_ALLOCATION_DIALOG = {
v.allocationNum = (num === 0 ? 1 : num) v.allocationNum = (num === 0 ? 1 : num)
this.$forceUpdate() this.$forceUpdate()
}, },
schoolLeaderRemoteMethod(query) {
if (query !== "") {
$.get("/open/common/userOptions", {query}).then((res) => {
this.schoolLeaders = res.data
})
}
},
getSchoolLeaders() {
this.$axios.post('/platform/teacherCongress/prepare/quotaAllocation/getSchoolLeaders', {sessionId: this.sessionId}).then(resp => {
if (resp.code === 0) {
this.schoolLeaders = resp.data
}
})
},
getUnionUsers() { getUnionUsers() {
this.$axios.post('/platform/teacherCongress/prepare/quotaAllocation/getUnionLimit', {sessionId: this.sessionId}).then(resp => { this.$axios.post('/platform/teacherCongress/prepare/quotaAllocation/getUnionLimit', {sessionId: this.sessionId}).then(resp => {
if (resp.code === 0) { if (resp.code === 0) {
@@ -356,6 +393,8 @@ const MANUAL_ALLOCATION_DIALOG = {
this.unionUserNumOneKeyRatio = 0 this.unionUserNumOneKeyRatio = 0
this.settingsType = "allocationNum" this.settingsType = "allocationNum"
this.getUnionUsers() this.getUnionUsers()
this.getSchoolLeaders()
} }
} }
} }