From 4edd2cccf8a70bb0cd78eb55750bf0a5502f571f Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 05 Jun 2023 11:56:14 +0800
Subject: [PATCH] twoCoin项目修改
---
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java | 35 +++++++++++++++++++++++++++++++----
1 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
index 5d6327c..cb4b592 100644
--- a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -363,6 +363,15 @@
* A币卖币规则,卖出100%销毁,30%回流底池溢价
*/
DappMemberEntity member = LoginUserUtil.getAppUser();
+
+ DataDictionaryCustom systemStateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+ PoolEnum.SYSTEM.getType(),
+ PoolEnum.SYSTEM.getCode()
+ );
+ String value = systemStateDic.getValue();
+ if("STOP".equals(value)){
+ throw new FebsException("Not yet open");
+ }
//提币数量
BigDecimal amount = withdrawDto.getAmount();
if(BigDecimal.ZERO.compareTo(amount) >= 0){
@@ -630,7 +639,7 @@
);
String value = systemStateDic.getValue();
if("STOP".equals(value)){
- throw new FebsException("功能升级中");
+ throw new FebsException("Not yet open");
}
String upgrade = redisUtils.getString("APP_UPGRADE");
if ("upgrade".equals(upgrade)) {
@@ -695,9 +704,27 @@
if(amountIn.compareTo(new BigDecimal(100)) != 0){
throw new FebsException("Limit per address 100 USDT");
}
- BigDecimal amountInLast = dappChargeUsdtMapper.selectByMaxAmountMemberId(member.getId());
- if(BigDecimal.ZERO.compareTo(amountInLast) < 0){
- throw new FebsException("Limit per address 100 USDT");
+
+// BigDecimal amountInLast = dappChargeUsdtMapper.selectByMaxAmountMemberId(member.getId());
+ /**
+ * 限制用户买入总额,
+ * 目前每人限一单,总金额限制100U
+ */
+ BigDecimal amountInLast = dappChargeUsdtMapper.selectBySumAmountMemberId(member.getId());
+ DataDictionaryCustom systemAddressDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+ PoolEnum.SYSTEM_ADDRESS.getType(),
+ PoolEnum.SYSTEM_ADDRESS.getCode()
+ );
+ if(StrUtil.isNotEmpty(systemAddressDic.getValue())){
+ if(!systemAddressDic.getValue().contains(dappMemberEntity.getAddress())){
+ if(BigDecimal.ZERO.compareTo(amountInLast) < 0){
+ throw new FebsException("Limit per address 100 USDT");
+ }
+ }
+ }else{
+ if(BigDecimal.ZERO.compareTo(amountInLast) < 0){
+ throw new FebsException("Limit per address 100 USDT");
+ }
}
/**
* 验证账户是否有入金金额的10%的AUSD
--
Gitblit v1.9.1