mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-25 04:36:39 +08:00
Compare commits
No commits in common. "0f0a3a181e47a52ed2b70b3ea5da5261b1ce8cae" and "b97f711eb409b8074d9b5bba481a481f16ffb542" have entirely different histories.
0f0a3a181e
...
b97f711eb4
@ -87,7 +87,7 @@ public class SysRegisterService {
|
||||
recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
|
||||
throw new CaptchaExpireException();
|
||||
}
|
||||
if (!StringUtils.equalsIgnoreCase(code, captcha)) {
|
||||
if (!code.equalsIgnoreCase(captcha)) {
|
||||
recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
|
||||
throw new CaptchaException();
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class PasswordAuthStrategy implements IAuthStrategy {
|
||||
loginService.recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
|
||||
throw new CaptchaExpireException();
|
||||
}
|
||||
if (!StringUtils.equalsIgnoreCase(code, captcha)) {
|
||||
if (!code.equalsIgnoreCase(captcha)) {
|
||||
loginService.recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
|
||||
throw new CaptchaException();
|
||||
}
|
||||
|
@ -50,11 +50,6 @@ public class CompleteTaskDTO implements Serializable {
|
||||
*/
|
||||
private String notice;
|
||||
|
||||
/**
|
||||
* 办理人(可不填 用于覆盖当前节点办理人)
|
||||
*/
|
||||
private String handler;
|
||||
|
||||
/**
|
||||
* 流程变量
|
||||
*/
|
||||
|
@ -30,11 +30,6 @@ public class StartProcessDTO implements Serializable {
|
||||
*/
|
||||
private String flowCode;
|
||||
|
||||
/**
|
||||
* 办理人(可不填 用于覆盖当前节点办理人)
|
||||
*/
|
||||
private String handler;
|
||||
|
||||
/**
|
||||
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
||||
*/
|
||||
|
@ -53,11 +53,6 @@ public class CompleteTaskBo implements Serializable {
|
||||
*/
|
||||
private String notice;
|
||||
|
||||
/**
|
||||
* 办理人(可不填 用于覆盖当前节点办理人)
|
||||
*/
|
||||
private String handler;
|
||||
|
||||
/**
|
||||
* 流程变量
|
||||
*/
|
||||
|
@ -34,11 +34,6 @@ public class StartProcessBo implements Serializable {
|
||||
@NotBlank(message = "流程定义编码不能为空", groups = {AddGroup.class})
|
||||
private String flowCode;
|
||||
|
||||
/**
|
||||
* 办理人(可不填 用于覆盖当前节点办理人)
|
||||
*/
|
||||
private String handler;
|
||||
|
||||
/**
|
||||
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
||||
*/
|
||||
|
@ -126,7 +126,6 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
variables.put(FlowConstant.AUTO_PASS, autoPass);
|
||||
|
||||
FlowParams flowParams = FlowParams.build()
|
||||
.handler(startProcessBo.getHandler())
|
||||
.flowCode(startProcessBo.getFlowCode())
|
||||
.variable(startProcessBo.getVariables())
|
||||
.flowStatus(BusinessStatusEnum.DRAFT.getStatus());
|
||||
@ -187,7 +186,6 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
}
|
||||
// 构建流程参数,包括变量、跳转类型、消息、处理人、权限等信息
|
||||
FlowParams flowParams = FlowParams.build()
|
||||
.handler(completeTaskBo.getHandler())
|
||||
.variable(variables)
|
||||
.skipType(SkipType.PASS.getKey())
|
||||
.message(completeTaskBo.getMessage())
|
||||
|
@ -9,10 +9,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.dto.CompleteTaskDTO;
|
||||
import org.dromara.common.core.domain.dto.StartProcessDTO;
|
||||
import org.dromara.common.core.domain.dto.StartProcessReturnDTO;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.service.WorkflowService;
|
||||
@ -130,14 +132,12 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
||||
// 后端发起需要忽略权限
|
||||
bo.getParams().put("ignore", true);
|
||||
|
||||
StartProcessDTO startProcess = new StartProcessDTO();
|
||||
startProcess.setBusinessId(leave.getId().toString());
|
||||
startProcess.setFlowCode(StringUtils.isEmpty(bo.getFlowCode()) ? "leave1" : bo.getFlowCode());
|
||||
startProcess.setVariables(bo.getParams());
|
||||
// 后端发起 如果没有登录用户 比如定时任务 可以手动设置一个处理人id
|
||||
// startProcess.setHandler("0");
|
||||
|
||||
boolean flag1 = workflowService.startCompleteTask(startProcess);
|
||||
boolean flag1 = workflowService.startCompleteTask(new StartProcessDTO() {{
|
||||
setBusinessId(leave.getId().toString());
|
||||
setFlowCode(StringUtils.isEmpty(bo.getFlowCode()) ? "leave1" : bo.getFlowCode());
|
||||
setVariables(bo.getParams());
|
||||
}});
|
||||
if (!flag1) {
|
||||
throw new ServiceException("流程发起异常");
|
||||
}
|
||||
|
@ -161,20 +161,16 @@ public class WorkflowServiceImpl implements WorkflowService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean startCompleteTask(StartProcessDTO startProcess) {
|
||||
try {
|
||||
StartProcessBo processBo = new StartProcessBo();
|
||||
processBo.setBusinessId(startProcess.getBusinessId());
|
||||
processBo.setFlowCode(startProcess.getFlowCode());
|
||||
processBo.setVariables(startProcess.getVariables());
|
||||
processBo.setHandler(startProcess.getHandler());
|
||||
|
||||
StartProcessReturnDTO result = flwTaskService.startWorkFlow(processBo);
|
||||
CompleteTaskBo taskBo = new CompleteTaskBo();
|
||||
taskBo.setTaskId(result.getTaskId());
|
||||
taskBo.setMessageType(Collections.singletonList(MessageTypeEnum.SYSTEM_MESSAGE.getCode()));
|
||||
taskBo.setVariables(startProcess.getVariables());
|
||||
taskBo.setHandler(startProcess.getHandler());
|
||||
|
||||
boolean flag = flwTaskService.completeTask(taskBo);
|
||||
StartProcessReturnDTO result = flwTaskService.startWorkFlow(new StartProcessBo() {{
|
||||
setBusinessId(startProcess.getBusinessId());
|
||||
setFlowCode(startProcess.getFlowCode());
|
||||
setVariables(startProcess.getVariables());
|
||||
}});
|
||||
boolean flag = flwTaskService.completeTask(new CompleteTaskBo() {{
|
||||
setTaskId(result.getTaskId());
|
||||
setMessageType(Collections.singletonList(MessageTypeEnum.SYSTEM_MESSAGE.getCode()));
|
||||
setVariables(startProcess.getVariables());
|
||||
}});
|
||||
if (!flag) {
|
||||
throw new ServiceException("流程发起异常");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user