init
This commit is contained in:
@@ -11,6 +11,9 @@ public class HomeUserVo {
|
||||
|
||||
@Schema(description = "是否可以查看头像,当不可以查看的时候头像和图片是空")
|
||||
private Boolean showAvatarBool = true;
|
||||
|
||||
@Schema(description = "最近登录时间")
|
||||
private String lastLoginTime;
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
@Schema(description = "用户编号")
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ruoyi.xq.enums.image;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum ImagesEnums {
|
||||
VIP_LOG("xq/images/logs/"),
|
||||
CONSUMER_LOG("xq/images/logs/"),
|
||||
SYSTEM_LOG("xq/images/logs/"),
|
||||
LOGO_LOG("xq/images/logs/"),
|
||||
;
|
||||
|
||||
private final String path;
|
||||
|
||||
ImagesEnums(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -125,6 +125,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
||||
if(userId.equals(currentUserId)){
|
||||
return result;
|
||||
}
|
||||
User currentUser = this.getById(currentUserId);
|
||||
// TODO 登录时间
|
||||
boolean star = userStarService.existsStar(currentUserId, userId);
|
||||
result.setStar(star);
|
||||
UserStatus userStatus = userStatusService.getByUserId(userId);
|
||||
|
||||
@@ -14,6 +14,9 @@ import com.ruoyi.xq.dto.app.account.WxTransLogListVo;
|
||||
import com.ruoyi.xq.dto.app.account.WxTransLogQuery;
|
||||
import com.ruoyi.xq.dto.common.user.MinUser;
|
||||
import com.ruoyi.xq.enums.account.WxTransLogCateEnum;
|
||||
import com.ruoyi.xq.enums.common.SystemConfigEnum;
|
||||
import com.ruoyi.xq.enums.image.ImagesEnums;
|
||||
import com.ruoyi.xq.manager.SystemConfigManager;
|
||||
import com.ruoyi.xq.mapper.WxTransLogMapper;
|
||||
import com.ruoyi.xq.service.UserService;
|
||||
import com.ruoyi.xq.service.WxTransLogService;
|
||||
@@ -38,6 +41,8 @@ import java.util.stream.Collectors;
|
||||
public class WxTransLogServiceImpl extends ServiceImpl<WxTransLogMapper,WxTransLog> implements WxTransLogService {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private SystemConfigManager systemConfigManager;
|
||||
|
||||
@Override
|
||||
public Page<WxTransLogListVo> pageApp(PageQuery pageQuery, WxTransLogQuery query) {
|
||||
@@ -46,6 +51,7 @@ public class WxTransLogServiceImpl extends ServiceImpl<WxTransLogMapper,WxTransL
|
||||
if(CollectionUtils.isEmpty(records)){
|
||||
return PageConvert.convertEmpty(page);
|
||||
}
|
||||
String cosDomain = systemConfigManager.getSystemConfig(SystemConfigEnum.COS_DOMAIN);
|
||||
List<Long> userIdList = records.stream().map(WxTransLog::getTarUserId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
List<User> users = userService.listByIds(userIdList);
|
||||
Map<Long, User> userMap = users.stream().collect(Collectors.toMap(User::getId, Function.identity()));
|
||||
@@ -59,11 +65,22 @@ public class WxTransLogServiceImpl extends ServiceImpl<WxTransLogMapper,WxTransL
|
||||
res.setContent(record.getRemark());
|
||||
res.setCreateTime(record.getCreateTime());
|
||||
res.setChangeValue(record.getChangeValue());
|
||||
User user = userMap.get(record.getTarUserId());
|
||||
if(user != null){
|
||||
res.setSourceUserId(user.getId());
|
||||
res.setSourceNickname(user.getNickname());
|
||||
res.setSourceImg(user.getAvatar());
|
||||
if(WxTransLogCateEnum.CONSUMER.getCode().equals(record.getCateId())){
|
||||
User user = userMap.get(record.getTarUserId());
|
||||
if(user != null){
|
||||
res.setSourceUserId(user.getId());
|
||||
res.setSourceNickname(user.getNickname());
|
||||
res.setSourceImg(user.getAvatar());
|
||||
}
|
||||
}else if(WxTransLogCateEnum.VIP_GIVE.getCode().equals(record.getCateId())){
|
||||
res.setSourceImg(cosDomain + ImagesEnums.VIP_LOG.getPath());
|
||||
}else if(WxTransLogCateEnum.ORDER.getCode().equals(record.getCateId())){
|
||||
res.setSourceImg(cosDomain + ImagesEnums.CONSUMER_LOG.getPath());
|
||||
}else if(WxTransLogCateEnum.SYSTEM.getCode().equals(record.getCateId())){
|
||||
res.setSourceImg(cosDomain + ImagesEnums.SYSTEM_LOG.getPath());
|
||||
}
|
||||
if(res.getSourceImg() == null){
|
||||
res.setSourceImg(cosDomain + ImagesEnums.LOGO_LOG.getPath());
|
||||
}
|
||||
vo.add(res);
|
||||
}
|
||||
|
||||
@@ -95,8 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
t1.education, t1.profession, if(t2.card_num_auth = 1, 1, 0) as cardNumAuthBool
|
||||
from xq_user t1
|
||||
join xq_user_auth t2 on t1.id = t2.user_id
|
||||
where t1.type = 0 and t1.status = 0 and t1.finish_base_status = 1
|
||||
and exists(select 1 from xq_user_vip p1 where p1.user_id = t1.id and p1.vip_status = 1 and p1.vip_timeout <= now())
|
||||
join xq_user_status t3 on t1.id = t3.user_id
|
||||
join xq_user_login t4 on t1.id = t4.user_id
|
||||
where t1.type = 0 and t1.status = 0 and t1.finish_base_status = 1 and t1.open_vip = 1 and t3.push_vip = 1
|
||||
order by t4.last_login_time desc
|
||||
</select>
|
||||
<select id="getMinUserById" resultType="com.ruoyi.xq.dto.common.user.MinUser">
|
||||
select t1.id,t1.usercode
|
||||
|
||||
Reference in New Issue
Block a user