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
233f2abe
Commit
233f2abe
authored
Dec 18, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
6c1e2d00
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
23 deletions
+19
-23
FilmService.java
src/main/java/com/egolm/film/api/service/FilmService.java
+0
-2
ReviewService.java
src/main/java/com/egolm/film/api/service/ReviewService.java
+2
-0
FilmServiceImpl.java
...java/com/egolm/film/api/service/impl/FilmServiceImpl.java
+0
-16
ReviewServiceImpl.java
...va/com/egolm/film/api/service/impl/ReviewServiceImpl.java
+16
-0
AdminReviewController.java
...a/com/egolm/film/api/web/admin/AdminReviewController.java
+1
-5
No files found.
src/main/java/com/egolm/film/api/service/FilmService.java
View file @
233f2abe
...
...
@@ -134,8 +134,6 @@ public interface FilmService {
void
updateEnroll
(
Long
member_film_id
);
void
saveReviewRecordIfNotExists
(
Integer
review_id
,
Integer
review_round
,
Integer
[]
user_id
);
void
saveUploadId
(
Long
member_film_id
,
String
upload_id
);
void
saveUploadState
(
Long
member_film_id
,
Integer
upload_state
);
...
...
src/main/java/com/egolm/film/api/service/ReviewService.java
View file @
233f2abe
...
...
@@ -83,5 +83,7 @@ public interface ReviewService {
void
toNextRound
(
Integer
review_id
);
void
tryNextRound
(
Integer
review_id
);
void
saveReviewRecordIfNotExists
(
Integer
review_id
,
Integer
review_round
,
Integer
[]
user_id
);
}
\ No newline at end of file
src/main/java/com/egolm/film/api/service/impl/FilmServiceImpl.java
View file @
233f2abe
...
...
@@ -580,22 +580,6 @@ public class FilmServiceImpl implements FilmService {
}
}
@Override
@Transactional
public
void
saveReviewRecordIfNotExists
(
Integer
review_id
,
Integer
review_round
,
Integer
[]
user_id
)
{
String
sql
=
""
+
"insert into fc_review_record"
+
"(review_id, user_id, review_round, view_state, create_time) select ?, ?, ?, 0, now() from dual "
+
"where "
+
"not exists (select * from fc_review_record where review_id = ? and user_id = ? and review_round = ?)"
;
Object
[][]
objs
=
new
Object
[
user_id
.
length
][];
for
(
int
i
=
0
;
i
<
objs
.
length
;
i
++)
{
objs
[
i
]
=
new
Object
[]{
review_id
,
user_id
[
i
],
review_round
,
review_id
,
user_id
[
i
],
review_round
};
}
jdbcTemplate
.
batchUpdate
(
sql
,
objs
);
jdbcTemplate
.
executeUpdate
(
"update fc_review set allot_state = 1, opt_state = 0 where id = ? and review_round = ?"
,
review_id
,
review_round
);
}
@Override
public
void
saveUploadId
(
Long
member_film_id
,
String
upload_id
)
{
jdbcTemplate
.
executeUpdate
(
"update fc_member_film set upload_id = ?, upload_time = ? where id = ?"
,
upload_id
,
new
Date
(),
member_film_id
);
...
...
src/main/java/com/egolm/film/api/service/impl/ReviewServiceImpl.java
View file @
233f2abe
...
...
@@ -295,4 +295,20 @@ public class ReviewServiceImpl implements ReviewService {
}
}
}
@Override
@Transactional
public
void
saveReviewRecordIfNotExists
(
Integer
review_id
,
Integer
review_round
,
Integer
[]
user_id
)
{
String
sql
=
""
+
"insert into fc_review_record"
+
"(review_id, user_id, review_round, view_state, create_time) select ?, ?, ?, 0, now() from dual "
+
"where "
+
"not exists (select * from fc_review_record where review_id = ? and user_id = ? and review_round = ?)"
;
Object
[][]
objs
=
new
Object
[
user_id
.
length
][];
for
(
int
i
=
0
;
i
<
objs
.
length
;
i
++)
{
objs
[
i
]
=
new
Object
[]{
review_id
,
user_id
[
i
],
review_round
,
review_id
,
user_id
[
i
],
review_round
};
}
jdbcTemplate
.
batchUpdate
(
sql
,
objs
);
jdbcTemplate
.
executeUpdate
(
"update fc_review set allot_state = 1, opt_state = 0 where id = ? and review_round = ?"
,
review_id
,
review_round
);
}
}
src/main/java/com/egolm/film/api/web/admin/AdminReviewController.java
View file @
233f2abe
...
...
@@ -13,7 +13,6 @@ import com.egolm.common.bean.Rjx;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.AdminTokenService
;
import
com.egolm.film.api.service.AdminUserService
;
import
com.egolm.film.api.service.FilmService
;
import
com.egolm.film.api.service.ReviewService
;
import
com.egolm.film.bean.Fc_admin
;
...
...
@@ -27,9 +26,6 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping
(
"admin/review"
)
public
class
AdminReviewController
{
@Autowired
FilmService
filmService
;
@Autowired
ReviewService
reviewService
;
...
...
@@ -85,7 +81,7 @@ public class AdminReviewController {
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
true
,
name
=
"user_id"
,
value
=
"审片评委ID"
,
allowMultiple
=
true
),
})
public
Object
allot
(
Integer
review_id
,
Integer
review_round
,
Integer
[]
user_id
)
{
film
Service
.
saveReviewRecordIfNotExists
(
review_id
,
review_round
,
user_id
);
review
Service
.
saveReviewRecordIfNotExists
(
review_id
,
review_round
,
user_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