commit
This commit is contained in:
@@ -48,6 +48,7 @@ public class FlowTodoCenterController {
|
||||
t.displayName AS taskName,
|
||||
t.taskState,
|
||||
t.formKey,
|
||||
t.h5FormKey,
|
||||
t.createdAt,
|
||||
t.finishTime,
|
||||
t.variable,
|
||||
@@ -92,6 +93,7 @@ public class FlowTodoCenterController {
|
||||
t.displayName AS taskName,
|
||||
t.taskState,
|
||||
t.formKey,
|
||||
t.h5FormKey,
|
||||
t.createdAt,
|
||||
t.finishTime,
|
||||
t.variable,
|
||||
@@ -115,6 +117,7 @@ public class FlowTodoCenterController {
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
cnd.where().andLike("ins.variable ->> '$.instanceName'", searchKeyword);
|
||||
}
|
||||
cnd.and("t.taskName", "!=", "startTask");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = sysUserService.listPageMap(pageNumber, pageSize, sql);
|
||||
@@ -140,10 +143,12 @@ public class FlowTodoCenterController {
|
||||
ins.createdAt,
|
||||
ins.variable ->> '$.instanceName' AS instanceName,
|
||||
GROUP_CONCAT(DISTINCT t.displayName) as taskName,
|
||||
cat.`name` categoryName
|
||||
cat.`name` categoryName,
|
||||
t.formKey,
|
||||
t.h5FormKey
|
||||
FROM
|
||||
wf_process_instance ins
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id and t.taskState = 10
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id and t.taskName = 'startTask'
|
||||
LEFT JOIN wf_process_define def ON def.id = ins.processDefineId
|
||||
LEFT JOIN wf_process_category cat ON cat.id = def.category
|
||||
$condition
|
||||
@@ -179,7 +184,7 @@ public class FlowTodoCenterController {
|
||||
ins.variable,
|
||||
ins.createdAt,
|
||||
ins.variable ->> '$.instanceName' AS instanceName,
|
||||
cat.`name` categoryName
|
||||
cat.`name` categoryName
|
||||
FROM
|
||||
wf_process_instance ins
|
||||
LEFT JOIN wf_process_define def ON def.id = ins.processDefineId
|
||||
|
||||
@@ -41,6 +41,8 @@ public class TaskModel extends NodeModel {
|
||||
*/
|
||||
private String countersignCompletionCondition;
|
||||
|
||||
private String h5form;
|
||||
|
||||
@Override
|
||||
public void exec(Execution execution) {
|
||||
// 执行任务节点自定义执行逻辑
|
||||
|
||||
@@ -8,7 +8,6 @@ import org.nutz.dao.entity.annotation.Comment;
|
||||
import org.nutz.dao.entity.annotation.Id;
|
||||
import org.nutz.dao.entity.annotation.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -66,6 +65,10 @@ public class ProcessTask extends BaseModel {
|
||||
@Column
|
||||
private String formKey;
|
||||
|
||||
@Comment("h5任务处理表单KEY")
|
||||
@Column
|
||||
private String h5FormKey;
|
||||
|
||||
@Comment("父任务ID")
|
||||
@Column
|
||||
private Long taskParentId;
|
||||
|
||||
@@ -8,7 +8,6 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.vo.LabelValueVO;
|
||||
@@ -31,7 +30,6 @@ import com.budwk.app.flow.service.ProcessDefineService;
|
||||
import com.budwk.app.flow.service.ProcessInstanceService;
|
||||
import com.budwk.app.flow.service.ProcessTaskService;
|
||||
import com.budwk.app.flow.vo.ProcessTaskVO;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -176,6 +174,7 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
||||
processTask.setTaskState(ProcessTaskStateEnum.DOING.getCode());
|
||||
processTask.setTaskType(taskModel.getTaskType().getCode());
|
||||
processTask.setFormKey(taskModel.getForm());
|
||||
processTask.setH5FormKey(taskModel.getH5form());
|
||||
processTask.setProcessInstanceId(execution.getProcessInstanceId());
|
||||
|
||||
// 增加是否为第一个任务节点标识
|
||||
@@ -283,7 +282,7 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
||||
@Override
|
||||
public boolean isAllowed(ProcessTask task, String operator) {
|
||||
// 执行者为超级管理员或自动执行用户
|
||||
if (AuthUtil.hasRole(RoleConstant.SYSADMIN.name()) || FlowConst.ADMIN_ID.equalsIgnoreCase(operator) || FlowConst.AUTO_ID.equalsIgnoreCase(operator)) {
|
||||
if (FlowConst.ADMIN_ID.equalsIgnoreCase(operator) || FlowConst.AUTO_ID.equalsIgnoreCase(operator)) {
|
||||
return true;
|
||||
}
|
||||
// 任务操作者==执行者
|
||||
@@ -392,6 +391,7 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
||||
processTask.setTaskState(ProcessTaskStateEnum.DOING.getCode());
|
||||
processTask.setTaskType(taskModel.getTaskType().getCode());
|
||||
processTask.setProcessInstanceId(execution.getProcessInstanceId());
|
||||
processTask.setH5FormKey(taskModel.getH5form());
|
||||
|
||||
// 增加是否为第一个任务节点标识
|
||||
execution.getArgs().put(FlowConst.IS_FIRST_TASK_NODE, FlowUtil.isFistTaskName(execution.getProcessModel(), taskModel.getName()));
|
||||
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user