Package it.hotel.controller.booking.DTO

Examples of it.hotel.controller.booking.DTO.SolutionHotelDTO


      Integer[] mapping = new Integer[]{0,1,0,0,0};
      SolutionBookingDTO soluzioneDisponibile = new SolutionBookingDTO(mapping ,prezzi);
      List<SolutionBookingDTO> soluzioniDisponibili = new ArrayList<SolutionBookingDTO>();
      soluzioniDisponibili.add(soluzioneDisponibile);
     
      SolutionHotelDTO soluzione1 =new SolutionHotelDTO(soluzioniDisponibili);
     
      criteriaResult2 = new HashMap<Hotel,List>();
      criteriaResult2.put(hotel2, soluzione1);
     
      criteriaResult1 = bookingRawManager.getSolutionsFromCriteria(dto, CalendarUtils.GetToday(), CalendarUtils.GetToday());
     
      assertTrue(criteriaResult1.size()==criteriaResult2.size());
     
      Set<Hotel> setResult1 = criteriaResult1.keySet();
      Set<Hotel> setResult2 = criteriaResult2.keySet();
     
      assertTrue(setResult1.containsAll(setResult2) && (setResult1.size() == setResult2.size()));
     
       
      soluzione1 = (SolutionHotelDTO) criteriaResult1.get(hotel2);
     
     
      assertEquals(soluzione1.getMinPrice(), soluzione.getMinPrice());
      assertEquals(soluzione1.getMaxPrice(), soluzione.getMaxPrice());
     
      SolutionBookingDTO bookingDto1 = soluzione1.getSolutions().get(0);
      SolutionBookingDTO bookingDto2 = soluzione.getSolutions().get(0);
     
      assertEquals(bookingDto1.getCombinationId(),bookingDto2.getCombinationId());
      assertEquals(bookingDto1.getMinPrice(),bookingDto2.getMinPrice());
      assertEquals(bookingDto1.getMaxPrice(),bookingDto2.getMaxPrice());
View Full Code Here


         
      SolutionBookingDTO soluzioneDisponibile = new SolutionBookingDTO(mapping ,prezzi);
      List<SolutionBookingDTO> soluzioniDisponibili = new ArrayList<SolutionBookingDTO>();
      soluzioniDisponibili.add(soluzioneDisponibile);
     
      SolutionHotelDTO soluzione1 =new SolutionHotelDTO(soluzioniDisponibili);
     
      assertEquals(soluzione1.getMinPrice(), soluzione.getMinPrice());
      assertEquals(soluzione1.getMaxPrice(), soluzione.getMaxPrice());
     
      SolutionBookingDTO bookingDto1 = soluzione1.getSolutions().get(0);
      SolutionBookingDTO bookingDto2 = soluzione.getSolutions().get(0);
     
      assertEquals(bookingDto1.getCombinationId(),bookingDto2.getCombinationId());
      assertEquals(bookingDto1.getMinPrice(),bookingDto2.getMinPrice());
      assertEquals(bookingDto1.getMaxPrice(),bookingDto2.getMaxPrice());
View Full Code Here

  @Transactional(readOnly = true, propagation = Propagation.REQUIRED)
  public Map<Hotel,List> getSolutionsFromCriteria(CriteriaDTO criteria, GregorianCalendar begindate, GregorianCalendar finishdate) {
    Map result =  new HashMap<Structure,List>();
    Collection<Structure> structures = structureManager.searchAll("city", criteria.getDestinazione());
    for(Structure structure: structures){
      SolutionHotelDTO solutions = getSolutionsForStructureFromCriteria(criteria, structure, begindate,  finishdate);
      if(null != solutions)
      {
        result.put(structure, solutions);
      }
    }
View Full Code Here

   
   
    List<SolutionBookingDTO> solutionsAvailable = isCriteriaMatching(roomResult,dto.getPersons(),dto.getRooms() ,  begindate,  finishdate);
     
    if(solutionsAvailable.size()>0){
        SolutionHotelDTO solution =new SolutionHotelDTO(solutionsAvailable);
        if(solution.getMinPrice().compareTo(dto.getPrice()) < 0 || dto.getPrice().equals(0.0)){
          return solution;
        }
      }
   
    return null;
View Full Code Here

TOP

Related Classes of it.hotel.controller.booking.DTO.SolutionHotelDTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.