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
1bc39bc7
Commit
1bc39bc7
authored
Dec 06, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
028835df
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
38 deletions
+45
-38
ReviewService.java
src/main/java/com/egolm/film/api/service/ReviewService.java
+4
-1
ReviewServiceImpl.java
...va/com/egolm/film/api/service/impl/ReviewServiceImpl.java
+11
-2
UserReviewController.java
...ava/com/egolm/film/api/web/user/UserReviewController.java
+21
-9
Fc_review_record_ext.java
src/main/java/com/egolm/film/bean/Fc_review_record_ext.java
+9
-26
No files found.
src/main/java/com/egolm/film/api/service/ReviewService.java
View file @
1bc39bc7
...
...
@@ -8,6 +8,7 @@ import com.egolm.common.jdbc.Page;
import
com.egolm.film.bean.Fc_review
;
import
com.egolm.film.bean.Fc_review_doubtful
;
import
com.egolm.film.bean.Fc_review_record
;
import
com.egolm.film.bean.Fc_review_record_ext
;
public
interface
ReviewService
{
...
...
@@ -21,6 +22,8 @@ public interface ReviewService {
List
<
Map
<
String
,
Object
>>
queryDoubtfulListByFilmId
(
Integer
film_id
,
Integer
user_id
);
void
saveReviewRecord
(
Fc_review_record
ru
);
Fc_review_record
queryReviewRecord
(
Integer
user_id
,
Integer
review_id
);
void
saveReviewRecord
(
Fc_review_record
ru
,
List
<
Fc_review_record_ext
>
exts
);
}
\ No newline at end of file
src/main/java/com/egolm/film/api/service/impl/ReviewServiceImpl.java
View file @
1bc39bc7
...
...
@@ -6,6 +6,7 @@ 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.DateUtil
;
import
com.egolm.common.StringUtil
;
...
...
@@ -15,6 +16,7 @@ import com.egolm.film.api.service.ReviewService;
import
com.egolm.film.bean.Fc_review
;
import
com.egolm.film.bean.Fc_review_doubtful
;
import
com.egolm.film.bean.Fc_review_record
;
import
com.egolm.film.bean.Fc_review_record_ext
;
import
com.egolm.film.util.SqlWhere
;
@Service
...
...
@@ -83,9 +85,16 @@ public class ReviewServiceImpl implements ReviewService {
}
@Override
public
void
saveReviewRecord
(
Fc_review_record
ru
)
{
jdbcTemplate
.
save
(
ru
);
public
Fc_review_record
queryReviewRecord
(
Integer
user_id
,
Integer
review_id
)
{
return
jdbcTemplate
.
queryForBean
(
"select * from fc_review_record where user_id = ? and review_id = ?"
,
Fc_review_record
.
class
,
user_id
,
review_id
);
}
@Override
@Transactional
public
void
saveReviewRecord
(
Fc_review_record
ru
,
List
<
Fc_review_record_ext
>
exts
)
{
jdbcTemplate
.
update
(
ru
);
jdbcTemplate
.
executeUpdate
(
"delete from fc_review_record_ext where record_id = ?"
,
ru
.
getId
());
jdbcTemplate
.
batchSave
(
exts
);
}
}
src/main/java/com/egolm/film/api/web/user/UserReviewController.java
View file @
1bc39bc7
package
com
.
egolm
.
film
.
api
.
web
.
user
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -19,6 +20,8 @@ import com.egolm.film.api.service.ReviewService;
import
com.egolm.film.api.service.UserTokenService
;
import
com.egolm.film.bean.Fc_review_doubtful
;
import
com.egolm.film.bean.Fc_review_record
;
import
com.egolm.film.bean.Fc_review_record_ext
;
import
com.egolm.film.config.XException
;
import
com.egolm.film.model.LoginToken
;
import
io.swagger.annotations.Api
;
...
...
@@ -101,7 +104,7 @@ public class UserReviewController {
@ResponseBody
@Transactional
@PostMapping
(
"
user_r
eview"
)
@PostMapping
(
"
doR
eview"
)
@ApiOperation
(
"评委审片"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
false
,
name
=
"review_id"
,
value
=
"审片ID"
),
...
...
@@ -116,12 +119,10 @@ public class UserReviewController {
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"double"
,
required
=
false
,
allowMultiple
=
true
,
name
=
"enroll_ext_score"
,
value
=
"才赛奖项得分"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
false
,
allowMultiple
=
true
,
name
=
"enroll_ext_text"
,
value
=
"才赛奖项评语"
),
})
public
Object
saveReviewRecord
(
Integer
review_id
,
Integer
review_state
,
Double
review_score
,
String
review_text
,
String
review_text_1
,
String
review_text_2
,
String
review_text_3
,
String
review_text_4
,
Integer
[]
enroll_ext_id
,
Double
[]
enroll_ext_score
,
String
[]
enroll_ext_text
)
{
public
Object
doReview
(
Integer
review_id
,
Integer
review_state
,
Double
review_score
,
String
review_text
,
String
review_text_1
,
String
review_text_2
,
String
review_text_3
,
String
review_text_4
,
Integer
[]
enroll_ext_id
,
Double
[]
enroll_ext_score
,
String
[]
enroll_ext_text
)
{
LoginToken
token
=
tokenService
.
getToken
();
Integer
user_id
=
(
Integer
)
token
.
getId
();
Fc_review_record
ru
=
new
Fc_review_record
();
ru
.
setReview_id
(
review_id
);
ru
.
setUser_id
(
user_id
);
Fc_review_record
ru
=
service
.
queryReviewRecord
(
user_id
,
review_id
);
ru
.
setReview_score
(
review_score
);
ru
.
setReview_state
(
review_state
);
ru
.
setReview_text
(
review_text_4
);
...
...
@@ -129,9 +130,20 @@ public class UserReviewController {
ru
.
setReview_text_2
(
review_text_2
);
ru
.
setReview_text_3
(
review_text_3
);
ru
.
setReview_text_4
(
review_text_4
);
service
.
saveReviewRecord
(
ru
);
List
<
Fc_review_record_ext
>
exts
=
new
ArrayList
<
Fc_review_record_ext
>();
if
(
enroll_ext_id
.
length
==
enroll_ext_score
.
length
&&
enroll_ext_score
.
length
==
enroll_ext_text
.
length
)
{
for
(
int
i
=
0
;
i
<
enroll_ext_id
.
length
;
i
++)
{
Fc_review_record_ext
ext
=
new
Fc_review_record_ext
();
ext
.
setRecord_id
(
ru
.
getId
());
ext
.
setEnroll_ext_id
(
enroll_ext_id
[
i
]);
ext
.
setEnroll_ext_score
(
enroll_ext_score
[
i
]);
ext
.
setEnroll_ext_text
(
enroll_ext_text
[
i
]);
exts
.
add
(
ext
);
}
}
else
{
throw
new
XException
(
"评奖项目参数数量错误"
);
}
service
.
saveReviewRecord
(
ru
,
exts
);
return
Rjx
.
jsonOk
();
}
...
...
src/main/java/com/egolm/film/bean/Fc_review_record_ext.java
View file @
1bc39bc7
...
...
@@ -19,16 +19,9 @@ public class Fc_review_record_ext implements java.io.Serializable {
private
Integer
id
;
/**
*
影片性质
*
评委评审记录ID
*/
@Id
private
Integer
review_id
;
/**
* 评委ID
*/
@Id
private
Integer
user_id
;
private
Integer
record_id
;
/**
* 影片申报奖项ID
...
...
@@ -56,16 +49,14 @@ public class Fc_review_record_ext implements java.io.Serializable {
/**
* 全参数构造方法
* @param id 影片ID
* @param review_id 影片性质
* @param user_id 评委ID
* @param record_id 评委评审记录ID
* @param enroll_ext_id 影片申报奖项ID
* @param enroll_ext_score 影片申报奖项评分
* @param enroll_ext_text 评委审片结论
*/
public
Fc_review_record_ext
(
Integer
id
,
Integer
re
view_id
,
Integer
user
_id
,
Integer
enroll_ext_id
,
Double
enroll_ext_score
,
String
enroll_ext_text
)
{
public
Fc_review_record_ext
(
Integer
id
,
Integer
re
cord
_id
,
Integer
enroll_ext_id
,
Double
enroll_ext_score
,
String
enroll_ext_text
)
{
this
.
id
=
id
;
this
.
review_id
=
review_id
;
this
.
user_id
=
user_id
;
this
.
record_id
=
record_id
;
this
.
enroll_ext_id
=
enroll_ext_id
;
this
.
enroll_ext_score
=
enroll_ext_score
;
this
.
enroll_ext_text
=
enroll_ext_text
;
...
...
@@ -79,20 +70,12 @@ public class Fc_review_record_ext implements java.io.Serializable {
return
id
;
}
public
void
setReview_id
(
Integer
review_id
)
{
this
.
review_id
=
review_id
;
}
public
Integer
getReview_id
()
{
return
review_id
;
}
public
void
setUser_id
(
Integer
user_id
)
{
this
.
user_id
=
user_id
;
public
void
setRecord_id
(
Integer
record_id
)
{
this
.
record_id
=
record_id
;
}
public
Integer
get
User
_id
()
{
return
user
_id
;
public
Integer
get
Record
_id
()
{
return
record
_id
;
}
public
void
setEnroll_ext_id
(
Integer
enroll_ext_id
)
{
...
...
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