| | |
| | | matrixTreeNode.setParentNode(parentNode == null ? null : parentNode.getMemberId()); |
| | | matrixTreeNodeMapper.insert(matrixTreeNode); |
| | | |
| | | if (parentNode == null) { |
| | | return; |
| | | } |
| | | |
| | | List<DataDictionaryCustom> dicList = dataDictionaryCustomMapper.selectDicByType(AppContants.AGENT_LEVEL); |
| | | DataDictionaryCustom dic = null; |
| | | for (DataDictionaryCustom dataDictionaryCustom : dicList) { |
| | |
| | | * @param orderId |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void directProfit(Long orderId) { |
| | | log.info("######直推奖励, 订单ID:{}######", orderId); |
| | | MallOrderInfo orderInfo = mallOrderInfoMapper.selectById(orderId); |
| | |
| | | isSameLevel = 1; |
| | | // 非代理推代理/非股东推股东 |
| | | } else { |
| | | profitPer = BigDecimal.valueOf(0.1); |
| | | profitPer = BigDecimal.valueOf(10); |
| | | isSameLevel = 2; |
| | | } |
| | | } |
| | |
| | | |
| | | // 非代理推代理 |
| | | if (isSameLevel == 2) { |
| | | if (StrUtil.isBlank(parentMember.getReferrerIds())) { |
| | | continue; |
| | | } |
| | | |
| | | List<MallMember> mallMembers = mallMemberMapper.selectParentMemberList(StrUtil.split(parentMember.getReferrerIds(), ','), parentMember.getReferrerId(), 2); |
| | | if (CollUtil.isEmpty(mallMembers)) { |
| | | continue; |
| | |
| | | * @date 2021-09-25 |
| | | **/ |
| | | @Slf4j |
| | | //@Component |
| | | @Component |
| | | public class AgentConsumer { |
| | | |
| | | @Autowired |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectOwnCntByInviteIdAndAccountLevel" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select IFNULL(count(1),0) from mall_member x where x.referrer_id=#{inviteId} |
| | | <select id="selectOwnCntByInviteIdAndAccountLevel" resultType="java.lang.Integer"> |
| | | select IFNULL(count(1),0) |
| | | from mall_member x where x.referrer_id=#{inviteId} |
| | | and x.level != 'ZERO_LEVEL' |
| | | <if test="accountLevel == 2"> |
| | | and x.account_level = 2 |
| | | </if> |
| | | <if test="accountLevel == 3"> |
| | | and x.accountLevel in (2, 3) |
| | | and x.account_level in (2, 3) |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | @Test |
| | | public void autoLevelUpTest() { |
| | | agentProducer.sendAutoLevelUpMsg(1L); |
| | | agentProducer.sendAutoLevelUpMsg(803L); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void returnMoneyTest() { |
| | | agentProducer.sendOrderReturn(5L); |
| | | } |
| | | // |
| | | // @Autowired |