Commit 1c14966b authored by Quxl's avatar Quxl

x

parent fd447c5f
...@@ -7,4 +7,8 @@ public interface CountryService { ...@@ -7,4 +7,8 @@ public interface CountryService {
public List<Map<String, String>> queryCountryList(); public List<Map<String, String>> queryCountryList();
public Map<String, String> queryCountryMap();
public Map<String, String> queryCountryMapReverse();
} }
package com.egolm.film.api.service; package com.egolm.film.api.service;
import java.io.OutputStream; import javax.servlet.ServletOutputStream;
import java.util.Map;
public interface ExportService { public interface ExportService {
Map<String, String> getAllTitles(String[] columns); void exportApplyList(ServletOutputStream outputStream);
void export(
OutputStream os,
Integer admin_group_id,
String keyword,
Integer state,
Integer apply_state,
Integer film_type,
Integer enroll_type,
Integer upload_state,
String film_country,
Integer film_type_short,
String play_shanghai,
Integer review_round,
Integer review_state,
Integer allot_atate,
Integer opt_state,
Integer[] film_group_id,
String[] columns);
void export(OutputStream os);
} }
package com.egolm.film.api.service.impl; package com.egolm.film.api.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
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 java.util.stream.Collectors;
...@@ -28,6 +29,30 @@ public class CountryServiceImpl implements CountryService { ...@@ -28,6 +29,30 @@ public class CountryServiceImpl implements CountryService {
return list; return list;
} }
@Override
public Map<String, String> queryCountryMap() {
List<Map<String, String>> list = this.queryCountryList();
Map<String, String> countryMap = new HashMap<String, String>();
for(Map<String, String> map : list) {
for(String key : map.keySet()) {
countryMap.put(key, map.get(key));
}
}
return countryMap;
}
@Override
public Map<String, String> queryCountryMapReverse() {
List<Map<String, String>> list = this.queryCountryList();
Map<String, String> countryMap = new HashMap<String, String>();
for(Map<String, String> map : list) {
for(String key : map.keySet()) {
countryMap.put(map.get(key), key);
}
}
return countryMap;
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(JSON.toJSONString(new CountryServiceImpl().queryCountryList())); System.out.println(JSON.toJSONString(new CountryServiceImpl().queryCountryList()));
} }
......
package com.egolm.film.api.service.impl; package com.egolm.film.api.service.impl;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.persistence.Column; import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.egolm.common.ExcelUtil;
import com.egolm.common.StringUtil;
import com.egolm.common.Util;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.CountryService;
import com.egolm.film.api.service.ExportService; import com.egolm.film.api.service.ExportService;
import com.egolm.film.api.service.FilmService;
import com.egolm.film.bean.Fc_member_film;
@Service @Service
public class ExportServiceImpl implements ExportService { public class ExportServiceImpl implements ExportService {
...@@ -28,295 +20,66 @@ public class ExportServiceImpl implements ExportService { ...@@ -28,295 +20,66 @@ public class ExportServiceImpl implements ExportService {
@Autowired @Autowired
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
@Autowired Map<String, String> countryMap;
FilmService filmService;
@Resource
private static final String[] exclude = new String[] { public void setCountryService(CountryService countryService) {
"serialVersionUID", countryMap = countryService.queryCountryMapReverse();
"origion_name", }
"type",
"film_group_id",
"film_type", @Override
"enroll_type", public void exportApplyList(ServletOutputStream outputStream) {
"show_date", String sql = ""
"show_time", + "select "
"film_producers", + "mf.film_no, "
"production_company", + "mf.en_name, "
"is_like_show", + "mf.cn_name, "
"prize", + "mf.enroll_type_name, "
"film_side_demand", + "mf.first_show_date, "
"is_show", + "mf.first_show_city, "
"lang", + "mf.other_filmfest_name, "
"film_district", + "mf.film_medium, "
"is_check_director", + "mf.film_format, "
"admin_creator", + "mf.completion_date, "
"apply_state_intro", + "mf.film_country, "
"plays_is_agree", + "mf.co_production_country, "
"plays_is_agree1"}; + "mf.enroll_type_name, "
+ "mf.state, "
private static final Map<String, String> titles = new HashMap<String, String>(); + "mf.dialogue_lang, "
+ "mf.subtitle_lang, "
private static final Map<String, String> playactorTypes = new HashMap<String, String>(); + "mf.play_shanghai, "
static { + "mf.film_total_time, "
playactorTypes.put("director", "导演"); + "mf.film_apply_company, "
playactorTypes.put("producer", "制片人"); + "mf.film_apply_realname, "
playactorTypes.put("screenwriter", "编剧"); + "mf.film_apply_email, "
playactorTypes.put("photographer", "摄影"); + "mf.film_apply_mobile, "
playactorTypes.put("actor", "男演员"); + "mf.film_apply_country, "
playactorTypes.put("actress", "女演员"); + "mf.film_format_url, "
playactorTypes.put("issuser", "发行方"); + "mf.film_format_passw, "
playactorTypes.put("show", "参加过的电视节"); + "mf.film_type_name_short "
titles.putAll(playactorTypes); + " from "
} + "fc_member_film mf "
private static final Map<String, String> filmTypes = new HashMap<String, String>(); + "where "
static { + "state = 2";
filmTypes.put("1", "剧情片"); List<Map<String, Object>> list = jdbcTemplate.limitAll(sql, new Page(1L, 1000L, new String[] {"film_no asc"}));
filmTypes.put("2", "纪录片");
filmTypes.put("3", "动画片");
filmTypes.put("4", "短片");
}
private static final Map<String, String> filmShortTypes = new HashMap<String, String>();
static {
filmShortTypes.put("1", "欧洲");
filmShortTypes.put("2", "亚太");
filmShortTypes.put("3", "美非");
filmShortTypes.put("4", "华语");
filmShortTypes.put("5", "纪录片");
filmShortTypes.put("6", "动画片");
filmShortTypes.put("7", "真人短片");
filmShortTypes.put("8", "动画短片");
}
private static final Map<String, String> enrollTypes = new HashMap<String, String>();
static {
enrollTypes.put("1", "金爵奖国际影片评选");
enrollTypes.put("2", "亚洲新人奖国际影片评选");
enrollTypes.put("3", "电影频道传媒关注");
enrollTypes.put("4", "国际电影展映");
}
private static final Map<String, String> enrollOtherTypes = new HashMap<String, String>();
static {
enrollOtherTypes.put("1", "最佳导演");
enrollOtherTypes.put("2", "最佳女演员");
enrollOtherTypes.put("3", "最佳男演员");
enrollOtherTypes.put("4", "最佳编剧");
enrollOtherTypes.put("5", "最佳摄影");
enrollOtherTypes.put("6", "真人短片");
enrollOtherTypes.put("7", "动画短片");
enrollOtherTypes.put("8", "最佳影片");
}
private static final Map<String, String> states = new HashMap<String, String>();
static {
states.put("1", "未提交");
states.put("2", "已提交");
}
private static final Map<String, String> applyStates = new HashMap<String, String>();
static {
applyStates.put("1", "未受理");
applyStates.put("2", "初审通过");
applyStates.put("3", "初审否决");
}
private static final Map<String, String> YN = new HashMap<String, String>();
static {
YN.put("0", "否");
YN.put("1", "是");
}
private static final Map<String, String> filmMedium = new HashMap<String, String>();
static {
filmMedium.put("1", "彩色");
filmMedium.put("2", "黑白");
filmMedium.put("3", "彩色+黑白");
}
private static final Map<String, String> filmFormat = new HashMap<String, String>();
static {
filmFormat.put("1", "移动存储");
filmFormat.put("2", "在线连接");
}
private static final Map<String, String> playShanghai = new HashMap<String, String>();
static {
playShanghai.put("1", "世界首映");
playShanghai.put("2", "国籍首映");
playShanghai.put("3", "亚洲首映");
playShanghai.put("4", "中国首映");
}
private List<Map<String, Object>> queryFilmDataList(
Integer admin_group_id,
String keyword,
Integer state,
Integer apply_state,
Integer film_type,
Integer enroll_type,
Integer upload_state,
String film_country,
Integer film_type_short,
String play_shanghai,
Integer review_round,
Integer review_state,
Integer allot_atate,
Integer opt_state,
Integer[] film_group_id) {
String sql0 = "select group_concat(fp.playactor_name) text, fp.film_id, fp.playactor_type from fc_member_film_playactor fp group by fp.film_id, fp.playactor_type";
String sql1 = "select group_concat(fi.issuer_company) text, fi.film_id from fc_member_film_issuer fi group by fi.film_id";
String sql2 = "select group_concat(fs.show_filmfest) text, fs.film_id from fc_member_film_show fs group by fs.film_id";
List<Map<String, Object>> list = filmService.queryFilmList(
admin_group_id,
keyword,
state,
apply_state,
film_type,
enroll_type,
upload_state,
film_country,
film_type_short,
play_shanghai,
review_round,
review_state,
allot_atate,
opt_state,
film_group_id,
new Page(1L, 9999999999L));
List<Map<String, Object>> playactors = jdbcTemplate.queryForList(sql0);
List<Map<String, Object>> issuers = jdbcTemplate.queryForList(sql1);
List<Map<String, Object>> shows = jdbcTemplate.queryForList(sql2);
Map<String, Map<String, Object>> playactorMM = Util.listToMM(playactors, ",", "film_id", "playactor_type");
Map<String, Map<String, Object>> issuerMM = Util.listToMM(issuers, ",", "film_id");
Map<String, Map<String, Object>> showMM = Util.listToMM(shows, ",", "film_id");
for(Map<String, Object> map : list) { for(Map<String, Object> map : list) {
String id_str = "" + map.get("id"); String film_country = (String)map.get("film_country");
for(String playactor_type : playactorTypes.keySet()) { String film_country_cn = countryMap.get(film_country);
Map<String, Object> playactorMap = playactorMM.get(id_str + "," + playactor_type); map.put("film_country_cn", film_country_cn);
map.put(playactor_type, playactorMap == null ? null : playactorMap.get("text"));
}
Map<String, Object> issuerMap = issuerMM.get(id_str);
Map<String, Object> showMap = showMM.get(id_str);
map.put("issuer", issuerMap == null ? null : issuerMap.get("text"));
map.put("show", showMap == null ? null : showMap.get("text"));
this.replaceEnumValue(map, "film_type_name", filmTypes);
this.replaceEnumValue(map, "film_type_name_short", filmShortTypes);
this.replaceEnumValue(map, "enroll_type_name", enrollTypes);
this.replaceEnumValue(map, "enroll_type_name_other", enrollOtherTypes);
this.replaceEnumValue(map, "state", states);
this.replaceEnumValue(map, "apply_state", applyStates);
this.replaceEnumValue(map, "film_medium", filmMedium);
this.replaceEnumValue(map, "film_format", filmFormat);
this.replaceEnumValue(map, "play_shanghai", playShanghai);
this.replaceEnumValue(map, "is_viewer_metting", YN);
this.replaceEnumValue(map, "is_important", YN);
this.replaceEnumValue(map, "is_night", YN);
this.replaceEnumValue(map, "is_copy_key", YN);
}
return list;
}
public void export(OutputStream os) { String co_production_country = (String)map.get("co_production_country");
List<Map<String, Object>> list = this.queryFilmDataList(null, null, null, null, null, null, null, null, null, null, null,null, null, null, null); String co_production_country_cn = countryMap.get(co_production_country);
List<String> argsList = new ArrayList<String>(); map.put("co_production_country_cn", co_production_country_cn);
List<String> titleList = new ArrayList<String>();
Map<String, String> map = this.getAllTitles(null);
for(String key : map.keySet()) {
argsList.add(key);
titleList.add(map.get(key));
}
ExcelUtil.excel(os, argsList.toArray(new String[argsList.size()]), titleList.toArray(new String[titleList.size()]), null, list);
}
public void export( String dialogue_lang = (String)map.get("dialogue_lang");
OutputStream os, String dialogue_lang_cn = countryMap.get(dialogue_lang);
Integer admin_group_id, map.put("dialogue_lang_cn", dialogue_lang_cn);
String keyword,
Integer state,
Integer apply_state,
Integer film_type,
Integer enroll_type,
Integer upload_state,
String film_country,
Integer film_type_short,
String play_shanghai,
Integer review_round,
Integer review_state,
Integer allot_atate,
Integer opt_state,
Integer[] film_group_id,
String[] columns) {
List<Map<String, Object>> list = this.queryFilmDataList(
admin_group_id,
keyword,
state,
apply_state,
film_type,
enroll_type,
upload_state,
film_country,
film_type_short,
play_shanghai,
review_round,
review_state,
allot_atate,
opt_state,
film_group_id);
List<String> argsList = new ArrayList<String>();
List<String> titleList = new ArrayList<String>();
Map<String, String> map = this.getAllTitles(columns);
for(String key : map.keySet()) {
argsList.add(key);
titleList.add(map.get(key));
}
ExcelUtil.excel(os, argsList.toArray(new String[argsList.size()]), titleList.toArray(new String[titleList.size()]), null, list);
}
public Map<String, String> getAllTitles(String[] columns) { String subtitle_lang = (String)map.get("subtitle_lang");
Map<String, String> map = new LinkedHashMap<String, String>(); String subtitle_lang_cn = countryMap.get(subtitle_lang);
Class<?> clz = Fc_member_film.class; map.put("subtitle_lang_cn", subtitle_lang_cn);
Field[] fs = clz.getDeclaredFields();
for(Field f : fs) {
String columnName = f.getName();
String columnComment = columnName;
if(f.isAnnotationPresent(Column.class)) {
Column column = f.getAnnotation(Column.class);
if(StringUtil.isNotBlank(column.name())) {
columnName = column.name();
}
String columnDefinition = column.columnDefinition();
if(StringUtil.isNotBlank(columnDefinition)) {
String regex = "COMMENT '(.+)'";
String[] strs = StringUtil.search(columnDefinition, regex, 1);
String comment = (strs == null || strs.length == 0 ? null : strs[0]);
if(StringUtil.isNotBlank(comment)) {
columnComment = comment;
}
}
} }
if(!StringUtil.contains(exclude, columnName) && (columns == null || columns.length == 0 || StringUtil.contains(columns, columnName))) {
map.put(columnName, columnComment);
}
}
for(String key : titles.keySet()) {
if(columns == null || columns.length == 0 || StringUtil.contains(columns, key)) {
String title = titles.get(key);
if(StringUtil.isBlank(title)) {
title = key;
}
map.put(key, title);
}
}
for(String key : map.keySet()) {
map.put(key, map.get(key).split("\\s+")[0]);
}
return map;
} }
private void replaceEnumValue(Map<String, Object> map, String columnName, Map<String, String> values) {
if(map.containsKey(columnName)) {
String columnValue = String.valueOf(map.get(columnName));
String[] ary = columnValue.split(",");
List<String> list = new ArrayList<String>();
for(String s : ary) {
list.add(values.get(s));
}
map.put(columnName, StringUtil.join(",", list));
}
}
} }
...@@ -420,7 +420,7 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -420,7 +420,7 @@ public class ReviewServiceImpl implements ReviewService {
asiaNew.setOriginal_name(film.getOrigion_name()); asiaNew.setOriginal_name(film.getOrigion_name());
Map<String, Object> fields = new HashMap<String, Object>(); Map<String, Object> fields = new HashMap<String, Object>();
String sql = "select rr.user_group_id, rre.ext_type, rre.ext_name, avg(rre.ext_score) ext_score from fc_review_record rr, fc_review_record_ext rre where rre.record_id = rr.id and rr.review_id = " + review_id + " and rr.review_round = " + review_round + " group by rr.user_group_id, rre.ext_type, rre.ext_name"; String sql = "select rr.user_group_id, rre.ext_type, rre.ext_name, avg(rre.ext_score) ext_score, sum(rre.ext_score) ext_score_sum from fc_review_record rr, fc_review_record_ext rre where rre.record_id = rr.id and rr.review_id = " + review_id + " and rr.review_round = " + review_round + " group by rr.user_group_id, rre.ext_type, rre.ext_name";
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
if(list != null && list.size() > 0) { if(list != null && list.size() > 0) {
for(Map<String, Object> map : list) { for(Map<String, Object> map : list) {
...@@ -428,6 +428,7 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -428,6 +428,7 @@ public class ReviewServiceImpl implements ReviewService {
String ext_type = (String)map.get("ext_type"); String ext_type = (String)map.get("ext_type");
String ext_name = (String)map.get("ext_name"); String ext_name = (String)map.get("ext_name");
BigDecimal ext_score = BigDecimal.valueOf((Double)map.get("ext_score")).setScale(2, BigDecimal.ROUND_HALF_UP); BigDecimal ext_score = BigDecimal.valueOf((Double)map.get("ext_score")).setScale(2, BigDecimal.ROUND_HALF_UP);
BigDecimal ext_score_sum = BigDecimal.valueOf((Double)map.get("ext_score_sum")).setScale(2, BigDecimal.ROUND_HALF_UP);
String setScoreFildName = "item_" + ext_type; String setScoreFildName = "item_" + ext_type;
String setDataFieldName = "item_" + ext_type + "_data"; String setDataFieldName = "item_" + ext_type + "_data";
...@@ -452,6 +453,7 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -452,6 +453,7 @@ public class ReviewServiceImpl implements ReviewService {
Map<String, Object> scoreMap = new HashMap<String, Object>(); Map<String, Object> scoreMap = new HashMap<String, Object>();
scoreMap.put("ext_name", ext_name); scoreMap.put("ext_name", ext_name);
scoreMap.put("ext_score", ext_score); scoreMap.put("ext_score", ext_score);
scoreMap.put("ext_score_sum", ext_score_sum);
datas.add(scoreMap); datas.add(scoreMap);
} }
......
package com.egolm.film.api.web;
import java.util.HashMap;
import java.util.Map;
public class ExportConstant {
public static final Map<String, String> playactorTypes = new HashMap<String, String>();
static {
playactorTypes.put("director", "导演");
playactorTypes.put("producer", "制片人");
playactorTypes.put("screenwriter", "编剧");
playactorTypes.put("photographer", "摄影");
playactorTypes.put("actor", "男演员");
playactorTypes.put("actress", "女演员");
playactorTypes.put("issuser", "发行方");
playactorTypes.put("show", "参加过的电视节");
}
public static final Map<String, String> filmTypes = new HashMap<String, String>();
static {
filmTypes.put("1", "剧情片");
filmTypes.put("2", "纪录片");
filmTypes.put("3", "动画片");
filmTypes.put("4", "短片");
}
public static final Map<String, String> filmShortTypes = new HashMap<String, String>();
static {
filmShortTypes.put("1", "欧洲");
filmShortTypes.put("2", "亚太");
filmShortTypes.put("3", "美非");
filmShortTypes.put("4", "华语");
filmShortTypes.put("5", "纪录片");
filmShortTypes.put("6", "动画片");
filmShortTypes.put("7", "真人短片");
filmShortTypes.put("8", "动画短片");
}
public static final Map<String, String> enrollTypes = new HashMap<String, String>();
static {
enrollTypes.put("1", "金爵奖国际影片评选");
enrollTypes.put("2", "亚洲新人奖国际影片评选");
enrollTypes.put("3", "电影频道传媒关注");
enrollTypes.put("4", "国际电影展映");
}
public static final Map<String, String> enrollOtherTypes = new HashMap<String, String>();
static {
enrollOtherTypes.put("1", "最佳导演");
enrollOtherTypes.put("2", "最佳女演员");
enrollOtherTypes.put("3", "最佳男演员");
enrollOtherTypes.put("4", "最佳编剧");
enrollOtherTypes.put("5", "最佳摄影");
enrollOtherTypes.put("6", "真人短片");
enrollOtherTypes.put("7", "动画短片");
enrollOtherTypes.put("8", "最佳影片");
}
public static final Map<String, String> states = new HashMap<String, String>();
static {
states.put("1", "未提交");
states.put("2", "已提交");
}
public static final Map<String, String> applyStates = new HashMap<String, String>();
static {
applyStates.put("1", "未受理");
applyStates.put("2", "初审通过");
applyStates.put("3", "初审否决");
}
public static final Map<String, String> YN = new HashMap<String, String>();
static {
YN.put("0", "否");
YN.put("1", "是");
}
public static final Map<String, String> filmMedium = new HashMap<String, String>();
static {
filmMedium.put("1", "彩色");
filmMedium.put("2", "黑白");
filmMedium.put("3", "彩色+黑白");
}
public static final Map<String, String> filmFormat = new HashMap<String, String>();
static {
filmFormat.put("1", "移动存储");
filmFormat.put("2", "在线连接");
}
public static final Map<String, String> playShanghai = new HashMap<String, String>();
static {
playShanghai.put("1", "世界首映");
playShanghai.put("2", "国籍首映");
playShanghai.put("3", "亚洲首映");
playShanghai.put("4", "中国首映");
}
}
package com.egolm.film.api.web; package com.egolm.film.api.web;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -11,6 +15,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -11,6 +15,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.DateUtil;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.film.api.service.AdminTokenService; import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.ExportService; import com.egolm.film.api.service.ExportService;
...@@ -186,4 +191,13 @@ public class FilmController { ...@@ -186,4 +191,13 @@ public class FilmController {
return Rjx.jsonOk().set("id", filmBase.getId()); return Rjx.jsonOk().set("id", filmBase.getId());
} }
@ResponseBody
@PostMapping("exportApplyList")
@ApiOperation("导出报名列表")
public void exportApplyList(HttpServletResponse response) throws IOException {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报名影片列表[" + DateUtil.format(new Date(), "yyMMdd-HHmmss") + "].xls", "UTF-8"));
exportService.exportApplyList(response.getOutputStream());
}
} }
package com.egolm.film.api.web.admin; package com.egolm.film.api.web.admin;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -15,18 +13,15 @@ import org.slf4j.LoggerFactory; ...@@ -15,18 +13,15 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.DateUtil;
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.AdminTokenService; import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.EmailService; import com.egolm.film.api.service.EmailService;
import com.egolm.film.api.service.ExportService;
import com.egolm.film.api.service.FilmService; import com.egolm.film.api.service.FilmService;
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;
...@@ -63,9 +58,6 @@ public class AdminFirstController { ...@@ -63,9 +58,6 @@ public class AdminFirstController {
@Autowired @Autowired
ReviewService reviewService; ReviewService reviewService;
@Autowired
ExportService exportService;
@ResponseBody @ResponseBody
@PostMapping("list") @PostMapping("list")
@ApiOperation("影片列表") @ApiOperation("影片列表")
...@@ -105,46 +97,6 @@ public class AdminFirstController { ...@@ -105,46 +97,6 @@ public class AdminFirstController {
return Rjx.jsonOk().setData(list).setPage(page); return Rjx.jsonOk().setData(list).setPage(page);
} }
@GetMapping("exportExcel")
@ApiOperation("影片列表导出")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="keyword", value="关键字"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="state", value="影片状态 1未提交 2 已提交"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="apply_state", value="初审状态 1未初审 2初审通过 3初审否决"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="film_type", value="影片类型"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="enroll_type", value="影片性质"),
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="film_country", value="影片国家地区"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="film_type_short", value="影片扩展分类"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="upload_state", value="影片文件上传状态(0,1)"),
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="play_shanghai", value="首映情况"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="review_round", value="审片轮数,第几轮审片"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="review_state", value="审片结论 1通过 2否决 3参赛 4参赛备选 5参展"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="allot_atate", value="评委分配状态 0未分配评委 1已分配评委评选中"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="opt_state", value="评选状态 0未评选 1有争议 2管理员分配 3已完成"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="film_group_id", value="影片分组ID"),
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="columns", value="数据导出时导出列" , allowMultiple=true),
})
public void exportExcel(
String keyword, String film_country, String play_shanghai,
Integer state, Integer apply_state, Integer film_type, Integer enroll_type, Integer upload_state, Integer film_type_short,
Integer review_round, Integer review_state, Integer allot_atate, Integer opt_state, Integer[] film_group_id,
String[] columns,
HttpServletRequest request,
HttpServletResponse response) throws IOException {
Fc_admin admin = Util.mapTo(tokenService.getTokenObj(), Fc_admin.class);
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("影片列表[" + DateUtil.format(new Date(), "yyMMdd-HHmmss") + "].xls", "UTF-8"));
exportService.export(response.getOutputStream(), admin.getGroup_id(), keyword, state, apply_state, film_type, enroll_type, upload_state, film_country, film_type_short, play_shanghai, review_round, review_state, allot_atate, opt_state, film_group_id, columns);
}
@Transactional
@ResponseBody
@PostMapping("exportColumns")
@ApiOperation("查看导出列")
public Object exportColumns() {
return Rjx.jsonOk().setData(exportService.getAllTitles(null));
}
@ResponseBody @ResponseBody
@Transactional @Transactional
@PostMapping("pass") @PostMapping("pass")
......
package com.egolm.film.config;
public class Constant {
}
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