/**
  *
  *
  * <pre>解析封装职位分类列表  </pre>
  *
  * @param array JsonArray
  * @return
  * @throws JSONException
  */
 private static List<PositionClassify> parsePositionClassList(JSONArray array, String pcode)
     throws JSONException {
   List<PositionClassify> positionClasss = null;
   if (!StringUtils.isEmpty(array)) {
     int nn = array.size();
     PositionClassify positionClassify = null;
     positionClasss = new ArrayList<PositionClassify>(nn);
     for (int i = 0; i < nn; i++) {
       JSONObject jObject = array.getJSONObject(i);
       positionClassify = new PositionClassify();
       String code = jObject.getString("code");
       positionClassify.setCode(code);
       positionClassify.setPcode(pcode);
       positionClassify.setValue(jObject.getString("value"));
       boolean has = jObject.getIntValue("hassub") == 1;
       positionClassify.setHasSub(has);
       if (has) {
         JSONArray subArray = jObject.getJSONArray("sublist");
         if (!StringUtils.isEmpty(subArray)) {
           positionClassify.setSubList(parsePositionClassList(subArray, code));
         }
       }
       positionClasss.add(positionClassify);
       mapPositionClassifies.put(code, positionClassify);
     }
   }
   return positionClasss;
 }
 /**
  *
  *
  * <pre>解析职位分类列表 </pre>
  */
 public static void parsePositionClass() {
   if (!StringUtils.isEmpty(jarray_positions)) {
     mapPositionClassifies = new HashMap<String, PositionClassify>(jarray_positions.size());
     try {
       positionClassifies = parsePositionClassList(jarray_positions, null);
     } catch (JSONException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
 }
Пример #3
0
 /* (non-Javadoc)
  * @see java.lang.Runnable#run()
  */
 @Override
 public void run() {
   // TODO Auto-generated method stub
   if (!StringUtils.isEmpty(kwss)) {
     keywords = controller.getKeywords(null, kwss, scope);
     if (keywords == null) {
       sendMessage(GET_KEYWORDS_FAIL);
     } else {
       sendMessage(GET_KEYWORDS_SUCCESS);
     }
   }
 }
Пример #4
0
  private void initView() {
    goback = (ImageButton) findViewById(R.id.goback);
    save = (Button) findViewById(R.id.btn_save);
    rela_salary_mode = (LinearLayout) findViewById(R.id.rela_salary_mode);
    txt_salary_mode = (TextView) findViewById(R.id.txt_salary_mode);
    rela_salary_currency = (LinearLayout) findViewById(R.id.rela_salary_currency);
    txt_salary_currency = (TextView) findViewById(R.id.txt_salary_currency);
    rela_salary_scope = (LinearLayout) findViewById(R.id.rela_salary_scope);
    txt_salary_scope = (TextView) findViewById(R.id.txt_salary_scope);
    cbx = (CheckBox) findViewById(R.id.cbx);
    goback.setOnClickListener(listener);
    save.setOnClickListener(listener);
    rela_salary_currency.setOnClickListener(listener);
    rela_salary_mode.setOnClickListener(listener);
    rela_salary_scope.setOnClickListener(listener);
    mode_code =
        JobFavoriteActivity.desiredJob.desired_salary_mode_key == null
            ? "1"
            : JobFavoriteActivity.desiredJob.desired_salary_mode_key;
    mode_value =
        JobFavoriteActivity.desiredJob.desired_salary_mode_value == null
            ? "月薪"
            : JobFavoriteActivity.desiredJob.desired_salary_mode_value;
    currency_code =
        JobFavoriteActivity.desiredJob.desired_salary_currency_key == null
            ? "1"
            : JobFavoriteActivity.desiredJob.desired_salary_currency_key;
    currency_value =
        JobFavoriteActivity.desiredJob.desired_salary_currency_value == null
            ? "人民币"
            : JobFavoriteActivity.desiredJob.desired_salary_currency_value;
    scope_code =
        JobFavoriteActivity.desiredJob.desired_salary_key == null
            ? "1"
            : JobFavoriteActivity.desiredJob.desired_salary_key;
    scope_value =
        JobFavoriteActivity.desiredJob.desired_salary_value == null
            ? "不限"
            : JobFavoriteActivity.desiredJob.desired_salary_value;
    is_show =
        JobFavoriteActivity.desiredJob.desired_salary_is_show == null
            ? "2"
            : JobFavoriteActivity.desiredJob.desired_salary_is_show;
    cbx.setChecked(is_show.contains("2"));
    txt_salary_mode.setText(mode_value);
    txt_salary_currency.setText(currency_value);
    txt_salary_scope.setText(
        (!StringUtils.isEmpty(scope_value) & scope_value.contains("50000-1000000"))
            ? "50000以上"
            : scope_value);
    cbx.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {

          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            // TODO Auto-generated method stub
            if (isChecked) {
              is_show = "2";
            } else {
              is_show = "1";
            }
          }
        });
  }