Merge branch 'master' into feature/REQ-3769
This commit is contained in:
commit
6cf881daaa
@ -38,14 +38,13 @@ public class CustomCancelProcessInstanceAsyncCmd extends AbstractCommand<Void> i
|
||||
|
||||
@Override
|
||||
public Void execute(CommandContext commandContext) {
|
||||
String processInstanceId = dto.getProcessInstanceId(), tenantId = dto.getTenantId();
|
||||
String processInstanceId = dto.getProcessInstanceId();
|
||||
BpmnTaskDelegateAssigner initiator = dto.getInitiator();
|
||||
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
||||
|
||||
HistoryService historyService = processEngineConfiguration.getHistoryService();
|
||||
HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery()
|
||||
.processInstanceId(processInstanceId)
|
||||
.processInstanceTenantId(tenantId)
|
||||
.singleResult();
|
||||
if (Objects.isNull(instance)) {
|
||||
throw new WorkflowEngineException(PROCESS_INSTANCE_NOT_EXISTS);
|
||||
|
||||
@ -102,7 +102,7 @@ public class CustomCancelProcessInstanceCmd extends AbstractCommand<Void> implem
|
||||
throw new WorkflowEngineException(PROCESS_INSTANCE_CANCEL_FAIL_NOT_EXISTS);
|
||||
}
|
||||
|
||||
if (Objects.isNull(initiator) || !initiator.comparePersonIdToOther(instance.getStartUserId())) {
|
||||
if (!Objects.equals(Boolean.TRUE, superAdmin) && !initiator.comparePersonIdToOther(instance.getStartUserId())) {
|
||||
throw new WorkflowEngineException(PROCESS_INSTANCE_CANCEL_FAIL_NOT_SELF);
|
||||
}
|
||||
|
||||
|
||||
@ -175,7 +175,7 @@ public class BpmnProcessInstanceController extends BasicPopulateAvatarController
|
||||
@DeleteMapping("/cancel")
|
||||
@Override
|
||||
@RepeatSubmit
|
||||
public CommonResponse<Boolean> cancelProcessInstance(@Validated(ValidGroup.Insert.class) @RequestBody BpmnProcessInstanceCancelDTO dto) {
|
||||
public CommonResponse<Boolean> cancelProcessInstance(@Validated(ValidGroup.Update.class) @RequestBody BpmnProcessInstanceCancelDTO dto) {
|
||||
log.info("撤回审核cancelProcessInstant===>>>参数:{}", JSONUtil.toJsonStr(dto));
|
||||
populateUsersAvatar(dto.getInitiator());
|
||||
SuperBpmnProcessInstanceCancelDTO target = new SuperBpmnProcessInstanceCancelDTO();
|
||||
@ -187,7 +187,7 @@ public class BpmnProcessInstanceController extends BasicPopulateAvatarController
|
||||
@DeleteMapping("/super/cancel")
|
||||
@RepeatSubmit
|
||||
@Override
|
||||
public CommonResponse<Boolean> superCancelProcessInstance(@Validated(ValidGroup.Update.class) @RequestBody SuperBpmnProcessInstanceCancelDTO dto) {
|
||||
public CommonResponse<Boolean> superCancelProcessInstance(@Validated(ValidGroup.Insert.class) @RequestBody SuperBpmnProcessInstanceCancelDTO dto) {
|
||||
log.info("超级撤回审核 superCancelProcessInstant===>>>参数:{}", JSONUtil.toJsonStr(dto));
|
||||
populateUsersAvatar(dto.getInitiator());
|
||||
return success(bpmnProcessInstanceService.cancelProcessInstance(dto));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user