| | |
| | | import cc.mrbird.febs.dapp.enumerate.*; |
| | | import cc.mrbird.febs.dapp.mapper.*; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | | import cc.mrbird.febs.dapp.soccer.entity.SoccerLeagues; |
| | | import cc.mrbird.febs.dapp.vo.*; |
| | | import cc.mrbird.febs.rabbit.producer.ChainProducer; |
| | | import cc.mrbird.febs.system.entity.User; |
| | |
| | | connectDto.setInviteId(null); |
| | | } |
| | | member = insertMember(connectDto.getAddress(), referenceID,nodeType); |
| | | } |
| | | |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(member.getId()); |
| | | if(2 == dappMemberEntity.getChangeAble()){ |
| | | throw new FebsException("账号已冻结"); |
| | | } |
| | | |
| | | String key = LoginUserUtil.getLoginKey(connectDto.getAddress(), connectDto.getNonce(), connectDto.getSign()); |
| | |
| | | |
| | | @Override |
| | | public List<AdminAgentLevelOptionTreeVo> getAgentLevelOption() { |
| | | return dataDictionaryCustomMapper.getAgentLevelOption(); |
| | | List<AdminAgentLevelOptionTreeVo> agentLevelOption = dataDictionaryCustomMapper.getAgentLevelOption(); |
| | | AdminAgentLevelOptionTreeVo adminAgentLevelOptionTreeVo = new AdminAgentLevelOptionTreeVo(); |
| | | adminAgentLevelOptionTreeVo.setId("MEMBER"); |
| | | adminAgentLevelOptionTreeVo.setName("MEMBER"); |
| | | agentLevelOption.add(adminAgentLevelOptionTreeVo); |
| | | return agentLevelOption; |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Transactional |
| | | public Long createOrder(AddOrderDto addOrderDto) { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(member.getId()); |
| | | if(2 == dappMemberEntity.getChangeAble()){ |
| | | throw new FebsException("账号已冻结"); |
| | | } |
| | | // DappMemberEntity member = dappMemberDao.selectById(1L); |
| | | /** |
| | | * 1、商品是否上架 |
| | | * 2、用户余额是否足够 |
| | | */ |
| | | |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(addOrderDto.getGoodsId()); |
| | | if(ObjectUtil.isEmpty(mallGoods)){ |
| | | throw new FebsException("商品不存在"); |
| | |
| | | public FebsResponse salePackage(SalePackageDto salePackageDto) { |
| | | Long memberId = LoginUserUtil.getAppUser().getId(); |
| | | BigDecimal cnt = salePackageDto.getCnt(); |
| | | |
| | | if(ObjectUtil.isEmpty(salePackageDto.getCnt())){ |
| | | throw new FebsException("请输入正确的数量"); |
| | | } |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId); |
| | | |
| | | if(2 == dappMemberEntity.getChangeAble()){ |
| | | throw new FebsException("账号已冻结"); |
| | | } |
| | | BigDecimal saleDoing = dappFundFlowDao.selectSumAmountByMemberIdAndTypeAndStatus(memberId, FundFlowEnum.SALE_PACKAGE.getCode(), DappFundFlowEntity.WITHDRAW_STATUS_ING); |
| | | if(BigDecimal.ZERO.compareTo(saleDoing) < 0){ |
| | | throw new FebsException("正在进行中,请稍后再试"); |
| | |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | dappMemberEntity.setChangeAble(1); |
| | | dappMemberEntity.setChangeAble(2); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | dappMemberEntity.setChangeAble(2); |
| | | dappMemberEntity.setChangeAble(1); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | |
| | | redisUtils.hdel(AppContants.REDIS_KEY_SIGN, dappMemberEntity.getAddress()); |
| | | redisUtils.hdel(AppContants.REDIS_KEY_MEMBER_INFO, dappMemberEntity.getAddress()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SoccerLeagues> selectSoccerLeaguesInPage(SoccerLeagues soccerLeagues, QueryRequest request) { |
| | | Page<SoccerLeagues> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<SoccerLeagues> soccerLeaguesIPage = dappMemberDao.selectSoccerLeaguesInPage(soccerLeagues, page); |
| | | return soccerLeaguesIPage; |
| | | } |
| | | |
| | | public static List<List<String>> partitionList(List<String> originalList, int partitionSize) { |
| | | List<List<String>> partitionedList = new ArrayList<>(); |
| | | int size = originalList.size(); |