Commit 9d4ed076 authored by Quxl's avatar Quxl

x

parent 9c0246a5
...@@ -25,17 +25,26 @@ public class ExportServiceImpl implements ExportService { ...@@ -25,17 +25,26 @@ public class ExportServiceImpl implements ExportService {
@Autowired @Autowired
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
private static final Map<String, String> types = new HashMap<String, String>(); private static final Map<String, String> playactorTypes = new HashMap<String, String>();
static { static {
types.put("director", "导演"); playactorTypes.put("director", "导演");
types.put("producer", "制片人"); playactorTypes.put("producer", "制片人");
types.put("screenwriter", "编剧"); playactorTypes.put("screenwriter", "编剧");
types.put("photographer", "摄影"); playactorTypes.put("photographer", "摄影");
types.put("actor", "男演员"); playactorTypes.put("actor", "男演员");
types.put("actress", "女演员"); playactorTypes.put("actress", "女演员");
types.put("issuser", "发行方"); playactorTypes.put("issuser", "发行方");
types.put("show", "参加过的电视节"); playactorTypes.put("show", "参加过的电视节");
} }
private static final Map<String, String> enrollTypes = new HashMap<String, String>();
static {
enrollTypes.put("1", "金爵奖国际影片评选");
enrollTypes.put("2", "亚洲新人奖国际影片评选");
enrollTypes.put("3", "电影频道传媒关注");
enrollTypes.put("4", "国际电影展映");
}
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";
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";
...@@ -50,7 +59,7 @@ public class ExportServiceImpl implements ExportService { ...@@ -50,7 +59,7 @@ public class ExportServiceImpl implements ExportService {
Map<String, Map<String, Object>> showMM = Util.listToMM(shows, ",", "film_id"); Map<String, Map<String, Object>> showMM = Util.listToMM(shows, ",", "film_id");
for(Map<String, Object> map : list) { for(Map<String, Object> map : list) {
String id_str = "" + map.get("id"); String id_str = "" + map.get("id");
for(String playactor_type : types.keySet()) { for(String playactor_type : playactorTypes.keySet()) {
Map<String, Object> playactorMap = playactorMM.get(id_str + "," + playactor_type); Map<String, Object> playactorMap = playactorMM.get(id_str + "," + playactor_type);
map.put(playactor_type, playactorMap == null ? null : playactorMap.get("text")); map.put(playactor_type, playactorMap == null ? null : playactorMap.get("text"));
} }
...@@ -58,6 +67,15 @@ public class ExportServiceImpl implements ExportService { ...@@ -58,6 +67,15 @@ 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"));
String enroll_type_name = (String)map.get("enroll_type_name");
String[] enrolls = enroll_type_name.split(",");
List<String> enrollList = new ArrayList<String>();
for(String s : enrolls) {
enrollList.add(enrollTypes.get(s));
}
map.put("enroll_type_name", StringUtil.join(",", enrollList));
} }
return list; return list;
...@@ -90,9 +108,9 @@ public class ExportServiceImpl implements ExportService { ...@@ -90,9 +108,9 @@ public class ExportServiceImpl implements ExportService {
argsList.add(columnName); argsList.add(columnName);
titleList.add(columnComment); titleList.add(columnComment);
} }
for(String key : types.keySet()) { for(String key : playactorTypes.keySet()) {
argsList.add(key); argsList.add(key);
titleList.add(types.get(key)); titleList.add(playactorTypes.get(key));
} }
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);
} }
......
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