| | |
| | | if(CollUtil.isNotEmpty(Arrays.asList(split))){ |
| | | for(String str : strings){ |
| | | if(StrUtil.isNotEmpty(str)){ |
| | | BigDecimal isAgent = BigDecimal.ZERO; |
| | | // BigDecimal isAgent = BigDecimal.ZERO; |
| | | MemberEntity memberShangJi = memberdao.selectMemberInfoByInviteId(str); |
| | | ZhiYaTeam zhiyaTeamByMemberId = zhiYaRecordDao.selectZhiyaTeamRecordByMemberId(memberShangJi.getId()); |
| | | if(ObjectUtil.isNotEmpty(zhiyaTeamByMemberId)){ |
| | | //更新数据 |
| | | zhiyaTeamByMemberId.setZhiyaCnt(zhiyaTeamByMemberId.getZhiyaCnt().add(balance)); |
| | | if(isAgent.compareTo(gricetoagent) >= 0){ |
| | | zhiyaTeamByMemberId.setIsAgent(1); |
| | | } |
| | | // if(isAgent.compareTo(gricetoagent) >= 0){ |
| | | // zhiyaTeamByMemberId.setIsAgent(1); |
| | | // } |
| | | zhiyaTeamDao.updateById(zhiyaTeamByMemberId); |
| | | }else{ |
| | | //新增数据 |
| | |
| | | zhiYaTeam.setMemberId(memberShangJi.getId()); |
| | | if(ObjectUtil.isNotEmpty(zhiyaTeamByMemberId)){ |
| | | zhiYaTeam.setZhiyaCnt(zhiyaTeamByMemberId.getZhiyaCnt().add(balance)); |
| | | isAgent = zhiyaTeamByMemberId.getZhiyaCnt().add(balance); |
| | | // isAgent = zhiyaTeamByMemberId.getZhiyaCnt().add(balance); |
| | | }else{ |
| | | zhiYaTeam.setZhiyaCnt(balance); |
| | | isAgent = balance; |
| | | // isAgent = balance; |
| | | } |
| | | if(isAgent.compareTo(gricetoagent) >= 0){ |
| | | zhiYaTeam.setIsAgent(1); |
| | | } |
| | | // if(isAgent.compareTo(gricetoagent) >= 0){ |
| | | // zhiYaTeam.setIsAgent(1); |
| | | // } |
| | | zhiyaTeamDao.insert(zhiYaTeam); |
| | | } |
| | | } |
| | |
| | | MemberEntity memberEntity = memberdao.selectById(memberId); |
| | | String refererIds = memberEntity.getRefererIds(); |
| | | if(StrUtil.isNotEmpty(refererIds)){ |
| | | BigDecimal gricetoagent = new BigDecimal(redisUtils.getString("GRICETOAGENT")); |
| | | // BigDecimal gricetoagent = new BigDecimal(redisUtils.getString("GRICETOAGENT")); |
| | | String[] split = refererIds.split(","); |
| | | List<String> strings = Arrays.asList(split); |
| | | if(CollUtil.isNotEmpty(Arrays.asList(split))){ |
| | | for(String str : strings){ |
| | | if(StrUtil.isNotEmpty(str)){ |
| | | BigDecimal isAgent = BigDecimal.ZERO; |
| | | // BigDecimal isAgent = BigDecimal.ZERO; |
| | | MemberEntity memberShangJi = memberdao.selectMemberInfoByInviteId(str); |
| | | ZhiYaTeam zhiyaTeamByMemberId = zhiYaRecordDao.selectZhiyaTeamRecordByMemberId(memberShangJi.getId()); |
| | | if(ObjectUtil.isNotEmpty(zhiyaTeamByMemberId)){ |
| | | //更新数据 |
| | | zhiyaTeamByMemberId.setZhiyaCnt(zhiyaTeamByMemberId.getZhiyaCnt().subtract(balance)); |
| | | isAgent = zhiyaTeamByMemberId.getZhiyaCnt().subtract(balance); |
| | | if(isAgent.compareTo(gricetoagent) >= 0){ |
| | | zhiyaTeamByMemberId.setIsAgent(1); |
| | | } |
| | | // isAgent = zhiyaTeamByMemberId.getZhiyaCnt().subtract(balance); |
| | | // if(isAgent.compareTo(gricetoagent) >= 0){ |
| | | // zhiyaTeamByMemberId.setIsAgent(1); |
| | | // } |
| | | zhiyaTeamDao.updateById(zhiyaTeamByMemberId); |
| | | }else{ |
| | | //新增数据 |
| | |
| | | zhiYaTeam.setMemberId(memberShangJi.getId()); |
| | | if(ObjectUtil.isNotEmpty(zhiyaTeamByMemberId)){ |
| | | zhiYaTeam.setZhiyaCnt(zhiyaTeamByMemberId.getZhiyaCnt().subtract(balance)); |
| | | isAgent = zhiyaTeamByMemberId.getZhiyaCnt().subtract(balance); |
| | | // isAgent = zhiyaTeamByMemberId.getZhiyaCnt().subtract(balance); |
| | | }else{ |
| | | zhiYaTeam.setZhiyaCnt(balance); |
| | | isAgent = balance; |
| | | // isAgent = balance; |
| | | } |
| | | if(isAgent.compareTo(gricetoagent) >= 0){ |
| | | zhiYaTeam.setIsAgent(1); |
| | | } |
| | | // if(isAgent.compareTo(gricetoagent) >= 0){ |
| | | // zhiYaTeam.setIsAgent(1); |
| | | // } |
| | | zhiyaTeamDao.insert(zhiYaTeam); |
| | | } |
| | | } |