From ece214d072e36875a78f7a2598495d2e2c1db021 Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Mon, 22 Sep 2025 15:36:37 +0800
Subject: [PATCH] 9.17优化
---
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java | 38 +++++++++++++++++++++++---------------
1 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
index 7a5f2f1..ff67772 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
@@ -106,19 +106,19 @@
throw new YamiShopBindException("系统参数错误");
}
-// if ("true".equals(exchange_withdraw_need_safeword)) {
-//
-// if (StringUtils.isEmptyString(safeword)) {
-// throw new YamiShopBindException("资金密码不能为空");
-// }
-//
-// if (safeword.length() < 6 || safeword.length() > 12) {
-// throw new YamiShopBindException("资金密码必须6-12位");
-// }
-// if (!userService.checkLoginSafeword(SecurityUtils.getUser().getUserId(),safeword)){
-// throw new YamiShopBindException("资金密码错误");
-// }
-// }
+ if ("true".equals(exchange_withdraw_need_safeword)) {
+
+ if (StringUtils.isEmptyString(safeword)) {
+ throw new YamiShopBindException("资金密码不能为空");
+ }
+
+ if (safeword.length() < 6 || safeword.length() > 12) {
+ throw new YamiShopBindException("资金密码必须6-12位");
+ }
+ if (!userService.checkLoginSafeword(SecurityUtils.getUser().getUserId(),safeword)){
+ throw new YamiShopBindException("资金密码错误");
+ }
+ }
// 获取资金账户(capital)
CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class)
@@ -137,7 +137,8 @@
//获取商户支持币种
List<Coin> coinList = udunClient.listSupportCoin(false);
- Coin coin = coinList.stream().filter(x -> x.getName().equals(channel)).findFirst().orElse(null);
+ String channelName = channel.replace("_", "");
+ Coin coin = coinList.stream().filter(x -> x.getName().replace("-","").equals(channelName)).findFirst().orElse(null);
if (coin == null) {
throw new YamiShopBindException("不支持的提现币种");
}
@@ -154,6 +155,7 @@
resultObject.setCode(1);
resultObject.setMsg(e.getMessage()); // 直接获取纯业务消息
log.error("业务异常: {}", e.getMessage());
+ throw e;
} catch (UdunException e) {
resultObject.setCode(1);
resultObject.setMsg(e.getMessage());
@@ -177,6 +179,7 @@
ResultMsg resultMsg = new ResultMsg();
try{
+ log.info("===withdrawCallback===:{}", body);
boolean flag = udunClient.checkSign(timestamp, nonce, body, sign);
log.info("===withdrawCallback===sign:{}", flag);
@@ -197,7 +200,12 @@
resultMsg.setCode(200);
return resultMsg;
}
- withdrawService.examineOk(order_no, Long.valueOf(withdraw.getUserId()));
+ Integer status = Integer.valueOf(map.get("status").toString());
+ if (status == 3) { //交易成功
+ withdrawService.examineOk(withdraw.getUuid(), null);
+ } else if(status == 2) { //驳回
+ withdrawService.reject(withdraw.getUuid(), "订单失败:" + status, "withdrawCallback");
+ }
resultMsg.setCode(200);
}catch (Exception e){
resultMsg.setCode(500);
--
Gitblit v1.9.3