Commit 5c401fb7 authored by Quxl's avatar Quxl

x

parent 106594f3
...@@ -182,22 +182,16 @@ public class FilmReportServiceImpl implements FilmReportService { ...@@ -182,22 +182,16 @@ public class FilmReportServiceImpl implements FilmReportService {
Integer count_canzan = jdbcTemplate.queryForInt("select count(id) from fc_review where opt_state = 3 and (enroll_type_id = 4 and review_state = 1)"); Integer count_canzan = jdbcTemplate.queryForInt("select count(id) from fc_review where opt_state = 3 and (enroll_type_id = 4 and review_state = 1)");
Integer count_cansai = jdbcTemplate.queryForInt("select count(id) from fc_review where opt_state = 3 and ((enroll_type_id = 1 and review_state = 1) or (enroll_type_id = 2 and review_state = 1))"); Integer count_cansai = jdbcTemplate.queryForInt("select count(id) from fc_review where opt_state = 3 and ((enroll_type_id = 1 and review_state = 1) or (enroll_type_id = 2 and review_state = 1))");
Integer count_foujue = jdbcTemplate.queryForInt("select count(id) from fc_review where opt_state = 3 and review_state = 2"); Integer count_foujue = jdbcTemplate.queryForInt("select count(id) from fc_review where opt_state = 3 and review_state = 2");
Map<String, Object> count_canzan_map = new HashMap<String, Object>(); Map<String, Object> count_canzan_map = new HashMap<String, Object>();
Map<String, Object> count_cansai_map = new HashMap<String, Object>(); Map<String, Object> count_cansai_map = new HashMap<String, Object>();
Map<String, Object> count_foujue_map = new HashMap<String, Object>(); Map<String, Object> count_foujue_map = new HashMap<String, Object>();
BigDecimal count = new BigDecimal(count_quanbu); BigDecimal count = new BigDecimal(count_quanbu);
count_canzan_map.put("count", count_canzan); count_canzan_map.put("count", count_canzan);
count_canzan_map.put("rate", (count.compareTo(BigDecimal.ZERO) == 0 ? "0.00" : new BigDecimal(count_canzan).divide(count).multiply(NUM_100).setScale(2)) + "%"); count_canzan_map.put("rate", (count.compareTo(BigDecimal.ZERO) == 0 ? "0.00" : new BigDecimal(count_canzan).divide(count).multiply(NUM_100).setScale(2)) + "%");
count_cansai_map.put("count", count_cansai); count_cansai_map.put("count", count_cansai);
count_cansai_map.put("rate", (count.compareTo(BigDecimal.ZERO) == 0 ? "0.00" : new BigDecimal(count_cansai).divide(count).multiply(NUM_100).setScale(2)) + "%"); count_cansai_map.put("rate", (count.compareTo(BigDecimal.ZERO) == 0 ? "0.00" : new BigDecimal(count_cansai).divide(count).multiply(NUM_100).setScale(2)) + "%");
count_foujue_map.put("count", count_foujue); count_foujue_map.put("count", count_foujue);
count_foujue_map.put("rate", (count.compareTo(BigDecimal.ZERO) == 0 ? "0.00" : new BigDecimal(count_foujue).divide(count).multiply(NUM_100).setScale(2)) + "%"); count_foujue_map.put("rate", (count.compareTo(BigDecimal.ZERO) == 0 ? "0.00" : new BigDecimal(count_foujue).divide(count).multiply(NUM_100).setScale(2)) + "%");
return Rjx.jsonOk().set("count", count_quanbu).set("cansai", count_cansai_map).set("canzhan", count_canzan_map).set("foujue", count_foujue_map); return Rjx.jsonOk().set("count", count_quanbu).set("cansai", count_cansai_map).set("canzhan", count_canzan_map).set("foujue", count_foujue_map);
} }
} }
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