Commit 5109ae9e authored by Quxl's avatar Quxl

x

parent 8fb85982
......@@ -120,11 +120,22 @@ public class ReviewServiceImpl implements ReviewService {
}
@Override
public List<Map<String, Object>> listNewAsianList(String keyword, Integer review_state, Integer playactor_type, Integer reveiw_round, Page page) {
public List<Map<String, Object>> listNewAsianList(String keyword, Integer review_state, Integer ext_type, Integer review_round, Page page) {
XRException.assertNotBlank("评选轮数不能未空", review_round);
XRException.assertNotBlank("获奖类型不能未空", ext_type);
SqlWhere where = new SqlWhere()
.eq("rr.review_round", review_round)
.eq("rr.review_state", review_state)
.eq("rre.ext_type", ext_type)
.lk(new String[] {"mf.cn_name", "mf.en_name", "mf.id", "mf.film_no"}, keyword)
;
String sql = ""
+ "select "
+ "r.id, "
+ "r.film_id, "
+ "mf.cn_name, "
+ "mf.en_name, "
+ "mf.film_no, "
+ "r.enroll_type_id, "
+ "r.review_round, "
+ "r.allot_stte, "
......@@ -132,19 +143,25 @@ public class ReviewServiceImpl implements ReviewService {
+ "r.opt_state, "
+ "r.push_time, "
+ "r.review_time, "
+ "rre.ext_title, "
+ "rre.ext_type, "
+ "rre.ext_name, "
+ "avg(rre.ext_score) ext_score_avg "
+ "from "
+ "fc_review r, fc_review_record rr, fc_review_record_ext rre "
+ "fc_review r, fc_member_film mf, fc_review_record rr, fc_review_record_ext rre "
+ "where "
+ "r.id = rr.review_id "
+ "r.film_id = mf.id "
+ "and r.id = rr.review_id "
+ "and rr.id = rre.record_id "
+ "and rr.review_round = " + reveiw_round + " "
+ "and rr.review_state = 2, "
+ "and rr.review_time is not null "
+ "and rre.id is not null "
+ StringUtil.join(" and ", "and ", " ", " ", where.getStringList())
+ "group by "
+ "r.id, "
+ "r.film_id, "
+ "mf.cn_name, "
+ "mf.en_name, "
+ "mf.film_no, "
+ "r.enroll_type_id, "
+ "r.review_round, "
+ "r.allot_stte, "
......@@ -152,8 +169,11 @@ public class ReviewServiceImpl implements ReviewService {
+ "r.opt_state, "
+ "r.push_time, "
+ "r.review_time, "
+ "rre.ext_title ";
return null;
+ "rre.ext_type, "
+ "rre.ext_name ";
sql = "select @rownum:=@rownum+1 as rownum, t.* from (" + sql + ") t, (select @rownum:=0) row order by t.ext_score_avg ";
return jdbcTemplate.limit(sql, page, where.getObjectList());
}
@Override
......
......@@ -92,20 +92,20 @@ public class AdminReviewController {
return Rjx.jsonOk().setData(list).setPage(page);
}
// @ResponseBody
// @PostMapping("listNewAsianList")
// @ApiOperation("查询亚新榜单")
// @ApiImplicitParams({
// @ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
// @ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
// })
// public Object listNewAsian(Long index, Long limit) {
// index = index == null ? 1 : index;
// limit = limit == null ? 20 : limit;
// Page page = new Page(index, limit);
// List<Map<String, Object>> list = reviewService.listNewAsianList(page);
// return Rjx.jsonOk().setData(list).setPage(page);
// }
@ResponseBody
@PostMapping("listNewAsianList")
@ApiOperation("查询亚新榜单")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
})
public Object listNewAsian(String keyword, Integer review_state, Integer playactor_type, Integer reveiw_round, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
List<Map<String, Object>> list = reviewService.listNewAsianList(keyword, review_state, playactor_type, reveiw_round, page);
return Rjx.jsonOk().setData(list).setPage(page);
}
@ResponseBody
......
......@@ -143,8 +143,8 @@ public class UserReviewController {
@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="奖项得分"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, allowMultiple=true, name = "ext_type", value="获奖类型"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, allowMultiple=true, name = "ext_name", value="获奖人名称"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, allowMultiple=true, name = "ext_type", value="获奖类型 例如 director:导演"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, allowMultiple=true, name = "ext_name", value="获奖人名称 例如 张三"),
})
public Object saveReviewRecord(Integer review_id, Long view_time, 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, String[] ext_type, String[] ext_name, Double[] ext_score) {
LoginToken token = tokenService.getToken();
......
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