Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public RoleContainerDTO findByEmployeeRecordId(Long officeId, Long employeeRecordId, Long currentOfficeUnitOrganogramId){
- List<EmployeeOffice> employeeOffices = this.employeeOfficeRepo.findByEmployeeRecordIdAndStatus(employeeRecordId,true);
- List<SingleRoleDTO> rolesDTO = employeeOffices.stream()
- .map(employeeOffice -> {
- return SingleRoleDTO.builder()
- .designation(employeeOffice.getDesignation())
- .officeUnitOrganogramId(employeeOffice.getOfficeUnitOrganogram().getId())
- .officeUnitId(employeeOffice.getOfficeUnit().getId())
- .officeId(employeeOffice.getOffice().getId())
- .officeUnitNameBangla(employeeOffice.getOfficeUnit().getUnitNameBangla())
- .officeUnitNameEnglish(employeeOffice.getOfficeUnit().getUnitNameEnglish())
- .officeNameEnglish(employeeOffice.getOffice().getNameEnglish())
- .officeNameBangla(employeeOffice.getOffice().getNameBangla())
- .selected(employeeOffice.getOfficeUnitOrganogram().getId().equals(currentOfficeUnitOrganogramId) && employeeOffice.getOffice().getId().equals(officeId))
- .build();
- })
- .collect(Collectors.toList());
- return RoleContainerDTO.builder()
- .roles(rolesDTO)
- .build();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement