"git@gitlab.ruzhoukj.com:wangcaixuan/rz-gb-web.git" did not exist on "f402273d24269af16cc715e29259fd63f5db604e"
Commit cf7031d5 authored by wujipeng's avatar wujipeng
Browse files

删除用户

parent 6972b544
......@@ -51,8 +51,8 @@ public class UserController extends BaseController {
}
@ApiModelProperty(value = "删除用户")
@DeleteMapping("/{id}")
public Result delete(@PathVariable String id) {
return Result.data(userService.delete(id));
@DeleteMapping()
public Result delete(@RequestParam(name = "userName") String userName) {
return Result.data(userService.delete(userName));
}
}
......@@ -30,5 +30,5 @@ public interface UserService extends IService<UserEntity> {
EveryoneVO relationPage(UserDTO userDTO);
Boolean delete(String id);
Boolean delete(String userName);
}
......@@ -203,9 +203,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
}
@Override
public Boolean delete(String id) {
UserEntity user = getById(id);
excelDataService.remove(new LambdaQueryWrapper<ExcelDataEntity>().eq(ExcelDataEntity::getPayUserName, user.getUserName()));
return removeById(id);
@Transactional
public Boolean delete(String userName) {
excelDataService.remove(new LambdaQueryWrapper<ExcelDataEntity>().eq(ExcelDataEntity::getPayUserName, userName));
//删除关系
userRelationService.remove(new LambdaQueryWrapper<UserRelationEntity>().eq(UserRelationEntity::getUserName, userName));
userRelationService.remove(new LambdaQueryWrapper<UserRelationEntity>().eq(UserRelationEntity::getOtherName, userName));
return remove(new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserName, userName));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment