提交 bd76f076 authored 作者: 吴德鹏's avatar 吴德鹏

下线人数

上级 df9bfebd
...@@ -210,4 +210,11 @@ public class TbCfUserInfoController { ...@@ -210,4 +210,11 @@ public class TbCfUserInfoController {
return R.ok(); return R.ok();
} }
@GetMapping("/getUserNetwork/{userId}")
@ResponseBody
public R getUserNetwork(@PathVariable String userId) {
List<TbCfUserInfoEntity> networks = tbCfUserInfoService.getUserNetwork(userId);
return R.ok().put("list",networks);
}
} }
...@@ -48,4 +48,8 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> { ...@@ -48,4 +48,8 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> {
int countUser(@Param("account") String account, @Param("avatar") String avatar, @Param("nick") String nick); int countUser(@Param("account") String account, @Param("avatar") String avatar, @Param("nick") String nick);
String selectRandomUser(); String selectRandomUser();
List<TbCfUserInfoEntity> getUserNetwork(String userId);
int getUserNetworkCount(String userId);
} }
...@@ -105,6 +105,8 @@ public class TbCfUserInfoEntity implements Serializable { ...@@ -105,6 +105,8 @@ public class TbCfUserInfoEntity implements Serializable {
private Integer real; private Integer real;
private Integer network;
public Integer getReal() { public Integer getReal() {
return real; return real;
} }
...@@ -422,4 +424,12 @@ public class TbCfUserInfoEntity implements Serializable { ...@@ -422,4 +424,12 @@ public class TbCfUserInfoEntity implements Serializable {
public Integer getEmailFlag() { public Integer getEmailFlag() {
return emailFlag; return emailFlag;
} }
public Integer getNetwork() {
return network;
}
public void setNetwork(Integer network) {
this.network = network;
}
} }
...@@ -102,4 +102,6 @@ public interface TbCfUserInfoService { ...@@ -102,4 +102,6 @@ public interface TbCfUserInfoService {
void importData(MultipartFile multipartFile); void importData(MultipartFile multipartFile);
void exportData(); void exportData();
List<TbCfUserInfoEntity> getUserNetwork(String userId);
} }
...@@ -37,7 +37,12 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService { ...@@ -37,7 +37,12 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
@Override @Override
public List<TbCfUserInfoEntity> queryList(Map<String, Object> map) { public List<TbCfUserInfoEntity> queryList(Map<String, Object> map) {
return tbCfUserInfoDao.queryList(map); List<TbCfUserInfoEntity> users = tbCfUserInfoDao.queryList(map);
users.stream().forEach(user -> {
//查询下线人数
user.setNetwork(tbCfUserInfoDao.getUserNetworkCount(user.getUserId()));
});
return users;
} }
@Override @Override
...@@ -210,6 +215,11 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService { ...@@ -210,6 +215,11 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
} }
@Override
public List<TbCfUserInfoEntity> getUserNetwork(String userId) {
return tbCfUserInfoDao.getUserNetwork(userId);
}
/** /**
* 编码文件名 * 编码文件名
*/ */
......
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
c.user_id c.user_id
WHERE 1=1 and `real` is null WHERE 1=1 and `real` is null
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND account LIKE concat('%',#{name},'%')
</if> </if>
<choose> <choose>
<when test="sidx != null and sidx.trim() != ''"> <when test="sidx != null and sidx.trim() != ''">
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
select count(*) from tb_cf_user_info select count(*) from tb_cf_user_info
WHERE 1=1 and `real` is null WHERE 1=1 and `real` is null
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%') AND account LIKE concat('%',#{name},'%')
</if> </if>
</select> </select>
...@@ -337,4 +337,13 @@ ...@@ -337,4 +337,13 @@
<select id="selectRandomUser" resultType="string"> <select id="selectRandomUser" resultType="string">
SELECT user_id FROM `tb_cf_user_info` WHERE `real` = 0 ORDER BY RAND() LIMIT 1; SELECT user_id FROM `tb_cf_user_info` WHERE `real` = 0 ORDER BY RAND() LIMIT 1;
</select> </select>
<!--查看用户的下线-->
<select id="getUserNetwork" resultType="com.platform.entity.TbCfUserInfoEntity">
SELECT user_id,account,avatar,nick,country,email,phone from tb_cf_user_info u inner join (select network_info_user_id from network where user_info_user_id=#{userId}) temp on u.user_id=temp.network_info_user_id
</select>
<select id="getUserNetworkCount" resultType="int">
select count(1) from network where user_info_user_id=#{userId}
</select>
</mapper> </mapper>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#jdbc.password=diaoyun666 #jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root jdbc.username: root
jdbc.password: Diaoyunnuli.8 jdbc.password: Diaoyunnuli.8
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#jdbc.password=diaoyun666 #jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root jdbc.username: root
jdbc.password: Diaoyunnuli.8 jdbc.password: Diaoyunnuli.8
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
<title>用户表</title> <title>用户表</title>
#parse("sys/header.html") #parse("sys/header.html")
<style> <style>
.ui-jqgrid .ui-jqgrid-bdiv{ .ui-jqgrid .ui-jqgrid-bdiv {
height:auto!important; height: auto !important;
} }
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
border-top: 2px solid #e7eaec; border-top: 2px solid #e7eaec;
line-height: 1.38857; line-height: 1.38857;
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
</head> </head>
<body> <body>
<div id="rrapp" v-cloak style="width: 3050px;height: calc(100% - 15px);"> <div id="rrapp" v-cloak style="width: 3050px;height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;"> <div v-show="showList" style="height: 100%;">
<Row :gutter="16"> <Row :gutter="16">
<div class="search-group"> <div class="search-group">
<i-col span="4"> <i-col span="4">
...@@ -39,12 +40,12 @@ ...@@ -39,12 +40,12 @@
</div> </div>
</Row> </Row>
<div id="speedp"></div> <div id="speedp"></div>
<table id="jqGrid"></table> <table id="jqGrid"></table>
</div> </div>
<Card v-show="!showList"> <Card v-show="!showList">
<p slot="title">{{title}}</p> <p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfUserInfo" :rules="ruleValidate" :label-width="80"> <i-form ref="formValidate" :model="tbCfUserInfo" :rules="ruleValidate" :label-width="80">
<Form-item label="用户编号" prop="userNo"> <Form-item label="用户编号" prop="userNo">
<i-input v-model="tbCfUserInfo.userNo" placeholder="用户编号"/> <i-input v-model="tbCfUserInfo.userNo" placeholder="用户编号"/>
</Form-item> </Form-item>
...@@ -66,9 +67,9 @@ ...@@ -66,9 +67,9 @@
<Form-item label="是否绑定手机" prop="phoneFlag"> <Form-item label="是否绑定手机" prop="phoneFlag">
<i-input v-model="tbCfUserInfo.phoneFlag" placeholder="是否绑定手机"/> <i-input v-model="tbCfUserInfo.phoneFlag" placeholder="是否绑定手机"/>
</Form-item> </Form-item>
<!-- <Form-item label="密码" prop="password"> <!-- <Form-item label="密码" prop="password">
<i-input v-model="tbCfUserInfo.password" placeholder="密码"/> <i-input v-model="tbCfUserInfo.password" placeholder="密码"/>
</Form-item>--> </Form-item>-->
<Form-item label="上一次登录时间" prop="lastLoginTime"> <Form-item label="上一次登录时间" prop="lastLoginTime">
<i-input v-model="tbCfUserInfo.lastLoginTime" placeholder="上一次登录时间"/> <i-input v-model="tbCfUserInfo.lastLoginTime" placeholder="上一次登录时间"/>
</Form-item> </Form-item>
...@@ -107,13 +108,14 @@ ...@@ -107,13 +108,14 @@
</Form-item> </Form-item>
<Form-item> <Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button> <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button> <i-button type="warning" @click="reload" style="margin-left: 8px"/>
返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button> <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item> </Form-item>
</i-form> </i-form>
</Card> </Card>
</div> </div>
<script src="${rc.contextPath}/js/sys/tbcfuserinfo.js?_${date.systemTime}"></script> <script src="${rc.contextPath}/js/sys/tbcfuserinfo.js?_${date.systemTime}"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -10,6 +10,7 @@ $(function () { ...@@ -10,6 +10,7 @@ $(function () {
{label: '注册来源', name: 'source', index: 'source', width: 60, formatter: signTypeFormat}, {label: '注册来源', name: 'source', index: 'source', width: 60, formatter: signTypeFormat},
{label: '用户头像地址', name: 'avatar', index: 'avatar', width: 100, formatter: imageFormat}, {label: '用户头像地址', name: 'avatar', index: 'avatar', width: 100, formatter: imageFormat},
{label: '用户名', name: 'nick', index: 'nick', width: 80}, {label: '用户名', name: 'nick', index: 'nick', width: 80},
{label: '下线人数', name: 'network', index: 'network', width: 80},
{label: '下单次数', name: 'count', index: 'count', width: 80}, {label: '下单次数', name: 'count', index: 'count', width: 80},
{label: '总金额', name: 'total', index: 'total', width: 80, formatter: moneyFormat}, {label: '总金额', name: 'total', index: 'total', width: 80, formatter: moneyFormat},
{label: '使用优惠券次数', name: 'num', index: 'num', width: 80}, {label: '使用优惠券次数', name: 'num', index: 'num', width: 80},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论