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