From 18ec469960104139455f8a3863e3c9e8fb1f32d2 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Sun, 29 Nov 2020 14:48:11 +0800
Subject: [PATCH] Merge branch 'pilot' of https://gitee.com/chonggaoxiao/new_excoin into pilot
---
src/main/java/com/xcong/excoin/modules/coin/entity/TrcAddressEntity.java | 2 ++
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java | 8 +++++++-
src/main/resources/mapper/member/SrcAddressDao.xml | 6 +++++-
src/main/java/com/xcong/excoin/modules/coin/dao/TrcAddressDao.java | 2 ++
src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java | 1 +
src/main/java/com/xcong/excoin/modules/symbols/service/impl/SymbolsServiceImpl.java | 2 +-
src/main/resources/application.yml | 9 ++++++---
7 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java b/src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java
index 4c24070..47010f0 100644
--- a/src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java
@@ -72,6 +72,7 @@
TrcAddressEntity address = trcAddressDao.selectOneSrcAddressUnUse();
address.setMemberId(member.getId());
address.setIsUse(1);
+ address.setSystemFlag(1);
TRC20ApiUtils.createWallet(member.getId(), member.getInviteId(), "USDT", address.getAddress());
trcAddressDao.updateById(address);
diff --git a/src/main/java/com/xcong/excoin/modules/coin/dao/TrcAddressDao.java b/src/main/java/com/xcong/excoin/modules/coin/dao/TrcAddressDao.java
index c0d5a23..2580cb2 100644
--- a/src/main/java/com/xcong/excoin/modules/coin/dao/TrcAddressDao.java
+++ b/src/main/java/com/xcong/excoin/modules/coin/dao/TrcAddressDao.java
@@ -13,4 +13,6 @@
TrcAddressEntity selectSrcAddressByMemberId(@Param("memberId") Long memberId);
TrcAddressEntity selectOneSrcAddressUnUse();
+
+ TrcAddressEntity selectTrcAddressByAddress(@Param("address") String address);
}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/entity/TrcAddressEntity.java b/src/main/java/com/xcong/excoin/modules/coin/entity/TrcAddressEntity.java
index 326c230..563cbd5 100644
--- a/src/main/java/com/xcong/excoin/modules/coin/entity/TrcAddressEntity.java
+++ b/src/main/java/com/xcong/excoin/modules/coin/entity/TrcAddressEntity.java
@@ -21,4 +21,6 @@
private int isUse;
private Long memberId;
+
+ private Integer systemFlag;
}
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 cc40335..9f54516 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
@@ -14,7 +14,9 @@
import com.xcong.excoin.common.system.dto.RegisterDto;
import com.xcong.excoin.common.system.service.CommonService;
import com.xcong.excoin.modules.coin.dao.MemberAccountMoneyChangeDao;
+import com.xcong.excoin.modules.coin.dao.TrcAddressDao;
import com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange;
+import com.xcong.excoin.modules.coin.entity.TrcAddressEntity;
import com.xcong.excoin.modules.member.dao.*;
import com.xcong.excoin.modules.member.entity.*;
import com.xcong.excoin.modules.member.parameter.dto.MemberAddCoinAddressDto;
@@ -109,6 +111,9 @@
@Resource
private MemberWalletContractSimulateDao memberWalletContractSimulateDao;
+
+ @Resource
+ private TrcAddressDao trcAddressDao;
@Transactional()
@Override
@@ -950,7 +955,8 @@
columnMap.put("is_biyict", MemberCoinAddressEntity.IS_BIYICT_YES);
List<MemberCoinAddressEntity> selectByMap = memberCoinAddressDao.selectByMap(columnMap);
TdCoinWallet tdCoinWallet = memberCoinAddressDao.selectTdCoinWalletByAddress(memberSubmitCoinApplyDto.getAddress(), CoinTypeEnum.USDT.name());
- if (CollUtil.isEmpty(selectByMap) && tdCoinWallet == null) {
+ TrcAddressEntity trcAddressEntity = trcAddressDao.selectTrcAddressByAddress(memberSubmitCoinApplyDto.getAddress());
+ if (CollUtil.isEmpty(selectByMap) && tdCoinWallet == null && trcAddressEntity == null) {
memberCoinWithdrawEntity.setIsInside(MemberCoinWithdrawEntity.ISINSIDE_NO);
} else {
memberCoinWithdrawEntity.setIsInside(MemberCoinWithdrawEntity.ISINSIDE_YES);
diff --git a/src/main/java/com/xcong/excoin/modules/symbols/service/impl/SymbolsServiceImpl.java b/src/main/java/com/xcong/excoin/modules/symbols/service/impl/SymbolsServiceImpl.java
index 68de18d..1c50dcd 100644
--- a/src/main/java/com/xcong/excoin/modules/symbols/service/impl/SymbolsServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/symbols/service/impl/SymbolsServiceImpl.java
@@ -147,7 +147,7 @@
homeSymbolsVo.setSymbol(symbol);
homeSymbolsVo.setCurrentPrice(newestPrice);
homeSymbolsVo.setUpOrDown(upOrDown);
- homeSymbolsVo.setVolume(symbolObject.getAmount());
+ homeSymbolsVo.setVolume(symbolObject.getVolume());
if (cnyUsdtExchange != null) {
BigDecimal cnyPrice = newestPrice.multiply(cnyUsdtExchange.getValue()).setScale(2, BigDecimal.ROUND_HALF_UP);
homeSymbolsVo.setCnyPrice(cnyPrice);
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index c873d74..c687974 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -7,9 +7,12 @@
profiles:
active: dev
datasource:
- url: jdbc:mysql://180.215.221.145:3306/db_pilot?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
- username: pilot
- password: pilot123!@#
+# url: jdbc:mysql://180.215.221.145:3306/db_pilot?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
+# username: pilot
+# password: pilot123!@#
+ url: jdbc:mysql://120.27.238.55:3306/pilot_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
+ username: ct_test
+ password: 123456
driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
diff --git a/src/main/resources/mapper/member/SrcAddressDao.xml b/src/main/resources/mapper/member/SrcAddressDao.xml
index 1737811..3f68088 100644
--- a/src/main/resources/mapper/member/SrcAddressDao.xml
+++ b/src/main/resources/mapper/member/SrcAddressDao.xml
@@ -3,10 +3,14 @@
<mapper namespace="com.xcong.excoin.modules.coin.dao.TrcAddressDao">
<select id="selectSrcAddressByMemberId" resultType="com.xcong.excoin.modules.coin.entity.TrcAddressEntity">
- select * from trc_address where member_id=#{memberId} and is_use=1
+ select * from trc_address where member_id=#{memberId} and is_use=1 and system_flag = 1
</select>
<select id="selectOneSrcAddressUnUse" resultType="com.xcong.excoin.modules.coin.entity.TrcAddressEntity">
select * from trc_address where is_use=2 limit 1
</select>
+
+ <select id="selectTrcAddressByAddress" resultType="com.xcong.excoin.modules.coin.entity.TrcAddressEntity">
+ select * from trc_address where address = #{address} and is_use = 1
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1