Commit de1faf49 authored by Quxl's avatar Quxl

管理组权限

parent 2a438e49
...@@ -148,8 +148,9 @@ public class AdminAuthController { ...@@ -148,8 +148,9 @@ public class AdminAuthController {
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="group_id", value="组ID"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="group_id", value="组ID"),
}) })
public Object groupAuthQuery(Integer group_id) throws FileNotFoundException { public Object groupAuthQuery(Integer group_id) throws FileNotFoundException {
List<Map<String, Object>> list = service.queryGroupAuth(group_id); List<Map<String, Object>> groupMenuList = service.queryGroupMenuList(group_id);
return Rjx.jsonOk().setData(list); List<Integer> groupFilmtypeList = service.queryGroupFilmtypeList(group_id);
return Rjx.jsonOk().set("groupMenuList", groupMenuList).set("groupFilmtypeList", groupFilmtypeList);
} }
@ResponseBody @ResponseBody
......
...@@ -21,7 +21,9 @@ public interface AdminAuthService { ...@@ -21,7 +21,9 @@ public interface AdminAuthService {
void mergeAdmin(Fc_admin admin); void mergeAdmin(Fc_admin admin);
List<Map<String, Object>> queryGroupAuth(Integer group_id); List<Map<String, Object>> queryGroupMenuList(Integer group_id);
List<Integer> queryGroupFilmtypeList(Integer group_id);
void updateGroupAuth(Integer group_id, Integer[] menu_ids, Integer[] film_types); void updateGroupAuth(Integer group_id, Integer[] menu_ids, Integer[] film_types);
......
...@@ -61,7 +61,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -61,7 +61,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
} }
@Override @Override
public List<Map<String, Object>> queryGroupAuth(Integer group_id) { public List<Map<String, Object>> queryGroupMenuList(Integer group_id) {
String s = "select am.*, agm.group_id from fc_admin_menu am left join fc_admin_group_menu agm on am.menu_id = agm.menu_id and agm.group_id = ? order by order_num"; String s = "select am.*, agm.group_id from fc_admin_menu am left join fc_admin_group_menu agm on am.menu_id = agm.menu_id and agm.group_id = ? order by order_num";
List<Map<String, Object>> list = jdbcTemplate.queryForList(s, group_id); List<Map<String, Object>> list = jdbcTemplate.queryForList(s, group_id);
return this.getTree(list, null); return this.getTree(list, null);
...@@ -83,6 +83,13 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -83,6 +83,13 @@ public class AdminAuthServiceImpl implements AdminAuthService {
return nodes; return nodes;
} }
@Override
public List<Integer> queryGroupFilmtypeList(Integer group_id) {
String s = "select film_type from fc_admin_group_filmtype where group_id = ?";
List<Integer> list = jdbcTemplate.queryForObjects(s, Integer.class, group_id);
return list;
}
@Override @Override
@Transactional @Transactional
public void updateGroupAuth(Integer group_id, Integer[] menu_ids, Integer[] film_types) { public void updateGroupAuth(Integer group_id, Integer[] menu_ids, Integer[] film_types) {
...@@ -105,9 +112,5 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -105,9 +112,5 @@ public class AdminAuthServiceImpl implements AdminAuthService {
jdbcTemplate.executeUpdate("delete from fc_admin_group_filmtype where group_id = ?", group_id); jdbcTemplate.executeUpdate("delete from fc_admin_group_filmtype where group_id = ?", group_id);
jdbcTemplate.batchSave(gtypeList); jdbcTemplate.batchSave(gtypeList);
} }
} }
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