Commit 63b3ec14 authored by Quxl's avatar Quxl

x

parent 78149b75
...@@ -36,4 +36,6 @@ public interface AdminAuthService { ...@@ -36,4 +36,6 @@ public interface AdminAuthService {
boolean changePasswordByMemberId(Integer id, String password, String newPassword); boolean changePasswordByMemberId(Integer id, String password, String newPassword);
void delAdmin(Integer[] adminid);
} }
...@@ -40,7 +40,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -40,7 +40,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
@Override @Override
public List<Map<String, Object>> queryAdminList(String keyword, Integer group_id, Page page) { public List<Map<String, Object>> queryAdminList(String keyword, Integer group_id, Page page) {
SqlWhere argEdit = new SqlWhere().lk(new String[]{"realname", "username"}, keyword).eq("group_id", group_id); SqlWhere argEdit = new SqlWhere().lk(new String[]{"realname", "username"}, keyword).eq("group_id", group_id).ne("state", 3);
String sql = "select * from fc_admin" + StringUtil.join(" and ", " where ", "", "", argEdit.getStringList()); String sql = "select * from fc_admin" + StringUtil.join(" and ", " where ", "", "", argEdit.getStringList());
return jdbcTemplate.limit(sql, page, argEdit.getObjectArray()); return jdbcTemplate.limit(sql, page, argEdit.getObjectArray());
} }
...@@ -51,6 +51,12 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -51,6 +51,12 @@ public class AdminAuthServiceImpl implements AdminAuthService {
jdbcTemplate.executeUpdate(sql, (Object[])adminid); jdbcTemplate.executeUpdate(sql, (Object[])adminid);
} }
@Override
public void delAdmin(Integer[] adminid) {
String sql = "update fc_admin set state = 3 where adminid in (" + StringUtil.join("?", ", ", adminid.length) + ")";
jdbcTemplate.executeUpdate(sql, (Object[])adminid);
}
@Override @Override
public void enableAdmin(Integer[] adminid) { public void enableAdmin(Integer[] adminid) {
String sql = "update fc_admin set state = 1 where adminid in (" + StringUtil.join("?", ", ", adminid.length) + ")"; String sql = "update fc_admin set state = 1 where adminid in (" + StringUtil.join("?", ", ", adminid.length) + ")";
......
...@@ -148,6 +148,18 @@ public class AdminAuthController { ...@@ -148,6 +148,18 @@ public class AdminAuthController {
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
@ResponseBody
@PostMapping("adminDel")
@ApiOperation("禁用管理员")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="adminid", value="管理员ID", allowMultiple=true),
})
public Object adminDel(Integer[] adminid) {
XException.assertNotBlank("管理员ID不能为空", (Object[])adminid);
service.delAdmin(adminid);
return Rjx.jsonOk();
}
@ResponseBody @ResponseBody
@PostMapping("adminEnabled") @PostMapping("adminEnabled")
@ApiOperation("启用管理员") @ApiOperation("启用管理员")
......
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