Commit bf8f2ef8 authored by Quxl's avatar Quxl

x

parent d0cf6122
package com.egolm.film.api.service; package com.egolm.film.api.service;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -7,10 +8,10 @@ import javax.servlet.ServletOutputStream; ...@@ -7,10 +8,10 @@ import javax.servlet.ServletOutputStream;
public interface ExportService { public interface ExportService {
Map<String, String> getApplyListColumns(); Map<String, String> getApplyListColumns();
void exportApplyList(ServletOutputStream os, String[] columns, Integer admin_group_id, String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, 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); void exportApplyList(ServletOutputStream os, String[] columns, List<Map<String, Object>> list);
Map<String, String> getApplyPassListColumns(); Map<String, String> getApplyPassListColumns();
void exportApplyPassList(ServletOutputStream os, String[] columns, Integer admin_group_id, String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, 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); void exportApplyPassList(ServletOutputStream os, String[] columns, List<Map<String, Object>> list);
} }
...@@ -81,8 +81,7 @@ public class ExportServiceImpl implements ExportService { ...@@ -81,8 +81,7 @@ public class ExportServiceImpl implements ExportService {
} }
@Override @Override
public void exportApplyList(ServletOutputStream os, String[] columns, Integer admin_group_id, String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, 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) { public void exportApplyList(ServletOutputStream os, String[] columns, List<Map<String, Object>> list) {
List<Map<String, Object>> list = filmService.queryFilmList(admin_group_id, keyword, state, apply_state, upload_state, film_type, enroll_type, film_country, film_type_short, play_shanghai, review_round, review_state, allot_atate, opt_state, film_group_id, new Page(1L, 9999999999L, new String[] {"id asc"}));
for(Map<String, Object> map : list) { for(Map<String, Object> map : list) {
Integer filmNo = Util.toInt(map.get("film_no")); Integer filmNo = Util.toInt(map.get("film_no"));
map.put("film_no", filmNo == null ? null : StringUtil.formatLength(filmNo.toString(), "0000")); map.put("film_no", filmNo == null ? null : StringUtil.formatLength(filmNo.toString(), "0000"));
...@@ -177,8 +176,7 @@ public class ExportServiceImpl implements ExportService { ...@@ -177,8 +176,7 @@ public class ExportServiceImpl implements ExportService {
} }
@Override @Override
public void exportApplyPassList(ServletOutputStream os, String[] columns, Integer admin_group_id, String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, 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) { public void exportApplyPassList(ServletOutputStream os, String[] columns, List<Map<String, Object>> list) {
List<Map<String, Object>> list = filmService.queryFilmList(admin_group_id, keyword, state, apply_state, upload_state, film_type, enroll_type, film_country, film_type_short, play_shanghai, review_round, review_state, allot_atate, opt_state, film_group_id, new Page(1L, 9999999999L, new String[] {"film_no asc"}));
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 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 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 rr.*, u.realname from fc_review_record rr left join fc_user u on u.uid = rr.user_id"; String sql2 = "select rr.*, u.realname from fc_review_record rr left join fc_user u on u.uid = rr.user_id";
......
...@@ -290,7 +290,8 @@ public class AdminFirstController { ...@@ -290,7 +290,8 @@ public class AdminFirstController {
Fc_admin admin = Util.mapTo(tokenService.getTokenObj(), Fc_admin.class); Fc_admin admin = Util.mapTo(tokenService.getTokenObj(), Fc_admin.class);
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报名列表[" + DateUtil.format(new Date(), "yyMMdd-HHmmss") + "].xls", "UTF-8")); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("报名列表[" + DateUtil.format(new Date(), "yyMMdd-HHmmss") + "].xls", "UTF-8"));
exportService.exportApplyList(response.getOutputStream(), columns, admin.getGroup_id(), keyword, state, apply_state, upload_state, film_type, enroll_type, film_country, film_type_short, play_shanghai, review_round, review_state, allot_atate, opt_state, film_group_id); List<Map<String, Object>> list = filmService.queryFilmList(admin.getGroup_id(), keyword, state, apply_state, upload_state, film_type, enroll_type, film_country, film_type_short, play_shanghai, review_round, review_state, allot_atate, opt_state, film_group_id, new Page(1L, 9999999999L, new String[] {"id asc"}));
exportService.exportApplyList(response.getOutputStream(), columns, list);
} }
@ResponseBody @ResponseBody
...@@ -313,7 +314,8 @@ public class AdminFirstController { ...@@ -313,7 +314,8 @@ public class AdminFirstController {
Fc_admin admin = Util.mapTo(tokenService.getTokenObj(), Fc_admin.class); Fc_admin admin = Util.mapTo(tokenService.getTokenObj(), Fc_admin.class);
response.setContentType("application/octet-stream"); response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("影片列表[" + DateUtil.format(new Date(), "yyMMdd-HHmmss") + "].xls", "UTF-8")); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("影片列表[" + DateUtil.format(new Date(), "yyMMdd-HHmmss") + "].xls", "UTF-8"));
exportService.exportApplyPassList(response.getOutputStream(), columns, admin.getGroup_id(), keyword, state, apply_state, upload_state, film_type, enroll_type, film_country, film_type_short, play_shanghai, review_round, review_state, allot_atate, opt_state, film_group_id); List<Map<String, Object>> list = filmService.queryFilmList(admin.getGroup_id(), keyword, state, apply_state, upload_state, film_type, enroll_type, film_country, film_type_short, play_shanghai, review_round, review_state, allot_atate, opt_state, film_group_id, new Page(1L, 9999999999L, new String[] {"film_no asc"}));
exportService.exportApplyPassList(response.getOutputStream(), columns, list);
} }
} }
\ No newline at end of file
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