Commit c911daaf authored by Quxl's avatar Quxl

x

parent 5cbe42db
......@@ -90,6 +90,8 @@ public interface ReviewService {
void toNextRound(Integer review_id);
void toRound(Integer review_id, Integer review_round);
void tryNextRound(Integer review_id);
void save(Object obj);
......@@ -115,4 +117,5 @@ public interface ReviewService {
List<Map<String, Object>> queryExhibitionList(String keyword, Integer enroll_type_id, Integer film_type_name,
Integer film_type_name_short, String film_country, Integer from_round, Page page);
}
\ No newline at end of file
......@@ -354,15 +354,21 @@ public class ReviewServiceImpl implements ReviewService {
@Override
public void toNextRound(Integer review_id) {
this.toNextRound(review_id, 1);
this.toNextStepRound(review_id, 1);
}
private void toNextRound(Integer review_id, Integer step) {
public void toNextStepRound(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 + " + step + ", opt_state = 0, allot_state = ?, review_state = null, push_time = now() where id = ?", allot_state, review_id);
}
public void toRound(Integer review_id, Integer review_round) {
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 = ? and r.id = ?", review_round, review_id);
Integer allot_state = count > 0 ? 1 : 0;
jdbcTemplate.executeUpdate("update fc_review set review_round = ?, opt_state = 0, allot_state = ?, review_state = null, push_time = now() where id = ?", review_round, allot_state, review_id);
}
private Integer reviewStateElection(List<Fc_review_record> records) {
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for(Fc_review_record record : records) {
......@@ -466,7 +472,7 @@ public class ReviewServiceImpl implements ReviewService {
} else if(enroll_type_id.intValue() == 4) {//展映
if(review_round.intValue() == 2) {//二选
if(review_state.intValue() == 5) {
this.toNextRound(review.getId(), 2);
this.toNextStepRound(review.getId(), 2);
} else {
throw new XRException("展映第2轮审片结论错误");
}
......
......@@ -196,6 +196,34 @@ public class AdminReviewController {
return Rjx.jsonOk().setData(list).setPage(page);
}
@ResponseBody
@Transactional
@PostMapping("allotExhibitionRound")
@ApiOperation("展映影片分配审片环节")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_round", value="审片环节(1,2,3,4,5)"),
})
public Object allotExhibitionRound(Integer review_id, Integer review_round) {
Fc_review review = reviewService.queryReviewById(review_id);
if(review.getEnroll_type_id().intValue() == 4) {
Fc_review_history history = new Fc_review_history();
history.setReview_id(review.getId());
history.setEnroll_type_id(review.getEnroll_type_id());
history.setFilm_id(review.getFilm_id());
history.setReview_round(review_round);
history.setReview_state(review.getReview_state());
history.setCreate_time(new Date());
history.setOpt_state(review.getOpt_state());
reviewService.toRound(review_id, review_round);
reviewService.save(history);
return Rjx.jsonOk();
} else {
return Rjx.jsonErr().setMessage("展映");
}
}
@ResponseBody
@PostMapping("getReviewGroupUserList")
@ApiOperation("可分配的审片评委查询")
......@@ -297,7 +325,7 @@ public class AdminReviewController {
history.setReview_id(review.getId());
history.setEnroll_type_id(review.getEnroll_type_id());
history.setFilm_id(review.getFilm_id());
history.setReview_round(review.getReview_round());
history.setReview_round(review.getReview_round() + 1);
history.setReview_state(review.getReview_state());
history.setCreate_time(new Date());
history.setOpt_state(review.getOpt_state());
......
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