|
@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
|
@@ -13,6 +14,7 @@ import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.conversion.vo.OaConversionPageReqVO;
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.conversion.vo.OaConversionRespVO;
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.conversion.vo.OaConversionSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.universal.vo.OaUniversalRespVO;
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskApproveReqVO;
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskReturnReqVO;
|
|
@@ -22,6 +24,8 @@ import cn.iocoder.yudao.module.bpm.enums.DictDataConstants;
|
|
|
import cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants;
|
|
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmConstants;
|
|
|
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
|
|
|
+import cn.iocoder.yudao.module.employee.api.EmployeeApi;
|
|
|
+import cn.iocoder.yudao.module.employee.api.dto.EmployeeRespDTO;
|
|
|
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
|
|
import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
|
|
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|
@@ -77,6 +81,9 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
@Resource
|
|
|
private AdminUserApi adminUserApi;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private EmployeeApi employeeApi;
|
|
|
+
|
|
|
@Resource
|
|
|
private DeptApi deptApi;
|
|
|
|
|
@@ -87,8 +94,13 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
AdminUserRespDTO loginUser = adminUserApi.getUser(loginUserId);
|
|
|
Objects.requireNonNull(loginUser, "登录用户不能为空");
|
|
|
+ // 登录员工信息
|
|
|
+ EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
|
|
|
// 转正人信息
|
|
|
- AdminUserRespDTO employee = adminUserApi.getUser(stagingReqVO.getEmployeeId());
|
|
|
+ EmployeeRespDTO employee = employeeApi.getEmployeeById(stagingReqVO.getEmployeeId());
|
|
|
+ if (loginEmployee == null || employee == null) {
|
|
|
+ throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
|
|
|
+ }
|
|
|
|
|
|
OaConversionDO oaConversion = BeanUtils.toBean(stagingReqVO, OaConversionDO.class);
|
|
|
if (StringUtils.isBlank(oaConversion.getConversionId())) {
|
|
@@ -96,18 +108,18 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
String uuid = IdUtil.fastSimpleUUID();
|
|
|
oaConversion.setConversionId(uuid);
|
|
|
}
|
|
|
- if (employee != null) {
|
|
|
- oaConversion.setEmployeeId(loginUser.getId());
|
|
|
- oaConversion.setEmployeeName(loginUser.getNickname());
|
|
|
- oaConversion.setEmployeePhone(loginUser.getMobile());
|
|
|
- oaConversion.setDeptId(loginUser.getDeptId());
|
|
|
- oaConversion.setPosition("员工职位");
|
|
|
- oaConversion.setUserId(loginUser.getId());
|
|
|
- }
|
|
|
+ oaConversion.setEmployeeId(employee.getId());
|
|
|
+ oaConversion.setEmployeeName(employee.getName());
|
|
|
+ oaConversion.setEmployeePhone(employee.getPhone());
|
|
|
+ oaConversion.setDeptId(employee.getDeptId());
|
|
|
+ oaConversion.setPostId(employee.getPostId());
|
|
|
+ oaConversion.setPosition(employee.getPosition());
|
|
|
+ oaConversion.setUserId(loginUser.getId());
|
|
|
oaConversion.setAuditStatus(DictDataConstants.OA_AUDIT_STATUS_STAGING);
|
|
|
oaConversion.setInfoSource("0");
|
|
|
- oaConversion.setApplyEmployeeId(loginUser.getId());
|
|
|
- oaConversion.setApplyEmployeeName(loginUser.getNickname());
|
|
|
+ oaConversion.setApplyEmployeeId(loginEmployee.getId());
|
|
|
+ oaConversion.setApplyEmployeeName(loginEmployee.getName());
|
|
|
+ oaConversion.setCreator(String.valueOf(loginEmployee.getId()));
|
|
|
// 暂存不保存审批人信息
|
|
|
oaConversion.setStartUserSelectAssignees(null);
|
|
|
// 保存或更新表单信息
|
|
@@ -135,13 +147,14 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
if (loginUser == null) {
|
|
|
throw exception(ErrorCodeConstants.OA_LOGIN_USER_NOT_EXISTS);
|
|
|
}
|
|
|
+ // 登录员工信息
|
|
|
+ EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
|
|
|
// 转正人信息
|
|
|
- AdminUserRespDTO employee = adminUserApi.getUser(commitReqVO.getEmployeeId());
|
|
|
- if (employee == null) {
|
|
|
+ EmployeeRespDTO employee = employeeApi.getEmployeeById(commitReqVO.getEmployeeId());
|
|
|
+ if (loginEmployee == null || employee == null) {
|
|
|
throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
OaConversionDO oaConversion = BeanUtils.toBean(commitReqVO, OaConversionDO.class);
|
|
|
if (StringUtils.isBlank(oaConversion.getConversionId())) {
|
|
|
// 创建单据uuid
|
|
@@ -149,14 +162,16 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
oaConversion.setConversionId(uuid);
|
|
|
}
|
|
|
oaConversion.setEmployeeId(employee.getId());
|
|
|
- oaConversion.setEmployeeName(employee.getNickname());
|
|
|
- oaConversion.setEmployeePhone(employee.getMobile());
|
|
|
+ oaConversion.setEmployeeName(employee.getName());
|
|
|
+ oaConversion.setEmployeePhone(employee.getPhone());
|
|
|
oaConversion.setDeptId(employee.getDeptId());
|
|
|
- oaConversion.setPosition("员工职位");
|
|
|
+ oaConversion.setPostId(employee.getPostId());
|
|
|
+ oaConversion.setPosition(employee.getPosition());
|
|
|
oaConversion.setUserId(loginUser.getId());
|
|
|
oaConversion.setInfoSource("0");
|
|
|
- oaConversion.setApplyEmployeeId(loginUser.getId());
|
|
|
- oaConversion.setApplyEmployeeName(loginUser.getNickname());
|
|
|
+ oaConversion.setApplyEmployeeId(loginEmployee.getId());
|
|
|
+ oaConversion.setApplyEmployeeName(loginEmployee.getName());
|
|
|
+ oaConversion.setCreator(String.valueOf(loginEmployee.getId()));
|
|
|
// 保存或更新表单信息
|
|
|
if (oaConversion.getId() == null) {
|
|
|
oaConversionMapper.insert(oaConversion);
|
|
@@ -192,7 +207,7 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
agreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_COMMITTED));
|
|
|
taskService.setVariable(task.getId(), BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_COMMITTED);
|
|
|
taskService.setVariable(task.getId(), "auditPass", "true");
|
|
|
- bpmTaskService.approveTask(loginUserId, agreeReqVO);
|
|
|
+ bpmTaskService.approveTask(loginEmployee.getId(), agreeReqVO);
|
|
|
|
|
|
Task nextTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
|
|
|
if (nextTask == null) {
|
|
@@ -222,7 +237,11 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
public Long agreeOaConversion(BpmTaskApproveReqVO agreeReqVO) {
|
|
|
// 登录人信息
|
|
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
- // TODO DP 根据登录人查询出对应的员工信息
|
|
|
+ // 根据登录人查询出对应的员工信息
|
|
|
+ EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
|
|
|
+ if (loginEmployee == null) {
|
|
|
+ throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
|
|
|
+ }
|
|
|
|
|
|
Task currentTask = bpmTaskService.getTask(agreeReqVO.getId());
|
|
|
if (currentTask == null) {
|
|
@@ -250,7 +269,7 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
agreeReqVO.setReason(reason);
|
|
|
agreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_AUDITING));
|
|
|
taskService.setVariable(agreeReqVO.getId(), "auditPass", "true");
|
|
|
- bpmTaskService.approveTask(loginUserId, agreeReqVO);
|
|
|
+ bpmTaskService.approveTask(loginEmployee.getId(), agreeReqVO);
|
|
|
|
|
|
Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
|
|
|
OaConversionDO oaConversionDO = new OaConversionDO();
|
|
@@ -288,7 +307,11 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
public Long disagreeOaConversion(BpmTaskReturnReqVO disagreeReqVO) {
|
|
|
// 登录人信息
|
|
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
- // TODO DP 根据登录人查询出对应的员工信息
|
|
|
+ // 根据登录人查询出对应的员工信息
|
|
|
+ EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
|
|
|
+ if (loginEmployee == null) {
|
|
|
+ throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
|
|
|
+ }
|
|
|
|
|
|
Task currentTask = bpmTaskService.getTask(disagreeReqVO.getId());
|
|
|
|
|
@@ -297,7 +320,7 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
disagreeReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_RETURNED));
|
|
|
taskService.setVariable(disagreeReqVO.getId(), "auditPass", "false");
|
|
|
taskService.setVariable(disagreeReqVO.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_RETURNED);
|
|
|
- bpmTaskService.returnTask(loginUserId, disagreeReqVO);
|
|
|
+ bpmTaskService.returnTask(loginEmployee.getId(), disagreeReqVO);
|
|
|
|
|
|
Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
|
|
|
Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
|
|
@@ -322,7 +345,11 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
public Long revocationOaConversion(BpmTaskApproveReqVO revocationReqVO) {
|
|
|
// 登录人信息
|
|
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
- // TODO DP 根据登录人查询出对应的员工信息
|
|
|
+ // 根据登录人查询出对应的员工信息
|
|
|
+ EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
|
|
|
+ if (loginEmployee == null) {
|
|
|
+ throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
|
|
|
+ }
|
|
|
|
|
|
Task currentTask = bpmTaskService.getTask(revocationReqVO.getId());
|
|
|
if (currentTask == null) {
|
|
@@ -332,7 +359,7 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
.eq(OaConversionDO::getProcInstId, currentTask.getProcessInstanceId());
|
|
|
OaConversionDO oaConversionDO = oaConversionMapper.selectOne(lambdaQueryWrapper);
|
|
|
if (!DictDataConstants.OA_AUDIT_STATUS_COMMITTED.equals(oaConversionDO.getAuditStatus())
|
|
|
- || !Objects.equals(String.valueOf(loginUserId), oaConversionDO.getCreator())) {
|
|
|
+ || !Objects.equals(String.valueOf(loginEmployee.getId()), oaConversionDO.getCreator())) {
|
|
|
throw ServiceExceptionUtil.exception(ErrorCodeConstants.TASK_REVOCATION_NOT_ALLOWED);
|
|
|
}
|
|
|
|
|
@@ -345,7 +372,7 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
returnReqVO.setReason(reason);
|
|
|
returnReqVO.setTaskStatus(Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_RECALLED));
|
|
|
taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_RECALLED);
|
|
|
- bpmTaskService.revocationTask(loginUserId, returnReqVO);
|
|
|
+ bpmTaskService.revocationTask(loginEmployee.getId(), returnReqVO);
|
|
|
|
|
|
Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
|
|
|
Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
|
|
@@ -377,9 +404,11 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
if (loginUser == null) {
|
|
|
throw exception(ErrorCodeConstants.OA_LOGIN_USER_NOT_EXISTS);
|
|
|
}
|
|
|
+ // 登录员工信息
|
|
|
+ EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
|
|
|
// 转正人信息
|
|
|
- AdminUserRespDTO employee = adminUserApi.getUser(reCommitReqVO.getEmployeeId());
|
|
|
- if (employee == null) {
|
|
|
+ EmployeeRespDTO employee = employeeApi.getEmployeeById(reCommitReqVO.getEmployeeId());
|
|
|
+ if (loginEmployee == null || employee == null) {
|
|
|
throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
|
|
|
}
|
|
|
|
|
@@ -389,13 +418,14 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
.setProcInstId(oaConversionOld.getProcInstId());
|
|
|
|
|
|
oaConversionNew.setEmployeeId(employee.getId());
|
|
|
- oaConversionNew.setEmployeeName(employee.getNickname());
|
|
|
- oaConversionNew.setEmployeePhone(employee.getMobile());
|
|
|
+ oaConversionNew.setEmployeeName(employee.getName());
|
|
|
+ oaConversionNew.setEmployeePhone(employee.getPhone());
|
|
|
oaConversionNew.setDeptId(employee.getDeptId());
|
|
|
- oaConversionNew.setPosition("员工职位");
|
|
|
+ oaConversionNew.setPostId(employee.getPostId());
|
|
|
+ oaConversionNew.setPosition(employee.getPosition());
|
|
|
oaConversionNew.setUserId(loginUser.getId());
|
|
|
- oaConversionNew.setApplyEmployeeId(loginUser.getId());
|
|
|
- oaConversionNew.setApplyEmployeeName(loginUser.getNickname());
|
|
|
+ oaConversionNew.setApplyEmployeeId(loginEmployee.getId());
|
|
|
+ oaConversionNew.setApplyEmployeeName(loginEmployee.getName());
|
|
|
|
|
|
Task currentTask = taskService.createTaskQuery().processInstanceId(oaConversionNew.getProcInstId()).singleResult();
|
|
|
BpmTaskApproveReqVO approveReqVO = new BpmTaskApproveReqVO();
|
|
@@ -414,7 +444,7 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
taskService.setVariable(currentTask.getId(), "auditPass", "true");
|
|
|
taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_COMMITTED);
|
|
|
// 再次提交,和审批通过逻辑相同
|
|
|
- bpmTaskService.approveTask(loginUserId, approveReqVO);
|
|
|
+ bpmTaskService.approveTask(loginEmployee.getId(), approveReqVO);
|
|
|
|
|
|
Task nextTask = taskService.createTaskQuery().processInstanceId(currentTask.getProcessInstanceId()).singleResult();
|
|
|
Long currentAuditEmployeeId = Long.valueOf(nextTask.getAssignee());
|
|
@@ -439,7 +469,11 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
}
|
|
|
// 登录人信息
|
|
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
- // TODO DP 根据登录人查询出对应的员工信息
|
|
|
+ // 根据登录人查询出对应的员工信息
|
|
|
+ EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
|
|
|
+ if (loginEmployee == null) {
|
|
|
+ throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
|
|
|
+ }
|
|
|
|
|
|
OaConversionDO oaConversionDO = validateOaConversionExists(id);
|
|
|
if (!DictDataConstants.OA_AUDIT_STATUS_RETURNED.equals(oaConversionDO.getAuditStatus())
|
|
@@ -455,7 +489,7 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
taskService.setVariable(currentTask.getId(), "auditPass", "false");
|
|
|
taskService.setVariable(currentTask.getId(),BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, DictDataConstants.OA_AUDIT_STATUS_CLOSED);
|
|
|
// 关闭,使用审批通过的方法实现
|
|
|
- bpmTaskService.approveTask(loginUserId, approveReqVO);
|
|
|
+ bpmTaskService.approveTask(loginEmployee.getId(), approveReqVO);
|
|
|
|
|
|
LambdaUpdateWrapper<OaConversionDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
lambdaUpdateWrapper.set(OaConversionDO::getAuditStatus, DictDataConstants.OA_AUDIT_STATUS_CLOSED)
|
|
@@ -479,7 +513,11 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
public OaConversionRespVO getOaConversion(Long id) {
|
|
|
// 登录人信息
|
|
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
- // TODO DP 根据登录人查询出对应的员工信息
|
|
|
+ // 根据登录人查询出对应的员工信息
|
|
|
+ EmployeeRespDTO loginEmployee = employeeApi.getEmployeeByUserId(loginUserId);
|
|
|
+ if (loginEmployee == null) {
|
|
|
+ throw exception(ErrorCodeConstants.OA_EMPLOYEE_NOT_EXISTS);
|
|
|
+ }
|
|
|
|
|
|
OaConversionDO oaConversionDO = validateOaConversionExists(id);
|
|
|
OaConversionRespVO oaConversionRespVO = BeanUtils.toBean(oaConversionDO, OaConversionRespVO.class);
|
|
@@ -494,7 +532,7 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
if (StrUtil.isNotBlank(procInstId)) {
|
|
|
Task task = taskService.createTaskQuery()
|
|
|
.processInstanceId(procInstId)
|
|
|
- .taskAssignee(String.valueOf(loginUserId))
|
|
|
+ .taskAssignee(String.valueOf(loginEmployee.getId()))
|
|
|
.singleResult();
|
|
|
if (DictDataConstants.OA_AUDIT_STATUS_COMMITTED.equals(oaConversionDO.getAuditStatus())) {
|
|
|
// 如果是已提交,不限制任务处理人是当前登录人,用于直接撤回
|
|
@@ -520,16 +558,15 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
// 审批人
|
|
|
String startUserSelectAssignees = oaConversionDO.getStartUserSelectAssignees();
|
|
|
if (StrUtil.isNotEmpty(startUserSelectAssignees)) {
|
|
|
- List<Long> userIdList = Arrays.stream(startUserSelectAssignees.split(","))
|
|
|
+ List<Long> employeeIdList = Arrays.stream(startUserSelectAssignees.split(","))
|
|
|
.map(Long::valueOf).collect(Collectors.toList());
|
|
|
- List<AdminUserRespDTO> userList = adminUserApi.getUserList(userIdList);
|
|
|
- List<AdminUserRespDTO> auditUserList = new ArrayList<>();
|
|
|
- for (Long userId : userIdList) {
|
|
|
- for (AdminUserRespDTO adminUserRespDTO : userList) {
|
|
|
- if (Objects.equals(userId, adminUserRespDTO.getId())) {
|
|
|
- auditUserList.add(adminUserRespDTO);
|
|
|
- break;
|
|
|
- }
|
|
|
+ List<EmployeeRespDTO> employeeRespDTOList = employeeApi.getEmployeeListByIds(employeeIdList);
|
|
|
+ Map<Long, EmployeeRespDTO> longEmployeeRespDTOMap = CollectionUtils.convertMap(employeeRespDTOList, EmployeeRespDTO::getId);
|
|
|
+ List<EmployeeRespDTO> auditUserList = new ArrayList<>();
|
|
|
+ for (Long employeeId : employeeIdList) {
|
|
|
+ EmployeeRespDTO employeeRespDTO = longEmployeeRespDTOMap.get(employeeId);
|
|
|
+ if (employeeRespDTO != null) {
|
|
|
+ auditUserList.add(employeeRespDTO);
|
|
|
}
|
|
|
}
|
|
|
oaConversionRespVO.setAuditUserList(auditUserList);
|
|
@@ -562,16 +599,15 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
// 审批人
|
|
|
String startUserSelectAssignees = oaConversionDO.getStartUserSelectAssignees();
|
|
|
if (StrUtil.isNotEmpty(startUserSelectAssignees)) {
|
|
|
- List<Long> userIdList = Arrays.stream(startUserSelectAssignees.split(","))
|
|
|
+ List<Long> employeeIdList = Arrays.stream(startUserSelectAssignees.split(","))
|
|
|
.map(Long::valueOf).collect(Collectors.toList());
|
|
|
- List<AdminUserRespDTO> userList = adminUserApi.getUserList(userIdList);
|
|
|
- List<AdminUserRespDTO> auditUserList = new ArrayList<>();
|
|
|
- for (Long userId : userIdList) {
|
|
|
- for (AdminUserRespDTO adminUserRespDTO : userList) {
|
|
|
- if (Objects.equals(userId, adminUserRespDTO.getId())) {
|
|
|
- auditUserList.add(adminUserRespDTO);
|
|
|
- break;
|
|
|
- }
|
|
|
+ List<EmployeeRespDTO> employeeRespDTOList = employeeApi.getEmployeeListByIds(employeeIdList);
|
|
|
+ Map<Long, EmployeeRespDTO> longEmployeeRespDTOMap = CollectionUtils.convertMap(employeeRespDTOList, EmployeeRespDTO::getId);
|
|
|
+ List<EmployeeRespDTO> auditUserList = new ArrayList<>();
|
|
|
+ for (Long employeeId : employeeIdList) {
|
|
|
+ EmployeeRespDTO employeeRespDTO = longEmployeeRespDTOMap.get(employeeId);
|
|
|
+ if (employeeRespDTO != null) {
|
|
|
+ auditUserList.add(employeeRespDTO);
|
|
|
}
|
|
|
}
|
|
|
oaConversionRespVO.setAuditUserList(auditUserList);
|
|
@@ -588,13 +624,12 @@ public class OaConversionServiceImpl implements OaConversionService {
|
|
|
List<OaConversionRespVO> oaConversionRespVOList = oaConversionRespVOPageResult.getList();
|
|
|
if (CollectionUtil.isNotEmpty(oaConversionRespVOList)) {
|
|
|
List<Long> employeeIdList = oaConversionRespVOList.stream().map(OaConversionRespVO::getCurrentAuditEmployeeId).collect(Collectors.toList());
|
|
|
- List<AdminUserRespDTO> employeeList = adminUserApi.getUserList(employeeIdList);
|
|
|
+ List<EmployeeRespDTO> employeeRespDTOList = employeeApi.getEmployeeListByIds(employeeIdList);
|
|
|
+ Map<Long, EmployeeRespDTO> longEmployeeRespDTOMap = CollectionUtils.convertMap(employeeRespDTOList, EmployeeRespDTO::getId);
|
|
|
for (OaConversionRespVO respVO : oaConversionRespVOList) {
|
|
|
- for (AdminUserRespDTO employee : employeeList) {
|
|
|
- if (employee.getId() != null && employee.getId().equals(respVO.getCurrentAuditEmployeeId())) {
|
|
|
- respVO.setCurrentAuditEmployeeName(employee.getNickname());
|
|
|
- break;
|
|
|
- }
|
|
|
+ EmployeeRespDTO employeeRespDTO = longEmployeeRespDTOMap.get(respVO.getCurrentAuditEmployeeId());
|
|
|
+ if (employeeRespDTO != null) {
|
|
|
+ respVO.setCurrentAuditEmployeeName(employeeRespDTO.getName());
|
|
|
}
|
|
|
}
|
|
|
|