Commit a9fa232b authored by Quxl's avatar Quxl

x

parent 17d44df1
......@@ -5,6 +5,7 @@ import java.util.List;
import java.util.Map;
import com.egolm.common.jdbc.Page;
import com.egolm.film.bean.Fc_review_doubtful;
public interface ReviewService {
......@@ -14,4 +15,6 @@ public interface ReviewService {
Integer queryReviewRound(Integer film_id, Integer enroll_type_id);
void saveDoubtful(Fc_review_doubtful doubtful);
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_review_doubtful;
import com.egolm.film.util.SqlWhere;
@Service
......@@ -46,9 +47,11 @@ public class ReviewServiceImpl implements ReviewService {
+ "ru.review_text_style, "
+ "ru.review_text_keynote "
+ "from "
+ "fc_member_film mf, fc_review r, fc_review_user ru "
+ "fc_member_film mf, fc_review_round rr, fc_review r, fc_review_user ru "
+ "where "
+ "mf.id = r.film_id "
+ " mf.id = rr.film_id "
+ "and rr.film_id = r.film_id "
+ "and rr.enroll_type_id = r.enroll_type_id "
+ "and r.id = ru.review_id "
+ "and ru.user_id = " + user_id
+ StringUtil.join(" and ", " and ", "", "", where.getStringList());
......@@ -63,7 +66,12 @@ public class ReviewServiceImpl implements ReviewService {
@Override
public Integer queryReviewRound(Integer film_id, Integer enroll_type_id) {
String sql = "select review_round from fc_review where film_id = ? and enroll_type_id = ?";
return null;
return jdbcTemplate.queryForInt(sql, film_id, enroll_type_id);
}
@Override
public void saveDoubtful(Fc_review_doubtful doubtful) {
jdbcTemplate.save(doubtful);
}
......
......@@ -16,6 +16,8 @@ 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.UserTokenService;
import com.egolm.film.bean.Fc_review;
import com.egolm.film.bean.Fc_review_doubtful;
import com.egolm.film.model.LoginToken;
import io.swagger.annotations.Api;
......@@ -71,6 +73,17 @@ public class UserReviewController {
})
public Object saveDoubtful(Integer film_id, Integer enroll_type_id, Integer doubtful_type_id, String doubtful_text, @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")Date play_time) {
Integer review_round = service.queryReviewRound(film_id, enroll_type_id);
return Rjx.jsonOk();
LoginToken token = tokenService.getToken();
Integer user_id = (Integer)token.getId();
Fc_review_doubtful doubtful = new Fc_review_doubtful();
doubtful.setDoubtful_type_id(doubtful_type_id);
doubtful.setEnroll_type_id(enroll_type_id);
doubtful.setFilm_id(film_id);
doubtful.setPlay_time(play_time);
doubtful.setReview_round(review_round);
doubtful.setDoubtful_text(doubtful_text);
doubtful.setUser_id(user_id);
service.saveDoubtful(doubtful);
return Rjx.jsonOk().setData(doubtful);
}
}
......@@ -45,13 +45,15 @@ public class Fc_review_doubtful implements java.io.Serializable {
/**
* 疑点介绍
*/
private String review_text;
private String doubtful_text;
/**
* 疑点时间
*/
private Date play_time;
private Date create_time;
/**
* 无参数构造方法
......@@ -68,18 +70,20 @@ public class Fc_review_doubtful implements java.io.Serializable {
* @param review_round 第几轮审核
* @param user_id 评委ID
* @param doubtful_type_id 疑点类型
* @param review_text 疑点介绍
* @param doubtful_text 疑点介绍
* @param play_time 疑点时间
* @param create_time
*/
public Fc_review_doubtful(Integer id, Integer film_id, Integer enroll_type_id, Integer review_round, Integer user_id, Integer doubtful_type_id, String review_text, Date play_time) {
public Fc_review_doubtful(Integer id, Integer film_id, Integer enroll_type_id, Integer review_round, Integer user_id, Integer doubtful_type_id, String doubtful_text, Date play_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.user_id = user_id;
this.doubtful_type_id = doubtful_type_id;
this.review_text = review_text;
this.doubtful_text = doubtful_text;
this.play_time = play_time;
this.create_time = create_time;
}
public void setId(Integer id) {
......@@ -130,12 +134,12 @@ public class Fc_review_doubtful implements java.io.Serializable {
return doubtful_type_id;
}
public void setReview_text(String review_text) {
this.review_text = review_text;
public void setDoubtful_text(String doubtful_text) {
this.doubtful_text = doubtful_text;
}
public String getReview_text() {
return review_text;
public String getDoubtful_text() {
return doubtful_text;
}
public void setPlay_time(Date play_time) {
......@@ -146,5 +150,13 @@ public class Fc_review_doubtful implements java.io.Serializable {
return play_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getCreate_time() {
return create_time;
}
}
package com.egolm.film.bean;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* @author 曲欣亮
*/
@Entity(name="fc_review_round")
public class Fc_review_round implements java.io.Serializable {
private static final long serialVersionUID = 1L;
/**
* 参审影片ID
*/
@Id
private Integer film_id;
/**
* 影片性质(申报奖项)ID
*/
@Id
private Integer enroll_type_id;
/**
* 审片轮数,第几轮审片
*/
private Integer review_round;
/**
* 无参数构造方法
*/
public Fc_review_round () {
super();
}
/**
* 全参数构造方法
* @param film_id 参审影片ID
* @param enroll_type_id 影片性质(申报奖项)ID
* @param review_round 审片轮数,第几轮审片
*/
public Fc_review_round(Integer film_id, Integer enroll_type_id, Integer review_round) {
this.film_id = film_id;
this.enroll_type_id = enroll_type_id;
this.review_round = review_round;
}
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_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) {
this.review_round = review_round;
}
public Integer getReview_round() {
return 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