Commit 85939284 authored by Quxl's avatar Quxl

x

parent 32abe2a1
...@@ -457,13 +457,13 @@ public class FilmServiceImpl implements FilmService { ...@@ -457,13 +457,13 @@ public class FilmServiceImpl implements FilmService {
@Override @Override
@Transactional @Transactional
public void toNextRound(Long member_film_id, Integer enroll_type_id) { public void toNextRound(Long member_film_id, Integer enroll_type_id) {
Fc_review reviewTmp = jdbcTemplate.queryForBean("select * from fc_review where film_id = ? and enroll_type_id = ?", Fc_review.class, member_film_id, enroll_type_id); Fc_review reviewTmp = null;
Integer round = reviewTmp.getReview_round();
Integer nextRound = null; Integer nextRound = null;
if(round == null || round == 0) { try {
reviewTmp = jdbcTemplate.queryForBean("select * from fc_review where film_id = ? and enroll_type_id = ?", Fc_review.class, member_film_id, enroll_type_id);
nextRound = reviewTmp.getReview_round() == null ? 1 : (reviewTmp.getReview_round()+1);
} catch (Exception e) {
nextRound = 1; nextRound = 1;
} else {
nextRound = round + 1;
} }
jdbcTemplate.executeUpdate("update fc_member_film_enroll set review_round = ? where film_id = ? and enroll_type_id = ?", nextRound, member_film_id, enroll_type_id); jdbcTemplate.executeUpdate("update fc_member_film_enroll set review_round = ? where film_id = ? and enroll_type_id = ?", nextRound, member_film_id, enroll_type_id);
Integer count = jdbcTemplate.queryForInt("select count(id) from fc_review where film_id = ? and review_round = ? and enroll_type_id = ?", member_film_id, nextRound, enroll_type_id); Integer count = jdbcTemplate.queryForInt("select count(id) from fc_review where film_id = ? and review_round = ? and enroll_type_id = ?", member_film_id, nextRound, enroll_type_id);
......
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