Commit fced7ec2 authored by Quxl's avatar Quxl

x

parent 26e6a63a
...@@ -135,7 +135,7 @@ public interface FilmService { ...@@ -135,7 +135,7 @@ public interface FilmService {
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, Page page); String film_country, Integer review_round, Integer[] review_state, Page page);
void allot(Long member_film_id, Integer enroll_type_id, Integer review_round, Integer[] user_id); void allot(Integer review_id, Integer review_round, Integer[] user_id);
void saveUploadId(Long member_film_id, String upload_id); void saveUploadId(Long member_film_id, String upload_id);
......
...@@ -32,7 +32,6 @@ import com.egolm.film.bean.Fc_member_film_issuer; ...@@ -32,7 +32,6 @@ import com.egolm.film.bean.Fc_member_film_issuer;
import com.egolm.film.bean.Fc_member_film_playactor; import com.egolm.film.bean.Fc_member_film_playactor;
import com.egolm.film.bean.Fc_member_film_show; import com.egolm.film.bean.Fc_member_film_show;
import com.egolm.film.bean.Fc_review; import com.egolm.film.bean.Fc_review;
import com.egolm.film.bean.Fc_review_record;
import com.egolm.film.bean.model.Fc_member_film_base_model; import com.egolm.film.bean.model.Fc_member_film_base_model;
import com.egolm.film.config.WebMvcConfig; import com.egolm.film.config.WebMvcConfig;
import com.egolm.film.config.XException; import com.egolm.film.config.XException;
...@@ -486,7 +485,7 @@ public class FilmServiceImpl implements FilmService { ...@@ -486,7 +485,7 @@ public class FilmServiceImpl implements FilmService {
.eq("mf.film_type_name_short", film_type_name_short) .eq("mf.film_type_name_short", film_type_name_short)
.eq("mf.film_country", film_country) .eq("mf.film_country", film_country)
.eq("r.review_round", review_round); .eq("r.review_round", review_round);
String sql = "select mf.id, r.review_round, mf.origion_name, mf.en_name, mf.cn_name, mf.film_type_name, mf.film_country, r.review_state, (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, r.review_round, r.review_id, mf.origion_name, mf.en_name, mf.cn_name, mf.film_type_name, mf.film_country, r.review_state, (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());
if(enroll_type_id != null) { if(enroll_type_id != null) {
sql = "select t.* from (" + sql + ") t, fc_member_film_enroll mfe where t.id = mfe.film_id and mfe.enroll_type_id = " + enroll_type_id; sql = "select t.* from (" + sql + ") t, fc_member_film_enroll mfe where t.id = mfe.film_id and mfe.enroll_type_id = " + enroll_type_id;
} }
...@@ -495,20 +494,13 @@ public class FilmServiceImpl implements FilmService { ...@@ -495,20 +494,13 @@ public class FilmServiceImpl implements FilmService {
@Override @Override
@Transactional @Transactional
public void allot(Long member_film_id, Integer enroll_type_id, Integer review_round, Integer[] user_id) { public void allot(Integer review_id, Integer review_round, Integer[] user_id) {
Fc_review review = jdbcTemplate.queryForBean("select * from fc_review where film_id = ? and enroll_type_id = ? and review_round = ?", Fc_review.class, member_film_id, enroll_type_id, review_round); jdbcTemplate.executeUpdate("update fc_review_record set review_state = ? where review_id = ? and review_round = ?", 1, review_id, review_round);
review.setReview_state(1);
jdbcTemplate.update(review);
jdbcTemplate.executeUpdate("delete from fc_review_record where review_id = ?", review.getId());
if(user_id != null && user_id.length > 0) { if(user_id != null && user_id.length > 0) {
List<Fc_review_record> list = new ArrayList<Fc_review_record>();
for(Integer i : user_id) { for(Integer i : user_id) {
Fc_review_record ru = new Fc_review_record(); String sql = "insert into fc_review_record(review_id, user_id, view_state, review_round, review_state) select ?, ?, ?, ?, ? from dual where not exists (select * form fc_review_record where review_id = ? and user_id = ? and review_round = ?)";
ru.setReview_id(review.getId()); jdbcTemplate.executeUpdate(sql, review_id, i, 0, review_round, 1, review_id, i, review_round);
ru.setUser_id(i);
ru.setView_state(0);
} }
jdbcTemplate.batchSave(list);
} }
} }
......
...@@ -58,7 +58,6 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -58,7 +58,6 @@ public class ReviewServiceImpl implements ReviewService {
+ " mf.id = r.film_id " + " mf.id = r.film_id "
+ "and r.id = rr.review_id " + "and r.id = rr.review_id "
+ "and r.review_round = rr.review_round " + "and r.review_round = rr.review_round "
+ "and r.review_round in ()"
+ "and rr.user_id = " + user_id + "and rr.user_id = " + user_id
+ StringUtil.join(" and ", " and ", "", "", where.getStringList()); + StringUtil.join(" and ", " and ", "", "", where.getStringList());
return jdbcTemplate.limit(sql, page, where.getObjectList()); return jdbcTemplate.limit(sql, page, where.getObjectList());
......
...@@ -58,13 +58,12 @@ public class AdminReviewController { ...@@ -58,13 +58,12 @@ public class AdminReviewController {
@PostMapping("allot") @PostMapping("allot")
@ApiOperation("分配审片评委") @ApiOperation("分配审片评委")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="member_film_id", value="影片ID"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="enroll_type_id", value="影片性质[申报奖项]ID"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_round", value="分配评委的审片环节"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_round", value="审片环节"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="user_id", value="审片评委ID"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="user_id", value="审片评委ID"),
}) })
public Object allot(Long member_film_id, Integer enroll_type_id, Integer review_round, Integer[] user_id) { public Object allot(Integer review_id, Integer review_round, Integer[] user_id) {
filmService.allot(member_film_id, enroll_type_id, review_round, user_id); filmService.allot(review_id, review_round, user_id);
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
......
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