From 97d07d0da594e424e5b98e67581ebdcf76ea95cb Mon Sep 17 00:00:00 2001
From: zainali5120 <512061637@qq.com>
Date: Mon, 16 Nov 2020 21:03:14 +0800
Subject: [PATCH] 功能同步

---
 src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java |   60 ++++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 40 insertions(+), 20 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 0322221..59cc90e 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,7 +73,9 @@
 	private final AgentFriendRelationMapper agentFriendRelationMapper;
 
 	private final RedisUtils redisUtils;
-	
+	private final TdFinancialReordDao tdFinancialReordDao;
+	private final TdCoinChargeDao tdCoinChargeDao;
+
 	@Override
 	public IPage<AgentFriendRelationEntity> findAgentInfoListInPage(AgentFriendRelationEntity agentFriendRelationEntity,
 			QueryRequest request) {
@@ -441,6 +427,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 +524,37 @@
 //				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);
+				 // 插入冲币记录
+
+				 TdCoinCharge tdCoinCharge = new TdCoinCharge();
+				 tdCoinCharge.setAddress(address);
+				 tdCoinCharge.setAmount(amount);
+				 tdCoinCharge.setMemberId(coinAddressEntity.getMemberId());
+				 tdCoinCharge.setSymbol("USDT");
+				 tdCoinCharge.setTag("ERC20");
+				 tdCoinCharge.setTransHash("");
+				 tdCoinCharge.setCreateTime(new Date());
+				 tdCoinCharge.setLastAmount(amount);
+				 tdCoinCharge.setStatus(1);
+				 tdCoinChargeDao.insert(tdCoinCharge);
+				 // 更新钱包
+				 memberCoinAddressMapper.updateSuanliWallet(walletId,amount);
+			 }
+		 }
 
 		/**
 		//短信提醒

--
Gitblit v1.9.1