private boolean doReq(List<TlogBean> normalDfs) {
    StringBuffer normalMsg = new StringBuffer();
    StringBuffer exceptionMsg = new StringBuffer();
    String resp = "手工审核成功\n";
    try {
      // MMs重发代付、 因订单重新生产
      if (normalDfs.size() != 0) {
        for (TlogBean tlog : normalDfs) {
          String respFlag = "suc";
          if (!"suc".equals(respFlag)) {
            tlog.setTstat(PayState.FAILURE);
            tlog.setError_msg("请求银行失败");
            tlog.setAgainPay_status(Constant.SgDfTstat.TSTAT_SHFAIL);
            new SgDfShDao().updateTstat(tlog);
            exceptionMsg.append(tlog.getOid()).append(",");
          } else {
            normalMsg.append(tlog.getOid()).append(",");
          }
        }
      }
    } catch (Exception e) {
      LogUtil.printErrorLog("SgDfShService", "reqPayDf", "reqPayDf_exception", e);
    }

    if (!Ryt.empty(normalMsg.toString())) {
      resp += "提交成功:" + normalMsg.substring(0, normalMsg.length() - 1) + "\n";
    }
    if (!Ryt.empty(exceptionMsg.toString())) {
      resp += "请求银行失败:" + exceptionMsg.substring(0, exceptionMsg.length() - 1) + "\n";
    }
    LogUtil.printInfoLog("SgDfShServiceTest", "doReq", "resp:" + resp);

    return true;
  }
Esempio n. 2
0
  private Map<String, String> parseSubjectDN(String subjectDN) {
    Map<String, String> map = new HashMap<String, String>();
    String fields[] = subjectDN.split(",");
    for (String item : fields) {
      String kv[] = item.split("=");
      if (Ryt.empty(kv[0])) continue;

      map.put(kv[0].trim(), Ryt.empty(kv[1]) ? "" : kv[1].trim());
    }

    return map;
  }
 /**
  * 明细页面单个对象
  *
  * @param tseq
  * @param table(hlog or tlog)
  * @return Hlog
  */
 public Hlog queryHlogById(String tseq, String table) {
   StringBuilder sb = new StringBuilder();
   sb.append("(select tseq,mid,oid,mdate,amount,type,gate,sys_date,sys_time,");
   sb.append("tstat,fee_amt,bank_fee,author_type,bk_url,mer_priv from ");
   sb.append("tlog");
   sb.append("  where tseq = ").append(Ryt.sql(tseq)).append(") UNION ALL(");
   sb.append("select tseq,mid,oid,mdate,amount,type,gate,sys_date,sys_time,");
   sb.append("tstat,fee_amt,bank_fee,author_type,bk_url,mer_priv from ");
   sb.append("hlog");
   sb.append("  where tseq = ").append(Ryt.sql(tseq)).append(")  limit 1");
   return queryForObject(sb.toString(), Hlog.class);
 }
Esempio n. 4
0
  @Override
  public List<String> getSql(String flowNo, String serviceType) {
    List<String> sqlList = new ArrayList<String>();

    String tseq = Ryt.genOidBySysTime();
    int bkResTime = DateUtil.getCurrentUTCSeconds();
    int bkResDate = DateUtil.today();

    StringBuffer sql = new StringBuffer();
    sql.append("insert into hlog(tseq,version,ip,mdate,mid,bid,oid,amount,type,gate,author_type,");
    sql.append("sys_date,init_sys_date,sys_time,fee_amt,tstat,bk_flag,bk_send,bk_recv,bk_date,");
    sql.append("bk_seq1,bk_seq2,trans_period,gid,bk_fee_model,pay_amt,data_source,p9) ");
    sql.append(" values(" + tseq + ",10,0,");
    sql.append(orderDate + ",");
    sql.append(Ryt.addQuotes(merId) + ",");
    sql.append(Ryt.addQuotes(merId) + ",");
    sql.append(Ryt.addQuotes(ordId) + ",");
    sql.append(transAmt + ",");
    sql.append(transMode + ",");
    sql.append(gateId + ",0,");
    sql.append(sysDate + ",");
    sql.append(sysDate + ",");
    sql.append(sysTime + ",");
    sql.append(merFee + ",");
    sql.append(transState + ",1,");
    sql.append(sysTime + ",");
    // sql.append(bkResTime + ",");
    sql.append(sysTime + ",");
    sql.append(sysDate + ",");
    sql.append(Ryt.addQuotes(bkSeq) + ",");
    sql.append(Ryt.addQuotes(bkSeq) + ",0,");
    sql.append(gid + ",");
    sql.append(Ryt.addQuotes(bkFeeMode) + ",");
    sql.append(payAmt + ",4,");
    sql.append(Ryt.addQuotes(flowNo) + ")");

    sqlList.add(sql.toString());

    if (transState == Constant.PayState.SUCCESS) {
      AccSeqs params = new AccSeqs();
      params.setUid(merId);
      params.setAid(merId);
      params.setTrAmt(transAmt);
      params.setTrFee(merFee);
      params.setAmt(transAmt - merFee);
      params.setRecPay((short) Constant.RecPay.INCREASE);
      params.setTbName(Constant.HLOG);
      params.setTbId(tseq);
      params.setRemark(serviceType + "同步");

      // 账户流水记未结算金额
      List<String> list = RecordLiveAccount.recordAccSeqsAndCalLiqBalance(params);
      if (list != null) sqlList.addAll(list);
    }

    return sqlList;
  }
 // 当天交易查询的sql条件
 private StringBuffer getConditionSql(
     String queryTable,
     String mid,
     Integer gate,
     Integer tstat,
     Integer type,
     String oid,
     Integer gid,
     String date,
     Integer bdate,
     Integer edate,
     String tseq,
     String bkseq,
     Integer bkCheck,
     Integer mstate,
     String begintrantAmt,
     String endtrantAmt) {
   StringBuffer condition = new StringBuffer();
   // String a="(select * from "+queryTable+" where type!=11) as a ";
   condition.append(" FROM ").append(queryTable + " as a, minfo m ").append(" WHERE  a.mid=m.id ");
   if (!Ryt.empty(mid)) condition.append(" AND a.mid = " + Ryt.addQuotes(mid));
   if (gate != null) condition.append(" AND a.gate = " + gate);
   if (tstat != null) condition.append(" AND a.tstat = " + tstat);
   if (type != null) {
     condition.append(" AND a.type = " + type);
   } else {
     condition.append(" AND a.type not in (11,12,16,17,14) ");
   }
   if (!Ryt.empty(tseq)) condition.append(" AND a.tseq = " + Ryt.addQuotes(tseq));
   if (gid != null) condition.append(" AND a.gid = " + gid);
   if (!Ryt.empty(oid)) condition.append(" AND a.oid like " + Ryt.addQuotes("%" + oid + "%"));
   if (date != null) {
     if (bdate != null) condition.append(" AND " + date + " >= " + bdate);
     if (edate != null) condition.append(" AND " + date + " <= " + edate);
   }
   if (!Ryt.empty(bkseq)) {
     condition.append(" AND (a.bk_seq1 = " + Ryt.addQuotes(bkseq));
     condition.append(" OR a.bk_seq2 = " + Ryt.addQuotes(bkseq));
     condition.append(" ) ");
   }
   if (bkCheck != null) {
     condition.append(" AND a.bk_chk= " + bkCheck);
   }
   if (mstate != null) {
     condition.append(" AND m.mstate= " + mstate);
   }
   if (!Ryt.empty(begintrantAmt)) {
     condition.append(" AND a.amount>= " + Ryt.mul100toInt(begintrantAmt));
   }
   if (!Ryt.empty(endtrantAmt)) {
     condition.append(" AND a.amount<=" + Ryt.mul100toInt(endtrantAmt));
   }
   return condition;
 }
 public int updateNotifyStatus(String inStr, String table, int isNotice) {
   StringBuilder sql =
       new StringBuilder("UPDATE ").append(Ryt.sql(table)).append(" SET is_notice = ");
   sql.append(isNotice).append(" WHERE tseq IN ").append(inStr);
   return pubdao.update(sql.toString());
 }
Esempio n. 7
0
 public String getCardNo() {
   LoginUser user = sysDao.getLoginUser();
   return Ryt.getProperty(user, Ryt.minfoGetHandle(cardNo));
 }
Esempio n. 8
0
 public void setCardNo(String cardNo) {
   this.cardNo = Ryt.minfoSetHandle(cardNo);
 }
Esempio n. 9
0
 public String getPidType() {
   return Ryt.minfoGetHandle(pidType);
 }
Esempio n. 10
0
 public String getPidNo() {
   // return pidNo;
   LoginUser user = sysDao.getLoginUser();
   return Ryt.getProperty(user, Ryt.minfoGetHandle(pidNo));
 }
Esempio n. 11
0
 public String getCardName() {
   // return cardName;
   return Ryt.minfoGetHandle(cardName);
 }
Esempio n. 12
0
 public void setCardName(String cardName) {
   // this.cardName = cardName;
   this.cardName = Ryt.minfoSetHandle(cardName);
 }
Esempio n. 13
0
 public void setPhoneNo(String phoneNo) {
   this.phoneNo = Ryt.minfoSetHandle(phoneNo);
 }
Esempio n. 14
0
 public String getPhoneNo() {
   LoginUser user = sysDao.getLoginUser();
   // return Ryt.getProperty(user,phoneNo);
   return Ryt.getProperty(user, Ryt.minfoGetHandle(phoneNo));
 }
Esempio n. 15
0
 public void setPidNo(String pidNo) {
   // this.pidNo = pidNo;
   this.pidNo = Ryt.minfoSetHandle(pidNo);
 }
 // 当天交易下载
 public FileTransfer downloadToday(
     String mid,
     Integer gate,
     Integer tstat,
     Integer type,
     String tseq,
     String oid,
     Integer gateRouteId,
     String bkseq,
     Integer mstate,
     String begintrantAmt,
     String endtrantAmt,
     String p15)
     throws Exception {
   CurrentPage<OrderInfo> tlogListPage =
       queryMerTodayDao.queryMerToday(
           1,
           -1,
           mid,
           gate,
           tstat,
           type,
           tseq,
           oid,
           gateRouteId,
           bkseq,
           mstate,
           begintrantAmt,
           endtrantAmt,
           p15);
   List<OrderInfo> tlogList = tlogListPage.getPageItems();
   ArrayList<String[]> list = new ArrayList<String[]>();
   Map<Integer, String> gates = RYFMapUtil.getGateMap();
   Map<Integer, String> gateRouteMap = RYFMapUtil.getGateRouteMap();
   long totleAmount = 0;
   long totleFeeAmt = 0;
   long totleBankFee = 0;
   list.add(
       "序号,电银流水号,商户号,商户订单号,商户日期,交易金额(元),交易状态,交易类型,交易银行,支付渠道,系统手续费(元),银行手续费(元),系统时间,银行流水号,失败原因,接入方式"
           .split(","));
   int i = 0;
   for (OrderInfo h : tlogList) {
     String gateRoute = "";
     if (h.getGid() != null && !String.valueOf(h.getGid()).equals("")) {
       gateRoute = gateRouteMap.get(h.getGid());
     }
     String[] str = {
       (i + 1) + "",
       h.getTseq() + "",
       h.getMid() + "",
       h.getOid(),
       h.getMdate() + "",
       Ryt.div100(h.getAmount()),
       AppParam.tlog_tstat.get(Integer.parseInt(h.getTstat() + "")),
       AppParam.tlog_type.get(Integer.parseInt(h.getType() + "")),
       gates.get(h.getGate()),
       gateRoute,
       Ryt.div100(h.getFeeAmt()),
       Ryt.div100(h.getBankFee()),
       h.getSysDate() + " " + DateUtil.getStringTime(h.getSysTime()),
       h.getBk_seq1(),
       h.getError_msg(),
       h.getP15()
     };
     totleAmount += h.getAmount();
     totleFeeAmt += h.getFeeAmt();
     totleBankFee += h.getBankFee();
     i += 1;
     list.add(str);
   }
   String[] str = {
     "总计:" + i + "条记录",
     "",
     "",
     "",
     "",
     Ryt.div100(totleAmount) + "",
     "",
     "",
     "",
     "",
     Ryt.div100(totleFeeAmt) + "",
     Ryt.div100(totleBankFee) + "",
     "",
     "",
     ""
   };
   list.add(str);
   String filename = "MERTLOG_" + DateUtil.today() + ".xlsx";
   String name = "当天交易表";
   return new DownloadFile().downloadXLSXFileBase(list, filename, name);
 }
Esempio n. 17
0
 public void setPeriod(String period) {
   // this.period = period;
   this.period = Ryt.minfoSetHandle(period);
 }
Esempio n. 18
0
 public String getPeriod() {
   // return period;
   return Ryt.minfoGetHandle(period);
 }
Esempio n. 19
0
 public void setPidType(String pidType) {
   this.pidType = Ryt.minfoSetHandle(pidType);
   // this.pidType = pidType;
 }