@SuppressLint("NewApi")
  private void initParam() {
    application = (MyApp) getApplication();
    bean = (NiGoBean) getIntent().getSerializableExtra("bean");
    flag = getIntent().getStringExtra("flag");
    PADDING = UIUtil.dip2px(this, getResources().getDimension(R.dimen.padding));
    MARGINMORE = UIUtil.dip2px(this, getResources().getDimension(R.dimen.marginMore));
    sharePre = new OptsharepreInterface(QueryDetailActivity.this);

    //		mylat = UIUtil.tryToDouble(sharePre.getPres("lat"));
    //		mylon = UIUtil.tryToDouble(sharePre.getPres("lon"));
    mylat = application.getLat();
    mylon = application.getLon();

    collectionBean = new CollectionBean();
    collectionBean.setGuid(bean.getGuid());
    collectionBean.setCreateDate();
    collectionBean.setAddPersonGuid(sharePre.getPres("guid"));
    collectionGuid = bean.getGuid() == null ? "" : bean.getGuid();
    if (flag.equals("service")) {
      collectionBean.setTypeOfCollection(6);
    } else {
      collectionBean.setTypeOfCollection(3);
    }
    collectionBean.setCollectionGuid(bean.getGuid());
    serviceCollectBean = new ServiceCollectBean();
    serviceCollectBean.setGuid(bean.getGuid());
    collectionBean.setCollection(serviceCollectBean);
  }
  @Override
  public void onClick(View v) {

    switch (v.getId()) {
      case R.id.btnNav:
        if (startPoint.getLatitude() == 0 && startPoint.getLongitude() == 0) {
          if (endPoint.getLatitude() == 0 && endPoint.getLongitude() == 0) {
            Toast.makeText(QueryDetailActivity.this, "没有具体位置信息", Toast.LENGTH_SHORT).show();
          } else {
            UIUtil.requestNav(this, endPoint);
          }

        } else {
          if (endPoint.getLatitude() == 0 && endPoint.getLongitude() == 0) {
            Toast.makeText(QueryDetailActivity.this, "没有具体位置信息", Toast.LENGTH_SHORT).show();
          } else {
            UIUtil.requestNav(this, startPoint, endPoint);
          }
        }
        break;
      case R.id.btnPhoneCall:
        UIUtil.tryToDial(this, tel);
        break;
      case R.id.btnSubmit:
        Intent intent = new Intent();
        intent.setClass(QueryDetailActivity.this, FregmentFileRepair.class);
        intent.putExtra("moduleType", ModuleType.wxgl);
        intent.putExtra("UserPositionBean", userPositionBean);
        startActivity(intent);
        break;
      default:
        break;
    }
  }
  @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);
      }
    }
  private void initUI() {
    if (null == bean) {
      UIUtil.appendNewRow(
          QueryDetailActivity.this,
          tableLayout,
          "",
          "无信息可显示",
          PADDING,
          MARGINMORE,
          getResources().getDrawable(R.drawable.round_all));
      btnNav.setVisibility(View.GONE);
      btnPhoneCall.setVisibility(View.GONE);
    } else {
      rlist = new ArrayList<String[]>();

      if (bean instanceof TaskNews) {
        try {
          tel = ((TaskNews) bean).getContactMobileNumber();
          startPoint = new LatLonPoint(mylat, mylon);
          endPoint =
              new LatLonPoint(((TaskNews) bean).getLatitude(), ((TaskNews) bean).getLongitude());
        } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
      if (null != bean) {
        if ("job".equals(flag)) {

          try {

            WorkTaskNewsBean workTaskNewsBean = ((WorkTaskNewsBean) bean);

            if (null != workTaskNewsBean.getNewsType()
                && null != workTaskNewsBean.getNewsType().getName()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getNewsType().getName())) {
                rlist.add(new String[] {"信息类别:", workTaskNewsBean.getNewsType().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "信息类别:", workTaskNewsBean.getNewsType().getName()));
              }
            }
            if (null != workTaskNewsBean.getWorkType()
                && null != workTaskNewsBean.getWorkType().getName()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getWorkType().getName())) {
                rlist.add(new String[] {"作业类型:", workTaskNewsBean.getWorkType().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "作业类型:", workTaskNewsBean.getWorkType().getName()));
              }
            }
            // if(!TextUtils.isEmpty(((WorkTaskNewsBean)bean).getMus())){
            rlist.add(new String[] {"作业面积:", workTaskNewsBean.getMus() + " 亩"});
            rlistWithDraw.add(
                TableRawUtils.newTableRawItemWithOutDraw(
                    "作业面积:", workTaskNewsBean.getMus() + " 亩"));
            // }
            // if(!TextUtils.isEmpty(((WorkTaskNewsBean)bean).getPrice()
            // )){
            rlist.add(
                new String[] {
                  "作业单价:",
                  workTaskNewsBean.getMinPrice() + "-" + workTaskNewsBean.getMaxPrice() + " 元/亩"
                });
            rlistWithDraw.add(
                TableRawUtils.newTableRawItemWithOutDraw(
                    "作业单价:",
                    workTaskNewsBean.getMinPrice()
                        + "-"
                        + workTaskNewsBean.getMaxPrice()
                        + " 元/亩"));
            // }
            if (null != workTaskNewsBean.getStartDateStr()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getStartDateStr())) {
                rlist.add(new String[] {"开始时间:", workTaskNewsBean.getStartDateStr()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "开始时间:", workTaskNewsBean.getStartDateStr()));
              }
            }
            if (null != workTaskNewsBean.getEndDateStr()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getEndDateStr())) {
                rlist.add(new String[] {"结束时间:", workTaskNewsBean.getEndDateStr()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "结束时间:", workTaskNewsBean.getEndDateStr()));
              }
            }
            if (null != workTaskNewsBean.getContactor()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getContactor())) {
                rlist.add(new String[] {"联系人:", workTaskNewsBean.getContactor()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "联系人:", workTaskNewsBean.getContactor()));
              }
            }
            if (null != workTaskNewsBean.getContactMobileNumber()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getContactMobileNumber())) {
                rlist.add(new String[] {"联系电话:", workTaskNewsBean.getContactMobileNumber()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithPhoneDraw(
                        QueryDetailActivity.this,
                        "联系电话:",
                        workTaskNewsBean.getContactMobileNumber()));
              }
            }
            if (null != workTaskNewsBean.getAdminAreaCode()
                && null != workTaskNewsBean.getAdminAreaCode().getFullName()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getAdminAreaCode().getFullName())) {
                rlist.add(
                    new String[] {"联系地址:", workTaskNewsBean.getAdminAreaCode().getFullName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithMapDraw(
                        QueryDetailActivity.this,
                        "联系地址:",
                        workTaskNewsBean.getAdminAreaCode().getFullName(),
                        startPoint,
                        endPoint));
                //								Log.wtf("测试距离de", (- workTaskNewsBean.getLatitude())*(application.getLat()
                // - workTaskNewsBean.getLatitude())+(application.getLon()-
                // workTaskNewsBean.getLongitude())*(application.getLon()-
                // workTaskNewsBean.getLongitude())+"");
              }
            }
            if (null != workTaskNewsBean.getComments()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getComments())) {
                rlist.add(new String[] {"备注信息:", workTaskNewsBean.getComments()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "备注信息:", workTaskNewsBean.getComments()));
              }
            }
          } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
          UIUtil.ctreatTableRowsWithDraw(QueryDetailActivity.this, tbLayoutNew, rlistWithDraw);
          // UIUtil.generateTableRows(QueryDetailActivity.this, table,
          // rlist);
        } else if ("jobNew".equals(flag)) {
          bottomLayout.setVisibility(View.VISIBLE);
          try {
            WorkTaskNewsBean workTaskNewsBean = ((WorkTaskNewsBean) bean);
            if (null != workTaskNewsBean.getAddPersonName()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getAddPersonName())) {
                rlist.add(new String[] {"距离:", workTaskNewsBean.getAddPersonName()});
              }
            }
            if (null != workTaskNewsBean.getContactor()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getContactor())) {
                rlist.add(new String[] {"联系人:", workTaskNewsBean.getContactor()});
              }
            }
            if (null != workTaskNewsBean.getContactMobileNumber()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getContactMobileNumber())) {
                rlist.add(new String[] {"联系电话:", workTaskNewsBean.getContactMobileNumber()});
              }
            }
            if (null != workTaskNewsBean.getWorkType()
                && null != workTaskNewsBean.getWorkType().getName()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getWorkType().getName())) {
                rlist.add(new String[] {"作业类型:", workTaskNewsBean.getWorkType().getName()});
              }
            }

            if (null != workTaskNewsBean.getNewsType()
                && null != workTaskNewsBean.getNewsType().getName()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getNewsType().getName())) {
                rlist.add(new String[] {"信息类别:", workTaskNewsBean.getNewsType().getName()});
              }
            }
            rlist.add(
                new String[] {
                  "作业单价:", workTaskNewsBean.getMinPrice() + "-" + workTaskNewsBean.getMaxPrice()
                });

            if (null != workTaskNewsBean.getEndDateStr()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getEndDateStr())) {
                rlist.add(new String[] {"结束时间:", workTaskNewsBean.getEndDateStr()});
              }
            }
            if (null != workTaskNewsBean.getAddress()) {
              if (!TextUtils.isEmpty(workTaskNewsBean.getAddress())) {
                rlist.add(new String[] {"联系地址:", workTaskNewsBean.getAddress()});
              }
            }
          } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
          UIUtil.generateTableRows(QueryDetailActivity.this, tableLayout, rlist);
        } else if ("machine".equals(flag)) {

          try {

            CarTaskNewsBean carTaskNewsBean = ((CarTaskNewsBean) bean);

            if (null != carTaskNewsBean.getNewsType()
                && null != carTaskNewsBean.getNewsType().getName()) {
              if (!TextUtils.isEmpty(carTaskNewsBean.getNewsType().getName())) {
                rlist.add(new String[] {"信息类别:", carTaskNewsBean.getNewsType().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "信息类别:", carTaskNewsBean.getNewsType().getName()));
              }
            }
            if (null != carTaskNewsBean.getCarTypeNew()
                && null != carTaskNewsBean.getCarTypeNew().getName()) {
              if (!TextUtils.isEmpty(carTaskNewsBean.getCarTypeNew().getName())) {
                rlist.add(new String[] {"农机类型:", carTaskNewsBean.getCarTypeNew().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "农机类型:", carTaskNewsBean.getCarTypeNew().getName()));
              }
            }
            if (null != carTaskNewsBean.getCropType()
                && null != carTaskNewsBean.getCropType().getName()) {
              if (!TextUtils.isEmpty(carTaskNewsBean.getCropType().getName())) {
                rlist.add(new String[] {"作物类型:", carTaskNewsBean.getCropType().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "作物类型:", carTaskNewsBean.getCropType().getName()));
              }
            }
            rlist.add(new String[] {"农机数量:", carTaskNewsBean.getCount() + " "});
            rlistWithDraw.add(
                TableRawUtils.newTableRawItemWithOutDraw(
                    "农机数量:", carTaskNewsBean.getCount() + " "));
            rlist.add(
                new String[] {
                  "作业单价:",
                  carTaskNewsBean.getMinPrice() + "-" + carTaskNewsBean.getMaxPrice() + " 元/亩"
                });
            rlistWithDraw.add(
                TableRawUtils.newTableRawItemWithOutDraw(
                    "作业单价:",
                    carTaskNewsBean.getMinPrice() + "-" + carTaskNewsBean.getMaxPrice() + " 元/亩"));
            try {
              if (null != carTaskNewsBean.getStartDateStr()) {
                if (!TextUtils.isEmpty(carTaskNewsBean.getStartDateStr())) {
                  rlist.add(new String[] {"开始时间:", carTaskNewsBean.getStartDateStr()});
                  rlistWithDraw.add(
                      TableRawUtils.newTableRawItemWithOutDraw(
                          "开始时间:", carTaskNewsBean.getStartDateStr()));
                }
              }
            } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
            if (null != carTaskNewsBean.getEndDateStr()) {
              if (!TextUtils.isEmpty(carTaskNewsBean.getEndDateStr())) {
                rlist.add(new String[] {"结束时间:", carTaskNewsBean.getEndDateStr()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "结束时间:", carTaskNewsBean.getEndDateStr()));
              }
            }
            if (null != carTaskNewsBean.getContactor()) {
              if (!TextUtils.isEmpty(carTaskNewsBean.getContactor())) {
                rlist.add(new String[] {"联系人:", carTaskNewsBean.getContactor()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "联系人:", carTaskNewsBean.getContactor()));
              }
            }
            if (null != carTaskNewsBean.getContactMobileNumber()) {
              if (!TextUtils.isEmpty(carTaskNewsBean.getContactMobileNumber())) {
                rlist.add(new String[] {"联系电话:", carTaskNewsBean.getContactMobileNumber()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithPhoneDraw(
                        QueryDetailActivity.this,
                        "联系电话:",
                        carTaskNewsBean.getContactMobileNumber()));
              }
            }
            if (null != carTaskNewsBean.getAdminAreaCode()
                && null != carTaskNewsBean.getAdminAreaCode().getFullName()) {
              if (!TextUtils.isEmpty(carTaskNewsBean.getAdminAreaCode().getFullName())) {
                rlist.add(new String[] {"联系地址:", carTaskNewsBean.getContactor()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithMapDraw(
                        QueryDetailActivity.this,
                        "联系地址:",
                        carTaskNewsBean.getAdminAreaCode().getFullName(),
                        startPoint,
                        endPoint));
              }
            } else {
              if (null != carTaskNewsBean.getAddress()) {
                if (!TextUtils.isEmpty(carTaskNewsBean.getAddress())) {
                  rlist.add(new String[] {"联系地址:", carTaskNewsBean.getAddress()});
                  rlistWithDraw.add(
                      TableRawUtils.newTableRawItemWithMapDraw(
                          QueryDetailActivity.this,
                          "联系地址:",
                          carTaskNewsBean.getAddress(),
                          startPoint,
                          endPoint));
                }
              }
            }
            //						if (null != carTaskNewsBean.getContactor()) {
            //							if (!TextUtils.isEmpty(carTaskNewsBean
            //									.getContactor())) {
            //								rlist.add(new String[] { "联系人:",
            //										carTaskNewsBean.getContactor() });
            //								rlistWithDraw
            //										.add(TableRawUtils.newTableRawItemWithOutDraw(
            //												"联系人:",
            //												carTaskNewsBean.getContactor()));
            //							}
            //						}
            if (null != carTaskNewsBean.getComments()) {
              if (!TextUtils.isEmpty(carTaskNewsBean.getComments())) {
                rlist.add(new String[] {"备注信息:", carTaskNewsBean.getComments()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "备注信息:", carTaskNewsBean.getComments()));
              }
            }
          } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
          UIUtil.ctreatTableRowsWithDraw(QueryDetailActivity.this, tbLayoutNew, rlistWithDraw);
          // UIUtil.generateTableRows(QueryDetailActivity.this, table,
          // rlist);
        } else if ("supply".equals(flag)) {

          try {

            SupplyAndDemandTaskNewsBean supplyAndDemandTaskNewsBean =
                ((SupplyAndDemandTaskNewsBean) bean);

            if (null != supplyAndDemandTaskNewsBean.getNewsType()
                && null != supplyAndDemandTaskNewsBean.getNewsType().getName()) {
              if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getNewsType().getName())) {
                rlist.add(
                    new String[] {"信息类别:", supplyAndDemandTaskNewsBean.getNewsType().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "信息类别:", supplyAndDemandTaskNewsBean.getNewsType().getName()));
              }
            }
            if (null != supplyAndDemandTaskNewsBean.getGoodsType()
                && null != supplyAndDemandTaskNewsBean.getGoodsType().getName()) {
              if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getGoodsType().getName())) {
                rlist.add(
                    new String[] {"商品类型:", supplyAndDemandTaskNewsBean.getGoodsType().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "商品类型:", supplyAndDemandTaskNewsBean.getGoodsType().getName()));
              }
            }

            if (null != supplyAndDemandTaskNewsBean.getGoodsName()) {
              if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getGoodsName())) {
                rlist.add(new String[] {"商品名称:", supplyAndDemandTaskNewsBean.getGoodsName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "商品名称:", supplyAndDemandTaskNewsBean.getGoodsName()));
              }
            }
            if (supplyAndDemandTaskNewsBean.getGoodsUnit() != null
                && null != supplyAndDemandTaskNewsBean.getGoodsUnit().getName()) {
              rlist.add(
                  new String[] {
                    "商品数量:",
                    supplyAndDemandTaskNewsBean.getCount()
                        + supplyAndDemandTaskNewsBean.getGoodsUnit().getName()
                  });
              rlistWithDraw.add(
                  TableRawUtils.newTableRawItemWithOutDraw(
                      "商品数量:",
                      supplyAndDemandTaskNewsBean.getCount()
                          + supplyAndDemandTaskNewsBean.getGoodsUnit().getName()));
            }

            if (supplyAndDemandTaskNewsBean.getGoodsUnit() != null
                && null != supplyAndDemandTaskNewsBean.getGoodsUnit().getName()) {
              rlist.add(
                  new String[] {
                    "商品单价:",
                    supplyAndDemandTaskNewsBean.getPrice()
                        + " 元/"
                        + supplyAndDemandTaskNewsBean.getGoodsUnit().getName()
                  });
              rlistWithDraw.add(
                  TableRawUtils.newTableRawItemWithOutDraw(
                      "商品单价:",
                      supplyAndDemandTaskNewsBean.getPrice()
                          + " 元/"
                          + supplyAndDemandTaskNewsBean.getGoodsUnit().getName()));
            }

            try {
              if (null != supplyAndDemandTaskNewsBean.getStartDateStr()) {
                if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getStartDateStr())) {
                  rlist.add(new String[] {"开始时间:", supplyAndDemandTaskNewsBean.getStartDateStr()});
                  rlistWithDraw.add(
                      TableRawUtils.newTableRawItemWithOutDraw(
                          "开始时间:", supplyAndDemandTaskNewsBean.getStartDateStr()));
                }
              }
            } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
            if (null != supplyAndDemandTaskNewsBean.getEndDateStr()) {
              if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getEndDateStr())) {
                rlist.add(new String[] {"结束时间:", supplyAndDemandTaskNewsBean.getEndDateStr()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "结束时间:", supplyAndDemandTaskNewsBean.getEndDateStr()));
              }
            }
            if (supplyAndDemandTaskNewsBean.getContactor() != null) {
              if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getContactor())) {
                rlist.add(new String[] {"联系人:", supplyAndDemandTaskNewsBean.getContactor()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "联系人:", supplyAndDemandTaskNewsBean.getContactor()));
              }
            }
            if (supplyAndDemandTaskNewsBean.getContactMobileNumber() != null) {
              if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getContactMobileNumber())) {
                rlist.add(
                    new String[] {"联系电话:", supplyAndDemandTaskNewsBean.getContactMobileNumber()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithPhoneDraw(
                        QueryDetailActivity.this,
                        "联系电话:",
                        supplyAndDemandTaskNewsBean.getContactMobileNumber()));
              }
            }
            if (supplyAndDemandTaskNewsBean.getAdminAreaCode() != null
                && null != supplyAndDemandTaskNewsBean.getAdminAreaCode().getFullName()) {
              if (!TextUtils.isEmpty(
                  supplyAndDemandTaskNewsBean.getAdminAreaCode().getFullName())) {
                rlist.add(
                    new String[] {
                      "联系地址:", supplyAndDemandTaskNewsBean.getAdminAreaCode().getFullName()
                    });
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithMapDraw(
                        QueryDetailActivity.this,
                        "联系地址:",
                        supplyAndDemandTaskNewsBean.getAdminAreaCode().getFullName(),
                        startPoint,
                        endPoint));
              }
            } else {
              if (null != supplyAndDemandTaskNewsBean.getAddress()) {
                if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getAddress())) {
                  rlist.add(new String[] {"联系地址:", supplyAndDemandTaskNewsBean.getAddress()});
                  rlistWithDraw.add(
                      TableRawUtils.newTableRawItemWithMapDraw(
                          QueryDetailActivity.this,
                          "联系地址:",
                          supplyAndDemandTaskNewsBean.getAddress(),
                          startPoint,
                          endPoint));
                }
              }
            }
            if (null != supplyAndDemandTaskNewsBean.getComments()) {
              if (!TextUtils.isEmpty(supplyAndDemandTaskNewsBean.getComments())) {
                rlist.add(new String[] {"备注信息:", supplyAndDemandTaskNewsBean.getComments()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "备注信息:", supplyAndDemandTaskNewsBean.getComments()));
              }
            }
          } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
          UIUtil.ctreatTableRowsWithDraw(QueryDetailActivity.this, tbLayoutNew, rlistWithDraw);
          // UIUtil.generateTableRows(QueryDetailActivity.this, table,
          // rlist);
        } else if ("service".equals(flag)) {
          try {
            // 显示地图导航和拨打电话的按钮

            startPoint = new LatLonPoint(mylat, mylon);
            endPoint =
                new LatLonPoint(
                    ((ServiceCollectBean) bean).getLatitude(),
                    ((ServiceCollectBean) bean).getLongitude());
            name = strFormat(((ServiceCollectBean) bean).getResponsiblePersonName());
            tel = strFormat(((ServiceCollectBean) bean).getResponsiblePersonmobileNumber());

            if (!TextUtils.isEmpty(((ServiceCollectBean) bean).getName())) {
              rlist.add(new String[] {"单位名称:", ((ServiceCollectBean) bean).getName()});
            }
            if (!TextUtils.isEmpty(name)) {
              rlist.add(new String[] {"联系人:", name});
            }
            if (!TextUtils.isEmpty(tel)) {
              rlist.add(new String[] {"联系电话:", tel});
            }
            if (((ServiceCollectBean) bean).getAdminAreaCode() != null
                && !TextUtils.isEmpty(
                    ((ServiceCollectBean) bean).getAdminAreaCode().getFullName())) {
              rlist.add(
                  new String[] {
                    "联系地址:", ((ServiceCollectBean) bean).getAdminAreaCode().getFullName()
                  });
            }

            // /////////////////////////// 农机驾校
            // //////////////////////////
            if (bean instanceof DrivingSchoolServiceBean) {
              tel = strFormat(((DrivingSchoolServiceBean) bean).getContactNumber());
              // rlistWithDraw.add(TableRawUtils.newTableRawItemWithPhoneDraw(
              // QueryDetailActivity.this,"联系电话:", tel ));
              showTableLine();
              if (!TextUtils.isEmpty(((DrivingSchoolServiceBean) bean).getMemo())) {
                rlist.add(new String[] {"简介:", ((DrivingSchoolServiceBean) bean).getMemo()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "简介:", ((DrivingSchoolServiceBean) bean).getMemo()));
              }
            }

            // //////////////////////// 维修站
            // //////////////////////////
            if (bean instanceof RepairServiceBean) {

              endPoint =
                  new LatLonPoint(
                      ((RepairServiceBean) bean).getLatitude(),
                      ((RepairServiceBean) bean).getLongitude());

              if (application.getIsLogin()) { // 如果是维修点就显示报修按钮
                btnSubmit.setVisibility(View.VISIBLE);
              }

              userPositionBean = new UserPositionBean();
              userPositionBean.setUserName(((ServiceCollectBean) bean).getName());
              userPositionBean.setGuid(((ServiceCollectBean) bean).getGuid());

              showTableLine();

              if (null != ((RepairServiceBean) bean).getType()
                  && !TextUtils.isEmpty(((RepairServiceBean) bean).getType().getName())) {
                rlist.add(new String[] {"类型:", ((RepairServiceBean) bean).getType().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "类型:", ((RepairServiceBean) bean).getType().getName()));
              }
              if (null != ((RepairServiceBean) bean).getGrade()
                  && !TextUtils.isEmpty(((RepairServiceBean) bean).getGrade().getName())) {
                rlist.add(new String[] {"资质:", ((RepairServiceBean) bean).getGrade().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "资质:", ((RepairServiceBean) bean).getGrade().getName()));
              }
              if (!TextUtils.isEmpty(((RepairServiceBean) bean).getMemo())) {
                rlist.add(new String[] {"简介:", ((RepairServiceBean) bean).getMemo()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "简介:", ((RepairServiceBean) bean).getMemo()));
              }
            }

            // /////////////////////// 加油站
            // //////////////////////////////
            if (bean instanceof GasStationServiceBean) {
              showTableLine();

              if (!TextUtils.isEmpty(((GasStationServiceBean) bean).getMemo())) {
                rlist.add(new String[] {"简介:", ((GasStationServiceBean) bean).getMemo()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "简介:", ((GasStationServiceBean) bean).getMemo()));
              }
            }

            // ///////////////////////// 经销商
            // ////////////////////////////
            if (bean instanceof DealerServiceBean) {

              showTableLine();
              if (null != ((DealerServiceBean) bean).getCategory()
                  && !TextUtils.isEmpty(((DealerServiceBean) bean).getCategory().getName())) {
                rlist.add(new String[] {"类型:", ((DealerServiceBean) bean).getCategory().getName()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "类型:", ((DealerServiceBean) bean).getCategory().getName()));
              }
              if (!TextUtils.isEmpty(((DealerServiceBean) bean).getMemo())) {
                rlist.add(new String[] {"简介:", ((DealerServiceBean) bean).getMemo()});
                rlistWithDraw.add(
                    TableRawUtils.newTableRawItemWithOutDraw(
                        "简介:", ((DealerServiceBean) bean).getMemo()));
              }
            }

          } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
          UIUtil.ctreatTableRowsWithDraw(QueryDetailActivity.this, tbLayoutNew, rlistWithDraw);
          // UIUtil.generateTableRows(QueryDetailActivity.this, table,
          // rlist);
        } else if ("cooper".equals(flag)) {
          try {
            // 合作社
            // 显示地图导航和拨打电话的按钮
            startPoint = new LatLonPoint(mylat, mylon);
            endPoint =
                new LatLonPoint(
                    ((CooperBean) bean).getLatitude(), ((CooperBean) bean).getLongitude());

            name = strFormat(((CooperBean) bean).getChargePerson());
            tel = strFormat(((CooperBean) bean).getTelephone());

            if (!TextUtils.isEmpty(((CooperBean) bean).getCoopName())) {
              rlist.add(new String[] {"单位名称:", ((CooperBean) bean).getCoopName()});
              serviceCollectBean.setName(((CooperBean) bean).getCoopName());
              rlistWithDraw.add(
                  TableRawUtils.newTableRawItemWithAddFavorDraw(
                      QueryDetailActivity.this,
                      "单位名称:",
                      ((CooperBean) bean).getCoopName(),
                      favorOrNot,
                      collectionBean));
            }
            if (!TextUtils.isEmpty(((CooperBean) bean).getCoopProperty().getName())) {
              rlist.add(new String[] {"类型:", ((CooperBean) bean).getCoopProperty().getName()});
              rlistWithDraw.add(
                  TableRawUtils.newTableRawItemWithOutDraw(
                      "类型:", ((CooperBean) bean).getCoopProperty().getName()));
            }
            if (!TextUtils.isEmpty(name)) {
              rlist.add(new String[] {"联系人:", name});
              rlistWithDraw.add(TableRawUtils.newTableRawItemWithOutDraw("联系人:", name));
            }
            if (!TextUtils.isEmpty(tel)) {
              rlist.add(new String[] {"联系电话:", tel});
              rlistWithDraw.add(
                  TableRawUtils.newTableRawItemWithPhoneDraw(
                      QueryDetailActivity.this, "联系电话:", tel));
            }

            if (((CooperBean) bean).getAdminAreaCode() != null
                && !TextUtils.isEmpty(((CooperBean) bean).getAdminAreaCode().getFullName())) {
              rlist.add(
                  new String[] {"联系地址:", ((CooperBean) bean).getAdminAreaCode().getFullName()});
              rlistWithDraw.add(
                  TableRawUtils.newTableRawItemWithMapDraw(
                      QueryDetailActivity.this,
                      "联系地址:",
                      ((CooperBean) bean).getAdminAreaCode().getFullName(),
                      startPoint,
                      endPoint));
            }
            if (!TextUtils.isEmpty(((CooperBean) bean).getIntroduction())) {
              rlist.add(new String[] {"简介:", ((CooperBean) bean).getIntroduction()});
              rlistWithDraw.add(
                  TableRawUtils.newTableRawItemWithOutDraw(
                      "简介:", ((CooperBean) bean).getIntroduction()));
            }
          } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
          bottomLayout.setVisibility(View.GONE);
          UIUtil.ctreatTableRowsWithDraw(QueryDetailActivity.this, tbLayoutNew, rlistWithDraw);
          return;
          // UIUtil.generateTableRows(QueryDetailActivity.this, table,
          // rlist);
        } else if ("njbt".equals(flag)) {
          if (!TextUtils.isEmpty(((NjBuTie) bean).getGuid()))
            new NJBTAsysTask().execute(((NjBuTie) bean).getGuid());
        }
      }
    }
  }