Commit 4193b2c9 authored by Quxl's avatar Quxl

x

parent 0cec4ad5
...@@ -78,7 +78,7 @@ public interface ReviewService { ...@@ -78,7 +78,7 @@ public interface ReviewService {
List<Map<String, Object>> queryReviewRecordList(Integer review_id); List<Map<String, Object>> queryReviewRecordList(Integer review_id);
void toFirstRound(Long member_film_id, Integer enroll_type_id); void toFirstRound(Long member_film_id);
void toNextRound(Integer review_id); void toNextRound(Integer review_id);
......
...@@ -15,7 +15,9 @@ import com.egolm.common.DateUtil; ...@@ -15,7 +15,9 @@ import com.egolm.common.DateUtil;
import com.egolm.common.StringUtil; import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.FilmService;
import com.egolm.film.api.service.ReviewService; import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_member_film_enroll;
import com.egolm.film.bean.Fc_review; import com.egolm.film.bean.Fc_review;
import com.egolm.film.bean.Fc_review_doubtful; import com.egolm.film.bean.Fc_review_doubtful;
import com.egolm.film.bean.Fc_review_record; import com.egolm.film.bean.Fc_review_record;
...@@ -223,12 +225,11 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -223,12 +225,11 @@ public class ReviewServiceImpl implements ReviewService {
@Override @Override
@Transactional @Transactional
public void toFirstRound(Long member_film_id, Integer enroll_type_id) { public void toFirstRound(Long member_film_id) {
Integer count = jdbcTemplate.queryForInt("select count(id) from fc_review where film_id = ?", member_film_id); Integer count = jdbcTemplate.queryForInt("select count(id) from fc_review where film_id = ?", member_film_id);
if(count == 0) { if(count == 0) {
Date now = new Date(); Date now = new Date();
Fc_review review = new Fc_review(); Fc_review review = new Fc_review();
review.setEnroll_type_id(enroll_type_id);
review.setFilm_id(member_film_id.intValue()); review.setFilm_id(member_film_id.intValue());
review.setReview_round(1); review.setReview_round(1);
review.setPush_time(now); review.setPush_time(now);
...@@ -293,11 +294,29 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -293,11 +294,29 @@ public class ReviewServiceImpl implements ReviewService {
System.out.println(new ReviewServiceImpl().reviewStateElection(records)); System.out.println(new ReviewServiceImpl().reviewStateElection(records));
} }
@Autowired
FilmService filmService;
@Override @Override
public void tryNextRound(Integer review_id) { public void tryNextRound(Integer review_id) {
Fc_review review = jdbcTemplate.queryForBean("select * from fc_review where id = ?", Fc_review.class, 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_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 enroll_type_id = review.getEnroll_type_id();
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_round = review.getReview_round();
Integer review_state = this.reviewStateElection(records); Integer review_state = this.reviewStateElection(records);
if(review_state == null) { if(review_state == null) {
...@@ -306,7 +325,7 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -306,7 +325,7 @@ public class ReviewServiceImpl implements ReviewService {
} else if(review_state == -1) { } else if(review_state == -1) {
//审片结果有争议,等待增加新评委或管理员决定本轮最终结果 //审片结果有争议,等待增加新评委或管理员决定本轮最终结果
jdbcTemplate.executeUpdate("update fc_review set opt_state = 1 where id = ?", review.getId()); jdbcTemplate.executeUpdate("update fc_review set opt_state = 1 where id = ?", review.getId());
} else if((enroll_type_id.intValue() == 2 || enroll_type_id.intValue() == 4) && (review_round == 2 || review_round == 3)) { } else if((flowNumber.intValue() == 2 || flowNumber.intValue() == 4) && (review_round == 2 || review_round == 3)) {
//理员决定是否晋级下一轮评选 //理员决定是否晋级下一轮评选
jdbcTemplate.executeUpdate("update fc_review set opt_state = 2 where id = ?", review.getId()); jdbcTemplate.executeUpdate("update fc_review set opt_state = 2 where id = ?", review.getId());
} else { } else {
......
...@@ -22,8 +22,6 @@ import com.egolm.film.api.service.EmailService; ...@@ -22,8 +22,6 @@ import com.egolm.film.api.service.EmailService;
import com.egolm.film.api.service.FilmService; import com.egolm.film.api.service.FilmService;
import com.egolm.film.api.service.ReviewService; import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_member_film; import com.egolm.film.bean.Fc_member_film;
import com.egolm.film.bean.Fc_member_film_enroll;
import com.egolm.film.config.XRException;
import com.egolm.film.model.LoginToken; import com.egolm.film.model.LoginToken;
import com.egolm.film.util.Common; import com.egolm.film.util.Common;
...@@ -127,24 +125,7 @@ public class AdminFirstController { ...@@ -127,24 +125,7 @@ public class AdminFirstController {
film.setFilm_type_name_short(film_type_name_short); film.setFilm_type_name_short(film_type_name_short);
memberFilmService.mergeMemberFilm(film); memberFilmService.mergeMemberFilm(film);
memberFilmService.pass(member_film_id); memberFilmService.pass(member_film_id);
List<Fc_member_film_enroll> enrolls = memberFilmService.queryFilmEnrollList(member_film_id); reviewService.toFirstRound(member_film_id);
Integer enroll_1_2 = 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(enroll_1_2 == null || enroll_1_2 == enroll_type_id) {
enroll_1_2 = enroll_type_id;
} else {
throw new XRException("申报影片" + member_film_id + "中同时包含亚新和金爵流程");
}
}
}
if(enroll_1_2 != null) {
reviewService.toFirstRound(member_film_id, enroll_1_2);
} else {
reviewService.toFirstRound(member_film_id, 4);
}
Map<String, Object> map = emailService.sendByTemplate_01(member_film_id, "doc/first_pass"); Map<String, Object> map = emailService.sendByTemplate_01(member_film_id, "doc/first_pass");
Rjx rjx = Rjx.jsonOk(); Rjx rjx = Rjx.jsonOk();
rjx.putAll(map); rjx.putAll(map);
......
...@@ -56,25 +56,9 @@ public class WebUtilController { ...@@ -56,25 +56,9 @@ public class WebUtilController {
jdbcTemplate.executeUpdate("delete from fc_review_record_ext"); jdbcTemplate.executeUpdate("delete from fc_review_record_ext");
List<Fc_member_film> films = jdbcTemplate.queryForBeans("select * from fc_member_film where apply_state = 2", Fc_member_film.class); List<Fc_member_film> films = jdbcTemplate.queryForBeans("select * from fc_member_film where apply_state = 2", Fc_member_film.class);
for(Fc_member_film film : films) { for(Fc_member_film film : films) {
Integer enroll_1_2 = null;
String enroll_type_name = film.getEnroll_type_name(); String enroll_type_name = film.getEnroll_type_name();
if(enroll_type_name != null && enroll_type_name.length() > 0) { if(enroll_type_name != null && enroll_type_name.length() > 0) {
String[] enrolls = enroll_type_name.split(","); service.toFirstRound(film.getId());
for(String enroll_str : enrolls) {
Integer enroll_type_id = Integer.valueOf(enroll_str);
if(enroll_type_id == 1 || enroll_type_id == 2) {
if(enroll_1_2 == null) {
enroll_1_2 = enroll_type_id;
} else {
logger.error("申报影片" + film.getId() + "中同时包含亚新和金爵流程");
}
}
}
if(enroll_1_2 != null) {
service.toFirstRound(film.getId(), enroll_1_2);
} else {
service.toFirstRound(film.getId(), 4);
}
} }
} }
return Rjx.jsonOk(); return Rjx.jsonOk();
......
...@@ -22,11 +22,6 @@ public class Fc_review implements java.io.Serializable { ...@@ -22,11 +22,6 @@ public class Fc_review implements java.io.Serializable {
*/ */
private Integer film_id; private Integer film_id;
/**
* 影片性质(申报奖项)ID
*/
private Integer enroll_type_id;
/** /**
* 审片轮数,第几轮审片 * 审片轮数,第几轮审片
*/ */
...@@ -77,7 +72,6 @@ public class Fc_review implements java.io.Serializable { ...@@ -77,7 +72,6 @@ public class Fc_review implements java.io.Serializable {
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) { 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.id = id;
this.film_id = film_id; this.film_id = film_id;
this.enroll_type_id = enroll_type_id;
this.review_round = review_round; this.review_round = review_round;
this.allot_state = allot_state; this.allot_state = allot_state;
this.review_state = review_state; this.review_state = review_state;
...@@ -102,14 +96,6 @@ public class Fc_review implements java.io.Serializable { ...@@ -102,14 +96,6 @@ public class Fc_review implements java.io.Serializable {
return film_id; 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) { public void setReview_round(Integer review_round) {
this.review_round = 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