diff --git a/src/main/java/com/budwk/app/flow/handler/FlowUnitPartySecretaryHandler.java b/src/main/java/com/budwk/app/flow/handler/FlowUnitPartySecretaryHandler.java index 940f808..bc94d83 100644 --- a/src/main/java/com/budwk/app/flow/handler/FlowUnitPartySecretaryHandler.java +++ b/src/main/java/com/budwk/app/flow/handler/FlowUnitPartySecretaryHandler.java @@ -1,5 +1,6 @@ package com.budwk.app.flow.handler; +import cn.hutool.core.util.StrUtil; import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.flow.engine.AssignmentHandler; import com.budwk.app.flow.engine.core.Execution; @@ -27,6 +28,10 @@ public class FlowUnitPartySecretaryHandler implements AssignmentHandler { @Override public List assign(TaskModel model, Execution execution) { String unitId = SecurityUtil.getUnitId(); + String argsUnitId = execution.getArgs().getStr("argsUnitId"); + if (StrUtil.isNotBlank(argsUnitId)){ + unitId = argsUnitId; + } SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class); Sys_role role = sysRoleService.getByCode(RoleConstant.UNIT_PARTY_SECRETARY); @@ -45,7 +50,7 @@ public class FlowUnitPartySecretaryHandler implements AssignmentHandler { @Override public String getMessage() { - return "获取当前登录用户所在单位党委书记"; + return "获取当前登录用户所在单位党委书记(如果argsUnitId存在则查询argsUnitId单位的党委书记)"; } @Override diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegateManageController.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegateManageController.java index b846de9..9d80636 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegateManageController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegateManageController.java @@ -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.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_union; import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation_unit; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -249,7 +250,7 @@ public class TeacherCongressDelegateManageController { vw_user u LEFT JOIN teacher_congress_delegate tcd ON tcd.userId = u.id $condition - """); + """); Cnd cnd = Cnd.NEW(); SqlExpressionGroup seg = new SqlExpressionGroup(); seg.orLike("u.username", param.getKeyWord()); @@ -478,5 +479,46 @@ public class TeacherCongressDelegateManageController { return Result.success(excelImportRes); } + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("tc.delegate.manage") + public Result doAllocateDelegation(String sessionId) { + List 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(); + } + } diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushController.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushController.java index 80c5be8..991936e 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushController.java @@ -49,6 +49,7 @@ 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; @@ -132,7 +133,7 @@ public class TeacherCongressDelegatePushController { """); Cnd cnd = Cnd.NEW(); cnd.andEX("info.sessionId", "=", sessionId); - cnd.andEX("info.unionId", "=", unionId); + cnd.andEX("info.pushUnionId", "=", unionId); if (!"全部".equals(isFormalOrAttendance)) { cnd.and("info.representativeType", "=", isFormalOrAttendance); @@ -146,7 +147,7 @@ public class TeacherCongressDelegatePushController { cnd.desc("info.createdAt"); if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) { if (AuthUtil.hasRole(RoleConstant.UNIT_PARTY_SECRETARY.name())) { - cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId()); + cnd.andEX("info.pushUnionId", "=", SecurityUtil.getUnionId()); } else { cnd.and("info.createdBy", "=", SecurityUtil.getUserId()); } @@ -174,12 +175,17 @@ public class TeacherCongressDelegatePushController { cndx.andEX("unionId", "=", SecurityUtil.getUnionId()); List delegateList = dao.query(TeacherCongressDelegatePush.class, cndx); List 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(""" SELECT u.id AS userId, u.loginname as loginName, u.username as userName, - u.professionalTitle, + u.professionalTitle, u.professionalLevel, u.sex, u.birthday, @@ -202,7 +208,21 @@ public class TeacherCongressDelegatePushController { cnd.and("tcdp.id", "is", null); cnd.and("u.unionId", "=", SecurityUtil.getUnionId()); sql.setCondition(cnd); - List userList = baseService.listMap(sql); + List 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)); } @@ -212,6 +232,9 @@ public class TeacherCongressDelegatePushController { @Aop(TransAop.READ_COMMITTED) @ApiOperation("推选代表") 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 list = new ArrayList<>(); for (String id : userValue) { View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", id)); @@ -230,6 +253,8 @@ public class TeacherCongressDelegatePushController { tmd.setPolitical(user.getPolitical()); tmd.setProfessionalTitle(user.getProfessionalTitle()); tmd.setProfessionalLevel(user.getProfessionalLevel()); + tmd.setPushUnionId(SecurityUtil.getUnionId()); + tmd.setPushUnitId(SecurityUtil.getUnitId()); tmd.setBirthday(user.getBirthday()); tmd.setUnitId(user.getUnitId()); @@ -244,6 +269,9 @@ public class TeacherCongressDelegatePushController { tmd.setIntermediateBelow(false); tmd.setCadre(false); tmd.setWorker(false); + if (Lang.isNotEmpty(quota_allocation.getSchoolLeadersLoginName()) && quota_allocation.getSchoolLeadersLoginName().equals(user.getLoginname())) { + tmd.setSchoolLeader(true); + } tmd.setMobile(user.getMobile()); @@ -310,7 +338,7 @@ public class TeacherCongressDelegatePushController { @At @ApiOperation("本单位代表上报情况") @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)) { unionId = SecurityUtil.getUnionId(); } @@ -334,9 +362,9 @@ public class TeacherCongressDelegatePushController { """); Cnd cnd = Cnd.NEW(); SqlExpressionGroup group = new SqlExpressionGroup(); - if (submitType.equals("JG")){ + if (submitType.equals("JG")) { group.or("t.taskName", "=", "tcDelegatePushDwSjTj"); - }else{ + } else { group.or("t.taskName", "=", "tcDelegatePushUnion"); } group.or("t.taskName", "=", "tcDelegatePushZg"); @@ -345,6 +373,7 @@ public class TeacherCongressDelegatePushController { cnd.and("ins.state", "!=", ProcessInstanceStateEnum.REJECT.getCode()); cnd.andEX("info.sessionId", "=", sessionId); cnd.andEX("info.unionId", "=", unionId); + cnd.andEX("info.schoolLeader", "!=", 1); cnd.andEX("info.representativeType", "=", "正式代表"); sql.setCondition(cnd); List writeList = baseService.listMap(sql); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushDwSjAuditController.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushDwSjAuditController.java index f27104d..d46f4c1 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushDwSjAuditController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushDwSjAuditController.java @@ -154,7 +154,7 @@ public class TeacherCongressDelegatePushDwSjAuditController { } teacherCongressDelegatePushService.batchSubmit("XY", sessionId); - return null; + return Result.success(); } diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushStatisticsController.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushStatisticsController.java new file mode 100644 index 0000000..29d3ee4 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushStatisticsController.java @@ -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 map = baseService.listMap(sql); + + Sql sql2 = getSql(new PageForm(), sessionId, null); + List 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 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; + } + + +} diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushWriteController.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushWriteController.java index 76a79e4..f6e18f0 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushWriteController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushWriteController.java @@ -13,6 +13,7 @@ import com.budwk.app.flow.service.FlowCommonService; import com.budwk.app.sys.views.View_user; 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.prepare.models.Teacher_congress_quota_allocation; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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.SUBMIT_TYPE, ProcessSubmitTypeEnum.AGREE.getCode()); 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"); }else{ dict.set("tf_type","XY"); + dict.set("argsUnitId",teacherCongressDelegatePush.getPushUnitId()); } flowCommonService.executeTask(dict); return Result.success(); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushZgAuditController.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushZgAuditController.java index 46e846c..d9cd01b 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushZgAuditController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/controller/TeacherCongressDelegatePushZgAuditController.java @@ -259,16 +259,16 @@ public class TeacherCongressDelegatePushZgAuditController { 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()) - .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()); userRole.setTcDelegationId(delegation_unit.getDelegationId()); } else { return Result.error(user.getUnitName() + "没有设置到代表团,请先在代表团管理里设置。"); - } + }*/ 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())); delegate.setRoleId(sys_role.getId()); @@ -283,7 +283,7 @@ public class TeacherCongressDelegatePushZgAuditController { userRole.setUserId(user.getId()); userRole.setTcSessionId(delegatePush.getSessionId()); baseService.dao().insert(delegate); - baseService.dao().insert(userRole); +// baseService.dao().insert(userRole); } flowCommonService.executeTask(args); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/models/TeacherCongressDelegatePush.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/models/TeacherCongressDelegatePush.java index adc9efd..1c44ab4 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/models/TeacherCongressDelegatePush.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/models/TeacherCongressDelegatePush.java @@ -186,6 +186,15 @@ public class TeacherCongressDelegatePush extends BaseModel { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") 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 @Comment("教代会代表类型") diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/service/TeacherCongressDelegatePushServiceImpl.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/service/TeacherCongressDelegatePushServiceImpl.java index 5836779..b266c0a 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/service/TeacherCongressDelegatePushServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/delegate/service/TeacherCongressDelegatePushServiceImpl.java @@ -67,10 +67,11 @@ public class TeacherCongressDelegatePushServiceImpl extends BaseServiceImpl allocationList = dao.query(Teacher_congress_quota_allocation.class, Cnd.where(Teacher_congress_quota_allocation::getSessionId, "=", sessionId)); + List loginNames = allocationList.stream() + .map(Teacher_congress_quota_allocation::getSchoolLeadersLoginName) + .filter(Objects::nonNull) + .toList(); + List sysUserList = dao.query(Sys_user.class, Cnd.where(Sys_user::getLoginname, "in", loginNames)); + + return Result.success(sysUserList); + } + } diff --git a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/prepare/models/Teacher_congress_quota_allocation.java b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/prepare/models/Teacher_congress_quota_allocation.java index cce548e..3674d86 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/prepare/models/Teacher_congress_quota_allocation.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/teachercongress/prepare/models/Teacher_congress_quota_allocation.java @@ -89,6 +89,11 @@ public class Teacher_congress_quota_allocation extends BaseModel { @Default("0") private Integer less45Num; + @Column + @Comment("校领导loginname") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String schoolLeadersLoginName; + } diff --git a/src/main/resources/static/assets/platform/img/home/family.png b/src/main/resources/static/assets/platform/img/home/family.png index 999418c..993cc8a 100644 Binary files a/src/main/resources/static/assets/platform/img/home/family.png and b/src/main/resources/static/assets/platform/img/home/family.png differ diff --git a/src/main/resources/static/components/plugins/sysUserSelect/index.vue b/src/main/resources/static/components/plugins/sysUserSelect/index.vue index f04ca49..aff9670 100644 --- a/src/main/resources/static/components/plugins/sysUserSelect/index.vue +++ b/src/main/resources/static/components/plugins/sysUserSelect/index.vue @@ -115,7 +115,6 @@ module.exports = { }, created() { this.clearOptions() - console.log(this.placeholder) } } diff --git a/src/main/resources/views/layouts/v4/home/index.html b/src/main/resources/views/layouts/v4/home/index.html index 0199a22..0b1f4b4 100644 --- a/src/main/resources/views/layouts/v4/home/index.html +++ b/src/main/resources/views/layouts/v4/home/index.html @@ -86,7 +86,7 @@ layout("/layouts/v4/baseLayout.html"){ - + diff --git a/src/main/resources/views/layouts/v4/platform.html b/src/main/resources/views/layouts/v4/platform.html index b76d9cd..6f4b897 100644 --- a/src/main/resources/views/layouts/v4/platform.html +++ b/src/main/resources/views/layouts/v4/platform.html @@ -36,7 +36,7 @@ } .v4-header { - background-color: rgb(0, 109, 185); + background-color: #811A1E; box-shadow: 0 2px 10px rgba(0, 109, 185, 0.3); padding: 0 24px; height: 64px; diff --git a/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/manage/index.html b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/manage/index.html index ae4cf6c..ee4f75a 100644 --- a/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/manage/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/manage/index.html @@ -10,21 +10,25 @@ layout("/layouts/platform.html"){ - + - + - + - + @@ -38,20 +42,29 @@ layout("/layouts/platform.html"){ - 导入代表 - 新增代表 + + 根据单位分配代表团 + + 导入代表 + + 新增代表 + 批量删除 - 代表调整 + 代表调整 + - + @@ -61,19 +74,22 @@ layout("/layouts/platform.html"){ @@ -139,6 +155,20 @@ layout("/layouts/platform.html"){ } }, 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() { this.pageForm.delegationId = null this.delegationOptions = [] @@ -154,7 +184,7 @@ layout("/layouts/platform.html"){ listDelegation() { this.delegationOptions = [] 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) { this.delegationOptions = res.data } @@ -184,7 +214,7 @@ layout("/layouts/platform.html"){ cancelButtonText: "取消", type: "info" }).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) { this.$message.success(res.msg) this.doSearch() diff --git a/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/index.html b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/index.html index 320e29f..0bf53c4 100644 --- a/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/index.html @@ -147,7 +147,7 @@ layout("/layouts/platform.html"){ > - + diff --git a/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/push-statistics-table.js b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/push-statistics-table.js new file mode 100644 index 0000000..accfd5f --- /dev/null +++ b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/push-statistics-table.js @@ -0,0 +1,142 @@ + +const PushStatisticsTable = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ `, + 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)*/ + + } + } +} diff --git a/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/statistics.html b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/statistics.html new file mode 100644 index 0000000..43f6297 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/democratic/teachercongress/delegate/push/statistics.html @@ -0,0 +1,119 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + diff --git a/src/main/resources/views/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/index.html b/src/main/resources/views/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/index.html index 431c5cf..6215ad4 100644 --- a/src/main/resources/views/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/index.html @@ -22,7 +22,8 @@ layout("/layouts/platform.html"){ - + @@ -44,15 +45,18 @@ layout("/layouts/platform.html"){ - + - + + + +
diff --git a/src/main/resources/views/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/manualAllocationDialog.js b/src/main/resources/views/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/manualAllocationDialog.js index 9cd2c2f..fbd0e0e 100644 --- a/src/main/resources/views/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/manualAllocationDialog.js +++ b/src/main/resources/views/platform/zhgh/democratic/teachercongress/prepare/quotaAllocation/manualAllocationDialog.js @@ -184,6 +184,25 @@ const MANUAL_ALLOCATION_DIALOG = { > + + + @@ -213,7 +232,8 @@ const MANUAL_ALLOCATION_DIALOG = { {label: "工人代表数", value: "workerNum"}, {label: "女代表数", value: "femaleNum"}, {label: "45岁以下代表数", value: "less45Num"}, - ] + ], + schoolLeaders: [] } }, methods: { @@ -225,6 +245,10 @@ const MANUAL_ALLOCATION_DIALOG = { sums[index] = '占代表总数的'; return; } + if (index === 10) { + sums[index] = ''; + return; + } const values = data.map(item => Number(item[column.property])); if (!values.every(value => isNaN(value))) { if (index === 2) { @@ -259,7 +283,6 @@ const MANUAL_ALLOCATION_DIALOG = { }, 0); sums[index] = ((part / total) * 100).toFixed(2) + ' %' - console.log(((part / total) * 100).toFixed(2)) } } else { sums[index] = null; @@ -342,6 +365,20 @@ const MANUAL_ALLOCATION_DIALOG = { v.allocationNum = (num === 0 ? 1 : num) 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() { this.$axios.post('/platform/teacherCongress/prepare/quotaAllocation/getUnionLimit', {sessionId: this.sessionId}).then(resp => { if (resp.code === 0) { @@ -356,6 +393,8 @@ const MANUAL_ALLOCATION_DIALOG = { this.unionUserNumOneKeyRatio = 0 this.settingsType = "allocationNum" this.getUnionUsers() + this.getSchoolLeaders() + } } }