Пример #1
0
  /**
   * 查询评分结果
   *
   * @param companyId
   */
  private void queryRating(String companyId) {
    // 需要在当前主线程:UI线程中启动新线程调用接口
    Handler handler =
        new Handler(
            new Handler.Callback() {
              @Override
              public boolean handleMessage(Message msg) {
                if (msg.what == MessageType.QUERY_RATING.getType()) {
                  Bundle bundle = msg.getData();
                  String resultCode = bundle.getString(Constants.RESULT_CODE);
                  String resultMessage = bundle.getString(Constants.RESULT_MESSAGE);
                  if (ResultCodes.SUCCESS.getCode().equals(resultCode)) {
                    String mark_sale_score = bundle.getString(Constants.MEMBER_MARK_SALE_SCORE);
                    String mark_capital_score =
                        bundle.getString(Constants.MEMBER_MARK_CAPITAL_SCORE);
                    String mark_years_score = bundle.getString(Constants.MEMBER_MARK_YEARS_SCORE);
                    String mark_experience_score =
                        bundle.getString(Constants.MEMBER_MARK_EXPERIENCE_SCORE);
                    String mark_size_score = bundle.getString(Constants.MEMBER_MARK_SIZE_SCORE);
                    String mark_worth_score = bundle.getString(Constants.MEMBER_MARK_WORTH_SCORE);
                    StringBuilder builder =
                        new StringBuilder()
                            .append("年销量评分值: ")
                            .append(mark_sale_score)
                            .append(",")
                            .append("注册资本评分值: ")
                            .append(mark_capital_score)
                            .append(",")
                            .append("成立年限评分值: ")
                            .append(mark_years_score)
                            .append(",")
                            .append("管理者行业经验评分值: ")
                            .append(mark_experience_score)
                            .append(",")
                            .append("团队规模评分值: ")
                            .append(mark_size_score)
                            .append(",")
                            .append("家庭净资产评分值: ")
                            .append(mark_worth_score);
                    Toast.makeText(
                            MainActivity.this, "查询评分结果:" + builder.toString(), Toast.LENGTH_LONG)
                        .show();
                  } else {
                    Toast.makeText(MainActivity.this, "评分失败:" + resultMessage, Toast.LENGTH_LONG)
                        .show();
                  }
                }
                return false;
              }
            });

    MemberRatingQueryResponseHandler memberRatingQueryResponseHandler =
        new MemberRatingQueryResponseHandler(handler);
    MemberApplyManager memberApplyManager = new MemberApplyManagerImpl();
    memberApplyManager.findMemberRatingResult(companyId, memberRatingQueryResponseHandler);
  }
Пример #2
0
  /** 查询会员列表 */
  private void search() {
    // 需要在当前主线程:UI线程中启动新线程调用接口
    Handler handler =
        new Handler(
            new Handler.Callback() {
              @Override
              public boolean handleMessage(Message msg) {
                if (msg.what == MessageType.MEMAPP_QUERY.getType()) {
                  Bundle bundle = msg.getData();
                  String resultCode = bundle.getString(Constants.RESULT_CODE);
                  String resultMessage = bundle.getString(Constants.RESULT_MESSAGE);
                  if (ResultCodes.SUCCESS.getCode().equals(resultCode)) {
                    MemberApplyParcelable applyParcelable =
                        bundle.getParcelable(Constants.MEMBER_APPLY_RESULT);
                    List<MemberApplyBo> memberApplyBos = applyParcelable.getMemApplyBos();
                    if (memberApplyBos != null) {
                      for (Iterator<MemberApplyBo> iter = memberApplyBos.iterator();
                          iter.hasNext(); ) {
                        Log.v(TAG, iter.next().toString());
                      }
                      Toast.makeText(
                              MainActivity.this,
                              "共查询" + memberApplyBos.size() + "条记录",
                              Toast.LENGTH_LONG)
                          .show();
                    }
                  } else {

                    Toast.makeText(MainActivity.this, "查询失败:" + resultMessage, Toast.LENGTH_LONG)
                        .show();
                  }
                }
                return false;
              }
            });

    MemberApplyQueryResponseHandler queryResponseHandler =
        new MemberApplyQueryResponseHandler(handler);

    MemberApplyManager memberApplyManager = new MemberApplyManagerImpl();
    memberApplyManager.findMemberApplyBoListByOperatorId("1", 1, queryResponseHandler);
  }
Пример #3
0
  /**
   * 查询上传图片记录
   *
   * @param memAppId 会员申请ID
   * @param fileCateCode 认证资料类别编码
   */
  private void queryUploadMaterial(Integer memAppId, String fileCateCode) {

    // 需要在当前主线程:UI线程中启动新线程调用接口
    Handler handler =
        new Handler(
            new Handler.Callback() {
              @Override
              public boolean handleMessage(Message msg) {
                if (msg.what == MessageType.QUERY_UPLOAD.getType()) {
                  Bundle bundle = msg.getData();
                  String resultCode = bundle.getString(Constants.RESULT_CODE);
                  String resultMessage = bundle.getString(Constants.RESULT_MESSAGE);
                  if (ResultCodes.SUCCESS.getCode().equals(resultCode)) {
                    MemberAuthFile[] MemberAuthFiles = MemberAuthFile.values();
                    for (MemberAuthFile memberAuthFile : MemberAuthFiles) {
                      ArrayList<String> filePaths =
                          bundle.getStringArrayList(memberAuthFile.getValue());
                      if (filePaths != null && !filePaths.isEmpty()) {
                        Log.v(TAG, filePaths.toString());
                        String text =
                            "查询上传记录:" + memberAuthFile.getValue() + ", " + filePaths.size() + "条";
                        Toast.makeText(MainActivity.this, text, Toast.LENGTH_LONG).show();
                      }
                    }
                  } else {
                    Toast.makeText(
                            MainActivity.this, "查询上传记录失败:" + resultMessage, Toast.LENGTH_LONG)
                        .show();
                  }
                }
                return false;
              }
            });

    UploadMaterialQueryResponseHandler uploadMaterialQueryResponseHandler =
        new UploadMaterialQueryResponseHandler(handler);

    MemberApplyManager memberApplyManager = new MemberApplyManagerImpl();
    memberApplyManager.findMemberAuthFileUploadsByCondition(
        memAppId, fileCateCode, uploadMaterialQueryResponseHandler);
  }
Пример #4
0
  /**
   * 登录
   *
   * @param userId 登录账号
   * @param password 登录密码
   */
  private void login(String userId, String password) {
    Handler handler =
        new Handler(
            new Handler.Callback() {
              @Override
              public boolean handleMessage(Message msg) {
                if (msg.what == MessageType.LOGIN.getType()) {
                  Bundle bundle = msg.getData();
                  String resultCode = bundle.getString(Constants.RESULT_CODE);
                  Log.v(TAG, resultCode);

                  String resultMsg = bundle.getString(Constants.RESULT_MESSAGE);
                  Toast.makeText(MainActivity.this, resultMsg, Toast.LENGTH_LONG).show();
                }
                return false;
              }
            });
    LoginResponseHandler loginResponseHandler = new LoginResponseHandler(handler);
    MemberApplyManager memberApplyManager = new MemberApplyManagerImpl();
    memberApplyManager.doLogin(userId, password, loginResponseHandler);
  }