Commit 33118125 authored by Quxl's avatar Quxl

x

parent 60ac8a74
......@@ -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>> 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;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -720,15 +720,10 @@ public class ReviewServiceImpl implements ReviewService {
}
@Override
public List<Map<String, Object>> queryReviewHistoryList(Integer[] film_type_id, Page page) {
List<String> film_type_name = new ArrayList<String>();
for(Integer id : film_type_id) {
if(id != null) {
film_type_name.add(String.valueOf(id));
}
}
public List<Map<String, Object>> queryReviewHistoryList(List<Integer> types, Page page) {
List<String> names = types.stream().map(String::valueOf).collect(Collectors.toList());
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);
}
......
......@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.Util;
import com.egolm.common.bean.Rjx;
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.AdminUserService;
import com.egolm.film.api.service.FilmService;
......@@ -52,6 +53,9 @@ public class AdminReviewController {
@Autowired
NewsService newsService;
@Autowired
AdminAuthService adminAuthService;
@ResponseBody
@PostMapping("list")
@ApiOperation("查询选片列表")
......@@ -383,15 +387,16 @@ public class AdminReviewController {
@PostMapping("getReviewHistory")
@ApiOperation("查询审片过程")
@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 = "limit"),
})
public Object getReviewHistory(Integer[] film_type_id, Long index, Long limit) {
public Object getReviewHistory(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.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);
}
......
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