| | |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; |
| | | import static cn.iocoder.yudao.module.hrm.enums.ErrorCodeConstants.*; |
| | |
| | | } |
| | | |
| | | private Long getCurrentUserId() { |
| | | return 1L; |
| | | return SecurityFrameworkUtils.getLoginUserId(); |
| | | } |
| | | |
| | | private String generateUniqueNo() { |
| | |
| | | } |
| | | |
| | | private void fillDeptNames(HrmTransferApplicationRespVO respVO, HrmTransferApplicationDO application) { |
| | | Set<Long> deptIds = Set.of(application.getCurrentDeptId(), application.getTargetDeptId()) |
| | | .stream().filter(Objects::nonNull).collect(Collectors.toSet()); |
| | | Set<Long> deptIds = Stream.of(application.getCurrentDeptId(), application.getTargetDeptId()) |
| | | .filter(Objects::nonNull).collect(Collectors.toSet()); |
| | | Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(deptIds); |
| | | if (application.getCurrentDeptId() != null && deptMap.containsKey(application.getCurrentDeptId())) { |
| | | respVO.setCurrentDeptName(deptMap.get(application.getCurrentDeptId()).getName()); |
| | |
| | | } |
| | | |
| | | private void fillPostNames(HrmTransferApplicationRespVO respVO, HrmTransferApplicationDO application) { |
| | | Set<Long> postIds = Set.of(application.getCurrentPostId(), application.getTargetPostId()) |
| | | .stream().filter(Objects::nonNull).collect(Collectors.toSet()); |
| | | Set<Long> postIds = Stream.of(application.getCurrentPostId(), application.getTargetPostId()) |
| | | .filter(Objects::nonNull).collect(Collectors.toSet()); |
| | | Map<Long, PostRespDTO> postMap = postApi.getPostMap(postIds); |
| | | if (application.getCurrentPostId() != null && postMap.containsKey(application.getCurrentPostId())) { |
| | | respVO.setCurrentPostName(postMap.get(application.getCurrentPostId()).getName()); |