Exemplo n.º 1
0
  /** 更新资料编辑 */
  protected void updateInfoData() {
    getUserData();
    // 添加要上传的图片
    // addUploadImages();

    // 判断用户是否修改了资料
    if (mNewUserBean.equals(mOldUserBean) && Bimp.imgPath.size() == 0) {
      showLongToast(getString(R.string.eidt_info_tip_msg));
      return;
    }
    // 设置用户操作的动作码
    PreferencesUtil.setSteps(Constants.Step.SAVE);
    mNewUserBean.imgList = Bimp.getUploadImg();
    // 提交编辑请求
    // AsyncHttpService.modifyUserInfo(mNewUserBean, imgList,
    AsyncHttpService.modifyUserInfo(
        mNewUserBean,
        new JsonHttpResponseHandler() {

          @Override
          public void onStart() {
            showLoadDialog((R.string.is_submitted_ellipsis));
            super.onStart();
          }

          @Override
          public void onFailure(
              int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
            super.onFailure(statusCode, headers, throwable, errorResponse);
            showLongToast(getString(R.string.httpisNull));
            mDialogLoading.dismiss();
          }

          @Override
          public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
            Log.d(TAG, "info: " + response.toString());
            dismissLoadDialog();
            super.onSuccess(statusCode, headers, response);
            try {
              if (UtilsError.isErrorCode(EditInfoActivity.this, response)) {
                return;
              }

              PreferencesUtil.putValue(PreferencesUtil.KEY_USER_NAME, mNewUserBean.userName);
              showLongToast(R.string.data_editor_success);
              thisFinish();

            } catch (Exception e) {
              dismissLoadDialog();
              e.printStackTrace();
              ErrLogUtils.uploadErrLog(EditInfoActivity.this, ErrLogUtils.toString(e));
            }
          }
        },
        this);
  }
Exemplo n.º 2
0
 private void initBaseData() {
   // test is third party
   isThirdParty = false;
   mThirdOrderList = new ArrayList<String>();
   // init store data;
   if (TextUtils.isEmpty(PreferencesUtil.user_company)) {
     PreferencesUtil.initStoreData();
   }
   // get Order data , copy order data;
   mOrderModel =
       (ExecuteAction) getIntent().getExtras().getSerializable(Constants.Feild.KEY_ACTION);
   mNewOrder = (ExecuteAction) UtilsJava.depthClone(mOrderModel);
   // get Scan Model;
   String options = PreferencesUtil.getValue(Constants.Feild.KEY_OPTIONS);
   if (!TextUtils.isEmpty(options)) {
     try {
       JSONObject jsonObject = new JSONObject(options);
       if (!jsonObject.isNull("scanModel")) mScanModel = jsonObject.getString("scanModel");
     } catch (JSONException e) {
       e.printStackTrace();
     }
   }
 }
Exemplo n.º 3
0
  /**
   * 扫描完成后,用户点击下一步的响应事件
   *
   * @param view
   */
  public void completeScan(View view) {
    saveOperateLog(((Button) view).getText().toString(), null);
    if (scanList.size() == 0) {
      String msg = String.format(getString(R.string.please_add_x_commit), PreferencesUtil.ordtitle);
      // "请添加" +PreferencesUtil.ordtitle + "后再提交",
      showShortToast(msg);
      return;
    }
    String fromType = getIntent().getStringExtra(OrderActionActivity.FILED_TYPE_FROM);
    PreferencesUtil.setSteps(Constants.Step.NEXT);

    // // 将List转化为Set,去除重复订单数据
    // Set<String> set = new HashSet<String>();
    // set.addAll(scanList);
    Log.e(TAG, mScanModel + ">>" + scanList.size() + ">>" + scanList);
    // if (scanList.size() == 1) {
    if (TextUtils.equals(fromType, OrderActionActivity.VALUE_FROM_ACCIDENT)) {
      startToAccident();
    } else if (scanList.size() == 1 && TextUtils.equals(Constants.Value.STATUS_OK, mScanModel)) {
      requestIsUpdate();
    } else {
      startOrderExecute();
    }
  }