13 files modified
3 files added
| | |
| | | return new FebsResponse().success().data(dappMemberService.aKLine(aKLineDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "兑换AUSD", notes = "兑换AUSD") |
| | | @ApiOperation(value = "兑换AUSDT", notes = "兑换AUSDT") |
| | | @PostMapping(value = "/transferAusd") |
| | | public FebsResponse transferAusd(@RequestBody TransferAusdDto transferAusdDto) { |
| | | return new FebsResponse().success().data(dappWalletService.transferAusd(transferAusdDto)); |
| | |
| | | package cc.mrbird.febs.dapp.controller; |
| | | |
| | | import cc.mrbird.febs.common.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.dapp.chain.ChainService; |
| | | import cc.mrbird.febs.dapp.dto.AgentLevelSetUpdateDto; |
| | | import cc.mrbird.febs.dapp.dto.PriceSettingDto; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappSystemProfit; |
| | | import cc.mrbird.febs.dapp.entity.DappTransferRecordEntity; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | | import cc.mrbird.febs.dapp.vo.AdminAgentLevelOptionTreeVo; |
| | | import cc.mrbird.febs.dapp.vo.AdminSystemFeeVo; |
| | | import cc.mrbird.febs.system.entity.User; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | Map<String, Object> data = getDataTable(dappMemberService.getMemberNodeInfo(dappMemberEntity,request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | @GetMapping(value = "/insideWithYes/{id}") |
| | | public FebsResponse insideWithYes(@PathVariable("id") Long id) { |
| | | return dappMemberService.insideWithYes(id); |
| | | } |
| | | |
| | | @GetMapping(value = "/insideWithNo/{id}") |
| | | public FebsResponse insideWithNo(@PathVariable("id") Long id) { |
| | | return dappMemberService.insideWithNo(id); |
| | | } |
| | | |
| | | /** |
| | | * 代理-等级选择Option |
| | | */ |
| | | @GetMapping("getAgentLevelOption") |
| | | @ControllerEndpoint(exceptionMessage = "获取等级失败") |
| | | public List<AdminAgentLevelOptionTreeVo> getAgentLevelOption() { |
| | | return dappMemberService.getAgentLevelOption(); |
| | | } |
| | | |
| | | /** |
| | | * 代理列表-设置代理级别 |
| | | */ |
| | | @PostMapping("agentLevelSetUpdate") |
| | | @ControllerEndpoint(operation = "代理列表-设置代理级别", exceptionMessage = "操作失败") |
| | | public FebsResponse agentLevelSetUpdate(@Valid AgentLevelSetUpdateDto agentLevelSetUpdateDto) { |
| | | return dappMemberService.agentLevelSetUpdate(agentLevelSetUpdateDto); |
| | | } |
| | | |
| | | } |
| | |
| | | import cc.mrbird.febs.dapp.entity.DappSystemProfit; |
| | | import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.mapper.DappMemberDao; |
| | | import cc.mrbird.febs.dapp.mapper.DappSystemProfitDao; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | | import cc.mrbird.febs.dapp.vo.AdminAgentLevelSetInfoVo; |
| | | import cc.mrbird.febs.dapp.vo.AdminSystemFeeVo; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | private final RedisUtils redisUtils; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | private final DappSystemProfitDao dappSystemProfitDao; |
| | | private final DappMemberDao dappMemberDao; |
| | | |
| | | @GetMapping(value = "admin") |
| | | @RequiresPermissions("admin:view") |
| | |
| | | memberNodeInfoMemberId = id; |
| | | return FebsUtil.view("dapp/member-node-Info"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 代理级别-设置代理 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("agentLevel/{id}") |
| | | @RequiresPermissions("agentLevel:view") |
| | | public String agentLevelSet(@PathVariable long id, Model model) { |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(id); |
| | | AdminAgentLevelSetInfoVo data = new AdminAgentLevelSetInfoVo(); |
| | | data.setId(id); |
| | | data.setLevelCode(dappMemberEntity.getAccountType()); |
| | | model.addAttribute("agentLevelSet", data); |
| | | return FebsUtil.view("dapp/member-agent-level"); |
| | | } |
| | | } |
| New file |
| | |
| | | package cc.mrbird.febs.dapp.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AgentLevelSetUpdateDto { |
| | | |
| | | private String levelCode; |
| | | |
| | | private Long id; |
| | | } |
| | |
| | | private String chainType; |
| | | |
| | | /** |
| | | * 是否节点 1-是 2-否 |
| | | * 是否是超级节点 1-是 2-否 |
| | | */ |
| | | private Integer nodeType; |
| | | |
| | |
| | | BigDecimal selectAllAchieveByInviteId(@Param("inviteId")String inviteId); |
| | | |
| | | List<DappMemberEntity> selectMemberByNotAccountType(@Param("accountType")String type); |
| | | |
| | | List<DappMemberEntity> selectByNodetype(); |
| | | } |
| | |
| | | package cc.mrbird.febs.dapp.mapper; |
| | | |
| | | import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.dapp.vo.AdminAgentLevelOptionTreeVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | DataDictionaryCustom selectDicDataByTypeAndCode(@Param("type") String type, @Param("code") String code); |
| | | |
| | | int updateDicValueByTypeAndCode(@Param("type") String type, @Param("code") String code, @Param("value") String value); |
| | | |
| | | List<AdminAgentLevelOptionTreeVo> getAgentLevelOption(); |
| | | } |
| | |
| | | MyInviteInfoVo findInviteInfo(); |
| | | |
| | | FebsResponse getFundFlowInfo(); |
| | | |
| | | FebsResponse insideWithYes(Long id); |
| | | |
| | | FebsResponse insideWithNo(Long id); |
| | | |
| | | List<AdminAgentLevelOptionTreeVo> getAgentLevelOption(); |
| | | |
| | | FebsResponse agentLevelSetUpdate(AgentLevelSetUpdateDto agentLevelSetUpdateDto); |
| | | } |
| | |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.enumerate.FundFlowEnum; |
| | | import cc.mrbird.febs.dapp.enumerate.MemberLevelEnum; |
| | | import cc.mrbird.febs.dapp.enumerate.PoolEnum; |
| | | import cc.mrbird.febs.dapp.mapper.*; |
| | | import cc.mrbird.febs.dapp.service.DappMemberService; |
| | |
| | | return new FebsResponse().success().data(fundFlowInfoVo); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse insideWithYes(Long id) { |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | dappMemberEntity.setNodeType(1); |
| | | dappMemberEntity.setAccountType(MemberLevelEnum.NODE_5.getType()); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse insideWithNo(Long id) { |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | dappMemberEntity.setNodeType(2); |
| | | dappMemberEntity.setAccountType(MemberLevelEnum.MEMBER.getType()); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public List<AdminAgentLevelOptionTreeVo> getAgentLevelOption() { |
| | | return dataDictionaryCustomMapper.getAgentLevelOption(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse agentLevelSetUpdate(AgentLevelSetUpdateDto agentLevelSetUpdateDto) { |
| | | Long memberId = agentLevelSetUpdateDto.getId(); |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId); |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)){ |
| | | return new FebsResponse().fail().message("系统繁忙,请刷新页面重试"); |
| | | } |
| | | dappMemberEntity.setAccountType(agentLevelSetUpdateDto.getLevelCode()); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户的大小区业绩 |
| | | * @param memberId |
| | |
| | | public BigDecimal superNodePoolPerk(BigDecimal nodeFivePoolDicCnt, String code, int code1) { |
| | | BigDecimal realPerkAmount = BigDecimal.ZERO; |
| | | //获取type级别的会员 |
| | | List<DappMemberNodeEntity> dappMemberNodeEntities = dappMemberNodeMapper.selectNodeByNodeCode(NodeCodeEnum.SUPER_NODE.getCode()); |
| | | // List<DappMemberNodeEntity> dappMemberNodeEntities = dappMemberNodeMapper.selectNodeByNodeCode(NodeCodeEnum.SUPER_NODE.getCode()); |
| | | List<DappMemberEntity> dappMemberEntities = dappMemberDao.selectByNodetype(); |
| | | //每日补贴总数 |
| | | // BigDecimal nodePerk = nodeFivePoolDicCnt.multiply(AppContants.NODE_PERK_PERCENT); |
| | | BigDecimal nodePerk = nodeFivePoolDicCnt; |
| | | if(CollUtil.isNotEmpty(dappMemberNodeEntities)){ |
| | | if(CollUtil.isNotEmpty(dappMemberEntities)){ |
| | | //每人的补贴 |
| | | BigDecimal averagePerk = nodePerk.divide(new BigDecimal(dappMemberNodeEntities.size()), 4, BigDecimal.ROUND_DOWN); |
| | | BigDecimal averagePerk = nodePerk.divide(new BigDecimal(dappMemberEntities.size()), 4, BigDecimal.ROUND_DOWN); |
| | | |
| | | for(DappMemberNodeEntity dappMemberNodeEntity : dappMemberNodeEntities){ |
| | | for(DappMemberEntity dappMemberEntitie : dappMemberEntities){ |
| | | |
| | | DappFundFlowEntity fundFlowToMember = new DappFundFlowEntity( |
| | | dappMemberNodeEntity.getMemberId(), |
| | | dappMemberEntitie.getId(), |
| | | averagePerk, |
| | | code1, |
| | | 2, |
| | | BigDecimal.ZERO); |
| | | dappFundFlowDao.insert(fundFlowToMember); |
| | | //用户的A币账户增加memberGetACnt数量 |
| | | dappWalletService.updateWalletMineWithLock(averagePerk,dappMemberNodeEntity.getMemberId(),1); |
| | | dappWalletService.updateWalletMineWithLock(averagePerk,dappMemberEntitie.getId(),1); |
| | | |
| | | realPerkAmount = realPerkAmount.add(averagePerk); |
| | | } |
| | |
| | | BigDecimal ausdPrice = new BigDecimal(ausdPriceDic.getValue()); |
| | | BigDecimal ausdAmountNeed = ausdPercentUsdt.divide(ausdPrice); |
| | | if(BigDecimal.ZERO.compareTo(ausdAmount) >= 0){ |
| | | throw new FebsException("AUSD数量不足"); |
| | | throw new FebsException("AUSDT数量不足"); |
| | | } |
| | | if(ausdAmountNeed.compareTo(ausdAmount) > 0){ |
| | | throw new FebsException("AUSD数量不足"); |
| | | throw new FebsException("AUSDT数量不足"); |
| | | } |
| | | /** |
| | | * 出局复投要求等于戓大于自己上次投资金额 |
| | |
| | | this.updateWalletCoinWithLock(aCoinCntReal,memberParent.getId(),1); |
| | | //插入资产闪对的流水 |
| | | DappFundFlowEntity dappFundFlowEntity = new DappFundFlowEntity( |
| | | dappMemberEntity.getId(), |
| | | memberParent.getId(), |
| | | aCoinCntReal, |
| | | FundFlowEnum.ANDAO_MEMBER_TO_MENBER.getCode(), |
| | | 2, |
| | |
| | | dappUsdtPerkEntityMapper.updateById(parentEntity); |
| | | //插入资产闪对的流水 |
| | | DappFundFlowEntity aCoinCntFlowParent = new DappFundFlowEntity( |
| | | parentEntity.getId(), |
| | | memberParent.getId(), |
| | | coinCnt, |
| | | FundFlowEnum.AUSDT_MEMBER_TO_MENBER.getCode(), |
| | | 2, |
| New file |
| | |
| | | package cc.mrbird.febs.dapp.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AdminAgentLevelOptionTreeVo { |
| | | |
| | | private String id; |
| | | |
| | | private String name; |
| | | } |
| New file |
| | |
| | | package cc.mrbird.febs.dapp.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminAgentLevelSetInfoVo", description = "信息返回类") |
| | | public class AdminAgentLevelSetInfoVo { |
| | | private Long id; |
| | | |
| | | private String levelCode; |
| | | } |
| | |
| | | select * from dapp_member |
| | | where active_status = 1 |
| | | </select> |
| | | |
| | | <select id="selectByNodetype" resultType="cc.mrbird.febs.dapp.entity.DappMemberEntity"> |
| | | select * from dapp_member |
| | | where node_type = 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </update> |
| | | |
| | | |
| | | <select id="getAgentLevelOption" resultType="cc.mrbird.febs.dapp.vo.AdminAgentLevelOptionTreeVo"> |
| | | select a.code id,a.code name from data_dictionary_custom a |
| | | where a.type='NODE_PERK' |
| | | </select> |
| | | </mapper> |
| | |
| | | <script type="text/html" id="approve-list"> |
| | | <a href="https://bscscan.com/address/{{d.address}}" target="_blank">{{d.address}}</a> |
| | | </script> |
| | | <script type="text/html" id="switchInsideWith"> |
| | | {{# if(d.nodeType === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchInsideWith"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchInsideWith"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="member-option"> |
| | | {{# |
| | | var accountStatus = { |
| | |
| | | <!-- <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 type="text/html" id="tableMemberBar">--> |
| | | <!-- <div class="layui-btn-container">--> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevel:view" lay-event="agentLevel">设置代理等级</button>--> |
| | | <!-- </div>--> |
| | | <!--</script>--> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'agentLevel') { |
| | | alert(1); |
| | | // var checkData = table.checkStatus('memberTable').data; |
| | | // if (checkData.length <= 0) { |
| | | // febs.alert.warn('请选择需要的用户'); |
| | | // return; |
| | | // } |
| | | // if (checkData.length > 1) { |
| | | // febs.alert.warn('请选择一个用户'); |
| | | // return; |
| | | // } |
| | | febs.modal.open('设置代理级别', 'dappView/agentLevel/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#agent-level-set').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | table.on('sort(memberTable)', function (obj) { |
| | |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | |
| | | form.on('switch(switchInsideWith)', function (data) { |
| | | if (data.elem.checked) { |
| | | insideWithYes(data.value); |
| | | } else { |
| | | insideWithNo(data.value); |
| | | } |
| | | }) |
| | | function insideWithYes(id) { |
| | | febs.get(ctx + 'member/insideWithYes/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function insideWithNo(id) { |
| | | febs.get(ctx + 'member/insideWithNo/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'memberTable', |
| | | url: ctx + 'member/list', |
| | | // toolbar:"#tableMemberBar", |
| | | // defaultToolbar:[], |
| | | totalRow: true, |
| | | cols: [[ |
| | | {title: '代理级别', |
| | | templet: function (d) { |
| | | return '<span class="layui-btn layui-btn-normal layui-btn-xs">'+d.accountType+'</span>' |
| | | },minWidth: 130,align:'center', totalRowText: '合计'}, |
| | | {field: 'address', title: '地址', minWidth: 400}, |
| | | // {type: 'checkbox'}, |
| | | // {title: '代理级别', |
| | | // templet: function (d) { |
| | | // return '<span class="layui-btn layui-btn-normal layui-btn-xs">'+d.accountType+'</span>' |
| | | // },minWidth: 130,align:'center'}, |
| | | {field: 'address', title: '地址', minWidth: 400, totalRowText: '合计'}, |
| | | {field: 'chainType', title: '所属链', minWidth: 130}, |
| | | {field: 'memberNodeSumPrice', title: '拥有积分', minWidth: 130}, |
| | | {title: '购买节点数量', |
| | | // {field: 'memberNodeSumPrice', title: '拥有积分', minWidth: 130}, |
| | | {field: 'nodeType', title: '超级节点', templet:'#switchInsideWith', minWidth: 120}, |
| | | {title: '会员等级', |
| | | templet: function (d) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="memberNodeInfo" shiro:hasPermission="memberNodeInfo:view"><span>'+d.memberNodeCnt+'</span></button>' |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" shiro:hasPermission="agentLevel:view">' + |
| | | '<span>'+d.accountType+'</span>' + |
| | | '</button>' |
| | | },minWidth: 130,align:'center'}, |
| | | {field: 'directProfit', title: '直推收益', minWidth: 100, totalRow: true}, |
| | | // {field: 'directProfit', title: '直推收益', minWidth: 100, totalRow: true}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100}, |
| | | {field: 'refererId', title: '上级邀请码', minWidth: 100}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 180} |