..
This commit is contained in:
@@ -7,7 +7,7 @@ public interface FlowConst {
|
||||
// 业务流程号
|
||||
String BUSINESS_NO = "BUSINESS_NO";
|
||||
// 超级管理员ID
|
||||
String ADMIN_ID = "flow.admin";
|
||||
String ADMIN_ID = "17a7f8ad3ee947b4a26175049a9c253d";
|
||||
// 自动执行ID
|
||||
String AUTO_ID = "flow.auto";
|
||||
String PROCESS_NAME_KEY = "name";
|
||||
|
||||
@@ -11,13 +11,13 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public enum ProcessSubmitTypeEnum {
|
||||
APPLY(0, "发起申请"),
|
||||
AGREE(1, "同意申请"),
|
||||
REJECT(2, "拒绝申请"),
|
||||
AGREE(1, "同意"),
|
||||
REJECT(2, "拒绝"),
|
||||
ROLLBACK(3, "退回上一步"),
|
||||
JUMP(4, "跳转"),
|
||||
RE_APPLY(5, "重新提交"),
|
||||
ROLLBACK_TO_OPERATOR(6, "退回发起人"),
|
||||
COUNTERSIGN_DISAGREE(20, "拒绝申请");
|
||||
COUNTERSIGN_DISAGREE(20, "会签不同意");
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
package com.budwk.app.flow.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
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 com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
|
||||
import java.util.List;
|
||||
@@ -15,7 +24,14 @@ public class FlowFghzxAssignmentHandler implements AssignmentHandler {
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
return List.of("17a7f8ad3ee947b4a26175049a9c253d");
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.BRANCH_UNION_CHAIRMAN);
|
||||
String unionId = StrUtil.blankToDefault(execution.getArgs().getStr(FlowConst.INITIATOR_UNIT_UNION_ID), SecurityUtil.getUnionId());
|
||||
Sys_user_role user_role = dao.fetch(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "=", sysRole.getId()).and(Sys_user_role::getUnionId, "=", unionId));
|
||||
if (user_role == null) {
|
||||
throw new BaseException("分工会主席没有设置,请联系校工会!", sysRole.getCode());
|
||||
}
|
||||
return List.of(user_role.getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -401,10 +401,10 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
||||
// 增加是否为第一个任务节点标识
|
||||
execution.getArgs().put(FlowConst.IS_FIRST_TASK_NODE, FlowUtil.isFistTaskName(execution.getProcessModel(), taskModel.getName()));
|
||||
//过滤上个任务的表单数据 避免造成污染 每个任务只保存自己的表单数据
|
||||
List<String> removeKeys = execution.getArgs().keySet().stream().filter(k -> k.startsWith(FlowConst.TASK_FORM_DATA_PREFIX) || k.equals(FlowConst.SUBMIT_TYPE)).toList();
|
||||
for (String key : removeKeys) {
|
||||
execution.getArgs().remove(key);
|
||||
}
|
||||
// List<String> removeKeys = execution.getArgs().keySet().stream().filter(k -> k.startsWith(FlowConst.TASK_FORM_DATA_PREFIX) || k.equals(FlowConst.SUBMIT_TYPE)).toList();
|
||||
// for (String key : removeKeys) {
|
||||
// execution.getArgs().remove(key);
|
||||
// }
|
||||
|
||||
processTask.setVariable(JSONUtil.toJsonStr(execution.getArgs()));
|
||||
processTask.setCreatedAt(now);
|
||||
|
||||
Reference in New Issue
Block a user