コード例 #1
0
  protected MobilePlace convertToMobilePlace(PlaceBean placeBean) {
    MobilePlace mp = new MobilePlace();

    mp.setCanOrderToday(placeBean.canOrderTodayCurrentTimeForPlace());

    mp.setOrderTodayAble(placeBean.getTodayOrderAble()); // 新今日可订

    mp.setId(Long.valueOf(placeBean.getId()));
    mp.setAddress(placeBean.getAddress());
    mp.setMarketPriceYuan(Float.valueOf(placeBean.getMarketPrice()));
    if (!StringUtil.isEmptyString(placeBean.getSellPrice())) {
      mp.setSellPriceYuan((PriceUtil.convertToYuan(Long.valueOf(placeBean.getSellPrice()))));
    }
    // mp.setJuli(String.valueOf(placeBean.getBoost()));
    mp.setFreenessNum(placeBean.getFreenessNum());
    mp.setRouteNum(placeBean.getRouteNum());
    mp.setName(placeBean.getName());
    mp.setBaiduLatitude(Double.valueOf(placeBean.getLatitude()));
    mp.setBaiduLongitude(Double.valueOf(placeBean.getLongitude()));
    mp.setMiddleImage(placeBean.getMiddleImage());
    mp.setCmtStarts(placeBean.getAvgScore() + "");
    /** ********* V3.1 ********* */
    // 主题类型
    // mp.setSubject(placeBean.getPlaceMainTitel());
    // 返现金额 (是分 还是元)
    // mp.setMaxCashRefund(StringUtil.isEmptyString(placeBean.getCashRefund())?0l:PriceUtil.convertToFen(placeBean.getCashRefund()));
    // 优惠 - 景点不显示惠
    // mp.setHasBusinessCoupon(ClientUtils.hasBusinessCoupon(placeBean.getTagList()));
    mp.setWeiXinActivity("Y".equals(placeBean.getShareweixin()));
    return mp;
  }
コード例 #2
0
 /**
  * 获取随机数据.
  *
  * @param placeList
  * @param placeId
  * @return
  */
 public MobilePlace getRandomPlaceBean(List<PlaceBean> placeList, String placeId) {
   PlaceBean pb = null;
   if (null != placeList && placeList.size() > 0) {
     int size = placeList.size();
     int index = getRandom(size);
     pb = placeList.get(index);
     if (null != placeId && !"null".equals(placeId)) {
       if (pb.getId().equals(placeId)) { // 如果上次已经摇到.
         placeList.remove(pb);
         return getRandomPlaceBean(placeList, placeId);
       } else {
         return this.convertToMobilePlace(pb);
       }
     }
   }
   return this.convertToMobilePlace(pb);
 }