|
@@ -15,6 +15,7 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmConstants;
|
|
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils;
|
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils;
|
|
|
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO;
|
|
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO;
|
|
|
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO;
|
|
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO;
|
|
|
|
|
+import cn.iocoder.yudao.module.employee.api.dto.EmployeeRespDTO;
|
|
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
|
@@ -44,7 +45,7 @@ public interface BpmProcessInstanceConvert {
|
|
|
Map<String, ProcessDefinition> processDefinitionMap,
|
|
Map<String, ProcessDefinition> processDefinitionMap,
|
|
|
Map<String, BpmCategoryDO> categoryMap,
|
|
Map<String, BpmCategoryDO> categoryMap,
|
|
|
Map<String, List<Task>> taskMap,
|
|
Map<String, List<Task>> taskMap,
|
|
|
- Map<Long, AdminUserRespDTO> userMap,
|
|
|
|
|
|
|
+ Map<Long, EmployeeRespDTO> employeeMap,
|
|
|
Map<Long, DeptRespDTO> deptMap,
|
|
Map<Long, DeptRespDTO> deptMap,
|
|
|
Map<String, BpmProcessDefinitionExtDO> bpmProcessDefinitionExtDOMap) {
|
|
Map<String, BpmProcessDefinitionExtDO> bpmProcessDefinitionExtDOMap) {
|
|
|
PageResult<BpmProcessInstanceRespVO> vpPageResult = BeanUtils.toBean(pageResult, BpmProcessInstanceRespVO.class);
|
|
PageResult<BpmProcessInstanceRespVO> vpPageResult = BeanUtils.toBean(pageResult, BpmProcessInstanceRespVO.class);
|
|
@@ -65,17 +66,21 @@ public interface BpmProcessInstanceConvert {
|
|
|
respVO.setTasks(BeanUtils.toBean(tasks, BpmProcessInstanceRespVO.Task.class));
|
|
respVO.setTasks(BeanUtils.toBean(tasks, BpmProcessInstanceRespVO.Task.class));
|
|
|
if (CollectionUtil.isNotEmpty(tasks)) {
|
|
if (CollectionUtil.isNotEmpty(tasks)) {
|
|
|
String assignee = tasks.get(0).getAssignee();
|
|
String assignee = tasks.get(0).getAssignee();
|
|
|
- if (userMap != null){
|
|
|
|
|
- AdminUserRespDTO adminUserRespDTO = userMap.get(Long.valueOf(assignee));
|
|
|
|
|
- respVO.setCurrentAuditUser(BeanUtils.toBean(adminUserRespDTO, BpmProcessInstanceRespVO.User.class));
|
|
|
|
|
|
|
+ if (employeeMap != null){
|
|
|
|
|
+ EmployeeRespDTO adminEmployeeRespDTO = employeeMap.get(Long.valueOf(assignee));
|
|
|
|
|
+ BpmProcessInstanceRespVO.User user = BeanUtils.toBean(adminEmployeeRespDTO, BpmProcessInstanceRespVO.User.class);
|
|
|
|
|
+ user.setNickname(adminEmployeeRespDTO.getName());
|
|
|
|
|
+ respVO.setCurrentAuditUser(user);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// user
|
|
// user
|
|
|
- if (userMap != null) {
|
|
|
|
|
- AdminUserRespDTO startUser = userMap.get(NumberUtils.parseLong(pageResult.getList().get(i).getStartUserId()));
|
|
|
|
|
- if (startUser != null) {
|
|
|
|
|
- respVO.setStartUser(BeanUtils.toBean(startUser, BpmProcessInstanceRespVO.User.class));
|
|
|
|
|
- MapUtils.findAndThen(deptMap, startUser.getDeptId(), dept -> respVO.getStartUser().setDeptName(dept.getName()));
|
|
|
|
|
|
|
+ if (employeeMap != null) {
|
|
|
|
|
+ EmployeeRespDTO startEmployee = employeeMap.get(NumberUtils.parseLong(pageResult.getList().get(i).getStartUserId()));
|
|
|
|
|
+ if (startEmployee != null) {
|
|
|
|
|
+ BpmProcessInstanceRespVO.User user = BeanUtils.toBean(startEmployee, BpmProcessInstanceRespVO.User.class);
|
|
|
|
|
+ user.setNickname(startEmployee.getName());
|
|
|
|
|
+ respVO.setStartUser(user);
|
|
|
|
|
+ MapUtils.findAndThen(deptMap, startEmployee.getDeptId(), dept -> respVO.getStartUser().setDeptName(dept.getName()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
BpmProcessDefinitionExtDO bpmProcessDefinitionExtDO = bpmProcessDefinitionExtDOMap.get(respVO.getProcessDefinitionId());
|
|
BpmProcessDefinitionExtDO bpmProcessDefinitionExtDO = bpmProcessDefinitionExtDOMap.get(respVO.getProcessDefinitionId());
|