@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
 protected CollectionBean doInBackground(Void... params) {
   try {
     ClientContext context = app.getClientContext();
     if (null == context) {
       context =
           ClientContext.getClientContext(
               Constants.SERVER_URL, Constants.ANONYMOUS, Constants.ANONYMOUS);
       app.setClientContext(context);
     }
     ICollectionManager manager = context.getManager(ICollectionManager.class);
     collectionBean = manager.findByCollectionGuid(collectionGuid, addPersonGuid);
   } catch (Exception e) {
   }
   return collectionBean;
 }
  @Override
  protected String doInBackground(Void... params) {
    // TODO Auto-generated method stub
    ClientContext context;
    String result = "";
    try {
      context = application.getClientContext();
      if (null == context) {
        context =
            ClientContext.getClientContext(
                Constants.SERVER_URL, Constants.ANONYMOUS, Constants.ANONYMOUS);
        application.setClientContext(context);
      }
      IKindsOfCarManager manager = context.getManager(IKindsOfCarManager.class);
      KindsOfCarBean[] kindsOfCarBeanArray = manager.getChildren(0L); // 获取到农机大类
      if (null != kindsOfCarBeanArray && kindsOfCarBeanArray.length > 0) {
        for (int j = 0; j < kindsOfCarBeanArray.length; j++) {
          agriculturalBCategoryList.add(kindsOfCarBeanArray[j]); // 将所有农机大类转存到List中
          KindsOfCarBean[] mapsNJ_XL = manager.getChildren(kindsOfCarBeanArray[j].getCode());
          for (int i = 0; i < mapsNJ_XL.length; i++) {
            if (null != mapsNJ_XL[i]) {
              agriculturalSCategoryList.add(mapsNJ_XL[i]); // 将所有农机小类转存到List中
              KindsOfCarBean[] mapsNJ_PM = manager.getChildren(mapsNJ_XL[i].getCode());
              for (int k = 0; k < mapsNJ_PM.length; k++) {
                if (null != mapsNJ_PM[k]) {
                  agriculturalPCategoryList.add(mapsNJ_PM[k]); // 将所有农机品目转存到List中
                }
              }
            }
          }
        }
      }

    } catch (LoginException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      result = e.getMessage();
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      result = "服务端异常,请稍后重试";
    }
    return result;
  }
  @SuppressWarnings("unchecked")
  @Override
  protected ArrayList<ServiceCollectBean> doInBackground(Void... params) {
    ArrayList<ServiceCollectBean> seviceCollectList = new ArrayList<ServiceCollectBean>();
    LoadOnGetList<? extends ServiceCollectBean> jobnewslist =
        new LoadOnGetList<ServiceCollectBean>();
    try {
      ClientContext context = application.getClientContext();
      if (!application.getIsLogin()) {
        context = null;
      }
      if (null == context) {
        context =
            ClientContext.getClientContext(
                Constants.SERVER_URL, Constants.ANONYMOUS, Constants.ANONYMOUS);
        application.setClientContext(context);
      }

      long code = 0;
      if (null != xzqh) {
        code = xzqh.getCode();
      } else {
        code = 0;
      }
      key.setAdminAreaCode(code);
      IServiceCollectManager manager = context.getManager(IServiceCollectManager.class);
      if (clz[idxInfoType] == DrivingSchoolServiceBean.class) {
        key.setRoleCode(15);
      }
      jobnewslist = manager.getLoad(clz[idxInfoType], key);
      seviceCollectList = (ArrayList<ServiceCollectBean>) jobnewslist.getList();

    } catch (Exception e) {
      if (null != pd) {
        pd.dismiss();
      }

      e.printStackTrace();
    }

    return seviceCollectList;
  }
  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());
        }
      }
    }
  }