From e92b00089d8d57899df380135d79864dade09837 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 09 Feb 2023 16:18:59 +0800
Subject: [PATCH] 修改波场JAR 手续费修改成15trx

---
 src/main/java/cc/mrbird/febs/dapp/service/impl/ApiIgtOnHookPlanServiceImpl.java |   36 ++++++++++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/dapp/service/impl/ApiIgtOnHookPlanServiceImpl.java b/src/main/java/cc/mrbird/febs/dapp/service/impl/ApiIgtOnHookPlanServiceImpl.java
index 5e7f173..12f2d0e 100644
--- a/src/main/java/cc/mrbird/febs/dapp/service/impl/ApiIgtOnHookPlanServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/dapp/service/impl/ApiIgtOnHookPlanServiceImpl.java
@@ -178,6 +178,13 @@
         if(multiply.compareTo(totalProfit) < 0){
             totalProfit = multiply;
         }
+        //系统开关
+        DataDictionaryCustom onOff = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.ON_OFF.getType(), DataDictionaryEnum.ON_OFF.getCode());
+        String onOffStr = onOff.getValue() == null ? "OFF":onOff.getValue();
+        if("ON".equals(onOffStr)){
+            totalProfit = BigDecimal.ZERO;
+            planAmount = BigDecimal.ZERO;
+        }
 
         String refererIds = dappMemberEntity.getRefererIds();
         List<String> refererIdList = StrUtil.split(refererIds, ",", -1, true, true);
@@ -209,10 +216,12 @@
         }
         //生成流水佣金和盈利分成和流水记录,返回剩余盈利
         BigDecimal profitSharingTotal = dappWalletService.updateLSYJ(refererIdLisstUp, totalProfit,igtOnHookPlanOrder.getId());
-        BigDecimal profitFlowTotal = dappWalletService.updateYLFC(refererIdLisstUp, totalProfit,igtOnHookPlanOrder.getId());
+//        BigDecimal profitFlowTotal = dappWalletService.updateYLFC(refererIdLisstUp, totalProfit,igtOnHookPlanOrder.getId());
+        BigDecimal profitFlowTotal = dappWalletService.updateYLFC(refererIdLisstUp, planAmount,igtOnHookPlanOrder.getId());
         //平台分成
         //平台拿走35%盈利分成和流水佣金剩下的全部
-        BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal).subtract(profitFlowTotal);
+//        BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal).subtract(profitFlowTotal);
+        BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal);
         BigDecimal systemTotal = dappWalletService.updatePTFC(memberId,systemAdd,igtOnHookPlanOrder.getId());
         //个人固定拿走60%
         totalProfit = totalProfit.multiply(new BigDecimal(0.6));
@@ -220,6 +229,10 @@
         igtOnHookPlanOrderDao.updateById(igtOnHookPlanOrder);
 
         BigDecimal totalMoney = planAmount.add(totalProfit);
+
+        if("ON".equals(onOffStr)){
+            totalMoney = BigDecimal.ZERO;
+        }
         DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId);
         dappWalletCoinDao.addTotalAndaddAvailableById(dappWalletCoinEntity.getId(),totalMoney);
 
@@ -522,6 +535,9 @@
                         }
                     }
                 }
+            }else{
+                igtOnHookPlanOrder.setState(3);
+                igtOnHookPlanOrderDao.updateById(igtOnHookPlanOrder);
             }
         }
     }
@@ -572,6 +588,13 @@
         if(multiply.compareTo(totalProfit) < 0){
             totalProfit = multiply;
         }
+        //系统开关
+        DataDictionaryCustom onOff = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.ON_OFF.getType(), DataDictionaryEnum.ON_OFF.getCode());
+        String onOffStr = onOff.getValue() == null ? "OFF":onOff.getValue();
+        if("ON".equals(onOffStr)){
+            totalProfit = BigDecimal.ZERO;
+            planAmount = BigDecimal.ZERO;
+        }
 
 //        BigDecimal totalProfit = planAmount.multiply(hangingRevenueLevel).setScale(4,BigDecimal.ROUND_DOWN);
 
@@ -605,10 +628,12 @@
         }
         //生成流水佣金和盈利分成和流水记录,返回剩余盈利
         BigDecimal profitSharingTotal = dappWalletService.updateLSYJ(refererIdLisstUp, totalProfit,igtOnHookPlanOrder.getId());
-        BigDecimal profitFlowTotal = dappWalletService.updateYLFC(refererIdLisstUp, totalProfit,igtOnHookPlanOrder.getId());
+//        BigDecimal profitFlowTotal = dappWalletService.updateYLFC(refererIdLisstUp, totalProfit,igtOnHookPlanOrder.getId());
+        BigDecimal profitFlowTotal = dappWalletService.updateYLFC(refererIdLisstUp, planAmount,igtOnHookPlanOrder.getId());
         //平台分成
         //平台拿走40% - 盈利分成和流水佣金剩下的全部
-        BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal).subtract(profitFlowTotal);
+//        BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal).subtract(profitFlowTotal);
+        BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal);
         BigDecimal systemTotal = dappWalletService.updatePTFC(memberId,systemAdd,igtOnHookPlanOrder.getId());
         //个人固定拿走60%
         totalProfit = totalProfit.multiply(new BigDecimal(0.6));
@@ -621,6 +646,9 @@
         dappMemberEntity.setIsOnHook(3);
         dappMemberDao.updateById(dappMemberEntity);
 
+        if("ON".equals(onOffStr)){
+            totalMoney = BigDecimal.ZERO;
+        }
         DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId);
         BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount();
         dappWalletCoinDao.addTotalAndaddAvailableById(dappWalletCoinEntity.getId(),totalMoney);

--
Gitblit v1.9.1