From e09e66d3b3a74a8e8f178378e139f7f0e33f6225 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 01 Jul 2020 15:55:17 +0800
Subject: [PATCH] modify
---
src/main/java/com/xcong/excoin/modules/contract/vo/CoinVo.java | 2
src/main/java/com/xcong/excoin/modules/contract/entity/ContractHoldOrderEntity.java | 6 +
src/main/java/com/xcong/excoin/modules/contract/entity/ContractOrderEntity.java | 9 +
src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java | 4
src/main/resources/mapper/modules/ContractOrderMapper.xml | 20 +++
src/main/resources/mapper/modules/CoinMapper.xml | 12 ++
src/main/resources/mapper/modules/ContractHoldOrderMapper.xml | 18 +++
src/main/resources/templates/febs/views/modules/contract/hold-list.html | 76 +++++-------
src/main/resources/templates/febs/views/modules/contract/sale-list.html | 62 ----------
src/main/resources/templates/febs/views/modules/contract/buy-list.html | 62 ----------
src/main/resources/templates/febs/views/modules/contract/history-list.html | 68 ++--------
11 files changed, 117 insertions(+), 222 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java b/src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java
index 7918a1b..bb5d759 100644
--- a/src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java
+++ b/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);
diff --git a/src/main/java/com/xcong/excoin/modules/contract/entity/ContractHoldOrderEntity.java b/src/main/java/com/xcong/excoin/modules/contract/entity/ContractHoldOrderEntity.java
index 23c1f47..35282e5 100644
--- a/src/main/java/com/xcong/excoin/modules/contract/entity/ContractHoldOrderEntity.java
+++ b/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;
}
diff --git a/src/main/java/com/xcong/excoin/modules/contract/entity/ContractOrderEntity.java b/src/main/java/com/xcong/excoin/modules/contract/entity/ContractOrderEntity.java
index 7c92c9c..1f94782 100644
--- a/src/main/java/com/xcong/excoin/modules/contract/entity/ContractOrderEntity.java
+++ b/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;
}
diff --git a/src/main/java/com/xcong/excoin/modules/contract/vo/CoinVo.java b/src/main/java/com/xcong/excoin/modules/contract/vo/CoinVo.java
index 13f99e3..ce2bae0 100644
--- a/src/main/java/com/xcong/excoin/modules/contract/vo/CoinVo.java
+++ b/src/main/java/com/xcong/excoin/modules/contract/vo/CoinVo.java
@@ -28,4 +28,6 @@
private Date createTime;
private String refererId;
+
+ private String account;
}
diff --git a/src/main/resources/mapper/modules/CoinMapper.xml b/src/main/resources/mapper/modules/CoinMapper.xml
index b4cc94b..f6ce48b 100644
--- a/src/main/resources/mapper/modules/CoinMapper.xml
+++ b/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>
diff --git a/src/main/resources/mapper/modules/ContractHoldOrderMapper.xml b/src/main/resources/mapper/modules/ContractHoldOrderMapper.xml
index 54d4a9c..25b48a2 100644
--- a/src/main/resources/mapper/modules/ContractHoldOrderMapper.xml
+++ b/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
diff --git a/src/main/resources/mapper/modules/ContractOrderMapper.xml b/src/main/resources/mapper/modules/ContractOrderMapper.xml
index ff105da..92ff33f 100644
--- a/src/main/resources/mapper/modules/ContractOrderMapper.xml
+++ b/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>
diff --git a/src/main/resources/templates/febs/views/modules/contract/buy-list.html b/src/main/resources/templates/febs/views/modules/contract/buy-list.html
index ef46ab1..f6a5dba 100644
--- a/src/main/resources/templates/febs/views/modules/contract/buy-list.html
+++ b/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()
};
}
diff --git a/src/main/resources/templates/febs/views/modules/contract/history-list.html b/src/main/resources/templates/febs/views/modules/contract/history-list.html
index 293b237..dd88cdb 100644
--- a/src/main/resources/templates/febs/views/modules/contract/history-list.html
+++ b/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()
};
}
diff --git a/src/main/resources/templates/febs/views/modules/contract/hold-list.html b/src/main/resources/templates/febs/views/modules/contract/hold-list.html
index 0072890..ca197ee 100644
--- a/src/main/resources/templates/febs/views/modules/contract/hold-list.html
+++ b/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()
};
}
diff --git a/src/main/resources/templates/febs/views/modules/contract/sale-list.html b/src/main/resources/templates/febs/views/modules/contract/sale-list.html
index 0197d7c..d802f44 100644
--- a/src/main/resources/templates/febs/views/modules/contract/sale-list.html
+++ b/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()
};
}
--
Gitblit v1.9.1