Commit ae300c4a authored by Quxl's avatar Quxl

x

parent 29cc427c
......@@ -17,7 +17,6 @@ import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.FilmService;
import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_member_film;
import com.egolm.film.bean.Fc_member_film_enroll;
import com.egolm.film.bean.Fc_review;
import com.egolm.film.bean.Fc_review_doubtful;
......@@ -403,42 +402,12 @@ public class ReviewServiceImpl implements ReviewService {
return null;
}
private void transfer_4_flow_4(Fc_review review) {
Date now = new Date();
review.setFrom_round(review.getReview_round());
review.setEnroll_type_id(4);
review.setReview_round(4);
review.setPush_time(now);
review.setAllot_state(0);
review.setOpt_state(0);
review.setReview_state(null);
review.setReview_time(null);
jdbcTemplate.update(review);
}
private void transfer_4_flow_5(Fc_review review) {
Date now = new Date();
review.setFrom_round(review.getReview_round());
review.setEnroll_type_id(4);
review.setReview_round(5);
review.setPush_time(now);
review.setAllot_state(0);
review.setOpt_state(3);
review.setReview_state(1);
review.setReview_time(now);
jdbcTemplate.update(review);
}
private Integer queryRoundReviewCount(Integer review_id, Integer review_round) {
return jdbcTemplate.queryForInt("select count(*) from fc_review_history where review_id = ? and review_round = ?", review_id, review_round);
}
@Override
/**
* 1金爵 2亚新 4展映
* 1通过 2否决 3参赛 4参赛备选 5参展
* 0未评选 1有争议 2管理员分配 3审片完成
*/
@Override
@Transactional
public void tryNextRound(Integer review_id) {
Fc_review review = jdbcTemplate.queryForBean("select * from fc_review where id = ?", Fc_review.class, review_id);
......@@ -449,163 +418,16 @@ public class ReviewServiceImpl implements ReviewService {
if(review_state == null) {//未完
return;
}
if(review_state.intValue() == 2) {//否决
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, review_state = 2 where id = ?", review.getId());
} else if(review_state.intValue() == -1) {//争议
if(enroll_type_id.intValue() == 4 && review_round.intValue() == 4 && this.queryRoundReviewCount(review.getId(), review_round) >= 2) {//展映把关已经产生两次争议,需要审片委员会介入
this.toNextRound(review.getId());
} else if(enroll_type_id.intValue() == 4 && review_round.intValue() == 5) {
throw new XRException("展映影片把关存争议,选片委员会介入后不允许产生有争议结论");
if(review_round.intValue() == 5) {
throw new XRException("选片委员会不允许产生有争议结论");
} else {
jdbcTemplate.executeUpdate("update fc_review set opt_state = 1, allot_state = 0 where id = ?", review.getId());
}
} else if(review_round.intValue() == 1) {//审片第一轮都一样
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("第1轮审片结论错误,正确应为:通过,否决");
}
} else if(enroll_type_id.intValue() == 4) {//展映
if(review_round.intValue() == 2) {//二选
if(review_state.intValue() == 5) {
this.toNextStepRound(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 + "]");
}
} else if(enroll_type_id.intValue() == 2) {//亚新
if(review_round.intValue() == 2) {
if(review_state.intValue() == 3) {//参赛,等待管理员分配进入下一轮评选
jdbcTemplate.executeUpdate("update fc_review set opt_state = 2, review_state = 3 where id = ?", review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_4(review);
} else {
throw new XRException("亚新第2轮审片结论错误");
}
} else if(review_round.intValue() == 3) {
if(review_state.intValue() == 3) {//参赛,等待管理员分配进入下一轮评选
jdbcTemplate.executeUpdate("update fc_review set opt_state = 2, review_state = 3 where id = ?", review.getId());
} else {
throw new XRException("亚新第3轮审片结论错误");
}
} else if(review_round.intValue() == 4) {//把关
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("亚新第4轮审片结论错误");
}
} else if(review_round.intValue() == 5) {//选片委员会
if(review_state.intValue() == 3) {//参赛,自动进入下一轮评选
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_5(review);
} else {
throw new XRException("亚新第5轮审片结论错误");
}
} else if(review_round.intValue() == 6) {//总局审片
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("亚新第6轮审片结论错误");
}
} else {
throw new XRException("亚新审片轮数错误[" + review_round + "]");
}
} else if(enroll_type_id.intValue() == 1) {
Fc_member_film film = filmService.queryMemberFilmById(review.getFilm_id().longValue());
Integer film_type_id = Integer.valueOf(film.getFilm_type_name());
if(film_type_id == 4) {//金爵短片
if(review_round.intValue() == 2) {
if(review_state.intValue() == 3 || review_state.intValue() == 4) {//参赛 //参赛备选
this.toNextRound(review.getId());
} else {
throw new XRException("金爵短片2轮审片结论错误");
}
} else if(review_round.intValue() == 3) {
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else {
throw new XRException("金爵短片3轮审片结论错误");
}
} else if(review_round.intValue() == 4) {//把关
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("金爵短片4轮审片结论错误");
}
} else if(review_round.intValue() == 5) {//选片委员会
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_5(review);
} else {
throw new XRException("金爵短片5轮审片结论错误");
}
} else if(review_round.intValue() == 6) {//总局审片
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("金爵短片6轮审片结论错误");
}
} else {
throw new XRException("金爵短片审片轮数错误[" + review_round + "]");
}
} else {//金爵长片
if(review_round.intValue() == 2) {
if(review_state.intValue() == 3 || review_state.intValue() == 4) {//参赛 //参赛备选
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_4(review);
} else {
throw new XRException("金爵长片2轮审片结论错误");
}
} else if(review_round.intValue() == 3) {
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_4(review);
} else {
throw new XRException("金爵长片3轮审片结论错误");
}
} else if(review_round.intValue() == 4) {//把关
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("金爵长片4轮审片结论错误");
}
} else if(review_round.intValue() == 5) {//选片委员会
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_5(review);
} else {
throw new XRException("金爵长片5轮审片结论错误");
}
} else if(review_round.intValue() == 6) {//总局审片
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("金爵长片6轮审片结论错误");
}
} else {
throw new XRException("金爵长片审片轮数错误[" + review_round + "]");
}
}
} else {
jdbcTemplate.executeUpdate("update fc_review set opt_state = 2, review_state = ? where id = ?", review_state, review.getId());
}
Integer opt_state = jdbcTemplate.queryForInt("select opt_state from fc_review where id = ?", review.getId());
Fc_review_history history = new Fc_review_history();
......
/**
* 1金爵 2亚新 4展映
* 1通过 2否决 3参赛 4参赛备选 5参展
* 0未评选 1有争议 2管理员分配 3审片完成
*/
@Override
@Transactional
public void tryNextRound(Integer review_id) {
Fc_review review = jdbcTemplate.queryForBean("select * from fc_review where id = ?", Fc_review.class, review_id);
List<Fc_review_record> records = jdbcTemplate.queryForBeans("select * from fc_review_record where review_id = ? and review_round = ?", Fc_review_record.class, review.getId(), review.getReview_round());
Integer review_round = review.getReview_round();
Integer enroll_type_id = review.getEnroll_type_id();
Integer review_state = this.reviewStateElection(records);
if(review_state == null) {//未完
return;
}
if(review_state.intValue() == 2) {//否决
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, review_state = 2 where id = ?", review.getId());
} else if(review_state.intValue() == -1) {//争议
if(enroll_type_id.intValue() == 4 && review_round.intValue() == 4 && this.queryRoundReviewCount(review.getId(), review_round) >= 2) {//展映把关已经产生两次争议,需要审片委员会介入
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());
}
} else if(review_round.intValue() == 1) {//审片第一轮都一样
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("第1轮审片结论错误,正确应为:通过,否决");
}
} else if(enroll_type_id.intValue() == 4) {//展映
if(review_round.intValue() == 2) {//二选
if(review_state.intValue() == 5) {
this.toNextStepRound(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 + "]");
}
} else if(enroll_type_id.intValue() == 2) {//亚新
if(review_round.intValue() == 2) {
if(review_state.intValue() == 3) {//参赛,等待管理员分配进入下一轮评选
jdbcTemplate.executeUpdate("update fc_review set opt_state = 2, review_state = 3 where id = ?", review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_4(review);
} else {
throw new XRException("亚新第2轮审片结论错误");
}
} else if(review_round.intValue() == 3) {
if(review_state.intValue() == 3) {//参赛,等待管理员分配进入下一轮评选
jdbcTemplate.executeUpdate("update fc_review set opt_state = 2, review_state = 3 where id = ?", review.getId());
} else {
throw new XRException("亚新第3轮审片结论错误");
}
} else if(review_round.intValue() == 4) {//把关
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("亚新第4轮审片结论错误");
}
} else if(review_round.intValue() == 5) {//选片委员会
if(review_state.intValue() == 3) {//参赛,自动进入下一轮评选
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_5(review);
} else {
throw new XRException("亚新第5轮审片结论错误");
}
} else if(review_round.intValue() == 6) {//总局审片
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("亚新第6轮审片结论错误");
}
} else {
throw new XRException("亚新审片轮数错误[" + review_round + "]");
}
} else if(enroll_type_id.intValue() == 1) {
Fc_member_film film = filmService.queryMemberFilmById(review.getFilm_id().longValue());
Integer film_type_id = Integer.valueOf(film.getFilm_type_name());
if(film_type_id == 4) {//金爵短片
if(review_round.intValue() == 2) {
if(review_state.intValue() == 3 || review_state.intValue() == 4) {//参赛 //参赛备选
this.toNextRound(review.getId());
} else {
throw new XRException("金爵短片2轮审片结论错误");
}
} else if(review_round.intValue() == 3) {
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else {
throw new XRException("金爵短片3轮审片结论错误");
}
} else if(review_round.intValue() == 4) {//把关
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("金爵短片4轮审片结论错误");
}
} else if(review_round.intValue() == 5) {//选片委员会
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_5(review);
} else {
throw new XRException("金爵短片5轮审片结论错误");
}
} else if(review_round.intValue() == 6) {//总局审片
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("金爵短片6轮审片结论错误");
}
} else {
throw new XRException("金爵短片审片轮数错误[" + review_round + "]");
}
} else {//金爵长片
if(review_round.intValue() == 2) {
if(review_state.intValue() == 3 || review_state.intValue() == 4) {//参赛 //参赛备选
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_4(review);
} else {
throw new XRException("金爵长片2轮审片结论错误");
}
} else if(review_round.intValue() == 3) {
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_4(review);
} else {
throw new XRException("金爵长片3轮审片结论错误");
}
} else if(review_round.intValue() == 4) {//把关
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("金爵长片4轮审片结论错误");
}
} else if(review_round.intValue() == 5) {//选片委员会
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_flow_5(review);
} else {
throw new XRException("金爵长片5轮审片结论错误");
}
} else if(review_round.intValue() == 6) {//总局审片
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("金爵长片6轮审片结论错误");
}
} else {
throw new XRException("金爵长片审片轮数错误[" + review_round + "]");
}
}
}
Integer opt_state = jdbcTemplate.queryForInt("select opt_state from fc_review where id = ?", review.getId());
Fc_review_history history = new Fc_review_history();
history.setReview_id(review.getId());
history.setEnroll_type_id(enroll_type_id);
history.setFilm_id(review.getFilm_id());
history.setReview_round(review_round);
history.setReview_state(review_state);
history.setCreate_time(new Date());
history.setOpt_state(opt_state);
jdbcTemplate.save(history);
}
\ No newline at end of file
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