From 42ba802e77dea3e36fb24468919bdca111468a5c Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Fri, 17 Jan 2025 13:54:59 +0800
Subject: [PATCH] 1

---
 src/main/java/project/web/api/WithdrawController.java |   48 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/src/main/java/project/web/api/WithdrawController.java b/src/main/java/project/web/api/WithdrawController.java
index b15e7fe..978b75a 100644
--- a/src/main/java/project/web/api/WithdrawController.java
+++ b/src/main/java/project/web/api/WithdrawController.java
@@ -11,6 +11,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -24,12 +25,17 @@
 import kernel.web.BaseAction;
 import kernel.web.ResultObject;
 import project.Constants;
+import project.data.DataService;
 import project.log.Log;
 import project.log.LogService;
 import project.party.PartyService;
 import project.party.model.Party;
+import project.redis.RedisHandler;
 import project.syspara.SysparaService;
+import project.wallet.WalletGatherService;
 import project.wallet.WalletLogService;
+import project.wallet.WalletService;
+import project.wallet.internal.WalletGatherServiceImpl;
 import project.withdraw.Withdraw;
 import project.withdraw.WithdrawService;
 import util.LockFilter;
@@ -55,6 +61,16 @@
 	
 	@Autowired
 	private LogService logService;
+
+	@Autowired
+	private RedisHandler redisHandler;
+
+	@Autowired
+	private JdbcTemplate jdbcTemplate;
+
+	@Autowired
+	private WalletService walletService;
+
 
 	private final String action = "/api/withdraw!";
 	
@@ -117,7 +133,7 @@
 		if (!"0".equals(resultObject.getCode())) {
 			return resultObject;
 		}
-		
+
 		String partyId = this.getLoginPartyId();
 		boolean lock = false;
 		try {
@@ -125,17 +141,17 @@
 			if (!StringUtils.isNullOrEmpty(error)) {
 				throw new BusinessException(error);
 			}
-			
+
 			double amount_double = Double.valueOf(amount).doubleValue();
-			
+
 			// 交易所提现是否需要资金密码
 			String exchange_withdraw_need_safeword = this.sysparaService.find("exchange_withdraw_need_safeword").getValue();
 			if(StringUtils.isEmptyString(exchange_withdraw_need_safeword)) {
 				throw new BusinessException("系统参数错误");
 			}
-			
+
 			if ("true".equals(exchange_withdraw_need_safeword)) {
-				
+
 				if (StringUtils.isEmptyString(safeword)) {
 					throw new BusinessException("资金密码不能为空");
 				}
@@ -143,18 +159,18 @@
 				if (safeword.length() < 6 || safeword.length() > 12) {
 					throw new BusinessException("资金密码必须6-12位");
 				}
-								
+
 				if (!this.partyService.checkSafeword(safeword, partyId)) {
 					throw new BusinessException("资金密码错误");
-				}				
+				}
 			}
 
 			if (!LockFilter.add(partyId)) {
 				throw new BusinessException(error);
 			}
-			
+
 			lock = true;
-			
+
 			Object object = this.sessionTokenService.cacheGet(session_token);
 			this.sessionTokenService.del(session_token);
 			if (null == object || !this.getLoginPartyId().equals((String) object)) {
@@ -167,10 +183,10 @@
 			withdraw.setAddress(from);
 			withdraw.setCurrency(currency);
 			withdraw.setDeviceIp(this.getIp());
-			
+
 			// 保存
 			this.withdrawService.saveApply(withdraw, channel, null, googleCode);
-			
+
 			Log log = new Log();
 			Party party = this.partyService.cachePartyBy(partyId, false);
 			log.setCategory(Constants.LOG_CATEGORY_SECURITY);
@@ -183,13 +199,13 @@
 
 		} catch (BusinessException e) {
 			if (105 == e.getSign()) {
-				resultObject.setCode("105");				
+				resultObject.setCode("105");
 			} else if (401 == e.getSign()) {
-				resultObject.setCode("401");				
+				resultObject.setCode("401");
 			} else if (506 == e.getSign()) {
-				resultObject.setCode("506");				
+				resultObject.setCode("506");
 			} else {
-				resultObject.setCode("1");				
+				resultObject.setCode("1");
 			}
 			resultObject.setMsg(e.getMessage());
 		} catch (Throwable t) {
@@ -203,7 +219,7 @@
 				LockFilter.remove(partyId);
 			}
 		}
-		
+
 		return resultObject;
 	}
 

--
Gitblit v1.9.3