Commit d0cf6122 authored by Quxl's avatar Quxl

x

parent 7694579b
......@@ -7,10 +7,10 @@ import javax.servlet.ServletOutputStream;
public interface ExportService {
Map<String, String> getApplyListColumns();
void exportApplyList(ServletOutputStream os, String[] columns, String keyword, Integer apply_state, Integer enroll_type_id, Integer film_type_id, String film_country);
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);
Map<String, String> getApplyPassListColumns();
void exportApplyPassList(ServletOutputStream os, String[] columns);
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);
}
......@@ -18,9 +18,9 @@ import com.egolm.common.jdbc.JdbcTemplate;
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.FilmService;
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 {
......@@ -28,6 +28,9 @@ public class ExportServiceImpl implements ExportService {
@Autowired
JdbcTemplate jdbcTemplate;
@Autowired
FilmService filmService;
Map<String, String> countryMap;
Map<String, String> languageMap;
......@@ -78,46 +81,8 @@ public class ExportServiceImpl implements ExportService {
}
@Override
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, "
+ "mf.film_no, "
+ "mf.en_name, "
+ "mf.cn_name, "
+ "mf.film_type_name, "
+ "mf.first_show_date, "
+ "mf.first_show_city, "
+ "mf.other_filmfest_name, "
+ "mf.film_medium, "
+ "mf.film_format, "
+ "mf.completion_date, "
+ "mf.film_country, "
+ "mf.co_production_country, "
+ "mf.enroll_type_name, "
+ "mf.state, "
+ "mf.dialogue_lang, "
+ "mf.subtitle_lang, "
+ "mf.play_shanghai, "
+ "mf.film_total_time, "
+ "mf.film_apply_company, "
+ "mf.film_apply_realname, "
+ "mf.film_apply_email, "
+ "mf.film_apply_mobile, "
+ "mf.film_apply_country, "
+ "mf.film_format_url, "
+ "mf.film_format_passw, "
+ "mf.film_type_name_short, "
+ "mf.apply_state "
+ " from "
+ 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"}));
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) {
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) {
Integer filmNo = Util.toInt(map.get("film_no"));
map.put("film_no", filmNo == null ? null : StringUtil.formatLength(filmNo.toString(), "0000"));
......@@ -212,47 +177,8 @@ public class ExportServiceImpl implements ExportService {
}
@Override
public void exportApplyPassList(ServletOutputStream os, String[] columns) {
String sql = ""
+ "select "
+ "mf.id, "
+ "mf.film_no, "
+ "mf.en_name, "
+ "mf.cn_name, "
+ "mf.film_type_name, "
+ "mf.enroll_type_name, "
+ "mf.film_total_time, "
+ "mf.film_medium, "
+ "mf.film_country, "
+ "mf.co_production_country, "
+ "mf.dialogue_lang, "
+ "mf.subtitle_lang, "
+ "mf.completion_date, "
+ "mf.play_shanghai, "
+ "mf.prize, "
+ "mf.first_show_date, "
+ "mf.first_show_city, "
+ "mf.other_filmfest_name, "
+ "mf.enroll_type_name_other, "
+ "mf.film_apply_company, "
+ "mf.film_apply_realname, "
+ "mf.film_apply_email, "
+ "mf.film_apply_tel, "
+ "mf.film_apply_mobile, "
+ "mf.film_type_name_short, "
+ "mf.film_format, "
+ "mf.film_format_url, "
+ "mf.film_format_passw, "
+ "mf.remark, "
+ "r.id review_id, "
+ "r.review_round, "
+ "r.review_state, "
+ "r.opt_state "
+ " from "
+ "fc_member_film mf left join fc_review r on r.film_id = mf.id "
+ "where "
+ "state = 2 and apply_state = 2";
List<Map<String, Object>> list = jdbcTemplate.limitAll(sql, new Page(1L, 1000L, new String[] {"film_no asc"}));
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) {
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 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";
......@@ -321,13 +247,13 @@ public class ExportServiceImpl implements ExportService {
String review_text_3 = (String)recordMap.get("review_text_3");
String review_text_4 = (String)recordMap.get("review_text_4");
Double review_score = Util.toDouble(recordMap.get("review_score"));
Integer review_state = Util.toInt(recordMap.get("review_state"));
Integer record_review_state = Util.toInt(recordMap.get("review_state"));
sb.append("评委:").append(realname).append("\r\n");
if(review_score != null) {
sb.append("评分:").append(review_score).append("\r\n");
}
if(review_state != null) {
sb.append("结论:").append(ExportConstant.reviewState[Integer.valueOf(review_state)]).append("\r\n");
if(record_review_state != null) {
sb.append("结论:").append(ExportConstant.reviewState[Integer.valueOf(record_review_state)]).append("\r\n");
}
if(StringUtil.isNotBlank(review_text)) {
sb.append("评论:").append(review_text).append("\r\n");
......
......@@ -260,10 +260,37 @@ public class AdminFirstController {
@GetMapping("exportApplyList")
@ApiOperation("导出报名列表")
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 {
@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="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
@ApiImplicitParam(paramType="query", dataType="string", required=true, name="limitKey", value="排序"),
})
public void exportApplyList(
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,
Long index,
Long limit,
String[] limitKey,
HttpServletResponse response, String[] columns) 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.exportApplyList(response.getOutputStream(), columns, keyword, apply_state, enroll_type_id, film_type_id, film_country);
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);
}
@ResponseBody
......@@ -275,10 +302,18 @@ public class AdminFirstController {
@GetMapping("exportApplyPassList")
@ApiOperation("导出影片列表")
public void exportApplyPassList(HttpServletResponse response, String[] columns) throws IOException {
public void exportApplyPassList(
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,
Long index,
Long limit,
String[] limitKey,
HttpServletResponse response, String[] columns) 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.exportApplyPassList(response.getOutputStream(), columns);
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);
}
}
\ 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