Commit 375e578d authored by Quxl's avatar Quxl

xx

parent baa19b27
......@@ -21,4 +21,6 @@ public interface AdminUserService {
void changePassword(Integer uid, String password);
void saveGroupFun(Integer group_id, Integer[] fun_id);
}
package com.egolm.film.api.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
......@@ -13,6 +15,7 @@ import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.AdminUserService;
import com.egolm.film.bean.Fc_user;
import com.egolm.film.bean.Fc_user_group;
import com.egolm.film.bean.Fc_user_group_fun;
import com.egolm.film.util.Common;
import com.egolm.film.util.SqlWhere;
......@@ -59,4 +62,15 @@ public class AdminUserServiceImpl implements AdminUserService {
jdbcTemplate.executeUpdate("update fc_user set password = ?, salt = ? where uid = ?", encodePassword, salt, uid);
}
@Override
@Transactional
public void saveGroupFun(Integer group_id, Integer[] fun_id) {
jdbcTemplate.executeUpdate("delete from fc_user_group_fun where group_id = ?", group_id);
List<Fc_user_group_fun> list = new ArrayList<Fc_user_group_fun>();
for(Integer i : fun_id) {
list.add(new Fc_user_group_fun(group_id, i));
}
jdbcTemplate.batchSave(list);
}
}
......@@ -53,6 +53,7 @@ public class AdminUserController {
}
@ResponseBody
@Transactional
@PostMapping("group_save")
@ApiOperation("保存分组及分组权限")
@ApiImplicitParams({
......@@ -73,6 +74,7 @@ public class AdminUserController {
group.setState(1);
}
service.mergeGroup(group);
service.saveGroupFun(group.getGroup_id(), fun_id);
return Rjx.jsonOk().setData(group);
}
......
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