Commit 1162f4b9 authored by Quxl's avatar Quxl

x

parent 3720e9c3
...@@ -220,18 +220,28 @@ public class ExportServiceImpl implements ExportService { ...@@ -220,18 +220,28 @@ public class ExportServiceImpl implements ExportService {
+ "mf.film_type_name_short, " + "mf.film_type_name_short, "
+ "mf.film_format, " + "mf.film_format, "
+ "mf.film_format_url, " + "mf.film_format_url, "
+ "mf.film_format_passw " + "mf.film_format_passw, "
+ "r.id review_id, "
+ "r.review_round, "
+ "r.review_state, "
+ "r.opt_state "
+ " from " + " from "
+ "fc_member_film mf " + "fc_member_film mf left join fc_review r on r.film_id = mf.id "
+ "where " + "where "
+ "state = 2 and apply_state = 2"; + "state = 2 and apply_state = 2";
List<Map<String, Object>> list = jdbcTemplate.limitAll(sql, new Page(1L, 1000L, new String[] {"film_no asc"})); List<Map<String, Object>> list = jdbcTemplate.limitAll(sql, new Page(1L, 1000L, 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 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";
List<Map<String, Object>> playactors = jdbcTemplate.queryForList(sql0); String sql2 = "select rr.*, u.realname from fc_review_record rr left join fc_user u on u.uid = rr.user_id";
List<Map<String, Object>> issuers = jdbcTemplate.queryForList(sql1); String sql3 = "select ree.* from fc_review_record_ext rre";
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>> exts = jdbcTemplate.limitAll(sql3, new Page(1L, 1000L));
Map<String, Map<String, Object>> playactorMM = Util.listToMM(playactors, ",", "film_id", "playactor_type"); 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, 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>>> extML = Util.listToML(exts, ",", "record_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 : ExportConstant.playactorTypes.keySet()) { for(String playactor_type : ExportConstant.playactorTypes.keySet()) {
...@@ -267,6 +277,52 @@ public class ExportServiceImpl implements ExportService { ...@@ -267,6 +277,52 @@ public class ExportServiceImpl implements ExportService {
} }
map.put("enroll_type_name_other", StringUtil.join(",", others)); map.put("enroll_type_name_other", StringUtil.join(",", others));
} }
Integer review_round = ((Number)map.get("review_round")).intValue();
Integer review_id = ((Number)map.get("review_id")).intValue();
for(int i = 1; i <= 6 && i <= review_round; 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"));
sb.append("评委:").append(realname).append("\r\n");
if(review_score != null) {
sb.append("评分:").append(review_score).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("record_id")).intValue();
List<Map<String, Object>> extList = extML.get(String.valueOf(record_id));
if(extList != null) {
for(Map<String, Object> extMap : extList) {
sb.append("\t").append("最佳").append(ExportConstant.playactorTypes.get(extMap.get("ext_type"))).append("\t").append(extMap.get("ext_name")).append("\t").append(extMap.get("ext_score"));
}
}
sb.append("\r\n\r\n");
}
}
}
} }
Map<String, String> columnMap = this.getApplyPassListColumns(); Map<String, String> columnMap = this.getApplyPassListColumns();
......
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