From 1047866e4e73890bf64c9b35f1a7043b543d64fe Mon Sep 17 00:00:00 2001
From: zainali5120 <512061637@qq.com>
Date: Sun, 15 Nov 2020 11:07:48 +0800
Subject: [PATCH] 交易所到算力内部

---
 src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java |   44 +++++++++++++++++++++++++-------------------
 1 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java b/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
index fec245b..9a0677e 100644
--- a/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
@@ -13,24 +13,8 @@
 import com.xcong.excoin.modules.Sms106Send;
 import com.xcong.excoin.modules.member.dto.MemberDetailConfirmDto;
 import com.xcong.excoin.modules.member.dto.MemberLimitDto;
-import com.xcong.excoin.modules.member.entity.AgentFriendRelationEntity;
-import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity;
-import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity;
-import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity;
-import com.xcong.excoin.modules.member.entity.MemberCoinChargeEntity;
-import com.xcong.excoin.modules.member.entity.MemberCoinWithdrawEntity;
-import com.xcong.excoin.modules.member.entity.MemberEntity;
-import com.xcong.excoin.modules.member.entity.MemberQuickBuySaleEntity;
-import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
-import com.xcong.excoin.modules.member.mapper.AgentFriendRelationMapper;
-import com.xcong.excoin.modules.member.mapper.MemberAccountMoneyChangeMapper;
-import com.xcong.excoin.modules.member.mapper.MemberAuthenticationMapper;
-import com.xcong.excoin.modules.member.mapper.MemberCoinAddressMapper;
-import com.xcong.excoin.modules.member.mapper.MemberCoinChargeMapper;
-import com.xcong.excoin.modules.member.mapper.MemberCoinWithdrawMapper;
-import com.xcong.excoin.modules.member.mapper.MemberMapper;
-import com.xcong.excoin.modules.member.mapper.MemberQuickBuySaleMapper;
-import com.xcong.excoin.modules.member.mapper.MemberWalletCoinMapper;
+import com.xcong.excoin.modules.member.entity.*;
+import com.xcong.excoin.modules.member.mapper.*;
 import com.xcong.excoin.modules.member.service.EthService;
 import com.xcong.excoin.modules.member.service.IMemberService;
 import com.xcong.excoin.modules.member.service.RocService;
@@ -89,6 +73,7 @@
 	private final AgentFriendRelationMapper agentFriendRelationMapper;
 
 	private final RedisUtils redisUtils;
+	private final TdFinancialReordDao tdFinancialReordDao;
 
 	@Override
 	public IPage<AgentFriendRelationEntity> findAgentInfoListInPage(AgentFriendRelationEntity agentFriendRelationEntity,
@@ -441,6 +426,10 @@
 		String symbol = selectById.getSymbol();
 		String address = selectById.getAddress();
 		int status = selectById.getStatus();
+		BigDecimal feeAmount = selectById.getFeeAmount();
+		if(feeAmount==null){
+			feeAmount = BigDecimal.ZERO;
+		}
 		BigDecimal amount = selectById.getAmount();
 		if(status != 1) {
 			return new FebsResponse().fail().message("只有等待审核的状态才能确认!");
@@ -534,7 +523,24 @@
 //				usdtStr = usdtStr.substring(0, usdtStr.lastIndexOf("."));
 //			}
 //			String s = ethService.tokenSend(address, usdtStr, null);
-		}
+			 // 判断是不是到交易所的
+			 MemberCoinAddressEntity coinAddressEntity = memberCoinAddressMapper.selectSuanliWallet(address);
+			 if(coinAddressEntity!=null){
+			 	// 是的
+				 Long walletId = coinAddressEntity.getId();
+				 // 插入充值记录
+				 TdFinancialReord financialReord = new TdFinancialReord();
+				 financialReord.setAmount(amount);
+				 financialReord.setTitle("USDT链上充值");
+				 financialReord.setContent("USDT链上充值");
+				 financialReord.setSymbol(symbol);
+				 financialReord.setCreateTime(new Date());
+				 financialReord.setMemId(coinAddressEntity.getMemberId());
+				 tdFinancialReordDao.insert(financialReord);
+				 // 更新钱包
+				 memberCoinAddressMapper.updateSuanliWallet(walletId,amount);
+			 }
+		 }
 
 		/**
 		//短信提醒

--
Gitblit v1.9.1