Pu Zhibing
2025-04-22 fd7b8fb7c89832c28a838b0449bbb8a392433ee2
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/payment/TransferUtil.java
@@ -40,7 +40,7 @@
   /**
    * 支付回调地址
    */
   private static final String callbackUrl = "http://221.182.45.100:9000";
   private static final String callbackUrl = "https://www.qijisheng.top";
   
   
   /**
@@ -56,7 +56,7 @@
      //商户编号
      body.put("userNo", merchantNo);
      //报备商户号
      body.put("tradeMerchantNo", singlePay.getTradeMerchantNo());
//      body.put("tradeMerchantNo", singlePay.getTradeMerchantNo());
      //产品类型
      body.put("productCode", "BANK_PAY_DAILY_ORDER");
      //交易请求时间
@@ -216,17 +216,11 @@
   
   
   public static String sign(JSONObject body) {
      //构建字段顺序必须按照文档签名顺序
      Set<Map.Entry<String, Object>> entries = body.entrySet();
      List<Map.Entry<String, Object>> infoIds = new ArrayList<Map.Entry<String, Object>>(entries);
      // 对所有传入参数按照字段名的 ASCII 码从小到大排序(字典序)
      Collections.sort(infoIds, new Comparator<Map.Entry<String, Object>>() {
         public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2) {
            return (o1.getKey()).compareTo(o2.getKey());
         }
      });
      // 构造签名键值对的格式
      StringBuilder sb = new StringBuilder();
      for (Map.Entry<String, Object> item : infoIds) {
      for (Map.Entry<String, Object> item : entries) {
         if (item.getKey() != null || item.getKey() != "") {
            Object val = item.getValue();
            if (!(val == "" || val == null)) {
@@ -235,6 +229,7 @@
         }
      }
      sb.append(key);
      log.info("待签名串:{}", sb.toString());
      return MD5AndKL.MD5(sb.toString());
   }