19 files modified
1 files added
| | |
| | | package cc.mrbird.febs.dapp.chain; |
| | | |
| | | import cc.mrbird.febs.dapp.dto.BatchTransferDto; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.util.List; |
| | | |
| | | public interface ContractChainService { |
| | | |
| | |
| | | BigInteger totalSupplyNFT(); |
| | | |
| | | String safeMintNFT(String address); |
| | | |
| | | /** |
| | | * 批量转账 |
| | | * @param batchTransferDtos |
| | | */ |
| | | void transferList(List<BatchTransferDto> batchTransferDtos); |
| | | } |
| | |
| | | package cc.mrbird.febs.dapp.chain; |
| | | |
| | | import cn.hutool.core.util.HexUtil; |
| | | import cc.mrbird.febs.dapp.dto.BatchTransferDto; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.bouncycastle.jcajce.provider.digest.SHA3; |
| | | import org.web3j.abi.FunctionEncoder; |
| | | import org.web3j.abi.FunctionReturnDecoder; |
| | | import org.web3j.abi.TypeReference; |
| | |
| | | import org.web3j.abi.datatypes.Function; |
| | | import org.web3j.abi.datatypes.Type; |
| | | import org.web3j.abi.datatypes.generated.Uint256; |
| | | import org.web3j.crypto.*; |
| | | import org.web3j.crypto.Credentials; |
| | | import org.web3j.crypto.RawTransaction; |
| | | import org.web3j.crypto.TransactionEncoder; |
| | | import org.web3j.protocol.Web3j; |
| | | import org.web3j.protocol.core.DefaultBlockParameterName; |
| | | import org.web3j.protocol.core.Request; |
| | | import org.web3j.protocol.core.methods.request.Transaction; |
| | | import org.web3j.protocol.core.methods.response.*; |
| | | import org.web3j.protocol.core.methods.response.EthBlockNumber; |
| | | import org.web3j.protocol.core.methods.response.EthCall; |
| | | import org.web3j.protocol.core.methods.response.EthGetTransactionCount; |
| | | import org.web3j.protocol.core.methods.response.EthSendTransaction; |
| | | import org.web3j.protocol.http.HttpService; |
| | | import org.web3j.utils.Convert; |
| | | import org.web3j.utils.Numeric; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.math.RoundingMode; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.concurrent.ExecutionException; |
| | | |
| | |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void transferList(List<BatchTransferDto> batchTransferDtos) { |
| | | String gas = getGas(); |
| | | Credentials credentials = Credentials.create(privateKey); |
| | | BigInteger nonce = null; |
| | | try { |
| | | nonce = web3j.ethGetTransactionCount(credentials.getAddress(), DefaultBlockParameterName.LATEST).send().getTransactionCount(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | for(BatchTransferDto batchTransferDto : batchTransferDtos){ |
| | | |
| | | String amount = batchTransferDto.getAmount().toPlainString(); |
| | | String toAddress = batchTransferDto.getToAddress(); |
| | | |
| | | BigDecimal amountPow = new BigDecimal(amount).multiply(BigDecimal.TEN.pow(18)); |
| | | amount = amountPow.toPlainString(); |
| | | if (amount.contains(".")) { |
| | | amount = amount.substring(0, amount.lastIndexOf(".")); |
| | | } |
| | | |
| | | Function function = new Function("transfer", |
| | | Arrays.asList(new Address(toAddress), new Uint256(new BigInteger(amount))), |
| | | Arrays.asList(new TypeReference<Type>() { |
| | | })); |
| | | |
| | | String encodedFunction = FunctionEncoder.encode(function); |
| | | |
| | | RawTransaction rawTransaction = RawTransaction.createTransaction(nonce, |
| | | Convert.toWei(gas, Convert.Unit.GWEI).toBigInteger(),// 给矿工开的转账单价 单价越高越快 |
| | | Convert.toWei("100000", Convert.Unit.WEI).toBigInteger(), contractAddress, encodedFunction);//里程上限 |
| | | |
| | | byte[] signedMessage = TransactionEncoder.signMessage(rawTransaction, credentials); |
| | | String hexValue = Numeric.toHexString(signedMessage); |
| | | |
| | | CompletableFuture<EthSendTransaction> ethSendTransactionCompletableFuture = web3j.ethSendRawTransaction(hexValue).sendAsync(); |
| | | try { |
| | | EthSendTransaction ethSendTransaction = ethSendTransactionCompletableFuture.get(); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } catch (ExecutionException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | nonce = nonce.add(BigInteger.ONE); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.dapp.chain; |
| | | |
| | | import cc.mrbird.febs.common.contants.AppContants; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cc.mrbird.febs.dapp.dto.BatchTransferDto; |
| | | import org.tron.trident.core.ApiWrapper; |
| | | import org.tron.trident.core.contract.Contract; |
| | | import org.tron.trident.core.contract.Trc20Contract; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.math.RoundingMode; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | |
| | | public String safeMintNFT(String address) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void transferList(List<BatchTransferDto> batchTransferDtos) { |
| | | |
| | | } |
| | | } |
| | |
| | | import cc.mrbird.febs.dapp.chain.ChainService; |
| | | import cc.mrbird.febs.dapp.dto.PriceSettingDto; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappStorage; |
| | | import cc.mrbird.febs.dapp.entity.DappTransferRecordEntity; |
| | | import cc.mrbird.febs.dapp.entity.DbMemberNode; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Map; |
| | |
| | | public FebsResponse list(DappMemberEntity member, QueryRequest request) { |
| | | Map<String, Object> dataTable = getDataTable(dappMemberService.selectInPage(member, request)); |
| | | return new FebsResponse().success().data(dataTable); |
| | | } |
| | | |
| | | |
| | | @GetMapping("changeIdentityYes/{type}/{id}") |
| | | public FebsResponse changeIdentityYes(@PathVariable("type") Integer type, @PathVariable("id") Long id) { |
| | | dappMemberService.changeIdentity(type, id, 1); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @GetMapping("changeIdentityNo/{type}/{id}") |
| | | public FebsResponse changeIdentityNo(@PathVariable("type") Integer type, @PathVariable("id") Long id) { |
| | | dappMemberService.changeIdentity(type, id, 2); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getBalanceByAddress/{chain}/{address}") |
| | |
| | | return new FebsResponse().success().data(getDataTable(dappMemberService.memberNodeList(dbMemberNode, request))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/storageList") |
| | | public FebsResponse storageList(DappStorage dappStorage, QueryRequest request) { |
| | | return new FebsResponse().success().data(getDataTable(dappMemberService.storageList(dappStorage, request))); |
| | | } |
| | | |
| | | @PostMapping(value = "/setNewestPrice") |
| | | public FebsResponse setNewestPrice(PriceSettingDto priceSettingDto) { |
| | | dappMemberService.setNewestPrice(priceSettingDto); |
New file |
| | |
| | | package cc.mrbird.febs.dapp.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class BatchTransferDto { |
| | | |
| | | private String toAddress; |
| | | |
| | | private BigDecimal amount; |
| | | |
| | | public BatchTransferDto(String toAddress, BigDecimal amount) { |
| | | this.toAddress = toAddress; |
| | | this.amount = amount; |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.dapp.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | |
| | | private BigDecimal releasePercent; |
| | | |
| | | private BigDecimal releaseAmount; |
| | | |
| | | @TableField(exist = false) |
| | | private String address; |
| | | } |
| | |
| | | @Getter |
| | | public enum MoneyFlowEnum { |
| | | |
| | | WITHDRAW(21,"提取:{},手续费:{}"), |
| | | STATIC_PERK(11,"静态释放:{}"), |
| | | TEAM_THREE_PERK(10,"DAO3团队激励:激励:{}"), |
| | | TEAM_TWO_PERK(9,"DAO2团队激励:激励:{}"), |
| | |
| | | BU_CHANG_PERK(5,"补偿池:{}。补偿:{}"), |
| | | NODE_PERK(4,"存储:{}。人数:{},节点奖励:{}"), |
| | | DIRECT_PERK(3,"存储:{}。直推奖励:{}"), |
| | | DYNAMIC_PERK(2,"存储:{}。动态奖励,直推:{},层级:{}"), |
| | | DYNAMIC_PERK(2,"存储:{}。动态奖励,直推:{},层级奖励:{}"), |
| | | CUN_CHU(1,"存储PEOPLE:{}") |
| | | ; |
| | | |
| | |
| | | |
| | | import cc.mrbird.febs.dapp.entity.DappStorage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | |
| | | List<DappStorage> selectListByDate( @Param("date") Date date); |
| | | |
| | | DappStorage selectAmountByDesc(@Param("date") Date date,int offset,int count); |
| | | |
| | | IPage<DappStorage> selectListInPage(@Param("record")DappStorage dappStorage, Page<DappStorage> page); |
| | | } |
| | |
| | | import cc.mrbird.febs.dapp.dto.ConnectDto; |
| | | import cc.mrbird.febs.dapp.dto.PriceSettingDto; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappStorage; |
| | | import cc.mrbird.febs.dapp.entity.DappTransferRecordEntity; |
| | | import cc.mrbird.febs.dapp.entity.DbMemberNode; |
| | | import cc.mrbird.febs.dapp.vo.AdminSystemFeeVo; |
| | |
| | | TeamUpVo teamUp(); |
| | | |
| | | List<TeamDownVo> teamDown(); |
| | | |
| | | IPage<DappStorage> storageList(DappStorage dappStorage, QueryRequest request); |
| | | |
| | | void changeIdentity(Integer type, Long id, int i); |
| | | } |
| | |
| | | return objects; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<DappStorage> storageList(DappStorage dappStorage, QueryRequest request) { |
| | | Page<DappStorage> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return dappStorageMapper.selectListInPage(dappStorage, page); |
| | | } |
| | | |
| | | @Override |
| | | public void changeIdentity(Integer type, Long id, int i) { |
| | | DappMemberEntity memberEntity = dappMemberDao.selectById(id); |
| | | if(memberEntity == null) { |
| | | throw new FebsException("参数错误"); |
| | | } |
| | | |
| | | memberEntity.setNodeType(i); |
| | | dappMemberDao.updateById(memberEntity); |
| | | } |
| | | |
| | | public TeamListVo buildTeamMatrix(DappAchieveMemberTreeEntity node) { |
| | | List<DappAchieveMemberTreeEntity> childNodes = dappAchieveMemberTreeDao.selectMatrixChildNode(node.getTopNode(), node.getTreeNode()); |
| | | |
| | |
| | | BigDecimal perkPercent = new BigDecimal(rule.getPerkPercent()).multiply(new BigDecimal("0.01")); |
| | | BigDecimal perkAmount = perkPercent.multiply(amount); |
| | | Long perkMemberId = dappMemberEntityRef.getId(); |
| | | //生成一条流水 |
| | | DappFundFlowEntity rePutInFlow = new DappFundFlowEntity( |
| | | perkMemberId, |
| | | |
| | | this.updateBalanceInsertFlow( |
| | | perkAmount, |
| | | 15, |
| | | 2, |
| | | null, |
| | | null); |
| | | dappFundFlowDao.insert(rePutInFlow); |
| | | //更新用户的金额 |
| | | dappWalletService.updateWalletCoinWithLock(perkAmount, perkMemberId, 1); |
| | | perkMemberId, |
| | | MoneyFlowEnum.DYNAMIC_PERK.getValue(), |
| | | StrUtil.format(MoneyFlowEnum.DYNAMIC_PERK.getDescrition(),amount,memberInviteList.size(),perkAmount)); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.dapp.chain.ChainEnum; |
| | | import cc.mrbird.febs.dapp.chain.ChainService; |
| | | import cc.mrbird.febs.dapp.dto.*; |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | |
| | | if (walletCoin.getAvailableAmount().compareTo(withdrawDto.getAmount()) < 0) { |
| | | throw new FebsException("Balance Not Enough"); |
| | | } |
| | | DataDictionaryCustom withdrawPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.WITHDRAW_PERCENT.getType(), |
| | | DataDictionaryEnum.WITHDRAW_PERCENT.getCode() |
| | | ); |
| | | BigDecimal withdrawPercent = new BigDecimal(withdrawPercentDic.getValue()); |
| | | |
| | | BigDecimal feeAmount = withdrawDto.getAmount().multiply(withdrawPercent).setScale(2, BigDecimal.ROUND_DOWN); |
| | | |
| | | updateWalletCoinWithLock(withdrawDto.getAmount(), member.getId(), 2); |
| | | |
| | | DappFundFlowEntity fundFlow = new DappFundFlowEntity( |
| | | member.getId(), |
| | | withdrawDto.getAmount().negate(), |
| | | 21, |
| | | 1, |
| | | withdrawDto.getFee(), |
| | | null); |
| | | MoneyFlowEnum.WITHDRAW.getValue(), |
| | | 2, |
| | | feeAmount, |
| | | StrUtil.format(MoneyFlowEnum.WITHDRAW.getDescrition(),withdrawDto.getAmount(),withdrawDto.getFee())); |
| | | dappFundFlowDao.insert(fundFlow); |
| | | |
| | | MemberCoinWithdrawEntity memberCoinWithdraw = new MemberCoinWithdrawEntity(); |
| | | memberCoinWithdraw.setMemberId(member.getId()); |
| | | memberCoinWithdraw.setAddress(member.getAddress()); |
| | | memberCoinWithdraw.setAmount(withdrawDto.getAmount()); |
| | | memberCoinWithdraw.setFeeAmount(withdrawDto.getFee()); |
| | | memberCoinWithdraw.setStatus(MemberCoinWithdrawEntity.STATUS_DOING); |
| | | memberCoinWithdraw.setSymbol("USDT"); |
| | | memberCoinWithdraw.setFeeAmount(feeAmount); |
| | | memberCoinWithdraw.setStatus(MemberCoinWithdrawEntity.STATUS_YES); |
| | | memberCoinWithdraw.setSymbol("COIN"); |
| | | memberCoinWithdraw.setFlowId(fundFlow.getId()); |
| | | memberCoinWithdrawDao.insert(memberCoinWithdraw); |
| | | |
| | | ArrayList<BatchTransferDto> objects = new ArrayList<>(); |
| | | BigDecimal bigDecimal = withdrawDto.getAmount().subtract(feeAmount).setScale(2, BigDecimal.ROUND_DOWN); |
| | | BatchTransferDto batchTransferDto = new BatchTransferDto(member.getAddress(),bigDecimal); |
| | | objects.add(batchTransferDto); |
| | | ChainService.getInstance(ChainEnum.BSC_TFC.name()).transferList(objects); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @ApiModelProperty(value = "提现费率") |
| | | private BigDecimal withdrawPercent; |
| | | |
| | | @ApiModelProperty(value = "提现费率") |
| | | @ApiModelProperty(value = "额度") |
| | | private BigDecimal usdtBalance; |
| | | |
| | | } |
| | |
| | | server: |
| | | port: 8082 |
| | | port: 8083 |
| | | tomcat: |
| | | uri-encoding: utf-8 |
| | | |
| | |
| | | |
| | | <select id="selectInPage" resultType="cc.mrbird.febs.dapp.entity.DappMemberEntity"> |
| | | select a.*, |
| | | b.total_amount totalAmount, |
| | | b.frozen_amount frozenAmount, |
| | | b.available_amount availableAmount |
| | | from dapp_member a |
| | | inner join dapp_wallet_coin b on a.id = b.member_id |
| | |
| | | limit {offset},{count} |
| | | </select> |
| | | |
| | | <select id="selectListInPage" resultType="cc.mrbird.febs.dapp.entity.DappStorage"> |
| | | select |
| | | a.*, |
| | | b.address address |
| | | from |
| | | dapp_storage a |
| | | left join dapp_member b on a.member_id = b.id |
| | | <where> |
| | | <if test="record.address != '' and record.address != null"> |
| | | and b.address = #{record.address} |
| | | </if> |
| | | <if test="record.state != null"> |
| | | and a.state = #{record.state} |
| | | </if> |
| | | </where> |
| | | order by a.create_time desc |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-transfer" lay-title="用户划扣记录"> |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-transfer" lay-title="用户存储"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">地址</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="address" autocomplete="off" placeholder="输入地址" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">存储状态</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="state"> |
| | | <option value=""></option> |
| | | <option value="1">释放中</option> |
| | | <option value="2">已结束</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | height: auto !important; |
| | | } |
| | | </style> |
| | | <script type="text/html" id="storage-state"> |
| | | {{# |
| | | var state = { |
| | | 1: {title: '释放中', color: 'green'}, |
| | | 2: {title: '已结束', color: 'blue'} |
| | | }[d.state]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{state.color}}">{{ state.title }}</span> |
| | | </script> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'transferTable', |
| | | url: ctx + 'member/memberNodeList', |
| | | url: ctx + 'member/storageList', |
| | | totalRow: true ,// 开启合计行 |
| | | cols: [[ |
| | | {field: 'address', title: '地址', minWidth: 130}, |
| | | {field: 'countFund', title: '轮数', minWidth: 180}, |
| | | {field: 'type', title: '星团等级', minWidth: 130}, |
| | | {field: 'amount', title: '金额', minWidth: 80}, |
| | | {field: 'address', title: '地址', minWidth: 130, totalRowText: '合计:'}, |
| | | {title: '存储状态', templet: '#storage-state', minWidth: 100}, |
| | | {field: 'amount', title: '存储数量', minWidth: 80,totalRow: '{{= parseInt(d.amount) }}'}, |
| | | {field: 'releaseAmount', title: '每次释放', minWidth: 80}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 130}, |
| | | ]] |
| | | }); |
| | |
| | | function getQueryParams() { |
| | | return { |
| | | address: $searchForm.find('input[name="address"]').val().trim(), |
| | | invalidate_ie_cache: new Date() |
| | | state: $searchForm.find("select[name='state']").val(), |
| | | }; |
| | | } |
| | | }) |
| | |
| | | cols: [[ |
| | | {field: 'address', title: '地址', minWidth: 400}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 100}, |
| | | {field: 'amountReal', title: '到账金额(USDT)', minWidth: 80}, |
| | | {title: '提现状态', templet: '#withdraw-status'}, |
| | | {field: 'amount', title: '提现金额(USDT)', minWidth: 80}, |
| | | {field: 'amount', title: '提取数量', minWidth: 80}, |
| | | {field: 'fee', title: '手续费', minWidth: 80}, |
| | | {title: '操作', toolbar: '#withdraw-option', minWidth: 300} |
| | | ]] |
| | |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">地址</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="inviteId" autocomplete="off" placeholder="输入地址或邀请码" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">状态</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="accountStatus"> |
| | | <option value=""></option> |
| | | <option value="2">禁用</option> |
| | | <option value="1">有效</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label layui-form-label-sm">可兑换</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="changeAble">--> |
| | | <!-- <option value=""></option>--> |
| | | <!-- <option value="2">否</option>--> |
| | | <!-- <option value="1">是</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">可提现</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="withdrawAble"> |
| | | <option value=""></option> |
| | | <option value="2">否</option> |
| | | <option value="1">是</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | height: auto !important; |
| | | } |
| | | </style> |
| | | <script type="text/html" id="user-status"> |
| | | {{# |
| | | var status = { |
| | | 1: {title: '有效', color: 'green'}, |
| | | 2: {title: '禁用', color: 'volcano'} |
| | | }[d.accountStatus]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{status.color}}">{{ status.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="change-able"> |
| | | {{# |
| | | var status = { |
| | | 1: {title: '是', color: 'green'}, |
| | | 2: {title: '否', color: 'volcano'} |
| | | }[d.changeAble]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{status.color}}">{{ status.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="withdraw-able"> |
| | | {{# |
| | | var status = { |
| | | 1: {title: '是', color: 'green'}, |
| | | 2: {title: '否', color: 'volcano'} |
| | | }[d.withdrawAble]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{status.color}}">{{ status.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="user-sex"> |
| | | {{# |
| | | var sex = { |
| | | 2: {title: '保密'}, |
| | | 1: {title: '女'}, |
| | | 0: {title: '男'} |
| | | }[d.sex]; |
| | | }} |
| | | <span>{{ sex.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="balance"> |
| | | <span name="balance">{{ d.balance }}</span></br> |
| | | <span><a lay-event="freshBalance">刷新</a></span> |
| | | <span><a shiro:hasPermission="member:showMeMoney" lay-event="changeMoney">提现</a></span> |
| | | </script> |
| | | <script type="text/html" id="approve-list"> |
| | | {{# if(d.chainType == 'TRX') { }} |
| | | <a href="https://tronscan.io/#/address/{{d.address}}" target="_blank">{{d.approveCnt}}</a> |
| | | {{# } else if (d.chainType == 'ETH') { }} |
| | | <a href="https://etherscan.io/address/{{d.address}}" target="_blank">{{d.approveCnt}}</a> |
| | | {{# } else if (d.chainType == 'BSC') { }} |
| | | <a href="https://bscscan.com/address/{{d.address}}" target="_blank">{{d.approveCnt}}</a> |
| | | <script type="text/html" id="switchPartner"> |
| | | {{# if(d.nodeType === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchPartner"> |
| | | {{# } else { }} |
| | | <span>-</span> |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchPartner"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="member-option"> |
| | | {{# |
| | | var accountStatus = { |
| | | 2: {title: '启用'}, |
| | | 1: {title: '禁用'} |
| | | }[d.accountStatus]; |
| | | var changeAble = { |
| | | 2: {title: '可兑换'}, |
| | | 1: {title: '不可兑换'} |
| | | }[d.changeAble]; |
| | | var withdrawAble = { |
| | | 2: {title: '可提现'}, |
| | | 1: {title: '不可提现'} |
| | | }[d.withdrawAble]; |
| | | }} |
| | | <span shiro:lacksPermission="member:accountStatus,member:changeAble,member:withdrawAble"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="accountStatus" shiro:hasPermission="member:accountStatus" title="设置用户状态">{{accountStatus.title}}</button> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="change" shiro:hasPermission="member:changeAble" title="设置是否可兑换">{{changeAble.title}}</button>--> |
| | | <button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="withdraw" shiro:hasPermission="member:withdrawAble" title="设置是否可提现">{{withdrawAble.title}}</button> |
| | | </script> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | |
| | | table.on('tool(memberTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'accountStatus') { |
| | | var text = "是否启用该用户?"; |
| | | if (data.accountStatus === 1) { |
| | | text = "是否禁用该用户" |
| | | } |
| | | febs.modal.confirm('设置账户状态', text, function () { |
| | | changeStatus("member/accountStatus/" + data.id); |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'withdraw') { |
| | | var text = "是否将该用户设置为可提现?"; |
| | | if (data.accountStatus === 1) { |
| | | text = "是否将该用户设置为不可提现?" |
| | | } |
| | | febs.modal.confirm('设置提现状态', text, function () { |
| | | changeStatus("member/withdrawAble/" + data.id); |
| | | }); |
| | | } |
| | | |
| | | // if (layEvent === 'change') { |
| | | // var text = "是否将该用户设置为可兑换?"; |
| | | // if (data.accountStatus === 1) { |
| | | // text = "是否将该用户设置为不可兑换?" |
| | | // } |
| | | // febs.modal.confirm('设置兑换状态', text, function () { |
| | | // changeStatus("member/changeAble/" + data.id); |
| | | // }); |
| | | // } |
| | | |
| | | if (layEvent === 'changeMoney') { |
| | | febs.modal.confirm('提现', "是否提现该用户?", function () { |
| | | febs.post(ctx + "member/changeMoney/" + data.chainType + "/" +data.address, null, function () { |
| | | febs.alert.success('提现成功'); |
| | | $query.click(); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | var balance = $(obj.tr).find("[name='balance']"); |
| | | if (layEvent === 'freshBalance') { |
| | | $.ajax({ |
| | | url : ctx + 'member/getBalanceByAddress/' + data.chainType + "/" + obj.data.address, |
| | | type : 'get', |
| | | async : true, |
| | | success : function(data) { |
| | | if (data.data >= 0) { |
| | | balance.text(data.data); |
| | | febs.alert.success('刷新成功'); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | table.on('sort(memberTable)', function (obj) { |
| | |
| | | url: ctx + 'member/list', |
| | | totalRow: true ,// 开启合计行 |
| | | cols: [[ |
| | | // {type: 'checkbox'}, |
| | | // {type: 'numbers'}, |
| | | {field: 'address', title: '地址', minWidth: 400, totalRowText: '合计:'}, |
| | | // {title: '余额(USDT)', templet: '#balance', minWidth: 120}, |
| | | // {title: '授权列表', templet: '#approve-list', minWidth: 110}, |
| | | // {field: 'chainType', title: '所属链', minWidth: 130}, |
| | | {field: 'totalAmount', title: '总金额', minWidth: 80,totalRow: '{{= parseInt(d.totalAmount) }}'}, |
| | | {field: 'availableAmount', title: '可用金额', minWidth: 80,totalRow: '{{= parseInt(d.availableAmount) }}'}, |
| | | // {field: 'frozenAmount', title: '冻结金额', minWidth: 80}, |
| | | {field: 'usdtBalance', title: '额度', minWidth: 100,totalRow: '{{= parseInt(d.usdtBalance) }}'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100}, |
| | | {field: 'refererId', title: '上级邀请码', minWidth: 100}, |
| | | {field: 'buyNode', title: '节点数量', minWidth: 100,totalRow: '{{= parseInt(d.buyNode) }}'}, |
| | | {title: '账户状态', templet: '#user-status', minWidth: 100}, |
| | | // {title: '是否可兑换', templet: '#change-able', minWidth: 100}, |
| | | // {title: '是否可提现', templet: '#withdraw-able', minWidth: 100}, |
| | | {field: 'nodeType', title: '节点', templet:'#switchPartner', minWidth: 120}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 180}, |
| | | // {title: '操作', toolbar: '#member-option', minWidth: 300} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | function getQueryParams() { |
| | | return { |
| | | inviteId: $searchForm.find('input[name="inviteId"]').val().trim(), |
| | | // changeAble: $searchForm.find("select[name='changeAble']").val(), |
| | | accountStatus: $searchForm.find("select[name='accountStatus']").val(), |
| | | withdrawAble: $searchForm.find("select[name='withdrawAble']").val(), |
| | | inviteId: $searchForm.find('input[name="inviteId"]').val(), |
| | | nodeType: $searchForm.find("select[name='nodeType']").val(), |
| | | invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | |
| | | function changeStatus(url) { |
| | | febs.post(ctx + url, null, function () { |
| | | form.on('switch(switchPartner)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeIdentityYes(4, data.value); |
| | | } else { |
| | | changeIdentityNo(4, data.value); |
| | | } |
| | | }) |
| | | |
| | | function changeIdentityYes(type, id) { |
| | | febs.get(ctx + 'member/changeIdentityYes/' + type + "/" + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function changeIdentityNo(type, id) { |
| | | febs.get(ctx + 'member/changeIdentityNo/' + type + "/" + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">地址</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="address" autocomplete="off" placeholder="输入地址" class="layui-input"> |
| | | </div> |
| | |
| | | <div class="layui-input-inline"> |
| | | <select name="type"> |
| | | <option value=""></option> |
| | | <option value="13">节点买入</option> |
| | | <option value="14">节点返利</option> |
| | | <option value="15">见点奖</option> |
| | | <option value="16">复投</option> |
| | | <option value="17">收益</option> |
| | | <option value="18">买入</option> |
| | | <option value="19">手续费充值</option> |
| | | <option value="20">手续费扣除</option> |
| | | <option value="21">提现</option> |
| | | <option value="22">提现失败</option> |
| | | <option value="1">存储PEOPLE</option> |
| | | <option value="2">动态奖励</option> |
| | | <option value="3">直推奖励</option> |
| | | <option value="4">节点奖励</option> |
| | | <option value="5">补偿池</option> |
| | | <option value="6">大单激励</option> |
| | | <option value="7">直推激励</option> |
| | | <option value="8">DAO1团队激励</option> |
| | | <option value="9">DAO2团队激励</option> |
| | | <option value="10">DAO3团队激励</option> |
| | | <option value="11">静态释放</option> |
| | | <option value="21">提取</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label layui-form-label-sm">可兑换</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="changeAble">--> |
| | | <!-- <option value=""></option>--> |
| | | <!-- <option value="2">否</option>--> |
| | | <!-- <option value="1">是</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label layui-form-label-sm">可提现</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="withdrawAble">--> |
| | | <!-- <option value=""></option>--> |
| | | <!-- <option value="2">否</option>--> |
| | | <!-- <option value="1">是</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | |
| | | <script type="text/html" id="flow-type"> |
| | | {{# |
| | | var type = { |
| | | 13: {title: '节点买入'}, |
| | | 14: {title: '节点返利'}, |
| | | 15: {title: '见点奖'}, |
| | | 16: {title: '复投'}, |
| | | 17: {title: '收益'}, |
| | | 18: {title: '买入'}, |
| | | 19: {title: '手续费充值'}, |
| | | 20: {title: '手续费扣除'}, |
| | | 21: {title: '提现'}, |
| | | 22: {title: '提现失败'}, |
| | | 1: {title: '存储PEOPLE'}, |
| | | 2: {title: '动态奖励'}, |
| | | 3: {title: '直推奖励'}, |
| | | 4: {title: '节点奖励'}, |
| | | 5: {title: '补偿池'}, |
| | | 6: {title: '大单激励'}, |
| | | 7: {title: '直推激励'}, |
| | | 8: {title: 'DAO1团队激励'}, |
| | | 9: {title: 'DAO2团队激励'}, |
| | | 10: {title: 'DAO3团队激励'}, |
| | | 11: {title: '静态释放'}, |
| | | 21: {title: '提取'}, |
| | | }[d.type]; |
| | | }} |
| | | <span>{{ type.title }}</span> |
| | |
| | | {field: 'fee', title: '手续费', minWidth: 80}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 150}, |
| | | {field: 'fromHash', title: 'fromHash', minWidth: 150}, |
| | | {field: 'toHash', title: 'toHash', minWidth: 150}, |
| | | ]] |
| | | }); |
| | | } |
| | |
| | | return { |
| | | address: $searchForm.find('input[name="address"]').val().trim(), |
| | | type: $searchForm.find("select[name='type']").val(), |
| | | // accountStatus: $searchForm.find("select[name='accountStatus']").val(), |
| | | // withdrawAble: $searchForm.find("input[name='withdrawAble']").val(), |
| | | // invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | |