8 files added
1 files deleted
8 files modified
| | |
| | | Map<String, Object> data = getDataTable(memberService.findMemberListInPage(member, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | @GetMapping("getFeeAmountList") |
| | | public FebsResponse getFeeAmountList(MemberEntity memberEntity, QueryRequest request) { |
| | | User user = getCurrentUser(); |
| | | memberEntity.setRefererId(FebsConstant.USER_TYPE_ADMIN.equals(user.getType()) ? FebsConstant.DEFAULT_REFERER_ID : user.getInviteId()); |
| | | Map<String, Object> data = getDataTable(memberService.findFeeAmountList(memberEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | } |
| | |
| | | import com.xcong.excoin.common.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(exist = false) |
| | | private Date endTime; |
| | | |
| | | @TableField(exist = false) |
| | | private BigDecimal openFeeAmount; |
| | | @TableField(exist = false) |
| | | private BigDecimal closeFeeAmount; |
| | | @TableField(exist = false) |
| | | private BigDecimal holdFeeAmount; |
| | | @TableField(exist = false) |
| | | private BigDecimal loseOrProfit; |
| | | } |
| | |
| | | IPage<MemberEntity> selectMemberListInPage(Page<MemberEntity> page, @Param("record") MemberEntity memberEntity); |
| | | |
| | | MemberEntity selectMemberByInviteIdAndRefererId(@Param("inviteId") String inviteId, @Param("refererId") String refererId); |
| | | |
| | | IPage<MemberEntity> selectMemberFeeAmountTotal(Page<MemberEntity> page, @Param("record") MemberEntity memberEntity); |
| | | } |
| | |
| | | public interface IMemberService extends IService<MemberEntity> { |
| | | |
| | | IPage<MemberEntity> findMemberListInPage(MemberEntity memberEntity, QueryRequest request); |
| | | |
| | | IPage<MemberEntity> findFeeAmountList(MemberEntity memberEntity, QueryRequest request); |
| | | } |
| | |
| | | Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.baseMapper.selectMemberListInPage(page, memberEntity); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MemberEntity> findFeeAmountList(MemberEntity memberEntity, QueryRequest request) { |
| | | Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.baseMapper.selectMemberListInPage(page, memberEntity); |
| | | } |
| | | } |
| | |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity; |
| | | import com.xcong.excoin.modules.contract.entity.ContractOrderEntity; |
| | | import com.xcong.excoin.modules.contract.service.IContractHoldOrderService; |
| | | import com.xcong.excoin.modules.contract.service.IContractOrderService; |
| | | import com.xcong.excoin.system.entity.User; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | private final IContractHoldOrderService contractHoldOrderService; |
| | | |
| | | private final IContractOrderService contractOrderService; |
| | | |
| | | @GetMapping("getHoldList") |
| | | public FebsResponse getHoldList(ContractHoldOrderEntity contractHoldOrderEntity, QueryRequest request) { |
| | | User user = getCurrentUser(); |
| | |
| | | Map<String, Object> data = getDataTable(contractHoldOrderService.findHoldList(contractHoldOrderEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | @GetMapping("getHistoryList") |
| | | public FebsResponse getHistoryList(ContractOrderEntity contractOrderEntity, QueryRequest request) { |
| | | User user = getCurrentUser(); |
| | | if (user.getType().equals(FebsConstant.USER_TYPE_ADMIN)) { |
| | | contractOrderEntity.setRefererId(FebsConstant.DEFAULT_REFERER_ID); |
| | | } else { |
| | | contractOrderEntity.setRefererId(user.getInviteId()); |
| | | } |
| | | Map<String, Object> data = getDataTable(contractOrderService.findHistoryOrderListInPage(contractOrderEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | } |
| | |
| | | public String saleList() { |
| | | return FebsUtil.view("modules/contract/sale-list"); |
| | | } |
| | | |
| | | @GetMapping("historyList") |
| | | @RequiresPermissions("history:view") |
| | | public String historyList() { |
| | | return FebsUtil.view("modules/contract/history-list"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.contract.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.xcong.excoin.common.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 合约订单历史表 |
| | | * |
| | | * @author wzy |
| | | * @date 2020-05-27 |
| | | **/ |
| | | @Data |
| | | @TableName("contract_order") |
| | | public class ContractOrderEntity extends BaseEntity { |
| | | |
| | | /** |
| | | * 交易类型 市价 |
| | | */ |
| | | public static final int TRADE_TYPE_MARK_PRICE = 1; |
| | | |
| | | /** |
| | | * 交易类型 限价 |
| | | */ |
| | | public static final int TRADE_TYPE_LIMIT_PRICE = 2; |
| | | |
| | | /** |
| | | * 订单状态 撤单 |
| | | */ |
| | | public static final int ORDER_STATUS_CANCEL = 2; |
| | | |
| | | /** |
| | | * 订单状态 成交 |
| | | */ |
| | | public static final int ORDER_STATUS_SUCCESS = 1; |
| | | |
| | | /** |
| | | * 订单类型 开多 |
| | | */ |
| | | public static final int ORDER_TYPE_OPEN_MORE = 1; |
| | | |
| | | /** |
| | | * 订单类型 开空 |
| | | */ |
| | | public static final int ORDER_TYPE_OPEN_LESS = 2; |
| | | |
| | | /** |
| | | * 订单类型 平多 |
| | | */ |
| | | public static final int ORDER_TYPE_CLOSE_MORE = 3; |
| | | |
| | | /** |
| | | * 订单类型 平空 |
| | | */ |
| | | public static final int ORDER_TYPE_CLOSE_LESS = 4; |
| | | |
| | | |
| | | /** |
| | | * 会员Id |
| | | */ |
| | | private Long memberId; |
| | | |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 仓位类型 1-逐仓 2-全仓 |
| | | */ |
| | | private int positionType; |
| | | |
| | | /** |
| | | * 交易类型 1-市价 2-限价 |
| | | */ |
| | | private int tradeType; |
| | | |
| | | /** |
| | | * 订单类型 - 1开多,2开空,3平多,4平空 |
| | | */ |
| | | private int orderType; |
| | | |
| | | /** |
| | | * 订单状态 - 1成交 2撤单 |
| | | */ |
| | | private int orderStatus = 1; |
| | | |
| | | /** |
| | | * 委托开仓价 |
| | | */ |
| | | private BigDecimal entrustOpeningPrice; |
| | | |
| | | /** |
| | | * 委托时间 |
| | | */ |
| | | private Date entrustTime; |
| | | |
| | | /** |
| | | * 币种 |
| | | */ |
| | | private String symbol; |
| | | |
| | | /** |
| | | * 手数 |
| | | */ |
| | | private int symbolCnt; |
| | | |
| | | /** |
| | | * 币种规格 |
| | | */ |
| | | private BigDecimal symbolSku; |
| | | |
| | | /** |
| | | * 平仓价 |
| | | */ |
| | | private BigDecimal closingPrice; |
| | | |
| | | /** |
| | | * 平仓手续费 |
| | | */ |
| | | private BigDecimal closingFeeAmount; |
| | | |
| | | /** |
| | | * 平仓时间 |
| | | */ |
| | | private Date closingTime; |
| | | |
| | | /** |
| | | * 平仓类型 2平多3平空4爆仓平多5爆仓平空6止盈平多7止盈平空8止损平多9止损平空 |
| | | */ |
| | | private int closingType; |
| | | |
| | | /** |
| | | * 杠杆倍率 |
| | | */ |
| | | private int leverRatio; |
| | | |
| | | /** |
| | | * 止损价 |
| | | */ |
| | | private BigDecimal stopLossPrice; |
| | | |
| | | /** |
| | | * 止盈价 |
| | | */ |
| | | private BigDecimal stopProfitPrice; |
| | | |
| | | /** |
| | | * 盈亏金额 |
| | | */ |
| | | private BigDecimal rewardAmount; |
| | | |
| | | /** |
| | | * 盈亏比例 |
| | | */ |
| | | private BigDecimal rewardRatio; |
| | | |
| | | /** |
| | | * 开仓价 |
| | | */ |
| | | private BigDecimal openingPrice; |
| | | |
| | | /** |
| | | * 开仓手续费 |
| | | */ |
| | | private BigDecimal openingFeeAmount; |
| | | |
| | | private Date openingTime; |
| | | |
| | | /** |
| | | * 预付款金额 |
| | | */ |
| | | private BigDecimal prePaymentAmount; |
| | | |
| | | /** |
| | | * 保证金 |
| | | */ |
| | | private BigDecimal bondAmount; |
| | | |
| | | /** |
| | | * 市场价 |
| | | */ |
| | | private BigDecimal markPrice; |
| | | |
| | | /** |
| | | * 预估强平价 |
| | | */ |
| | | private BigDecimal forceClosingPrice; |
| | | |
| | | /** |
| | | * 持仓费 |
| | | */ |
| | | private BigDecimal holdAmount; |
| | | |
| | | private int operateNo; |
| | | |
| | | private String refererId; |
| | | private String phone; |
| | | private String email; |
| | | private String name; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.contract.mapper; |
| | | |
| | | 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.contract.entity.ContractOrderEntity; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author helius |
| | | */ |
| | | public interface ContractOrderMapper extends BaseMapper<ContractOrderEntity> { |
| | | |
| | | IPage<ContractOrderEntity> selectHistoryOrderListInPage(Page<ContractOrderEntity> page, @Param("record") ContractOrderEntity contractOrderEntity); |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.contract.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.contract.entity.ContractOrderEntity; |
| | | |
| | | /** |
| | | * @author helius |
| | | */ |
| | | public interface IContractOrderService extends IService<ContractOrderEntity> { |
| | | |
| | | IPage<ContractOrderEntity> findHistoryOrderListInPage(ContractOrderEntity contractOrderEntity, QueryRequest request); |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.contract.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.contract.entity.ContractOrderEntity; |
| | | import com.xcong.excoin.modules.contract.mapper.ContractOrderMapper; |
| | | import com.xcong.excoin.modules.contract.service.IContractOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-06-19 |
| | | **/ |
| | | @Service |
| | | public class ContractOrderServiceImpl extends ServiceImpl<ContractOrderMapper, ContractOrderEntity> implements IContractOrderService { |
| | | |
| | | @Override |
| | | public IPage<ContractOrderEntity> findHistoryOrderListInPage(ContractOrderEntity contractOrderEntity, QueryRequest request) { |
| | | Page<ContractOrderEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.baseMapper.selectHistoryOrderListInPage(page, contractOrderEntity); |
| | | } |
| | | } |
New file |
| | |
| | | <?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.contract.mapper.ContractOrderMapper"> |
| | | |
| | | <select id="selectHistoryOrderListInPage" resultType="com.xcong.excoin.modules.contract.entity.ContractOrderEntity"> |
| | | select |
| | | a.phone, |
| | | a.email, |
| | | a.referer_id, |
| | | concat(b.first_name, b.second_name) name, |
| | | c.* |
| | | from member a |
| | | inner join member_authentication b on a.id=b.member_id |
| | | inner join contract_order c on a.id=c.member_id |
| | | <where> |
| | | <if test="record!=null"> |
| | | <if test="record.refererId!=null and record.refererId!=''"> |
| | | find_in_set(#{record.refererId}, a.referer_ids) |
| | | </if> |
| | | and order_status = 1 |
| | | </if> |
| | | </where> |
| | | order by c.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | where invite_id=#{inviteId} and referer_id=#{refererId} |
| | | </select> |
| | | |
| | | <select id="selectMemberFeeAmountTotal" resultType="com.xcong.excoin.modules.agent.entity.MemberEntity"> |
| | | select |
| | | a.create_time, |
| | | a.phone, |
| | | a.email, |
| | | a.referer_id, |
| | | a.invite_id, |
| | | concat(c.first_name, c.second_name) account, |
| | | sum(b.opening_fee_amount) openFeeAmount, |
| | | sum(b.closing_fee_amount) closeFeeAmount, |
| | | sum(b.hold_amount) holdFeeAmount, |
| | | sum(reward_amount) loseOrProfit |
| | | from member a |
| | | inner join member_authentication c on a.id=c.member_id |
| | | inner join contract_order b on a.id=b.member_id and b.order_status=1 |
| | | where find_in_set(#{record.refererId}, a.referer_ids) |
| | | group by a.create_time,a.phone, a.email |
| | | order by a.create_time desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <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"> |
| | | <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 class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">创建时间</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="createTime" id="user-createTime" |
| | | 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="accountType"> |
| | | <option value=""></option> |
| | | <option value="1">测试账号</option> |
| | | <option value="2">正常账号</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="accountStatus"> |
| | | <option value=""></option> |
| | | <option value="0">禁用</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="certifyStatus"> |
| | | <option value=""></option> |
| | | <option value="0">未通过</option> |
| | | <option value="1">审核中</option> |
| | | <option value="2">审核通过</option> |
| | | <option value="2">未实名</option> |
| | | </select> |
| | | </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="open-type"> |
| | | {{# |
| | | var openType = { |
| | | 1: {title: '开多', color : 'blue'}, |
| | | 2: {title: '开空', color : 'red'}, |
| | | 3: {title: '平多', color : 'blue'}, |
| | | 4: {title: '平空', color : 'red'} |
| | | }[d.orderType]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{openType.color}}">{{ openType.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="closing-type"> |
| | | {{# |
| | | var closingType = { |
| | | 0: {title: '-'}, |
| | | 2: {title: '平多'}, |
| | | 3: {title: '平空'}, |
| | | 4: {title: '爆仓平多'}, |
| | | 5: {title: '爆仓平空'}, |
| | | 6: {title: '止盈平多'}, |
| | | 7: {title: '止盈平空'}, |
| | | 8: {title: '止损平多'}, |
| | | 9: {title: '止损平空'}, |
| | | }[d.closingType]; |
| | | }} |
| | | <span>{{ closingType.title }}</span> |
| | | </script> |
| | | <script type="text/html" id="loseOrProfit"> |
| | | {{# if(d.orderType == 3 || d.orderType == 4){ }} |
| | | {{# if(d.rewardAmount >= 0){ }} |
| | | <span style="color: green">{{ d.rewardAmount }}</span> |
| | | {{# } else { }} |
| | | <span style="color: red">{{ d.rewardAmount }}</span> |
| | | {{# } }} |
| | | {{# } }} |
| | | </script> |
| | | <!-- 表格字段状态格式化 start --> |
| | | |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | | laydate = layui.laydate, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-user'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns, |
| | | createTimeFrom, |
| | | createTimeTo; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 时间组件 |
| | | laydate.render({ |
| | | elem: '#user-createTime', |
| | | range: true, |
| | | trigger: '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(); |
| | | sortObject.type = 'null'; |
| | | createTimeTo = null; |
| | | createTimeFrom = null; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userTable', |
| | | url: ctx + 'order/getHistoryList', |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'orderNo', title: '订单编号', minWidth: 150, align: 'center'}, |
| | | {field: 'symbol', title: '合约名称', minWidth: 100, align: 'center'}, |
| | | {field: 'refererId', title: '上级UID', minWidth: 100, align: 'center'}, |
| | | {field: 'name', title: '姓名', minWidth: 130, align: 'center'}, |
| | | {field: 'phone', title: '联系方式', minWidth: 130, align: 'center'}, |
| | | {field: 'email', title: '邮箱', minWidth: 140, align: 'center'}, |
| | | {title: '开仓类型', templet: '#open-type', minWidth: 100, align: 'center'}, |
| | | {field: 'entrustPrice', title: '委托价', minWidth: 100, align: 'center'}, |
| | | {field: 'openingPrice', title: '开仓价', minWidth: 130, align: 'center'}, |
| | | {field: 'openingFeeAmount', title: '开仓手续费', minWidth: 130, align: 'center'}, |
| | | {field: 'openingTime', title: '开仓时间', minWidth: 180, align: 'center'}, |
| | | {field: 'bondAmount', title: '保证金', minWidth: 120, align: 'center'}, |
| | | {field: 'symbolCnt', title: '成交量', minWidth: 100, align: 'center'}, |
| | | {field: 'stopProfitPrice', title: '止盈', minWidth: 100, align: 'center'}, |
| | | {field: 'stopLossPrice', title: '止损', minWidth: 120, align: 'center'}, |
| | | {field: 'holdAmount', title: '持仓费', minWidth: 140, align: 'center'}, |
| | | {templet: '#loseOrProfit', title: '平仓盈亏', minWidth: 140, align: 'center'}, |
| | | {field: 'closingPrice', title: '平仓价', minWidth: 140, align: 'center'}, |
| | | {field: 'closingFeeAmount', title: '平仓手续费', minWidth: 140, align: 'center'}, |
| | | { title: '平仓类型', templet: '#closing-type', minWidth: 100, align: 'center'}, |
| | | {field: 'closingTime', title: '平仓时间', minWidth: 180, align: 'center'}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | var createTime = $searchForm.find('input[name="createTime"]').val(); |
| | | if (createTime) { |
| | | createTimeFrom = createTime.split(' - ')[0]; |
| | | createTimeTo = createTime.split(' - ')[1]; |
| | | } |
| | | return { |
| | | startTime: createTimeFrom, |
| | | endTime: createTimeTo, |
| | | account: $searchForm.find('input[name="account"]').val().trim(), |
| | | accountStatus: $searchForm.find("select[name='accountStatus']").val(), |
| | | accountType: $searchForm.find("select[name='accountType']").val(), |
| | | certifyStatus: $searchForm.find("select[name='certifyStatus']").val(), |
| | | invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | }) |
| | | </script> |
New file |
| | |
| | | <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"> |
| | | <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 class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">创建时间</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="createTime" id="user-createTime" |
| | | 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="accountType"> |
| | | <option value=""></option> |
| | | <option value="1">测试账号</option> |
| | | <option value="2">正常账号</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="accountStatus"> |
| | | <option value=""></option> |
| | | <option value="0">禁用</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="certifyStatus"> |
| | | <option value=""></option> |
| | | <option value="0">未通过</option> |
| | | <option value="1">审核中</option> |
| | | <option value="2">审核通过</option> |
| | | <option value="2">未实名</option> |
| | | </select> |
| | | </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="open-type"> |
| | | {{# |
| | | var openType = { |
| | | 1: {title: '开多', color : 'blue'}, |
| | | 2: {title: '开空', color : 'red'} |
| | | }[d.openingType]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{openType.color}}">{{ openType.title }}</span> |
| | | </script> |
| | | <!-- 表格字段状态格式化 start --> |
| | | |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | | laydate = layui.laydate, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-user'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns, |
| | | createTimeFrom, |
| | | createTimeTo; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 时间组件 |
| | | laydate.render({ |
| | | elem: '#user-createTime', |
| | | range: true, |
| | | trigger: '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(); |
| | | sortObject.type = 'null'; |
| | | createTimeTo = null; |
| | | createTimeFrom = null; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userTable', |
| | | url: ctx + 'order/getHoldList', |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'orderNo', title: '订单编号', minWidth: 150, align: 'center'}, |
| | | {field: 'symbol', title: '币种', minWidth: 100, align: 'center'}, |
| | | {field: 'refererId', title: '上级UID', minWidth: 100, align: 'center'}, |
| | | {field: 'telphone', title: '联系方式', minWidth: 130, align: 'center'}, |
| | | {field: 'email', title: '邮箱', minWidth: 100, align: 'center'}, |
| | | {title: '开仓类型', templet: '#open-type', minWidth: 100, align: 'center'}, |
| | | {field: 'leverRatio', title: '杠杆倍率', minWidth: 100, align: 'center'}, |
| | | {field: 'openingPrice', title: '开仓均价', minWidth: 120, align: 'center'}, |
| | | {field: 'symbolCnt', title: '持仓数', minWidth: 100, align: 'center'}, |
| | | {field: 'symbolCntSale', title: '可平数', minWidth: 100, align: 'center'}, |
| | | {field: 'forceClosingPrice', title: '预估强平价', minWidth: 130, align: 'center'}, |
| | | {field: 'bondAmount', title: '保证金', minWidth: 130, align: 'center'}, |
| | | {field: 'createTime', title: '开仓时间', minWidth: 160, align: 'center'}, |
| | | {field: 'loseOrProfit', title: '盈亏', minWidth: 140, align: 'center', fixed : "right"}, |
| | | {field: 'returnRatio', title: '回报率', minWidth: 140, align: 'center', fixed : "right"}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | var createTime = $searchForm.find('input[name="createTime"]').val(); |
| | | if (createTime) { |
| | | createTimeFrom = createTime.split(' - ')[0]; |
| | | createTimeTo = createTime.split(' - ')[1]; |
| | | } |
| | | return { |
| | | startTime: createTimeFrom, |
| | | endTime: createTimeTo, |
| | | account: $searchForm.find('input[name="account"]').val().trim(), |
| | | accountStatus: $searchForm.find("select[name='accountStatus']").val(), |
| | | accountType: $searchForm.find("select[name='accountType']").val(), |
| | | certifyStatus: $searchForm.find("select[name='certifyStatus']").val(), |
| | | invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | }) |
| | | </script> |
New file |
| | |
| | | <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"> |
| | | <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 class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">创建时间</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="createTime" id="user-createTime" |
| | | 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="accountType"> |
| | | <option value=""></option> |
| | | <option value="1">测试账号</option> |
| | | <option value="2">正常账号</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="accountStatus"> |
| | | <option value=""></option> |
| | | <option value="0">禁用</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="certifyStatus"> |
| | | <option value=""></option> |
| | | <option value="0">未通过</option> |
| | | <option value="1">审核中</option> |
| | | <option value="2">审核通过</option> |
| | | <option value="2">未实名</option> |
| | | </select> |
| | | </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="open-type"> |
| | | {{# |
| | | var openType = { |
| | | 1: {title: '开多', color : 'blue'}, |
| | | 2: {title: '开空', color : 'red'} |
| | | }[d.openingType]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{openType.color}}">{{ openType.title }}</span> |
| | | </script> |
| | | <!-- 表格字段状态格式化 start --> |
| | | |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | | laydate = layui.laydate, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-user'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns, |
| | | createTimeFrom, |
| | | createTimeTo; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 时间组件 |
| | | laydate.render({ |
| | | elem: '#user-createTime', |
| | | range: true, |
| | | trigger: '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(); |
| | | sortObject.type = 'null'; |
| | | createTimeTo = null; |
| | | createTimeFrom = null; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userTable', |
| | | url: ctx + 'member/getFeeAmountList', |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'inviteId', title: '代理UID', minWidth: 150, align: 'center'}, |
| | | {field: 'refererId', title: '上级UID', minWidth: 100, align: 'center'}, |
| | | {field: 'telphone', title: '联系方式', minWidth: 130, align: 'center'}, |
| | | {field: 'email', title: '邮箱', minWidth: 100, align: 'center'}, |
| | | {field: 'account', title: '姓名', minWidth: 100, align: 'center'}, |
| | | {field: 'openFeeAmount', title: '开仓手续费', minWidth: 140, align: 'center'}, |
| | | {field: 'closeFeeAmount', title: '平仓手续费', minWidth: 140, align: 'center'}, |
| | | {field: 'holdFeeAmount', title: '持仓手续费', minWidth: 140, align: 'center'}, |
| | | {field: 'loseOrProfit', title: '净盈利', minWidth: 140, align: 'center'} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | var createTime = $searchForm.find('input[name="createTime"]').val(); |
| | | if (createTime) { |
| | | createTimeFrom = createTime.split(' - ')[0]; |
| | | createTimeTo = createTime.split(' - ')[1]; |
| | | } |
| | | return { |
| | | startTime: createTimeFrom, |
| | | endTime: createTimeTo, |
| | | account: $searchForm.find('input[name="account"]').val().trim(), |
| | | accountStatus: $searchForm.find("select[name='accountStatus']").val(), |
| | | accountType: $searchForm.find("select[name='accountType']").val(), |
| | | certifyStatus: $searchForm.find("select[name='certifyStatus']").val(), |
| | | invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | }) |
| | | </script> |