Exemplo n.º 1
0
  /** 店铺今日收入 */
  public void getShopAccountToday() {
    String reqTime = AbDateUtil.getDateTimeNow();
    String uuid = AbStrUtil.getUUID();
    try {
      okHttpsImp.getTodayShopIncome(
          OkHttpsImp.md5_key,
          uuid,
          "app",
          reqTime,
          userShopInfoBean.getBusinessId(),
          userShopInfoBean.getUserId(),
          new MyResultCallback<String>() {

            @Override
            public void onResponseResult(Result result) {
              String reString = result.getData();
              if (!TextUtils.isEmpty(reString)) {
                mShopinComeToday =
                    BigDecimal.valueOf(Long.valueOf(result.getData()))
                        .divide(new BigDecimal(100))
                        .doubleValue();
              }
              ((FinancialOfficeFragment) fm_caiwushi).setPriceTotal(mShopinComeToday, 4);
            }

            @Override
            public void onResponseFailed(String msg) {}
          });
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Exemplo n.º 2
0
  private void postClientId() {
    if (!TextUtils.isEmpty(userShopInfoBean.getBusinessId())) {
      /** 获取手机唯一识别码CID */
      if (PushManager.getInstance().getClientid(this) != null) {
        mClientId = PushManager.getInstance().getClientid(this);
      }
      String reqTime = AbDateUtil.getDateTimeNow();
      String uuid = AbStrUtil.getUUID();
      System.out.println("向服务器发送手机识别码" + mClientId);
      try {
        okHttpsImp.postPhoneClientId(
            uuid,
            "app",
            reqTime,
            userShopInfoBean.getUserId(),
            userShopInfoBean.getBusinessId(),
            mClientId,
            "01",
            new MyResultCallback<String>() {

              @Override
              public void onResponseResult(Result result) {}

              @Override
              public void onResponseFailed(String msg) {}
            });
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
Exemplo n.º 3
0
  /** status 1:已更新;2:自定义更新;3:必须更新 */
  private void getUpData() {
    final String vName = AbAppUtil.getAppVersionName(this);
    String reqTime = AbDateUtil.getDateTimeNow();
    String uuid = AbStrUtil.getUUID();
    try {
      okHttpsImp.getEdition(
          uuid,
          "app",
          reqTime,
          vName,
          new MyResultCallback<String>() {

            @Override
            public void onResponseResult(Result result) {

              final AppUpDataBean uB =
                  com.alibaba.fastjson.JSONObject.parseObject(
                      result.getData(), AppUpDataBean.class);
              String status = uB.getCoerceModify();

              if (status.equals("Y")) {
                mustUp = true;
                DialogCommon dialogCommon =
                    new DialogCommon(MainActivity.this) {

                      @Override
                      public void onOkClick() {
                        mustUp = false;
                        downApp(uB);
                        dismiss();
                      }

                      @Override
                      public void onCheckClick() {
                        dismiss();
                      }
                    };
                dialogCommon.setOnDismissListener(
                    new OnDismissListener() {

                      @Override
                      public void onDismiss(DialogInterface arg0) {
                        if (mustUp) {
                          MainActivity.this.exit();
                        }
                      }
                    });
                dialogCommon.setTextTitle("必须更新了:" + uB.getVersion());
                dialogCommon.setTv_dialog_common_ok("更新");
                dialogCommon.setTv_dialog_common_cancelV(View.GONE);
                dialogCommon.show();
              } else if (status.equals("N")) {
                String edition = "V" + vName;
                if (!edition.equals(uB.getVersion())) {
                  DialogCommon dialogCommon =
                      new DialogCommon(MainActivity.this) {

                        @Override
                        public void onOkClick() {
                          dismiss();
                          downApp(uB);
                        }

                        @Override
                        public void onCheckClick() {
                          dismiss();
                        }
                      };
                  dialogCommon.setTextTitle("有更新了:" + uB.getVersion());
                  dialogCommon.setTv_dialog_common_ok("更新");
                  dialogCommon.setTv_dialog_common_cancel("取消");
                  dialogCommon.show();
                }
              }
            }

            @Override
            public void onResponseFailed(String msg) {}
          });
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }