Commit a98d4376 authored by Quxl's avatar Quxl

x

parent 3b6666e2
......@@ -87,5 +87,5 @@ public interface ReviewService {
void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id);
void deleteDoubtfulById(Integer id);
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ 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;
......@@ -30,6 +31,9 @@ public class ReviewServiceImpl implements ReviewService {
@Autowired
JdbcTemplate jdbcTemplate;
@Autowired
FilmService filmService;
@Override
public List<Map<String, Object>> queryReviewListForAdmin(
......@@ -228,9 +232,25 @@ public class ReviewServiceImpl implements ReviewService {
public void toFirstRound(Long member_film_id) {
Integer count = jdbcTemplate.queryForInt("select count(id) from fc_review where film_id = ?", member_film_id);
if(count == 0) {
List<Fc_member_film_enroll> enrolls = filmService.queryFilmEnrollList(member_film_id);
Integer enroll_type_id = null;
for(Fc_member_film_enroll enroll : enrolls) {
Integer enroll_type_id_tmp = enroll.getEnroll_type_id();
if(enroll_type_id_tmp == 1 || enroll_type_id_tmp == 2) {
if(enroll_type_id == null || enroll_type_id == enroll_type_id_tmp) {
enroll_type_id = enroll_type_id_tmp;
} else {
throw new XRException("申报影片" + member_film_id + "中同时包含亚新和金爵流程");
}
}
}
if(enroll_type_id == null) {
enroll_type_id = 4;
}
Date now = new Date();
Fc_review review = new Fc_review();
review.setFilm_id(member_film_id.intValue());
review.setEnroll_type_id(enroll_type_id);
review.setReview_round(1);
review.setPush_time(now);
review.setAllot_state(0);
......@@ -294,52 +314,166 @@ public class ReviewServiceImpl implements ReviewService {
System.out.println(new ReviewServiceImpl().reviewStateElection(records));
}
@Autowired
FilmService filmService;
private void transfer_4_Flow(Fc_review review) {
Date now = new Date();
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, review_state = 2 where id = ?", review.getId());
Fc_review review_new = new Fc_review();
review_new.setFilm_id(review.getFilm_id());
review_new.setEnroll_type_id(4);
review_new.setReview_round(1);
review_new.setPush_time(now);
review_new.setAllot_state(0);
review_new.setOpt_state(0);
review_new.setReview_state(null);
review_new.setCreate_time(now);
jdbcTemplate.save(review);
}
@Override
/**
* 1金爵 2亚新 4展映
* 1通过 2否决 3参赛 4参赛备选 5参展
* 0未评选 1有争议 2管理员分配 3审片完成
*/
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());
List<Fc_member_film_enroll> enrolls = filmService.queryFilmEnrollList(review.getFilm_id().longValue());
Integer flowNumber = null;
for(Fc_member_film_enroll enroll : enrolls) {
Integer enroll_type_id = enroll.getEnroll_type_id();
if(enroll_type_id == 1 || enroll_type_id == 2) {
if(flowNumber == null || flowNumber == enroll_type_id) {
flowNumber = enroll_type_id;
} else {
throw new XRException("申报影片" + review.getFilm_id() + "中同时包含亚新和金爵流程");
}
}
}
if(flowNumber == null) {
flowNumber = 4;
}
Integer review_round = review.getReview_round();
Integer review_state = this.reviewStateElection(records);
if(review_state == null) {
//没有审完
if(review_state == null) {//未完
return;
}
Integer enroll_type_id = review.getEnroll_type_id();
if(review_state.intValue() == 2) {//否决
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, review_state = 2 where id = ?", review.getId());
return;
} else if(review_state == -1) {
//审片结果有争议,等待增加新评委或管理员决定本轮最终结果
}
if(review_state.intValue() == -1) {//争议
jdbcTemplate.executeUpdate("update fc_review set opt_state = 1 where id = ?", review.getId());
} else if(flowNumber.intValue() == 4 && review_round == 2) {
//展映第二轮评选完成(最后一轮)
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, allot_state = 0 where id = ?", review.getId());
} else if(flowNumber.intValue() == 2 && (review_round == 2 || review_round == 3)) {
//理员决定是否晋级下一轮评选
jdbcTemplate.executeUpdate("update fc_review set opt_state = 2 where id = ?", review.getId());
} else {
if(review_round == 6) {
//已经是最后一轮评选
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, allot_state = 0 where id = ?", review.getId());
} else {
//自动进入下一轮评选
return;
}
if(review_round.intValue() == 1) {//审片第一轮都一样
if(review_state.intValue() == 1) {
this.toNextRound(review.getId());
} else {
throw new XRException("第1轮审片结论错误,正确应为:通过,否决");
}
return;
}
if(enroll_type_id.intValue() == 4) {//展映
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());
} else {
throw new XRException("展映第2轮审片结论错误");
}
} else {
throw new XRException("展映只有2轮审片流程");
}
return;
}
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(review);
} else {
throw new XRException("亚新第2轮审片结论错误");
}
} else if(review_round.intValue() == 3) {
if(review_state.intValue() == 1) {//第三轮通过,自动进入下一轮评选
this.toNextRound(review.getId());
} else {
throw new XRException("亚新第3轮审片结论错误");
}
} else if(review_round.intValue() == 4) {
if(review_state.intValue() == 3) {//参赛,自动进入下一轮评选
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_Flow(review);
} 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轮审片结论错误");
}
}
return;
}
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() == 3) {
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_Flow(review);
} 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 {//金爵长片
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(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(review);
} else {
throw new XRException("金爵长片3轮审片结论错误");
}
} else if(review_round.intValue() == 4) {
if(review_state.intValue() == 3) {
this.toNextRound(review.getId());
} else if(review_state.intValue() == 5) {//参展,结束当前流程,启动新参展流程
this.transfer_4_Flow(review);
} 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轮审片结论错误");
}
}
}
return;
}
}
@Override
......@@ -362,4 +496,5 @@ public class ReviewServiceImpl implements ReviewService {
public void deleteDoubtfulById(Integer id) {
jdbcTemplate.executeUpdate("delete from fc_review_doubtful where id = ?", id);
}
}
}
\ No newline at end of file
......@@ -121,7 +121,6 @@ public class UserReviewController {
@ApiOperation("评委审片")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "review_id", value="审片ID"),
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "review_state", value="审片状态 1通过,2否决,3参赛,4参赛备选,5参展"),
@ApiImplicitParam(paramType = "query", dataType = "double", required = false, name = "review_score", value="评分"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "review_text", value="评语"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "review_text_1", value="评语1"),
......@@ -130,7 +129,6 @@ public class UserReviewController {
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "review_text_4", value="评语4"),
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, allowMultiple=true, name = "enroll_ext_id", value="才赛奖项ID"),
@ApiImplicitParam(paramType = "query", dataType = "double", required = false, allowMultiple=true, name = "enroll_ext_score", value="才赛奖项得分"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, allowMultiple=true, name = "enroll_ext_text", value="才赛奖项评语"),
})
public Object saveReviewRecord(Integer review_id, 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, Integer[] enroll_ext_id, Double[]enroll_ext_score, String[] enroll_ext_text) {
LoginToken token = tokenService.getToken();
......
......@@ -22,6 +22,11 @@ public class Fc_review implements java.io.Serializable {
*/
private Integer film_id;
/**
* 影片性质
*/
private Integer enroll_type_id;
/**
* 审片轮数,第几轮审片
*/
......@@ -61,6 +66,7 @@ public class Fc_review implements java.io.Serializable {
* 全参数构造方法
* @param id
* @param film_id 参审影片ID
* @param enroll_type_id 影片性质
* @param review_round 审片轮数,第几轮审片
* @param allot_state 评委分配状态 0未分配评委 1已分配评委评选中
* @param review_state 审片结论 1通过 2否决 3参赛 4参赛备选 5参展
......@@ -68,9 +74,10 @@ public class Fc_review implements java.io.Serializable {
* @param push_time 推送时间
* @param create_time
*/
public Fc_review(Integer id, Integer film_id, Integer review_round, Integer allot_state, Integer review_state, Integer opt_state, Date push_time, Date create_time) {
public Fc_review(Integer id, Integer film_id, Integer enroll_type_id, Integer review_round, Integer allot_state, Integer review_state, Integer opt_state, Date push_time, Date create_time) {
this.id = id;
this.film_id = film_id;
this.enroll_type_id = enroll_type_id;
this.review_round = review_round;
this.allot_state = allot_state;
this.review_state = review_state;
......@@ -95,6 +102,14 @@ public class Fc_review implements java.io.Serializable {
return film_id;
}
public void setEnroll_type_id(Integer enroll_type_id) {
this.enroll_type_id = enroll_type_id;
}
public Integer getEnroll_type_id() {
return enroll_type_id;
}
public void setReview_round(Integer review_round) {
this.review_round = 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