Commit 04d18335 authored by Quxl's avatar Quxl

x

parent 36473887
...@@ -14,4 +14,7 @@ public interface ExportService { ...@@ -14,4 +14,7 @@ public interface ExportService {
Map<String, String> getApplyPassListColumns(); Map<String, String> getApplyPassListColumns();
void exportApplyPassList(ServletOutputStream os, String[] columns, List<Map<String, Object>> list); void exportApplyPassList(ServletOutputStream os, String[] columns, List<Map<String, Object>> list);
Map<String, String> getReviewPassListColumns();
void exportReviewPassList(ServletOutputStream os, String[] columns, List<Map<String, Object>> list);
} }
...@@ -11,7 +11,7 @@ public interface FilmGroupService { ...@@ -11,7 +11,7 @@ public interface FilmGroupService {
List<Map<String, Object>> queryFilmListByGroupId(Integer film_group_id); List<Map<String, Object>> queryFilmListByGroupId(Integer film_group_id);
void updateFilmGroupId(Integer[] film_id, Integer group_id); void updateFilmGroupId(Integer[] film_id, Integer group_id, String group_remark);
void removeFilmGroupById(Integer[] id); void removeFilmGroupById(Integer[] id);
......
...@@ -304,4 +304,226 @@ public class ExportServiceImpl implements ExportService { ...@@ -304,4 +304,226 @@ public class ExportServiceImpl implements ExportService {
ExcelUtil.excel(os, columnList.toArray(new String[columnList.size()]), titleList.toArray(new String[titleList.size()]), null, list); ExcelUtil.excel(os, columnList.toArray(new String[columnList.size()]), titleList.toArray(new String[titleList.size()]), null, list);
} }
@Override
public Map<String, String> getReviewPassListColumns() {
Map<String, String> columns = new LinkedHashMap<String, String>();
columns.put("film_no", "影片编号");
columns.put("en_name", "英文名称");
columns.put("cn_name", "中文片名");
columns.put("film_type_name", "影片类型");
columns.put("enroll_type_name", "报名性质");
columns.put("film_total_time", "时长");
columns.put("film_medium", "色彩");
columns.put("film_country", "制片国");
columns.put("film_country_cn", "制片国(中文)");
columns.put("co_production_country", "合拍国");
columns.put("co_production_country_cn", "合拍国(中文)");
columns.put("dialogue_lang", "对白语言");
columns.put("dialogue_lang_cn", "对白语言(中文)");
columns.put("subtitle_lang", "字幕语言");
columns.put("subtitle_lang_cn", "字幕语言(中文)");
columns.put("completion_date", "完成日期");
columns.put("play_shanghai", "该片在上海电影节放映是");
columns.put("prize", "参加过的电影节");
columns.put("first_show_date", "首次上映时间");
columns.put("first_show_city", "首次上映城市");
columns.put("other_filmfest_name", "同时申报的电影节");
columns.put("enroll_type_name_other", "申报奖项");
columns.put("synopsis_cn", "影片简介中文");
columns.put("synopsis_en", "影片简介英文");
columns.put("director_cn", "导演中文名");
columns.put("director_en", "导演英文名");
columns.put("director_biography_cn", "导演中文简介");
columns.put("director_biography_en", "导演英文简介");
columns.put("producer_cn", "制片人中文名");
columns.put("producer_en", "制片人英文名");
columns.putAll(ExportConstant.playactorTypes);
columns.put("film_apply_company", "申报公司");
columns.put("film_apply_realname", "申报人姓名");
columns.put("film_apply_email", "申报人邮箱");
columns.put("film_apply_tel", "申报人电话");
columns.put("film_apply_mobile", "申报人手机");
columns.put("film_type_name_short", "区域类型");
columns.put("film_format", "样片规格");
columns.put("film_format_url", "样片URL");
columns.put("film_format_passw", "样片URL密码");
columns.put("reviewText", "审片进度");
columns.put("round_1_text", "一选审片详情");
columns.put("round_2_text", "二选审片详情");
columns.put("round_3_text", "三选审片详情");
columns.put("round_4_text", "影片把关审片详情");
columns.put("round_5_text", "选片委员会审片详情");
columns.put("round_6_text", "电影总局审片详情");
columns.put("group_remark", "终审归档");
columns.put("is_viewer_metting", "观众见面会");
columns.put("film_requirement", "片方要求");
columns.put("is_copy_key", "拷贝密钥");
columns.put("show_number", "放映场次");
columns.put("copy_options", "拷贝");
columns.put("is_important", "重点影片");
columns.put("is_night", "夜场");
columns.put("level_text", "级别评定");
columns.put("charge_show_currency", "费用币种");
columns.put("charge_show", "放映费用");
columns.put("charge_key_currency", "费用币种");
columns.put("charge_key", "密钥费用");
columns.put("charge_copy_currency", "费用币种");
columns.put("charge_copy", "拷贝运输费");
columns.put("format", "放映格式");
columns.put("screenplay", "编剧");
columns.put("director_of_photography", "摄影知道");
columns.put("music", "音乐");
columns.put("production_designer", "艺术指导");
columns.put("executive_producer", "执行制片");
columns.put("editor", "剪辑");
columns.put("cast", "主要演员制片人");
columns.put("world_sales", "国籍销售");
columns.put("resolution", "分辨率");
columns.put("aspect_ratio", "画幅");
columns.put("sound_format", "音频");
columns.put("frame_rate", "帧数");
columns.put("kdm", "密钥");
return columns;
}
@Override
public void exportReviewPassList(ServletOutputStream os, String[] columns, List<Map<String, Object>> list) {
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";
String sql3 = "select rre.* from fc_review_record_ext rre";
String sql4 = "select * from fc_member_film_ext";
List<Map<String, Object>> playactors = jdbcTemplate.limitAll(sql0, new Page(1L, 1000L));
List<Map<String, Object>> issuers = jdbcTemplate.limitAll(sql1, new Page(1L, 1000L));
List<Map<String, Object>> records = jdbcTemplate.limitAll(sql2, new Page(1L, 1000L));
List<Map<String, Object>> recordExts = jdbcTemplate.limitAll(sql3, new Page(1L, 1000L));
List<Map<String, Object>> filmExts = jdbcTemplate.limitAll(sql4, new Page(1L, 1000L));
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, List<Map<String, Object>>> recordML = Util.listToML(records, ",", "review_id", "review_round");
Map<String, List<Map<String, Object>>> recordExtML = Util.listToML(recordExts, ",", "record_id");
Map<String, Map<String, Object>> filmExtMM = Util.listToMM(filmExts, ",", "id");
for(Map<String, Object> map : list) {
String id_str = "" + map.get("id");
for(String playactor_type : ExportConstant.playactorTypes.keySet()) {
Map<String, Object> playactorMap = playactorMM.get(id_str + "," + playactor_type);
map.put(playactor_type, playactorMap == null ? null : playactorMap.get("text"));
}
Map<String, Object> issuerMap = issuerMM.get(id_str);
map.put("issuer", issuerMap == null ? null : issuerMap.get("text"));
Integer filmNo = Util.toInt(map.get("film_no"));
map.put("film_no", filmNo == null ? null : StringUtil.formatLength(filmNo.toString(), "0000"));
map.put("film_country_cn", countryMap.get(map.get("film_country")));
map.put("co_production_country_cn", countryMap.get(map.get("co_production_country")));
map.put("dialogue_lang_cn", languageMap.get(map.get("dialogue_lang")));
map.put("subtitle_lang_cn", languageMap.get(map.get("subtitle_lang")));
map.put("film_type_name", ExportConstant.filmTypes.get(map.get("film_type_name")));
map.put("film_type_name_short", ExportConstant.filmShortTypes.get(map.get("film_type_name_short")));
map.put("film_medium", ExportConstant.filmMedium.get(String.valueOf(map.get("film_medium"))));
map.put("film_format", ExportConstant.filmFormat.get(String.valueOf(map.get("film_format"))));
map.put("play_shanghai", ExportConstant.playShanghai.get(String.valueOf(map.get("play_shanghai"))));
for(String key: new String[] {"is_viewer_metting", "is_copy_key", "is_important", "is_night"}) {
map.put(key, ExportConstant.YN.get(String.valueOf(map.get(key))));
}
map.putAll(filmExtMM.get(id_str));
Integer reviewRound = (Integer)map.get("review_round");
Integer reviewState = (Integer)map.get("review_state");
Integer optState = (Integer)map.get("opt_state");
String reviewText = ExportConstant.rounds[reviewRound] + (reviewState != null && reviewState != 0 ? ExportConstant.reviewState[reviewState] : ExportConstant.optState[optState]);
map.put("reviewText", reviewText);
String enroll_type_name = (String)map.get("enroll_type_name");
if(StringUtil.isNotBlank(enroll_type_name)) {
List<String> enrolls = new ArrayList<String>();
for(String str : enroll_type_name.split(",")) {
enrolls.add(ExportConstant.enrollTypes.get(str.trim()));
}
map.put("enroll_type_name", StringUtil.join(",", enrolls));
}
String enroll_type_name_other = (String)map.get("enroll_type_name_other");
if(StringUtil.isNotBlank(enroll_type_name_other)) {
List<String> others = new ArrayList<String>();
for(String str : enroll_type_name_other.split(",")) {
others.add(ExportConstant.enrollOtherTypes.get(str.trim()));
}
map.put("enroll_type_name_other", StringUtil.join(",", others));
}
Integer review_id = ((Number)map.get("review_id")).intValue();
for(int i = 1; i <= 6 && i <= reviewRound; i++) {
StringBuffer sb = new StringBuffer();
List<Map<String, Object>> recordList = recordML.get(review_id + "," + i);
if(recordList != null) {
for(Map<String, Object> recordMap : recordList) {
String realname = (String)recordMap.get("realname");
String review_text = (String)recordMap.get("review_text");
String review_text_1 = (String)recordMap.get("review_text_1");
String review_text_2 = (String)recordMap.get("review_text_2");
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 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(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");
}
if(StringUtil.isNotBlank(review_text_1)) {
sb.append("评语1:").append(review_text_1).append("\r\n");
}
if(StringUtil.isNotBlank(review_text_2)) {
sb.append("评语2:").append(review_text_2).append("\r\n");
}
if(StringUtil.isNotBlank(review_text_3)) {
sb.append("评语3:").append(review_text_3).append("\r\n");
}
if(StringUtil.isNotBlank(review_text_4)) {
sb.append("评语4:").append(review_text_4).append("\r\n");
}
Integer record_id = ((Number)recordMap.get("id")).intValue();
List<Map<String, Object>> extList = recordExtML.get(String.valueOf(record_id));
if(extList != null) {
for(Map<String, Object> extMap : extList) {
sb.append("\t").append("奖项:").append("最佳").append(ExportConstant.playactorTypes.get(extMap.get("ext_type"))).append(" ").append(extMap.get("ext_name")).append(", 得分:").append(extMap.get("ext_score")).append("\r\n");
}
}
sb.append("\r\n\r\n");
}
}
map.put("round_" + i + "_text", sb.toString());
}
}
Map<String, String> columnMap = this.getApplyPassListColumns();
List<String> titleList = new ArrayList<String>();
List<String> columnList = new ArrayList<String>();
if(columns == null || columns.length == 0) {
for(String key : columnMap.keySet()) {
columnList.add(key);
titleList.add(columnMap.get(key));
}
} else {
for(String column: columns) {
columnList.add(column);
String title = columnMap.get(column);
if(StringUtil.isNotBlank(title)) {
titleList.add(title);
} else {
titleList.add(column);
}
}
}
ExcelUtil.excel(os, columnList.toArray(new String[columnList.size()]), titleList.toArray(new String[titleList.size()]), null, list);
}
} }
...@@ -48,12 +48,12 @@ public class FilmGroupServiceImpl implements FilmGroupService { ...@@ -48,12 +48,12 @@ public class FilmGroupServiceImpl implements FilmGroupService {
} }
@Override @Override
public void updateFilmGroupId(Integer[] film_id, Integer group_id) { public void updateFilmGroupId(Integer[] film_id, Integer group_id, String group_remark) {
Integer[][] args = new Integer[film_id.length][]; Integer[][] args = new Integer[film_id.length][];
for(int i = 0; i < film_id.length; i++) { for(int i = 0; i < film_id.length; i++) {
args[i] = new Integer[] {group_id, film_id[i]}; args[i] = new Integer[] {group_id, film_id[i]};
} }
jdbcTemplate.batchUpdate("update fc_member_film set film_group_id = ? where id = ?", args); jdbcTemplate.batchUpdate("update fc_member_film set film_group_id = ?, group_remark where id = ?", args);
} }
@Override @Override
......
...@@ -135,8 +135,8 @@ public class FilmGroupController { ...@@ -135,8 +135,8 @@ public class FilmGroupController {
@ResponseBody @ResponseBody
@PostMapping("updateFilmGroupId") @PostMapping("updateFilmGroupId")
@ApiOperation("更新影片分类") @ApiOperation("更新影片分类")
public Object updateFilmGroupId(Integer[] film_id, Integer group_id) { public Object updateFilmGroupId(Integer[] film_id, Integer group_id, String group_remark) {
filmGroupService.updateFilmGroupId(film_id, group_id); filmGroupService.updateFilmGroupId(film_id, group_id, group_remark);
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
......
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