| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.common.contants.AppContants; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.enumerate.MemberOnHookPlanEnum; |
| | | import cc.mrbird.febs.dapp.mapper.DappFundFlowDao; |
| | | import cc.mrbird.febs.dapp.mapper.DappMemberBoxRecordMapper; |
| | | import cc.mrbird.febs.dapp.mapper.DappMemberDao; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import cc.mrbird.febs.dapp.service.MemberOnHookPlan; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | @SpringBootTest |
| | | public class MemberTest { |
| | | |
| | | @Autowired |
| | | private DappMemberDao dappMemberDao; |
| | | |
| | | @Autowired |
| | | private DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @Test |
| | | public void refererIdsTest() { |
| | | DappMemberEntity member = dappMemberDao.selectById(24); |
| | | |
| | | boolean flag = false; |
| | | String parentId = "35087336"; |
| | | String ids = ""; |
| | | String feeProfitIds = ""; |
| | | |
| | | int i = 1; |
| | | List<DataDictionaryCustom> feeProfitDic = dataDictionaryCustomMapper.selectDicByType(AppContants.DIC_TYPE_DISTRIBUTE_PROP); |
| | | while (!flag && StringUtils.isNotBlank(parentId)) { |
| | | if (StrUtil.isBlank(ids)) { |
| | | ids += parentId; |
| | | } else { |
| | | ids += ("," + parentId); |
| | | } |
| | | |
| | | if (i <= 4) { |
| | | if (StrUtil.isBlank(feeProfitIds)) { |
| | | feeProfitIds += parentId; |
| | | } else { |
| | | feeProfitIds += ("," + parentId); |
| | | } |
| | | } |
| | | |
| | | i++; |
| | | DappMemberEntity parentMember = dappMemberDao.selectMemberInfoByInviteId(parentId); |
| | | if (parentMember == null) { |
| | | break; |
| | | } |
| | | parentId = parentMember.getRefererId(); |
| | | if(StringUtils.isBlank(parentId) || "0".equals(parentId)){ |
| | | break; |
| | | } |
| | | if (parentMember.getRefererId().equals(parentMember.getInviteId())) { |
| | | flag = true; |
| | | } |
| | | } |
| | | member.setRefererIds(ids); |
| | | member.setFeeProfitIds(feeProfitIds); |
| | | } |
| | | // @Autowired |
| | | // private DappMemberDao dappMemberDao; |
| | | // |
| | | // @Autowired |
| | | // private DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | // |
| | | // @Test |
| | | // public void refererIdsTest() { |
| | | // DappMemberEntity member = dappMemberDao.selectById(24); |
| | | // |
| | | // boolean flag = false; |
| | | // String parentId = "35087336"; |
| | | // String ids = ""; |
| | | // String feeProfitIds = ""; |
| | | // |
| | | // int i = 1; |
| | | // List<DataDictionaryCustom> feeProfitDic = dataDictionaryCustomMapper.selectDicByType(AppContants.DIC_TYPE_DISTRIBUTE_PROP); |
| | | // while (!flag && StringUtils.isNotBlank(parentId)) { |
| | | // if (StrUtil.isBlank(ids)) { |
| | | // ids += parentId; |
| | | // } else { |
| | | // ids += ("," + parentId); |
| | | // } |
| | | // |
| | | // if (i <= 4) { |
| | | // if (StrUtil.isBlank(feeProfitIds)) { |
| | | // feeProfitIds += parentId; |
| | | // } else { |
| | | // feeProfitIds += ("," + parentId); |
| | | // } |
| | | // } |
| | | // |
| | | // i++; |
| | | // DappMemberEntity parentMember = dappMemberDao.selectMemberInfoByInviteId(parentId); |
| | | // if (parentMember == null) { |
| | | // break; |
| | | // } |
| | | // parentId = parentMember.getRefererId(); |
| | | // if (StringUtils.isBlank(parentId) || "0".equals(parentId)) { |
| | | // break; |
| | | // } |
| | | // if (parentMember.getRefererId().equals(parentMember.getInviteId())) { |
| | | // flag = true; |
| | | // } |
| | | // } |
| | | // member.setRefererIds(ids); |
| | | // member.setFeeProfitIds(feeProfitIds); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private DappFundFlowDao dappFundFlowDao; |
| | | // |
| | | // @Autowired |
| | | // private DappMemberBoxRecordMapper dappMemberBoxRecordMapper; |
| | | // |
| | | // @Test |
| | | // public void memberBoxTest() { |
| | | // QueryWrapper<DappFundFlowEntity> query = new QueryWrapper<>(); |
| | | // query.eq("status", 2); |
| | | // query.eq("type", 1); |
| | | // List<DappFundFlowEntity> fundFLows = dappFundFlowDao.selectList(query); |
| | | // for (DappFundFlowEntity fundFLow : fundFLows) { |
| | | // DappMemberEntity member = dappMemberDao.selectById(fundFLow.getMemberId()); |
| | | // DappMemberEntity parent = dappMemberDao.selectMemberInfoByInviteId(member.getRefererId()); |
| | | // if (parent == null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // if (new BigDecimal(1600).compareTo(fundFLow.getAmount()) > 0) { |
| | | // System.out.println(fundFLow.getId()); |
| | | // continue; |
| | | // } |
| | | // |
| | | // DappMemberBoxRecordEntity boxRecord = dappMemberBoxRecordMapper.selectByFromMemberId(fundFLow.getMemberId()); |
| | | // if (boxRecord != null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // DappMemberBoxRecordEntity memberBoxRecordEntity = new DappMemberBoxRecordEntity(); |
| | | // memberBoxRecordEntity.setMemberId(parent.getId()); |
| | | // memberBoxRecordEntity.setAddress(parent.getAddress()); |
| | | // memberBoxRecordEntity.setFromMemberId(member.getId()); |
| | | // memberBoxRecordEntity.setFromAddress(member.getAddress()); |
| | | // memberBoxRecordEntity.setCreateTime(fundFLow.getCreateTime()); |
| | | // this.dappMemberBoxRecordMapper.insert(memberBoxRecordEntity); |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private DappSystemService dappSystemService; |
| | | // |
| | | // @Test |
| | | // public void boxCntTest() { |
| | | // dappSystemService.boxCnt(109L); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private RedisUtils redisUtils; |
| | | // |
| | | // @Test |
| | | // public void startSystemTest() { |
| | | // redisUtils.set(AppContants.SYSTEM_START_FLAG, "start"); |
| | | // dappSystemService.startSystem(); |
| | | // } |
| | | // @Test |
| | | // public void tfcPriceTest() { |
| | | // dappSystemService.tfcNewPrice(); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void priceTest() { |
| | | // List<DappPriceRecordEntity> priceListIn24H = dappSystemService.findPriceListIn24H(); |
| | | // System.out.println(111); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void buyRewardTest() { |
| | | // dappSystemService.userBuyReward(347L); |
| | | // } |
| | | } |