Exemple #1
0
 public RouteVO getRouteDetail(TbBizRouteBO oneroute) {
   RouteVO route = new RouteVO();
   TbBizRouteTypeBO routeTypeBO = oneroute.getRouteType();
   RouteTypeVO routeType = new RouteTypeVO();
   routeType.setRouteTypeId(routeTypeBO.getRouteTypeId());
   routeType.setDescrition(routeTypeBO.getDescrition());
   routeType.setRouteName(routeTypeBO.getRouteName());
   route.setRouteid(oneroute.getRouteId());
   route.setName(oneroute.getRouteName());
   route.setDes(oneroute.getDescription());
   route.setcTime(oneroute.getCreateTime());
   route.seteTime(oneroute.getUpdateTime());
   route.setStatus(oneroute.getRouteStatusCd());
   route.setThemeImageUrl(oneroute.getThemeImage());
   route.setRoutetype(routeType.getRouteTypeId());
   List<NodeVO> ns = new ArrayList<NodeVO>();
   Set<TbBizRouteNodeBO> nodes = oneroute.getRouteNodes();
   for (Iterator<TbBizRouteNodeBO> nodeiterator = nodes.iterator(); nodeiterator.hasNext(); ) {
     TbBizRouteNodeBO day = nodeiterator.next();
     NodeVO node = new NodeVO();
     node.setName(day.getNodeName());
     node.setDescription(day.getDescription());
     node.setAccommodation(day.getAccommodation());
     node.setKeywords(day.getKeywords());
     node.setSequence(day.getSequentialNum());
     node.setIpath(day.getImageUrl());
     ns.add(node);
   }
   List<DetailVO> ds = new ArrayList<DetailVO>();
   SortByday sort = new SortByday();
   Collections.sort(ns, sort);
   String days = "";
   List<String> cars = new ArrayList<String>();
   Set<TbBizRouteDetailBO> details = oneroute.getDetails();
   for (TbBizRouteDetailBO o : details) {
     days = o.getDayOfWeek();
     break;
   }
   for (Iterator<TbBizRouteDetailBO> detailiterator = details.iterator();
       detailiterator.hasNext(); ) {
     TbBizRouteDetailBO detail = detailiterator.next();
     DetailVO detailVO = getDetailVO(detail);
     ds.add(detailVO);
   }
   route.setNodes(ns);
   route.setDetails(ds);
   String[] dayofweek = days.split("");
   route.setDayofweek(dayofweek);
   String[] car = new String[cars.size()];
   // route.setCars(cars.toArray(car));
   HostelVO vo = getHostel(oneroute.getHostel());
   route.setHotel(vo);
   return route;
 }