Example #1
0
  /**
   * 下载对账文件
   *
   * @param date 日期
   * @param type 收付类型:S-代收;F代付
   */
  public void downSettleFile(String date, String type) {

    String reqtime = DateUtil.format(new Date(), DateUtil.FULL_PATTERN_1);
    String reqUrl =
        downUrl
            + "?SETT_DATE="
            + date
            + "&SETT_NO=01&SF_TYPE="
            + type
            + "&USER_NAME="
            + username
            + "&MERCHANT_ID="
            + merchantId
            + "&REQ_TIME="
            + reqtime
            + "&SIGNED_MSG=";

    String signData = date + "|01|" + username + "|" + merchantId + "|" + reqtime;
    String signMsg = sign(signData);
    reqUrl += signMsg;

    log.info("下载请求报文:" + reqUrl);
    String filename = null;
    if ("S".equals(type)) {
      filename = date + "01_ds.txt";
    } else if ("F".equals(type)) {
      filename = date + "01_df.txt";
    }
    String filepath = settleFileDir + "/" + date + "/" + filename;
    HttpClientUtils.down(reqUrl, filepath);
  }
  /**
   * 基金账户开户接口:机构
   *
   * @param request
   * @return
   */
  public OpenAccountOrgResponse openAccountOrg(OpenAccountOrgRequest request) {
    OpenAccountOrgResponse response = new OpenAccountOrgResponse();
    response.setVersion(Constant.HftSysConfig.Version);
    response.setMerchantId(Constant.HftSysConfig.MerchantId);
    response.setDistributorCode(Constant.HftSysConfig.DistributorCode);
    response.setBusinType(request.getBusinType());
    response.setApplicationNo(request.getApplicationNo());

    response.setTransactionAccountID("Tan" + DateUtil.format(new Date(), DateUtil.FULL_PATTERN_1));

    response.setReturnCode("0000");
    response.setReturnMsg("交易成功");
    LOG.warn("模拟器返回:" + response);
    return response;
  }
  /**
   * 银行鉴权验证接口(快捷)
   *
   * @param request
   * @return
   */
  @Override
  public BankVeriResponse bankVeri(BankVeriRequest request) {

    BankVeriResponse response = new BankVeriResponse();
    response.setVersion(Constant.HftSysConfig.Version);
    response.setMerchantId(Constant.HftSysConfig.MerchantId);
    response.setDistributorCode(Constant.HftSysConfig.DistributorCode);
    response.setBusinType(request.getBusinType());
    response.setApplicationNo(request.getApplicationNo());

    response.setValidateState("1");
    response.setProtocolNo("Protocol" + DateUtil.format(new Date(), DateUtil.FULL_PATTERN_1));

    response.setReturnCode("0000");
    response.setReturnMsg("交易成功");
    LOG.warn("模拟器返回:" + response);
    return response;
  }