コード例 #1
0
ファイル: SponsorWebServiceImpl.java プロジェクト: mavetx/kc
 public List<SponsorDTO> getMatchingSponsors(SponsorCriteriaDto searchCriteria) {
   List<SponsorDTO> results = new ArrayList<SponsorDTO>();
   Collection<Sponsor> sponsors;
   if (ObjectUtils.isNull(searchCriteria)
       || (StringUtils.isEmpty(searchCriteria.getSponsorCode())
           && StringUtils.isEmpty(searchCriteria.getCustomerNumber()))) {
     sponsors = getBusinessObjectService().findAll(Sponsor.class);
   } else if (StringUtils.isNotEmpty(searchCriteria.getSponsorCode())) {
     sponsors =
         legacyDataAdapter.findCollectionBySearchHelper(
             Sponsor.class,
             Collections.singletonMap("sponsorCode", searchCriteria.getSponsorCode()),
             Collections.<String>emptyList(),
             true,
             false,
             0);
   } else {
     sponsors =
         legacyDataAdapter.findCollectionBySearchHelper(
             Sponsor.class,
             Collections.singletonMap("customerNumber", searchCriteria.getCustomerNumber()),
             Collections.<String>emptyList(),
             true,
             false,
             0);
   }
   if (sponsors != null && !sponsors.isEmpty()) {
     for (Sponsor sponsor : sponsors) {
       results.add(sponsorDtoService.buildDto(sponsor));
     }
   }
   return results;
 }
コード例 #2
0
ファイル: SponsorWebServiceImpl.java プロジェクト: mavetx/kc
 public SponsorDTO getSponsor(String sponsorCode) {
   if (StringUtils.isNotBlank(sponsorCode)) {
     Sponsor sponsor =
         getBusinessObjectService().findBySinglePrimaryKey(Sponsor.class, sponsorCode);
     if (sponsor != null) {
       SponsorDTO result = sponsorDtoService.buildDto(sponsor);
       return result;
     }
   }
   return null;
 }