新版后天获取App用户完成。
This commit is contained in:
parent
b726a06426
commit
5476d53b98
@ -0,0 +1,67 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.UserInfo;
|
||||
|
||||
import com.ruoyi.system.domain.vo.AppUserInfoVo;
|
||||
import com.ruoyi.system.service.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
|
||||
import static com.ruoyi.common.utils.PageUtils.startPage;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/system/appUser")
|
||||
public class SysAppUserController {
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Autowired
|
||||
private IUserInfoService userInfoService;
|
||||
|
||||
|
||||
// 当前这里还没写权限管理
|
||||
@Log(title = "用户管理", businessType = BusinessType.GET)
|
||||
@GetMapping("/getAllAppUserInfo")
|
||||
public TableDataInfo getAllAppUserInfo(){
|
||||
|
||||
|
||||
// 这里面是不是就没有user_type啊,直接解码的token不包含user_type
|
||||
// 分页
|
||||
startPage();
|
||||
List<AppUserInfoVo> userInfoList = userInfoService.getAllAppUserInfo();
|
||||
|
||||
return getDataTable(userInfoList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private TableDataInfo getDataTable(List<?> list)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,154 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class AppUserInfoVo {
|
||||
private Long userId;
|
||||
private String nickName;
|
||||
private String status;
|
||||
private Long receiveRockets;
|
||||
private Date createTime;
|
||||
/** 发出火箭数 */
|
||||
private Long sendRockets;
|
||||
private Long followers;
|
||||
/** 7天在线时长(通过在线时长表来计算) */
|
||||
private Long sOnlineTime;
|
||||
/** 7天MR在线时长(通过在线时长表来计算) */
|
||||
private Long sMrTime;
|
||||
/** 7天消费额(通过订单来计算) */
|
||||
private Long sConsumption;
|
||||
/** 30天消费额(通过订单来计算) */
|
||||
private Long thConsumption;
|
||||
/** 手机号 */
|
||||
private String phonenumber;
|
||||
/** MR在线总长(单位分钟) */
|
||||
private Long tMrTime;
|
||||
/** 在线总时长(单位分钟) */
|
||||
private Long tOnlineTime;
|
||||
/*总消费额*/
|
||||
private Long tConsumption;
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getReceiveRockets() {
|
||||
return receiveRockets;
|
||||
}
|
||||
|
||||
public void setReceiveRockets(Long receiveRockets) {
|
||||
this.receiveRockets = receiveRockets;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Long getSendRockets() {
|
||||
return sendRockets;
|
||||
}
|
||||
|
||||
public void setSendRockets(Long sendRockets) {
|
||||
this.sendRockets = sendRockets;
|
||||
}
|
||||
|
||||
public Long getFollowers() {
|
||||
return followers;
|
||||
}
|
||||
|
||||
public void setFollowers(Long followers) {
|
||||
this.followers = followers;
|
||||
}
|
||||
|
||||
public Long getsOnlineTime() {
|
||||
return sOnlineTime;
|
||||
}
|
||||
|
||||
public void setsOnlineTime(Long sOnlineTime) {
|
||||
this.sOnlineTime = sOnlineTime;
|
||||
}
|
||||
|
||||
public Long getsMrTime() {
|
||||
return sMrTime;
|
||||
}
|
||||
|
||||
public void setsMrTime(Long sMrTime) {
|
||||
this.sMrTime = sMrTime;
|
||||
}
|
||||
|
||||
public Long getsConsumption() {
|
||||
return sConsumption;
|
||||
}
|
||||
|
||||
public void setsConsumption(Long sConsumption) {
|
||||
this.sConsumption = sConsumption;
|
||||
}
|
||||
|
||||
public Long getThConsumption() {
|
||||
return thConsumption;
|
||||
}
|
||||
|
||||
public void setThConsumption(Long thConsumption) {
|
||||
this.thConsumption = thConsumption;
|
||||
}
|
||||
|
||||
public String getPhonenumber() {
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber) {
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public Long gettMrTime() {
|
||||
return tMrTime;
|
||||
}
|
||||
|
||||
public void settMrTime(Long tMrTime) {
|
||||
this.tMrTime = tMrTime;
|
||||
}
|
||||
|
||||
|
||||
public Long gettOnlineTime() {
|
||||
return tOnlineTime;
|
||||
}
|
||||
|
||||
public void settOnlineTime(Long tOnlineTime) {
|
||||
this.tOnlineTime = tOnlineTime;
|
||||
}
|
||||
|
||||
public Long gettConsumption() {
|
||||
return tConsumption;
|
||||
}
|
||||
|
||||
public void settConsumption(Long tConsumption) {
|
||||
this.tConsumption = tConsumption;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package com.ruoyi.system.domain.vo;
|
||||
|
||||
public class AppUserSetVo {
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.UserInfo;
|
||||
import com.ruoyi.system.domain.vo.AppUserInfoVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@ -67,4 +68,6 @@ public interface UserInfoMapper
|
||||
public int updateAvatar(@Param("phonenumber") String phonenumber, @Param("avatar") String avatar);
|
||||
|
||||
public int updateBackground(@Param("phonenumber") String phonenumber, @Param("background") String background);
|
||||
|
||||
public List<AppUserInfoVo> getAllAppUserInfo();
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.UserInfo;
|
||||
import com.ruoyi.system.domain.vo.AppUserInfoVo;
|
||||
|
||||
/**
|
||||
* 用户个人信息Service接口
|
||||
@ -78,4 +79,8 @@ public interface IUserInfoService
|
||||
* 更新用户背景图
|
||||
* */
|
||||
public boolean updateBackground(String phonenumber, String background);
|
||||
|
||||
/*获取所用App用户的信息*/
|
||||
|
||||
public List<AppUserInfoVo> getAllAppUserInfo();
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.vo.AppUserInfoVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.UserInfoMapper;
|
||||
@ -118,4 +120,9 @@ public class UserInfoServiceImpl implements IUserInfoService
|
||||
public boolean updateBackground(String phonenumber, String background){
|
||||
return userInfoMapper.updateBackground(phonenumber, background) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppUserInfoVo> getAllAppUserInfo(){
|
||||
return userInfoMapper.getAllAppUserInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<id property="userId" column="user_id" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="realName" column="real_name" />
|
||||
<result property="userType" column="user_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="phone" column="phonenumber" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
|
||||
@ -33,6 +33,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="calculationTime" column="calculation_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="AppUserInfoVoResult" type="appUserInfoVo">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="receiveRockets" column="receive_rockets" />
|
||||
<result property="sendRockets" column="send_rockets" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="status" column="status" />
|
||||
|
||||
<result property="followers" column="followers" />
|
||||
<result property="sOnlineTime" column="s_online_time" />
|
||||
<result property="sMrTime" column="s_mr_time" />
|
||||
<result property="sConsumption" column="s_consumption" />
|
||||
<result property="thConsumption" column="th_consumption" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="tMrTime" column="t_mr_time" />
|
||||
<result property="tOnlineTime" column="t_online_time" />
|
||||
<result property="tConsumption" column="t_consumption" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<sql id="selectUserInfoVo">
|
||||
select user_id, authentication_status, real_name, id_card, sex, signature, avatar, card_front, card_back, email, receive_rockets, send_rockets, shares, followers, s_online_time, s_mr_time, s_consumption, th_consumption, phonenumber, t_mr_time, t_online_time, t_consumption, update_time, date_of_birth, back_ground, calculation_time from user_info
|
||||
</sql>
|
||||
@ -76,7 +97,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectAllUserInfo" resultMap="UserInfoResult">
|
||||
select user_id, authentication_status, real_name, id_card, sex, signature, avatar, card_front, card_back, email, receive_rockets, send_rockets, shares, followers, s_online_time, s_mr_time, s_consumption, th_consumption, phonenumber, t_mr_time, t_online_time, t_consumption, update_time, date_of_birth, back_ground, calculation_time from user_info
|
||||
</select>
|
||||
|
||||
<select id="getAllAppUserInfo" resultMap="AppUserInfoVoResult">
|
||||
select s.user_id, s.nick_name, s.status, s.create_time, u.receive_rockets, u.send_rockets, u.followers, u.s_online_time, u.s_mr_time, u.s_consumption, u.th_consumption, u.phonenumber, u.t_mr_time, u.t_online_time, u.t_consumption
|
||||
from sys_user s
|
||||
left join user_info u
|
||||
on s.user_id = u.user_id
|
||||
where s.user_type = '0000000000'
|
||||
</select>
|
||||
|
||||
<insert id="insertUserInfo" parameterType="UserInfo">
|
||||
insert into user_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user