Commit 7694579b authored by Quxl's avatar Quxl

x

parent 748cacf6
......@@ -7,7 +7,7 @@ import javax.servlet.ServletOutputStream;
public interface ExportService {
Map<String, String> getApplyListColumns();
void exportApplyList(ServletOutputStream os, String[] columns);
void exportApplyList(ServletOutputStream os, String[] columns, String keyword, Integer apply_state, Integer enroll_type_id, Integer film_type_id, String film_country);
Map<String, String> getApplyPassListColumns();
......
......@@ -20,6 +20,7 @@ import com.egolm.film.api.service.CountryService;
import com.egolm.film.api.service.ExportService;
import com.egolm.film.api.service.LanguageService;
import com.egolm.film.api.web.ExportConstant;
import com.egolm.film.util.SqlWhere;
@Service
public class ExportServiceImpl implements ExportService {
......@@ -77,7 +78,13 @@ public class ExportServiceImpl implements ExportService {
}
@Override
public void exportApplyList(ServletOutputStream os, String[] columns) {
public void exportApplyList(ServletOutputStream os, String[] columns, String keyword, Integer apply_state, Integer enroll_type_id, Integer film_type_id, String film_country) {
SqlWhere where = new SqlWhere();
where.eq("mf.state", 2).lk("mf.keywords", keyword).eq("mf.apply_state", apply_state).lk("mf.film_type_name", film_type_id).eq("mf.film_country", film_country);
String sqlFilm = "fc_member_film";
if(enroll_type_id != null) {
sqlFilm = "(select mf0.* from fc_member_film mf0, fc_member_film_enroll mfe where mf0.id = mfe.film_id and mfe.enroll_type_id = " + enroll_type_id + ")";
}
String sql = ""
+ "select "
+ "mf.id, "
......@@ -109,9 +116,7 @@ public class ExportServiceImpl implements ExportService {
+ "mf.film_type_name_short, "
+ "mf.apply_state "
+ " from "
+ "fc_member_film mf "
+ "where "
+ "state = 2";
+ sqlFilm + " mf " + StringUtil.join(" and ", " where ", "", "", where.getStringList());
List<Map<String, Object>> list = jdbcTemplate.limitAll(sql, new Page(1L, 1000L, new String[] {"film_no asc", "id asc"}));
for(Map<String, Object> map : list) {
Integer filmNo = Util.toInt(map.get("film_no"));
......
......@@ -260,10 +260,10 @@ public class AdminFirstController {
@GetMapping("exportApplyList")
@ApiOperation("导出报名列表")
public void exportApplyList(HttpServletResponse response, String[] columns) throws IOException {
public void exportApplyList(String keyword, Integer apply_state, Integer enroll_type_id, Integer film_type_id, String film_country, HttpServletResponse response, String[] columns) 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(), columns);
exportService.exportApplyList(response.getOutputStream(), columns, keyword, apply_state, enroll_type_id, film_type_id, film_country);
}
@ResponseBody
......
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