コード例 #1
0
  @Override
  public BillInfo findBillInfo(String transType, String transRefNo, String mrchNo, String storeNo) {
    BillInfo billInfo = null;
    CashLoad cashLoad = new CashLoad();
    cashLoad.setTransNo(transRefNo);
    cashLoad.setMrchNo(mrchNo);
    cashLoad.setStoreNo(storeNo);
    cashLoad = cashLoadDao.queryLoad(cashLoad);
    TransferChannel channel = transferRouter.findChannel(cashLoad.getTargetChannel());
    billInfo = channel.findBillInfo(transRefNo);

    TransferChannelType channelType =
        TransferChannelType.fromChannelName(cashLoad.getTargetChannel());
    // 设置其他非传统CUPS交易数据
    billInfo.setTransferChannel(channelType.getChannelId());
    billInfo.setMrchName(cashLoad.getMrchName());
    billInfo.setStoreName(cashLoad.getStoreName());
    billInfo.setOperatorName(cashLoad.getOperatorName()); // 是否要显示真实交易姓名
    billInfo.setTransRefNo(cashLoad.getTransNo());
    billInfo.setTransToken(cashLoad.getUpSno());

    String elecsignsPath =
        baseESignaturePath
            + cashLoad.getMrchNo()
            + File.separatorChar
            + cashLoad.getStoreNo()
            + File.separatorChar;
    String fileName = transRefNo + "-" + transType + "." + XPOSPClientUtils.BILLINFO_PICTURE_SUFFIX;
    logger.debug("[圈存电子签购单路径elecsignsPath:" + elecsignsPath + ",fileName:" + fileName + "]");
    File file = new File(elecsignsPath + fileName);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    if (file.exists()) {
      BufferedImage image;
      try {
        image = ImageIO.read(file);
        ImageIO.write(image, XPOSPClientUtils.BILLINFO_PICTURE_SUFFIX, out);
        billInfo.setElecSignData(CodecUtils.hexString(out.toByteArray()));
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
    return billInfo;
  }
コード例 #2
0
 @Override
 public CashLoad findCashLoadByTransNo(String transNo) {
   Assert.notNull(transNo, "find CashLoad failed for transNo null");
   return cashLoadDao.findById(transNo);
 }