17 files modified
2 files added
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 交易员数据---列表
|
| | | * 交易员数据---列表---交易员利润分成
|
| | | */
|
| | | @GetMapping("traderDataInfo")
|
| | | public FebsResponse traderDataInfo(FollowTraderProfitInfoEntity followTraderProfitInfoEntity, QueryRequest request) {
|
| | | Map<String, Object> data = getDataTable(documentaryService.findTraderDataInfoInfoInPage(followTraderProfitInfoEntity, request));
|
| | | @GetMapping("traderProfitInfo")
|
| | | public FebsResponse traderProfitInfo(FollowTraderProfitInfoEntity followTraderProfitInfoEntity, QueryRequest request) {
|
| | | Map<String, Object> data = getDataTable(documentaryService.findTraderProfitInfoInfoInPage(followTraderProfitInfoEntity, request));
|
| | | return new FebsResponse().success().data(data);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 交易员数据---列表---跟单数据详情
|
| | | */
|
| | | @GetMapping("/seeFollowerInfo")
|
| | | public FebsResponse seeFollowerInfo(QueryRequest request, FollowTraderProfitInfoEntity followTraderProfitInfoEntity,Integer parentId) {
|
| | | if(parentId==null){
|
| | | ViewController.idFromMember=0;
|
| | | }
|
| | | followTraderProfitInfoEntity.setId(ViewController.idFromMember);
|
| | | Map<String, Object> dataTable = getDataTable(documentaryService.findlistSeeFollowerInfo(request, followTraderProfitInfoEntity));
|
| | | return new FebsResponse().success().data(dataTable);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private final DocumentaryService documentaryService;
|
| | |
|
| | | private final FollowTraderLabelMapper followTraderLabelMapper;
|
| | |
|
| | | public static long idFromMember;
|
| | |
|
| | | /**
|
| | | *交易员利润分成---详情
|
| | | */
|
| | | @GetMapping("seeFollowerInfo/{id}")
|
| | | public String seeFollowerInfo(@PathVariable long id, Model model) {
|
| | | idFromMember = id;
|
| | | return FebsUtil.view("modules/documentary/seeFollowerInfo");
|
| | | }
|
| | |
|
| | | /**
|
| | | * 标签设置
|
| | |
| | | model.addAttribute("member", data);
|
| | | return FebsUtil.view("modules/documentary/modifyProfitRatio");
|
| | | }
|
| | | |
| | | /**
|
| | | * 交易员利润分成
|
| | | * @return
|
| | | */
|
| | | @GetMapping("traderProfit")
|
| | | @RequiresPermissions("traderProfit:view")
|
| | | public String traderProfit() {
|
| | | return FebsUtil.view("modules/documentary/traderProfit");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.xcong.excoin.modules.documentary.entity;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | | import com.xcong.excoin.common.entity.BaseEntity;
|
| | |
|
| | |
| | | * 交易笔数
|
| | | */
|
| | | private BigDecimal totalOrderCnt;
|
| | |
|
| | | @TableField(exist = false)
|
| | | private String account;
|
| | |
|
| | | @TableField(exist = false)
|
| | | private String realName;
|
| | | /**
|
| | | * 手机号(包含国际手机号)
|
| | | */
|
| | | @TableField(exist = false)
|
| | | private String phone;
|
| | | /**
|
| | | * 邮箱
|
| | | */
|
| | | @TableField(exist = false)
|
| | | private String email;
|
| | | /**
|
| | | * 邀请码
|
| | | */
|
| | | @TableField(exist = false)
|
| | | private String inviteId;
|
| | | |
| | | /**
|
| | | * 账号类型
|
| | | */
|
| | | @TableField(exist = false)
|
| | | private int accountType;
|
| | | |
| | | /**
|
| | | * 利润率
|
| | | */
|
| | | @TableField(exist = false)
|
| | | private BigDecimal profitRatio;
|
| | | /**
|
| | | * 总返利
|
| | | */
|
| | | @TableField(exist = false)
|
| | | private BigDecimal profitRatioTotal;
|
| | |
|
| | |
|
| | | }
|
| | |
| | | package com.xcong.excoin.modules.documentary.mapper;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.vo.SeeFollowerInfoVo;
|
| | |
|
| | | public interface FollowFollowerProfitMapper extends BaseMapper<FollowFollowerProfitEntity> {
|
| | |
|
| | | IPage<SeeFollowerInfoVo> findFollowFollowerProfitInfo(Page<SeeFollowerInfoVo> page,
|
| | | @Param("record") FollowTraderInfoEntity followTraderInfo);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | IPage<FollowTraderInfoEntity> findTraderListInPage(Page<FollowTraderInfoEntity> page, @Param("record") FollowTraderInfoEntity followTraderInfoEntity);
|
| | |
|
| | | String selectProfitRatioTotal(@Param("memberId") Long memberId);
|
| | |
|
| | | String selectAllProfitByMemberIdAndTraderMemberId(@Param("memberId")long memberId, @Param("traderMemberId")Long traderMemberId);
|
| | |
|
| | | }
|
| | |
| | | package com.xcong.excoin.modules.documentary.mapper;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
|
| | |
|
| | | public interface FollowTraderProfitInfoMapper extends BaseMapper<FollowTraderProfitInfoEntity> {
|
| | |
|
| | | IPage<FollowTraderProfitInfoEntity> findTraderProfitInfoInfoInPage(Page<FollowTraderProfitInfoEntity> page,
|
| | | @Param("record")FollowTraderProfitInfoEntity followTraderProfitInfoEntity);
|
| | |
|
| | | }
|
| | |
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderLabelEntity;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
|
| | | import com.xcong.excoin.modules.documentary.vo.SeeFollowerInfoVo;
|
| | |
|
| | | public interface DocumentaryService extends IService<FollowTraderInfoEntity> {
|
| | |
|
| | |
| | |
|
| | | void followLabelSetUpdate(@Valid FollowTraderLabelEntity followTraderLabelEntity);
|
| | |
|
| | | IPage<FollowTraderProfitInfoEntity> findTraderDataInfoInfoInPage(FollowTraderProfitInfoEntity followTraderProfitInfoEntity, QueryRequest request);
|
| | |
|
| | | FebsResponse modifyProfitRatio(@Valid ModifyProfitRatioDto modifyProfitRatioDto);
|
| | |
|
| | | FebsResponse traderGetOn(@NotNull(message = "{required}") Long id);
|
| | |
|
| | | FebsResponse traderGetOutFrist(@NotNull(message = "{required}")Long id);
|
| | |
|
| | | IPage<FollowTraderProfitInfoEntity> findTraderProfitInfoInfoInPage(FollowTraderProfitInfoEntity followTraderProfitInfoEntity,
|
| | | QueryRequest request);
|
| | |
|
| | | IPage<SeeFollowerInfoVo> findlistSeeFollowerInfo(QueryRequest request, FollowTraderProfitInfoEntity followTraderProfitInfoEntity);
|
| | | }
|
| | |
| | | package com.xcong.excoin.modules.documentary.service.impl;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.math.RoundingMode;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | |
| | |
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.xcong.excoin.common.utils.RedisUtils;
|
| | | import com.xcong.excoin.modules.documentary.vo.SeeFollowerInfoVo;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | | if(StrUtil.isNotEmpty(profitRatioStr)) {
|
| | | profitRatio = new BigDecimal(profitRatioStr);
|
| | | }
|
| | | if(profitRatio.compareTo(BigDecimal.ZERO) < 0 || profitRatio.compareTo(BigDecimal.ONE) >= 0){
|
| | | return new FebsResponse().fail().message("利润率设置规则:只允许0到1之间的小数");
|
| | | }
|
| | | String isok = followTraderInfoDto.getIsok();
|
| | | if("1".equals(isok)) {
|
| | | //更新【会员信息表】数据
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public IPage<FollowTraderProfitInfoEntity> findTraderDataInfoInfoInPage(FollowTraderProfitInfoEntity followTraderProfitInfoEntity, QueryRequest request) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public FebsResponse modifyProfitRatio(@Valid ModifyProfitRatioDto modifyProfitRatioDto) {
|
| | | Long id = modifyProfitRatioDto.getId();
|
| | |
| | | String profitRatioStr = modifyProfitRatioDto.getProfitRatio();
|
| | | if(StrUtil.isNotEmpty(profitRatioStr)) {
|
| | | profitRatio = new BigDecimal(profitRatioStr);
|
| | | }
|
| | | if(profitRatio.compareTo(BigDecimal.ZERO) < 0 || profitRatio.compareTo(BigDecimal.ONE) >= 0){
|
| | | return new FebsResponse().fail().message("利润率设置规则:只允许0到1之间的小数");
|
| | | }
|
| | | //更新【交易员信息表】数据
|
| | | selectById.setProfitRatio(profitRatio);
|
| | |
| | | return new FebsResponse().success();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public IPage<FollowTraderProfitInfoEntity> findTraderProfitInfoInfoInPage(
|
| | | FollowTraderProfitInfoEntity followTraderProfitInfoEntity, QueryRequest request) {
|
| | |
|
| | | Page<FollowTraderProfitInfoEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
|
| | | IPage<FollowTraderProfitInfoEntity> FollowTraderProfitInfoEntitys = followTraderProfitInfoMapper.findTraderProfitInfoInfoInPage(page, followTraderProfitInfoEntity);
|
| | | List<FollowTraderProfitInfoEntity> records = FollowTraderProfitInfoEntitys.getRecords();
|
| | |
|
| | | if(CollUtil.isNotEmpty(records)) {
|
| | | for(FollowTraderProfitInfoEntity followTraderProfitInfo : records) {
|
| | | Long traderId = followTraderProfitInfo.getTraderId();
|
| | | FollowTraderInfoEntity followTraderInfoEntity = followTraderInfoMapper.selectById(traderId);
|
| | | //利润率
|
| | | BigDecimal profitRatio = BigDecimal.ZERO;
|
| | | //总返利
|
| | | BigDecimal profitRatioTotal = BigDecimal.ZERO;
|
| | | if(ObjectUtil.isNotEmpty(followTraderInfoEntity)) {
|
| | | profitRatio = followTraderInfoEntity.getProfitRatio();
|
| | | profitRatioTotal = new BigDecimal(followTraderInfoMapper.selectProfitRatioTotal(followTraderInfoEntity.getMemberId())).setScale(2, RoundingMode.HALF_UP);
|
| | | }
|
| | | followTraderProfitInfo.setProfitRatio(profitRatio);
|
| | | followTraderProfitInfo.setProfitRatioTotal(profitRatioTotal);
|
| | | |
| | | Long memberId = followTraderProfitInfo.getMemberId();
|
| | | Map<String, Object> columnMap = new HashMap<>();
|
| | | columnMap.put("member_id", memberId);
|
| | | List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap );
|
| | | if(CollUtil.isNotEmpty(selectByMap)) {
|
| | | MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0);
|
| | | String firstName = memberAuthenticationEntity.getFirstName();
|
| | | String secondName = memberAuthenticationEntity.getSecondName();
|
| | | String realName = firstName + secondName;
|
| | | followTraderProfitInfo.setRealName(realName);
|
| | | }
|
| | | }
|
| | | }
|
| | | return FollowTraderProfitInfoEntitys;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public IPage<SeeFollowerInfoVo> findlistSeeFollowerInfo(QueryRequest request, FollowTraderProfitInfoEntity followTraderProfitInfoEntity) {
|
| | |
|
| | | Long id = followTraderProfitInfoEntity.getId();
|
| | | if(ObjectUtil.isEmpty(id)) {
|
| | | return null;
|
| | | }
|
| | | //获取交易员信息
|
| | | FollowTraderProfitInfoEntity FollowTraderProfitInfo = followTraderProfitInfoMapper.selectById(id);
|
| | | if(ObjectUtil.isEmpty(FollowTraderProfitInfo)) {
|
| | | return null;
|
| | | }
|
| | | Long traderId = FollowTraderProfitInfo.getTraderId();
|
| | | Long traderMemberId = FollowTraderProfitInfo.getMemberId();
|
| | | FollowTraderInfoEntity FollowTraderInfo = followTraderInfoMapper.selectById(traderId);
|
| | | if(ObjectUtil.isEmpty(FollowTraderInfo)) {
|
| | | return null;
|
| | | }
|
| | | //获取当前的跟随者
|
| | | Page<SeeFollowerInfoVo> page = new Page<>(request.getPageNum(), request.getPageSize());
|
| | | IPage<SeeFollowerInfoVo> seeFollowerInfoVos = followFollowerProfitMapper.findFollowFollowerProfitInfo(page, FollowTraderInfo);
|
| | | List<SeeFollowerInfoVo> records = seeFollowerInfoVos.getRecords();
|
| | | if(CollUtil.isNotEmpty(records)) {
|
| | | for(SeeFollowerInfoVo seeFollowerInfoVo : records) {
|
| | | long memberId = seeFollowerInfoVo.getMemberId();
|
| | | MemberEntity memberEntity = memberMapper.selectById(memberId);
|
| | | if(ObjectUtil.isNotEmpty(memberEntity)) {
|
| | | String phone = memberEntity.getPhone();
|
| | | String email = memberEntity.getEmail();
|
| | | String inviteId = memberEntity.getInviteId();
|
| | | seeFollowerInfoVo.setPhone(phone);
|
| | | seeFollowerInfoVo.setEmail(email);
|
| | | seeFollowerInfoVo.setInviteId(inviteId);
|
| | | //合约账户总资产
|
| | | String totalString = memberMapper.selectMemberWalletContractByMemberId(memberId);
|
| | | BigDecimal contractTotal = new BigDecimal(totalString);
|
| | | seeFollowerInfoVo.setContractTotal(contractTotal);
|
| | | //总返利
|
| | | String totalProfitStr = followTraderInfoMapper.selectAllProfitByMemberIdAndTraderMemberId(memberId,traderMemberId);
|
| | | BigDecimal totalProfit = new BigDecimal(totalProfitStr);
|
| | | seeFollowerInfoVo.setProfitTotal(totalProfit);
|
| | | |
| | | Map<String, Object> columnMap = new HashMap<>();
|
| | | columnMap.put("member_id", memberId);
|
| | | List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap );
|
| | | if(CollUtil.isNotEmpty(selectByMap)) {
|
| | | MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0);
|
| | | String firstName = memberAuthenticationEntity.getFirstName();
|
| | | String secondName = memberAuthenticationEntity.getSecondName();
|
| | | String realName = firstName + secondName;
|
| | | seeFollowerInfoVo.setRealName(realName);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | return seeFollowerInfoVos;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | String selectDLZCForAllDataInfo(@Param("record")MemberEntity memberEntity);
|
| | |
|
| | | String selectSellClosingpriceForForAllDataInfo(@Param("record")MemberEntity memberEntity);
|
| | |
|
| | | String selectMemberWalletContractByMemberId(@Param("memberId")long memberId);
|
| | |
|
| | | }
|
| | |
| | | and (m.phone = #{record.account} or m.email = #{record.account} or m.invite_id=#{record.account})
|
| | | </if>
|
| | | <if test="record.contractType!=null and record.contractType!=''">
|
| | | and m.contract_type= #{record.contractType}
|
| | | and s.contract_type= #{record.contractType}
|
| | | </if>
|
| | | <if test="record.isTest!=null and record.isTest!=''">
|
| | | and m.account_type= #{record.isTest}
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.xcong.excoin.modules.documentary.mapper.FollowFollowerProfitMapper">
|
| | |
|
| | | <select id="findFollowFollowerProfitInfo" resultType="com.xcong.excoin.modules.documentary.vo.SeeFollowerInfoVo">
|
| | | select * from follow_follower_profit s left join member m on m.id = s.member_id
|
| | | where s.trade_id = #{record.id} and s.trade_member_id = #{record.memberId}
|
| | | order by s.create_time desc
|
| | | </select>
|
| | | </mapper> |
| | |
| | | </where>
|
| | | order by s.create_time desc
|
| | | </select>
|
| | |
|
| | | <select id="selectProfitRatioTotal" resultType="java.lang.String">
|
| | | select IFNULL(SUM(f.amount),'0') as amount from follow_trader_profit_detail f where f.member_id = #{memberId}
|
| | | </select>
|
| | |
|
| | | <select id="selectAllProfitByMemberIdAndTraderMemberId" resultType="java.lang.String">
|
| | | select IFNULL(SUM(f.amount),'0') as amount from follow_trader_profit_detail f where f.member_id = #{traderMemberId} and f.follow_member_id = #{memberId}
|
| | | </select>
|
| | |
|
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.xcong.excoin.modules.documentary.mapper.FollowTraderProfitInfoMapper">
|
| | |
|
| | | <select id="findTraderProfitInfoInfoInPage" resultType="com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity">
|
| | | select * from follow_trader_profit_info t
|
| | | left join follow_trader_info s on s.id = t.trader_id
|
| | | left join member m on m.id = t.member_id
|
| | | <where>
|
| | | <if test="record != null" >
|
| | | <if test="record.account!=null and record.account!=''">
|
| | | and (m.phone = #{record.account} or m.email = #{record.account} or m.invite_id=#{record.account})
|
| | | </if>
|
| | | </if>
|
| | | </where>
|
| | | order by s.create_time desc |
| | | </select>
|
| | |
|
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | | <mapper namespace="com.xcong.excoin.modules.member.mapper.MemberMapper">
|
| | |
|
| | | <select id="selectMemberWalletContractByMemberId" resultType="java.lang.String">
|
| | | SELECT
|
| | | total_balance
|
| | | FROM
|
| | | member_wallet_contract where member_id = #{memberId}
|
| | | </select>
|
| | |
|
| | | <select id="selectSellClosingpriceForForAllDataInfo" resultType="java.lang.String">
|
| | | SELECT
|
| | | IFNULL(SUM(a.closing_fee_amount),'0')
|
| | |
| | | <div class="layui-fluid" id="user-update"> |
| | | <form class="layui-form" action="" lay-filter="user-update-form"> |
| | | <div class="layui-form-item"> |
| | | <div style="text-align: center"> |
| | | 利润率设置规则 --- 1:代表10%。 |
| | | <div style="text-align: center;color:red"> |
| | | 利润率设置规则:只允许0到1之间的小数 |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
New file |
| | |
| | | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-user-child" lay-title="跟单数据详情"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <table lay-filter="userTableChild" lay-data="{id: 'userTableChild'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect' ,'eleTree'], function () { |
| | | var $ = layui.jquery, |
| | | laydate = layui.laydate, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | treeSelect = layui.treeSelect, |
| | | dropdown = layui.dropdown, |
| | | $view = $('#febs-user-child'), |
| | | $query = $view.find('#queryChild'), |
| | | $searchForm = $view.find('formChild'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns, |
| | | createTimeFrom, |
| | | createTimeTo; |
| | | |
| | | form.render(); |
| | | |
| | | initTable(); |
| | | |
| | | laydate.render({ |
| | | elem: '#user-createTime', |
| | | range: true, |
| | | trigger: 'click' |
| | | }); |
| | | |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userTable', |
| | | url: ctx + 'documentary/seeFollowerInfo?parentId=1', |
| | | cols: [[ |
| | | {field: 'phone', title: '手机号', minWidth: 100,align:'left'}, |
| | | {field: 'email', title: '邮箱', minWidth: 100,align:'left'}, |
| | | {field: 'realName', title: '姓名', minWidth: 100,align:'left'}, |
| | | {field: 'inviteId', title: '邀请码UID', minWidth: 80,align:'center'}, |
| | | {field: 'contractTotal', title: '合约账户总资产', minWidth: 150,align:'left'}, |
| | | {field: 'profitTotal', title: '总返利金额', minWidth: 150,align:'center'}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | </script> |
| | |
| | | <div class="layui-fluid" id="user-update">
|
| | | <form class="layui-form" action="" lay-filter="user-update-form">
|
| | | <div class="layui-form-item">
|
| | | <div style="text-align: center">
|
| | | 利润率设置规则 --- 1:代表10%。
|
| | | <div style="text-align: center;color:red">
|
| | | 利润率设置规则:只允许0到1之间的小数
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-form-item febs-hide">
|
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="trader-profit" lay-title="交易员利润分成"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="手机号/邮箱/邀请码" name="account" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="userTable" lay-data="{id: 'userTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="user:update"><i |
| | | class="layui-icon febs-edit-area febs-blue"></i></a> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#trader-profit'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'phone', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(userTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'edit') { |
| | | febs.modal.open('交易员审核', 'modules/documentary/traderDetail/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'seeFollowerInfo') { |
| | | febs.modal.open('总利润详情', 'modules/documentary/seeFollowerInfo/' + data.id, { |
| | | area: $(window).width() <= 750 ? '90%' : '80%', |
| | | offset: '30px', |
| | | btn: ['取消'], |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | $query.click(); |
| | | } |
| | | if (layEvent === 'modifyProfitRatio') { |
| | | febs.modal.open('收益率修改', 'modules/documentary/modifyProfitRatio/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'getOut') { |
| | | febs.modal.confirm('确认', '您是否要踢出该交易员?', function () { |
| | | confirmUsers(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getOn') { |
| | | febs.modal.confirm('确认', '您是否推荐当前交易员?', function () { |
| | | confirmUsersGetOn(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getOutFrist') { |
| | | febs.modal.confirm('确认', '您是否取消推荐当前交易员?', function () { |
| | | confirmUsersGetOutFrist(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getFull') { |
| | | febs.modal.confirm('确认', '您是否要设置成【满员】状态?', function () { |
| | | cancelUsers(data.id); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function confirmUsers(id) { |
| | | febs.get(ctx + 'documentary/traderGetOut/' + id, null, function () { |
| | | febs.alert.success('踢出成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function confirmUsersGetOn(id) { |
| | | febs.get(ctx + 'documentary/traderGetOn/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function confirmUsersGetOutFrist(id) { |
| | | febs.get(ctx + 'documentary/traderGetOutFrist/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function cancelUsers(id) { |
| | | febs.get(ctx + 'documentary/traderGetFull/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | | tableIns.reload({where: params, page: {curr: 1}}); |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | $searchForm[0].reset(); |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userTable', |
| | | url: ctx + 'documentary/traderProfitInfo', |
| | | cols: [[ |
| | | {field: 'phone', title: '手机号', minWidth: 100,align:'left'}, |
| | | {field: 'realName', title: '姓名', minWidth: 100,align:'left'}, |
| | | {field: 'inviteId', title: '邀请码UID', minWidth: 80,align:'center'}, |
| | | {field: 'profitRatio', title: '利润率', minWidth: 80,align:'center'}, |
| | | {field: 'profitRatioTotal', title: '总返利润', minWidth: 80,align:'center'}, |
| | | {title: '利润详情', |
| | | templet: function (d) { |
| | | return '<button lay-event="seeFollowerInfo" shiro:hasPermission="user:update">查看</button>' |
| | | }, minWidth: 100,align:'center'}, |
| | | {field: 'totalProfitRatio', title: '累计收益率', minWidth: 80,align:'center'}, |
| | | {field: 'totalProfit', title: '带单总收益', minWidth: 80,align:'center'}, |
| | | {field: 'followerTotalProfit', title: '跟随者总收益', minWidth: 80,align:'center'}, |
| | | {field: 'winRate', title: '胜率', minWidth: 80,align:'center'}, |
| | | {field: 'totalFollowerCnt', title: '累计跟随人数', minWidth: 80,align:'center'}, |
| | | {field: 'totalOrderCnt', title: '交易笔数', minWidth: 80,align:'center'}, |
| | | {field: 'accountType', title: '账号类型', |
| | | templet: function (d) { |
| | | if (d.accountType === 2) { |
| | | return '<span style="color:green;">测试账号</span>' |
| | | } else if (d.accountType === 1) { |
| | | return '<span style="color:red;">正常账号</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'email', title: '邮箱', minWidth: 100,align:'left'}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | account: $searchForm.find('input[name="account"]').val().trim(), |
| | | }; |
| | | } |
| | | |
| | | }) |
| | | </script> |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="trader-index" lay-title="交易员列表">
|
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-user" lay-title="交易员列表">
|
| | | <div class="layui-row febs-container">
|
| | | <div class="layui-col-md12">
|
| | | <div class="layui-card">
|
| | |
| | | febs = layui.febs,
|
| | | form = layui.form,
|
| | | table = layui.table,
|
| | | $view = $('#trader-index'),
|
| | | $view = $('#febs-user'),
|
| | | $query = $view.find('#query'),
|
| | | $reset = $view.find('#reset'),
|
| | | $searchForm = $view.find('form'),
|
| | |
| | | url: ctx + 'documentary/traderList',
|
| | | cols: [[
|
| | | {field: 'phone', title: '手机号', minWidth: 100,align:'left'},
|
| | | {field: 'email', title: '邮箱', minWidth: 200,align:'left'},
|
| | | {field: 'realName', title: '姓名', minWidth: 200,align:'left'},
|
| | | {field: 'email', title: '邮箱', minWidth: 100,align:'left'},
|
| | | {field: 'realName', title: '姓名', minWidth: 100,align:'left'},
|
| | | {field: 'inviteId', title: '邀请码UID', minWidth: 80,align:'center'},
|
| | | {field: 'profitRatio', title: '利润率', minWidth: 80,align:'center'},
|
| | | {field: 'accountType', title: '账号类型',
|