Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -66,6 +66,7 @@ RoleConstant {
|
||||
PROPOSAL_BRANCH_SCHOOL_LEADER("提案分管校领导"),
|
||||
PROPOSAL_UNIT_LEADER("提案承办单位领导"),
|
||||
PROPOSAL_UNIT_PROXY("提案承办单位代理答复人"),
|
||||
PROPOSAL_PERSONNEL_OFFICE_ADMIN("提案人事处管理员"),
|
||||
|
||||
WORKER_CONGRESS_DELEGATE_FORMAL("工代会正式代表"),
|
||||
WORKER_CONGRESS_DELEGATE_ATTENDANCE("工代会列席代表"),
|
||||
|
||||
@@ -2,18 +2,32 @@ package com.budwk.app.flow.service;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.engine.event.ProcessEvent;
|
||||
import com.budwk.app.flow.engine.event.ProcessPublisher;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.*;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
public class FlowCommonService {
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
/**
|
||||
* 执行任务
|
||||
@@ -65,4 +79,42 @@ public class FlowCommonService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result revokeTask(Long taskId) {
|
||||
// 自己任务
|
||||
ProcessTask selfTask = dao.fetch(ProcessTask.class, taskId);
|
||||
selfTask.setTaskState(ProcessTaskStateEnum.DOING.getCode());
|
||||
|
||||
// 撤销任务
|
||||
List<ProcessTask> taskList = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getTaskParentId, "=", taskId));
|
||||
for (ProcessTask task : taskList) {
|
||||
task.setTaskState(ProcessTaskStateEnum.WITHDRAW.getCode());
|
||||
dao.update(task);
|
||||
}
|
||||
// 会签并行任务 撤销后续任务
|
||||
if (selfTask.getPerformType().equals(ProcessTaskPerformTypeEnum.COUNTERSIGN.getCode())) {
|
||||
List<ProcessTask> doingTasks = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.DOING.getCode())
|
||||
.and(ProcessTask::getProcessInstanceId, "=", selfTask.getProcessInstanceId()));
|
||||
for (ProcessTask doingTask : doingTasks) {
|
||||
doingTask.setTaskState(ProcessTaskStateEnum.WITHDRAW.getCode());
|
||||
dao.update(doingTask);
|
||||
}
|
||||
}
|
||||
|
||||
// 激活
|
||||
dao.update(selfTask);
|
||||
|
||||
// 流程激活
|
||||
dao.update(ProcessInstance.class, Chain.make("state", ProcessInstanceStateEnum.DOING.getCode()),Cnd.where(ProcessInstance::getId, "=", selfTask.getProcessInstanceId()));
|
||||
|
||||
// 发送任务撤回事件 确保上面执行成功
|
||||
for (ProcessTask task : taskList) {
|
||||
ProcessPublisher.notify(ProcessEvent.builder().eventType(ProcessEventTypeEnum.PROCESS_TASK_REVOKE).sourceId(task.getId()).build());
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -211,4 +211,13 @@ public interface ProcessTaskService extends BaseService<ProcessTask> {
|
||||
*/
|
||||
List<ProcessTask> getDoingTaskByBizIdTaskName(List<String> bizIds, String taskName);
|
||||
|
||||
/**
|
||||
* 获取已结束的任务
|
||||
*
|
||||
* @param bizIds 业务ID
|
||||
* @param taskName 任务名称
|
||||
* @return
|
||||
*/
|
||||
List<ProcessTask> getDoneTaskByBizIdTaskName(List<String> bizIds, String taskName);
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.expression.ExpressionUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.vo.LabelValueVO;
|
||||
@@ -281,7 +280,7 @@ public class ProcessInstanceServiceImpl extends BaseServiceImpl<ProcessInstance>
|
||||
List<ProcessTask> processTaskList = flowEngine.processTaskService().getDoingTaskList(processInstanceId, new String[]{});
|
||||
// 拿到历史任务-按更新时间倒序
|
||||
List<ProcessTask> hisProcessTaskList = flowEngine.processTaskService().query(Cnd.where(ProcessTask::getProcessInstanceId, "=", processInstanceId).desc(ProcessTask::getUpdatedAt));
|
||||
processTaskList.forEach(task -> {
|
||||
processTaskList.forEach(task -> {
|
||||
if (!vo.getActiveNodeNames().contains(task.getTaskName())) {
|
||||
vo.getActiveNodeNames().add(task.getTaskName());
|
||||
recursionModel(processModel.getStart(), processInstance, processTaskList, hisProcessTaskList, task.getTaskName(), vo);
|
||||
|
||||
@@ -490,6 +490,16 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ProcessTask> getDoneTaskByBizIdTaskName(List<String> bizIds, String taskName) {
|
||||
List<ProcessInstance> instances = dao().query(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", bizIds));
|
||||
List<Long> instanceIds = instances.stream().map(ProcessInstance::getId).toList();
|
||||
List<ProcessTask> tasks = dao().query(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "in", instanceIds)
|
||||
.and(ProcessTask::getTaskName, "=", taskName)
|
||||
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode()));
|
||||
return tasks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProcessTask> getDoingTaskByBizIdTaskName(List<String> bizIds, String taskName) {
|
||||
List<ProcessInstance> instances = dao().query(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", bizIds));
|
||||
|
||||
@@ -38,7 +38,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/sys/menu")
|
||||
@@ -391,11 +390,11 @@ public class SysMenuController {
|
||||
@At
|
||||
@Ok("json")
|
||||
@SaCheckPermission("sys.manager.menu.edit")
|
||||
public Object sortDo(@Param("ids") String ids, HttpServletRequest req) {
|
||||
public Object sortDo(@Param("ids") String ids, @Param("platform") String platform, HttpServletRequest req) {
|
||||
try {
|
||||
String[] menuIds = StringUtils.split(ids, ",");
|
||||
int i = 0;
|
||||
sysMenuService.execute(Sqls.create("update sys_menu set location=0"));
|
||||
sysMenuService.execute(Sqls.create("update sys_menu set location=0 where platform = '%s'".formatted(platform)));
|
||||
for (String s : menuIds) {
|
||||
if (!Strings.isBlank(s)) {
|
||||
sysMenuService.update(org.nutz.dao.Chain.make("location", i), Cnd.where("id", "=", s));
|
||||
@@ -425,11 +424,11 @@ public class SysMenuController {
|
||||
@SaCheckPermission("sys.manager.menu")
|
||||
@ApiOperation("更新首页推荐应用或服务")
|
||||
public Result updateRecommendSetting(@Param("menuIds") String[] menuIds, String platform, String type) {
|
||||
String column = "";
|
||||
switch (type) {
|
||||
case "app" -> column = "isRecommendApp";
|
||||
case "service" -> column = "isRecommendService";
|
||||
}
|
||||
String column = "";
|
||||
switch (type) {
|
||||
case "app" -> column = "isRecommendApp";
|
||||
case "service" -> column = "isRecommendService";
|
||||
}
|
||||
sysMenuService.update(Chain.make(column, 0), Cnd.where("id", "is not", null).and("platform", "=", platform));
|
||||
if (ArrayUtil.isNotEmpty(menuIds)) {
|
||||
sysMenuService.update(Chain.make(column, 1), Cnd.where("id", "in", menuIds).and("platform", "=", platform));
|
||||
|
||||
@@ -87,9 +87,9 @@ public class SysV4AppsController {
|
||||
LEFT JOIN sys_module sm ON sm.id = m.moduleId
|
||||
$condition
|
||||
""");
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
categoryId = "2";
|
||||
}
|
||||
// if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
// categoryId = "2";
|
||||
// }
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("m.platform", "=", platform);
|
||||
cnd.and("m.disabled", "=", false);
|
||||
|
||||
@@ -304,7 +304,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
String decodePwd = Base64Decoder.decodeStr(passowrd);
|
||||
String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt());
|
||||
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
|
||||
if (!Globals.sso) {
|
||||
if (Globals.sso) {
|
||||
throw new BaseException("用户名或者密码不正确");
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -68,6 +68,20 @@ public class ExecutiveCommitteeConfigController {
|
||||
""").setParam("sessionId",sessionId);
|
||||
List<NutMap> listMap = committeeConfigService.listMap(sql);
|
||||
config.setUnionQuotaList(listMap);
|
||||
Sql sql2 = Sqls.create("""
|
||||
SELECT
|
||||
dbt.id as delegationId,
|
||||
dbt.name as delegationName,
|
||||
dbt.code as delegationCode,
|
||||
(SELECT count(1) FROM teacher_congress_delegate WHERE delegationId =dbt.id) AS dbCount,
|
||||
0 as quotaCount
|
||||
FROM
|
||||
teacher_congress_delegation dbt
|
||||
WHERE dbt.sessionId = @sessionId
|
||||
ORDER BY CODE ASC
|
||||
""").setParam("sessionId", sessionId);
|
||||
List<NutMap> listMap2 = committeeConfigService.listMap(sql2);
|
||||
config.setDelegationQuotaList(listMap2);
|
||||
}
|
||||
return Result.success(config);
|
||||
}
|
||||
|
||||
+43
-37
@@ -15,6 +15,7 @@ import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeOnePush;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -40,13 +41,13 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/25 15:18
|
||||
* @description 分工会一次推选
|
||||
* @description 团长一次推选
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/executiveCommittee/delegationOnePush")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "执委会推选-分工会主席一次推选")
|
||||
@Api(tags = "执委会推选-团长一次推选")
|
||||
public class ExecutiveCommitteeDelegationOnePushController {
|
||||
|
||||
@Inject
|
||||
@@ -60,9 +61,8 @@ public class ExecutiveCommitteeDelegationOnePushController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询某个分工会的一次推选的委员")
|
||||
@ApiOperation("查询某个代表团的团长一次推选的委员")
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
public Result pageData(PageForm pageForm,
|
||||
String teacherMeetId,
|
||||
@@ -91,13 +91,19 @@ public class ExecutiveCommitteeDelegationOnePushController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
|
||||
if (StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
cnd.andEX("t3.id", "=", unionId);
|
||||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.andEX("t1.delegationId", "=", delegationId);
|
||||
}else{
|
||||
cnd.andEX("t3.id", "=", SecurityUtil.getUnionId());
|
||||
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (ObjectUtil.isEmpty(db)) {
|
||||
return Result.error("没有权限,只有代表团团长才能推选");
|
||||
}
|
||||
cnd.andEX("t1.delegationId", "=", db.getDelegationId());
|
||||
}
|
||||
cnd.andEX("t1.delegationId", "=", delegationId);
|
||||
|
||||
cnd.andEX("t3.id", "=", unionId);
|
||||
cnd.andEX("t1.addType", "=", 1);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
@@ -115,10 +121,11 @@ public class ExecutiveCommitteeDelegationOnePushController {
|
||||
@ApiOperation("查询可以推选委员和已经推选的人员")
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
public Result getDelegationUser(String teacherMeetId) {
|
||||
if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
|
||||
return Result.error("没有权限,只有分工会主席才能推选");
|
||||
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (ObjectUtil.isEmpty(db)) {
|
||||
return Result.error("没有权限,只有代表团团长才能推选");
|
||||
}
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where(ExecutiveCommitteeConfig::getTeacherMeetId, "=", teacherMeetId));
|
||||
@@ -137,6 +144,11 @@ public class ExecutiveCommitteeDelegationOnePushController {
|
||||
List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW());
|
||||
List<String> userIds = onePushList.stream().map(v -> v.getUserId()).collect(Collectors.toList());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("db.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("db.userId", "not in", userIds);
|
||||
cnd.andEX("db.userId", "!=", SecurityUtil.getUserId());
|
||||
cnd.and("db.delegationId", "=", db.getDelegationId());
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
db.*,
|
||||
@@ -148,33 +160,29 @@ public class ExecutiveCommitteeDelegationOnePushController {
|
||||
LEFT JOIN `vw_user` u ON db.userId = u.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("db.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("db.userId", "not in", userIds);
|
||||
cnd.andEX("db.userId", "!=", SecurityUtil.getUserId());
|
||||
cnd.and("db.unionId", "=", SecurityUtil.getUnionId());
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> userData = baseService.listMap(sql);
|
||||
|
||||
|
||||
List<NutMap> unionQuotaList = config.getUnionQuotaList();
|
||||
NutMap unionQuota = unionQuotaList.stream().filter(v -> v.get("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null);
|
||||
if (Lang.isNotEmpty(unionQuota)) {
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", unionQuota.getInt("quotaCount")));
|
||||
List<NutMap> delegationQuotaList = config.getDelegationQuotaList();
|
||||
NutMap delegationQuota = delegationQuotaList.stream().filter(v -> v.get("delegationId").equals(db.getDelegationId())).findFirst().orElse(null);
|
||||
if (Lang.isNotEmpty(delegationQuota)) {
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", delegationQuota.getInt("quotaCount")));
|
||||
}
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", 0));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
@SLog(tag = "执委会推选-分工会主席推选委员", msg = "推选委员")
|
||||
@SLog(tag = "执委会推选-团长推选委员", msg = "推选委员")
|
||||
public Result addOnePush(@Param("userValue") String[] userValue,
|
||||
String teacherMeetId) {
|
||||
try {
|
||||
if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
|
||||
return Result.error("没有权限,只有分工会主席才能推选");
|
||||
Teacher_congress_delegate db = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (ObjectUtil.isEmpty(db)) {
|
||||
return Result.error("没有权限,只有代表团团长才能推选");
|
||||
}
|
||||
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
@@ -188,20 +196,19 @@ public class ExecutiveCommitteeDelegationOnePushController {
|
||||
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("一次预选已结束");
|
||||
}
|
||||
List<NutMap> unionQuotaList = config.getUnionQuotaList();
|
||||
List<NutMap> delegationQuotaList = config.getDelegationQuotaList();
|
||||
|
||||
NutMap unionQuota = unionQuotaList.stream().filter(v -> v.getString("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(unionQuota)) {
|
||||
return Result.error("请先配置分工会人数");
|
||||
NutMap delegationQuota = delegationQuotaList.stream().filter(v -> v.getString("delegationId").equals(db.getDelegationId())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(delegationQuota)) {
|
||||
return Result.error("请先配置代表团人数");
|
||||
}
|
||||
|
||||
int dbCount = dao.count(ExecutiveCommitteeOnePush.class,
|
||||
Cnd.where("unionId", "=", SecurityUtil.getUnionId())
|
||||
Cnd.where("delegationId", "=", db.getDelegationId())
|
||||
.and("teacherMeetId", "=", teacherMeetId)
|
||||
.and("addType", "=", 1));
|
||||
assert unionQuota != null;
|
||||
if (dbCount + userValue.length > unionQuota.getInt("quotaCount")) {
|
||||
return Result.error("推选人数限制" + unionQuota.getInt("quotaCount") + "人");
|
||||
if (dbCount + userValue.length > delegationQuota.getInt("quotaCount")) {
|
||||
return Result.error("推选人数限制" + delegationQuota.getInt("quotaCount") + "人");
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -229,7 +236,6 @@ public class ExecutiveCommitteeDelegationOnePushController {
|
||||
onePush.setUserName(jdhDb.getString("userName"));
|
||||
onePush.setLoginName(jdhDb.getString("loginName"));
|
||||
onePush.setDelegationId(jdhDb.getString("delegationId"));
|
||||
onePush.setUnionId(jdhDb.getString("unionId"));
|
||||
onePush.setUnitId(jdhDb.getString("unitId"));
|
||||
onePush.setTeacherMeetId(teacherMeetId);
|
||||
String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName")));
|
||||
@@ -247,7 +253,7 @@ public class ExecutiveCommitteeDelegationOnePushController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.delegationOnePush")
|
||||
@SLog(tag = "执委会推选-分工会主席推选委员", msg = "删除推选的人")
|
||||
@SLog(tag = "执委会推选-团长推选委员", msg = "删除推选的人")
|
||||
public Result doDelete(@Valid String id, @Valid String teacherMeetId) {
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
|
||||
+18
-17
@@ -36,7 +36,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/6/23 15:25
|
||||
* @description 分工会二次推选
|
||||
* @description 候选人录入
|
||||
*/
|
||||
@At("/platform/executiveCommittee/delegationTwoPush")
|
||||
@Ok("json:full")
|
||||
@@ -62,7 +62,8 @@ public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
public Result pageData(PageForm pageForm,
|
||||
String teacherMeetId,
|
||||
String delegationId,
|
||||
String unionId) {
|
||||
String unionId,
|
||||
String roleCode) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*,
|
||||
@@ -86,9 +87,9 @@ public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("t1.pushUserId", "=", SecurityUtil.getUserId());
|
||||
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("t2.delegationId", "=", delegationId);
|
||||
cnd.andEX("t1.roleCode", "=", roleCode);
|
||||
if (StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
@@ -109,9 +110,9 @@ public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.delegationTwoPush")
|
||||
@SLog(type = "执委会推选-分工会二次推选", tag = "查询可以二次推选的名单", param = true, result = true)
|
||||
@SLog(type = "执委会推选-候选人录入", tag = "查询可以二次推选的名单", param = true, result = true)
|
||||
public Result getDelegationUser(String teacherMeetId) {
|
||||
if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
|
||||
/* if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
|
||||
return Result.error("没有权限,只有分工会主席才能推选");
|
||||
@@ -126,10 +127,9 @@ public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
}
|
||||
if (config.getSecondEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("二次预选已结束");
|
||||
}
|
||||
}*/
|
||||
List<ExecutiveCommitteeTwoPush> userValue = dao.query(ExecutiveCommitteeTwoPush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId)
|
||||
.and("pushUserId", "=", SecurityUtil.getUserId()));
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
List<String> userIds = userValue.stream().map(v -> v.getUserId()).collect(Collectors.toList());
|
||||
|
||||
|
||||
@@ -151,20 +151,20 @@ public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
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);
|
||||
List<NutMap> userData = baseService.listMap(sql);
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue, "committeeQuotaCount", config.getCommitteeQuotaCount()));
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue, "committeeQuotaCount",0));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.delegationTwoPush")
|
||||
@ApiOperation("推选委员")
|
||||
@SLog(tag = "执委会推选-分工会二次推选", msg = "推选委员")
|
||||
@SLog(tag = "执委会推选-候选人录入", msg = "推选委员")
|
||||
public Result addOnePush(@Param("userValue") String[] userValue,
|
||||
String teacherMeetId) {
|
||||
String teacherMeetId,
|
||||
String roleCode) {
|
||||
try {
|
||||
if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
|
||||
/* if (!(StpUtil.hasRole(RoleConstant.SYSADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()) ||
|
||||
StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()))) {
|
||||
return Result.error("没有权限,只有分工会主席才能推选");
|
||||
@@ -187,7 +187,7 @@ public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
if (dbCount + userValue.length > config.getCommitteeQuotaCount()) {
|
||||
return Result.error("推选人数限制" + config.getCommitteeQuotaCount() + "人");
|
||||
}
|
||||
|
||||
*/
|
||||
List<Teacher_congress_delegate> dbList = dao.query(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", teacherMeetId)
|
||||
.andEX(Teacher_congress_delegate::getUserId, "in", userValue));
|
||||
@@ -206,6 +206,7 @@ public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
twoPush.setPushUserName(SecurityUtil.getUserUsername());
|
||||
twoPush.setPushLoginName(SecurityUtil.getUserLoginname());
|
||||
twoPush.setTeacherMeetId(teacherMeetId);
|
||||
twoPush.setRoleCode(roleCode);
|
||||
list.add(twoPush);
|
||||
}
|
||||
dao.insert(list);
|
||||
@@ -219,16 +220,16 @@ public class ExecutiveCommitteeDelegationTwoPushController {
|
||||
@At
|
||||
@ApiOperation("删除推选人员")
|
||||
@SaCheckPermission("executiveCommittee.delegationTwoPush")
|
||||
@SLog(tag = "执委会推选-分工会二次推选", msg = "删除推选人员")
|
||||
@SLog(tag = "执委会推选-候选人录入", msg = "删除推选人员")
|
||||
public Result doDelete(@Valid String id, @Valid String teacherMeetId) {
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getSecondEndTime().getTime() < System.currentTimeMillis()) {
|
||||
/* if (config.getSecondEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("二次预选已结束不能删除!");
|
||||
}
|
||||
}*/
|
||||
int num = dao.clear(ExecutiveCommitteeTwoPush.class, Cnd.where("id", "=", id));
|
||||
return num >= 0 ? Result.success() : Result.error();
|
||||
}
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class ExecutiveCommitteeMemberController {
|
||||
entityList.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属代表团", "delegationName", 20));
|
||||
entityList.add(new ExcelExportEntity("票数", "pushCount", 20));
|
||||
entityList.add(new ExcelExportEntity("委员类别", "addTypeName", 20));
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("委员会预选名单.xlsx", "UTF-8"));
|
||||
|
||||
+68
-105
@@ -1,21 +1,22 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.pinyin.PinyinUtil;
|
||||
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.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeOnePush;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeTwoPush;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -29,10 +30,8 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -43,7 +42,7 @@ import java.util.stream.Collectors;
|
||||
@At("/platform/executiveCommittee/preparatoryGroupPush")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "执委会推选-筹备组推选")
|
||||
@Api(tags = "执委会推选-正式委员录入")
|
||||
public class ExecutiveCommitteePushController {
|
||||
|
||||
@Inject
|
||||
@@ -63,38 +62,49 @@ public class ExecutiveCommitteePushController {
|
||||
public Result pageData(PageForm pageForm,
|
||||
String teacherMeetId,
|
||||
String delegationId,
|
||||
String unionId) {
|
||||
String unionId,
|
||||
String roleCode) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
SELECT
|
||||
t1.*,
|
||||
t2.name AS unitName,
|
||||
t3.name unionName,
|
||||
t4.sex,
|
||||
t2.loginName,
|
||||
t2.userName,
|
||||
t3.name AS unitName,
|
||||
t4.name unionName,
|
||||
t5.sex,
|
||||
TIMESTAMPDIFF(
|
||||
YEAR,
|
||||
t4.birthday,
|
||||
t5.birthday,
|
||||
CURDATE()) AS age,
|
||||
t5.name AS delegationName
|
||||
t6.name AS delegationName
|
||||
FROM
|
||||
`executive_committee_one_push` t1
|
||||
LEFT JOIN sys_unit t2 ON t1.unitId = t2.id
|
||||
LEFT JOIN `sys_union` t3 ON t3.id = t2.unionid
|
||||
LEFT JOIN `vw_user` t4 ON t4.id = t1.userId
|
||||
LEFT JOIN teacher_congress_delegation t5 ON t5.id = t1.delegationId
|
||||
`executive_committee_two_push` t1
|
||||
LEFT JOIN executive_committee_one_push t2 on t2.userId=t1.userId and t2.teacherMeetId=t1.teacherMeetId
|
||||
LEFT JOIN sys_unit t3 ON t2.unitId = t3.id
|
||||
LEFT JOIN `sys_union` t4 ON t4.id = t3.unionid
|
||||
LEFT JOIN `vw_user` t5 ON t5.id = t1.userId
|
||||
LEFT JOIN teacher_congress_delegation t6 ON t6.id = t2.delegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.delegationId", "=", delegationId);
|
||||
cnd.andEX("t3.id", "=", unionId);
|
||||
cnd.andEX("t1.addType", "=", 2);
|
||||
cnd.andEX("t2.delegationId", "=", delegationId);
|
||||
cnd.andEX("t1.roleCode", "=", roleCode);
|
||||
cnd.andEX("t1.isFormal", "=", true);
|
||||
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);
|
||||
} else {
|
||||
cnd.andEX("t4.id", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("t1.userName", pageForm.getSearchKeyword());
|
||||
group.orLike("t1.loginName", pageForm.getSearchKeyword());
|
||||
group.orLike("t2.userName", pageForm.getSearchKeyword());
|
||||
group.orLike("t2.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
cnd.asc("t5.code").asc("t1.firstLetter");
|
||||
cnd.asc("t6.code").asc("t2.firstLetter");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
}
|
||||
@@ -104,93 +114,53 @@ public class ExecutiveCommitteePushController {
|
||||
@SaCheckPermission("executiveCommittee.preparatoryGroupPush")
|
||||
@ApiOperation("查询可以推选委员和已经推选的人员")
|
||||
public Result getDelegationUser(String teacherMeetId) {
|
||||
List<ExecutiveCommitteeOnePush> userValue = dao.query(ExecutiveCommitteeOnePush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId)
|
||||
.and("addType", "=", 2));
|
||||
List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW());
|
||||
List<String> userIds = onePushList.stream().map(ExecutiveCommitteeOnePush::getUserId).collect(Collectors.toList());
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("db.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("db.userId", "not in", userIds);
|
||||
cnd.andEX("db.userId", "!=", SecurityUtil.getUserId());
|
||||
List<ExecutiveCommitteeTwoPush> twoPushList = dao.query(ExecutiveCommitteeTwoPush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId).and(ExecutiveCommitteeTwoPush::getRoleCode, "is not", null));
|
||||
|
||||
List<ExecutiveCommitteeTwoPush> userValue = twoPushList.stream().filter(ExecutiveCommitteeTwoPush::getIsFormal).toList();
|
||||
List<String> userIds = userValue.stream().map(ExecutiveCommitteeTwoPush::getUserId).toList();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
db.*,
|
||||
u.professionalTitle,
|
||||
u.professionalLevel,
|
||||
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
|
||||
SELECT
|
||||
t2.id userId,
|
||||
t2.username userName,
|
||||
t2.loginname loginName,
|
||||
t2.unitName,
|
||||
t2.sex,
|
||||
t2.professionalTitle,
|
||||
t2.professionalLevel,
|
||||
t1.roleCode,
|
||||
TIMESTAMPDIFF(
|
||||
YEAR,
|
||||
t2.birthday,
|
||||
CURDATE()) age
|
||||
FROM
|
||||
teacher_congress_delegate db
|
||||
LEFT JOIN `vw_user` u ON db.userId = u.id
|
||||
executive_committee_two_push t1
|
||||
LEFT JOIN `vw_user` t2 ON t1.userId = t2.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("t1.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.userId", "not in", userIds);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> userData = baseService.listMap(sql);
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue,"prepareGroupQuotaCount",config.getPrepareGroupQuotaCount()));
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("executiveCommittee.preparatoryGroupPush")
|
||||
@SLog(tag = "执委会推选-筹备组推选", msg = "推选委员")
|
||||
@SLog(tag = "执委会推选-正式委员录入", msg = "推选委员")
|
||||
public Result addOnePush(@Param("userValue") String[] userValue,
|
||||
String teacherMeetId) {
|
||||
try {
|
||||
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
/* if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
if (ObjectUtil.isEmpty(userValue)) {
|
||||
return Result.error("请选择要录入的委员!");
|
||||
}
|
||||
if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("请等待一次预选开始时间");
|
||||
if (ObjectUtil.isEmpty(teacherMeetId)) {
|
||||
return Result.error("请选择教代会!");
|
||||
}
|
||||
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("一次预选已结束");
|
||||
}*/
|
||||
|
||||
int dbCount = dao.count(ExecutiveCommitteeOnePush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId)
|
||||
.and("addType", "=", 2));
|
||||
if (dbCount + userValue.length > config.getPrepareGroupQuotaCount()) {
|
||||
return Result.error("推选人数限制" + config.getPrepareGroupQuotaCount() + "人");
|
||||
}
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*
|
||||
FROM
|
||||
teacher_congress_delegate t1
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t1.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.userId", "in", userValue);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> dbList = baseService.listMap(sql);
|
||||
|
||||
List<ExecutiveCommitteeOnePush> list = new ArrayList<>();
|
||||
for (String id : userValue) {
|
||||
NutMap jdhDb = dbList.stream().filter(v -> v.getString("userId").equals(id)).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(jdhDb)) {
|
||||
return Result.error("请选择正确的代表!");
|
||||
}
|
||||
ExecutiveCommitteeOnePush onePush = new ExecutiveCommitteeOnePush();
|
||||
onePush.setPushDate(DateUtil.date());
|
||||
onePush.setUserId(jdhDb.getString("userId"));
|
||||
onePush.setUserName(jdhDb.getString("userName"));
|
||||
onePush.setLoginName(jdhDb.getString("loginName"));
|
||||
onePush.setDelegationId(jdhDb.getString("delegationId"));
|
||||
onePush.setUnionId(jdhDb.getString("unionId"));
|
||||
onePush.setUnitId(jdhDb.getString("unitId"));
|
||||
onePush.setTeacherMeetId(teacherMeetId);
|
||||
String firstLetter = String.valueOf(getFirstLetter(jdhDb.getString("userName")));
|
||||
onePush.setFirstLetter(firstLetter);
|
||||
onePush.setAddType(2);
|
||||
list.add(onePush);
|
||||
}
|
||||
dao.insert(list);
|
||||
List<ExecutiveCommitteeTwoPush> twoPushList = dao.query(ExecutiveCommitteeTwoPush.class, Cnd.where(ExecutiveCommitteeTwoPush::getTeacherMeetId, "=", teacherMeetId).and(ExecutiveCommitteeTwoPush::getUserId, "in", userValue));
|
||||
List<String> ids = twoPushList.stream().map(ExecutiveCommitteeTwoPush::getId).toList();
|
||||
dao.update(ExecutiveCommitteeTwoPush.class, Chain.make("isFormal", true), Cnd.where("id", "in", ids));
|
||||
return Result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -202,16 +172,9 @@ public class ExecutiveCommitteePushController {
|
||||
@SaCheckPermission("executiveCommittee.preparatoryGroupPush")
|
||||
@SLog(tag = "执委会推选-筹备组推选", msg = "删除推选的人")
|
||||
public Result doDelete(@Valid String id, @Valid String teacherMeetId) {
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
int num = dao.clear(ExecutiveCommitteeOnePush.class, Cnd.where("id", "=", id));
|
||||
return num >= 0 ? Result.success() : Result.error();
|
||||
dao.update(ExecutiveCommitteeTwoPush.class, Chain.make("isFormal", false), Cnd.where("id", "=", id));
|
||||
return Result.success("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
public static char getFirstLetter(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
throw new IllegalArgumentException("字符串不能为空");
|
||||
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.pinyin.PinyinUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeOnePush;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeUnionPushInfo;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/3/13 16:09
|
||||
* @description 党委书记审核
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/executiveCommittee/pushDwSjAudit")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "两委会委员推选-党委书记审查")
|
||||
public class ExecutiveCommitteePushDwSjAuditController {
|
||||
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("executiveCommittee.pushDwSjAudit")
|
||||
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/pushDwSjAudit/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("executiveCommittee.pushDwSjAudit")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "teacherMeetId") String teacherMeetId,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
tcd.loginName,
|
||||
tcd.userName,
|
||||
tcd.age,
|
||||
tcd.sex,
|
||||
tcd.unitName,
|
||||
tcd.unionName,
|
||||
ion.`name` delegationName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN executive_committee_union_push_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN teacher_congress_delegate tcd on tcd.sessionId=@sessionId and tcd.userId=info.userId
|
||||
LEFT JOIN teacher_congress_delegation ion on ion.id=tcd.delegationId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""").setParam("sessionId", teacherMeetId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "4d57210e-076e-4446-a3b3-139397e4e6de");
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
cnd.andEX("info.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("info.userName", pageForm.getSearchKeyword());
|
||||
group.orLike("info.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("提交")
|
||||
@SaCheckPermission("executiveCommittee.pushDwSjAudit")
|
||||
public Result executeTask(@Param("data") String data) {
|
||||
Dict args = Json.fromJson(Dict.class, data);
|
||||
flowCommonService.executeTask(args);
|
||||
|
||||
List<ExecutiveCommitteeOnePush> pushArrayList = new ArrayList<>();
|
||||
if (args.getInt("submitType") == 1) {
|
||||
ExecutiveCommitteeUnionPushInfo pushInfo = baseService.dao().fetch(ExecutiveCommitteeUnionPushInfo.class, args.getStr("bizId"));
|
||||
Teacher_congress_delegate delegate = baseService.dao().fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getUserId, "=", pushInfo.getUserId())
|
||||
.and(Teacher_congress_delegate::getSessionId, "=", pushInfo.getTeacherMeetId()));
|
||||
|
||||
ExecutiveCommitteeOnePush onePush = new ExecutiveCommitteeOnePush();
|
||||
onePush.setUserId(pushInfo.getUserId());
|
||||
onePush.setTeacherMeetId(pushInfo.getTeacherMeetId());
|
||||
onePush.setUnionId(delegate.getUnionId());
|
||||
onePush.setUnitId(delegate.getUnitId());
|
||||
onePush.setDelegationId(delegate.getDelegationId());
|
||||
onePush.setUserName(delegate.getUserName());
|
||||
onePush.setLoginName(delegate.getLoginName());
|
||||
String firstLetter = String.valueOf(getFirstLetter(delegate.getUserName()));
|
||||
onePush.setFirstLetter(firstLetter);
|
||||
onePush.setAddType(3);
|
||||
onePush.setPushDate(DateUtil.date());
|
||||
pushArrayList.add(onePush);
|
||||
}
|
||||
baseService.dao().insert(pushArrayList);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
public static char getFirstLetter(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
throw new IllegalArgumentException("字符串不能为空");
|
||||
}
|
||||
char firstChar = str.charAt(0);
|
||||
if (Validator.isChinese(String.valueOf(firstChar))) {
|
||||
return Character.toUpperCase(PinyinUtil.getPinyin(firstChar).charAt(0));
|
||||
} else if (Character.isLetter(firstChar)) {
|
||||
return Character.toUpperCase(firstChar);
|
||||
} else {
|
||||
return firstChar;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+290
@@ -0,0 +1,290 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeConfig;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeOnePush;
|
||||
import com.budwk.app.zhgh.democratic.executiveCommittee.models.ExecutiveCommitteeUnionPushInfo;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/3/13 11:32
|
||||
* @description 分工会推选
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/executiveCommittee/unionPush")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
@Api(tags = "两委会委员推选-分工会推选")
|
||||
public class ExecutiveCommitteeUnionPushController {
|
||||
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("executiveCommittee.unionPush")
|
||||
@Ok("beetl:/platform/zhgh/democratic/executiveCommittee/unionPush/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("executiveCommittee.unionPush")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "teacherMeetId") String teacherMeetId,
|
||||
@Param(value = "unionId") String unionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
tcd.loginName,
|
||||
tcd.userName,
|
||||
tcd.age,
|
||||
tcd.sex,
|
||||
tcd.unitName,
|
||||
tcd.unionName,
|
||||
ion.`name` delegationName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT t.displayName),'结束') curTaskName,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
executive_committee_union_push_info info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN teacher_congress_delegate tcd on tcd.sessionId=@sessionId and tcd.userId=info.userId
|
||||
LEFT JOIN teacher_congress_delegation ion on ion.id=tcd.delegationId
|
||||
$condition
|
||||
""").setParam("sessionId", teacherMeetId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.teacherMeetId", "=", teacherMeetId);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("info.userName", pageForm.getSearchKeyword());
|
||||
group.orLike("info.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
cnd.desc("info.createdAt");
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if (AuthUtil.hasRole(RoleConstant.UNIT_PARTY_SECRETARY.name())) {
|
||||
cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
|
||||
}
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询可以推选委员和已经推选的人员")
|
||||
@SaCheckPermission("executiveCommittee.unionPush")
|
||||
public Result getUnionUser(String teacherMeetId) {
|
||||
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where(ExecutiveCommitteeConfig::getTeacherMeetId, "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("请等待一次预选开始时间");
|
||||
}
|
||||
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("一次预选已结束");
|
||||
}
|
||||
List<ExecutiveCommitteeOnePush> userValue = dao.query(ExecutiveCommitteeOnePush.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
List<ExecutiveCommitteeOnePush> onePushList = dao.query(ExecutiveCommitteeOnePush.class, Cnd.NEW());
|
||||
List<String> userIds = onePushList.stream().map(v -> v.getUserId()).collect(Collectors.toList());
|
||||
|
||||
|
||||
List<ExecutiveCommitteeUnionPushInfo> pushInfoList = dao.query(ExecutiveCommitteeUnionPushInfo.class, Cnd.where(ExecutiveCommitteeUnionPushInfo::getTeacherMeetId, "=", teacherMeetId));
|
||||
List<String> unionPushUserIds = pushInfoList.stream().map(v -> v.getUserId()).toList();
|
||||
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("db.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("db.userId", "not in", userIds);
|
||||
cnd.andEX("db.userId", "not in", unionPushUserIds);
|
||||
cnd.andEX("db.userId", "!=", SecurityUtil.getUserId());
|
||||
cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
db.*,
|
||||
u.professionalTitle,
|
||||
u.professionalLevel,
|
||||
TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) AS age
|
||||
FROM
|
||||
teacher_congress_delegate db
|
||||
LEFT JOIN `vw_user` u ON db.userId = u.id
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> userData = baseService.listMap(sql);
|
||||
|
||||
|
||||
List<NutMap> unionQuotaList = config.getUnionQuotaList();
|
||||
NutMap unionQuota = unionQuotaList.stream().filter(v -> v.getString("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null);
|
||||
if (Lang.isNotEmpty(unionQuota)) {
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", unionQuota.getInt("quotaCount")));
|
||||
}
|
||||
return Result.success(Map.of("userData", userData, "userValue", userValue, "quotaCount", 0));
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("executiveCommittee.unionPush")
|
||||
@SLog(tag = "执委会推选-分工会推选委员", msg = "推选委员")
|
||||
public Result addPush(@Param("userValue") String[] userValue,
|
||||
String teacherMeetId) {
|
||||
|
||||
|
||||
ExecutiveCommitteeConfig config = dao.fetch(ExecutiveCommitteeConfig.class,
|
||||
Cnd.where("teacherMeetId", "=", teacherMeetId));
|
||||
if (ObjectUtil.isEmpty(config)) {
|
||||
return Result.error("请先配置基础信息");
|
||||
}
|
||||
if (config.getFirstStartTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("请等待一次预选开始时间");
|
||||
}
|
||||
if (config.getFirstEndTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("一次预选已结束");
|
||||
}
|
||||
List<NutMap> unionQuotaList = config.getUnionQuotaList();
|
||||
|
||||
NutMap unionQuota = unionQuotaList.stream().filter(v -> v.getString("unionId").equals(SecurityUtil.getUnionId())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(unionQuota)) {
|
||||
return Result.error("请先配置分工会人数");
|
||||
}
|
||||
|
||||
int dbCount = dao.count(ExecutiveCommitteeUnionPushInfo.class,
|
||||
Cnd.where(ExecutiveCommitteeUnionPushInfo::getUnionId, "=", SecurityUtil.getUnionId())
|
||||
.and(ExecutiveCommitteeUnionPushInfo::getTeacherMeetId, "=", teacherMeetId));
|
||||
if (dbCount + userValue.length > unionQuota.getInt("quotaCount")) {
|
||||
return Result.error("推选人数限制" + unionQuota.getInt("quotaCount") + "人");
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*
|
||||
FROM
|
||||
teacher_congress_delegate t1
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t1.sessionId", "=", teacherMeetId);
|
||||
cnd.andEX("t1.userId", "in", userValue);
|
||||
sql.setCondition(cnd);
|
||||
List<Teacher_congress_delegate> dbList = baseService.listVO(sql, Teacher_congress_delegate.class);
|
||||
|
||||
List<ExecutiveCommitteeUnionPushInfo> list = new ArrayList<>();
|
||||
for (String id : userValue) {
|
||||
Teacher_congress_delegate jdhDb = dbList.stream().filter(v -> v.getUserId().equals(id)).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(jdhDb)) {
|
||||
return Result.error("请选择正确的代表!");
|
||||
}
|
||||
|
||||
ExecutiveCommitteeUnionPushInfo pushInfo = new ExecutiveCommitteeUnionPushInfo();
|
||||
pushInfo.setPushDate(DateUtil.date());
|
||||
pushInfo.setUserId(jdhDb.getUserId());
|
||||
pushInfo.setUnionId(jdhDb.getUnionId());
|
||||
pushInfo.setUnitId(jdhDb.getUnitId());
|
||||
pushInfo.setTeacherMeetId(teacherMeetId);
|
||||
list.add(pushInfo);
|
||||
}
|
||||
dao.insert(list);
|
||||
|
||||
list.forEach(ExecutiveCommitteeUnionPushInfo -> {
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, ExecutiveCommitteeUnionPushInfo);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("LWHHY", ExecutiveCommitteeUnionPushInfo.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
});
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@SaCheckPermission("executiveCommittee.unionPush")
|
||||
@SLog(tag = "删除推选代表", msg = "删除推选代表")
|
||||
public Result doDelete(String id){
|
||||
baseService.dao().delete(ExecutiveCommitteeUnionPushInfo.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+10
@@ -51,6 +51,11 @@ public class ExecutiveCommitteeConfig extends BaseModel implements Serializable
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer unionQuotaCount;
|
||||
|
||||
@Column
|
||||
@Comment("代表团推荐名额总数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer delegationQuotaCount;
|
||||
|
||||
@Column
|
||||
@Comment("一次预选开始时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@@ -76,4 +81,9 @@ public class ExecutiveCommitteeConfig extends BaseModel implements Serializable
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<NutMap> unionQuotaList;
|
||||
|
||||
@Column
|
||||
@Comment("各代表团名额数")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<NutMap> delegationQuotaList;
|
||||
|
||||
}
|
||||
|
||||
+11
@@ -66,4 +66,15 @@ public class ExecutiveCommitteeTwoPush extends BaseModel implements Serializable
|
||||
@Comment("推选时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime pushDate;
|
||||
|
||||
@Column
|
||||
@Comment("录入类型1.执委会委员/2.工会委员会委员/3.经审委员会委员")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 30)
|
||||
private String roleCode;
|
||||
|
||||
@Column
|
||||
@Comment("是否正式委员")
|
||||
@Default("0")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isFormal;
|
||||
}
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
package com.budwk.app.zhgh.democratic.executiveCommittee.models;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/3/13 14:32
|
||||
* @description 分工会推选记录表
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("executive_committee_union_push_info")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("分工会推选记录表")
|
||||
public class ExecutiveCommitteeUnionPushInfo extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("代表用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("所属教代会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String teacherMeetId;
|
||||
|
||||
@Column
|
||||
@Comment("所属分工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("推选时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private DateTime pushDate;
|
||||
}
|
||||
+6
-1
@@ -37,7 +37,12 @@ public class ExecutiveCommitteeMemberServiceImpl extends BaseServiceImpl impleme
|
||||
YEAR,
|
||||
u.birthday,
|
||||
CURDATE()) AS age,
|
||||
( SELECT count( 1 ) FROM executive_committee_two_push tp WHERE tp.userId = op.userId ) as pushCount
|
||||
( SELECT count( 1 ) FROM executive_committee_two_push tp WHERE tp.userId = op.userId ) as pushCount,
|
||||
CASE op.addType
|
||||
WHEN 1 THEN '执委会委员'
|
||||
WHEN 3 THEN '工会委员会委员'
|
||||
ELSE '未知'
|
||||
END AS addTypeName
|
||||
FROM
|
||||
executive_committee_one_push op
|
||||
LEFT JOIN sys_unit it ON op.unitId = it.id
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ public class OpinionWriteController {
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, opinionInfo);
|
||||
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("JDHYJ", opinionInfo.getId(), opinionInfo.getCreateUserId(), args);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("JDHYJ", opinionInfo.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
|
||||
+15
-9
@@ -2,11 +2,14 @@ package com.budwk.app.zhgh.democratic.proposal.controller.query;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.controller.vo.ProposalInfoPageVO;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -24,7 +27,6 @@ import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Arrays;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/proposal/query/comprehensive")
|
||||
@@ -65,6 +67,7 @@ public class ProposalQueryComprehensiveController {
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 0 THEN pru.unitName END) AS slaveUnitNames
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN vw_user us ON us.loginname=info.createUserLoginName
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN proposal_merge mer ON mer.proposalId = info.id
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
@@ -77,25 +80,25 @@ public class ProposalQueryComprehensiveController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(ArrayUtil.isNotEmpty(pageForm.getOrigins())){
|
||||
if (ArrayUtil.isNotEmpty(pageForm.getOrigins()) && ObjectUtil.isNotEmpty(pageForm.getCommonKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
|
||||
// 案名
|
||||
if(ArrayUtil.contains(pageForm.getOrigins(),"name")){
|
||||
if (ArrayUtil.contains(pageForm.getOrigins(), "name")) {
|
||||
for (String keyword : pageForm.getCommonKeyword().split(" ")) {
|
||||
seg.orLike("info.name", keyword);
|
||||
}
|
||||
}
|
||||
|
||||
// 案由
|
||||
if(ArrayUtil.contains(pageForm.getOrigins(),"brief")){
|
||||
if (ArrayUtil.contains(pageForm.getOrigins(), "brief")) {
|
||||
for (String keyword : pageForm.getCommonKeyword().split(" ")) {
|
||||
seg.orLike("info.brief", keyword);
|
||||
}
|
||||
}
|
||||
|
||||
// 提案人
|
||||
if(ArrayUtil.contains(pageForm.getOrigins(),"createUserName")){
|
||||
if (ArrayUtil.contains(pageForm.getOrigins(), "createUserName")) {
|
||||
for (String keyword : pageForm.getCommonKeyword().split(" ")) {
|
||||
seg.orLike("info.createUserName", keyword);
|
||||
seg.orLike("info.createUserLoginName", keyword);
|
||||
@@ -103,21 +106,24 @@ public class ProposalQueryComprehensiveController {
|
||||
}
|
||||
|
||||
// 答复内容
|
||||
if(ArrayUtil.contains(pageForm.getOrigins(),"answer")){
|
||||
if (ArrayUtil.contains(pageForm.getOrigins(), "answer")) {
|
||||
for (String keyword : pageForm.getCommonKeyword().split(" ")) {
|
||||
seg.orLike("JSON_EXTRACT(replyTask.variable,'$.tf_opinion')", keyword);
|
||||
}
|
||||
}
|
||||
|
||||
if(!seg.isEmpty()){
|
||||
if (!seg.isEmpty()) {
|
||||
cnd.and(seg);
|
||||
}
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(pageForm.getUnderTakeUnitId())){
|
||||
if (StrUtil.isNotBlank(pageForm.getUnderTakeUnitId())) {
|
||||
cnd.andEX("pru.unitId", "=", pageForm.getUnderTakeUnitId());
|
||||
}
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(),RoleConstant.SCHOOL_UNION_PROPOSAL_ADMIN.name())){
|
||||
cnd.and("us.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
|
||||
+130
-102
@@ -1,23 +1,26 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessTask;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.flow.service.ProcessTaskService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.proposal.controller.vo.ProposalInfoPageVO;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalCommitteeFilingUnitApprovalParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalCommitteeFilingUnitService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -25,10 +28,10 @@ import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
@@ -46,10 +49,15 @@ public class ProposalCommitteeFilingUnitController {
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private ProposalCommitteeFilingUnitService proposalCommitteeFilingUnitService;
|
||||
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private ProcessTaskService processTaskService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/committeeFilingUnit/index.html")
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@@ -64,123 +72,143 @@ public class ProposalCommitteeFilingUnitController {
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT(p.consolidationIds) > 0 AS isConsolidation,
|
||||
EXISTS (
|
||||
SELECT 1
|
||||
FROM bpm_process_task next_task
|
||||
WHERE next_task.prevTaskId = task.id
|
||||
AND next_task.taskStatus = 'COMPLETE'
|
||||
) AS nextTaskIsComplete
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL OR (ins.state = 20 AND info.caseFilingResult = 'NOT'), 1, 0) AS canRevoke
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN proposal_info info ON info.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id))
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN proposal_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd ON tcd.id = info.delegationId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
|
||||
LEFT JOIN proposal_merge mer ON mer.proposalId = info.id
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "committeeFilingUnit");
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and(new Static("JSON_CONTAINS( task.assignments, '\"%s\"' )".formatted(SecurityUtil.getUserLoginname())));
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
cnd.and("nd.nodeCode", "=", 70);
|
||||
if (approval) {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.ACTIVE);
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.and(new Static("""
|
||||
NOT EXISTS(
|
||||
SELECT 1
|
||||
FROM bpm_process_task t2
|
||||
WHERE t2.processInstanceId = task.processInstanceId
|
||||
AND t2.processTaskNodeCode = task.processTaskNodeCode
|
||||
AND t2.createdOn > task.createdOn
|
||||
)
|
||||
"""));
|
||||
cnd.groupBy("info.id");
|
||||
cnd.groupBy("task.id");
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageVO(pageForm, sql, ProposalInfoPageVO.class);
|
||||
Pagination pagination = proposalCommitteeFilingUnitService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@ApiOperation("执行任务")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "委员会确认承办单位", msg = "委员会确认承办单位")
|
||||
@ApiOperation("委员会确认承办单位")
|
||||
public Result approval(@Valid @Param("approval") ProposalCommitteeFilingUnitApprovalParam approvalParam) {
|
||||
proposalCommitteeFilingUnitService.approval(approvalParam);
|
||||
return Result.success();
|
||||
}
|
||||
public Result executeTask(@Param("data") String data) {
|
||||
Dict args = Json.fromJson(Dict.class, data);
|
||||
String proposalId = args.getStr("proposalId");
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "委员会确认承办单位", msg = "委员会确认承办单位撤回")
|
||||
public Result revoke(@Valid String taskId) {
|
||||
proposalCommitteeFilingUnitService.revoke(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
// 查询是否提案
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@ApiOperation("查询立案的结果及承办单位")
|
||||
public Result committeeFiling(@Valid String processInstanceId, @Valid String processInstanceTaskId) {
|
||||
JSONObject newJson = new JSONObject();
|
||||
|
||||
BpmProcessTask caseUnitTask = proposalCommitteeFilingUnitService.dao().fetch(BpmProcessTask.class,
|
||||
Cnd.where(BpmProcessTask::getId, "=", processInstanceTaskId)
|
||||
.and(BpmProcessTask::getProcessInstanceId, "=", processInstanceId)
|
||||
.and(BpmProcessTask::getProcessTaskNodeCode, "=", 70)
|
||||
.and(BpmProcessTask::getDelFlag, "=", 0)
|
||||
);
|
||||
if (ObjectUtil.isNotNull(caseUnitTask) && ObjectUtil.isNotEmpty(caseUnitTask.getExtVariable())) {
|
||||
JSONObject jsonObject = caseUnitTask.getExtVariable();
|
||||
newJson.set("caseFilingResult", jsonObject.get("caseFilingResult"));
|
||||
newJson.set("hostUnitId", jsonObject.get("hostUnitId"));
|
||||
newJson.set("helpUnitIds", jsonObject.getBeanList("helpUnitIds", String.class));
|
||||
newJson.set("approvalOpinion", jsonObject.get("approvalOpinion"));
|
||||
newJson.set("consolidationIds", jsonObject.getBeanList("consolidationIds", String.class));
|
||||
return Result.success(newJson);
|
||||
// 单条审核
|
||||
List<String> mergeProposalIds = proposalCommonService.mergeProposal(proposalId);
|
||||
if (ObjectUtil.isEmpty(mergeProposalIds)) {
|
||||
flowCommonService.executeTask(args);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
BpmProcessTask caseTask = proposalCommitteeFilingUnitService.dao().fetch(BpmProcessTask.class,
|
||||
Cnd.where(BpmProcessTask::getProcessInstanceId, "=", processInstanceId)
|
||||
.and(BpmProcessTask::getDelFlag, "=", 0)
|
||||
.and(BpmProcessTask::getProcessTaskNodeCode, "=", 60)
|
||||
.desc(BpmProcessTask::getCreatedOn)
|
||||
);
|
||||
JSONObject jsonObject = caseTask.getExtVariable();
|
||||
newJson.set("caseFilingResult", jsonObject.get("caseFilingResult"));
|
||||
newJson.set("hostUnitId", jsonObject.get("hostUnitId"));
|
||||
newJson.set("helpUnitIds", jsonObject.getBeanList("helpUnitIds", String.class));
|
||||
newJson.set("approvalOpinion", jsonObject.get("approvalOpinion"));
|
||||
newJson.set("consolidationIds", jsonObject.getBeanList("consolidationIds", String.class));
|
||||
return Result.success(newJson);
|
||||
// 并案审核
|
||||
ProcessTask thisTask = baseService.dao().fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY));
|
||||
List<ProcessTask> mergeTasks = processTaskService.getDoingTaskByBizIdTaskName(mergeProposalIds, thisTask.getTaskName());
|
||||
for (ProcessTask mergeTask : mergeTasks) {
|
||||
Dict cloneArgs = args.clone();
|
||||
cloneArgs.put(FlowConst.PROCESS_TASK_ID_KEY, mergeTask.getId());
|
||||
flowCommonService.executeTask(cloneArgs);
|
||||
}
|
||||
|
||||
ProposalInfo info = proposalCommonService.fetch(proposalId);
|
||||
info.setCaseFilingResult(args.getStr("caseFilingResult"));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("撤销任务")
|
||||
public Result revokeTask(@Param("taskId") Long taskId,@Param("proposalId")String proposalId) {
|
||||
// 单条审核
|
||||
List<String> mergeProposalIds = proposalCommonService.mergeProposal(proposalId);
|
||||
if (ObjectUtil.isEmpty(mergeProposalIds)) {
|
||||
flowCommonService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
// 并案审核
|
||||
ProcessTask thisTask = baseService.dao().fetch(ProcessTask.class, taskId);
|
||||
List<ProcessTask> mergeTasks = processTaskService.getDoneTaskByBizIdTaskName(mergeProposalIds, thisTask.getTaskName());
|
||||
for (ProcessTask mergeTask : mergeTasks) {
|
||||
flowCommonService.revokeTask(mergeTask.getId());
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@ApiOperation("查询承办单位")
|
||||
public Result listUnderTake() {
|
||||
List<ProposalUndertake> list = baseService.dao().query(ProposalUndertake.class, Cnd.NEW().asc(ProposalUndertake::getCode));
|
||||
return Result.success(list);
|
||||
public Result doUpData(){
|
||||
List<ProcessTask> tasks = baseService.dao().query(ProcessTask.class, Cnd.where("taskName", "=", "personnelOffice"));
|
||||
List<Long> list = tasks.stream().map(ProcessTask::getId).toList();
|
||||
|
||||
List<ProcessTaskActor> actorList = baseService.dao().query(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "in", list));
|
||||
|
||||
List<ProcessInstance> instanceList = baseService.dao().query(ProcessInstance.class, Cnd.where(ProcessInstance::getProcessDefineId, "=", 396));
|
||||
|
||||
for (ProcessTask task : tasks) {
|
||||
task.setTaskName("committee");
|
||||
task.setDisplayName("提案委员会立案");
|
||||
task.setFormKey("/platform/proposal/committee");
|
||||
task.setH5FormKey("");
|
||||
}
|
||||
|
||||
for (ProcessTaskActor actor : actorList) {
|
||||
actor.setActorId("1fb89886bf4c43dcb48409c83d3363c3");
|
||||
actor.setActorAccount("018054");
|
||||
actor.setActorName("赵丽霞");
|
||||
actor.setActorUnitName("工会");
|
||||
actor.setActorUnitId("0011");
|
||||
}
|
||||
|
||||
for (ProcessInstance instance : instanceList) {
|
||||
instance.setProcessDefineId(399L);
|
||||
}
|
||||
|
||||
baseService.update(tasks);
|
||||
baseService.update(actorList);
|
||||
baseService.update(instanceList);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-121
@@ -1,121 +0,0 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
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 com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalDelegationService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/3/12 09:36
|
||||
* @description 人事处审核
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/proposal/personnelOffice")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "提案-办理-人事处审核")
|
||||
public class ProposalPersonnelOfficeController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private ProposalDelegationService proposalDelegationService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/personnelOffice/index.html")
|
||||
@SaCheckPermission("proposal.personnelOffice")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/personnelOffice/index.html")
|
||||
@SaCheckPermission("h5.proposal.personnelOffice")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.personnelOffice")
|
||||
@ApiOperation("分页列表")
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN proposal_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "personnelOffice");
|
||||
|
||||
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-3
@@ -1,13 +1,11 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
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 com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalSecondedService;
|
||||
@@ -101,7 +99,7 @@ public class ProposalSecondedController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "second");
|
||||
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
if (!SecurityUtil.getUserLoginname().equals("sysadmin")) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.handler;
|
||||
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.flow.engine.AssignmentHandler;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.flow.engine.model.TaskModel;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/3/16 13:54
|
||||
* @description 提案人事处管理员
|
||||
*/
|
||||
public class proposalPersonnelOfficeAdminHandler implements AssignmentHandler {
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
Sys_role role = sysRoleService.getByCode(RoleConstant.PROPOSAL_PERSONNEL_OFFICE_ADMIN);
|
||||
|
||||
List<Sys_user_role> roles = ServiceContext.find(Dao.class).query(
|
||||
Sys_user_role.class,
|
||||
Cnd.where(Sys_user_role::getRoleId, "=", role.getId()));
|
||||
if (Lang.isEmpty(roles)) {
|
||||
throw new RuntimeException("当前登录用户所在单位未设置单位党委书记,请联系校工会进行设置。");
|
||||
}
|
||||
return roles.stream().map(Sys_user_role::getUserId).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "获取当前提案人事处管理员";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return AssignmentHandler.super.getOrder();
|
||||
}
|
||||
}
|
||||
+9
-4
@@ -1,24 +1,23 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.interceptor;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ProposalDelegationPrefixInterceptor
|
||||
* @Author JyuHsin
|
||||
@@ -77,6 +76,12 @@ public class ProposalDelegationPrefixInterceptor implements FlowInterceptor {
|
||||
|
||||
execution.getArgs().set(FlowConst.TASK_FORM_DATA_PREFIX + "delegationAudit", delegationAudit);
|
||||
|
||||
ProcessTask processTask = execution.getProcessTask();
|
||||
Dict dict = JSONUtil.toBean(processTask.getVariable(), Dict.class);
|
||||
dict.set(FlowConst.TASK_FORM_DATA_PREFIX + "delegationAudit", delegationAudit);
|
||||
processTask.setVariable(JSONUtil.toJsonStr(dict));
|
||||
dao.update(processTask);
|
||||
|
||||
// 存储一些参数,方便查询副团长
|
||||
execution.getArgs().set("sessionId", proposalInfo.getSessionId());
|
||||
execution.getArgs().set("delegationId", proposalInfo.getDelegationId());
|
||||
|
||||
+20
-14
@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.budwk.app.base.param.ExportTableColumns;
|
||||
@@ -192,25 +193,30 @@ public class ProposalExportServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
// 添加序号,去除富文本,获取附议人
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).put("index", i + 1);
|
||||
list.get(i).put("brief", HtmlUtil.cleanHtmlTag(list.get(i).getString("brief")));
|
||||
list.get(i).put("measures", HtmlUtil.cleanHtmlTag(list.get(i).getString("measures")));
|
||||
list.get(i).put("brief", HtmlUtil.cleanHtmlTag(list.get(i).getString("brief")).replaceAll(" "," "));
|
||||
list.get(i).put("measures", HtmlUtil.cleanHtmlTag(list.get(i).getString("measures")).replaceAll(" "," "));
|
||||
|
||||
// 流程实例
|
||||
ProcessInstance instance = dao().fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", list.get(i).getString("id")));
|
||||
|
||||
// 查询附议人信息
|
||||
ProcessTask inviteTask = dao().fetch(ProcessTask.class,
|
||||
Cnd.where(ProcessTask::getProcessInstanceId, "=", instance.getId())
|
||||
.and(ProcessTask::getTaskName, "=", "invite")
|
||||
.and(ProcessTask::getTaskState, "in",
|
||||
List.of(ProcessTaskStateEnum.DOING.getCode(), ProcessTaskStateEnum.FINISHED.getCode()))
|
||||
.desc(ProcessTask::getCreatedAt));
|
||||
if (ObjectUtil.isNotEmpty(instance)){
|
||||
ProcessTask inviteTask = dao().fetch(ProcessTask.class,
|
||||
Cnd.where(ProcessTask::getProcessInstanceId, "=", instance.getId())
|
||||
.and(ProcessTask::getTaskName, "=", "invite")
|
||||
.and(ProcessTask::getTaskState, "in",
|
||||
List.of(ProcessTaskStateEnum.DOING.getCode(), ProcessTaskStateEnum.FINISHED.getCode()))
|
||||
.desc(ProcessTask::getCreatedAt));
|
||||
|
||||
if (inviteTask != null) {
|
||||
NutMap variable = Json.fromJson(NutMap.class, inviteTask.getVariable());
|
||||
List<NutMap> seconders = variable.getAsList(FlowConst.TASK_FORM_DATA_PREFIX + "seconder", NutMap.class);
|
||||
list.get(i).put("secondedUserNames", seconders.stream().map(v -> v.getString("userName")).collect(Collectors.joining(",")));
|
||||
if (inviteTask != null) {
|
||||
NutMap variable = Json.fromJson(NutMap.class, inviteTask.getVariable());
|
||||
List<NutMap> seconders = variable.getAsList(FlowConst.TASK_FORM_DATA_PREFIX + "seconder", NutMap.class);
|
||||
if (seconders != null){
|
||||
list.get(i).put("secondedUserNames", seconders.stream().map(v -> v.getString("userName")).collect(Collectors.joining(",")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
@@ -570,8 +576,8 @@ public class ProposalExportServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
// 添加序号,去除富文本,获取附议人
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).put("index", i + 1);
|
||||
list.get(i).put("brief", HtmlUtil.cleanHtmlTag(list.get(i).getString("brief")));
|
||||
list.get(i).put("measures", HtmlUtil.cleanHtmlTag(list.get(i).getString("measures")));
|
||||
list.get(i).put("brief", HtmlUtil.cleanHtmlTag(list.get(i).getString("brief")).replaceAll(" "," "));
|
||||
list.get(i).put("measures", HtmlUtil.cleanHtmlTag(list.get(i).getString("measures")).replaceAll(" "," "));
|
||||
|
||||
// 流程实例
|
||||
// ProcessInstance instance = dao().fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", list.get(i).getString("id")));
|
||||
|
||||
+8
-1
@@ -1,10 +1,12 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.common;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
@@ -14,6 +16,7 @@ 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.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@@ -54,10 +57,14 @@ public class TeacherCongressCommonController {
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result listDelegate(String sessionId, String keyWord) {
|
||||
public Result listDelegate(String sessionId, String delegationId,String keyWord) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("sessionId", "=", sessionId);
|
||||
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())&&!AuthUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("delegationId", "=", delegationId);
|
||||
}
|
||||
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("userName", keyWord);
|
||||
group.orLike("loginName", keyWord);
|
||||
|
||||
+5
-4
@@ -1,6 +1,7 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.benefiting.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
@@ -47,7 +48,7 @@ public class BenefitingProjectManageController {
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"benefiting.manage","benefiting.list"})
|
||||
@SaCheckPermission(value = {"benefiting.manage", "benefiting.list"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,Integer year,String projectName) {
|
||||
Sql sql = Sqls.create("""
|
||||
select * from benefiting_project $condition
|
||||
@@ -63,7 +64,7 @@ public class BenefitingProjectManageController {
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("benefiting.manage")
|
||||
@SaCheckPermission(value = {"benefiting.manage", "benefiting.list"}, mode = SaMode.OR)
|
||||
public Result doSubmit(BenefitingProject benefitingProject) {
|
||||
benefitingProject.setCreateTime(new Date());
|
||||
baseService.insertOrUpdate(benefitingProject);
|
||||
@@ -72,7 +73,7 @@ public class BenefitingProjectManageController {
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("benefiting.manage")
|
||||
@SaCheckPermission(value = {"benefiting.manage", "benefiting.list"}, mode = SaMode.OR)
|
||||
public Result doDelete(String id) {
|
||||
baseService.dao().delete(BenefitingProject.class, id);
|
||||
return Result.success();
|
||||
@@ -80,7 +81,7 @@ public class BenefitingProjectManageController {
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("benefiting.manage")
|
||||
@SaCheckPermission(value = {"benefiting.manage", "benefiting.list"}, mode = SaMode.OR)
|
||||
public Result findOne(String id) {
|
||||
BenefitingProject project = baseService.dao().fetch(BenefitingProject.class, id);
|
||||
return Result.success(project);
|
||||
|
||||
Reference in New Issue
Block a user