修复搜索失效

This commit is contained in:
TinyAnts 2022-04-14 14:14:17 +08:00
parent df694b4063
commit 590cedb3a9
4 changed files with 56 additions and 8 deletions

View File

@ -105,4 +105,17 @@ public class SystemAdminController {
return AjaxResult.success(); return AjaxResult.success();
} }
/**
* 管理员状态切换
*
* @author fzr
* @return Object
*/
@Log(title = "管理员状态切换")
@PostMapping("/disable")
public Object disable(@Validated(value = SystemAdminParam.delete.class) @RequestBody SystemAdminParam systemAdminParam) {
iSystemAdminService.disable(systemAdminParam.getId());
return AjaxResult.success();
}
} }

View File

@ -41,7 +41,7 @@ public interface ISystemAdminService {
SystemAdminVo detail(Integer id); SystemAdminVo detail(Integer id);
/** /**
* 新增管理员 * 管理员新增
* *
* @author fzr * @author fzr
* @param systemAdminParam 参数 * @param systemAdminParam 参数
@ -49,7 +49,7 @@ public interface ISystemAdminService {
void add(SystemAdminParam systemAdminParam); void add(SystemAdminParam systemAdminParam);
/** /**
* 编辑管理员 * 管理员编辑
* *
* @author fzr * @author fzr
* @param systemAdminParam 参数 * @param systemAdminParam 参数
@ -57,13 +57,21 @@ public interface ISystemAdminService {
void edit(SystemAdminParam systemAdminParam); void edit(SystemAdminParam systemAdminParam);
/** /**
* 删除管理员 * 管理员删除
* *
* @author fzr * @author fzr
* @param id 主键参数 * @param id 主键参数
*/ */
void del(Integer id); void del(Integer id);
/**
* 管理员状态切换
*
* @author fzr
* @param id 主键参数
*/
void disable(Integer id);
/** /**
* 缓存管理员 * 缓存管理员
*/ */

View File

@ -49,7 +49,7 @@ public class SystemAdminServiceImpl implements ISystemAdminService {
} }
/** /**
* 获取管理员列表 * 管理员列表
* *
* @author fzr * @author fzr
* @param pageParam 分页参数 * @param pageParam 分页参数
@ -99,7 +99,7 @@ public class SystemAdminServiceImpl implements ISystemAdminService {
} }
/** /**
* 获取管理员详细 * 管理员详细
* *
* @author fzr * @author fzr
* @param id 主键 * @param id 主键
@ -132,7 +132,7 @@ public class SystemAdminServiceImpl implements ISystemAdminService {
} }
/** /**
* 新增管理员 * 管理员新增
* *
* @author fzr * @author fzr
* @param systemAdminParam 参数 * @param systemAdminParam 参数
@ -174,7 +174,7 @@ public class SystemAdminServiceImpl implements ISystemAdminService {
} }
/** /**
* 更新管理员 * 管理员更新
* *
* @author fzr * @author fzr
* @param systemAdminParam 参数 * @param systemAdminParam 参数
@ -231,7 +231,7 @@ public class SystemAdminServiceImpl implements ISystemAdminService {
} }
/** /**
* 删除管理员 * 管理员删除
* *
* @author fzr * @author fzr
* @param id 主键 * @param id 主键
@ -258,6 +258,29 @@ public class SystemAdminServiceImpl implements ISystemAdminService {
this.cacheAdminUserByUid(id); this.cacheAdminUserByUid(id);
} }
/**
* 管理员状态切换
*
* @author fzr
* @param id 主键参数
*/
@Override
public void disable(Integer id) {
String[] field = {"id", "username", "nickname", "is_disable"};
SystemAdmin systemAdmin = systemAdminMapper.selectOne(new QueryWrapper<SystemAdmin>()
.select(field)
.eq("id", id)
.eq("is_delete", 0)
.last("limit 1"));
Assert.notNull(systemAdmin, "账号已不存在!");
Integer disable = systemAdmin.getIsDisable() == 1 ? 0 : 1;
systemAdmin.setIsDisable(disable);
systemAdmin.setUpdateTime(TimeUtil.timestamp());
systemAdminMapper.updateById(systemAdmin);
}
/** /**
* 缓存管理员 * 缓存管理员
*/ */

View File

@ -77,6 +77,7 @@ public interface IBaseMapper<T> extends MPJBaseMapper<T> {
} else if (type.equals("long")) { } else if (type.equals("long")) {
val = Long.parseLong(value); val = Long.parseLong(value);
} }
break;
case "notIn": case "notIn":
case "in": case "in":
if (type.equals("long")){ if (type.equals("long")){
@ -92,6 +93,7 @@ public interface IBaseMapper<T> extends MPJBaseMapper<T> {
} }
val = intData; val = intData;
} }
break;
} }
switch (where) { switch (where) {
@ -212,6 +214,7 @@ public interface IBaseMapper<T> extends MPJBaseMapper<T> {
} else if (type.equals("long")) { } else if (type.equals("long")) {
val = Long.parseLong(value); val = Long.parseLong(value);
} }
break;
case "in": case "in":
case "notIn": case "notIn":
if (type.equals("int")) { if (type.equals("int")) {
@ -227,6 +230,7 @@ public interface IBaseMapper<T> extends MPJBaseMapper<T> {
} }
val = longData; val = longData;
} }
break;
} }
switch (where) { switch (where) {