| | |
| | | |
| | | AGENT_ALL_BONUS("MEIYE_BONUS_TYPE", "AGENT_ALL_BONUS"), |
| | | PARNER_ALL_BONUS("MEIYE_BONUS_TYPE", "PARNER_ALL_BONUS"), |
| | | AGENT_BONUS_RELEASE("MEIYE_BONUS_TYPE", "AGENT_BONUS_RELEASE"); |
| | | AGENT_BONUS_RELEASE("MEIYE_BONUS_TYPE", "AGENT_BONUS_RELEASE"), |
| | | RECOMMEND_BONUS("MEIYE_BONUS_TYPE", "RECOMMEND_BONUS"), |
| | | UNAGENT_TO_AGENT_PARENT("MEIYE_BONUS_TYPE", "UNAGENT_TO_AGENT_PARENT"), |
| | | UNAGENT_TO_AGENT("MEIYE_BONUS_TYPE", "UNAGENT_TO_AGENT"); |
| | | private String type; |
| | | |
| | | private String code; |
| | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import cc.mrbird.febs.common.enumerates.MemberLevelTagDicEnums; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | |
| | | private Integer childNodeCnt; |
| | | |
| | | private String skin; |
| | | |
| | | public String getLevelName() { |
| | | if (sex != null) { |
| | | return MemberLevelTagDicEnums.getDesc(sex, level); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public List<SkinTypeVo> findSkinList() { |
| | | MallMember loginUser = LoginUserUtil.getLoginUser(); |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.SKIN_TYPE_LIST, loginUser.getLevel()); |
| | | String level = loginUser.getLevel(); |
| | | // 全网分红 -- 代理和股东当作是女王殿下级别 |
| | | if (MemberLevelEnum.getLevelCode(level) > MemberLevelEnum.FOUR_LEVEL.getCode()) { |
| | | level = MemberLevelEnum.FOUR_LEVEL.getType(); |
| | | } |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.SKIN_TYPE_LIST, level); |
| | | if (dic == null || StrUtil.isBlank(dic.getValue())) { |
| | | throw new FebsException("请检查皮肤配置"); |
| | | } |
| | |
| | | log.info("积分订单无返利"); |
| | | return; |
| | | } |
| | | BigDecimal indirectPer = BigDecimal.valueOf(0.25); |
| | | BigDecimal indirectPer2 = BigDecimal.valueOf(0.15); |
| | | |
| | | MallMember member = mallMemberMapper.selectById(orderInfo.getMemberId()); |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | // 非代理推代理,非代理上级拿的收益比例 |
| | | DataDictionaryCustom indirectPerDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.UNAGENT_TO_AGENT_PARENT.getType(), DataDictionaryEnum.UNAGENT_TO_AGENT_PARENT.getCode()); |
| | | |
| | | // 非代理推代理,非代理的直推收益比例 |
| | | DataDictionaryCustom unAgentDirectDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.UNAGENT_TO_AGENT.getType(), DataDictionaryEnum.UNAGENT_TO_AGENT.getCode()); |
| | | |
| | | // 父级会员直推人数 |
| | | Integer directCnt = mallMemberMapper.selectOwnCntByInviteIdAndAccountLevel(parentMember.getInviteId(), parentMember.getAccountLevel()); |
| | | List<DataDictionaryCustom> dataDices = dataDictionaryCustomMapper.selectDicByType(DataDictionaryEnum.DIRECT_BONUS_SETTING.getType()); |
| | |
| | | if (CollUtil.isEmpty(items)) { |
| | | return; |
| | | } |
| | | |
| | | // 推荐奖比例 |
| | | DataDictionaryCustom indrectDicPropDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.RECOMMEND_BONUS.getType(), DataDictionaryEnum.RECOMMEND_BONUS.getCode()); |
| | | |
| | | for (MallOrderItem item : items) { |
| | | // 减去成本后算收益 |
| | |
| | | isSameLevel = 1; |
| | | // 非代理推代理/非股东推股东 |
| | | } else { |
| | | profitPer = BigDecimal.valueOf(10); |
| | | profitPer = new BigDecimal(unAgentDirectDic.getValue()); |
| | | isSameLevel = 2; |
| | | } |
| | | } |
| | |
| | | // 直推奖 |
| | | BigDecimal profit = amount.multiply(profitPer.divide(new BigDecimal(100), 2, RoundingMode.HALF_UP)); |
| | | changeScoreAndCommission(parentMember.getId(), profit, MoneyFlowTypeEnum.DIRECT_BONUS.getValue(), orderInfo.getOrderNo()); |
| | | |
| | | // 代理推代理 |
| | | // if (isSameLevel == 1) { |
| | | // MallMember doubleParentMember = mallMemberMapper.selectInfoByInviteId(parentMember.getReferrerId()); |
| | | // if (doubleParentMember == null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // BigDecimal doubleParentProfit = profit.multiply(indirectPer); |
| | | // changeScoreAndCommission(doubleParentMember.getId(), doubleParentProfit, MoneyFlowTypeEnum.DIRECT_BONUS.getValue(), orderInfo.getOrderNo()); |
| | | // } |
| | | |
| | | // 非代理推代理 |
| | | if (isSameLevel == 2) { |
| | |
| | | break; |
| | | } |
| | | |
| | | BigDecimal doubleParentProfit = profit.multiply(indirectPer2); |
| | | BigDecimal doubleParentProfit = profit.multiply(new BigDecimal(indirectPerDic.getValue())); |
| | | changeScoreAndCommission(mallMember.getId(), doubleParentProfit, MoneyFlowTypeEnum.DIRECT_BONUS.getValue(), orderInfo.getOrderNo()); |
| | | } |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | // 隔代比例 |
| | | BigDecimal indrectDicProp = new BigDecimal(20); |
| | | BigDecimal indrectDicProp = new BigDecimal(indrectDicPropDic.getValue()); |
| | | |
| | | // 隔代推荐奖 收益 |
| | | direct = direct.multiply(indrectDicProp.divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP)); |
| | |
| | | walletService.add(direct, parent.getId(), "commission"); |
| | | moneyFlowService.addMoneyFlow(parent.getId(), direct, MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.COMMISSION.getValue()); |
| | | moneyFlowService.addMoneyFlow(parent.getId(), direct.negate(), MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.SCORE.getValue()); |
| | | changeScoreAndCommission(parent.getId(), direct, MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo()); |
| | | } |
| | | // =======隔代奖== end ===== |
| | | } |
| | |
| | | * @date 2021-09-25 |
| | | **/ |
| | | @Slf4j |
| | | //@Component |
| | | @Component |
| | | public class AgentConsumer { |
| | | |
| | | @Autowired |
| | |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by m.CREATED_TIME desc |
| | | order by m.id desc |
| | | </select> |
| | | |
| | | <select id="getMallMemberInfoById" resultType="cc.mrbird.febs.mall.vo.MallMemberVo"> |
| | |
| | | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="moneyFlow:update" lay-event="moneyFlow">资金流水</button> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="updateReferer:update" lay-event="updateReferer">修改推荐人</button>--> |
| | | </script> |
| | | <script type="text/html" id="switchStatus"> |
| | | {{# if(d.accountStatus == 1) { }} |
| | | <script type="text/html" id="switchAccountLevel"> |
| | | {{# if(d.accountLevel == 1) { }} |
| | | <span>会员</span> |
| | | {{# } else if(d.accountLevel == 2) { }} |
| | | <span>代理</span> |
| | |
| | | <span>股东</span> |
| | | {{# } else { }} |
| | | <span>未购买</span> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchStatus"> |
| | | {{# if(d.accountStatus === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" checked lay-skin="switch" lay-filter="switchStatus"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" lay-skin="switch" lay-filter="switchStatus"> |
| | | {{# } }} |
| | | </script> |
| | | <style> |
| | |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, |
| | | {field: 'balance', title: '余额', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.balance) }}'}, |
| | | {field: 'prizeScore', title: '现金积分', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.prizeScore) }}'}, |
| | | {field: 'commission', title: '佣金', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.commission) }}'}, |
| | | {field: 'childNodeCnt', title: '粉丝数量', minWidth: 100,align:'left'}, |
| | | {field: 'referrerName', title: '推荐人', minWidth: 100,align:'left'}, |
| | | {field: 'levelName', title: '会员类型', minWidth: 100,align:'left'}, |
| | | {field: 'insideWith', title: '账号级别', templet:'#switchStatus', minWidth: 120,align:'left'}, |
| | | {field: 'insideWith', title: '账号级别', templet:'#switchAccountLevel', minWidth: 120,align:'left'}, |
| | | {field: 'accountType', title: '账号类型', |
| | | templet: function (d) { |
| | | if (d.accountType === 2) { |
| | |
| | | <div class="layui-tab-item layui-show"> |
| | | <table id="agentBonus" lay-filter="agentBonus"></table> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">推荐奖(%):</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="RECOMMEND_BONUS" lay-verify="required|integer" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | <div class="layui-word-aux" style="margin-left: 150px;"></div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">非代理推代理(%):</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="UNAGENT_TO_AGENT" lay-verify="required|integer" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | <div class="layui-word-aux" style="margin-left: 150px;">非代理/股东推荐的人购买了代理/股东套餐的直推收益比例</div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">非代理推代理父级(%):</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="UNAGENT_TO_AGENT_PARENT" lay-verify="required|integer" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | <div class="layui-word-aux" style="margin-left: 150px;">非代理/股东推荐的人购买了代理/股东套餐的其父级收益比例</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-card-body"> |