|
|
|
@ -83,13 +83,13 @@ public class KnowledgeFlowServiceImpl implements KnowledgeFlowService {
|
|
|
|
|
Set<String> submitDeptSet = records.stream().map(KnowledgeFlowResVO::getSubmitDeptId).collect(Collectors.toSet());
|
|
|
|
|
Collection<String> deptIdSet = CollUtil.union(submitDeptSet, publishDeptSet);
|
|
|
|
|
Map<String, String> deptMap = new HashMap<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(deptIdSet)){
|
|
|
|
|
if (CollUtil.isNotEmpty(deptIdSet)) {
|
|
|
|
|
deptMap = systemDeptService.listByIds(deptIdSet).stream().collect(Collectors.toMap(SystemDept::getId, SystemDept::getDeptName));
|
|
|
|
|
}
|
|
|
|
|
// 获取所有子库
|
|
|
|
|
Set<String> userIdSet = records.stream().map(KnowledgeFlowResVO::getSubmitUserId).collect(Collectors.toSet());
|
|
|
|
|
Map<String, String> userMap = new HashMap<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(userIdSet)){
|
|
|
|
|
if (CollUtil.isNotEmpty(userIdSet)) {
|
|
|
|
|
userMap = systemUserService.listByIds(userIdSet).stream().collect(Collectors.toMap(SystemUser::getId, SystemUser::getUsername));
|
|
|
|
|
}
|
|
|
|
|
for (KnowledgeFlowResVO record : records) {
|
|
|
|
@ -213,8 +213,8 @@ public class KnowledgeFlowServiceImpl implements KnowledgeFlowService {
|
|
|
|
|
throw new BusinessException("审批节点不存在");
|
|
|
|
|
}
|
|
|
|
|
if (1 == reqVO.getOperate()) {
|
|
|
|
|
// 如果当前节点的索引号和节点数量相等,说明是最后一个节点,这时说明流程走完了
|
|
|
|
|
if (ruleOrderList.size() == index) {
|
|
|
|
|
// 如果当前节点的索引号和节点数量-1相等(因为索引从0开始),说明是最后一个节点,这时说明流程走完了
|
|
|
|
|
if ((ruleOrderList.size() - 1) == index) {
|
|
|
|
|
// 这时走流程结束的流程
|
|
|
|
|
KnowledgeFlowRecord newKnowledgeFlowRecord = KnowledgeFlowRecord.builder().type(2)
|
|
|
|
|
.knowledgeId(knowledgeFlowTodo.getKnowledgeId())
|
|
|
|
@ -254,7 +254,7 @@ public class KnowledgeFlowServiceImpl implements KnowledgeFlowService {
|
|
|
|
|
} catch (IndexOutOfBoundsException e) {
|
|
|
|
|
throw new BusinessException("未找到下一个审批节点,请联系管理员解决");
|
|
|
|
|
}
|
|
|
|
|
List<SystemFlowRuleUser> nextRuleUserList = systemFlowRuleUserService.lambdaQuery().eq(SystemFlowRuleUser::getFlowId, nextRule.getId())
|
|
|
|
|
List<SystemFlowRuleUser> nextRuleUserList = systemFlowRuleUserService.lambdaQuery().eq(SystemFlowRuleUser::getFlowId, nextRule.getFlowId())
|
|
|
|
|
.eq(SystemFlowRuleUser::getRuleId, nextRule.getId()).list();
|
|
|
|
|
if (CollUtil.isEmpty(nextRuleUserList)) {
|
|
|
|
|
throw new BusinessException("下级审批节点未配置审批用户,审批失败,请联系管理员解决");
|
|
|
|
@ -323,10 +323,17 @@ public class KnowledgeFlowServiceImpl implements KnowledgeFlowService {
|
|
|
|
|
}).sorted(Comparator.comparing(KnowledgeFlowRecordResVO::getProcessTime)).toList();
|
|
|
|
|
// 然后把人名和部门名进行转换
|
|
|
|
|
Set<String> userIdSet = result.stream().map(KnowledgeFlowRecordResVO::getProcessUserId).collect(Collectors.toSet());
|
|
|
|
|
List<SystemUser> systemUsers = systemUserService.listByIds(userIdSet);
|
|
|
|
|
List<SystemUser> systemUsers = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(userIdSet)) {
|
|
|
|
|
systemUsers = systemUserService.listByIds(userIdSet);
|
|
|
|
|
}
|
|
|
|
|
Map<String, String> userNameMap = systemUsers.stream().collect(Collectors.toMap(SystemUser::getId, SystemUser::getUsername));
|
|
|
|
|
Set<String> deptIdSet = result.stream().map(KnowledgeFlowRecordResVO::getProcessDeptId).collect(Collectors.toSet());
|
|
|
|
|
List<SystemDept> systemDeptList = systemDeptService.listByIds(deptIdSet);
|
|
|
|
|
List<SystemDept> systemDeptList = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(deptIdSet)) {
|
|
|
|
|
systemDeptList = systemDeptService.listByIds(deptIdSet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, String> deptNameMap = systemDeptList.stream().collect(Collectors.toMap(SystemDept::getId, SystemDept::getDeptName));
|
|
|
|
|
result.forEach(node -> {
|
|
|
|
|
node.setProcessUserName(userNameMap.getOrDefault(node.getProcessUserId(), "未知用户"));
|
|
|
|
|