Commit a9f15216 authored by Quxl's avatar Quxl

x

parent 77871dd2
...@@ -91,5 +91,7 @@ public interface ReviewService { ...@@ -91,5 +91,7 @@ public interface ReviewService {
void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id); void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id);
void deleteDoubtfulById(Integer id); void deleteDoubtfulById(Integer id);
Fc_review_record queryReviewRecord(Integer record_id);
} }
\ No newline at end of file
...@@ -574,4 +574,9 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -574,4 +574,9 @@ public class ReviewServiceImpl implements ReviewService {
jdbcTemplate.executeUpdate("delete from fc_review_doubtful where id = ?", id); jdbcTemplate.executeUpdate("delete from fc_review_doubtful where id = ?", id);
} }
@Override
public Fc_review_record queryReviewRecord(Integer record_id) {
return jdbcTemplate.queryForBean("select * from fc_review_record where id = ?", Fc_review_record.class, record_id);
}
} }
\ No newline at end of file
package com.egolm.film.api.web.admin; package com.egolm.film.api.web.admin;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -16,6 +18,10 @@ import com.egolm.film.api.service.AdminUserService; ...@@ -16,6 +18,10 @@ import com.egolm.film.api.service.AdminUserService;
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_admin; import com.egolm.film.bean.Fc_admin;
import com.egolm.film.bean.Fc_review_record;
import com.egolm.film.bean.Fc_review_record_ext;
import com.egolm.film.config.XException;
import com.egolm.film.model.LoginToken;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -145,4 +151,61 @@ public class AdminReviewController { ...@@ -145,4 +151,61 @@ public class AdminReviewController {
return Rjx.jsonOk().setData(list); return Rjx.jsonOk().setData(list);
} }
@ResponseBody
@Transactional
@PostMapping("getReviewRecord")
@ApiOperation("查询审片详情")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "review_id", value="审片ID"),
})
public Object saveReviewRecord(Integer review_id) {
LoginToken token = tokenService.getToken();
Integer user_id = (Integer)token.getId();
Fc_review_record record = reviewService.queryReviewRecord(user_id, review_id);
List<Fc_review_record_ext> extList = reviewService.queryReviewRecordExtList(record.getId());
return Rjx.jsonOk().setData(record).set("exts", extList);
}
@ResponseBody
@Transactional
@PostMapping("saveReviewRecord")
@ApiOperation("评委审片")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "record_id", value="审片记录ID"),
@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"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "review_text_2", value="评语2"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "review_text_3", value="评语3"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "review_text_4", value="评语4"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, allowMultiple=true, name = "ext_title", value="获奖标题 例如: 最佳男演员-张三"),
@ApiImplicitParam(paramType = "query", dataType = "double", required = false, allowMultiple=true, name = "ext_score", value="奖项得分"),
})
public Object saveReviewRecord(Integer record_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, String[] ext_title, Double[] ext_score) {
Fc_review_record ru = reviewService.queryReviewRecord(record_id);
ru.setReview_score(review_score);
ru.setReview_state(review_state);
ru.setReview_text(review_text);
ru.setReview_text_1(review_text_1);
ru.setReview_text_2(review_text_2);
ru.setReview_text_3(review_text_3);
ru.setReview_text_4(review_text_4);
List<Fc_review_record_ext> exts = new ArrayList<Fc_review_record_ext>();
if(ext_title != null && ext_score != null) {
if(ext_title.length == ext_score.length) {
for(int i = 0; i < ext_title.length; i++) {
Fc_review_record_ext ext = new Fc_review_record_ext();
ext.setRecord_id(ru.getId());
ext.setExt_title(ext_title[i]);
ext.setExt_score(ext_score[i]);
exts.add(ext);
}
} else {
throw new XException("评奖项目参数数量错误");
}
}
reviewService.saveReviewRecord(ru, exts);
reviewService.tryNextRound(ru.getReview_id());
return Rjx.jsonOk();
}
} }
...@@ -39,11 +39,6 @@ public class Fc_review_history implements java.io.Serializable { ...@@ -39,11 +39,6 @@ public class Fc_review_history implements java.io.Serializable {
*/ */
private Integer review_state; private Integer review_state;
/**
* 评选状态 0未评选 1有争议 2管理员分配 3审片完成
*/
private Integer opt_state;
private Date create_time; private Date create_time;
...@@ -62,17 +57,15 @@ public class Fc_review_history implements java.io.Serializable { ...@@ -62,17 +57,15 @@ public class Fc_review_history implements java.io.Serializable {
* @param enroll_type_id 影片性质 * @param enroll_type_id 影片性质
* @param review_round 审片轮数,第几轮审片 * @param review_round 审片轮数,第几轮审片
* @param review_state 审片结论 1通过 2否决 3参赛 4参赛备选 5参展 * @param review_state 审片结论 1通过 2否决 3参赛 4参赛备选 5参展
* @param opt_state 评选状态 0未评选 1有争议 2管理员分配 3审片完成
* @param create_time * @param create_time
*/ */
public Fc_review_history(Integer id, Integer film_id, Integer review_id, Integer enroll_type_id, Integer review_round, Integer review_state, Integer opt_state, Date create_time) { public Fc_review_history(Integer id, Integer film_id, Integer review_id, Integer enroll_type_id, Integer review_round, Integer review_state, Date create_time) {
this.id = id; this.id = id;
this.film_id = film_id; this.film_id = film_id;
this.review_id = review_id; this.review_id = review_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.review_state = review_state; this.review_state = review_state;
this.opt_state = opt_state;
this.create_time = create_time; this.create_time = create_time;
} }
...@@ -124,14 +117,6 @@ public class Fc_review_history implements java.io.Serializable { ...@@ -124,14 +117,6 @@ public class Fc_review_history implements java.io.Serializable {
return review_state; return review_state;
} }
public void setOpt_state(Integer opt_state) {
this.opt_state = opt_state;
}
public Integer getOpt_state() {
return opt_state;
}
public void setCreate_time(Date create_time) { public void setCreate_time(Date create_time) {
this.create_time = create_time; this.create_time = create_time;
} }
......
...@@ -31,9 +31,9 @@ public class Fc_review_record implements java.io.Serializable { ...@@ -31,9 +31,9 @@ public class Fc_review_record implements java.io.Serializable {
private Integer user_id; private Integer user_id;
/** /**
* 0未观看,1已观看 * 观看时长(分钟)
*/ */
private Integer view_state; private Integer view_time;
/** /**
* 评选轮数 * 评选轮数
...@@ -78,7 +78,7 @@ public class Fc_review_record implements java.io.Serializable { ...@@ -78,7 +78,7 @@ public class Fc_review_record implements java.io.Serializable {
* @param id 影片ID * @param id 影片ID
* @param review_id 评选轮数 * @param review_id 评选轮数
* @param user_id 评委ID * @param user_id 评委ID
* @param view_state 0未观看,1已观看 * @param view_time 观看时长(分钟)
* @param review_round 评选轮数 * @param review_round 评选轮数
* @param review_state 审片状态 1通过,2否决,3参赛,4参赛备选,5参展 * @param review_state 审片状态 1通过,2否决,3参赛,4参赛备选,5参展
* @param review_score 得分分数 * @param review_score 得分分数
...@@ -89,11 +89,11 @@ public class Fc_review_record implements java.io.Serializable { ...@@ -89,11 +89,11 @@ public class Fc_review_record implements java.io.Serializable {
* @param review_text_4 * @param review_text_4
* @param create_time * @param create_time
*/ */
public Fc_review_record(Integer id, Integer review_id, Integer user_id, Integer view_state, Integer review_round, 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, Date create_time) { public Fc_review_record(Integer id, Integer review_id, Integer user_id, Integer view_time, Integer review_round, 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, Date create_time) {
this.id = id; this.id = id;
this.review_id = review_id; this.review_id = review_id;
this.user_id = user_id; this.user_id = user_id;
this.view_state = view_state; this.view_time = view_time;
this.review_round = review_round; this.review_round = review_round;
this.review_state = review_state; this.review_state = review_state;
this.review_score = review_score; this.review_score = review_score;
...@@ -129,12 +129,12 @@ public class Fc_review_record implements java.io.Serializable { ...@@ -129,12 +129,12 @@ public class Fc_review_record implements java.io.Serializable {
return user_id; return user_id;
} }
public void setView_state(Integer view_state) { public void setView_time(Integer view_time) {
this.view_state = view_state; this.view_time = view_time;
} }
public Integer getView_state() { public Integer getView_time() {
return view_state; return view_time;
} }
public void setReview_round(Integer review_round) { public void setReview_round(Integer 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