Commit d567c702 authored by Quxl's avatar Quxl

x

parent fab9f869
package com.egolm.film.api.web;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.DateUtil;
import com.egolm.common.bean.Rjx;
import com.egolm.film.api.service.ExportService;
import com.egolm.film.api.service.FilmService;
import com.egolm.film.bean.Fc_member_film;
import com.egolm.film.bean.Fc_member_film_issuer;
......@@ -30,6 +38,9 @@ public class FilmController {
@Autowired
FilmService memberFilmService;
@Autowired
ExportService exportService;
@ResponseBody
@PostMapping("get_detail")
@ApiOperation("获取全部申报信息")
......@@ -153,4 +164,13 @@ public class FilmController {
return Rjx.jsonOk().set("id", filmBase.getId());
}
@Transactional
@GetMapping("exportExcel")
@ApiOperation("导出Excel")
public void exportExcel(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.export(response.getOutputStream());
}
}
package com.egolm.film.api.web.admin;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -24,13 +18,11 @@ import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import com.egolm.common.DateUtil;
import com.egolm.common.StringUtil;
import com.egolm.common.Util;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.ExportService;
import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_admin;
import com.egolm.film.bean.Fc_logs_ext;
......@@ -58,9 +50,6 @@ public class WebUtilController {
@Autowired
AdminTokenService tokenService;
@Autowired
ExportService exportService;
@Autowired
private RequestMappingHandlerMapping requestMappingHandlerMapping;
......@@ -193,12 +182,4 @@ public class WebUtilController {
return Rjx.jsonOk();
}
@Transactional
@GetMapping("exportExcel")
@ApiOperation("导出Excel")
public void exportExcel(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.export(response.getOutputStream());
}
}
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