@SuppressWarnings("unchecked") @Override protected void onPostExecute(String result) { // TODO Auto-generated method stub super.onPostExecute(result); RepairUtils.myRemoveDialog(pd); if ("".equals(result)) { /** 返回结果是空字符串标示获取数据成功,就把农机类别数据保存到数据库中 */ database.InsertToDb(Optdb_interfce.TABLE_NJLEIBIE, agriculturalBCategoryList); database.InsertToDb(Optdb_interfce.TABLE_NJLEIBIE, agriculturalSCategoryList); database.InsertToDb(Optdb_interfce.TABLE_NJLEIBIE, agriculturalPCategoryList); /** 取出第一个农机大类对应的农机小类 在取出第一个农机小类对应的农机品目 */ if (agriculturalBCategoryList.size() != 0) { agriculturalSCategoryList = database.getSmallKindsOfCarBeanInfo( MyState.CAR_SMALL_TYPE_MARK + "", agriculturalBCategoryList.get(0).getBigClassName()); if (agriculturalSCategoryList.size() != 0) { agriculturalPCategoryList = database.getSmallKindsOfCarBeanPMInfo( MyState.CAR_TYPE_MARK + "", agriculturalSCategoryList.get(0).getSmallClassName()); } } /** 将农机类别数据返回 */ allTaskInterface.taskFinishReturn( agriculturalBCategoryList, agriculturalSCategoryList, agriculturalPCategoryList); } else { UIUtil.showMsg(context, result); allTaskInterface.taskFinishReturn(null); } database.close_SqlDb(); }
@Override protected void onPostExecute(String result) { // TODO Auto-generated method stub super.onPostExecute(result); pd.dismiss(); if (!"".equals(result)) { UIUtil.showMsg(QueryDetailActivity.this, result); } else { try { if (null != carTypeLists[14]) { ((NjBuTie) bean).setNjDl(carTypeLists[14].toString()); } if (null != carTypeLists[15]) { ((NjBuTie) bean).setNjXl(carTypeLists[15].toString()); } if (null != carTypeLists[16]) { ((NjBuTie) bean).setNjPm(carTypeLists[16].toString()); } Log.e("农机补贴信息:", bean.toString()); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { startPoint = new LatLonPoint(mylat, mylon); if (!TextUtils.isEmpty(((NjBuTie) bean).getFactoryName())) { rlist.add(new String[] {"厂家名称:", ((NjBuTie) bean).getFactoryName()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw( "厂家名称:", ((NjBuTie) bean).getFactoryName())); } if (!TextUtils.isEmpty(((NjBuTie) bean).getContactName())) { rlist.add(new String[] {"联系人:", ((NjBuTie) bean).getContactName()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw( "联系人:", ((NjBuTie) bean).getContactName())); } if (!TextUtils.isEmpty(((NjBuTie) bean).getContactPhone())) { rlist.add(new String[] {"联系电话:", ((NjBuTie) bean).getContactPhone()}); tel = ((NjBuTie) bean).getContactPhone(); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw( "联系电话:", ((NjBuTie) bean).getContactPhone())); } // rlist.add(new String[] { "农机大类:", // ((NjBuTie) bean).getType(). }); // rlist.add(new String[] { "农机小类:", // ((NjBuTie) bean).getType().getSmallClassName() }); // rlist.add(new String[] { "农机品目:", // ((NjBuTie) bean).getType().getItemName() }); if (!TextUtils.isEmpty(((NjBuTie) bean).getNjDl())) { rlist.add(new String[] {"农机大类:", ((NjBuTie) bean).getNjDl()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw("农机大类:", ((NjBuTie) bean).getNjDl())); } if (!TextUtils.isEmpty(((NjBuTie) bean).getNjXl())) { rlist.add(new String[] {"农机小类:", ((NjBuTie) bean).getNjXl()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw("农机小类:", ((NjBuTie) bean).getNjXl())); } if (!TextUtils.isEmpty(((NjBuTie) bean).getNjPm())) { rlist.add(new String[] {"农机品目:", ((NjBuTie) bean).getNjPm()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw("农机品目:", ((NjBuTie) bean).getNjPm())); } if (!TextUtils.isEmpty(((NjBuTie) bean).getBrandName())) { rlist.add(new String[] {"品牌名称:", ((NjBuTie) bean).getBrandName()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw("品牌名称:", ((NjBuTie) bean).getBrandName())); } if (!TextUtils.isEmpty(((NjBuTie) bean).getProductName())) { rlist.add(new String[] {"产品名称:", ((NjBuTie) bean).getProductName()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw( "产品名称:", ((NjBuTie) bean).getProductName())); } if (!TextUtils.isEmpty(((NjBuTie) bean).getSubsidyMoney())) { rlist.add(new String[] {"补贴金额:", ((NjBuTie) bean).getSubsidyMoney()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw( "补贴金额:", ((NjBuTie) bean).getSubsidyMoney())); } if (!TextUtils.isEmpty(((NjBuTie) bean).getAddress())) { rlist.add(new String[] {"厂家地址:", ((NjBuTie) bean).getAddress()}); rlistWithDraw.add( TableRawUtils.newTableRawItemWithOutDraw("厂家地址:", ((NjBuTie) bean).getAddress())); } endPoint = new LatLonPoint(((NjBuTie) bean).getLat(), ((NjBuTie) bean).getLon()); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } UIUtil.ctreatTableRowsWithDraw(QueryDetailActivity.this, tbLayoutNew, rlistWithDraw); // UIUtil.generateTableRows(QueryDetailActivity.this, table, // rlist); } }