Commit 8ed04213 authored by Quxl's avatar Quxl

x

parent 7b627dbe
...@@ -46,5 +46,9 @@ public interface AdminUserService { ...@@ -46,5 +46,9 @@ public interface AdminUserService {
List<Map<String, Object>> getReviewGroupList(Integer review_id, Integer review_round); List<Map<String, Object>> getReviewGroupList(Integer review_id, Integer review_round);
List<Map<String, Object>> getShowFilmGroupList();
List<Map<String, Object>> getShowFilmUserList();
} }
...@@ -42,7 +42,7 @@ public interface ReviewService { ...@@ -42,7 +42,7 @@ public interface ReviewService {
Integer opt_state, Integer opt_state,
Page page); Page page);
List<Map<String, Object>> queryBestMvListByGroup(String keyword, Integer user_group_id, Integer review_state, Integer review_round, String ext_type, Page page); List<Map<String, Object>> queryBestMvListByGroup(String keyword, Integer user_group_id, Integer review_round, String ext_type, Page page);
/** /**
* 查询评委审片列表 * 查询评委审片列表
...@@ -121,7 +121,7 @@ public interface ReviewService { ...@@ -121,7 +121,7 @@ public interface ReviewService {
void toType4(Integer id); void toType4(Integer id);
List<Map<String, Object>> queryShowFilmUserList(Integer review_id); List<Map<String, Object>> queryShowFilmUserListByReviewId(Integer review_id);
} }
\ No newline at end of file
...@@ -161,4 +161,16 @@ public class AdminUserServiceImpl implements AdminUserService { ...@@ -161,4 +161,16 @@ public class AdminUserServiceImpl implements AdminUserService {
return jdbcTemplate.queryForList(sql, review_round, review_id); return jdbcTemplate.queryForList(sql, review_round, review_id);
} }
@Override
public List<Map<String, Object>> getShowFilmGroupList() {
String sql = "select ug.* from fc_user_group ug, fc_user_group_funs ugf where ug.group_id = ugf.group_id and ugf.fun_id = 2";
return jdbcTemplate.queryForList(sql);
}
@Override
public List<Map<String, Object>> getShowFilmUserList() {
String sql = "select u.uid, u.username, u.realname, u.group_id, ug.group_name from fc_user u left join fc_user_group ug on ug.group_id = u.group_id, fc_user_group_funs ugf where u.group_id = ugf.group_id and ugf.fun_id = 2";
return jdbcTemplate.queryForList(sql);
}
} }
...@@ -133,61 +133,11 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -133,61 +133,11 @@ public class ReviewServiceImpl implements ReviewService {
} }
@Override @Override
public List<Map<String, Object>> queryBestMvListByGroup(String keyword, Integer user_group_id, Integer review_state, Integer review_round, String ext_type, Page page) { public List<Map<String, Object>> queryBestMvListByGroup(String keyword, Integer user_group_id, Integer review_round, String ext_type, Page page) {
XRException.assertNotBlank("获奖类型不能为空", ext_type);
XRException.assertNotBlank("选片轮数不能为空", review_round); XRException.assertNotBlank("选片轮数不能为空", review_round);
String sql = "" String sql = "select r.* from fc_review r where r.enroll_type_id = 2 and review_round >= " + review_round;
+ "select " //TODO
+ "rh.film_id, " return null;
+ "rh.review_id, "
+ "rh.enroll_type_id, "
+ "rh.review_state, "
+ "rh.opt_state, "
+ "rr.user_group_id, "
+ "mf.cn_name, "
+ "mf.en_name, "
+ "mf.film_no, "
+ "rre.ext_type, "
+ "rre.ext_name, "
+ "r.review_round, "
+ "avg(rre.ext_score) ext_score_avg "
+ "from "
+ "fc_review_record_ext rre, "
+ "fc_review_record rr, "
+ "fc_review_history rh left join fc_member_film mf on mf.id = rh.film_id left join fc_review r on r.id = rh.review_id "
+ "where "
+ "rre.ext_type = '" + ext_type + "' "
+ "and rh.review_round = " + review_round + " "
+ "and rre.record_id = rr.id "
+ "and rr.review_id = rh.review_id "
+ "and rh.enroll_type_id = 2 "
+ "and rh.opt_state = 2 "
+ "group by "
+ "rh.film_id, "
+ "rh.review_id, "
+ "rh.enroll_type_id, "
+ "rh.review_round, "
+ "rh.review_state, "
+ "rh.opt_state, "
+ "rr.user_group_id, "
+ "mf.cn_name, "
+ "mf.en_name, "
+ "mf.film_no, "
+ "rre.ext_type, "
+ "rre.ext_name"
;
sql = "select @rownum:=@rownum+1 as rownum, t.* from (" + sql + ") t, (select @rownum:=0) row where t.user_group_id = " + user_group_id + " order by t.ext_score_avg desc";
SqlWhere where = new SqlWhere().eq("tt.review_state", review_state);
if(StringUtil.isNotBlank(keyword)) {
String lkstr = "%" + keyword + "%";
if(keyword.matches("\\d+")) {
where.where("(tt.film_no = ? or tt.en_name like ? or tt.cn_name like ? or tt.ext_name like ?)", new Object[] {Integer.valueOf(keyword), lkstr, lkstr, lkstr});
} else {
where.lk(new String[]{"tt.en_name", "tt.cn_name", "tt.ext_name"}, keyword);
}
}
sql = "select tt.* from (" + sql + ") tt " + StringUtil.join(" and ", " where ", "", "", where.getStringList()) + " order by tt.rownum";
return jdbcTemplate.limit(sql, page, where.getObjectArray());
} }
@Override @Override
...@@ -604,7 +554,7 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -604,7 +554,7 @@ public class ReviewServiceImpl implements ReviewService {
} }
@Override @Override
public List<Map<String, Object>> queryShowFilmUserList(Integer review_id) { public List<Map<String, Object>> queryShowFilmUserListByReviewId(Integer review_id) {
String sql = "select u.*, ug.group_name from fc_user u left join fc_user_group ug on ug.group_id = u.group_id, fc_user_film uf where u.uid = uf.user_id and uf.review_id = ?"; String sql = "select u.*, ug.group_name from fc_user u left join fc_user_group ug on ug.group_id = u.group_id, fc_user_film uf where u.uid = uf.user_id and uf.review_id = ?";
return jdbcTemplate.queryForList(sql, review_id); return jdbcTemplate.queryForList(sql, review_id);
} }
......
...@@ -25,7 +25,6 @@ import com.egolm.film.api.service.NewsService; ...@@ -25,7 +25,6 @@ import com.egolm.film.api.service.NewsService;
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; import com.egolm.film.bean.Fc_review;
import com.egolm.film.bean.Fc_review_history;
import com.egolm.film.bean.Fc_review_record; import com.egolm.film.bean.Fc_review_record;
import com.egolm.film.bean.Fc_review_record_ext; import com.egolm.film.bean.Fc_review_record_ext;
import com.egolm.film.config.XRException; import com.egolm.film.config.XRException;
...@@ -108,26 +107,13 @@ public class AdminReviewController { ...@@ -108,26 +107,13 @@ public class AdminReviewController {
} }
@ResponseBody @ResponseBody
@PostMapping({"getNewAsianRoundList", "getBestMvListByGroup"}) @PostMapping({"getBestMvGroupList"})
@ApiOperation("查询亚新榜单(全部分组)") @ApiOperation("查询亚新榜单全部评委组")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", name="keyword", value="搜索关键字"), @ApiImplicitParam(paramType="query", dataType="int", name="review_round", value="2,3"),
@ApiImplicitParam(paramType="query", dataType="int", name="review_state", value="评委意见(3参赛 4参赛备选 5参展)"),
@ApiImplicitParam(paramType="query", dataType="int", name="ext_type", value="获奖类型(前端根据审片时保存到数据库的对应字段进行检索)"),
@ApiImplicitParam(paramType="query", dataType="int", name="review_round", value="第2或3选(2,3)"),
}) })
public Object getBestMvListByGroup( public Object getBestMvGroupList(Integer review_round) {
String keyword,
Integer review_state,
Integer review_round,
String ext_type) {
Page page = new Page(1L, 999999999999L);
List<Map<String, Object>> ugList = reviewService.queryUserGroupListByReviewRecord(2, review_round); List<Map<String, Object>> ugList = reviewService.queryUserGroupListByReviewRecord(2, review_round);
for(Map<String, Object> ugMap : ugList) {
Integer ugId = ((Number)ugMap.get("group_id")).intValue();
List<Map<String, Object>> list = reviewService.queryBestMvListByGroup(keyword, ugId, review_state, review_round, ext_type, page);
ugMap.put("list", list);
}
return Rjx.jsonOk().setData(ugList); return Rjx.jsonOk().setData(ugList);
} }
...@@ -150,9 +136,7 @@ public class AdminReviewController { ...@@ -150,9 +136,7 @@ public class AdminReviewController {
@ApiOperation("查询亚新榜单(单个分组)") @ApiOperation("查询亚新榜单(单个分组)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", name="keyword", value="搜索关键字"), @ApiImplicitParam(paramType="query", dataType="string", name="keyword", value="搜索关键字"),
@ApiImplicitParam(paramType="query", dataType="int", name="review_state", value="评委意见(3参赛 4参赛备选 5参展)"),
@ApiImplicitParam(paramType="query", dataType="int", name="user_group_id", value="评委组ID)"), @ApiImplicitParam(paramType="query", dataType="int", name="user_group_id", value="评委组ID)"),
@ApiImplicitParam(paramType="query", dataType="int", name="ext_type", value="获奖类型(前端根据审片时保存到数据库的对应字段进行检索)"),
@ApiImplicitParam(paramType="query", dataType="int", name="review_round", value="第2或3选(2,3)"), @ApiImplicitParam(paramType="query", dataType="int", name="review_round", value="第2或3选(2,3)"),
@ApiImplicitParam(paramType="query", dataType="long", name="index", value="分页编号"), @ApiImplicitParam(paramType="query", dataType="long", name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", name="limit", value="分页大小"), @ApiImplicitParam(paramType="query", dataType="long", name="limit", value="分页大小"),
...@@ -160,7 +144,6 @@ public class AdminReviewController { ...@@ -160,7 +144,6 @@ public class AdminReviewController {
public Object getBestMvList( public Object getBestMvList(
String keyword, String keyword,
Integer user_group_id, Integer user_group_id,
Integer review_state,
Integer review_round, Integer review_round,
String ext_type, String ext_type,
Long index, Long index,
...@@ -168,7 +151,7 @@ public class AdminReviewController { ...@@ -168,7 +151,7 @@ public class AdminReviewController {
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);
List<Map<String, Object>> list = reviewService.queryBestMvListByGroup(keyword, user_group_id, review_state, review_round, ext_type, page); List<Map<String, Object>> list = reviewService.queryBestMvListByGroup(keyword, user_group_id, review_round, ext_type, page);
return Rjx.jsonOk().setData(list).setPage(page); return Rjx.jsonOk().setData(list).setPage(page);
} }
...@@ -200,32 +183,6 @@ public class AdminReviewController { ...@@ -200,32 +183,6 @@ public class AdminReviewController {
return Rjx.jsonOk().setData(list).setPage(page); return Rjx.jsonOk().setData(list).setPage(page);
} }
@ResponseBody
@Transactional
@PostMapping("allotExhibitionRound")
@ApiOperation("展映影片分配审片环节")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_round", value="审片环节(1,2,3,4,5)"),
})
public Object allotExhibitionRound(Integer review_id, Integer review_round) {
Fc_review review = reviewService.queryReviewById(review_id);
if(review.getEnroll_type_id().intValue() == 4) {
Fc_review_history history = new Fc_review_history();
history.setReview_id(review.getId());
history.setEnroll_type_id(review.getEnroll_type_id());
history.setFilm_id(review.getFilm_id());
history.setReview_round(review_round);
history.setCreate_time(new Date());
reviewService.toRound(review_id, review_round);
reviewService.save(history);
return Rjx.jsonOk();
} else {
return Rjx.jsonErr().setMessage("展映流程错误");
}
}
@ResponseBody @ResponseBody
@PostMapping("getReviewGroupUserList") @PostMapping("getReviewGroupUserList")
@ApiOperation("可分配的审片评委查询") @ApiOperation("可分配的审片评委查询")
...@@ -241,6 +198,19 @@ public class AdminReviewController { ...@@ -241,6 +198,19 @@ public class AdminReviewController {
return Rjx.jsonOk().set("userList", userList).set("groupList", groupList); return Rjx.jsonOk().set("userList", userList).set("groupList", groupList);
} }
@ResponseBody
@PostMapping("getShowFilmUserList")
@ApiOperation("可分配的看片评委查询")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"),
})
public Object getShowFilmUserList(
Integer review_id) {
List<Map<String, Object>> groupList = adminUserService.getShowFilmGroupList();
List<Map<String, Object>> userList = adminUserService.getShowFilmUserList();
return Rjx.jsonOk().set("userList", userList).set("groupList", groupList);
}
@ResponseBody @ResponseBody
@PostMapping("timeoutList") @PostMapping("timeoutList")
@ApiOperation("超时列表") @ApiOperation("超时列表")
...@@ -336,7 +306,7 @@ public class AdminReviewController { ...@@ -336,7 +306,7 @@ public class AdminReviewController {
@ResponseBody @ResponseBody
@PostMapping("allot_list") @PostMapping("allot_list")
@ApiOperation("查询审片评委") @ApiOperation("查询已分配的审片评委")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"),
}) })
...@@ -347,12 +317,12 @@ public class AdminReviewController { ...@@ -347,12 +317,12 @@ public class AdminReviewController {
@ResponseBody @ResponseBody
@PostMapping("show_user_list") @PostMapping("show_user_list")
@ApiOperation("查询看片评委") @ApiOperation("查询已分配的看片评委")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"),
}) })
public Object show_user_list(Integer review_id) { public Object show_user_list(Integer review_id) {
List<Map<String, Object>> list = reviewService.queryShowFilmUserList(review_id); List<Map<String, Object>> list = reviewService.queryShowFilmUserListByReviewId(review_id);
return Rjx.jsonOk().setData(list); return Rjx.jsonOk().setData(list);
} }
......
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