refactor(resource): 调整消息通知
parent
afc35ca586
commit
2efdbfe773
|
@ -6,6 +6,8 @@ import com.mcwl.resource.domain.vo.AttentionAdviceVo;
|
||||||
import com.mcwl.resource.domain.vo.CommentAdviceVo;
|
import com.mcwl.resource.domain.vo.CommentAdviceVo;
|
||||||
import com.mcwl.resource.domain.vo.LikeAdviceVo;
|
import com.mcwl.resource.domain.vo.LikeAdviceVo;
|
||||||
import com.mcwl.resource.service.ISysAdviceService;
|
import com.mcwl.resource.service.ISysAdviceService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -22,41 +24,16 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("system/advice")
|
@RequestMapping("system/advice")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "消息通知")
|
||||||
public class SysAdviceController {
|
public class SysAdviceController {
|
||||||
|
|
||||||
private final ISysAdviceService sysAdviceService;
|
private final ISysAdviceService sysAdviceService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据当前用户获取新消息通知
|
|
||||||
*/
|
|
||||||
@GetMapping("getUserNewMsg")
|
|
||||||
public R<List<AdviceVo>> getUserNewMsg() {
|
|
||||||
List<AdviceVo> adviceVo = sysAdviceService.getUserNewMsg();
|
|
||||||
return R.ok(adviceVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据当前用户获取系统公告
|
|
||||||
*/
|
|
||||||
@GetMapping("getUserSystemNotice")
|
|
||||||
public R<List<AdviceVo>> getUserSystemNotice() {
|
|
||||||
List<AdviceVo> adviceVo = sysAdviceService.getUserSystemNotice();
|
|
||||||
return R.ok(adviceVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据当前用户获取所有通知
|
|
||||||
*/
|
|
||||||
@GetMapping("getUserAllMsg")
|
|
||||||
public R<List<AdviceVo>> getUserAllMsg() {
|
|
||||||
List<AdviceVo> adviceVo = sysAdviceService.getUserAllMsg();
|
|
||||||
return R.ok(adviceVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有通知
|
* 获取所有通知
|
||||||
*/
|
*/
|
||||||
@GetMapping("getAllMsg")
|
@GetMapping("getAllMsg")
|
||||||
|
@ApiOperation(value = "获取所有通知")
|
||||||
public R<List<AdviceVo>> getAllMsg() {
|
public R<List<AdviceVo>> getAllMsg() {
|
||||||
List<AdviceVo> adviceVo = sysAdviceService.getAllMsg();
|
List<AdviceVo> adviceVo = sysAdviceService.getAllMsg();
|
||||||
return R.ok(adviceVo);
|
return R.ok(adviceVo);
|
||||||
|
@ -67,6 +44,7 @@ public class SysAdviceController {
|
||||||
* 获取评论通知
|
* 获取评论通知
|
||||||
*/
|
*/
|
||||||
@GetMapping("getCommentMsg")
|
@GetMapping("getCommentMsg")
|
||||||
|
@ApiOperation(value = "获取评论通知")
|
||||||
public R<List<CommentAdviceVo>> getCommentMsg(@Valid
|
public R<List<CommentAdviceVo>> getCommentMsg(@Valid
|
||||||
@NotNull(message = "类型不能为空")
|
@NotNull(message = "类型不能为空")
|
||||||
@ApiParam(value = "类型 0模型 1工作流 2图片 3全部", required = true)
|
@ApiParam(value = "类型 0模型 1工作流 2图片 3全部", required = true)
|
||||||
|
@ -79,6 +57,7 @@ public class SysAdviceController {
|
||||||
* 获取点赞通知
|
* 获取点赞通知
|
||||||
*/
|
*/
|
||||||
@GetMapping("getLikeMsg")
|
@GetMapping("getLikeMsg")
|
||||||
|
@ApiOperation(value = "获取点赞通知")
|
||||||
public R<List<LikeAdviceVo>> getLikeMsg(@Valid
|
public R<List<LikeAdviceVo>> getLikeMsg(@Valid
|
||||||
@NotNull(message = "类型不能为空")
|
@NotNull(message = "类型不能为空")
|
||||||
@ApiParam(value = "类型 0模型 1工作流 2图片 3评论 4全部", required = true)
|
@ApiParam(value = "类型 0模型 1工作流 2图片 3评论 4全部", required = true)
|
||||||
|
@ -92,6 +71,7 @@ public class SysAdviceController {
|
||||||
* 获取关注通知
|
* 获取关注通知
|
||||||
*/
|
*/
|
||||||
@GetMapping("getAttentionMsg")
|
@GetMapping("getAttentionMsg")
|
||||||
|
@ApiOperation(value = "获取关注通知")
|
||||||
public R<List<AttentionAdviceVo>> getAttentionMsg() {
|
public R<List<AttentionAdviceVo>> getAttentionMsg() {
|
||||||
List<AttentionAdviceVo> attentionAdviceVoList = sysAdviceService.getAttentionMsg();
|
List<AttentionAdviceVo> attentionAdviceVoList = sysAdviceService.getAttentionMsg();
|
||||||
return R.ok(attentionAdviceVoList);
|
return R.ok(attentionAdviceVoList);
|
||||||
|
|
|
@ -1,29 +1,46 @@
|
||||||
package com.mcwl.resource.domain.vo;
|
package com.mcwl.resource.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.mcwl.system.domain.enums.AdviceEnum;
|
import com.mcwl.system.domain.enums.AdviceEnum;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ApiModel(description = "消息通知")
|
||||||
public class AdviceVo {
|
public class AdviceVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息类型 表示新消息提醒,系统公告等
|
* id
|
||||||
*/
|
*/
|
||||||
private AdviceEnum type;
|
@ApiModelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标题
|
* 标题
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "标题")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内容
|
* 内容
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否已读 0否 1是
|
* 是否已读 0否 1是
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "是否已读 0否 1是")
|
||||||
private String isRead;
|
private String isRead;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.mcwl.resource.domain.vo;
|
package com.mcwl.resource.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -37,6 +38,7 @@ public class AttentionAdviceVo {
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.mcwl.resource.domain.vo;
|
package com.mcwl.resource.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -56,6 +57,7 @@ public class CommentAdviceVo {
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface ISysAdviceService extends IService<SysAdvice> {
|
public interface ISysAdviceService extends IService<SysAdvice> {
|
||||||
|
|
||||||
List<AdviceVo> getUserNewMsg();
|
|
||||||
|
|
||||||
List<AdviceVo> getUserSystemNotice();
|
|
||||||
|
|
||||||
List<AdviceVo> getUserAllMsg();
|
|
||||||
|
|
||||||
List<AdviceVo> getAllMsg();
|
List<AdviceVo> getAllMsg();
|
||||||
|
|
||||||
List<CommentAdviceVo> getCommentMsg(Integer productType);
|
List<CommentAdviceVo> getCommentMsg(Integer productType);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.mcwl.resource.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.mcwl.common.core.domain.entity.SysUser;
|
import com.mcwl.common.core.domain.entity.SysUser;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
|
@ -46,44 +47,24 @@ public class SysAdviceServiceImpl extends ServiceImpl<SysAdviceMapper, SysAdvice
|
||||||
private final Map<Long, WorkFlow> workFlowMap = new ConcurrentHashMap<>();
|
private final Map<Long, WorkFlow> workFlowMap = new ConcurrentHashMap<>();
|
||||||
private final Map<Long, ModelImage> modelImageMap = new ConcurrentHashMap<>();
|
private final Map<Long, ModelImage> modelImageMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<AdviceVo> getUserNewMsg() {
|
|
||||||
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
|
||||||
|
|
||||||
List<SysAdvice> sysAdvices = baseMapper.selectList(lambdaQuery()
|
|
||||||
.eq(SysAdvice::getReceiverId, userId)
|
|
||||||
.eq(SysAdvice::getType, AdviceEnum.NEW_MESSAGE_REMIND));
|
|
||||||
|
|
||||||
return BeanUtil.copyToList(sysAdvices, AdviceVo.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<AdviceVo> getUserSystemNotice() {
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
|
||||||
|
|
||||||
List<SysAdvice> sysAdvices = baseMapper.selectList(lambdaQuery()
|
|
||||||
.eq(SysAdvice::getReceiverId, userId)
|
|
||||||
.eq(SysAdvice::getType, AdviceEnum.SYSTEM_NOTICE));
|
|
||||||
|
|
||||||
return BeanUtil.copyToList(sysAdvices, AdviceVo.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<AdviceVo> getUserAllMsg() {
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
|
||||||
|
|
||||||
List<SysAdvice> sysAdvices = baseMapper.selectList(lambdaQuery()
|
|
||||||
.eq(SysAdvice::getReceiverId, userId));
|
|
||||||
|
|
||||||
return BeanUtil.copyToList(sysAdvices, AdviceVo.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdviceVo> getAllMsg() {
|
public List<AdviceVo> getAllMsg() {
|
||||||
|
|
||||||
List<SysAdvice> sysAdvices = baseMapper.selectList(null);
|
// 创建分页对象
|
||||||
|
Page<SysAdvice> page = new Page<>(1, 20);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<SysAdvice> lqw = new LambdaQueryWrapper<SysAdvice>()
|
||||||
|
.and(wrapper -> wrapper
|
||||||
|
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId())
|
||||||
|
.or()
|
||||||
|
.isNull(SysAdvice::getReceiverId)
|
||||||
|
)
|
||||||
|
.orderByDesc(SysAdvice::getCreateTime);
|
||||||
|
|
||||||
|
Page<SysAdvice> sysAdvicePage = baseMapper.selectPage(page, lqw);
|
||||||
|
|
||||||
|
|
||||||
|
List<SysAdvice> sysAdvices = sysAdvicePage.getRecords();
|
||||||
|
|
||||||
return BeanUtil.copyToList(sysAdvices, AdviceVo.class);
|
return BeanUtil.copyToList(sysAdvices, AdviceVo.class);
|
||||||
}
|
}
|
||||||
|
@ -96,14 +77,15 @@ public class SysAdviceServiceImpl extends ServiceImpl<SysAdviceMapper, SysAdvice
|
||||||
List<SysAdvice> sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
|
List<SysAdvice> sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
|
||||||
.eq(SysAdvice::getType, AdviceEnum.COMMENT_REMIND)
|
.eq(SysAdvice::getType, AdviceEnum.COMMENT_REMIND)
|
||||||
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId())
|
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId())
|
||||||
.eq(productType != 3, SysAdvice::getProductType, productType));
|
.eq(productType != 3, SysAdvice::getProductType, productType)
|
||||||
|
.orderByDesc(SysAdvice::getCreateTime));
|
||||||
|
|
||||||
|
|
||||||
List<Long> commentUserIdList = new ArrayList<>();
|
List<Long> commentUserIdList = new ArrayList<>();
|
||||||
for (SysAdvice sysAdvice : sysAdviceList) {
|
for (SysAdvice sysAdvice : sysAdviceList) {
|
||||||
commentUserIdList.add(sysAdvice.getSenderId());
|
commentUserIdList.add(sysAdvice.getSenderId());
|
||||||
}
|
}
|
||||||
List<SysUser> sysUsers = sysUserService.selectUserByIds(commentUserIdList);
|
List<SysUser> sysUsers = sysUserService.listByIds(commentUserIdList);
|
||||||
|
|
||||||
Map<Long, SysUser> commentUserMap = new HashMap<>();
|
Map<Long, SysUser> commentUserMap = new HashMap<>();
|
||||||
for (SysUser sysUser : sysUsers) {
|
for (SysUser sysUser : sysUsers) {
|
||||||
|
@ -116,7 +98,9 @@ public class SysAdviceServiceImpl extends ServiceImpl<SysAdviceMapper, SysAdvice
|
||||||
|
|
||||||
Long senderId = sysAdvice.getSenderId();
|
Long senderId = sysAdvice.getSenderId();
|
||||||
SysUser senderUser = commentUserMap.get(senderId);
|
SysUser senderUser = commentUserMap.get(senderId);
|
||||||
|
if (Objects.nonNull(senderUser)) {
|
||||||
commentAdviceVo.setUserAvatar(senderUser.getAvatar());
|
commentAdviceVo.setUserAvatar(senderUser.getAvatar());
|
||||||
|
}
|
||||||
if (productType == 0) {
|
if (productType == 0) {
|
||||||
ModelProduct modelProduct = modelProductMap.get(sysAdvice.getProductId());
|
ModelProduct modelProduct = modelProductMap.get(sysAdvice.getProductId());
|
||||||
if (Objects.nonNull(modelProduct)) {
|
if (Objects.nonNull(modelProduct)) {
|
||||||
|
@ -148,19 +132,21 @@ public class SysAdviceServiceImpl extends ServiceImpl<SysAdviceMapper, SysAdvice
|
||||||
sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
|
sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
|
||||||
.eq(SysAdvice::getType, AdviceEnum.LIKE_REMIND)
|
.eq(SysAdvice::getType, AdviceEnum.LIKE_REMIND)
|
||||||
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId())
|
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId())
|
||||||
.isNotNull(SysAdvice::getCommentId));
|
.isNotNull(SysAdvice::getCommentId)
|
||||||
|
.orderByDesc(SysAdvice::getCreateTime));
|
||||||
} else {
|
} else {
|
||||||
sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
|
sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
|
||||||
.eq(SysAdvice::getType, AdviceEnum.LIKE_REMIND)
|
.eq(SysAdvice::getType, AdviceEnum.LIKE_REMIND)
|
||||||
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId())
|
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId())
|
||||||
.eq(productType != 4, SysAdvice::getProductType, productType));
|
.eq(productType != 4, SysAdvice::getProductType, productType)
|
||||||
|
.orderByDesc(SysAdvice::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Long> likeUserIdList = new ArrayList<>();
|
List<Long> likeUserIdList = new ArrayList<>();
|
||||||
for (SysAdvice sysAdvice : sysAdviceList) {
|
for (SysAdvice sysAdvice : sysAdviceList) {
|
||||||
likeUserIdList.add(sysAdvice.getSenderId());
|
likeUserIdList.add(sysAdvice.getSenderId());
|
||||||
}
|
}
|
||||||
List<SysUser> sysUsers = sysUserService.selectUserByIds(likeUserIdList);
|
List<SysUser> sysUsers = sysUserService.listByIds(likeUserIdList);
|
||||||
|
|
||||||
Map<Long, SysUser> likeUserMap = new HashMap<>();
|
Map<Long, SysUser> likeUserMap = new HashMap<>();
|
||||||
for (SysUser sysUser : sysUsers) {
|
for (SysUser sysUser : sysUsers) {
|
||||||
|
@ -174,7 +160,9 @@ public class SysAdviceServiceImpl extends ServiceImpl<SysAdviceMapper, SysAdvice
|
||||||
|
|
||||||
Long senderId = sysAdvice.getSenderId();
|
Long senderId = sysAdvice.getSenderId();
|
||||||
SysUser senderUser = likeUserMap.get(senderId);
|
SysUser senderUser = likeUserMap.get(senderId);
|
||||||
|
if (Objects.nonNull(senderUser)) {
|
||||||
likeAdviceVo.setUserAvatar(senderUser.getAvatar());
|
likeAdviceVo.setUserAvatar(senderUser.getAvatar());
|
||||||
|
}
|
||||||
if (productType == 0) {
|
if (productType == 0) {
|
||||||
ModelProduct modelProduct = modelProductMap.get(sysAdvice.getProductId());
|
ModelProduct modelProduct = modelProductMap.get(sysAdvice.getProductId());
|
||||||
if (Objects.nonNull(modelProduct)) {
|
if (Objects.nonNull(modelProduct)) {
|
||||||
|
@ -202,7 +190,8 @@ public class SysAdviceServiceImpl extends ServiceImpl<SysAdviceMapper, SysAdvice
|
||||||
public List<AttentionAdviceVo> getAttentionMsg() {
|
public List<AttentionAdviceVo> getAttentionMsg() {
|
||||||
List<SysAdvice> sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
|
List<SysAdvice> sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
|
||||||
.eq(SysAdvice::getType, AdviceEnum.FANS_REMIND)
|
.eq(SysAdvice::getType, AdviceEnum.FANS_REMIND)
|
||||||
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId()));
|
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId())
|
||||||
|
.orderByDesc(SysAdvice::getCreateTime));
|
||||||
|
|
||||||
List<AttentionAdviceVo> attentionAdviceVoList = new ArrayList<>();
|
List<AttentionAdviceVo> attentionAdviceVoList = new ArrayList<>();
|
||||||
List<Long> atentUserIdList = new ArrayList<>();
|
List<Long> atentUserIdList = new ArrayList<>();
|
||||||
|
@ -225,7 +214,9 @@ public class SysAdviceServiceImpl extends ServiceImpl<SysAdviceMapper, SysAdvice
|
||||||
AttentionAdviceVo attentionAdviceVo = BeanUtil.copyProperties(sysAdvice, AttentionAdviceVo.class);
|
AttentionAdviceVo attentionAdviceVo = BeanUtil.copyProperties(sysAdvice, AttentionAdviceVo.class);
|
||||||
Long senderId = sysAdvice.getSenderId();
|
Long senderId = sysAdvice.getSenderId();
|
||||||
SysUser attentionUser = attentionUserMap.get(senderId);
|
SysUser attentionUser = attentionUserMap.get(senderId);
|
||||||
|
if (Objects.nonNull(attentionUser)) {
|
||||||
attentionAdviceVo.setUserAvatar(attentionUser.getAvatar());
|
attentionAdviceVo.setUserAvatar(attentionUser.getAvatar());
|
||||||
|
}
|
||||||
attentionAdviceVoList.add(attentionAdviceVo);
|
attentionAdviceVoList.add(attentionAdviceVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,8 +138,6 @@ public interface SysUserMapper
|
||||||
|
|
||||||
List<SysUser> listByIds(List<Long> userIdList);
|
List<SysUser> listByIds(List<Long> userIdList);
|
||||||
|
|
||||||
List<SysUser> selectUserByIds(@Param("userIds") List<Long> userIds);
|
|
||||||
|
|
||||||
List<SysUser> selectUserPage(@Param("userId") Long userId);
|
List<SysUser> selectUserPage(@Param("userId") Long userId);
|
||||||
|
|
||||||
List<SysUser> selectToUserPage(@Param("userId") Long userId);
|
List<SysUser> selectToUserPage(@Param("userId") Long userId);
|
||||||
|
|
|
@ -217,6 +217,4 @@ public interface ISysUserService
|
||||||
AjaxResult updateIdCard(SysUser sysUser);
|
AjaxResult updateIdCard(SysUser sysUser);
|
||||||
|
|
||||||
List<SysUser> listByIds(List<Long> userIdList);
|
List<SysUser> listByIds(List<Long> userIdList);
|
||||||
|
|
||||||
List<SysUser> selectUserByIds(List<Long> userIds);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -653,6 +653,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysUser> listByIds(List<Long> userIdList) {
|
public List<SysUser> listByIds(List<Long> userIdList) {
|
||||||
|
if (userIdList == null || userIdList.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
return userMapper.listByIds(userIdList);
|
return userMapper.listByIds(userIdList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,9 +678,4 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<SysUser> selectUserByIds(List<Long> userIds) {
|
|
||||||
return userMapper.selectUserByIds(userIds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,14 +167,6 @@
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUserByIds" resultType="com.mcwl.common.core.domain.entity.SysUser">
|
|
||||||
<include refid="selectUserVo"/>
|
|
||||||
where u.user_id in
|
|
||||||
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
|
|
||||||
#{userId}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectUserPage" resultType="com.mcwl.common.core.domain.entity.SysUser">
|
<select id="selectUserPage" resultType="com.mcwl.common.core.domain.entity.SysUser">
|
||||||
select u.user_id,nick_name,avatar FROM sys_user_attention as a
|
select u.user_id,nick_name,avatar FROM sys_user_attention as a
|
||||||
LEFT JOIN sys_user as u
|
LEFT JOIN sys_user as u
|
||||||
|
|
Loading…
Reference in New Issue