Commit 68c6c798 authored by Quxl's avatar Quxl

x

parent e7969977
......@@ -42,7 +42,7 @@ public interface ReviewService {
Integer opt_state,
Page page);
List<Map<String, Object>> queryBestMvListByGroup(String keyword, Integer user_group_id, Integer review_round, String ext_type, Page page);
List<Map<String, Object>> queryBestMvListByGroup(String keyword, Integer user_group_id, Integer review_round, Page page);
/**
* 查询评委审片列表
......@@ -125,5 +125,7 @@ public interface ReviewService {
List<Map<String, Object>> queryShowFilmUserListByReviewId(Integer review_id);
void deleteAsiaNewReport(int review_id, int review_round);
}
\ No newline at end of file
......@@ -138,9 +138,10 @@ public class ReviewServiceImpl implements ReviewService {
}
@Override
public List<Map<String, Object>> queryBestMvListByGroup(String keyword, Integer user_group_id, Integer review_round, String ext_type, Page page) {
public List<Map<String, Object>> queryBestMvListByGroup(String keyword, Integer user_group_id, Integer review_round, Page page) {
XRException.assertNotBlank("选片轮数不能为空", review_round);
String sql = "select ran.*, mf.film_no from fc_report_asia_new ran left join fc_member_film mf on mf.id = ran.film_id where ran.user_group_id = " + user_group_id + " and ran.review_round = " + review_round + (StringUtil.isNotBlank(ext_type) ? (" and ran.item_" + ext_type + " is not null") : "");
XRException.assertNotBlank("评委组不能为空", user_group_id);
String sql = "select ran.*, mf.film_no from fc_report_asia_new ran left join fc_member_film mf on mf.id = ran.film_id where ran.user_group_id = " + user_group_id + " and ran.review_round = " + review_round;
return jdbcTemplate.limit(sql, page);
}
......@@ -361,6 +362,9 @@ public class ReviewServiceImpl implements ReviewService {
int reviewRound = review.getReview_round().intValue();
int enrollType = review.getEnroll_type_id().intValue();
int reviewState = this.toReviewState(records);
if(enrollType == 2 && (reviewRound == 2 || reviewRound == 3)) {
this.createAsiaNewReport(review.getId().intValue(), reviewRound);
}
if(reviewState == 0) {
return;
}
......@@ -368,9 +372,6 @@ public class ReviewServiceImpl implements ReviewService {
jdbcTemplate.executeUpdate("update fc_review set opt_state = 3, review_state = 2 where id = ?", review.getId());
} else if(reviewState == -1) {//争议
jdbcTemplate.executeUpdate("update fc_review set opt_state = 1, allot_state = 0 where id = ?", review.getId());
if(enrollType == 2 && (reviewRound == 2 || reviewRound == 3)) {
this.createAsiaNewReport(review.getId().intValue(), reviewRound);
}
} else {
jdbcTemplate.executeUpdate("update fc_review set opt_state = 2, review_state = ? where id = ?", reviewState, review.getId());
if(enrollType == 1) {
......@@ -392,9 +393,6 @@ public class ReviewServiceImpl implements ReviewService {
this.closeFlow(1, review.getId());
}
}
if(enrollType == 2 && (reviewRound == 2 || reviewRound == 3)) {
this.createAsiaNewReport(review.getId().intValue(), reviewRound);
}
}
Integer opt_state = jdbcTemplate.queryForInt("select opt_state from fc_review where id = ?", review.getId());
Fc_review_history history = new Fc_review_history();
......@@ -408,6 +406,11 @@ public class ReviewServiceImpl implements ReviewService {
jdbcTemplate.save(history);
}
@Override
public void deleteAsiaNewReport(int review_id, int review_round) {
jdbcTemplate.executeUpdate("delete from fc_report_asia_new where review_id = ? and review_round = ?", review_id, review_round);
}
public void createAsiaNewReport(int review_id, int review_round) {
Fc_review review = jdbcTemplate.queryForBean("select * from fc_review where id = ?", Fc_review.class, review_id);
int enrollType = review.getEnroll_type_id();
......@@ -475,7 +478,7 @@ public class ReviewServiceImpl implements ReviewService {
throw new XException("生成亚新榜单中间结果错误", e);
}
}
jdbcTemplate.executeUpdate("delete from fc_report_asia_new where review_id = ?", asiaNew.getReview_id());
jdbcTemplate.executeUpdate("delete from fc_report_asia_new where review_id = ? and review_round = ? and user_group_id = ?", asiaNew.getReview_id(), asiaNew.getReview_round(), asiaNew.getUser_group_id());
jdbcTemplate.save(asiaNew);
}
}
......@@ -660,7 +663,6 @@ public class ReviewServiceImpl implements ReviewService {
@Override
public void toType4(Integer review_id) {
jdbcTemplate.executeUpdate("delete from fc_report_asia_new where review_id = ?", review_id);
jdbcTemplate.executeUpdate("update fc_review set enroll_type_id = 4 where id = ?", review_id);
}
......
......@@ -153,7 +153,7 @@ public class AdminReviewController {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit, limitKey);
List<Map<String, Object>> list = reviewService.queryBestMvListByGroup(keyword, user_group_id, review_round, ext_type, page);
List<Map<String, Object>> list = reviewService.queryBestMvListByGroup(keyword, user_group_id, review_round, page);
return Rjx.jsonOk().setData(list).setPage(page);
}
......@@ -288,6 +288,7 @@ public class AdminReviewController {
boolean isAsia2Round = enrollType == 2 && reviewRound == 2;
if(reviewState == 5 && (isJinJue23Round || isAsia2Round)) {//金爵二选三选或亚新二选转参赛影片把关流程
reviewService.toType4(review.getId());
reviewService.deleteAsiaNewReport(review_id, reviewRound);
reviewService.toRound(review.getId(), 4);
} else {
reviewService.toRound(review_id, toRoundNumber);
......
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