Browse Source

商家转账到零钱代码最终版

master
HY 1 month ago
parent
commit
56b443bfa9
15 changed files with 296 additions and 32 deletions
  1. +38
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AesUtil.java
  2. +1
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  3. +66
    -17
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/controller/HotelBalanceLogController.java
  4. +2
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/entity/HotelBalanceLog.java
  5. +3
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/req/TransferBatchesRequest.java
  6. +32
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchNotifyResourceResp.java
  7. +51
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchResourceDataResp.java
  8. +31
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesNotifyResp.java
  9. +30
    -4
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesResp.java
  10. +2
    -1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/order/controller/OrderController.java
  11. +9
    -9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/shop/service/impl/ShopServiceImpl.java
  12. +1
    -0
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  13. +1
    -0
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  14. +2
    -1
      jeecg-boot-module-system/src/main/resources/application-test.yml
  15. +27
    -0
      jeecg-boot-module-system/src/test/java/org/jeecg/Test.java

+ 38
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AesUtil.java View File

@ -0,0 +1,38 @@
package org.jeecg.common.util;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class AesUtil {
static final int KEY_LENGTH_BYTE = 32;
static final int TAG_LENGTH_BIT = 128;
private final byte[] aesKey;
public AesUtil(byte[] key) {
if (key.length != KEY_LENGTH_BYTE) {
throw new IllegalArgumentException("无效的ApiV3Key,长度必须为32个字节");
}
this.aesKey = key;
}
public String decryptToString(byte[] associatedData, byte[] nonce, String ciphertext)
throws GeneralSecurityException, IOException {
try {
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
SecretKeySpec key = new SecretKeySpec(aesKey, "AES");
GCMParameterSpec spec = new GCMParameterSpec(TAG_LENGTH_BIT, nonce);
cipher.init(Cipher.DECRYPT_MODE, key, spec);
cipher.updateAAD(associatedData);
return new String(cipher.doFinal(Base64.getDecoder().decode(ciphertext)), "utf-8");
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
throw new IllegalStateException(e);
} catch (InvalidKeyException | InvalidAlgorithmParameterException e) {
throw new IllegalArgumentException(e);
}
}
}

+ 1
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java View File

@ -72,6 +72,7 @@ public class ShiroConfig {
} }
} }
filterChainDefinitionMap.put("/hotelbalancelog/hotelBalanceLog/withdrawal/notify", "anon");//分类接口
filterChainDefinitionMap.put("/order/query/logistics", "anon");//分类接口 filterChainDefinitionMap.put("/order/query/logistics", "anon");//分类接口
filterChainDefinitionMap.put("/conf/one", "anon");//分类接口 filterChainDefinitionMap.put("/conf/one", "anon");//分类接口
filterChainDefinitionMap.put("/category/list", "anon");//分类接口 filterChainDefinitionMap.put("/category/list", "anon");//分类接口


+ 66
- 17
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/controller/HotelBalanceLogController.java View File

@ -1,11 +1,10 @@
package org.jeecg.modules.hotelbalancelog.controller; package org.jeecg.modules.hotelbalancelog.controller;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@ -17,14 +16,11 @@ import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.wechat.pay.contrib.apache.httpclient.util.RsaCryptoUtil; import com.wechat.pay.contrib.apache.httpclient.util.RsaCryptoUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.HttpRequestUtil;
import org.jeecg.common.util.MoneyUtil;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.common.util.*;
import org.jeecg.common.util.pay.WeChatPayConfig2; import org.jeecg.common.util.pay.WeChatPayConfig2;
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService;
@ -32,6 +28,8 @@ import org.jeecg.modules.hotelbalancelog.entity.HotelBalanceLog;
import org.jeecg.modules.hotelbalancelog.req.AuditReq; import org.jeecg.modules.hotelbalancelog.req.AuditReq;
import org.jeecg.modules.hotelbalancelog.req.TransferBatchesDetailsRequest; import org.jeecg.modules.hotelbalancelog.req.TransferBatchesDetailsRequest;
import org.jeecg.modules.hotelbalancelog.req.TransferBatchesRequest; import org.jeecg.modules.hotelbalancelog.req.TransferBatchesRequest;
import org.jeecg.modules.hotelbalancelog.resp.TransferBatchResourceDataResp;
import org.jeecg.modules.hotelbalancelog.resp.TransferBatchesNotifyResp;
import org.jeecg.modules.hotelbalancelog.resp.TransferBatchesResp; import org.jeecg.modules.hotelbalancelog.resp.TransferBatchesResp;
import org.jeecg.modules.hotelbalancelog.service.IHotelBalanceLogService; import org.jeecg.modules.hotelbalancelog.service.IHotelBalanceLogService;
@ -89,6 +87,10 @@ public class HotelBalanceLogController extends JeecgController<HotelBalanceLog,
private String mchId; private String mchId;
@Value("${weixin.serialNo}") @Value("${weixin.serialNo}")
private String wxsSerialNo; private String wxsSerialNo;
@Value("${wxpay.withdrawalNotifyUrl}")
private String withdrawalNotifyUrl;
@Value("${wxpay.apiV3Key}")
private String apiV3Key;
@Resource @Resource
private WeChatPayConfig2 weChatPayConfig2; private WeChatPayConfig2 weChatPayConfig2;
@ -300,7 +302,8 @@ public class HotelBalanceLogController extends JeecgController<HotelBalanceLog,
transferBatchesRequest.setOutBillNo(idStr); transferBatchesRequest.setOutBillNo(idStr);
transferBatchesRequest.setTransferRemark("商家提现"); transferBatchesRequest.setTransferRemark("商家提现");
transferBatchesRequest.setOpenid(hanHaiMember.getAppletOpenid()); transferBatchesRequest.setOpenid(hanHaiMember.getAppletOpenid());
transferBatchesRequest.setTransferSceneId("1000");
transferBatchesRequest.setTransferSceneId("1005");
transferBatchesRequest.setNotifyUrl(withdrawalNotifyUrl);
String serialNo = null; String serialNo = null;
try { try {
X509Certificate certificate = weChatPayConfig2.getVerifier().getValidCertificate(); X509Certificate certificate = weChatPayConfig2.getVerifier().getValidCertificate();
@ -315,32 +318,78 @@ public class HotelBalanceLogController extends JeecgController<HotelBalanceLog,
transferBatchesRequest.setTransferAmount(MoneyUtil.Yuan2Fen(hotelBalanceLog.getBalance().doubleValue())); transferBatchesRequest.setTransferAmount(MoneyUtil.Yuan2Fen(hotelBalanceLog.getBalance().doubleValue()));
List<TransferBatchesDetailsRequest> transferBatchesDetailsRequests = new ArrayList<>(); List<TransferBatchesDetailsRequest> transferBatchesDetailsRequests = new ArrayList<>();
TransferBatchesDetailsRequest transferBatchesDetailsRequest = new TransferBatchesDetailsRequest(); TransferBatchesDetailsRequest transferBatchesDetailsRequest = new TransferBatchesDetailsRequest();
transferBatchesDetailsRequest.setInfoType("1000-现金营销");
transferBatchesDetailsRequest.setInfoContent("商品返利");
transferBatchesDetailsRequest.setInfoType("岗位类型");
transferBatchesDetailsRequest.setInfoContent("销售员");
TransferBatchesDetailsRequest transferBatchesDetailsRequest2 = new TransferBatchesDetailsRequest();
transferBatchesDetailsRequest2.setInfoType("报酬说明");
transferBatchesDetailsRequest2.setInfoContent("销售佣金");
transferBatchesDetailsRequests.add(transferBatchesDetailsRequest); transferBatchesDetailsRequests.add(transferBatchesDetailsRequest);
transferBatchesDetailsRequests.add(transferBatchesDetailsRequest2);
transferBatchesRequest.setTransferDetailList(transferBatchesDetailsRequests); transferBatchesRequest.setTransferDetailList(transferBatchesDetailsRequests);
String jsonString = JSONObject.toJSONString(transferBatchesRequest); String jsonString = JSONObject.toJSONString(transferBatchesRequest);
log.info("请求数据:"+jsonString);
String postTransBatRequest = HttpRequestUtil.postTransBatRequest(transferBatchUrl, jsonString, serialNo, wxsSerialNo, mchId, pemPath); String postTransBatRequest = HttpRequestUtil.postTransBatRequest(transferBatchUrl, jsonString, serialNo, wxsSerialNo, mchId, pemPath);
log.error("返回结果1:" + postTransBatRequest); log.error("返回结果1:" + postTransBatRequest);
TransferBatchesResp transferBatchesResp = JSON.parseObject(postTransBatRequest, TransferBatchesResp.class); TransferBatchesResp transferBatchesResp = JSON.parseObject(postTransBatRequest, TransferBatchesResp.class);
log.error("返回结果2:" + transferBatchesResp); log.error("返回结果2:" + transferBatchesResp);
if (transferBatchesResp == null || org.apache.commons.lang3.StringUtils.isBlank(transferBatchesResp.getBatchId())) {
if (transferBatchesResp == null || org.apache.commons.lang3.StringUtils.isBlank(transferBatchesResp.getOutBillNo())|| StringUtils.equals(transferBatchesResp.getState(),"FAIL")) {
throw new JeecgBootException("打款失败"); throw new JeecgBootException("打款失败");
} }
HotelBalanceLog hotelBalanceLog1 = new HotelBalanceLog(); HotelBalanceLog hotelBalanceLog1 = new HotelBalanceLog();
hotelBalanceLog1.setId(hotelBalanceLog.getId()); hotelBalanceLog1.setId(hotelBalanceLog.getId());
hotelBalanceLog1.setStatus(2);
hotelBalanceLog1.setOutBatchNo(transferBatchesResp.getOutBatchNo());
hotelBalanceLog1.setBatchId(transferBatchesResp.getBatchId());
hotelBalanceLog1.setStatus(4);
hotelBalanceLog1.setOutBatchNo(transferBatchesResp.getTransferBillNo());
hotelBalanceLog1.setBatchId(transferBatchesResp.getOutBillNo());
hotelBalanceLog1.setPackageInfo(transferBatchesResp.getPackageInfo());
hotelBalanceLogService.updateById(hotelBalanceLog1); hotelBalanceLogService.updateById(hotelBalanceLog1);
return Result.OK(); return Result.OK();
} }
@PostMapping("/withdrawal/notify")
public Object withdrawalNotify(@RequestBody TransferBatchesNotifyResp transferBatchesNotifyResp) throws GeneralSecurityException, IOException {
log.info("回调内容:"+transferBatchesNotifyResp.toString());
String associatedData = "mch_payment";
String decryptToString = new AesUtil(apiV3Key.getBytes(StandardCharsets.UTF_8)).decryptToString(associatedData.getBytes(StandardCharsets.UTF_8), transferBatchesNotifyResp.getResource().getNonce().getBytes(StandardCharsets.UTF_8), transferBatchesNotifyResp.getResource().getCiphertext());
log.info("解密内容:"+decryptToString);
TransferBatchResourceDataResp transferBatchResourceDataResp = JSON.parseObject(decryptToString, TransferBatchResourceDataResp.class);
log.info("解密内容转换:"+transferBatchResourceDataResp.toString());
HotelBalanceLog hotelBalanceLog = hotelBalanceLogService.lambdaQuery().eq(HotelBalanceLog::getBatchId, transferBatchResourceDataResp.getOutBillNo()).one();
Map<String, Object> map = new HashMap<>();
if(hotelBalanceLog == null){
log.error("失败,未查找到数据");
map.put("code","FAIL");
map.put("message","未查找到数据");
return map;
}
HotelBalanceLog hotelBalanceLog1 = new HotelBalanceLog();
hotelBalanceLog1.setId(hotelBalanceLog.getId());
hotelBalanceLog1.setStatus(2);
hotelBalanceLogService.updateById(hotelBalanceLog1);
map.put("code","SUCCESS");
map.put("message","SUCCESS");
return map;
}
} }

+ 2
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/entity/HotelBalanceLog.java View File

@ -94,4 +94,6 @@ public class HotelBalanceLog implements Serializable {
private String outBatchNo; private String outBatchNo;
/**微信批次单号*/ /**微信批次单号*/
private String batchId; private String batchId;
/**跳转领取页面的package信息*/
private String packageInfo;
} }

+ 3
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/req/TransferBatchesRequest.java View File

@ -36,6 +36,9 @@ public class TransferBatchesRequest {
/**真实姓名*/ /**真实姓名*/
@JSONField(name = "user_name") @JSONField(name = "user_name")
private String userName; private String userName;
/**回调地址*/
@JSONField(name = "notify_url")
private String notifyUrl;
/**发起批量转账的明细列表,最多三千笔*/ /**发起批量转账的明细列表,最多三千笔*/
@JSONField(name = "transfer_scene_report_infos") @JSONField(name = "transfer_scene_report_infos")
private List<TransferBatchesDetailsRequest> transferDetailList; private List<TransferBatchesDetailsRequest> transferDetailList;


+ 32
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchNotifyResourceResp.java View File

@ -0,0 +1,32 @@
package org.jeecg.modules.hotelbalancelog.resp;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class TransferBatchNotifyResourceResp {
/**
* 加密算法类型
* 对开启结果数据进行加密的加密算法目前只支持AEAD_AES_256_GCM
*/
@JSONField(name = "algorithm")
private String algorithm;
/**
* 数据密文
* Base64编码后的商家转账结果数据密文
*/
@JSONField(name = "ciphertext")
private String ciphertext;
/**附加数据*/
@JSONField(name = "associated_data")
private String associatedData;
/**原始回调类型,为mch_payment*/
@JSONField(name = "original_type")
private String originalType;
/**加密使用的随机串*/
@JSONField(name = "nonce")
private String nonce;
}

+ 51
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchResourceDataResp.java View File

@ -0,0 +1,51 @@
package org.jeecg.modules.hotelbalancelog.resp;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class TransferBatchResourceDataResp {
/**微信批次单号*/
@JSONField(name = "out_bill_no")
private String outBillNo;
/**商家批次单号*/
@JSONField(name = "transfer_bill_no")
private String transferBillNo;
/**
* 商家转账订单状态
* ACCEPTED: 转账已受理
*
* PROCESSING: 转账处理中转账结果尚未明确如一直处于此状态建议检查账户余额是否足够
*
* WAIT_USER_CONFIRM: 待收款用户确认可拉起微信收款确认页面进行收款确认
*
* TRANSFERING: 转账结果尚未明确可拉起微信收款确认页面再次重试确认收款
*
* SUCCESS: 转账成功
*
* FAIL: 转账失败
*
* CANCELING: 商户撤销请求受理成功该笔转账正在撤销中
*
* CANCELLED: 转账撤销完成
* */
@JSONField(name = "state")
private String state;
/**失败原因*/
@JSONField(name = "fail_reason")
private String failReason;
/**商户号*/
@JSONField(name = "mch_id")
private String mchId;
/**转账总金额,单位为“分”*/
@JSONField(name = "transfer_amount")
private Integer transferAmount;
@JSONField(name = "openid")
private String openid;
@JSONField(name = "create_time")
private String createTime;
@JSONField(name = "update_time")
private String updateTime;
}

+ 31
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesNotifyResp.java View File

@ -0,0 +1,31 @@
package org.jeecg.modules.hotelbalancelog.resp;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class TransferBatchesNotifyResp {
private String id;
@JSONField(name = "create_time")
private String createTime;
/**
* 通知类型
* 通知的类型商家转账通知的类型为MCHTRANSFER.BILL.FINISHED
* */
@JSONField(name = "event_type")
private String eventType;
/**
* 通知类型
* 通知的资源数据类型商家转账通知为encrypt-resource
* */
@JSONField(name = "resource_type")
private String resourceType;
/**通知数据*/
@JSONField(name = "resource")
private TransferBatchNotifyResourceResp resource;
/**回调摘要*/
@JSONField(name = "summary")
private String summary;
}

+ 30
- 4
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesResp.java View File

@ -15,13 +15,39 @@ import lombok.Data;
public class TransferBatchesResp { public class TransferBatchesResp {
/**微信批次单号*/ /**微信批次单号*/
@JSONField(name = "batch_id")
private String batchId;
@JSONField(name = "out_bill_no")
private String outBillNo;
/**商家批次单号*/ /**商家批次单号*/
@JSONField(name = "out_batch_no")
private String outBatchNo;
@JSONField(name = "transfer_bill_no")
private String transferBillNo;
/**批次创建时间*/ /**批次创建时间*/
@JSONField(name = "create_time") @JSONField(name = "create_time")
private String createTime; private String createTime;
/**
* 商家转账订单状态
* ACCEPTED: 转账已受理
*
* PROCESSING: 转账处理中转账结果尚未明确如一直处于此状态建议检查账户余额是否足够
*
* WAIT_USER_CONFIRM: 待收款用户确认可拉起微信收款确认页面进行收款确认
*
* TRANSFERING: 转账结果尚未明确可拉起微信收款确认页面再次重试确认收款
*
* SUCCESS: 转账成功
*
* FAIL: 转账失败
*
* CANCELING: 商户撤销请求受理成功该笔转账正在撤销中
*
* CANCELLED: 转账撤销完成
* */
@JSONField(name = "state")
private String state;
/**失败原因*/
@JSONField(name = "fail_reason")
private String failReason;
/**跳转领取页面的package信息*/
@JSONField(name = "package_info")
private String packageInfo;
} }

+ 2
- 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/order/controller/OrderController.java View File

@ -162,7 +162,8 @@ public class OrderController {
@ApiOperation(value = "查询物流") @ApiOperation(value = "查询物流")
@PostMapping("/query/logistics") @PostMapping("/query/logistics")
public Result<?> queryLogistics(QueryLogisticsReq queryLogisticsReq){
public Result<?> queryLogistics(HttpServletRequest request,QueryLogisticsReq queryLogisticsReq){
queryLogisticsReq.setToken(TokenUtils.getTokenByRequest(request));
return orderService.queryLogistics(queryLogisticsReq); return orderService.queryLogistics(queryLogisticsReq);
} }


+ 9
- 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/shop/service/impl/ShopServiceImpl.java View File

@ -147,15 +147,15 @@ public class ShopServiceImpl implements IShopService {
if(StringUtils.isBlank(applyWithdrawalReq.getName())){ if(StringUtils.isBlank(applyWithdrawalReq.getName())){
throw new JeecgBootException("请填写姓名"); throw new JeecgBootException("请填写姓名");
} }
if(StringUtils.isBlank(applyWithdrawalReq.getPhone())){
throw new JeecgBootException("请填写电话");
}
if(StringUtils.isBlank(applyWithdrawalReq.getBankCard())){
throw new JeecgBootException("请填写银行卡号");
}
if(StringUtils.isBlank(applyWithdrawalReq.getBankAddress())){
throw new JeecgBootException("请填写银行卡支行地址");
}
// if(StringUtils.isBlank(applyWithdrawalReq.getPhone())){
// throw new JeecgBootException("请填写电话");
// }
// if(StringUtils.isBlank(applyWithdrawalReq.getBankCard())){
// throw new JeecgBootException("请填写银行卡号");
// }
// if(StringUtils.isBlank(applyWithdrawalReq.getBankAddress())){
// throw new JeecgBootException("请填写银行卡支行地址");
// }
if(StringUtils.isBlank(hanHaiMember.getAppletOpenid())){ if(StringUtils.isBlank(hanHaiMember.getAppletOpenid())){
throw new JeecgBootException("请先绑定微信"); throw new JeecgBootException("请先绑定微信");
} }


+ 1
- 0
jeecg-boot-module-system/src/main/resources/application-dev.yml View File

@ -373,6 +373,7 @@ wxpay:
keyPemPath: apiclient_key.pem keyPemPath: apiclient_key.pem
#商户证书序列号 #商户证书序列号
serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9 serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9
withdrawalNotifyUrl: https://hotel.java996.icu/hotel/hotelbalancelog/hotelBalanceLog/withdrawal/notify
cainiao: cainiao:


+ 1
- 0
jeecg-boot-module-system/src/main/resources/application-prod.yml View File

@ -372,6 +372,7 @@ wxpay:
keyPemPath: apiclient_key.pem keyPemPath: apiclient_key.pem
#商户证书序列号 #商户证书序列号
serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9 serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9
withdrawalNotifyUrl: https://hotel.java996.icu/hotel/hotelbalancelog/hotelBalanceLog/withdrawal/notify
cainiao: cainiao:
appKey: 251828 appKey: 251828


+ 2
- 1
jeecg-boot-module-system/src/main/resources/application-test.yml View File

@ -352,7 +352,7 @@ weixin:
mchKey: 0fdb77429ffdf206c151af76a663041c mchKey: 0fdb77429ffdf206c151af76a663041c
serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9 serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9
apiV3Key: 0fdb77429ffdf206c151af76a663041c apiV3Key: 0fdb77429ffdf206c151af76a663041c
keyPemPath: apiclient_key.pem
keyPemPath: /usr/local/cert/apiclient_key.pem
wxpay: wxpay:
#应用编号 #应用编号
@ -373,6 +373,7 @@ wxpay:
keyPemPath: apiclient_key.pem keyPemPath: apiclient_key.pem
#商户证书序列号 #商户证书序列号
serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9 serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9
withdrawalNotifyUrl: https://hotel.java996.icu/hotel/hotelbalancelog/hotelBalanceLog/withdrawal/notify
cainiao: cainiao:
appKey: 251828 appKey: 251828


+ 27
- 0
jeecg-boot-module-system/src/test/java/org/jeecg/Test.java View File

@ -0,0 +1,27 @@
package org.jeecg;
import org.jeecg.common.util.AesUtil;
import java.nio.charset.StandardCharsets;
public class Test {
@org.junit.Test
public void test2(){
String key = "0fdb77429ffdf206c151af76a663041c";
String date = "mch_payment";
String nonce = "TPOOb8DWV7qc";
String ciphertext = "d0H8gWhcI3+pT7Q2WvZM+jeopUqR8NceBD8qT51+H+hK2ZZpO0GH+NvOpixOGoMR080Ru4hh37B2iBycZVFe3WFEehSnwm4R4mBzNA7z8jrQuen8tNZxu/pyz/wL1St+eUWHK48j0poT1GOdjyC0X8iiMjTc+cRUS5Zrf+576RqN+e8TT1f8qCkb9L2DYmzqjYvii07etPW400/Pezb8Csv/dTpCsAeUFJIMPj/NDyyQ/nBJXTGsBQhWtQwOQFoU4gON4fb2oZUGXYwNYaWzFA06iZQFzCpO5H7I0rtPerkSMcQJYKA5fOdm7oPgS2uiJDO6SGcq6TEMq7hqyJpNofT48b8cAbMTyR1y5ve4jtNXabN+1OufiJwKXpQEL89p5PLjesUMpjyDrmHobWv0PuwuPYNHd30FhTbqs/Q=";
try {
String s = new AesUtil(key.getBytes(StandardCharsets.UTF_8)).decryptToString(date.getBytes(StandardCharsets.UTF_8), nonce.getBytes(StandardCharsets.UTF_8), ciphertext);
System.out.println(s);
}catch (Exception e){
}
}
}

Loading…
Cancel
Save