| | |
| | | import cc.mrbird.febs.dapp.dto.ApiStartDto; |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.enumerate.MemberLevelEnum; |
| | | import cc.mrbird.febs.dapp.enumerate.MemberOnHookPlanEnum; |
| | | import cc.mrbird.febs.dapp.mapper.*; |
| | | import cc.mrbird.febs.dapp.service.ApiIgtOnHookPlanService; |
| | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | //根据上下级,筛选用户的级别 |
| | | ArrayList<String> refererIdLisstUp = new ArrayList<>(); |
| | | String levelNext = MemberLevelEnum.LEVEL_MB.getType(); |
| | | for(String inviteId : refererIdList){ |
| | | DappMemberEntity dappMemberUp = dappMemberDao.selectMemberInfoByInviteId(inviteId); |
| | | String identityUp = dappMemberUp.getIdentity(); |
| | | int compareLevelResult = MemberLevelEnum.LEVEL_MB.compareLevel(identityUp, levelNext); |
| | | if(0 < compareLevelResult){ |
| | | levelNext = identityUp; |
| | | refererIdLisstUp.add(inviteId); |
| | | } |
| | | } |
| | | //生成流水佣金和盈利分成和流水记录,返回剩余盈利 |
| | | BigDecimal profitSharingTotal = dappWalletService.updateLSYJYLFC(refererIdList, totalProfit.multiply(new BigDecimal(0.4)),igtOnHookPlanOrder.getId()); |
| | | //生成流水佣金和盈利分成和流水记录,返回盈利分成和流水佣金总共分成 |
| | | // BigDecimal profitSharingTotal = dappWalletService.updateLSYJYLFC(refererIdList, totalProfit,igtOnHookPlanOrder.getId()); |
| | | BigDecimal profitSharingTotal = dappWalletService.updateLSYJ(refererIdLisstUp, totalProfit.multiply(new BigDecimal(0.2)),igtOnHookPlanOrder.getId()); |
| | | BigDecimal profitFlowTotal = dappWalletService.updateYLFC(refererIdLisstUp, totalProfit.multiply(new BigDecimal(0.2)),igtOnHookPlanOrder.getId()); |
| | | //平台分成 |
| | | //平台拿走35%盈利分成和流水佣金剩下的全部 |
| | | BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal); |
| | | BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal).subtract(profitFlowTotal); |
| | | BigDecimal systemTotal = dappWalletService.updatePTFC(memberId,systemAdd,igtOnHookPlanOrder.getId()); |
| | | //个人固定拿走60% |
| | | totalProfit = totalProfit.multiply(new BigDecimal(0.6)); |
| | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | //根据上下级,筛选用户的级别 |
| | | ArrayList<String> refererIdLisstUp = new ArrayList<>(); |
| | | String levelNext = MemberLevelEnum.LEVEL_MB.getType(); |
| | | for(String inviteId : refererIdList){ |
| | | DappMemberEntity dappMemberUp = dappMemberDao.selectMemberInfoByInviteId(inviteId); |
| | | String identityUp = dappMemberUp.getIdentity(); |
| | | int compareLevelResult = MemberLevelEnum.LEVEL_MB.compareLevel(identityUp, levelNext); |
| | | if(0 < compareLevelResult){ |
| | | levelNext = identityUp; |
| | | refererIdLisstUp.add(inviteId); |
| | | } |
| | | } |
| | | //生成流水佣金和盈利分成和流水记录,返回剩余盈利 |
| | | BigDecimal profitSharingTotal = dappWalletService.updateLSYJYLFC(refererIdList, totalProfit.multiply(new BigDecimal(0.4)),igtOnHookPlanOrder.getId()); |
| | | BigDecimal profitSharingTotal = dappWalletService.updateLSYJ(refererIdLisstUp, totalProfit.multiply(new BigDecimal(0.2)),igtOnHookPlanOrder.getId()); |
| | | BigDecimal profitFlowTotal = dappWalletService.updateYLFC(refererIdLisstUp, totalProfit.multiply(new BigDecimal(0.2)),igtOnHookPlanOrder.getId()); |
| | | //平台分成 |
| | | //平台拿走35%盈利分成和流水佣金剩下的全部 |
| | | BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal); |
| | | BigDecimal systemAdd = totalProfit.multiply(new BigDecimal(0.4)).subtract(profitSharingTotal).subtract(profitFlowTotal); |
| | | BigDecimal systemTotal = dappWalletService.updatePTFC(memberId,systemAdd,igtOnHookPlanOrder.getId()); |
| | | //个人固定拿走60% |
| | | totalProfit = totalProfit.multiply(new BigDecimal(0.6)); |