Commit 351db415 authored by Quxl's avatar Quxl

x

parent f017937d
...@@ -106,24 +106,29 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -106,24 +106,29 @@ public class AdminAuthServiceImpl implements AdminAuthService {
@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) {
List<Fc_admin_group_menu> agmList = new ArrayList<Fc_admin_group_menu>();
for(Integer menu_id : menu_ids) {
Fc_admin_group_menu agm = new Fc_admin_group_menu();
agm.setGroup_id(group_id);
agm.setMenu_id(menu_id);
agmList.add(agm);
}
List<Fc_admin_group_filmtype> gtypeList = new ArrayList<Fc_admin_group_filmtype>();
for(Integer film_type : film_types) {
Fc_admin_group_filmtype gtype = new Fc_admin_group_filmtype();
gtype.setGroup_id(group_id);
gtype.setFilm_type_id(film_type);
gtypeList.add(gtype);
}
jdbcTemplate.executeUpdate("delete from fc_admin_group_menu where group_id = ?", group_id); jdbcTemplate.executeUpdate("delete from fc_admin_group_menu where group_id = ?", group_id);
jdbcTemplate.batchSave(agmList);
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); if(menu_ids != null && menu_ids.length > 0) {
List<Fc_admin_group_menu> agmList = new ArrayList<Fc_admin_group_menu>();
for(Integer menu_id : menu_ids) {
Fc_admin_group_menu agm = new Fc_admin_group_menu();
agm.setGroup_id(group_id);
agm.setMenu_id(menu_id);
agmList.add(agm);
}
jdbcTemplate.batchSave(agmList);
}
if(film_types != null && film_types.length > 0) {
List<Fc_admin_group_filmtype> gtypeList = new ArrayList<Fc_admin_group_filmtype>();
for(Integer film_type : film_types) {
Fc_admin_group_filmtype gtype = new Fc_admin_group_filmtype();
gtype.setGroup_id(group_id);
gtype.setFilm_type_id(film_type);
gtypeList.add(gtype);
}
jdbcTemplate.batchSave(gtypeList);
}
} }
@Override @Override
......
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