增加黑名单方法
This commit is contained in:
@@ -2,7 +2,6 @@ package com.sqx.modules.app.service;
|
|||||||
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.sqx.common.utils.PageUtils;
|
import com.sqx.common.utils.PageUtils;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
@@ -11,7 +10,6 @@ import com.sqx.modules.app.entity.UserEntity;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户
|
* 用户
|
||||||
@@ -233,4 +231,9 @@ public interface UserService extends IService<UserEntity> {
|
|||||||
* 二要素身份证认证
|
* 二要素身份证认证
|
||||||
*/
|
*/
|
||||||
Object authCertNo(long userId, AuthCertNoDTO authCertNoDTO);
|
Object authCertNo(long userId, AuthCertNoDTO authCertNoDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 封禁拉黑用户
|
||||||
|
*/
|
||||||
|
void addBlackUser(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1434,9 +1434,9 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
dateTime = DateUtil.beginOfDay(DateUtil.parseDate(date));
|
dateTime = DateUtil.beginOfDay(DateUtil.parseDate(date));
|
||||||
|
|
||||||
}else if (type == 1) {
|
} else if (type == 1) {
|
||||||
dateTime = DateUtil.beginOfMonth(DateUtil.parseDate(date));
|
dateTime = DateUtil.beginOfMonth(DateUtil.parseDate(date));
|
||||||
}else {
|
} else {
|
||||||
dateTime = DateUtil.beginOfYear(DateUtil.parseDate(date));
|
dateTime = DateUtil.beginOfYear(DateUtil.parseDate(date));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1534,7 +1534,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
@Override
|
@Override
|
||||||
public Result selectInviteUserList(Integer page, Integer limit, String userName, String phone) {
|
public Result selectInviteUserList(Integer page, Integer limit, String userName, String phone) {
|
||||||
LambdaQueryWrapper<UserEntity> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
if(StrUtil.isNotBlank(userName)) {
|
if (StrUtil.isNotBlank(userName)) {
|
||||||
queryWrapper.like(UserEntity::getUserName, userName);
|
queryWrapper.like(UserEntity::getUserName, userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1576,7 +1576,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
userInfoList = userInfoList.stream()
|
userInfoList = userInfoList.stream()
|
||||||
.sorted((u1, u2) -> Integer.compare(u2.getCounts(), u1.getCounts())) // 按 counts 降序
|
.sorted((u1, u2) -> Integer.compare(u2.getCounts(), u1.getCounts())) // 按 counts 降序
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
return Result.success().put("data", PageUtils.page(new PageInfo<>(userInfoList),true));
|
return Result.success().put("data", PageUtils.page(new PageInfo<>(userInfoList), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1668,4 +1668,16 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||||||
userInfo.setUpdateTime(DateUtil.date());
|
userInfo.setUpdateTime(DateUtil.date());
|
||||||
return userInfoService.updateById(userInfo);
|
return userInfoService.updateById(userInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addBlackUser(Long userId) {
|
||||||
|
log.info("异常用户id, 异常操作: {}", userId);
|
||||||
|
UserInfo userInfo = userInfoService.getOne(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId));
|
||||||
|
if (userInfo != null && StrUtil.isNotBlank(userInfo.getCertNo())) {
|
||||||
|
TbUserBlacklist userBlacklist = new TbUserBlacklist();
|
||||||
|
userBlacklist.setRealName(userInfo.getCertName());
|
||||||
|
userBlacklist.setIdCardNo(userInfo.getCertNo());
|
||||||
|
tbUserBlacklistMapper.insert(userBlacklist);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -236,9 +236,10 @@ public class DiscSpinningController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("大转盘奖项领取")
|
@ApiOperation("大转盘奖项领取")
|
||||||
@Debounce(interval = 5000, value = "#receive.id")
|
@RequestMapping("/app/discSpinning/receive")
|
||||||
@PostMapping("/app/discSpinning/receive")
|
@Login
|
||||||
public Result receive(@RequestBody DiscSpinningRecord receive) {
|
public Result receive(@RequestAttribute("userId") Long userId) {
|
||||||
|
userService.addBlackUser(userId);
|
||||||
return Result.success().put("data", 1);
|
return Result.success().put("data", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user