diff --git a/src/main/java/com/xkrs/controller/SysUserController.java b/src/main/java/com/xkrs/controller/SysUserController.java index 4af9038..f077b7a 100644 --- a/src/main/java/com/xkrs/controller/SysUserController.java +++ b/src/main/java/com/xkrs/controller/SysUserController.java @@ -206,20 +206,6 @@ public class SysUserController { return sysUserService.deleteSysUser(userName); } - /** - * 软删除指定id的普通用户 - */ - @RequestMapping(value = "/general/delete", method = RequestMethod.DELETE) - public String deleteCustomUser(@RequestParam(value = "userId", required = false) Long id) { - // 验证数据合法性 - int res = sysUserService.softDeleteGeneralUser(id); - if (res == 1) { - return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, "", locale); - } else { - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "", locale); - } - } - @RequestMapping(value = "/update", method = RequestMethod.POST) public String updateUser(@Validated({SysUserQoUpdate.class}) @RequestBody SysUserQo userQo, BindingResult bindingResult) { // 验证数据合法性 diff --git a/src/main/java/com/xkrs/dao/SysRoleDao.java b/src/main/java/com/xkrs/dao/SysRoleDao.java index 6729aeb..623f071 100644 --- a/src/main/java/com/xkrs/dao/SysRoleDao.java +++ b/src/main/java/com/xkrs/dao/SysRoleDao.java @@ -13,15 +13,6 @@ import java.util.List; @Component public interface SysRoleDao extends JpaRepository, JpaSpecificationExecutor { - /** - * 查询用户角色列表根据用户id - * - * @param id - * @return - */ - @Query(value = "SELECT sys_role.id,sys_role.role_name,sys_role.role_name_zh,sys_role.role_desc FROM sys_role,rel_user_role WHERE sys_role.id = rel_user_role.role_id AND rel_user_role.user_id = :id ", nativeQuery = true) - List selectByUserId(@Param("id") Long id); - /** * 查询用户角色列表根据用户名 * diff --git a/src/main/java/com/xkrs/dao/SysUserDao.java b/src/main/java/com/xkrs/dao/SysUserDao.java index 87b2028..5e7b1c9 100644 --- a/src/main/java/com/xkrs/dao/SysUserDao.java +++ b/src/main/java/com/xkrs/dao/SysUserDao.java @@ -35,13 +35,6 @@ public interface SysUserDao extends JpaRepository, JpaSpeci @Query(value = "SELECT * FROM sys_user WHERE user_name = :userName", nativeQuery = true) SysUserEntity selectByUserName(@Param("userName") String userName); - /** - * 软删除系统用户根据id - */ - @Modifying - @Query(value = "UPDATE sys_user SET delete_flag = 1 " + "WHERE id = :id ;", nativeQuery = true) - void softDeleteGeneralUserById(@Param("id") Long id); - /** * 删除系统用户(危险操作!) */ diff --git a/src/main/java/com/xkrs/service/SysUserService.java b/src/main/java/com/xkrs/service/SysUserService.java index e9e55a3..56e2790 100644 --- a/src/main/java/com/xkrs/service/SysUserService.java +++ b/src/main/java/com/xkrs/service/SysUserService.java @@ -51,14 +51,6 @@ public interface SysUserService { */ int updateSysUser(SysUserQo sysUserQo); - /** - * 软删除系统用户 - * - * @param id - * @return - */ - int softDeleteGeneralUser(Long id); - /** * 查询用户的信息 * diff --git a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java index 95713f3..fa29388 100644 --- a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java @@ -2,7 +2,10 @@ package com.xkrs.service.impl; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.dao.*; -import com.xkrs.model.entity.*; +import com.xkrs.model.entity.RelRoleAuthorityEntity; +import com.xkrs.model.entity.RelUserRoleEntity; +import com.xkrs.model.entity.StreetEntity; +import com.xkrs.model.entity.SysUserEntity; import com.xkrs.model.qo.SysUserQo; import com.xkrs.service.RedisService; import com.xkrs.service.SysUserService; @@ -203,25 +206,6 @@ public class SysUserServiceImpl implements SysUserService { return 1; } - /** - * 软删除普通用户 - */ - @Transactional(rollbackFor = Exception.class) - @Override - public int softDeleteGeneralUser(Long id) { - String adminRole = "role_administor"; - String sysRole = "role_system_manager"; - List list = sysRoleDao.selectByUserId(id); - if (list.size() > 0) { - SysRoleEntity sysRoleEntity = list.get(1); - if (sysRole.equals(sysRoleEntity.getRoleName()) || adminRole.equals(sysRoleEntity.getRoleName())) { - sysUserDao.softDeleteGeneralUserById(id); - return 0; - } - } - return 1; - } - /** * 查询用户的信息 */