Commit c385d3de authored by Quxl's avatar Quxl

x

parent 25a3023d
......@@ -235,7 +235,7 @@ public class ReviewServiceImpl implements ReviewService {
return jdbcTemplate.queryForList(sql, review_id);
}
@Override
@Override
@Transactional
public void toFirstRound(Long member_film_id) {
Integer count = jdbcTemplate.queryForInt("select count(id) from fc_review where film_id = ?", member_film_id);
......@@ -273,9 +273,13 @@ public class ReviewServiceImpl implements ReviewService {
@Override
public void toNextRound(Integer review_id) {
Integer count = jdbcTemplate.queryForInt("select count(rr.id) from fc_review_record rr, fc_review r where rr.review_id = r.id and rr.review_round = (r.review_round + 1) and r.id = ?", review_id);
this.toNextRound(review_id, 1);
}
private void toNextRound(Integer review_id, Integer step) {
Integer count = jdbcTemplate.queryForInt("select count(rr.id) from fc_review_record rr, fc_review r where rr.review_id = r.id and rr.review_round = (r.review_round + " + step + ") and r.id = ?", review_id);
Integer allot_state = count > 0 ? 1 : 0;
jdbcTemplate.executeUpdate("update fc_review set review_round = review_round + 1, opt_state = 0, allot_state = ?, review_state = null, push_time = now() where id = ?", allot_state, review_id);
jdbcTemplate.executeUpdate("update fc_review set review_round = review_round + " + step + ", opt_state = 0, allot_state = ?, review_state = null, push_time = now() where id = ?", allot_state, review_id);
}
private Integer reviewStateElection(List<Fc_review_record> records) {
......@@ -337,6 +341,10 @@ public class ReviewServiceImpl implements ReviewService {
jdbcTemplate.save(review);
}
private Integer queryUserCount(Integer review_id, Integer review_round) {
return jdbcTemplate.queryForInt("select count(*) from fc_review_round where review_id = ? and review_round = ?", review_id, review_round);
}
@Override
/**
* 1金爵 2亚新 4展映
......@@ -358,7 +366,13 @@ public class ReviewServiceImpl implements ReviewService {
return;
}
if(review_state.intValue() == -1) {//争议
jdbcTemplate.executeUpdate("update fc_review set opt_state = 1 where id = ?", review.getId());
if(enroll_type_id.intValue() == 4 && review_round.intValue() == 4 && this.queryUserCount(review.getId(), review_round) >= 4) {
this.toNextRound(review.getId());
} else if(enroll_type_id.intValue() == 4 && review_round.intValue() == 5) {
throw new XRException("展映影片把关存争议,选片委员会介入后不允许产生有争议结论");
} else {
jdbcTemplate.executeUpdate("update fc_review set opt_state = 1, allot_state = 0 where id = ?", review.getId());
}
return;
}
if(review_round.intValue() == 1) {//审片第一轮都一样
......@@ -371,12 +385,24 @@ public class ReviewServiceImpl implements ReviewService {
}
if(enroll_type_id.intValue() == 4) {//展映
if(review_round.intValue() == 2) {
if(review_round.intValue() == 2) {//二选
if(review_state.intValue() == 1) {
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, review_state = 1 where id = ?", review.getId());
this.toNextRound(review.getId(), 2);
} else {
throw new XRException("展映第2轮审片结论错误");
}
} else if(review_round.intValue() == 4) {//把关
if(review_state.intValue() == 1) {
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, review_state = 1 where id = ?", review.getId());
} else {
throw new XRException("展映第4轮审片结论错误");
}
} else if(review_round.intValue() == 5) {//选片委员会
if(review_state.intValue() == 1) {
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, review_state = 1 where id = ?", review.getId());
} else {
throw new XRException("展映第5轮审片结论错误");
}
} else {
throw new XRException("展映审片轮数错误[" + review_round + "]");
}
......
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