From 56b443bfa9f363865cb399970228990938d0b643 Mon Sep 17 00:00:00 2001 From: ieaii <1069385070@qq.com> Date: Mon, 20 Jan 2025 23:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=AE=B6=E8=BD=AC=E8=B4=A6=E5=88=B0?= =?UTF-8?q?=E9=9B=B6=E9=92=B1=E4=BB=A3=E7=A0=81=E6=9C=80=E7=BB=88=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/jeecg/common/util/AesUtil.java | 38 ++++++++++ .../java/org/jeecg/config/shiro/ShiroConfig.java | 1 + .../controller/HotelBalanceLogController.java | 83 +++++++++++++++++----- .../hotelbalancelog/entity/HotelBalanceLog.java | 2 + .../req/TransferBatchesRequest.java | 3 + .../resp/TransferBatchNotifyResourceResp.java | 32 +++++++++ .../resp/TransferBatchResourceDataResp.java | 51 +++++++++++++ .../resp/TransferBatchesNotifyResp.java | 31 ++++++++ .../hotelbalancelog/resp/TransferBatchesResp.java | 34 +++++++-- .../xcx/order/controller/OrderController.java | 3 +- .../xcx/shop/service/impl/ShopServiceImpl.java | 18 ++--- .../src/main/resources/application-dev.yml | 1 + .../src/main/resources/application-prod.yml | 1 + .../src/main/resources/application-test.yml | 3 +- .../src/test/java/org/jeecg/Test.java | 27 +++++++ 15 files changed, 296 insertions(+), 32 deletions(-) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AesUtil.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchNotifyResourceResp.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchResourceDataResp.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesNotifyResp.java create mode 100644 jeecg-boot-module-system/src/test/java/org/jeecg/Test.java diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AesUtil.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AesUtil.java new file mode 100644 index 0000000..772eb38 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AesUtil.java @@ -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); + } + } +} \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index a826098..ff41922 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -72,6 +72,7 @@ public class ShiroConfig { } } + filterChainDefinitionMap.put("/hotelbalancelog/hotelBalanceLog/withdrawal/notify", "anon");//分类接口 filterChainDefinitionMap.put("/order/query/logistics", "anon");//分类接口 filterChainDefinitionMap.put("/conf/one", "anon");//分类接口 filterChainDefinitionMap.put("/category/list", "anon");//分类接口 diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/controller/HotelBalanceLogController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/controller/HotelBalanceLogController.java index 6453feb..2bef785 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/controller/HotelBalanceLogController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/controller/HotelBalanceLogController.java @@ -1,11 +1,10 @@ package org.jeecg.modules.hotelbalancelog.controller; import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.security.GeneralSecurityException; 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.io.IOException; import java.io.UnsupportedEncodingException; @@ -17,14 +16,11 @@ import javax.servlet.http.HttpServletResponse; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.IdWorker; 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.exception.JeecgBootException; 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.modules.hanHaiMember.entity.HanHaiMember; 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.TransferBatchesDetailsRequest; 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.service.IHotelBalanceLogService; @@ -89,6 +87,10 @@ public class HotelBalanceLogController extends JeecgController transferBatchesDetailsRequests = new ArrayList<>(); 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(transferBatchesDetailsRequest2); transferBatchesRequest.setTransferDetailList(transferBatchesDetailsRequests); String jsonString = JSONObject.toJSONString(transferBatchesRequest); + log.info("请求数据:"+jsonString); String postTransBatRequest = HttpRequestUtil.postTransBatRequest(transferBatchUrl, jsonString, serialNo, wxsSerialNo, mchId, pemPath); log.error("返回结果1:" + postTransBatRequest); TransferBatchesResp transferBatchesResp = JSON.parseObject(postTransBatRequest, TransferBatchesResp.class); 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("打款失败"); } HotelBalanceLog hotelBalanceLog1 = new HotelBalanceLog(); 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); 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 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; + + + } + + } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/entity/HotelBalanceLog.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/entity/HotelBalanceLog.java index 3a639c3..ad7a29e 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/entity/HotelBalanceLog.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/entity/HotelBalanceLog.java @@ -94,4 +94,6 @@ public class HotelBalanceLog implements Serializable { private String outBatchNo; /**微信批次单号*/ private String batchId; + /**跳转领取页面的package信息*/ + private String packageInfo; } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/req/TransferBatchesRequest.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/req/TransferBatchesRequest.java index eb293be..a56311d 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/req/TransferBatchesRequest.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/req/TransferBatchesRequest.java @@ -36,6 +36,9 @@ public class TransferBatchesRequest { /**真实姓名*/ @JSONField(name = "user_name") private String userName; + /**回调地址*/ + @JSONField(name = "notify_url") + private String notifyUrl; /**发起批量转账的明细列表,最多三千笔*/ @JSONField(name = "transfer_scene_report_infos") private List transferDetailList; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchNotifyResourceResp.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchNotifyResourceResp.java new file mode 100644 index 0000000..b3a4f70 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchNotifyResourceResp.java @@ -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; + + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchResourceDataResp.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchResourceDataResp.java new file mode 100644 index 0000000..efd8d83 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchResourceDataResp.java @@ -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; + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesNotifyResp.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesNotifyResp.java new file mode 100644 index 0000000..8c35683 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesNotifyResp.java @@ -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; + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesResp.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesResp.java index 6a240fa..04e48bf 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesResp.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/hotelbalancelog/resp/TransferBatchesResp.java @@ -15,13 +15,39 @@ import lombok.Data; 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") 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; } diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/order/controller/OrderController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/order/controller/OrderController.java index 90edc04..d8dc7fa 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/order/controller/OrderController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/order/controller/OrderController.java @@ -162,7 +162,8 @@ public class OrderController { @ApiOperation(value = "查询物流") @PostMapping("/query/logistics") - public Result queryLogistics(QueryLogisticsReq queryLogisticsReq){ + public Result queryLogistics(HttpServletRequest request,QueryLogisticsReq queryLogisticsReq){ + queryLogisticsReq.setToken(TokenUtils.getTokenByRequest(request)); return orderService.queryLogistics(queryLogisticsReq); } diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/shop/service/impl/ShopServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/shop/service/impl/ShopServiceImpl.java index 7e7816f..e89abd2 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/shop/service/impl/ShopServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/shop/service/impl/ShopServiceImpl.java @@ -147,15 +147,15 @@ public class ShopServiceImpl implements IShopService { if(StringUtils.isBlank(applyWithdrawalReq.getName())){ 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())){ throw new JeecgBootException("请先绑定微信"); } diff --git a/jeecg-boot-module-system/src/main/resources/application-dev.yml b/jeecg-boot-module-system/src/main/resources/application-dev.yml index f3b3b67..95273dd 100644 --- a/jeecg-boot-module-system/src/main/resources/application-dev.yml +++ b/jeecg-boot-module-system/src/main/resources/application-dev.yml @@ -373,6 +373,7 @@ wxpay: keyPemPath: apiclient_key.pem #商户证书序列号 serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9 + withdrawalNotifyUrl: https://hotel.java996.icu/hotel/hotelbalancelog/hotelBalanceLog/withdrawal/notify cainiao: diff --git a/jeecg-boot-module-system/src/main/resources/application-prod.yml b/jeecg-boot-module-system/src/main/resources/application-prod.yml index 924aa8a..ceeefed 100644 --- a/jeecg-boot-module-system/src/main/resources/application-prod.yml +++ b/jeecg-boot-module-system/src/main/resources/application-prod.yml @@ -372,6 +372,7 @@ wxpay: keyPemPath: apiclient_key.pem #商户证书序列号 serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9 + withdrawalNotifyUrl: https://hotel.java996.icu/hotel/hotelbalancelog/hotelBalanceLog/withdrawal/notify cainiao: appKey: 251828 diff --git a/jeecg-boot-module-system/src/main/resources/application-test.yml b/jeecg-boot-module-system/src/main/resources/application-test.yml index 24a0abf..5d26964 100644 --- a/jeecg-boot-module-system/src/main/resources/application-test.yml +++ b/jeecg-boot-module-system/src/main/resources/application-test.yml @@ -352,7 +352,7 @@ weixin: mchKey: 0fdb77429ffdf206c151af76a663041c serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9 apiV3Key: 0fdb77429ffdf206c151af76a663041c - keyPemPath: apiclient_key.pem + keyPemPath: /usr/local/cert/apiclient_key.pem wxpay: #应用编号 @@ -373,6 +373,7 @@ wxpay: keyPemPath: apiclient_key.pem #商户证书序列号 serialNo: 617767B5F6790AA85EEDED28F82599AAF4830FB9 + withdrawalNotifyUrl: https://hotel.java996.icu/hotel/hotelbalancelog/hotelBalanceLog/withdrawal/notify cainiao: appKey: 251828 diff --git a/jeecg-boot-module-system/src/test/java/org/jeecg/Test.java b/jeecg-boot-module-system/src/test/java/org/jeecg/Test.java new file mode 100644 index 0000000..246cf55 --- /dev/null +++ b/jeecg-boot-module-system/src/test/java/org/jeecg/Test.java @@ -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){ + + } + + + } + +}