用户列表
This commit is contained in:
parent
02008e5173
commit
d14f0e099e
|
|
@ -47,7 +47,13 @@ public class User {
|
|||
|
||||
@RequestMapping(value = "/getUserList", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object getlist() {
|
||||
return userHelper.getlist();
|
||||
public Object getlist(String draw, Integer start, Integer length) {
|
||||
return userHelper.getlist(draw, start, length);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/updateRemarks", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object updateRemarks(String userId, String remarks) {
|
||||
return userHelper.updateRemarks(userId, remarks);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ public enum PushTypeEnum {
|
|||
offline_push("offline_push", "离线通知"),
|
||||
send_report("send_report", "看护报告"),
|
||||
shops_push("shops_push", "看护通知"),
|
||||
all_push("all_push", "所有用户推送");
|
||||
all_push("all_push", "所有用户推送"),
|
||||
pinglun_push("pinglun_push", "直播间评论");
|
||||
|
||||
private PushTypeEnum(String key, String value) {
|
||||
this.key = key;
|
||||
|
|
|
|||
|
|
@ -26,5 +26,14 @@ public interface UserHelper {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getlist();
|
||||
public Object getlist(String draw, Integer start, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 修改备注
|
||||
*
|
||||
* @param userId
|
||||
* @param remarks
|
||||
* @return
|
||||
*/
|
||||
public Object updateRemarks(String userId, String remarks);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,8 +57,9 @@ public class UserHelperI implements UserHelper {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object getlist() {
|
||||
List<Map> list = tbl_User_Mapper.getUserList();
|
||||
public Object getlist(String draw, Integer start, Integer pageSize) {
|
||||
List<Map> list = tbl_User_Mapper.getUserList(start, pageSize);
|
||||
Integer count = tbl_User_Mapper.getUsersCount();
|
||||
|
||||
for (Map map : list) {
|
||||
if (map.get("createTime") != null) {
|
||||
|
|
@ -73,10 +74,29 @@ public class UserHelperI implements UserHelper {
|
|||
|
||||
Map map = new HashMap();
|
||||
map.put("data", list);
|
||||
map.put("draw", 20);
|
||||
map.put("recordsTotal", 100);
|
||||
map.put("recordsFiltered", 77);
|
||||
map.put("draw", draw);
|
||||
map.put("recordsTotal", count);
|
||||
map.put("recordsFiltered", count);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改备注
|
||||
*
|
||||
* @param userId
|
||||
* @param remarks
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object updateRemarks(String userId, String remarks) {
|
||||
Tbl_User user = new Tbl_User();
|
||||
user.setUserId(Integer.parseInt(userId));
|
||||
user.setRemarks(remarks);
|
||||
int i = tbl_User_Mapper.updateUser(user);
|
||||
if (i > 0) {
|
||||
return "true";
|
||||
} else {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,14 @@ public interface Tbl_User_Mapper {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
@SelectProvider(type = Tbl_User_MapperSql.class, method = "getlist")
|
||||
List<Map> getUserList();
|
||||
@SelectProvider(type = Tbl_User_MapperSql.class, method = "getUserList")
|
||||
List<Map> getUserList(@Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);
|
||||
|
||||
/**
|
||||
* 根据条件查询用户列表总数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@SelectProvider(type = Tbl_User_MapperSql.class, method = "getUsersCount")
|
||||
Integer getUsersCount();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,11 +98,25 @@ public class Tbl_User_MapperSql {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public String getlist() {
|
||||
public String getUserList(@Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("SELECT user_id userId,phone_number phoneNumber,user_email userEmail,nick_name nickName,create_time createTime,phone_type phoneType,login_type loginType,login_time loginTime,login_count loginCount,address,is_register_gwell isRegisterGwell,jiguang_userid jiguangUserid,remarks FROM tbl_user \n"
|
||||
+ "LIMIT 40,10");
|
||||
+ " ORDER BY user_id DESC "
|
||||
+ "LIMIT " + pageNo + "," + pageSize);
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册用户页,获取用户列表总数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getUsersCount() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("SELECT count(1) FROM tbl_user ");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@
|
|||
<div class="col-lg-12 heading">
|
||||
<!-- Start .bredcrumb -->
|
||||
<ul id="crumb" class="breadcrumb">
|
||||
<li><i class="im-home"></i><a href="index">首页</a><i class="en-arrow-right7"></i></li>
|
||||
</ul>
|
||||
<!-- End .breadcrumb -->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,9 +15,123 @@
|
|||
<div class="panel panel-default plain toggle panelClose panelRefresh">
|
||||
<!-- Start .panel -->
|
||||
<div class="panel-heading white-bg">
|
||||
<h4 class="panel-title">Data table</h4>
|
||||
<h4 class="panel-title">用户列表</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table id="searchTable" class="table table-bordered">
|
||||
<tbody><tr>
|
||||
<td class="important">
|
||||
<label>ID</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" id="userId" name="userId" values="10026" class="input-medium searchClass" min="1">
|
||||
</td>
|
||||
<td class="important">
|
||||
<label>手机号</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="phoneNumber" name="phoneNumber" class="input-medium searchClass" maxlength="15">
|
||||
</td>
|
||||
<td class="important">
|
||||
<label>邮箱</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="userEmail" name="userEmail" class="input-medium searchClass" maxlength="20">
|
||||
</td>
|
||||
<td class="important">
|
||||
<label>手机类型</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="phoneType" name="phoneType" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="ios">ios</option>
|
||||
<option value="android">android</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="important">
|
||||
<label>是否注册技威</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="isRegisterGwell" name="isRegisterGwell" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="0">否</option>
|
||||
<option value="1">是</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="important">
|
||||
<label>是否注册极光</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="isRegisterJiguang" name="isRegisterJiguang" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="0">否</option>
|
||||
<option value="1">是</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="important">
|
||||
<label>排序字段</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="sortField" name="sortField" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="createTime">注册时间</option>
|
||||
<option value="loginTime">登陆时间</option>
|
||||
<option value="loginCount">登陆次数</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="important">
|
||||
<label>排序方式</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="sortMode" name="sortMode" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="asc">升序↑</option>
|
||||
<option value="desc">降序↓</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="important">
|
||||
<label>昵称</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="nickName" name="nickName" class="input-medium searchClass" maxlength="10">
|
||||
</td>
|
||||
<td class="important">
|
||||
<label>备注</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="remarks" name="remarks" class="input-medium searchClass" maxlength="10">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td class="important">
|
||||
<label>登陆时间</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<input type="text" id="loginTime1" name="loginTime1" class="input-medium searchClass" maxlength="20">~~<input type="text" id="loginTime2" name="loginTime2" class="input-medium searchClass" maxlength="20">
|
||||
</td>
|
||||
<td class="important">
|
||||
<label>注册时间</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<input type="text" id="createTime1" name="createTime1" class="input-medium searchClass" maxlength="20">~~<input type="text" id="createTime2" name="createTime2" class="input-medium searchClass" maxlength="20">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="12" style="text-align:center;" class="important">
|
||||
<button type="button" class="btn btn-sm btn-info" onclick="refreshTable();" style="margin-right:20px;"><i class="fa-refresh"></i> 刷新</button>
|
||||
<button id="reset" type="reset" class="btn btn-sm btn-info" style="margin-right:20px;"><i class="fa-undo"></i> 重置</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<table class="dataTable cell-border" id="datatable" >
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -36,7 +150,6 @@
|
|||
|
||||
</table>
|
||||
</div>
|
||||
<button id="prompt-modal" type="button" class="btn btn-success btn-alt mr15 mb15">Prompt modal</button>
|
||||
</div>
|
||||
<!-- End .panel -->
|
||||
</div>
|
||||
|
|
@ -47,17 +160,52 @@
|
|||
<!-- End .outlet -->
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#prompt-modal').click(function () {
|
||||
bootbox.dialog({ message: '<div class="text-center"><i class="fa fa-spin fa-spinner"></i> Loading...</div>' })
|
||||
function refreshTable() {
|
||||
var table = $('#datatable').DataTable();
|
||||
table.ajax.reload(null, false);
|
||||
}
|
||||
|
||||
$.fn.dataTable.ext.search.push(
|
||||
function (settings, data, dataIndex) {
|
||||
var userId = parseInt($('#userId').val(), 10);
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
//备注
|
||||
function remarks(userId, remarks) {
|
||||
if (remarks == 'undefined') {
|
||||
remarks = '';
|
||||
}
|
||||
bootbox.prompt({
|
||||
input:'textarea',
|
||||
size: 'large',
|
||||
inputType: 'textarea',
|
||||
title: "请输入要修改的备注",
|
||||
value: remarks,
|
||||
callback: function (result) {
|
||||
//callback result
|
||||
console.log(result);
|
||||
$.ajax({
|
||||
url: 'updateRemarks',
|
||||
type: 'post',
|
||||
data: {"userId": userId, "remarks": result},
|
||||
success: function (data) {
|
||||
var table = $('#datatable').DataTable();
|
||||
table.ajax.reload(null, false);
|
||||
console.log(data);
|
||||
},
|
||||
error: function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//$('#remarksModal').modal("show");
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
//日期控件
|
||||
$('#loginTime1,#loginTime2,#createTime1,#createTime2').datepicker({
|
||||
format: "yyyy-mm-dd"
|
||||
});
|
||||
|
||||
var data = [
|
||||
|
|
@ -78,7 +226,7 @@
|
|||
"$5,300"
|
||||
]
|
||||
];
|
||||
$('#datatable').DataTable({
|
||||
var table = $('#datatable').DataTable({
|
||||
//记录用户状态
|
||||
stateSave: true,
|
||||
//中文自定义
|
||||
|
|
@ -117,7 +265,23 @@
|
|||
//ajax获取服务器数据
|
||||
ajax: {
|
||||
url: 'getUserList',
|
||||
type: 'post'
|
||||
type: 'post',
|
||||
data: function (d) {
|
||||
d.userId = $('#userId').val();
|
||||
d.phoneNumber = $('#phoneNumber').val();
|
||||
d.userEmail = $('#userEmail').val();
|
||||
d.phoneType = $('#phoneType').val();
|
||||
d.isRegisterGwell = $('#isRegisterGwell').val();
|
||||
d.isRegisterJiguang = $('#isRegisterJiguang').val();
|
||||
d.sortField = $('#sortField').val();
|
||||
d.sortMode = $('#sortMode').val();
|
||||
d.nickName = $('#nickName').val();
|
||||
d.remarks = $('#remarks').val();
|
||||
d.loginTime1 = $('#loginTime1').val();
|
||||
d.loginTime2 = $('#loginTime2').val();
|
||||
d.createTime1 = $('#createTime1').val();
|
||||
d.createTime2 = $('#createTime2').val();
|
||||
}
|
||||
},
|
||||
//数据展示
|
||||
columns: [
|
||||
|
|
@ -171,6 +335,8 @@
|
|||
}
|
||||
if (row.loginCount != null) {
|
||||
str = str + "<span class='label label-info mr10 mb10'>" + row.loginCount + "</span>";
|
||||
} else {
|
||||
str = str + "<span class='label label-info mr10 mb10'>0</span>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
@ -190,9 +356,9 @@
|
|||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.isRegisterGwell != null && row.isRegisterGwell == '1') {
|
||||
str = "<span class='btn btn-dark btn-alt'>是</span></br>";
|
||||
str = "<span class='btn btn-success btn-alt'>是</span></br>";
|
||||
} else {
|
||||
str = "<span class='btn btn-dark btn-alt'>否</span></br>";
|
||||
str = "<span class='btn btn-danger btn-alt'>否</span></br>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
@ -202,9 +368,9 @@
|
|||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.jiguangUserid != null && row.jiguangUserid == '') {
|
||||
str = "<span class='btn btn-dark btn-alt'>是</span></br>";
|
||||
str = "<span class='btn btn-success btn-alt'>是</span></br>";
|
||||
} else {
|
||||
str = "<span class='btn btn-dark btn-alt'>否</span></br>";
|
||||
str = "<span class='btn btn-danger btn-alt'>否</span></br>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
@ -214,16 +380,26 @@
|
|||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.remarks != null) {
|
||||
str = str + "<span class='btn btn-dark btn-alt'>" + row.remarks + "</span></br>";
|
||||
str = row.remarks;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{"data": "userId"},
|
||||
{
|
||||
"data": "userId",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "<a href='javascript:void(0);' onclick='remarks(" + row.userId + ",\"" + row.remarks + "\")' title='备注' class='label label-primary'><span class='fa-edit'></span></a>";
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{"data": "userId"}
|
||||
]
|
||||
});
|
||||
|
||||
$('#userId').keyup(function () {
|
||||
//table.ajax.reload(null, true);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1070,7 +1070,7 @@
|
|||
var navsub = navel.closest('.nav.sub');
|
||||
//empty curmb
|
||||
breadcrumb.empty();
|
||||
breadcrumb.append('<li>'+homeIcon+'<a href="index.html">Home</a>'+rightArrow+'</li>');
|
||||
breadcrumb.append('<li>'+homeIcon+'<a href="index">首页</a>'+rightArrow+'</li>');
|
||||
|
||||
if (navsub.closest('li').hasClass('hasSub')) {
|
||||
//get previous
|
||||
|
|
|
|||
|
|
@ -785,7 +785,7 @@
|
|||
CANCEL : "Ακύρωση",
|
||||
CONFIRM : "Επιβεβαίωση"
|
||||
},
|
||||
en : {
|
||||
enE : {
|
||||
OK : "OK",
|
||||
CANCEL : "Cancel",
|
||||
CONFIRM : "OK"
|
||||
|
|
@ -855,7 +855,7 @@
|
|||
CANCEL : "İptal",
|
||||
CONFIRM : "Onayla"
|
||||
},
|
||||
zh_CN : {
|
||||
en : {
|
||||
OK : "OK",
|
||||
CANCEL : "取消",
|
||||
CONFIRM : "确认"
|
||||
|
|
|
|||
Loading…
Reference in New Issue