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
720eb6f6
Commit
720eb6f6
authored
Jan 18, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
53b66d44
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
2 deletions
+60
-2
NewsService.java
src/main/java/com/egolm/film/api/service/NewsService.java
+3
-0
NewsServiceImpl.java
...java/com/egolm/film/api/service/impl/NewsServiceImpl.java
+51
-0
ReviewServiceImpl.java
...va/com/egolm/film/api/service/impl/ReviewServiceImpl.java
+0
-2
AdminReviewController.java
...a/com/egolm/film/api/web/admin/AdminReviewController.java
+6
-0
No files found.
src/main/java/com/egolm/film/api/service/NewsService.java
View file @
720eb6f6
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
java.util.Map
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.bean.Fc_admin
;
public
interface
NewsService
{
...
...
@@ -19,4 +20,6 @@ public interface NewsService {
List
<
Map
<
String
,
Object
>>
queryListForUser
(
Integer
uid
,
Integer
gid
,
Page
page
);
void
sendAllotNews
(
Integer
review_id
,
Integer
review_round
,
Integer
[]
user_id
,
Fc_admin
admin
);
}
src/main/java/com/egolm/film/api/service/impl/NewsServiceImpl.java
View file @
720eb6f6
package
com
.
egolm
.
film
.
api
.
service
.
impl
;
import
java.text.MessageFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
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.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.NewsService
;
import
com.egolm.film.bean.Fc_admin
;
import
com.egolm.film.bean.Fc_news
;
import
com.egolm.film.bean.Fc_news_sender
;
@Service
public
class
NewsServiceImpl
implements
NewsService
{
...
...
@@ -49,4 +57,47 @@ public class NewsServiceImpl implements NewsService {
return
jdbcTemplate
.
limit
(
sql
,
page
,
uid
,
uid
,
gid
);
}
static
String
[]
rounds
=
new
String
[]
{
"一选"
,
"二选"
,
"三选"
,
"把关"
,
"选片委员会"
,
"总局审片"
};
static
Map
<
Integer
,
String
>
map
=
new
HashMap
<
Integer
,
String
>();
static
{
map
.
put
(
1
,
"金爵奖国际影片评选"
);
map
.
put
(
2
,
"亚洲新人奖国际影片评选"
);
map
.
put
(
3
,
"国际电影展映"
);
}
@Override
@Transactional
public
void
sendAllotNews
(
Integer
review_id
,
Integer
review_round
,
Integer
[]
user_id
,
Fc_admin
admin
)
{
Map
<
String
,
Object
>
film
=
jdbcTemplate
.
queryForMap
(
"select mf.*, r.enroll_type_id from fc_member_film mf, fc_review r where mf.id = r.film_id and r.id = ?"
,
review_id
);
String
cn_name
=
(
String
)
film
.
get
(
"cn_name"
);
String
en_name
=
(
String
)
film
.
get
(
"en_name"
);
Integer
enroll_type_id
=
((
Number
)
film
.
get
(
"enroll_type_id"
)).
intValue
();
String
enroll_type_name
=
map
.
get
(
enroll_type_id
);
String
round
=
rounds
[
review_round
-
1
];
String
content
=
"管理员 [{0}] 已经为您分配了新的审片任务 [{1} {2}] {3} {4},请按时处理."
;
content
=
MessageFormat
.
format
(
content
,
admin
.
getRealname
(),
cn_name
,
en_name
,
enroll_type_name
,
round
);
String
title
=
"审片任务: [{1} {2}] {3} {4}"
;
title
=
MessageFormat
.
format
(
title
,
cn_name
,
en_name
,
enroll_type_name
,
round
);
Fc_news
news
=
new
Fc_news
();
news
.
setTitle
(
title
);
news
.
setContent
(
content
);
news
.
setCreate_time
(
new
Date
());
news
.
setCreator
(
admin
.
getAdminid
());
news
.
setLevel
(
1
);
news
.
setType
(
"TEXT"
);
news
.
setUpdater
(
admin
.
getAdminid
());
news
.
setLast_update_time
(
news
.
getCreate_time
());
jdbcTemplate
.
save
(
news
);
List
<
Fc_news_sender
>
senders
=
new
ArrayList
<
Fc_news_sender
>();
for
(
Integer
uid
:
user_id
)
{
Fc_news_sender
sender
=
new
Fc_news_sender
();
sender
.
setNews_id
(
news
.
getId
());
sender
.
setSend_time
(
news
.
getCreate_time
());
sender
.
setSender
(
admin
.
getAdminid
());
sender
.
setUser_id
(
uid
);
senders
.
add
(
sender
);
}
jdbcTemplate
.
batchSave
(
senders
);
}
}
src/main/java/com/egolm/film/api/service/impl/ReviewServiceImpl.java
View file @
720eb6f6
...
...
@@ -644,8 +644,6 @@ public class ReviewServiceImpl implements ReviewService {
}
objs2
[
i
]
=
new
Object
[]{
gid
,
review_id
,
review_round
,
user_id
[
i
]};
}
jdbcTemplate
.
batchUpdate
(
"update fc_review_record set user_group_id = ? where review_id = ? and review_round = ? and user_id = ?"
,
objs2
);
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 @
720eb6f6
...
...
@@ -18,6 +18,7 @@ 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.NewsService
;
import
com.egolm.film.api.service.ReviewService
;
import
com.egolm.film.bean.Fc_admin
;
import
com.egolm.film.bean.Fc_review
;
...
...
@@ -48,6 +49,9 @@ public class AdminReviewController {
@Autowired
AdminUserService
adminUserService
;
@Autowired
NewsService
newsService
;
@ResponseBody
@PostMapping
(
"list"
)
@ApiOperation
(
"查询选片列表"
)
...
...
@@ -208,6 +212,8 @@ public class AdminReviewController {
}
if
(
saveList
.
size
()
>
0
)
{
reviewService
.
saveReviewRecordIfNotExists
(
review_id
,
review_round
,
saveList
.
toArray
(
new
Integer
[
saveList
.
size
()]));
Fc_admin
admin
=
Util
.
mapTo
(
tokenService
.
getTokenObj
(),
Fc_admin
.
class
);
newsService
.
sendAllotNews
(
review_id
,
review_round
,
user_id
,
admin
);
}
if
(
cancelList
.
size
()
>
0
)
{
reviewService
.
deleteReviewRecord
(
review_id
,
review_round
,
cancelList
.
toArray
(
new
Integer
[
cancelList
.
size
()]));
...
...
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