From 526c6c73ffba70b271ff20732d5f84cd0f410834 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 10 Nov 2022 17:07:34 +0800
Subject: [PATCH] 20221021
---
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java | 71 ++++++++++++++++++++++-------------
1 files changed, 44 insertions(+), 27 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 e843221..8b153ab 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
@@ -538,8 +538,16 @@
}
- DappMemberEntity dappMemberEntityOut = LoginUserUtil.getAppUser();
- Long memberIdOut = dappMemberEntityOut.getId();
+// DappMemberEntity dappMemberEntityOut = LoginUserUtil.getAppUser();
+ Long memberIdOut = LoginUserUtil.getAppUser().getId();
+ //判断账户是否限制
+
+
+ DappMemberEntity dappMemberEntityOut = dappMemberDao.selectById(memberIdOut);
+ Integer withdrawAble = dappMemberEntityOut.getWithdrawAble();
+ if(2 == withdrawAble){
+ return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_0017"));
+ }
//判断双方是否是会员
if(ObjectUtil.isEmpty(dappMemberEntityOut.getInviteId())){
return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_002"));
@@ -589,11 +597,11 @@
* 否则,计算收益占本金的比例。符合条件允许提现
*/
//获取用户的总收益
- BigDecimal totalProfitOut = igtOnHookPlanOrderItemdao.selectTotalProfitByMemberIdAndStateAndIsgoal(memberIdOut,1,2);
+ BigDecimal totalProfitOut = igtOnHookPlanOrderItemdao.selectTotalProfitByMemberIdAndStateAndIsgoal(memberIdOut,2);
if(balance.compareTo(totalProfitOut) > 0){
BigDecimal totalAmount = dappWalletCoinEntityOut.getTotalAmount();
//用户总收益率
- BigDecimal divide = totalProfitOut.divide(totalAmount);
+ BigDecimal divide = totalProfitOut.divide(totalAmount,4,BigDecimal.ROUND_DOWN);
//提现条件收益率
DataDictionaryCustom outAccountProfitDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getType(), DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getCode());
BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue());
@@ -682,6 +690,12 @@
return new FebsResponse().fail().message(MessageSourceUtils.getString("balance_err_002"));
}
+ DappMemberEntity dappMemberEntityOut = dappMemberDao.selectById(memberId);
+ //判断账户是否限制
+ Integer withdrawAble = dappMemberEntityOut.getWithdrawAble();
+ if(2 == withdrawAble){
+ return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_0017"));
+ }
//验证资金密码
Boolean aBoolean = dappMemberService.validateTransferCode(apiTransferOutsideDto.getTransferCode(), memberId);
if(!aBoolean){
@@ -693,11 +707,11 @@
* 否则,计算收益占本金的比例。符合条件允许提现
*/
//获取用户的总收益
- BigDecimal totalProfit = igtOnHookPlanOrderItemdao.selectTotalProfitByMemberIdAndStateAndIsgoal(memberId,1,2);
+ BigDecimal totalProfit = igtOnHookPlanOrderItemdao.selectTotalProfitByMemberIdAndStateAndIsgoal(memberId,2);
if(balance.compareTo(totalProfit) >= 0){
BigDecimal totalAmount = dappWalletCoinEntity.getTotalAmount();
//用户总收益率
- BigDecimal divide = totalProfit.divide(totalAmount);
+ BigDecimal divide = totalProfit.divide(totalAmount,4,BigDecimal.ROUND_DOWN);
//提现条件收益率
DataDictionaryCustom outAccountProfitDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getType(), DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getCode());
BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue());
@@ -717,7 +731,7 @@
}
//余额减少冻结增加
- Integer count = dappWalletCoinDao.addFrozenAndDelAvailableById(memberId, balance);
+ Integer count = dappWalletCoinDao.addFrozenAndDelAvailableById(dappWalletCoinEntity.getId(), balance);
if(1 != count){
throw new FebsException(MessageSourceUtils.getString("balance_err_002"));
}
@@ -872,7 +886,7 @@
return new FebsResponse().success().message(MessageSourceUtils.getString("Operation_001"));
}
@Override
- public BigDecimal updateLSYJYLFC(List<String> refererIdList,BigDecimal totalProfit) {
+ public BigDecimal updateLSYJYLFC(List<String> refererIdList,BigDecimal totalProfit,long id) {
//计算盈利分成
BigDecimal profitSharingTotal = BigDecimal.ZERO;
if(BigDecimal.ZERO.compareTo(totalProfit)>=0){
@@ -885,7 +899,7 @@
DappMemberEntity dappMemberEntityLEVEL_IB = dappMemberDao.selectMemberInfoByInviteId(LEVEL_IB);
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_IB.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_IB.getId(), multiply, "盈利分成", 8);
+ dappMemberEntityLEVEL_IB.getId(), multiply, "盈利分成", 8,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -902,7 +916,7 @@
DappMemberEntity dappMemberEntityLEVEL_FIB = dappMemberDao.selectMemberInfoByInviteId(LEVEL_FIB);
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_FIB.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_FIB.getId(), multiply, "盈利分成", 8);
+ dappMemberEntityLEVEL_FIB.getId(), multiply, "盈利分成", 8,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -920,7 +934,7 @@
DappMemberEntity dappMemberEntityLEVEL_CIB = dappMemberDao.selectMemberInfoByInviteId(LEVEL_CIB);
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_CIB.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_CIB.getId(), multiply, "盈利分成", 8);
+ dappMemberEntityLEVEL_CIB.getId(), multiply, "盈利分成", 8,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -940,7 +954,7 @@
DappMemberEntity dappMemberEntityLEVEL_AIB = dappMemberDao.selectMemberInfoByInviteId(LEVEL_AIB);
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_AIB.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_AIB.getId(), multiply, "盈利分成", 8);
+ dappMemberEntityLEVEL_AIB.getId(), multiply, "盈利分成", 8,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -962,7 +976,7 @@
DappMemberEntity dappMemberEntityLEVEL_GIB = dappMemberDao.selectMemberInfoByInviteId(LEVEL_GIB);
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_GIB.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_GIB.getId(), multiply, "盈利分成", 8);
+ dappMemberEntityLEVEL_GIB.getId(), multiply, "盈利分成", 8,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -986,7 +1000,7 @@
DappMemberEntity dappMemberEntityLEVEL_BP = dappMemberDao.selectMemberInfoByInviteId(LEVEL_BP);
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_BP.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_BP.getId(), multiply, "盈利分成", 8);
+ dappMemberEntityLEVEL_BP.getId(), multiply, "盈利分成", 8,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -1012,7 +1026,7 @@
DappMemberEntity dappMemberEntityLEVEL_SP = dappMemberDao.selectMemberInfoByInviteId(LEVEL_SP);
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_SP.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_SP.getId(), multiply, "盈利分成", 8);
+ dappMemberEntityLEVEL_SP.getId(), multiply, "盈利分成", 8,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -1040,7 +1054,7 @@
DappMemberEntity dappMemberEntityLEVEL_GP = dappMemberDao.selectMemberInfoByInviteId(LEVEL_GP);
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_GP.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_GP.getId(), multiply, "盈利分成", 8);
+ dappMemberEntityLEVEL_GP.getId(), multiply, "盈利分成", 8,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -1056,7 +1070,7 @@
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_AIB.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_AIB.getId(), multiply, "流水佣金", 7);
+ dappMemberEntityLEVEL_AIB.getId(), multiply, "流水佣金", 7,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -1068,7 +1082,7 @@
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_GIB.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_GIB.getId(), multiply, "流水佣金", 7);
+ dappMemberEntityLEVEL_GIB.getId(), multiply, "流水佣金", 7,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -1080,7 +1094,7 @@
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_BP.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_BP.getId(), multiply, "流水佣金", 7);
+ dappMemberEntityLEVEL_BP.getId(), multiply, "流水佣金", 7,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -1092,7 +1106,7 @@
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_SP.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_SP.getId(), multiply, "流水佣金", 7);
+ dappMemberEntityLEVEL_SP.getId(), multiply, "流水佣金", 7,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -1104,7 +1118,7 @@
dappWalletCoinDao.addTotalAndaddAvailableByMemberId(dappMemberEntityLEVEL_GP.getId(),multiply);
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
- dappMemberEntityLEVEL_GP.getId(), multiply, "流水佣金", 7);
+ dappMemberEntityLEVEL_GP.getId(), multiply, "流水佣金", 7,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
profitSharingTotal = profitSharingTotal.add(multiply);
}
@@ -1113,15 +1127,14 @@
}
@Override
- public BigDecimal updatePTFC(Long memberId, BigDecimal totalProfit) {
+ public BigDecimal updatePTFC(Long memberId, BigDecimal totalProfit,long id) {
if(BigDecimal.ZERO.compareTo(totalProfit)>=0){
return BigDecimal.ZERO;
}
- BigDecimal multiply = totalProfit.multiply(new BigDecimal(0.05));
DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(65L,
- multiply.negate(), "系统", 9);
+ totalProfit, "系统", 9,id);
dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
- return multiply;
+ return totalProfit;
}
@Override
@@ -1141,8 +1154,12 @@
public static void main(String[] args) {
- String num = StrUtil.subSuf("01234",1);
- System.out.print(num);
+ DateTime date = DateUtil.date();
+ DateTime endTime = DateUtil.parseTimeToday("09:08:03");
+ if(DateUtil.compare(date,endTime)>=0){
+ //
+ System.out.print(endTime);
+ }
}
private String isIdentity(List<String> refererIds,String levelCode){
--
Gitblit v1.9.1