Commit 33118125 authored by Quxl's avatar Quxl

x

parent 60ac8a74
...@@ -110,6 +110,6 @@ public interface ReviewService { ...@@ -110,6 +110,6 @@ public interface ReviewService {
List<Map<String, Object>> queryReviewRecordLogList(String username, Integer enroll_type_id, Integer review_state, Page page); List<Map<String, Object>> queryReviewRecordLogList(String username, Integer enroll_type_id, Integer review_state, Page page);
List<Map<String, Object>> queryReviewHistoryList(Integer[] film_type_id, Page page); List<Map<String, Object>> queryReviewHistoryList(List<Integer> types, Page page);
} }
\ No newline at end of file
package com.egolm.film.api.service.impl; package com.egolm.film.api.service.impl;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -720,15 +720,10 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -720,15 +720,10 @@ public class ReviewServiceImpl implements ReviewService {
} }
@Override @Override
public List<Map<String, Object>> queryReviewHistoryList(Integer[] film_type_id, Page page) { public List<Map<String, Object>> queryReviewHistoryList(List<Integer> types, Page page) {
List<String> film_type_name = new ArrayList<String>(); List<String> names = types.stream().map(String::valueOf).collect(Collectors.toList());
for(Integer id : film_type_id) {
if(id != null) {
film_type_name.add(String.valueOf(id));
}
}
String sql = "select rh.*, mf.film_type_name, mf.cn_name, mf.en_name from fc_review_history rh left join fc_member_film mf on mf.id = rh.film_id order by rh.create_time desc"; String sql = "select rh.*, mf.film_type_name, mf.cn_name, mf.en_name from fc_review_history rh left join fc_member_film mf on mf.id = rh.film_id order by rh.create_time desc";
sql = "select t.* from (" + sql + ") t where t.film_type_name in (" + StringUtil.join("', '", "'", "'", film_type_name) + ")"; sql = "select t.* from (" + sql + ") t where t.film_type_name in (" + StringUtil.join("', '", "'", "'", names) + ")";
return jdbcTemplate.limit(sql, page); return jdbcTemplate.limit(sql, page);
} }
......
...@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.Util; import com.egolm.common.Util;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.AdminAuthService;
import com.egolm.film.api.service.AdminTokenService; import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.AdminUserService; import com.egolm.film.api.service.AdminUserService;
import com.egolm.film.api.service.FilmService; import com.egolm.film.api.service.FilmService;
...@@ -52,6 +53,9 @@ public class AdminReviewController { ...@@ -52,6 +53,9 @@ public class AdminReviewController {
@Autowired @Autowired
NewsService newsService; NewsService newsService;
@Autowired
AdminAuthService adminAuthService;
@ResponseBody @ResponseBody
@PostMapping("list") @PostMapping("list")
@ApiOperation("查询选片列表") @ApiOperation("查询选片列表")
...@@ -383,15 +387,16 @@ public class AdminReviewController { ...@@ -383,15 +387,16 @@ public class AdminReviewController {
@PostMapping("getReviewHistory") @PostMapping("getReviewHistory")
@ApiOperation("查询审片过程") @ApiOperation("查询审片过程")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "film_type_id", allowMultiple=true),
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "index"), @ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "index"),
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "limit"), @ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "limit"),
}) })
public Object getReviewHistory(Integer[] film_type_id, Long index, Long limit) { public Object getReviewHistory(Long index, Long limit) {
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.queryReviewHistoryList(film_type_id, page); Fc_admin admin = Util.mapTo(tokenService.getTokenObj(), Fc_admin.class);
List<Integer> types = adminAuthService.queryGroupFilmtypeList(admin.getGroup_id());
List<Map<String, Object>> list = reviewService.queryReviewHistoryList(types, page);
return Rjx.jsonOk().setData(list).setPage(page); return Rjx.jsonOk().setData(list).setPage(page);
} }
......
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