Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sentinel
Commits
2578feeb
Commit
2578feeb
authored
Nov 23, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理组权限
parent
90f4352e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
7 deletions
+75
-7
AdminAuthController.java
...in/java/com/egolm/film/api/admin/AdminAuthController.java
+2
-2
AdminAuthService.java
...va/com/egolm/film/api/admin/service/AdminAuthService.java
+1
-1
AdminAuthServiceImpl.java
...olm/film/api/admin/service/impl/AdminAuthServiceImpl.java
+14
-4
Fc_admin_group_filmtype.java
...ain/java/com/egolm/film/bean/Fc_admin_group_filmtype.java
+58
-0
No files found.
src/main/java/com/egolm/film/api/admin/AdminAuthController.java
View file @
2578feeb
...
...
@@ -155,8 +155,8 @@ public class AdminAuthController {
@ResponseBody
@PostMapping
(
"updateGroupAuth"
)
@ApiOperation
(
"保存或更新管理组权限"
)
public
Object
updateGroupAuth
(
Integer
group_id
,
Integer
[]
menu_id
)
{
service
.
updateGroupAuth
(
group_id
,
menu_id
);
public
Object
updateGroupAuth
(
Integer
group_id
,
Integer
[]
menu_id
,
Integer
[]
film_type
)
{
service
.
updateGroupAuth
(
group_id
,
menu_id
,
film_type
);
return
Rjx
.
jsonOk
();
}
...
...
src/main/java/com/egolm/film/api/admin/service/AdminAuthService.java
View file @
2578feeb
...
...
@@ -23,6 +23,6 @@ public interface AdminAuthService {
List
<
Map
<
String
,
Object
>>
queryGroupAuth
(
Integer
group_id
);
void
updateGroupAuth
(
Integer
group_id
,
Integer
[]
menu_id
);
void
updateGroupAuth
(
Integer
group_id
,
Integer
[]
menu_id
s
,
Integer
[]
film_types
);
}
src/main/java/com/egolm/film/api/admin/service/impl/AdminAuthServiceImpl.java
View file @
2578feeb
...
...
@@ -14,6 +14,7 @@ import com.egolm.common.jdbc.Page;
import
com.egolm.film.api.admin.service.AdminAuthService
;
import
com.egolm.film.bean.Fc_admin
;
import
com.egolm.film.bean.Fc_admin_group
;
import
com.egolm.film.bean.Fc_admin_group_filmtype
;
import
com.egolm.film.bean.Fc_admin_group_menu
;
import
com.egolm.film.config.WebMvcConfig
;
import
com.egolm.film.util.SqlWhere
;
...
...
@@ -91,16 +92,25 @@ public class AdminAuthServiceImpl implements AdminAuthService {
@Override
@Transactional
public
void
updateGroupAuth
(
Integer
group_id
,
Integer
[]
ids
)
{
String
sql
=
"delete from fc_admin_group_menu where group_id = ?"
;
jdbcTemplate
.
executeUpdate
(
sql
,
group_id
);
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
:
ids
)
{
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
(
film_type
);
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
);
}
...
...
src/main/java/com/egolm/film/bean/Fc_admin_group_filmtype.java
0 → 100644
View file @
2578feeb
package
com
.
egolm
.
film
.
bean
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
/**
* @author 曲欣亮
* @since 2018-11-23
* @version v-1.0
*/
@Entity
(
name
=
"fc_admin_group_filmtype"
)
public
class
Fc_admin_group_filmtype
implements
java
.
io
.
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
Integer
group_id
;
@Id
private
Integer
film_type
;
/**
* 无参数构造方法
*/
public
Fc_admin_group_filmtype
()
{
super
();
}
/**
* 全参数构造方法
* @param group_id
* @param film_type
*/
public
Fc_admin_group_filmtype
(
Integer
group_id
,
Integer
film_type
)
{
this
.
group_id
=
group_id
;
this
.
film_type
=
film_type
;
}
public
void
setGroup_id
(
Integer
group_id
)
{
this
.
group_id
=
group_id
;
}
public
Integer
getGroup_id
()
{
return
group_id
;
}
public
void
setFilm_type
(
Integer
film_type
)
{
this
.
film_type
=
film_type
;
}
public
Integer
getFilm_type
()
{
return
film_type
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment