fix
Hentua
2023-04-25 6c98fa6643e00e6a31b87d58184b6470f990e76f
src/main/java/cc/mrbird/febs/mall/service/impl/MemberProfitServiceImpl.java
@@ -77,8 +77,8 @@
        // 非代理推代理,非代理的直推收益比例
        DataDictionaryCustom unAgentDirectDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.UNAGENT_TO_AGENT.getType(), DataDictionaryEnum.UNAGENT_TO_AGENT.getCode());
        // 父级会员直推人数
        Integer directCnt = mallMemberMapper.selectOwnCntByInviteIdAndAccountLevel(parentMember.getInviteId(), parentMember.getAccountLevel());
        // 父级需要拥有 此会员 对应级别的直推数量
        Integer directCnt = mallMemberMapper.selectOwnCntByInviteIdAndAccountLevel(parentMember.getInviteId(), member.getAccountLevel());
        List<DataDictionaryCustom> dataDices = dataDictionaryCustomMapper.selectDicByType(DataDictionaryEnum.DIRECT_BONUS_SETTING.getType());
        directCnt = directCnt == null ? 0 : directCnt;
@@ -110,8 +110,7 @@
            } else {
                // 判断上级是否与自己购买的套餐符合,若符合则走3级直推逻辑,若不符合则另外一个
                if (parentMember.getAccountLevel().equals(item.getGoodsLevel()) || AccountLevelEnums.VIP.getLevel().equals(parentMember.getAccountLevel())) {
                if (parentMember.getAccountLevel() >= item.getGoodsLevel()) {
                    for (DataDictionaryCustom dataDic : dataDices) {
                        JSONObject jsonObject = JSONObject.parseObject(dataDic.getValue());
                        if (directCnt >= jsonObject.getInteger("pushCnt")) {
@@ -183,8 +182,8 @@
                    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 =====
@@ -365,8 +364,8 @@
        }
        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;
    }