Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
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
曲欣亮
member-api
Commits
31a6528b
Commit
31a6528b
authored
Jan 11, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
76bddaed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
17 deletions
+29
-17
FilmGroupService.java
...ain/java/com/egolm/film/api/service/FilmGroupService.java
+2
-2
FilmGroupServiceImpl.java
...com/egolm/film/api/service/impl/FilmGroupServiceImpl.java
+13
-5
FilmGroupController.java
...ava/com/egolm/film/api/web/admin/FilmGroupController.java
+14
-10
No files found.
src/main/java/com/egolm/film/api/service/FilmGroupService.java
View file @
31a6528b
...
...
@@ -11,9 +11,9 @@ public interface FilmGroupService {
List
<
Map
<
String
,
Object
>>
queryFilmListByGroupId
(
Integer
film_group_id
);
void
updateFilmGroupId
(
Integer
film_id
,
Integer
group_id
);
void
updateFilmGroupId
(
Integer
[]
film_id
,
Integer
group_id
);
void
removeFilmGroupById
(
Integer
id
);
void
removeFilmGroupById
(
Integer
[]
id
);
List
<
Map
<
String
,
Object
>>
queryFilmList
(
Integer
enroll_type_id
,
String
film_country
,
Page
page
);
...
...
src/main/java/com/egolm/film/api/service/impl/FilmGroupServiceImpl.java
View file @
31a6528b
...
...
@@ -29,15 +29,23 @@ public class FilmGroupServiceImpl implements FilmGroupService {
}
@Override
public
void
updateFilmGroupId
(
Integer
film_id
,
Integer
group_id
)
{
jdbcTemplate
.
executeUpdate
(
"update fc_member_film set film_group_id = ? where id = ?"
,
group_id
,
film_id
);
public
void
updateFilmGroupId
(
Integer
[]
film_id
,
Integer
group_id
)
{
Integer
[][]
args
=
new
Integer
[
film_id
.
length
][];
for
(
int
i
=
0
;
i
<
film_id
.
length
;
i
++)
{
args
[
i
]
=
new
Integer
[]
{
group_id
,
film_id
[
i
]};
}
jdbcTemplate
.
batchUpdate
(
"update fc_member_film set film_group_id = ? where id = ?"
,
args
);
}
@Override
@Transactional
public
void
removeFilmGroupById
(
Integer
id
)
{
jdbcTemplate
.
executeUpdate
(
"delete from fc_film_group where id = ?"
,
id
);
jdbcTemplate
.
executeUpdate
(
"update fc_member_film set film_group_id = ? where film_group_id = ?"
,
null
,
id
);
public
void
removeFilmGroupById
(
Integer
[]
id
)
{
Integer
[][]
args
=
new
Integer
[
id
.
length
][];
for
(
int
i
=
0
;
i
<
id
.
length
;
i
++)
{
args
[
i
]
=
new
Integer
[]
{
id
[
i
]};
}
jdbcTemplate
.
batchUpdate
(
"delete from fc_film_group where id = ?"
,
args
);
jdbcTemplate
.
batchUpdate
(
"update fc_member_film set film_group_id = null where film_group_id = ?"
,
args
);
}
@Override
...
...
src/main/java/com/egolm/film/api/web/admin/FilmGroupController.java
View file @
31a6528b
...
...
@@ -5,6 +5,7 @@ import java.util.Map;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
...
@@ -42,22 +43,25 @@ public class FilmGroupController {
}
@ResponseBody
@Transactional
@PostMapping
(
"saveOrUpdate"
)
@ApiOperation
(
"保存或更新分类"
)
public
Object
saveOrUpdate
(
Integer
id
,
String
group_name
,
Integer
parent_id
,
Integer
order_num
)
{
Fc_film_group
g
=
new
Fc_film_group
();
g
.
setId
(
id
);
g
.
setGroup_name
(
group_name
);
g
.
setParent_id
(
parent_id
);
g
.
setOrder_num
(
order_num
);
jdbcTemplate
.
merge
(
g
);
return
Rjx
.
jsonOk
().
setData
(
g
);
public
Object
saveOrUpdate
(
Integer
[]
id
,
String
[]
group_name
,
Integer
[]
order_num
,
Integer
[]
parent_id
)
{
for
(
int
i
=
0
;
i
<
id
.
length
;
i
++)
{
Fc_film_group
g
=
new
Fc_film_group
();
g
.
setId
(
id
[
i
]);
g
.
setGroup_name
(
group_name
[
i
]);
g
.
setParent_id
(
parent_id
[
i
]);
g
.
setOrder_num
(
order_num
[
i
]);
jdbcTemplate
.
merge
(
g
);
}
return
Rjx
.
jsonOk
();
}
@ResponseBody
@PostMapping
(
"delete"
)
@ApiOperation
(
"删除分类"
)
public
Object
delete
(
Integer
id
)
{
public
Object
delete
(
Integer
[]
id
)
{
filmGroupService
.
removeFilmGroupById
(
id
);
return
Rjx
.
jsonOk
();
}
...
...
@@ -81,7 +85,7 @@ public class FilmGroupController {
@ResponseBody
@PostMapping
(
"updateFilmGroupId"
)
@ApiOperation
(
"更新影片分类"
)
public
Object
updateFilmGroupId
(
Integer
film_id
,
Integer
group_id
)
{
public
Object
updateFilmGroupId
(
Integer
[]
film_id
,
Integer
group_id
)
{
filmGroupService
.
updateFilmGroupId
(
film_id
,
group_id
);
return
Rjx
.
jsonOk
();
}
...
...
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