public static String organizationName(Long organizationId) { Organization organization = getOrganizationService().findOne(organizationId); if (organization == null) { return ""; } return organization.getOrgName(); }
public static String organizationNames(Collection<Long> organizationIds) { if (CollectionUtils.isEmpty(organizationIds)) { return ""; } StringBuilder s = new StringBuilder(); for (Long organizationId : organizationIds) { Organization organization = getOrganizationService().findOne(organizationId); if (organization == null) { return ""; } s.append(organization.getOrgName()); s.append(","); } if (s.length() > 0) { s.deleteCharAt(s.length() - 1); } return s.toString(); }