示例#1
0
  /**
   * 非跳转类账户充值
   *
   * @param accesstype 接入方式 B表示web,W表示wap,C表示客户端
   * @param mobile_code 登录的手机号码
   * @param cardType 支付方式
   * @param transaction_money 充值金额 (分为单位)
   * @param totalAmount 卡面值
   * @param card_no 卡号
   * @param card_pwd 卡密码
   * @param bankId 银行标识
   * @param expand 扩展参数
   * @param sessionid
   * @return
   */
  public static String attemperRequest(
      String accesstype,
      String mobile_code,
      String cardType,
      String transaction_money,
      String totalAmount,
      String card_no,
      String card_pwd,
      String bankId,
      String expand,
      String sessionid) {
    String reValue = "";
    String action = "attemper.do";
    String method = "attemperRequest";
    String para = "";
    try {
      Random rdm = new Random();
      int transctionId = rdm.nextInt();
      JSONObject paras = new JSONObject();
      paras.put("inputCharset", 2);
      paras.put("version", "v2.0");
      paras.put("language", 1);
      paras.put("transctionid", transctionId);

      paras.put("accesstype", accesstype);
      paras.put("mobile_code", mobile_code);
      paras.put("cardType", cardType);
      paras.put("transaction_money", transaction_money);
      paras.put("totalAmount", totalAmount);
      paras.put("card_no", card_no);
      paras.put("card_pwd", card_pwd);
      paras.put("bankId", bankId);
      paras.put("expand", expand);
      paras.put("channel", Constants.COOP_ID);

      Log.e("para=================", paras.toString());
      para = URLEncoder.encode(paras.toString());

      String temp =
          Constants.SERVER_URL
              + action
              + ";jsessionid="
              + sessionid
              + "?method="
              + method
              + "&jsonString="
              + para;

      temp = GT.encodingString(temp, "GBK", "UTF-8");
      String re = InternetUtils.GetMethodOpenHttpConnect(temp);
      if (re != null && re.length() > 0) {
        reValue = re;
      }
    } catch (Exception e) {

    }

    return reValue;
  }
示例#2
0
 public String alipaySignNet() {
   JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
   try {
     jsonProtocol.put(ProtocolManager.COMMAND, "login");
     jsonProtocol.put(ProtocolManager.REQUESTTYPE, "alipaySign");
     return InternetUtils.GetMethodOpenHttpConnectSecurity(
         Constants.LOT_SERVER, jsonProtocol.toString());
   } catch (JSONException e) {
     e.printStackTrace();
   }
   return "";
 }
示例#3
0
 public String queryCashNet(String cashdetailId) {
   JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
   try {
     jsonProtocol.put(ProtocolManager.COMMAND, "getCash");
     jsonProtocol.put(ProtocolManager.CASHTYPE, "cashDetail");
     jsonProtocol.put(ProtocolManager.CASHDETAILID, cashdetailId);
     return InternetUtils.GetMethodOpenHttpConnectSecurity(
         Constants.LOT_SERVER, jsonProtocol.toString());
   } catch (JSONException e) {
     e.printStackTrace();
   }
   return "";
 }
示例#4
0
  /**
   * 获取所有的开奖信息
   *
   * @return
   */
  public JSONObject getLotteryAllNotice() {
    String result = "";
    try {
      JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
      jsonProtocol.put(ProtocolManager.COMMAND, COMMAND);
      result =
          InternetUtils.GetMethodOpenHttpConnectSecurity(
              Constants.LOT_SERVER, jsonProtocol.toString());
      return new JSONObject(result);
    } catch (JSONException e) {
      e.printStackTrace();
      // 联网失败了
    }

    return null;
  }
  /** 提交服务器反馈内容 */
  public static String feedback(String feedbackContent, String userno) {
    String reValue = "";
    try {

      JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
      jsonProtocol.put(ProtocolManager.COMMAND, COMMAND);
      jsonProtocol.put(ProtocolManager.FEEDBACK_CONTENT, feedbackContent);
      jsonProtocol.put(ProtocolManager.USERNO, userno);
      reValue =
          InternetUtils.GetMethodOpenHttpConnectSecurity(
              Constants.LOT_SERVER, jsonProtocol.toString());
    } catch (Exception e) {
      //			Log.e(TAG, "softwareupeate error");
    }
    return reValue;
  }
  /**
   * 查询DNA充值的方法
   *
   * @param phonenum  公共常量:用户手机号
   * @param sessionid  公共常量:服务器返回的sessionid
   * @param userno  公共常量:用户的userno
   * @return error_code 如果error_code为"000047"为message="无记录";如果error_code为"070002", message="未登录"
   *     如果error_code为"999999",message="操作失败";如果error_code为"000000" ,message="成功" *
   */
  public String queryintegration(String phonenum, String sessionid, String userno) {
    JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
    try {
      jsonProtocol.put(ProtocolManager.COMMAND, COMMAND);
      jsonProtocol.put(ProtocolManager.USERNO, userno);
      jsonProtocol.put(ProtocolManager.TYPE, "userCenter");
      jsonProtocol.put(ProtocolManager.SESSIONID, sessionid);
      jsonProtocol.put(ProtocolManager.PHONE_NUM, phonenum);
      return InternetUtils.GetMethodOpenHttpConnectSecurity(
          Constants.LOT_SERVER, jsonProtocol.toString());

    } catch (JSONException e) {
      e.printStackTrace();
    }

    return "";
  }
  /** 检测是否更新新版本 statInfo 统计信息 */
  public String softwareupdate(JSONObject statInfo) {
    String reValue = "";
    try {
      JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
      jsonProtocol.put(ProtocolManager.COMMAND, COMMAND);
      if (statInfo != null) {
        // 有统计信息
        jsonProtocol.put(ProtocolManager.GAME_STATINFO, statInfo);
      }
      reValue =
          InternetUtils.GetMethodOpenHttpConnectSecurity(
              Constants.LOT_SERVER, jsonProtocol.toString());
    } catch (Exception e) {
      Log.e(TAG, "softwareupeate error");
    }

    return reValue;
  }
  /**
   * 根据彩种和彩种的期号来获取本期号对应的开奖详情
   *
   * @param lotno 彩种编号
   * @param batchcode 彩种的期号
   * @return 返回一个还有开奖详情相关数据的JSONObject对象
   */
  public JSONObject getNoticePrizeDetail(String lotno, String batchcode) {
    String result = "";
    try {
      JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
      jsonProtocol.put(ProtocolManager.COMMAND, COMMAND);
      jsonProtocol.put(ProtocolManager.TYPE, "winInfoDetail");
      jsonProtocol.put(ProtocolManager.LOTNO, lotno);
      jsonProtocol.put(ProtocolManager.BATCHCODE, batchcode);
      result =
          InternetUtils.GetMethodOpenHttpConnectSecurity(
              Constants.LOT_SERVER, jsonProtocol.toString());
      return new JSONObject(result);
    } catch (Exception e) {
      // TODO: handle exception
    }

    return null;
  }
  /**
   * 积分明细
   *
   * @param userno 用户编号 用户注册成功返回的用户编号<br>
   * @param startline 开始条数<br>
   * @param stopline 截止条数<br>
   * @param pageindex 第几页,比如第二页,pageindex=2<br>
   * @param sessionid <br>
   * @return error_code | message <br>
   *     000000 |成功<br>
   *     000047 |无记录<br>
   *     999999 |操作失败<br>
   *     type_memo : 交易类型<br>
   *     amount :变动金额 金额单位为分<br>
   *     plattime : 交易时间 <br>
   */
  public String setupnickname(String userno, String nickname) {

    JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
    try {
      jsonProtocol.put(ProtocolManager.COMMAND, COMMAND);
      jsonProtocol.put(ProtocolManager.USERNO, userno);
      jsonProtocol.put(ProtocolManager.TYPE, "updateNickName");
      //			jsonProtocol.put(ProtocolManager.PHONE_NUM, phonenum);
      jsonProtocol.put("nickName", nickname);

      return InternetUtils.GetMethodOpenHttpConnectSecurity(
          Constants.LOT_SERVER, jsonProtocol.toString());

    } catch (JSONException e) {
      e.printStackTrace();
    }

    return "";
  }
  /** 合买详情的方法 */
  public static String queryLotJoincanyu(
      String id, String userno, String phone, String pageIndex, String maxrsult) {

    JSONObject jsonProtocol = ProtocolManager.getInstance().getDefaultJsonProtocol();
    try {
      jsonProtocol.put(ProtocolManager.COMMAND, COMMAND);
      jsonProtocol.put(ProtocolManager.TYPE, "caseLotBuys");
      jsonProtocol.put(ProtocolManager.CASEID, id);
      jsonProtocol.put(ProtocolManager.USERNO, userno);
      jsonProtocol.put(ProtocolManager.PHONE_NUM, phone);
      jsonProtocol.put(ProtocolManager.PAGEINDEX, pageIndex);
      jsonProtocol.put(ProtocolManager.MAXRESULT, maxrsult);

      return InternetUtils.GetMethodOpenHttpConnectSecurity(
          Constants.LOT_SERVER, jsonProtocol.toString());

    } catch (JSONException e) {
      e.printStackTrace();
    }

    return "";
  }