Commit 1d5979a1 authored by Quxl's avatar Quxl

x

parent 63ba1f54
...@@ -25,6 +25,29 @@ public class ExportServiceImpl implements ExportService { ...@@ -25,6 +25,29 @@ public class ExportServiceImpl implements ExportService {
@Autowired @Autowired
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
private static final String[] exclude = new String[] {
"origion_name",
"type",
"film_group_id",
"film_type",
"enroll_type",
"show_date",
"show_time",
"film_producers",
"production_company",
"is_like_show",
"prize",
"film_side_demand",
"is_show",
"lang",
"film_district",
"is_check_director",
"admin_creator",
"apply_state_intro",
"plays_is_agree",
"plays_is_agree1"};
private static final Map<String, String> playactorTypes = new HashMap<String, String>(); private static final Map<String, String> playactorTypes = new HashMap<String, String>();
static { static {
playactorTypes.put("director", "导演"); playactorTypes.put("director", "导演");
...@@ -36,7 +59,24 @@ public class ExportServiceImpl implements ExportService { ...@@ -36,7 +59,24 @@ public class ExportServiceImpl implements ExportService {
playactorTypes.put("issuser", "发行方"); playactorTypes.put("issuser", "发行方");
playactorTypes.put("show", "参加过的电视节"); playactorTypes.put("show", "参加过的电视节");
} }
private static final Map<String, String> filmTypes = new HashMap<String, String>();
static {
filmTypes.put("1", "剧情片");
filmTypes.put("2", "纪录片");
filmTypes.put("3", "动画片");
filmTypes.put("4", "短片");
}
private static final Map<String, String> filmShortTypes = new HashMap<String, String>();
static {
filmShortTypes.put("1", "欧洲");
filmShortTypes.put("2", "亚太");
filmShortTypes.put("3", "美非");
filmShortTypes.put("4", "华语");
filmShortTypes.put("5", "纪录片");
filmShortTypes.put("6", "动画片");
filmShortTypes.put("7", "真人短片");
filmShortTypes.put("8", "动画短片");
}
private static final Map<String, String> enrollTypes = new HashMap<String, String>(); private static final Map<String, String> enrollTypes = new HashMap<String, String>();
static { static {
enrollTypes.put("1", "金爵奖国际影片评选"); enrollTypes.put("1", "金爵奖国际影片评选");
...@@ -44,9 +84,54 @@ public class ExportServiceImpl implements ExportService { ...@@ -44,9 +84,54 @@ public class ExportServiceImpl implements ExportService {
enrollTypes.put("3", "电影频道传媒关注"); enrollTypes.put("3", "电影频道传媒关注");
enrollTypes.put("4", "国际电影展映"); enrollTypes.put("4", "国际电影展映");
} }
private static final Map<String, String> enrollOtherTypes = new HashMap<String, String>();
static {
enrollOtherTypes.put("1", "最佳导演");
enrollOtherTypes.put("2", "最佳女演员");
enrollOtherTypes.put("3", "最佳男演员");
enrollOtherTypes.put("4", "最佳编剧");
enrollOtherTypes.put("5", "最佳摄影");
enrollOtherTypes.put("6", "真人短片");
enrollOtherTypes.put("7", "动画短片");
enrollOtherTypes.put("8", "最佳影片");
}
private static final Map<String, String> states = new HashMap<String, String>();
static {
states.put("1", "未提交");
states.put("2", "已提交");
}
private static final Map<String, String> applyStates = new HashMap<String, String>();
static {
applyStates.put("1", "未受理");
applyStates.put("2", "初审通过");
applyStates.put("3", "初审否决");
}
private static final Map<String, String> YN = new HashMap<String, String>();
static {
YN.put("0", "否");
YN.put("1", "是");
}
private static final Map<String, String> filmMedium = new HashMap<String, String>();
static {
filmMedium.put("0", "否");
filmMedium.put("1", "是");
}
private static final Map<String, String> filmFormat = new HashMap<String, String>();
static {
filmFormat.put("0", "否");
filmFormat.put("1", "是");
}
private static final Map<String, String> playShanghai = new HashMap<String, String>();
static {
playShanghai.put("0", "否");
playShanghai.put("1", "是");
}
private List<Map<String, Object>> queryFilmDataList() { private List<Map<String, Object>> queryFilmDataList() {
String sql = "select t.* from fc_member_film t"; String sql = "select t.* from fc_member_film t where state = 2";
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 group_concat(fs.show_filmfest) text, fs.film_id from fc_member_film_show fs group by fs.film_id"; String sql2 = "select group_concat(fs.show_filmfest) text, fs.film_id from fc_member_film_show fs group by fs.film_id";
...@@ -67,14 +152,19 @@ public class ExportServiceImpl implements ExportService { ...@@ -67,14 +152,19 @@ public class ExportServiceImpl implements ExportService {
Map<String, Object> showMap = showMM.get(id_str); Map<String, Object> showMap = showMM.get(id_str);
map.put("issuer", issuerMap == null ? null : issuerMap.get("text")); map.put("issuer", issuerMap == null ? null : issuerMap.get("text"));
map.put("show", showMap == null ? null : showMap.get("text")); map.put("show", showMap == null ? null : showMap.get("text"));
this.replaceEnumValue(map, "film_type_name", filmTypes);
String enroll_type_name = (String)map.get("enroll_type_name"); this.replaceEnumValue(map, "film_type_name_short", filmShortTypes);
String[] enrolls = enroll_type_name.split(","); this.replaceEnumValue(map, "enroll_type_name", enrollTypes);
List<String> enrollList = new ArrayList<String>(); this.replaceEnumValue(map, "enroll_type_name_other", enrollOtherTypes);
for(String s : enrolls) { this.replaceEnumValue(map, "state", states);
enrollList.add(enrollTypes.get(s)); this.replaceEnumValue(map, "apply_state", applyStates);
} this.replaceEnumValue(map, "film_medium", filmMedium);
map.put("enroll_type_name", StringUtil.join(",", enrollList)); this.replaceEnumValue(map, "film_format", filmFormat);
this.replaceEnumValue(map, "play_shanghai", playShanghai);
this.replaceEnumValue(map, "is_viewer_metting", YN);
this.replaceEnumValue(map, "is_important", YN);
this.replaceEnumValue(map, "is_night", YN);
this.replaceEnumValue(map, "is_copy_key", YN);
} }
return list; return list;
} }
...@@ -103,8 +193,10 @@ public class ExportServiceImpl implements ExportService { ...@@ -103,8 +193,10 @@ public class ExportServiceImpl implements ExportService {
} }
} }
} }
argsList.add(columnName); if(!StringUtil.contains(exclude, columnName)) {
titleList.add(columnComment); argsList.add(columnName);
titleList.add(columnComment);
}
} }
for(String key : playactorTypes.keySet()) { for(String key : playactorTypes.keySet()) {
argsList.add(key); argsList.add(key);
...@@ -113,4 +205,15 @@ public class ExportServiceImpl implements ExportService { ...@@ -113,4 +205,15 @@ public class ExportServiceImpl implements ExportService {
ExcelUtil.excel(os, argsList.toArray(new String[argsList.size()]), titleList.toArray(new String[titleList.size()]), null, list); ExcelUtil.excel(os, argsList.toArray(new String[argsList.size()]), titleList.toArray(new String[titleList.size()]), null, list);
} }
private void replaceEnumValue(Map<String, Object> map, String columnName, Map<String, String> values) {
if(map.containsKey(columnName)) {
String columnValue = String.valueOf(map.get(columnName));
String[] ary = columnValue.split(",");
List<String> list = new ArrayList<String>();
for(String s : ary) {
list.add(values.get(s));
}
map.put(columnName, StringUtil.join(",", list));
}
}
} }
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