/**
  * 会员未支付订单 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;
     }
   }
 }
 @InjectHttpErr({9, 10, 11, 27})
 public void resultErr(ResponseEntity r) {
   if (r.getKey() == 9) {
     getNoLoginOrder();
   }
   dismissDialog();
   Toast.makeText(activity, ErrorMessageEnum.SYSTEM_EXCEPTION.getName(), Toast.LENGTH_SHORT)
       .show();
 }
 @InjectHttpErr(value = {1, 3})
 public void resultErr(ResponseEntity r) {
   dismissDialog();
   Ioc.getIoc().getLogger().i("接口请求异常:" + r.getContentAsString());
   if (r.getKey() == 1) {
     pageUtil.isEndDownPage();
     Toast.makeText(activity, ErrorMsgEnum.NET_ERROR.getName(), Toast.LENGTH_SHORT).show();
   }
 }
  /** @Function resultErr @Description 请求结果失败处理 @Input r:请求结果封装实体类 @Return 无返回值 */
  @InjectHttpErr(value = {1})
  public void resultErr(ResponseEntity r) {
    switch (r.getKey()) {
        // 消费明细
      case 1:
        Ioc.getIoc().getLogger().i("消费明细接口获取失败,请检查网络或者接口");
        Toast.makeText(this, "消费明细接口获取失败,请检查网络或者接口", Toast.LENGTH_SHORT).show();
        break;
    }

    cancelDialog();
  }
Exemple #5
0
  // 获取个人信息成功返回结果
  @InjectHttpOk({1, 13})
  public void resultOk(ResponseEntity r) {

    dismissDialog();
    // 获取个人信息成功 返回OK
    if (ResultParse.isResultOK(r, this)) {
      switch (r.getKey()) {
        case 1: // 获取个人信息
          personEntity = Handler_Json.JsonToBean(PersonalEntity.class, r.getContentAsString());
          personEntity.setId("2222");
          if (getPersonInfo() > 0) db.saveOrUpdate(personEntity);
          else db.save(personEntity);

          // 判断是否绑定手机,如果绑定手机,登陆的时候显示手机号,否则显示邮箱
          if (personEntity.getCallPhone() != null && !personEntity.getCallPhone().equals("")) {
            account_item_name.setText(personEntity.getCallPhone());
          } else {
            account_item_name.setText(personEntity.getEmail());
          }
          break;
        case 13: // 版本更新
          try {
            final Map<String, String> map = Handler_Json.JsonToCollection(r.getContentAsString());
            ////                       {
            //                        "name": "红树林管家",
            //                                "version": "10",
            //                                "changelog": "新版本更新\n1、增加新产品商城\n2、业态展示\n3、商品订单中心",
            //                                "updated_at": 1470668072,
            //                                "versionShort": "V 3.1.0",
            //                                "build": "10",
            //                                "installUrl":
            // "http://download.fir.im/v2/app/install/54c7076b64fa0433050049a8?download_token=1fbef156fe3a27ff2524cae445d06849",
            //                                "install_url":
            // "http://download.fir.im/v2/app/install/54c7076b64fa0433050049a8?download_token=1fbef156fe3a27ff2524cae445d06849",
            //                                "direct_install_url":
            // "http://download.fir.im/v2/app/install/54c7076b64fa0433050049a8?download_token=1fbef156fe3a27ff2524cae445d06849",
            //                                "update_url": "http://fir.im/mangrovetree",
            //                                "binary": {
            //                            "fsize": 60386833
            //                        }
            //                    }
            int version = Integer.valueOf(map.get("version"));
            Ioc.getIoc().getLogger().e(" 当前versionCode:" + Handler_System.getVersionCode(this));
            if (version > Handler_System.getVersionCode(this)) {
              onAlertVersion(map.get("changelog"), map.get("install_url"));
            }
          } catch (Exception e) {
          }
          break;
      }

      // 是否开通帐户余额,开通了获取余额值
      //            if(personEntity.getOpenBalance() == 1){
      //                internetConfig.setKey(3);
      //                //已开通余额帐户,取帐户余额
      //                FastHttpHander.ajaxString(Url.METHOD_MEMBERBALANCEINFO,new
      // JsonObject().toString(),internetConfig,this);
      //            }else{
      //                //设置帐户余额
      //                account_item_money.setText("未开通账户余额");
      //            }

    }
  }