Commit e62ab0c4 authored by Quxl's avatar Quxl

x

parent b5fd3940
...@@ -7,4 +7,8 @@ public interface LanguageService { ...@@ -7,4 +7,8 @@ public interface LanguageService {
public List<Map<String, String>> queryLanguageList(); public List<Map<String, String>> queryLanguageList();
public Map<String, String> queryLanguageMap();
public Map<String, String> queryLanguageMapReverse();
} }
...@@ -18,6 +18,7 @@ import com.egolm.common.jdbc.JdbcTemplate; ...@@ -18,6 +18,7 @@ import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.CountryService; import com.egolm.film.api.service.CountryService;
import com.egolm.film.api.service.ExportService; 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.api.web.ExportConstant;
@Service @Service
...@@ -27,11 +28,17 @@ public class ExportServiceImpl implements ExportService { ...@@ -27,11 +28,17 @@ public class ExportServiceImpl implements ExportService {
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
Map<String, String> countryMap; Map<String, String> countryMap;
Map<String, String> languageMap;
@Resource @Resource
public void setCountryService(CountryService countryService) { public void setCountryMap(CountryService countryService) {
countryMap = countryService.queryCountryMapReverse(); countryMap = countryService.queryCountryMapReverse();
} }
@Resource
public void setLanguageMap(LanguageService languageService) {
languageMap = languageService.queryLanguageMapReverse();
}
public Map<String, String> getApplyListColumns() { public Map<String, String> getApplyListColumns() {
Map<String, String> columns = new LinkedHashMap<String, String>(); Map<String, String> columns = new LinkedHashMap<String, String>();
...@@ -51,7 +58,7 @@ public class ExportServiceImpl implements ExportService { ...@@ -51,7 +58,7 @@ public class ExportServiceImpl implements ExportService {
columns.put("co_production_country_cn", "合拍国(中文)"); columns.put("co_production_country_cn", "合拍国(中文)");
columns.put("enroll_type_name", "报名性质"); columns.put("enroll_type_name", "报名性质");
columns.put("state", "状态"); columns.put("state", "状态");
columns.put("dialogue_lang", "对语言"); columns.put("dialogue_lang", "对语言");
columns.put("dialogue_lang_cn", "对白语言(中文)"); columns.put("dialogue_lang_cn", "对白语言(中文)");
columns.put("subtitle_lang", "字幕语言"); columns.put("subtitle_lang", "字幕语言");
columns.put("subtitle_lang_cn", "字幕语言(中文)"); columns.put("subtitle_lang_cn", "字幕语言(中文)");
...@@ -107,6 +114,8 @@ public class ExportServiceImpl implements ExportService { ...@@ -107,6 +114,8 @@ public class ExportServiceImpl implements ExportService {
+ "state = 2"; + "state = 2";
List<Map<String, Object>> list = jdbcTemplate.limitAll(sql, new Page(1L, 1000L, new String[] {"film_no asc", "id asc"})); 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) { 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"));
map.put("film_country_cn", countryMap.get(map.get("film_country"))); 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("co_production_country_cn", countryMap.get(map.get("co_production_country")));
map.put("dialogue_lang_cn", countryMap.get(map.get("dialogue_lang"))); map.put("dialogue_lang_cn", countryMap.get(map.get("dialogue_lang")));
...@@ -165,7 +174,7 @@ public class ExportServiceImpl implements ExportService { ...@@ -165,7 +174,7 @@ public class ExportServiceImpl implements ExportService {
columns.put("film_country_cn", "制片国(中文)"); columns.put("film_country_cn", "制片国(中文)");
columns.put("co_production_country", "合拍国"); columns.put("co_production_country", "合拍国");
columns.put("co_production_country_cn", "合拍国(中文)"); columns.put("co_production_country_cn", "合拍国(中文)");
columns.put("dialogue_lang", "对语言"); columns.put("dialogue_lang", "对语言");
columns.put("dialogue_lang_cn", "对白语言(中文)"); columns.put("dialogue_lang_cn", "对白语言(中文)");
columns.put("subtitle_lang", "字幕语言"); columns.put("subtitle_lang", "字幕语言");
columns.put("subtitle_lang_cn", "字幕语言(中文)"); columns.put("subtitle_lang_cn", "字幕语言(中文)");
...@@ -256,7 +265,8 @@ public class ExportServiceImpl implements ExportService { ...@@ -256,7 +265,8 @@ public class ExportServiceImpl implements ExportService {
} }
Map<String, Object> issuerMap = issuerMM.get(id_str); Map<String, Object> issuerMap = issuerMM.get(id_str);
map.put("issuer", issuerMap == null ? null : issuerMap.get("text")); 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("film_country_cn", countryMap.get(map.get("film_country")));
map.put("co_production_country_cn", countryMap.get(map.get("co_production_country"))); map.put("co_production_country_cn", countryMap.get(map.get("co_production_country")));
map.put("dialogue_lang_cn", countryMap.get(map.get("dialogue_lang"))); map.put("dialogue_lang_cn", countryMap.get(map.get("dialogue_lang")));
......
...@@ -28,5 +28,29 @@ public class LanguageServiceImpl implements LanguageService { ...@@ -28,5 +28,29 @@ public class LanguageServiceImpl implements LanguageService {
} }
return list; return list;
} }
@Override
public Map<String, String> queryLanguageMap() {
List<Map<String, String>> list = this.queryLanguageList();
Map<String, String> countryMap = new HashMap<String, String>();
for(Map<String, String> map : list) {
for(String key : map.keySet()) {
countryMap.put(key, map.get(key));
}
}
return countryMap;
}
@Override
public Map<String, String> queryLanguageMapReverse() {
List<Map<String, String>> list = this.queryLanguageList();
Map<String, String> countryMap = new HashMap<String, String>();
for(Map<String, String> map : list) {
for(String key : map.keySet()) {
countryMap.put(map.get(key), key);
}
}
return countryMap;
}
} }
...@@ -89,7 +89,7 @@ public class ExportConstant { ...@@ -89,7 +89,7 @@ public class ExportConstant {
public static final Map<String, String> playShanghai = new HashMap<String, String>(); public static final Map<String, String> playShanghai = new HashMap<String, String>();
static { static {
playShanghai.put("1", "世界首映"); playShanghai.put("1", "世界首映");
playShanghai.put("2", "国首映"); playShanghai.put("2", "国首映");
playShanghai.put("3", "亚洲首映"); playShanghai.put("3", "亚洲首映");
playShanghai.put("4", "中国首映"); playShanghai.put("4", "中国首映");
} }
......
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