"...platform/git@gitlab.ruzhoukj.com:wujipeng/relation.git" did not exist on "4a5fa74040f25a1270613c3ac62b3d4b01311c6e"
Commit cf7031d5 authored by wujipeng's avatar wujipeng
Browse files

删除用户

parent 6972b544
...@@ -51,8 +51,8 @@ public class UserController extends BaseController { ...@@ -51,8 +51,8 @@ public class UserController extends BaseController {
} }
@ApiModelProperty(value = "删除用户") @ApiModelProperty(value = "删除用户")
@DeleteMapping("/{id}") @DeleteMapping()
public Result delete(@PathVariable String id) { public Result delete(@RequestParam(name = "userName") String userName) {
return Result.data(userService.delete(id)); return Result.data(userService.delete(userName));
} }
} }
...@@ -30,5 +30,5 @@ public interface UserService extends IService<UserEntity> { ...@@ -30,5 +30,5 @@ public interface UserService extends IService<UserEntity> {
EveryoneVO relationPage(UserDTO userDTO); EveryoneVO relationPage(UserDTO userDTO);
Boolean delete(String id); Boolean delete(String userName);
} }
...@@ -203,9 +203,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -203,9 +203,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
} }
@Override @Override
public Boolean delete(String id) { @Transactional
UserEntity user = getById(id); public Boolean delete(String userName) {
excelDataService.remove(new LambdaQueryWrapper<ExcelDataEntity>().eq(ExcelDataEntity::getPayUserName, user.getUserName()));
return removeById(id); 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