Helius
2020-07-01 e09e66d3b3a74a8e8f178378e139f7f0e33f6225
modify
11 files modified
339 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/entity/ContractHoldOrderEntity.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/entity/ContractOrderEntity.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/vo/CoinVo.java 2 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/CoinMapper.xml 12 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/ContractHoldOrderMapper.xml 18 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/ContractOrderMapper.xml 20 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/contract/buy-list.html 62 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/contract/history-list.html 68 ●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/contract/hold-list.html 76 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/contract/sale-list.html 62 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java
@@ -51,9 +51,9 @@
    public FebsResponse getHistoryList(ContractOrderEntity contractOrderEntity, QueryRequest request) {
        User user = getCurrentUser();
        if (user.getType().equals(FebsConstant.USER_TYPE_ADMIN)) {
            contractOrderEntity.setRefererId(FebsConstant.DEFAULT_REFERER_ID);
            contractOrderEntity.setRefererIds(FebsConstant.DEFAULT_REFERER_ID);
        } else {
            contractOrderEntity.setRefererId(user.getInviteId());
            contractOrderEntity.setRefererIds(user.getInviteId());
        }
        Map<String, Object> data = getDataTable(contractOrderService.findHistoryOrderListInPage(contractOrderEntity, request));
        return new FebsResponse().success().data(data);
src/main/java/com/xcong/excoin/modules/contract/entity/ContractHoldOrderEntity.java
@@ -1,5 +1,6 @@
package com.xcong.excoin.modules.contract.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xcong.excoin.common.entity.BaseEntity;
import lombok.Data;
@@ -159,4 +160,9 @@
    private BigDecimal returnRatio;
    private int isProfit;
    @TableField(exist = false)
    private String timeType;
    @TableField(exist = false)
    private String openType;
}
src/main/java/com/xcong/excoin/modules/contract/entity/ContractOrderEntity.java
@@ -1,5 +1,6 @@
package com.xcong.excoin.modules.contract.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xcong.excoin.common.entity.BaseEntity;
import lombok.Data;
@@ -197,11 +198,19 @@
    private int operateNo;
    @TableField(exist = false)
    private String refererId;
    @TableField(exist = false)
    private String refererIds;
    @TableField(exist = false)
    private String phone;
    @TableField(exist = false)
    private String email;
    @TableField(exist = false)
    private String name;
    @TableField(exist = false)
    private String timeType;
}
src/main/java/com/xcong/excoin/modules/contract/vo/CoinVo.java
@@ -28,4 +28,6 @@
    private Date createTime;
    private String refererId;
    private String account;
}
src/main/resources/mapper/modules/CoinMapper.xml
@@ -16,6 +16,9 @@
            from member a
            inner join member_quick_buy_sale b on a.id=b.member_id and b.order_type='B'
            where find_in_set(#{record.refererId}, a.referer_ids)
            <if test="record.account!=null and record.account!=''">
                and (a.phone=#{record.account} or a.email=#{record.account} or a.invite_id=#{record.account})
            </if>
            union
            select
                a.invite_id inviteId,
@@ -29,6 +32,9 @@
            from member a
            inner join member_coin_charge b on a.id=b.member_id and b.status=2
            where find_in_set(#{record.refererId}, a.referer_ids)
            <if test="record.account!=null and record.account!=''">
                and (a.phone=#{record.account} or a.email=#{record.account} or a.invite_id=#{record.account})
            </if>
            ) x
        order by createTime desc
    </select>
@@ -47,6 +53,9 @@
            from member a
            inner join member_quick_buy_sale b on a.id=b.member_id and b.order_type='S'
            where find_in_set(#{record.refererId}, a.referer_ids)
            <if test="record.account!=null and record.account!=''">
                and (a.phone=#{record.account} or a.email=#{record.account} or a.invite_id=#{record.account})
            </if>
            union
            select
                a.invite_id inviteId,
@@ -60,6 +69,9 @@
            from member a
            inner join member_coin_withdraw b on a.id=b.member_id and b.status=2
            where find_in_set(#{record.refererId}, a.referer_ids)
            <if test="record.account!=null and record.account!=''">
                and (a.phone=#{record.account} or a.email=#{record.account} or a.invite_id=#{record.account})
            </if>
            ) x
        order by createTime desc
    </select>
src/main/resources/mapper/modules/ContractHoldOrderMapper.xml
@@ -11,6 +11,24 @@
                <if test="record.inviteId!=null and record.inviteId!=''">
                    and find_in_set(#{record.inviteId}, b.referer_ids)
                </if>
                <if test="record.symbol!=null and record.symbol!=''">
                    and symbol=#{record.symbol}
                </if>
                <if test="record.openType!=null and record.openType!=''">
                    and opening_type=#{record.openType}
                </if>
                <if test='record.timeType=="1"'>
                    and TO_DAYS(create_time) = TO_DAYS(NOW())
                </if>
                <if test='record.timeType=="2"'>
                    and TO_DAYS(NOW()) - TO_DAYS(create_time) = 1
                </if>
                <if test='record.timeType=="3"'>
                    and YEARWEEK(date_format(create_time,'%Y-%m-%d')) = YEARWEEK(now())
                </if>
                <if test='record.timeType=="4"'>
                    and DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' )
                </if>
            </if>
        </where>
        order by a.create_time desc
src/main/resources/mapper/modules/ContractOrderMapper.xml
@@ -14,8 +14,26 @@
        inner join contract_order c on a.id=c.member_id
        <where>
            <if test="record!=null">
                <if test="record.refererIds!=null and record.refererIds!=''">
                    find_in_set(#{record.refererIds}, a.referer_ids)
                </if>
                <if test="record.refererId!=null and record.refererId!=''">
                    find_in_set(#{record.refererId}, a.referer_ids)
                    and a.referer_id=#{record.refererId}
                </if>
                <if test="record.name!=null and record.name!=''">
                    and (a.phone=#{record.name} or a.email=#{record.name} or a.invite_id=#{record.name})
                </if>
                <if test='record.timeType=="1"'>
                    and TO_DAYS(c.create_time) = TO_DAYS(NOW())
                </if>
                <if test='record.timeType=="2"'>
                    and TO_DAYS(NOW()) - TO_DAYS(c.create_time) = 1
                </if>
                <if test='record.timeType=="3"'>
                    and YEARWEEK(date_format(c.create_time,'%Y-%m-%d')) = YEARWEEK(now())
                </if>
                <if test='record.timeType=="4"'>
                    and DATE_FORMAT(c.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' )
                </if>
                and order_status = 1
            </if>
src/main/resources/templates/febs/views/modules/contract/buy-list.html
@@ -13,45 +13,6 @@
                                                   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">
@@ -85,21 +46,12 @@
            $reset = $view.find('#reset'),
            $searchForm = $view.find('form'),
            sortObject = {field: 'createTime', type: null},
            tableIns,
            createTimeFrom,
            createTimeTo;
            tableIns;
        form.render();
        // 表格初始化
        initTable();
        // 时间组件
        laydate.render({
            elem: '#user-createTime',
            range: true,
            trigger: 'click'
        });
        // 查询按钮
        $query.on('click', function () {
@@ -111,8 +63,6 @@
        $reset.on('click', function () {
            $searchForm[0].reset();
            sortObject.type = 'null';
            createTimeTo = null;
            createTimeFrom = null;
            tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
        });
@@ -137,18 +87,8 @@
        // 获取查询参数
        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()
            };
        }
src/main/resources/templates/febs/views/modules/contract/history-list.html
@@ -14,42 +14,17 @@
                                        </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">
                                            <input type="text" placeholder="上级UID" name="refererId"
                                                   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">
                                            <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 class="layui-input-block">
                                            <input type="radio" name="timeType" value="1" title="今日">
                                            <input type="radio" name="timeType" value="2" title="昨日">
                                            <input type="radio" name="timeType" value="3" title="本周">
                                            <input type="radio" name="timeType" value="4" title="本月">
                                        </div>
                                    </div>
                                </div>
@@ -125,20 +100,12 @@
            $searchForm = $view.find('form'),
            sortObject = {field: 'createTime', type: null},
            tableIns,
            createTimeFrom,
            createTimeTo;
            timeType;
        form.render();
        // 表格初始化
        initTable();
        // 时间组件
        laydate.render({
            elem: '#user-createTime',
            range: true,
            trigger: 'click'
        });
        // 查询按钮
        $query.on('click', function () {
@@ -150,8 +117,7 @@
        $reset.on('click', function () {
            $searchForm[0].reset();
            sortObject.type = 'null';
            createTimeTo = null;
            createTimeFrom = null;
            timeType = null;
            tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
        });
@@ -189,18 +155,14 @@
        // 获取查询参数
        function getQueryParams() {
            var createTime = $searchForm.find('input[name="createTime"]').val();
            if (createTime) {
                createTimeFrom = createTime.split(' - ')[0];
                createTimeTo = createTime.split(' - ')[1];
            var type = $searchForm.find('input[name="timeType"]:checked').val();
            if (type) {
                timeType = type;
            }
            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(),
                timeType : timeType,
                name: $searchForm.find('input[name="account"]').val().trim(),
                refererId: $searchForm.find('input[name="refererId"]').val().trim(),
                invalidate_ie_cache: new Date()
            };
        }
src/main/resources/templates/febs/views/modules/contract/hold-list.html
@@ -14,42 +14,36 @@
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label layui-form-label-sm">创建时间</label>
                                        <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">
                                            <select name="symbol">
                                                <option value=""></option>
                                                <option value="1">测试账号</option>
                                                <option value="2">正常账号</option>
                                                <option value="BTC/USDT">BTC/USDT</option>
                                                <option value="BCH/USDT">BCH/USDT</option>
                                                <option value="ETC/USDT">ETC/USDT</option>
                                                <option value="ETH/USDT">ETH/USDT</option>
                                                <option value="EOS/USDT">EOS/USDT</option>
                                                <option value="XRP/USDT">XRP/USDT</option>
                                                <option value="LTC/USDT">LTC/USDT</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label layui-form-label-sm">账号状态</label>
                                        <label class="layui-form-label layui-form-label-sm">开仓类型</label>
                                        <div class="layui-input-inline">
                                            <select name="accountStatus">
                                            <select name="openType">
                                                <option value=""></option>
                                                <option value="0">禁用</option>
                                                <option value="1">正常</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="certifyStatus">
                                                <option value=""></option>
                                                <option value="0">未通过</option>
                                                <option value="1">审核中</option>
                                                <option value="2">审核通过</option>
                                                <option value="2">未实名</option>
                                            </select>
                                        <div class="layui-input-block">
                                            <input type="radio" name="timeType" value="1" title="今日">
                                            <input type="radio" name="timeType" value="2" title="昨日">
                                            <input type="radio" name="timeType" value="3" title="本周">
                                            <input type="radio" name="timeType" value="4" title="本月">
                                        </div>
                                    </div>
                                </div>
@@ -98,20 +92,13 @@
            $searchForm = $view.find('form'),
            sortObject = {field: 'createTime', type: null},
            tableIns,
            createTimeFrom,
            createTimeTo;
            timeType,
            openingType;
        form.render();
        // 表格初始化
        initTable();
        // 时间组件
        laydate.render({
            elem: '#user-createTime',
            range: true,
            trigger: 'click'
        });
        // 查询按钮
        $query.on('click', function () {
@@ -123,8 +110,8 @@
        $reset.on('click', function () {
            $searchForm[0].reset();
            sortObject.type = 'null';
            createTimeTo = null;
            createTimeFrom = null;
            timeType = null;
            openingType = null;
            tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
        });
@@ -156,18 +143,19 @@
        // 获取查询参数
        function getQueryParams() {
            var createTime = $searchForm.find('input[name="createTime"]').val();
            if (createTime) {
                createTimeFrom = createTime.split(' - ')[0];
                createTimeTo = createTime.split(' - ')[1];
            var type = $searchForm.find('input[name="timeType"]:checked').val();
            if (type) {
                timeType = type;
            }
            var openType = $searchForm.find("select[name='openType']").val();
            if (openType) {
                openingType = openType;
            }
            return {
                startTime: createTimeFrom,
                endTime: createTimeTo,
                timeType: timeType,
                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(),
                openType: openingType,
                symbol: $searchForm.find("select[name='symbol']").val(),
                invalidate_ie_cache: new Date()
            };
        }
src/main/resources/templates/febs/views/modules/contract/sale-list.html
@@ -13,45 +13,6 @@
                                                   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">
@@ -85,21 +46,12 @@
            $reset = $view.find('#reset'),
            $searchForm = $view.find('form'),
            sortObject = {field: 'createTime', type: null},
            tableIns,
            createTimeFrom,
            createTimeTo;
            tableIns;
        form.render();
        // 表格初始化
        initTable();
        // 时间组件
        laydate.render({
            elem: '#user-createTime',
            range: true,
            trigger: 'click'
        });
        // 查询按钮
        $query.on('click', function () {
@@ -111,8 +63,6 @@
        $reset.on('click', function () {
            $searchForm[0].reset();
            sortObject.type = 'null';
            createTimeTo = null;
            createTimeFrom = null;
            tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
        });
@@ -137,18 +87,8 @@
        // 获取查询参数
        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()
            };
        }