v1.1 后台-地区充值统计

This commit is contained in:
2022-10-19 01:33:48 +08:00
parent 9917545371
commit d0dad73f23
2 changed files with 122 additions and 4 deletions

View File

@@ -242,12 +242,11 @@ public class ChargeRecordAdminController extends BaseController {
@RequestMapping(value = "/countryDetail")
@ResponseBody
public BusiResult<List<ChargeRecordCountryVo>> countryDetail(Date startTime, Date endTime) {
List<ChargeRecordCountryVo> data = chargeRecordAdminService.getCountryGoldDetail(startTime, endTime);
return new BusiResult<>(data);
public List<ChargeRecordCountryVo> countryDetail(Date startTime, Date endTime) {
return chargeRecordAdminService.getCountryGoldDetail(startTime, endTime);
}
@RequestMapping(value = "/exportCountryDetail", method = RequestMethod.POST)
@RequestMapping(value = "/exportCountryDetail")
@ResponseBody
public void exportCountryDetail(HttpServletResponse response, Date startTime, Date endTime) throws IOException {
response.setContentType("application/vnd.ms-excel");

View File

@@ -0,0 +1,119 @@
<section class="content">
<div class="box box-primary">
<div class="box-body">
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<section class="content-body">
<div id="toolbar">
<div class="col-sm-12">
<div class="pull-left">
<form id="searchForm" class="col-sm-pull-12" action="/admin/chargeRecord/exportCountryDetail"
method="get" target="_blank">
<div class="col-sm-11">
<label for="beginDate" class="col-sm-2 control-label">开始日期:</label>
<div class="col-sm-4"><input type="text" class="form-control" name="beginDate"
id="beginDate" placeholder="必填">
</div>
<label for="endDate" class="col-sm-2 control-label">结束日期:</label>
<div class="col-sm-4"><input type="text" class="form-control" name="endDate" id="endDate" placeholder="必填"></div>
</div>
</form>
</div>
<div class="pull-right">
<button id="btnSearch" class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>查询
</button>
<button id="btnExport" class="btn btn-default">
<i class="glyphicon glyphicon-export"></i>导出
</button>
</div>
</div>
</div>
<!-- .content -->
<div id="table"></div>
</section>
</div>
</div>
</section>
<script>
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{field: 'country', title: '国家/地区', align: 'center', width: '25%'},
{field: 'googleGold', title: 'google充值钻石', align: 'center', width: '25%'},
{field: 'payermaxGold', title: 'payermax充值钻石', align: 'center', width: '25%'},
{field: 'totalGold', title: '总充值钻石', align: 'center', width: '25%'},
],
cache: false,
striped: true,
showRefresh: false,
pagination: false,
search: false,
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
beginDate: $('#beginDate').val(),
endDate: $('#endDate').val()
};
return param;
},
toolbar: '#toolbar',
url: '/admin/chargeRecord/countryDetail',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
// 导出EXCEL
$('#btnExport').on('click', function () {
if (!$('#beginDate').val() || !$('#endDate').val()) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
$("#searchForm").submit();
});
// 查询刷新
$('#btnSearch').on('click', function () {
if (!$('#beginDate').val() || !$('#endDate').val()) {
$("#tipMsg").text("请输入必填的信息");
$("#tipModal").modal('show');
return;
}
TableHelper.doRefresh('#table');
});
var chargeStart = $('#beginDate').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
chargeStart.datepicker("setDate", new Date(new Date() - 86400 * 7 * 1000))
var chargeEnd = $('#endDate').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
});
chargeEnd.datepicker("setDate", new Date())
chargeStart.on('changeDate', function () {
var date = $('#beginDate').datepicker('getDate');
chargeEnd.datepicker('setStartDate', date);
});
chargeEnd.on('changeDate', function () {
var date = $('#endDate').datepicker('getDate');
chargeStart.datepicker('setEndDate', date);
});
});
</script>