Commit b6d15859 authored by Quxl's avatar Quxl

x

parent 07427d43
...@@ -127,7 +127,7 @@ public interface FilmService { ...@@ -127,7 +127,7 @@ public interface FilmService {
* @return * @return
*/ */
List<Map<String, Object>> queryReviewList(String keyword, Integer group_id, Integer enroll_type_id, Integer film_type_name, Integer film_type_name_short, List<Map<String, Object>> queryReviewList(String keyword, Integer group_id, Integer enroll_type_id, Integer film_type_name, Integer film_type_name_short,
String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer dispute_state, Page page); String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer promotion_state, Page page);
void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id); void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id);
......
...@@ -540,7 +540,7 @@ public class FilmServiceImpl implements FilmService { ...@@ -540,7 +540,7 @@ public class FilmServiceImpl implements FilmService {
*/ */
@Override @Override
public List<Map<String, Object>> queryReviewList(String keyword, Integer group_id, Integer enroll_type_id, Integer film_type_name, public List<Map<String, Object>> queryReviewList(String keyword, Integer group_id, Integer enroll_type_id, Integer film_type_name,
Integer film_type_name_short, String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer dispute_state, Integer film_type_name_short, String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer promotion_state,
Page page) { Page page) {
SqlWhere w1 = new SqlWhere() SqlWhere w1 = new SqlWhere()
.where("mf.film_type_name in (select agft.film_type_id from fc_admin_group_filmtype agft where agft.group_id = ?)", new Object[]{group_id}) .where("mf.film_type_name in (select agft.film_type_id from fc_admin_group_filmtype agft where agft.group_id = ?)", new Object[]{group_id})
...@@ -554,7 +554,7 @@ public class FilmServiceImpl implements FilmService { ...@@ -554,7 +554,7 @@ public class FilmServiceImpl implements FilmService {
.eq("r.enroll_type_id", enroll_type_id) .eq("r.enroll_type_id", enroll_type_id)
.eq("r.review_state", review_state) .eq("r.review_state", review_state)
.eq("r.allot_state", allot_state) .eq("r.allot_state", allot_state)
.eq("r.dispute_state", dispute_state); .eq("r.promotion_state", promotion_state);
String sql = "select mf.id, mf.film_no, r.id review_id, r.review_round, r.review_state, r.enroll_type_id, mf.origion_name, mf.en_name, mf.cn_name, mf.film_type_name, mf.film_country, (select GROUP_CONCAT(mfd.playactor_name) from fc_member_film_playactor mfd where mfd.film_id = mf.id and mfd.playactor_type = 'director') director_name from fc_member_film mf, fc_review r where r.film_id = mf.id" + StringUtil.join(" and ", " and ", "", "", w1.getStringList()); String sql = "select mf.id, mf.film_no, r.id review_id, r.review_round, r.review_state, r.enroll_type_id, mf.origion_name, mf.en_name, mf.cn_name, mf.film_type_name, mf.film_country, (select GROUP_CONCAT(mfd.playactor_name) from fc_member_film_playactor mfd where mfd.film_id = mf.id and mfd.playactor_type = 'director') director_name from fc_member_film mf, fc_review r where r.film_id = mf.id" + StringUtil.join(" and ", " and ", "", "", w1.getStringList());
return jdbcTemplate.limit(sql, page, w1.getObjectList()); return jdbcTemplate.limit(sql, page, w1.getObjectList());
} }
...@@ -568,7 +568,7 @@ public class FilmServiceImpl implements FilmService { ...@@ -568,7 +568,7 @@ public class FilmServiceImpl implements FilmService {
objs[i] = new Object[]{review_id, user_id[i], review_round, review_id, user_id[i], review_round}; objs[i] = new Object[]{review_id, user_id[i], review_round, review_id, user_id[i], review_round};
} }
jdbcTemplate.batchUpdate(sql, objs); jdbcTemplate.batchUpdate(sql, objs);
jdbcTemplate.executeUpdate("update fc_review set allot_state = 1, dispute_state = 0 where review_id = ? and review_round = ?", review_id, review_round); jdbcTemplate.executeUpdate("update fc_review set allot_state = 1, promotion_state = 0 where review_id = ? and review_round = ?", review_id, review_round);
} }
@Override @Override
......
...@@ -47,7 +47,7 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -47,7 +47,7 @@ public class ReviewServiceImpl implements ReviewService {
+ "r.enroll_type_id, " + "r.enroll_type_id, "
+ "r.review_round, " + "r.review_round, "
+ "r.allot_state, " + "r.allot_state, "
+ "r.dispute_state, " + "r.promotion_state, "
+ "r.review_state, " + "r.review_state, "
+ "r.push_time, " + "r.push_time, "
+ "rr.view_state, " + "rr.view_state, "
......
...@@ -31,7 +31,7 @@ public class VoteServiceImpl implements VoteService { ...@@ -31,7 +31,7 @@ public class VoteServiceImpl implements VoteService {
review.setReview_round(1); review.setReview_round(1);
review.setPush_time(now); review.setPush_time(now);
review.setAllot_state(0); review.setAllot_state(0);
review.setDispute_state(0); review.setPromotion_state(null);
review.setReview_state(null); review.setReview_state(null);
review.setCreate_time(now); review.setCreate_time(now);
jdbcTemplate.save(review); jdbcTemplate.save(review);
...@@ -42,7 +42,7 @@ public class VoteServiceImpl implements VoteService { ...@@ -42,7 +42,7 @@ public class VoteServiceImpl implements VoteService {
public void toNextRound(Integer review_id) { public void toNextRound(Integer review_id) {
Integer count = jdbcTemplate.queryForInt("select count(*) from fc_review_record where review_id = ?", review_id); Integer count = jdbcTemplate.queryForInt("select count(*) from fc_review_record where review_id = ?", review_id);
Integer allot_state = count > 0 ? 1 : 0; Integer allot_state = count > 0 ? 1 : 0;
jdbcTemplate.executeUpdate("update fc_review set review_round = review_round + 1, allot_state = ?, dispute_state = ?, review_state = ?, push_time = ? where id = ?", allot_state, 0, null, new Date(), review_id); jdbcTemplate.executeUpdate("update fc_review set review_round = review_round + 1, allot_state = ?, review_state = ?, push_time = ? where id = ?", allot_state, null, new Date(), review_id);
} }
private Integer reviewStateElection(List<Fc_review_record> records) { private Integer reviewStateElection(List<Fc_review_record> records) {
...@@ -91,9 +91,11 @@ public class VoteServiceImpl implements VoteService { ...@@ -91,9 +91,11 @@ public class VoteServiceImpl implements VoteService {
Integer enroll_type_id = review.getEnroll_type_id(); Integer enroll_type_id = review.getEnroll_type_id();
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) return; if(review_state == null) {
return;
if(review_state == -1) { } else if(review_state == -1) {
jdbcTemplate.executeUpdate("update fc_review set promotion_state = 1 where id = ?", review.getId());
} else {
} }
......
...@@ -43,16 +43,16 @@ public class AdminReviewController { ...@@ -43,16 +43,16 @@ public class AdminReviewController {
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="review_round", value="审片当前第几轮[1,2,3,4,5,6]"), @ApiImplicitParam(paramType="query", dataType="int", required=false, name="review_round", value="审片当前第几轮[1,2,3,4,5,6]"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="review_state", value="评选状态"), @ApiImplicitParam(paramType="query", dataType="int", required=false, name="review_state", value="评选状态"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="allot_state", value="分配状态"), @ApiImplicitParam(paramType="query", dataType="int", required=false, name="allot_state", value="分配状态"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="dispute_state", value="争议状态"), @ApiImplicitParam(paramType="query", dataType="int", required=false, name="promotion_state", value="争议状态"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"), @ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"), @ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
}) })
public Object list(String keyword, Integer enroll_type_id, Integer film_type_name, Integer film_type_name_short, String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer dispute_state, Long index, Long limit) { public Object list(String keyword, Integer enroll_type_id, Integer film_type_name, Integer film_type_name_short, String film_country, Integer review_round, Integer review_state, Integer allot_state, Integer promotion_state, Long index, Long limit) {
index = index == null ? 1 : index; index = index == null ? 1 : index;
limit = limit == null ? 20 : limit; limit = limit == null ? 20 : limit;
Page page = new Page(index, limit); Page page = new Page(index, limit);
Fc_admin admin = (Fc_admin)tokenService.getTokenObj(); Fc_admin admin = (Fc_admin)tokenService.getTokenObj();
List<Map<String, Object>> list = filmService.queryReviewList(keyword, admin.getGroup_id(), enroll_type_id, film_type_name, film_type_name_short, film_country, review_round, review_state, allot_state, dispute_state, page); List<Map<String, Object>> list = filmService.queryReviewList(keyword, admin.getGroup_id(), enroll_type_id, film_type_name, film_type_name_short, film_country, review_round, review_state, allot_state, promotion_state, page);
return Rjx.jsonOk().setData(list).setPage(page); return Rjx.jsonOk().setData(list).setPage(page);
} }
......
...@@ -43,9 +43,9 @@ public class Fc_review implements java.io.Serializable { ...@@ -43,9 +43,9 @@ public class Fc_review implements java.io.Serializable {
private Integer review_state; private Integer review_state;
/** /**
* 争议状态 0无争议 1有争议 * 晋级方式 1有争议 2管理员分配
*/ */
private Integer dispute_state; private Integer promotion_state;
/** /**
* 推送时间 * 推送时间
...@@ -70,18 +70,18 @@ public class Fc_review implements java.io.Serializable { ...@@ -70,18 +70,18 @@ public class Fc_review implements java.io.Serializable {
* @param review_round 审片轮数,第几轮审片 * @param review_round 审片轮数,第几轮审片
* @param allot_state 评委分配状态 0未分配评委,1已分配评委评选中 * @param allot_state 评委分配状态 0未分配评委,1已分配评委评选中
* @param review_state 审片状态 1通过,2否决,3参赛,4参赛备选,5参展 * @param review_state 审片状态 1通过,2否决,3参赛,4参赛备选,5参展
* @param dispute_state 争议状态 0无争议 1有争议 * @param promotion_state 晋级方式 1有争议 2管理员分配
* @param push_time 推送时间 * @param push_time 推送时间
* @param create_time * @param create_time
*/ */
public Fc_review(Integer id, Integer film_id, Integer enroll_type_id, Integer review_round, Integer allot_state, Integer review_state, Integer dispute_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 promotion_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.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;
this.dispute_state = dispute_state; this.promotion_state = promotion_state;
this.push_time = push_time; this.push_time = push_time;
this.create_time = create_time; this.create_time = create_time;
} }
...@@ -134,12 +134,12 @@ public class Fc_review implements java.io.Serializable { ...@@ -134,12 +134,12 @@ public class Fc_review implements java.io.Serializable {
return review_state; return review_state;
} }
public void setDispute_state(Integer dispute_state) { public void setPromotion_state(Integer promotion_state) {
this.dispute_state = dispute_state; this.promotion_state = promotion_state;
} }
public Integer getDispute_state() { public Integer getPromotion_state() {
return dispute_state; return promotion_state;
} }
public void setPush_time(Date push_time) { public void setPush_time(Date push_time) {
......
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