|
|
@ -163,12 +163,17 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) |
|
|
|
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) |
|
|
|
public void delete(Long userId) { |
|
|
|
public void delete(Long userId) throws Exception { |
|
|
|
// 查询用户
|
|
|
|
// 查询用户
|
|
|
|
BsUser user = getUser(userId); |
|
|
|
BsUser user = getUser(userId); |
|
|
|
if (user == null) { |
|
|
|
if (user == null) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (UserStatusEnum.status0.getCode() == user.getStatus()) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
user.setHeadImg(null); |
|
|
|
|
|
|
|
user.setName("账户已注销"); |
|
|
|
user.setStatus(UserStatusEnum.status0.getCode()); |
|
|
|
user.setStatus(UserStatusEnum.status0.getCode()); |
|
|
|
editData(user); |
|
|
|
editData(user); |
|
|
|
|
|
|
|
|
|
|
@ -185,6 +190,8 @@ public class BsUserServiceImpl implements BsUserService { |
|
|
|
sonRel.setStatus(0); |
|
|
|
sonRel.setStatus(0); |
|
|
|
userParentRelService.editData(sonRel); |
|
|
|
userParentRelService.editData(sonRel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 更新session
|
|
|
|
|
|
|
|
userCenter.remove(userToken(user.getId())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|