nnnn
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
package com.ruoyi.cai.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户账户对象 cai_account
|
||||
*
|
||||
* @author 77
|
||||
* @date 2023-12-23
|
||||
*/
|
||||
@Data
|
||||
@TableName("cai_account_delete")
|
||||
public class AccountDelete implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 子账户ID
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
private String usercode;
|
||||
/**
|
||||
* 当前彩币数量
|
||||
*/
|
||||
private Long coin;
|
||||
/**
|
||||
* 收益的彩币数量
|
||||
*/
|
||||
private Long incomeCoin;
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
private Long points;
|
||||
/**
|
||||
* 充值总额
|
||||
*/
|
||||
private BigDecimal totalBuyMoney;
|
||||
/**
|
||||
* 充值彩贝总额
|
||||
*/
|
||||
private Long totalBuyCoin;
|
||||
/**
|
||||
* 第四方充值总额
|
||||
*/
|
||||
private BigDecimal totalTrdMoney;
|
||||
/**
|
||||
* 聊天收入
|
||||
*/
|
||||
private Long messageIncomeCoin;
|
||||
/** 视频收入 */
|
||||
private Long videoIncomeCoin;
|
||||
/** 礼物收入 */
|
||||
private Long giftIncomeCoin;
|
||||
/** 守护收入 */
|
||||
private Long guardIncomeCoin;
|
||||
/** 工会收入 */
|
||||
private Long unionIncomeCoin;
|
||||
/**
|
||||
* 账户锁定 0 正常 1 锁定
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.ruoyi.cai.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cai.domain.AccountDelete;
|
||||
|
||||
public interface AccountDeleteMapper extends BaseMapper<AccountDelete> {
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.ruoyi.cai.service.impl;
|
||||
|
||||
import cn.dev33.satoken.secure.BCrypt;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -16,6 +15,7 @@ import com.ruoyi.cai.dto.app.vo.user.*;
|
||||
import com.ruoyi.cai.dto.commom.user.MinUser;
|
||||
import com.ruoyi.cai.enums.GenderEnum;
|
||||
import com.ruoyi.cai.im.ImManager;
|
||||
import com.ruoyi.cai.mapper.AccountDeleteMapper;
|
||||
import com.ruoyi.cai.mapper.UserMapper;
|
||||
import com.ruoyi.cai.notice.YunxinHttpService;
|
||||
import com.ruoyi.cai.service.*;
|
||||
@@ -24,6 +24,7 @@ import com.ruoyi.cai.ws.service.RoomService;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.common.utils.BeanConvertUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.redisson.api.RBucket;
|
||||
@@ -32,7 +33,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -270,6 +273,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
.set(User::getPassword,BCrypt.hashpw(password)));
|
||||
}
|
||||
|
||||
@Resource
|
||||
private AccountDeleteMapper accountDeleteMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean removeUser(Long id) {
|
||||
@@ -287,6 +293,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
if(!b){
|
||||
throw new ServiceException("用户不存在");
|
||||
}
|
||||
Account account = accountService.getByUserId(user.getId());
|
||||
if(account != null){
|
||||
AccountDelete accountDelete = BeanConvertUtil.convertTo(account, AccountDelete::new);
|
||||
accountDelete.setId(null);
|
||||
accountDelete.setUsercode(user.getUsercode());
|
||||
accountDelete.setCreateTime(LocalDateTime.now());
|
||||
accountDeleteMapper.insert(accountDelete);
|
||||
}
|
||||
this.update(Wrappers.lambdaUpdate(User.class)
|
||||
.eq(User::getInviteId, user.getId())
|
||||
.set(User::getInviteId, null));
|
||||
@@ -306,6 +320,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
userMemberService.remove(Wrappers.lambdaQuery(UserMember.class).eq(UserMember::getUserId,id));
|
||||
userForbidService.remove(Wrappers.lambdaQuery(UserForbid.class).eq(UserForbid::getId,id));
|
||||
anchorApplyService.remove(Wrappers.lambdaQuery(AnchorApply.class).eq(AnchorApply::getId,id));
|
||||
log.info("触发删除用户 userId={};usercode={}", user.getId(), user.getUsercode());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user