/**
  * 会员未支付订单 2014-8-14下午2:49:19
  *
  * @author wangmingyu
  */
 @InjectHttpOk({10, 11, 27})
 public void resultOk(ResponseEntity r) {
   dismissDialog();
   if (ResultParse.isResultOK(r, activity)) {
     switch (r.getKey()) {
       case 10:
         List<OrdrDetail> list = new ArrayList<OrdrDetail>();
         list = Handler_Json.jsonToBean(OrdrDetail.class, "list", r.getContentAsString());
         installData(list);
         break;
       case 11: // 查询订单组列表
         positionJson = r.getContentAsString();
         child = Handler_Json.jsonToBean(OrderDetailEntity.class, "list", r.getContentAsString());
         if (child != null) {
           order_center_list.expandGroup(groupPosition);
           if (Handler_String.isBlank(((OrderDetailEntity) oca.getChild(0, 0)).getCardNo())) {
             footerView.findViewById(R.id.rl_type_card).setVisibility(View.GONE);
             footerView.findViewById(R.id.rl_type_money).setVisibility(View.VISIBLE);
           } else {
             footerView.findViewById(R.id.rl_type_card).setVisibility(View.VISIBLE);
             footerView.findViewById(R.id.rl_type_money).setVisibility(View.GONE);
             TextView cardNo = (TextView) footerView.findViewById(R.id.tv_card_No);
             TextView cardPoint = (TextView) footerView.findViewById(R.id.tv_card_point);
             Selector selector = Selector.from(ReservationDto.class);
             selector.select(" * ");
             selector.where("cardNo", "=", ((OrderDetailEntity) oca.getChild(0, 0)).getCardNo());
             ReservationDto rd =
                 Ioc.getIoc().getDb("/sdcard/MTM/", Constants.APP_DATABASE).findFirst(selector);
             String card_no_6 = rd.getCardNo().substring(rd.getCardNo().length() - 6);
             cardNo.setText(getString(R.string._card_wh, card_no_6));
             cardPoint.setText(getString(R.string.usable_card_idx, rd.getCardRemainingIdx()));
           }
           order_center_list.addFooterView(footerView);
           oca.notifyDataSetChanged();
         }
         break;
       case 27: // 取消订单
         try {
           List<HashMap<String, String>> cancelList =
               Handler_Json.jsonToList("orderCancelList", r.getContentAsString());
           for (int i = 0; i < cancelList.size(); i++) {
             Ioc.getIoc()
                 .getDb("/sdcard/MTM/", Constants.APP_DATABASE)
                 .delete(
                     SubmittedOrderEntity.class,
                     WhereBuilder.b("orderNo", "=", cancelList.get(i).get("orderNo")));
           }
           // group.remove(groupPosition);
           // 获取当前未支付订单数量
           eventBus.post(new MSGCountEntity());
           group.clear();
           oca.notifyDataSetChanged();
           rl_tools.setVisibility(View.GONE);
         } catch (Exception e) {
           e.printStackTrace();
         }
         break;
     }
   }
 }
 /**
  * **********************************************
  *
  * @return void 返回类型
  * @throws @Title: ajaxPOST @Description: (酒店介绍 图片列表 请求操作) 设定文件
  * @date 2014-11-19 ***********************************************
  */
 private void ajaxPOST() {
   rd = (ReservationDto) MapVo.get("reservtion");
   if (rd == null) {
     Toast.makeText(activity, "数据异常,请重新选择酒店及入住时间", Toast.LENGTH_SHORT).show();
   } else {
     if (rd.getHotelCode() != null && rd.getHotelCode() != "") {
       String jsonParams = "{'hotelCode':" + rd.getHotelCode() + "}";
       InternetConfig config = new InternetConfig();
       config.setKey(111);
       FastHttpHander.ajaxString(Url.HOTELRESERVE_ASSET_BULIDING_ARRAY, jsonParams, config, this);
     } else {
       Toast.makeText(activity, "数据异常,请重新选择酒店及入住时间", Toast.LENGTH_SHORT).show();
     }
   }
 }
  private void ajaxImgList() {

    InternetConfig config = new InternetConfig();
    JsonObject json = new JsonObject();
    json.addProperty("hotelCode", rd.getHotelCode());
    //		json.addProperty("roomTypeCode", rd.getRoomTypeCode());
    //		json.addProperty("includeLayoutPic", "1");
    //		json.addProperty("includePic", "1");
    FastHttpHander.ajaxString(Url.HOTELRESERVE_ASSET_BULIDING_ARRAY, json.toString(), config, this);
  }
  /**
   * **********************************************
   *
   * @param list 设定文件
   * @return void 返回类型
   * @throws @Title: getList @Description: TODO(为适配器装载数据)
   * @date 2014-11-19 ***********************************************
   */
  private void getList(ArrayList<HashMap<String, String>> list) {

    // RoomResourceDto
    if (list != null) {
      // dataList.clear();
      List<OrderCenterEntity> orderList = getNotSubOrder(rd.getStartDate(), rd.getEndDate());

      for (int i = 0; i < list.size(); i++) {

        HashMap<String, String> hashMap = new HashMap<String, String>();
        HashMap<String, String> r = list.get(i);
        if (orderList != null) {
          for (int j = 0; j < orderList.size(); j++) {
            if (orderList.get(j).getRoomCode().equals(r.get("roomCode"))) {
              hashMap.put("img_sel", "1"); // 是否存在 1是 空或0 不是
            }
          }
        }
        hashMap.put(
            "text_room_name",
            r.get("roomTypeName") + "-" + r.get("floorName") + "-" + r.get("roomCode"));
        hashMap.put("text_myExam_content", r.get("viewIntro"));
        hashMap.put("text_room_idx", getString(R.string._room_idx, r.get("roomIdx")));
        // hashMap.put("text_room_idx",
        // getString(R.string._room_idx,rd.get("roomIdx")));
        //                if (null != rd.getCardNo() && !"".equals(rd.getCardNo())) {
        //                    hashMap.put("text_pointsNight", r.get("idx") + "间夜");
        //                } else {
        //                    hashMap.put("text_pointsNight",
        //                            getString(R.string._price, r.get("price")));
        //                }
        hashMap.put("text_pointsNight", getString(R.string._price, r.get("price")));
        hashMap.put("text_infarIntro", r.get("infarIntro"));
        hashMap.put("roomCode", r.get("roomCode"));
        hashMap.put("image_myExam_infoIcon", r.get("logoUrl")); // rd.get("logoUrl")

        hashMap.put("btn_reservation", "预订");
        dataList.add(hashMap);
      }
    }
    srla.notifyDataSetChanged();
  }
 /**
  * **********************************************
  *
  * @param page 设定文件
  * @return void 返回类型
  * @throws @Title: ajaxRoomList @Description: TODO(获取房间列表)
  * @date 2014-11-19 ***********************************************
  */
 private void ajaxRoomList(int page) {
   RoomResourceParamDto rrpd = new RoomResourceParamDto();
   rrpd.setStartDate(rd.getStartDate());
   rrpd.setEndDate(rd.getEndDate());
   rrpd.setHotelCode(rd.getHotelCode());
   rrpd.setCardNo(rd.getCardNo());
   rrpd.setPageNo(page + "");
   rrpd.setPageCount("5");
   ArrayList<HashMap<String, String>> conditions =
       (ArrayList<HashMap<String, String>>) MapVo.get("conditions");
   if (conditions != null) {
     rrpd.setBuildingCode(conditions.get(3).get("text_type_code") + "");
     rrpd.setFloorCode(conditions.get(4).get("text_type_code") + "");
     rrpd.setInfarIntro(conditions.get(2).get("text_type_code") + "");
     rrpd.setRoomTypeCode(conditions.get(0).get("text_type_code") + "");
     rrpd.setViewCode(conditions.get(1).get("text_type_code") + "");
     rrpd.setRoomIdxRange(conditions.get(5).get("text_type_code") + "");
   }
   InternetConfig config = new InternetConfig();
   config.setKey(1);
   String json = Handler_Json.beanToJson(rrpd);
   Ioc.getIoc().getLogger().i(json);
   FastHttpHander.ajaxString(Url.HOTELRESERVE_ASSET_RECOMMENDROOMARRAY, json, config, this);
 }
  /**
   * @return void 返回类型
   * @throws @Title: initView @Description: 初始化控件
   */
  public void initView() {
    LayoutInflater inflater = android.view.LayoutInflater.from(getActivity());
    heardView = inflater.inflate(R.layout.reservation_conditions_room, null);
    listview_roomlist.addHeaderView(heardView);
    gallery_hotel = (IMGGallery) heardView.findViewById(R.id.gallery_hotel);
    indicator_container = (LinearLayout) heardView.findViewById(R.id.indicator_container);
    text_startDate = (TextView) heardView.findViewById(R.id.text_startDate);
    text_endDate = (TextView) heardView.findViewById(R.id.text_endDate);
    text_count_days = (TextView) heardView.findViewById(R.id.text_count_days);
    text_hotelname = (TextView) heardView.findViewById(R.id.text_hotelname);
    text_hotelidx = (TextView) heardView.findViewById(R.id.text_hotelidx);

    rd = (ReservationDto) MapVo.get("reservtion");
    text_hotelname.setText(rd.getHotelName());
    text_hotelidx.setText(rd.getProjectIdx());
    text_startDate.setText(rd.getStartDate());
    text_endDate.setText(rd.getEndDate());
    int subDay = DateUtil.nDaysBetweenTwoDate(rd.getStartDate(), rd.getEndDate());
    text_count_days.setText(getString(R.string._subday, subDay));
  }