Merge branch 'feature/REQ-2752' into feature/merge_2924_2752
This commit is contained in:
commit
070a215300
@ -243,6 +243,7 @@ public interface ProcessTaskApi {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "获取实例正在审核的人列表")
|
@Operation(summary = "获取实例正在审核的人列表")
|
||||||
@GetMapping("/api/process/task/active/list")
|
@GetMapping("/api/process/task/active/list")
|
||||||
|
@Manageable
|
||||||
@InvokeMode(SYNC)
|
@InvokeMode(SYNC)
|
||||||
CommonResponse<List<BpmnTaskInstanceVO>> getActiveTasksByProcessInstanceId(@NotBlank(message = "流程实例 ID 不能为空") @RequestParam String processInstanceId,
|
CommonResponse<List<BpmnTaskInstanceVO>> getActiveTasksByProcessInstanceId(@NotBlank(message = "流程实例 ID 不能为空") @RequestParam String processInstanceId,
|
||||||
@NotBlank(message = "租户不能为空") @RequestParam String tenantId);
|
@NotBlank(message = "租户不能为空") @RequestParam String tenantId);
|
||||||
|
|||||||
@ -56,6 +56,12 @@ public class BpmnTaskTransferDTO {
|
|||||||
@ApiModelProperty(value = "审批任务转交给谁", notes = "可以为空,意义在于如果分配给某离职的人,可能需要置为空")
|
@ApiModelProperty(value = "审批任务转交给谁", notes = "可以为空,意义在于如果分配给某离职的人,可能需要置为空")
|
||||||
private BpmnTaskDelegateAssigner targetAssigner;
|
private BpmnTaskDelegateAssigner targetAssigner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转交描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "转交描述", notes = "正常是'xx转交给xx',该字段值追加在后面")
|
||||||
|
private String additionalOpeDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否异步执行
|
* 是否异步执行
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -46,19 +46,23 @@ import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.validTask
|
|||||||
*/
|
*/
|
||||||
public class CustomTransferUserTaskCmd extends AbstractCommand<Void> implements Serializable {
|
public class CustomTransferUserTaskCmd extends AbstractCommand<Void> implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -8011156125774066571L;
|
||||||
private final String originTaskId;
|
private final String originTaskId;
|
||||||
private final BpmnTaskDelegateAssigner originTaskAssignee;
|
private final BpmnTaskDelegateAssigner originTaskAssignee;
|
||||||
private final String advice;
|
private final String advice;
|
||||||
private final List<AttachmentDTO> attachmentList;
|
private final List<AttachmentDTO> attachmentList;
|
||||||
private final BpmnTaskDelegateAssigner targetTaskAssignee;
|
private final BpmnTaskDelegateAssigner targetTaskAssignee;
|
||||||
|
private final String additionalOpeDesc;
|
||||||
|
|
||||||
public CustomTransferUserTaskCmd(String originTaskId, BpmnTaskDelegateAssigner originTaskAssignee, String advice,
|
public CustomTransferUserTaskCmd(String originTaskId, BpmnTaskDelegateAssigner originTaskAssignee, String advice,
|
||||||
List<AttachmentDTO> attachmentList, BpmnTaskDelegateAssigner targetTaskAssignee) {
|
List<AttachmentDTO> attachmentList, BpmnTaskDelegateAssigner targetTaskAssignee,
|
||||||
|
String additionalOpeDesc) {
|
||||||
this.originTaskId = originTaskId;
|
this.originTaskId = originTaskId;
|
||||||
this.originTaskAssignee = originTaskAssignee;
|
this.originTaskAssignee = originTaskAssignee;
|
||||||
this.advice = advice;
|
this.advice = advice;
|
||||||
this.attachmentList = attachmentList;
|
this.attachmentList = attachmentList;
|
||||||
this.targetTaskAssignee = targetTaskAssignee;
|
this.targetTaskAssignee = targetTaskAssignee;
|
||||||
|
this.additionalOpeDesc = additionalOpeDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -75,9 +79,9 @@ public class CustomTransferUserTaskCmd extends AbstractCommand<Void> implements
|
|||||||
@Override
|
@Override
|
||||||
public Void execute(CommandContext commandContext) {
|
public Void execute(CommandContext commandContext) {
|
||||||
ProcessEngineConfigurationImpl processEngineConfiguration =
|
ProcessEngineConfigurationImpl processEngineConfiguration =
|
||||||
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
||||||
HistoricTaskInstanceQuery taskQuery =
|
HistoricTaskInstanceQuery taskQuery =
|
||||||
processEngineConfiguration.getHistoryService().createHistoricTaskInstanceQuery();
|
processEngineConfiguration.getHistoryService().createHistoricTaskInstanceQuery();
|
||||||
HistoricTaskInstance historicTaskInstance = taskQuery.taskId(originTaskId).singleResult();
|
HistoricTaskInstance historicTaskInstance = taskQuery.taskId(originTaskId).singleResult();
|
||||||
|
|
||||||
TaskService taskService = processEngineConfiguration.getTaskService();
|
TaskService taskService = processEngineConfiguration.getTaskService();
|
||||||
@ -93,7 +97,7 @@ public class CustomTransferUserTaskCmd extends AbstractCommand<Void> implements
|
|||||||
// 对被转交的任务进行建议和附件的处理
|
// 对被转交的任务进行建议和附件的处理
|
||||||
resolveOriginTask(commandContext, taskService, task);
|
resolveOriginTask(commandContext, taskService, task);
|
||||||
batchAddAttachment(commandContext, task.getProcessInstanceId(), task, attachmentList,
|
batchAddAttachment(commandContext, task.getProcessInstanceId(), task, attachmentList,
|
||||||
originTaskAssignee);
|
originTaskAssignee);
|
||||||
|
|
||||||
// 生成转交任务
|
// 生成转交任务
|
||||||
addMultiTask(commandContext, task, targetTaskAssignee);
|
addMultiTask(commandContext, task, targetTaskAssignee);
|
||||||
@ -120,9 +124,9 @@ public class CustomTransferUserTaskCmd extends AbstractCommand<Void> implements
|
|||||||
public void processAssignee(ProcessEngineConfigurationImpl processEngineConfiguration, Task task) {
|
public void processAssignee(ProcessEngineConfigurationImpl processEngineConfiguration, Task task) {
|
||||||
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
|
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
|
||||||
List<BpmnTaskDelegateAssigner> originAssingeeList = runtimeService.getVariable(task.getProcessInstanceId(),
|
List<BpmnTaskDelegateAssigner> originAssingeeList = runtimeService.getVariable(task.getProcessInstanceId(),
|
||||||
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + task.getTaskDefinitionKey(), List.class);
|
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + task.getTaskDefinitionKey(), List.class);
|
||||||
Optional<BpmnTaskDelegateAssigner> exists = originAssingeeList.stream()
|
Optional<BpmnTaskDelegateAssigner> exists = originAssingeeList.stream()
|
||||||
.filter(i -> Objects.equals(i.buildAssigneeId(), targetTaskAssignee.buildAssigneeId())).findAny();
|
.filter(i -> Objects.equals(i.buildAssigneeId(), targetTaskAssignee.buildAssigneeId())).findAny();
|
||||||
if (exists.isPresent()) {
|
if (exists.isPresent()) {
|
||||||
throw new WorkflowEngineException(ASSIGNEE_HAS_BEEN_EXISTS);
|
throw new WorkflowEngineException(ASSIGNEE_HAS_BEEN_EXISTS);
|
||||||
}
|
}
|
||||||
@ -135,8 +139,8 @@ public class CustomTransferUserTaskCmd extends AbstractCommand<Void> implements
|
|||||||
}
|
}
|
||||||
originAssingeeList.add(targetTaskAssignee);
|
originAssingeeList.add(targetTaskAssignee);
|
||||||
runtimeService.setVariable(task.getProcessInstanceId(),
|
runtimeService.setVariable(task.getProcessInstanceId(),
|
||||||
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + task.getTaskDefinitionKey(),
|
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + task.getTaskDefinitionKey(),
|
||||||
originAssingeeList);
|
originAssingeeList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,6 @@ public class AsyncTransferUserTaskJobHandler extends AbstractJobHandler implemen
|
|||||||
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
||||||
BpmnTaskTransferDTO dto = JSONUtil.toBean(job.getCustomValues(), BpmnTaskTransferDTO.class);
|
BpmnTaskTransferDTO dto = JSONUtil.toBean(job.getCustomValues(), BpmnTaskTransferDTO.class);
|
||||||
processEngineConfiguration.getCommandExecutor().execute(new CustomTransferUserTaskCmd(dto.getTaskId(),
|
processEngineConfiguration.getCommandExecutor().execute(new CustomTransferUserTaskCmd(dto.getTaskId(),
|
||||||
dto.getOriginAssigner(), dto.getAdvice(), dto.getAttachmentList(), dto.getTargetAssigner()));
|
dto.getOriginAssigner(), dto.getAdvice(), dto.getAttachmentList(), dto.getTargetAssigner(), dto.getAdditionalOpeDesc()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -684,7 +684,7 @@ public class BpmnProcessTaskServiceImpl implements BpmnProcessTaskService {
|
|||||||
commandExecutor.execute(new CustomTransferUserTaskAsyncCmd(dto));
|
commandExecutor.execute(new CustomTransferUserTaskAsyncCmd(dto));
|
||||||
} else {
|
} else {
|
||||||
commandExecutor.execute(new CustomTransferUserTaskCmd(dto.getTaskId(),
|
commandExecutor.execute(new CustomTransferUserTaskCmd(dto.getTaskId(),
|
||||||
dto.getOriginAssigner(), dto.getAdvice(), dto.getAttachmentList(), dto.getTargetAssigner()));
|
dto.getOriginAssigner(), dto.getAdvice(), dto.getAttachmentList(), dto.getTargetAssigner(), dto.getAdditionalOpeDesc()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public class ProcessTaskDocument {
|
|||||||
/**
|
/**
|
||||||
* 审批人姓名
|
* 审批人姓名
|
||||||
*/
|
*/
|
||||||
@IndexField(fieldType = FieldType.KEYWORD)
|
@IndexField(fieldType = FieldType.KEYWORD, searchAnalyzer = "ngram_analyzer")
|
||||||
private String assigneeName;
|
private String assigneeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -196,14 +196,6 @@ public interface WorkflowCoreService {
|
|||||||
@PostMapping("/api/process/task/robot/complete")
|
@PostMapping("/api/process/task/robot/complete")
|
||||||
Boolean completeRobotTask(@Validated @RequestBody BpmnRobotTaskCompleteDTO dto);
|
Boolean completeRobotTask(@Validated @RequestBody BpmnRobotTaskCompleteDTO dto);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取实例正在审核的人列表
|
|
||||||
*/
|
|
||||||
@Operation(summary = "获取实例正在审核的人列表")
|
|
||||||
@GetMapping("/api/process/task/active/list")
|
|
||||||
@InvokeMode(SYNC)
|
|
||||||
List<BpmnTaskInstanceVO> getActiveTasksByProcessInstanceId(@NotBlank(message = "流程实例 ID 不能为空") @RequestParam String processInstanceId, @NotBlank(message = "租户不能为空") @RequestParam String tenantId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建审批流程
|
* 创建审批流程
|
||||||
*
|
*
|
||||||
|
|||||||
@ -277,6 +277,15 @@ public interface WorkflowManageService {
|
|||||||
@InvokeMode(SYNC)
|
@InvokeMode(SYNC)
|
||||||
List<BpmnHistoricTaskInstanceGroupVO> getTaskListGroupByProcessInstanceId(@NotBlank(message = "流程实例 ID 不能为空") @RequestParam String processInstanceId, @Nullable @RequestParam(required = false) String tenantId);
|
List<BpmnHistoricTaskInstanceGroupVO> getTaskListGroupByProcessInstanceId(@NotBlank(message = "流程实例 ID 不能为空") @RequestParam String processInstanceId, @Nullable @RequestParam(required = false) String tenantId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取实例正在审核的人列表
|
||||||
|
*/
|
||||||
|
@Operation(summary = "获取实例正在审核的人列表")
|
||||||
|
@GetMapping("/api/process/task/active/list")
|
||||||
|
@Manageable
|
||||||
|
@InvokeMode(SYNC)
|
||||||
|
List<BpmnTaskInstanceVO> getActiveTasksByProcessInstanceId(@NotBlank(message = "流程实例 ID 不能为空") @RequestParam String processInstanceId, @NotBlank(message = "租户不能为空") @RequestParam String tenantId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据实例 ID 和自然人 ID 查询对应待处理的任务 ID
|
* 根据实例 ID 和自然人 ID 查询对应待处理的任务 ID
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user