Commit 351db415 authored by Quxl's avatar Quxl

x

parent f017937d
...@@ -106,6 +106,9 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -106,6 +106,9 @@ 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) {
jdbcTemplate.executeUpdate("delete from fc_admin_group_menu where group_id = ?", group_id);
jdbcTemplate.executeUpdate("delete from fc_admin_group_filmtype where group_id = ?", group_id);
if(menu_ids != null && menu_ids.length > 0) {
List<Fc_admin_group_menu> agmList = new ArrayList<Fc_admin_group_menu>(); List<Fc_admin_group_menu> agmList = new ArrayList<Fc_admin_group_menu>();
for(Integer menu_id : menu_ids) { for(Integer menu_id : menu_ids) {
Fc_admin_group_menu agm = new Fc_admin_group_menu(); Fc_admin_group_menu agm = new Fc_admin_group_menu();
...@@ -113,6 +116,9 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -113,6 +116,9 @@ public class AdminAuthServiceImpl implements AdminAuthService {
agm.setMenu_id(menu_id); agm.setMenu_id(menu_id);
agmList.add(agm); 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>(); List<Fc_admin_group_filmtype> gtypeList = new ArrayList<Fc_admin_group_filmtype>();
for(Integer film_type : film_types) { for(Integer film_type : film_types) {
Fc_admin_group_filmtype gtype = new Fc_admin_group_filmtype(); Fc_admin_group_filmtype gtype = new Fc_admin_group_filmtype();
...@@ -120,12 +126,11 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -120,12 +126,11 @@ public class AdminAuthServiceImpl implements AdminAuthService {
gtype.setFilm_type_id(film_type); gtype.setFilm_type_id(film_type);
gtypeList.add(gtype); gtypeList.add(gtype);
} }
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.batchSave(gtypeList); jdbcTemplate.batchSave(gtypeList);
} }
}
@Override @Override
public void saveOrUpdateMenu(Fc_admin_menu menu) { public void saveOrUpdateMenu(Fc_admin_menu menu) {
jdbcTemplate.saveOrUpdate(menu); jdbcTemplate.saveOrUpdate(menu);
......
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