Esempio n. 1
0
 /**
  * 会员未支付订单 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;
     }
   }
 }
Esempio n. 2
0
 @InjectHttpOk(1)
 public void resultOk(ResponseEntity r) {
   dismissDialog();
   if (ResultParse.isResultOK(r, activity)) {
     ArrayList<HashMap<String, String>> list =
         Handler_Json.jsonToList("list", r.getContentAsString());
     String page = (String) Handler_Json.getValue("pageNo", r.getContentAsString());
     String time = (String) Handler_Json.getValue("sysDateTime", r.getContentAsString());
     MangrovePayApp.msgTime = time;
     MangrovePayApp.app.setData("msgTime", time);
     Ioc.getIoc().getLogger().i("-------------------------");
     Ioc.getIoc().getLogger().i("-------------系统时间:" + MangrovePayApp.msgTime);
     if (!Handler_String.isBlank(page)) {
       pageNo = Integer.valueOf(page) + 1;
     }
     initData(list, page);
   }
 }