mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-29 22:56:40 +08:00
update 调整获取加签人,审判记录
This commit is contained in:
parent
f0368395d1
commit
6b6b9a91d9
@ -46,4 +46,14 @@ public class WorkflowUserController extends BaseController {
|
||||
public R<List<TaskVo>> getWorkflowDeleteMultiInstanceList(@PathVariable String taskId) {
|
||||
return R.ok(iWorkflowUserService.getWorkflowDeleteMultiInstanceList(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照用户id查询用户
|
||||
*
|
||||
* @param userIds 用户id
|
||||
*/
|
||||
@GetMapping("/getUserListByIds/{userIds}")
|
||||
public R<List<SysUserVo>> getUserListByIds(@PathVariable List<Long> userIds) {
|
||||
return R.ok(iWorkflowUserService.getUserListByIds(userIds));
|
||||
}
|
||||
}
|
||||
|
@ -135,4 +135,9 @@ public class TaskVo {
|
||||
* 参与者
|
||||
*/
|
||||
private ParticipantVo participantVo;
|
||||
|
||||
/**
|
||||
* 是否会签
|
||||
*/
|
||||
private Boolean multiInstance;
|
||||
}
|
||||
|
@ -29,4 +29,12 @@ public interface IWorkflowUserService {
|
||||
* @return 结果
|
||||
*/
|
||||
List<TaskVo> getWorkflowDeleteMultiInstanceList(String taskId);
|
||||
|
||||
/**
|
||||
* 按照用户id查询用户
|
||||
*
|
||||
* @param userIds 用户id
|
||||
* @return 结果
|
||||
*/
|
||||
List<SysUserVo> getUserListByIds(List<Long> userIds);
|
||||
}
|
||||
|
@ -267,6 +267,15 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
||||
}
|
||||
actHistoryInfoVoList.add(actHistoryInfoVo);
|
||||
}
|
||||
List<ActHistoryInfoVo> collect = new ArrayList<>();
|
||||
//待办理
|
||||
List<ActHistoryInfoVo> waitingTask = StreamUtils.filter(actHistoryInfoVoList, e -> e.getEndTime() == null);
|
||||
//已办理
|
||||
List<ActHistoryInfoVo> finishTask = StreamUtils.filter(actHistoryInfoVoList, e -> e.getEndTime() != null);
|
||||
collect.addAll(waitingTask);
|
||||
collect.addAll(finishTask);
|
||||
//审批记录
|
||||
map.put("historyRecordList", collect);
|
||||
List<ActHistoryInfoVo> nodeInfoList = new ArrayList<>();
|
||||
Map<String, List<ActHistoryInfoVo>> groupByKey = StreamUtils.groupByKey(actHistoryInfoVoList, ActHistoryInfoVo::getTaskDefinitionKey);
|
||||
for (Map.Entry<String, List<ActHistoryInfoVo>> entry : groupByKey.entrySet()) {
|
||||
@ -275,6 +284,11 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
||||
if (StringUtils.isNotBlank(nickName)) {
|
||||
actHistoryInfoVo.setNickName(nickName);
|
||||
}
|
||||
actHistoryInfoVoList.stream().filter(e -> e.getTaskDefinitionKey().equals(entry.getKey()) && e.getEndTime() != null).findFirst()
|
||||
.ifPresent(e -> {
|
||||
actHistoryInfoVo.setStatus("已处理");
|
||||
actHistoryInfoVo.setStartTime(e.getStartTime());
|
||||
});
|
||||
actHistoryInfoVoList.stream().filter(e -> e.getTaskDefinitionKey().equals(entry.getKey()) && e.getEndTime() == null).findFirst()
|
||||
.ifPresent(e -> {
|
||||
actHistoryInfoVo.setStatus("待处理");
|
||||
@ -286,15 +300,6 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
||||
}
|
||||
//节点信息
|
||||
map.put("nodeListInfo", nodeInfoList);
|
||||
List<ActHistoryInfoVo> collect = new ArrayList<>();
|
||||
//待办理
|
||||
List<ActHistoryInfoVo> waitingTask = StreamUtils.filter(actHistoryInfoVoList, e -> e.getEndTime() == null);
|
||||
//已办理
|
||||
List<ActHistoryInfoVo> finishTask = StreamUtils.filter(actHistoryInfoVoList, e -> e.getEndTime() != null);
|
||||
collect.addAll(waitingTask);
|
||||
collect.addAll(finishTask);
|
||||
//审批记录
|
||||
map.put("historyRecordList", collect);
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(list.get(0).getProcessDefinitionId());
|
||||
List<GraphicInfoVo> graphicInfoVos = new ArrayList<>();
|
||||
Collection<FlowElement> flowElements = bpmnModel.getMainProcess().getFlowElements();
|
||||
@ -443,7 +448,7 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
||||
List<Task> taskList = taskService.createTaskQuery().taskTenantId(TenantHelper.getTenantId()).processInstanceId(processInstanceId).list();
|
||||
for (Task task : taskList) {
|
||||
taskService.setAssignee(task.getId(), String.valueOf(LoginHelper.getUserId()));
|
||||
taskService.addComment(task.getId(), processInstanceId, LoginHelper.getUsername() + ":撤销申请");
|
||||
taskService.addComment(task.getId(), processInstanceId, TaskStatusEnum.CANCEL.getStatus(), LoginHelper.getUsername() + ":撤销申请");
|
||||
}
|
||||
HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().finished().orderByHistoricTaskInstanceEndTime().asc().list().get(0);
|
||||
List<String> nodeIds = StreamUtils.toList(taskList, Task::getTaskDefinitionKey);
|
||||
|
@ -197,6 +197,7 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||
}
|
||||
taskVo.setAssignee(StringUtils.isNotBlank(task.getAssignee()) ? Long.valueOf(task.getAssignee()) : null);
|
||||
taskVo.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId()));
|
||||
taskVo.setMultiInstance(WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey()) != null);
|
||||
list.add(taskVo);
|
||||
}
|
||||
long count = query.count();
|
||||
@ -239,6 +240,7 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||
}
|
||||
taskVo.setAssignee(StringUtils.isNotBlank(task.getAssignee()) ? Long.valueOf(task.getAssignee()) : null);
|
||||
taskVo.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId()));
|
||||
taskVo.setMultiInstance(WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey()) != null);
|
||||
list.add(taskVo);
|
||||
}
|
||||
long count = query.count();
|
||||
|
@ -60,19 +60,20 @@ public class WorkflowUserServiceImpl implements IWorkflowUserService {
|
||||
throw new ServiceException("任务不存在");
|
||||
}
|
||||
MultiInstanceVo multiInstance = WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
|
||||
if (multiInstance == null) {
|
||||
return TableDataInfo.build();
|
||||
}
|
||||
LambdaQueryWrapper<SysUser> queryWrapper = Wrappers.lambdaQuery();
|
||||
//检索条件
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(sysUserMultiBo.getDeptId()), SysUser::getDeptId, sysUserMultiBo.getDeptId());
|
||||
queryWrapper.eq(SysUser::getStatus, UserStatus.OK.getCode());
|
||||
if (multiInstance != null) {
|
||||
if (multiInstance.getType() instanceof SequentialMultiInstanceBehavior) {
|
||||
List<Long> assigneeList = (List) runtimeService.getVariable(task.getExecutionId(), multiInstance.getAssigneeList());
|
||||
queryWrapper.notIn(CollectionUtil.isNotEmpty(assigneeList), SysUser::getUserId, assigneeList);
|
||||
} else {
|
||||
List<Task> list = taskService.createTaskQuery().processInstanceId(task.getProcessInstanceId()).list();
|
||||
List<Long> userIds = StreamUtils.toList(list, e -> Long.valueOf(e.getAssignee()));
|
||||
queryWrapper.notIn(CollectionUtil.isNotEmpty(userIds), SysUser::getUserId, userIds);
|
||||
}
|
||||
if (multiInstance.getType() instanceof SequentialMultiInstanceBehavior) {
|
||||
List<Long> assigneeList = (List) runtimeService.getVariable(task.getExecutionId(), multiInstance.getAssigneeList());
|
||||
queryWrapper.notIn(CollectionUtil.isNotEmpty(assigneeList), SysUser::getUserId, assigneeList);
|
||||
} else {
|
||||
List<Task> list = taskService.createTaskQuery().processInstanceId(task.getProcessInstanceId()).list();
|
||||
List<Long> userIds = StreamUtils.toList(list, e -> Long.valueOf(e.getAssignee()));
|
||||
queryWrapper.notIn(CollectionUtil.isNotEmpty(userIds), SysUser::getUserId, userIds);
|
||||
}
|
||||
queryWrapper.like(StringUtils.isNotEmpty(sysUserMultiBo.getUserName()), SysUser::getUserName, sysUserMultiBo.getUserName());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(sysUserMultiBo.getNickName()), SysUser::getNickName, sysUserMultiBo.getNickName());
|
||||
@ -172,4 +173,27 @@ public class WorkflowUserServiceImpl implements IWorkflowUserService {
|
||||
page.setRecords(records);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照用户id查询用户
|
||||
*
|
||||
* @param userIds 用户id
|
||||
*/
|
||||
@Override
|
||||
public List<SysUserVo> getUserListByIds(List<Long> userIds) {
|
||||
LambdaQueryWrapper<SysUser> queryWrapper = Wrappers.lambdaQuery();
|
||||
//检索条件
|
||||
queryWrapper.eq(SysUser::getStatus, UserStatus.OK.getCode());
|
||||
queryWrapper.in(SysUser::getUserId, userIds);
|
||||
List<SysUserVo> sysUserVos = sysUserMapper.selectVoList(queryWrapper);
|
||||
List<Long> collectDeptId = sysUserVos.stream().map(SysUserVo::getDeptId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(collectDeptId)) {
|
||||
return sysUserVos;
|
||||
}
|
||||
List<SysDeptVo> sysDeptList = sysDeptMapper.selectVoBatchIds(collectDeptId);
|
||||
sysUserVos.forEach(e -> {
|
||||
sysDeptList.stream().filter(d -> d.getDeptId().equals(e.getDeptId())).findFirst().ifPresent(e::setDept);
|
||||
});
|
||||
return sysUserVos;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user