Commit 8764dee7 authored by Quxl's avatar Quxl

x

parent f5364cb1
......@@ -78,7 +78,9 @@ public interface ReviewService {
List<Map<String, Object>> queryDoubtfulListByFilmIdId(Integer film_id);
Fc_review_record queryReviewRecord(Integer user_id, Integer review_id);
Fc_review_record queryCurrentReviewRecord(Integer user_id, Integer review_id);
Fc_review_record queryCurrentReviewRecord(Integer review_id);
void saveReviewRecord(Fc_review_record ru, List<Fc_review_record_ext> exts);
......@@ -137,5 +139,5 @@ public interface ReviewService {
Map<String, Object> queryFilmReport(Integer user_id);
Fc_review_record queryReviewRecord(Integer record_id);
Fc_review_record queryReviewRecordById(Integer record_id);
}
\ No newline at end of file
......@@ -252,16 +252,22 @@ public class ReviewServiceImpl implements ReviewService {
}
@Override
public Fc_review_record queryReviewRecord(Integer user_id, Integer review_id) {
public Fc_review_record queryCurrentReviewRecord(Integer user_id, Integer review_id) {
String sql = "select rr.* from fc_review_record rr, fc_review r where rr.user_id = ? and rr.review_id = ? and rr.review_id = r.id and rr.review_round = r.review_round";
return jdbcTemplate.queryForBean(sql, Fc_review_record.class, user_id, review_id);
}
@Override
public Fc_review_record queryCurrentReviewRecord(Integer review_id) {
String sql = "select rr.* from fc_review_record rr, fc_review r where rr.review_id = ? and rr.review_id = r.id and rr.review_round = r.review_round";
return jdbcTemplate.queryForBean(sql, Fc_review_record.class, review_id);
}
@Override
@Transactional
public void saveReviewRecord(Fc_review_record ru, List<Fc_review_record_ext> exts) {
Fc_review review = this.queryReviewById(ru.getReview_id());
Fc_review_record record = this.queryReviewRecord(ru.getId());
Fc_review_record record = this.queryReviewRecordById(ru.getId());
if(!ru.getReview_state().equals(record.getReview_state()) && review.getReview_round().intValue() != ru.getReview_round().intValue()) {
throw new XRException("不能修改历史审片结论");
}
......@@ -274,7 +280,7 @@ public class ReviewServiceImpl implements ReviewService {
}
@Override
public Fc_review_record queryReviewRecord(Integer record_id) {
public Fc_review_record queryReviewRecordById(Integer record_id) {
return jdbcTemplate.queryForBean("select * from fc_review_record where id = ?", Fc_review_record.class, record_id);
}
......
......@@ -176,7 +176,7 @@ public class UserReviewController {
public Object saveReviewRecord(Integer review_id, Long view_time, 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, String[] ext_title, String[] ext_type, String[] ext_name, Double[] ext_score) {
LoginToken token = tokenService.getToken();
Integer user_id = (Integer)token.getId();
Fc_review_record ru = service.queryReviewRecord(user_id, review_id);
Fc_review_record ru = service.queryCurrentReviewRecord(user_id, review_id);
ru.setView_time(view_time);
ru.setReview_score(review_score);
ru.setReview_state(review_state);
......@@ -218,9 +218,7 @@ public class UserReviewController {
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "review_id", value="审片ID"),
})
public Object saveReviewRecord(Integer review_id) {
LoginToken token = tokenService.getToken();
Integer user_id = (Integer)token.getId();
Fc_review_record record = service.queryReviewRecord(user_id, review_id);
Fc_review_record record = service.queryCurrentReviewRecord(review_id);
List<Fc_review_record_ext> extList = service.queryReviewRecordExtList(record.getId());
return Rjx.jsonOk().setData(record).set("exts", extList);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment