Exemplo n.º 1
0
  /**
   * 获得用户押金信息
   *
   * @param appKey
   * @param IMEI
   * @param moneyType 若输入资金类型(1密点、2微点、3(微点和密点同时返回)),
   *     4保险金,按实际金额做返回;(在原有的moneyType类型上添加)5密点的实际金额(单位:元)、 6微点的实际金额(单位:元),无资金类型参数(微点和密点的实际金额(单位:元))
   * @return
   */
  @ResponseBody
  @RequestMapping("/getUserDepositInfo")
  public String getUserDepositInfo(String appKey, String IMEI, Short moneyType) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.getUserDepositInfo(appkey, secret, IMEI, moneyType, getUserDepositInfo);
      JSONObject resultJson = JSONObject.fromObject(result).getJSONObject("RESULT");
      String returnType = resultJson.getString("returnType");
      if (("2").equals(returnType)) {
        resultJson.put("depositType", "2");
        result = JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_OK, resultJson);
      }
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 2
0
  /**
   * 获得押金历史
   *
   * @param appKey
   * @param IMEI
   * @param startTime
   * @param endTime
   * @param startPage
   * @param pageCount
   * @param moneyType 若输入资金类型(1密点、2微点、3(微点和密点同时返回)),
   *     4保险金,按实际金额做返回;(在原有的moneyType类型上添加)5密点的实际金额(单位:元)、 6微点的实际金额(单位:元),无资金类型参数(微点和密点的实际金额(单位:元))
   * @return
   */
  @ResponseBody
  @RequestMapping("/fetchDepositHisotry")
  public String fetchDepositHisotry(
      String appKey,
      String IMEI,
      String startTime,
      String endTime,
      String startPage,
      String pageCount,
      Short moneyType,
      HttpServletResponse response) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.fetchDepositHisotry(
              appkey,
              secret,
              IMEI,
              startTime,
              endTime,
              startPage,
              pageCount,
              moneyType,
              fetchDepositHisotry);
      response.getOutputStream().write(result.getBytes("utf-8"));
      String ERRORCODE = JSONObject.fromObject(result).getString("ERRORCODE");
      if (("0").equals(ERRORCODE)) {
        logger.info(
            appKey
                + "===>"
                + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_OK, ConstantsUtil.RESULT_OK));
      } else {
        logger.warn(appKey + "===>" + result);
      }
      result = null;
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 3
0
  /**
   * 确认换货申请
   *
   * @param appKey
   * @param secret
   * @param oldIMEI
   * @param newIMEI
   * @return
   */
  @ResponseBody
  @RequestMapping("/confirmExchangeGoods")
  public String confirmExchangeGoods(String appKey, String oldIMEI, String newIMEI) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.confirmExchangeGoods(
              appkey, secret, oldIMEI, newIMEI, confirmExchangeGoods);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(appKey + "===>" + result);
    }

    return result;
  }
Exemplo n.º 4
0
  /**
   * 用户未使用直接退货
   *
   * @param appKey
   * @param secret
   * @param IMEI
   * @param expressNumber
   * @param expressCompany
   * @return
   */
  @ResponseBody
  @RequestMapping("/returnGoodsWithoutUse")
  public String returnGoodsWithoutUse(
      String appKey, String IMEI, String expressNumber, String expressCompany) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.returnGoodsWithoutUse(
              appkey, secret, IMEI, expressNumber, expressCompany, returnGoodsWithoutUse);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(appKey + "===>" + e.toString());
    }

    return result;
  }
Exemplo n.º 5
0
  /**
   * 检验是否设置押金密码
   *
   * @param appKey
   * @param secret
   * @param IMEI
   * @return
   */
  @ResponseBody
  @RequestMapping("/judgeExistPassword")
  public String judgeExistPassword(String appKey, String IMEI) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result = rewardService.judgeExistPassword(appkey, secret, IMEI, judgeExistPassword);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 6
0
  /**
   * 申请提现
   *
   * @param appKey
   * @param IMEI
   * @param accountID
   * @param depositPassword
   * @param applyWithdrawAmount
   * @param withdrawAccount
   * @param withdrawAccountType
   * @return
   */
  @ResponseBody
  @RequestMapping("/applyWithdraw")
  public String applyWithdraw(
      String appKey,
      String IMEI,
      String accountID,
      String depositPassword,
      String applyWithdrawAmount,
      String withdrawAccount,
      String withdrawAccountType) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.applyWithdraw(
              appkey,
              secret,
              IMEI,
              accountID,
              depositPassword,
              applyWithdrawAmount,
              withdrawAccount,
              withdrawAccountType,
              applyWithdraw);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 7
0
  /**
   * 申请退货
   *
   * @param appKey
   * @param IMEI
   * @param accountID
   * @param depositPassword
   * @param expressNumber
   * @param expressCompany
   * @return
   */
  @ResponseBody
  @RequestMapping("/applyCancelContract")
  public String applyCancelContract(
      String appKey,
      String IMEI,
      String accountID,
      String depositPassword,
      String expressNumber,
      String expressCompany,
      String returnReason) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.applyCancelContract(
              appkey,
              secret,
              IMEI,
              accountID,
              depositPassword,
              expressNumber,
              expressCompany,
              returnReason,
              applyCancelContract);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 8
0
  /**
   * 获得收入
   *
   * @param appKey
   * @param accountID
   * @param mileage
   * @return
   */
  @ResponseBody
  @RequestMapping("/getRewardAmountByMileage")
  public String getRewardAmountByMileage(
      String appKey, String accountID, String mileage, Short moneyType) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.getRewardAmountByMileage(
              appkey, secret, accountID, mileage, moneyType, getRewardAmountByMileage);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 9
0
  /**
   * 设置押金密码
   *
   * @param appKey
   * @param secret
   * @param accountID
   * @param IMEI
   * @param oldPassword
   * @param newPassword
   * @return
   */
  @ResponseBody
  @RequestMapping("/updateDepositPassword")
  public String updateDepositPassword(
      String appKey, String accountID, String IMEI, String oldPassword, String newPassword) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.updateDepositPassword(
              appkey, secret, accountID, IMEI, oldPassword, newPassword, updateDepositPassword);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 10
0
  /**
   * 获取用户当前资金信息
   *
   * @param appKey
   * @param secret
   * @param accountID
   * @param moneyType 若输入资金类型(1密点、2微点、3(微点和密点同时返回)),
   *     4保险金,按实际金额做返回;(在原有的moneyType类型上添加)5密点的实际金额(单位:元)、 6微点的实际金额(单位:元),无资金类型参数(微点和密点的实际金额(单位:元))
   * @return
   */
  @ResponseBody
  @RequestMapping("/getUserFinanceInfo")
  public String getUserFinanceInfo(String appKey, String accountID, String moneyType) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.getUserFinanceInfo(
              appkey, secret, accountID, moneyType, getUserFinanceInfo);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      e.printStackTrace();
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 11
0
  /**
   * 获得押金类型
   *
   * @param appKey
   * @param secret
   * @param depositType
   * @return
   */
  @ResponseBody
  @RequestMapping("/getDepositTypeInfo")
  public String getDepositTypeInfo(
      String appKey, String depositType, HttpServletResponse response) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result = rewardService.getDepositTypeInfo(appkey, secret, depositType, getDepositTypeInfo);
      response.getOutputStream().write(result.getBytes("utf-8"));
      logger.info(appKey + "===>" + result);
      result = null;
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }
Exemplo n.º 12
0
  /**
   * 用户缴纳押金
   *
   * @param appKey
   * @param IMEI
   * @param depositType
   * @param depositAmount
   * @return
   */
  @ResponseBody
  @RequestMapping("/payUserDeposit")
  public String payUserDeposit(
      String appKey, String IMEI, String depositType, String depositAmount) {
    String result = null;
    String appkey = ConstantsUtil.getAppKey(appKey);
    String secret = ConstantsUtil.getSecret(appKey);
    try {
      result =
          rewardService.payUserDeposit(
              appkey, secret, IMEI, depositType, depositAmount, payUserDeposit);
      logger.info(appKey + "===>" + result);
    } catch (Exception e) {
      result =
          JsonPuserUtil.jsonToString(
              ConstantsUtil.ERRORCODE_SERVICE_ERROR, ConstantsUtil.RESULT_SERVICE_ERROR);
      logger.error(
          appKey
              + "===>"
              + JsonPuserUtil.jsonToString(ConstantsUtil.ERRORCODE_SERVICE_ERROR, e.toString()));
    }

    return result;
  }