| | |
| | | // 非代理推代理,非代理上级拿的收益比例 |
| | | DataDictionaryCustom indirectPerDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.UNAGENT_TO_AGENT_PARENT.getType(), DataDictionaryEnum.UNAGENT_TO_AGENT_PARENT.getCode()); |
| | | |
| | | |
| | | // 非代理推代理,非代理上级拿的收益比例 |
| | | DataDictionaryCustom indirectPerTwoDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.UNAGENT_TO_AGENT_PARENT_TWO.getType(), DataDictionaryEnum.UNAGENT_TO_AGENT_PARENT_TWO.getCode()); |
| | | |
| | | |
| | | // 非代理推代理,非代理的直推收益比例 |
| | | DataDictionaryCustom unAgentDirectDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.UNAGENT_TO_AGENT.getType(), DataDictionaryEnum.UNAGENT_TO_AGENT.getCode()); |
| | | |
| | |
| | | |
| | | // 直推奖 |
| | | BigDecimal profit = amount.multiply(profitPer.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); |
| | | log.info("直推奖励:{}", profit); |
| | | changeScoreAndCommission(parentMember.getId(), profit, MoneyFlowTypeEnum.DIRECT_BONUS.getValue(), orderInfo.getOrderNo()); |
| | | |
| | | // 非代理推代理 |
| | |
| | | continue; |
| | | } |
| | | |
| | | int index = 1; |
| | | for (MallMember mallMember : mallMembers) { |
| | | if (!item.getGoodsLevel().equals(mallMember.getAccountLevel())) { |
| | | break; |
| | | } |
| | | |
| | | if (index != 2) { |
| | | indirectPerDic = indirectPerTwoDic; |
| | | } |
| | | BigDecimal doubleParentProfit = profit.multiply(new BigDecimal(indirectPerDic.getValue())); |
| | | changeScoreAndCommission(mallMember.getId(), doubleParentProfit, MoneyFlowTypeEnum.DIRECT_BONUS.getValue(), orderInfo.getOrderNo()); |
| | | index++; |
| | | } |
| | | } |
| | | // ----- 直推奖 end ------- |
| | |
| | | continue; |
| | | } |
| | | |
| | | walletService.add(direct, parent.getId(), "commission"); |
| | | moneyFlowService.addMoneyFlow(parent.getId(), direct, MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.COMMISSION.getValue()); |
| | | walletService.add(direct, parent.getId(), "balance"); |
| | | moneyFlowService.addMoneyFlow(parent.getId(), direct, MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.BALANCE.getValue()); |
| | | moneyFlowService.addMoneyFlow(parent.getId(), direct.negate(), MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.SCORE.getValue()); |
| | | } |
| | | // =======隔代奖== end ===== |
| | |
| | | } |
| | | |
| | | income = map.get("amount"); |
| | | walletService.add(income, memberId, "commission"); |
| | | moneyFlowService.addMoneyFlow(memberId, income, type, orderNo, FlowTypeEnum.COMMISSION.getValue()); |
| | | walletService.add(income, memberId, "balance"); |
| | | moneyFlowService.addMoneyFlow(memberId, income, type, orderNo, FlowTypeEnum.BALANCE.getValue()); |
| | | moneyFlowService.addMoneyFlow(memberId, income.negate(), type, orderNo, FlowTypeEnum.SCORE.getValue()); |
| | | return income; |
| | | } |
| | |
| | | } |
| | | |
| | | memberList.add(item); |
| | | levelMemberMap.put(item.getLevel(), memberList); |
| | | levelMemberMap.put(level, memberList); |
| | | }); |
| | | |
| | | if (levelMemberMap.isEmpty()) { |