From eca9bca18d94d5ee8aaf35d44336f58706609903 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 01 Nov 2022 11:40:00 +0800
Subject: [PATCH] 20221021
---
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 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 3cc0f7f..e843221 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
@@ -670,6 +670,12 @@
if(BigDecimal.ZERO.compareTo(balance) >= 0){
return new FebsResponse().fail().message(MessageSourceUtils.getString("balance_err_001"));
}
+ DataDictionaryCustom withDrawDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.WITHDRAW_MAX.getType()
+ , DataDictionaryEnum.WITHDRAW_MAX.getCode());
+ BigDecimal withDrawMax = withDrawDic.getValue() == null ? new BigDecimal("100") : new BigDecimal(withDrawDic.getValue());
+ if(withDrawMax.compareTo(balance) > 0){
+ return new FebsResponse().fail().message(MessageSourceUtils.getString("balance_err_003"));
+ }
DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId);
BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount();
if(balance.compareTo(availableAmount) > 0){
@@ -869,6 +875,9 @@
public BigDecimal updateLSYJYLFC(List<String> refererIdList,BigDecimal totalProfit) {
//计算盈利分成
BigDecimal profitSharingTotal = BigDecimal.ZERO;
+ if(BigDecimal.ZERO.compareTo(totalProfit)>=0){
+ return profitSharingTotal;
+ }
if(CollUtil.isNotEmpty(refererIdList)){
String LEVEL_IB = isIdentity(refererIdList, DataDictionaryEnum.LEVEL_IB.getCode());
if(!DataDictionaryEnum.LEVEL_IB.getCode().equals(LEVEL_IB)){
@@ -1105,9 +1114,12 @@
@Override
public BigDecimal updatePTFC(Long memberId, BigDecimal totalProfit) {
+ if(BigDecimal.ZERO.compareTo(totalProfit)>=0){
+ return BigDecimal.ZERO;
+ }
BigDecimal multiply = totalProfit.multiply(new BigDecimal(0.05));
- DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- memberId, multiply.negate(), "系统", 9);
+ DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(65L,
+ multiply.negate(), "系统", 9);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
return multiply;
}
--
Gitblit v1.9.1