| | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.crypto.asymmetric.KeyType; |
| | | import cn.hutool.crypto.asymmetric.RSA; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | private final DappBankDao dappBankDao; |
| | | // private final DappMemberService dappMemberService; |
| | | private final DappMemberAddressDao dappMemberAddressDao; |
| | | private final IgtOnHookPlanOrderDao igtOnHookPlanOrderDao; |
| | | |
| | | private final RedisTemplate<String, Object> redisTemplate; |
| | | |
| | |
| | | public IPage<DappMemberEntity> selectInPage(DappMemberEntity member, QueryRequest request) { |
| | | Page<DappMemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | User currentUser = FebsUtil.getCurrentUser(); |
| | | if (currentUser.getDeptId() == null) { |
| | | member.setCurrentUser(currentUser.getUserId()); |
| | | // if (currentUser.getDeptId() == null) { |
| | | // member.setCurrentUser(currentUser.getUserId()); |
| | | // } |
| | | if(StrUtil.isNotEmpty(currentUser.getDescription())){ |
| | | member.setDescription(currentUser.getDescription()); |
| | | } |
| | | return dappMemberDao.selectInPage(member, page); |
| | | } |
| | |
| | | member.setPassword(SecureUtil.md5(registerDto.getPassword())); |
| | | member.setIdentity(DataDictionaryEnum.LEVEL_MB.getCode()); |
| | | member.setRefererId(registerDto.getRefererId()); |
| | | member.setIsOnHook(2); |
| | | member.setIsProfit(1); |
| | | dappMemberDao.insert(member); |
| | | |
| | | //更新用户信息 |
| | |
| | | dappWalletCoinEntity.setAvailableAmount(AppContants.INIT_MONEY); |
| | | dappWalletCoinEntity.setFrozenAmount(AppContants.INIT_MONEY); |
| | | dappWalletCoinEntity.setTotalAmount(AppContants.INIT_MONEY); |
| | | dappWalletCoinEntity.setWalletCode("USDT"); |
| | | dappWalletCoinDao.insert(dappWalletCoinEntity); |
| | | |
| | | return new FebsResponse().success().message(MessageSourceUtils.getString("register_err_006")); |
| | |
| | | dappMemberEntity = new DappMemberEntity(); |
| | | dappMemberEntity.setTouristMark(touristMark); |
| | | dappMemberEntity.setIdentity(DataDictionaryEnum.LEVEL_TM.getCode()); |
| | | dappMemberEntity.setIsOnHook(2); |
| | | dappMemberEntity.setIsProfit(1); |
| | | dappMemberDao.insert(dappMemberEntity); |
| | | |
| | | //初始化账户信息 |
| | |
| | | }else{ |
| | | memberInfoVo.setIsSetTransferCode(2); |
| | | } |
| | | if(ObjectUtil.isNotEmpty(dappMemberEntity.getRealname())){ |
| | | memberInfoVo.setRealname(dappMemberEntity.getRealname()); |
| | | } |
| | | int isOnHook = dappMemberEntity.getIsOnHook() == null ? 2 : dappMemberEntity.getIsOnHook(); |
| | | memberInfoVo.setIsOnHook(isOnHook); |
| | | |
| | | |
| | | BigDecimal totalProfit = igtOnHookPlanOrderDao.selectSumProfitByMemberId(memberId); |
| | | memberInfoVo.setTotalProfit(totalProfit); |
| | | |
| | | DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId); |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)){ |
| | |
| | | if(BigDecimal.ZERO.compareTo(totalAmount) > 0){ |
| | | memberInfoVo.setTotalAmount(AppContants.INIT_MONEY); |
| | | }else{ |
| | | memberInfoVo.setTotalAmount(totalAmount.setScale(2,BigDecimal.ROUND_DOWN)); |
| | | memberInfoVo.setTotalAmount(totalAmount.setScale(4,BigDecimal.ROUND_DOWN)); |
| | | } |
| | | if(BigDecimal.ZERO.compareTo(frozenAmount) > 0){ |
| | | memberInfoVo.setFrozenAmount(AppContants.INIT_MONEY); |
| | | }else{ |
| | | memberInfoVo.setFrozenAmount(frozenAmount.setScale(2,BigDecimal.ROUND_DOWN)); |
| | | memberInfoVo.setFrozenAmount(frozenAmount.setScale(4,BigDecimal.ROUND_DOWN)); |
| | | } |
| | | if(BigDecimal.ZERO.compareTo(availableAmount) > 0){ |
| | | memberInfoVo.setAvailableAmount(AppContants.INIT_MONEY); |
| | | }else{ |
| | | memberInfoVo.setAvailableAmount(availableAmount.setScale(2,BigDecimal.ROUND_DOWN)); |
| | | memberInfoVo.setAvailableAmount(availableAmount.setScale(4,BigDecimal.ROUND_DOWN)); |
| | | } |
| | | } |
| | | return memberInfoVo; |
| | |
| | | RSA rsa = new RSA(null, AppContants.PUBLIC_KEY); |
| | | return rsa.encryptBase64(token + "_" + System.currentTimeMillis(), KeyType.PublicKey); |
| | | } |
| | | |
| | | |
| | | } |