mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 10:13:28 +08:00
update 调整作废,撤销等校验
This commit is contained in:
parent
ac2e88dc0a
commit
40ab60b4fc
@ -471,9 +471,9 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
||||
}
|
||||
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
|
||||
.processInstanceId(processInvalidBo.getProcessInstanceId()).processInstanceTenantId(TenantHelper.getTenantId()).singleResult();
|
||||
// if (ObjectUtil.isNotEmpty(historicProcessInstance)) {
|
||||
// BusinessStatusEnum.checkStatus(historicProcessInstance.getBusinessStatus());
|
||||
// }
|
||||
if (ObjectUtil.isNotEmpty(historicProcessInstance) && BusinessStatusEnum.FINISH.getStatus().equals(historicProcessInstance.getBusinessStatus())) {
|
||||
throw new ServiceException("该单据已完成申请!");
|
||||
}
|
||||
runtimeService.updateBusinessStatus(processInvalidBo.getProcessInstanceId(), BusinessStatusEnum.INVALID.getStatus());
|
||||
runtimeService.deleteProcessInstance(processInvalidBo.getProcessInstanceId(), deleteReason);
|
||||
FlowProcessEventHandler processHandler = flowEventStrategy.getProcessHandler(historicProcessInstance.getProcessDefinitionKey());
|
||||
@ -587,7 +587,9 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
||||
if (processInstance.isSuspended()) {
|
||||
throw new ServiceException(FlowConstant.MESSAGE_SUSPENDED);
|
||||
}
|
||||
BusinessStatusEnum.checkStatus(processInstance.getBusinessStatus());
|
||||
if (BusinessStatusEnum.CANCEL.getStatus().equals(processInstance.getBusinessStatus())) {
|
||||
throw new ServiceException("该单据已撤销!");
|
||||
}
|
||||
List<Task> taskList = taskService.createTaskQuery().taskTenantId(TenantHelper.getTenantId()).processInstanceId(processInstanceId).list();
|
||||
for (Task task : taskList) {
|
||||
taskService.setAssignee(task.getId(), String.valueOf(LoginHelper.getUserId()));
|
||||
|
||||
@ -434,8 +434,8 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||
throw new ServiceException(FlowConstant.MESSAGE_SUSPENDED);
|
||||
}
|
||||
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceBusinessKey(task.getProcessInstanceId()).processInstanceTenantId(TenantHelper.getTenantId()).singleResult();
|
||||
if (ObjectUtil.isNotEmpty(historicProcessInstance)) {
|
||||
BusinessStatusEnum.checkStatus(historicProcessInstance.getBusinessStatus());
|
||||
if (ObjectUtil.isNotEmpty(historicProcessInstance) && BusinessStatusEnum.TERMINATION.getStatus().equals(historicProcessInstance.getBusinessStatus())) {
|
||||
throw new ServiceException("该单据已终止!");
|
||||
}
|
||||
try {
|
||||
if (StringUtils.isBlank(terminationBo.getComment())) {
|
||||
@ -612,6 +612,9 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||
List<ExecutionEntity> executionEntities = managementService.executeCommand(childByExecutionIdCmd);
|
||||
//校验单据
|
||||
BusinessStatusEnum.checkStatus(processInstance.getBusinessStatus());
|
||||
if (BusinessStatusEnum.BACK.getStatus().equals(processInstance.getBusinessStatus())) {
|
||||
throw new ServiceException("该单据已退回!");
|
||||
}
|
||||
//判断是否有多个任务
|
||||
List<Task> taskList = taskService.createTaskQuery().processInstanceId(processInstanceId).taskTenantId(TenantHelper.getTenantId()).list();
|
||||
//申请人节点
|
||||
|
||||
Loading…
Reference in New Issue
Block a user