Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. public RoleContainerDTO findByEmployeeRecordId(Long officeId, Long employeeRecordId, Long currentOfficeUnitOrganogramId){
  2. List<EmployeeOffice> employeeOffices = this.employeeOfficeRepo.findByEmployeeRecordIdAndStatus(employeeRecordId,true);
  3. List<SingleRoleDTO> rolesDTO = employeeOffices.stream()
  4. .map(employeeOffice -> {
  5. return SingleRoleDTO.builder()
  6. .designation(employeeOffice.getDesignation())
  7. .officeUnitOrganogramId(employeeOffice.getOfficeUnitOrganogram().getId())
  8. .officeUnitId(employeeOffice.getOfficeUnit().getId())
  9. .officeId(employeeOffice.getOffice().getId())
  10. .officeUnitNameBangla(employeeOffice.getOfficeUnit().getUnitNameBangla())
  11. .officeUnitNameEnglish(employeeOffice.getOfficeUnit().getUnitNameEnglish())
  12. .officeNameEnglish(employeeOffice.getOffice().getNameEnglish())
  13. .officeNameBangla(employeeOffice.getOffice().getNameBangla())
  14. .selected(employeeOffice.getOfficeUnitOrganogram().getId().equals(currentOfficeUnitOrganogramId) && employeeOffice.getOffice().getId().equals(officeId))
  15. .build();
  16. })
  17. .collect(Collectors.toList());
  18.  
  19. return RoleContainerDTO.builder()
  20. .roles(rolesDTO)
  21. .build();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement