Commit 106594f3 authored by Quxl's avatar Quxl

x

parent 12907df9
......@@ -11,4 +11,5 @@ public interface FilmReportService {
Map<String, Object> applyTypeReport();
List<Map<String, Object>> directorReport(String playactor_name, Page page);
Map<String, Object> directorDetail(String playactor_name);
Object queryFilmReport();
}
package com.egolm.film.api.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
......@@ -12,6 +13,7 @@ import org.springframework.stereotype.Service;
import com.egolm.common.DateUtil;
import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.FilmReportService;
......@@ -171,4 +173,31 @@ public class FilmReportServiceImpl implements FilmReportService {
res.put("list", list);
return res;
}
static BigDecimal NUM_100 = BigDecimal.valueOf(100);
@Override
public Object queryFilmReport() {
Integer count_quanbu = jdbcTemplate.queryForInt("select count(id) from fc_review");
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_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_cansai_map = new HashMap<String, Object>();
Map<String, Object> count_foujue_map = new HashMap<String, Object>();
BigDecimal count = new BigDecimal(count_quanbu);
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_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_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)) + "%");
return Rjx.jsonOk().set("count", count_quanbu).set("cansai", count_cansai_map).set("canzhan", count_canzan_map).set("foujue", count_foujue_map);
}
}
......@@ -83,4 +83,13 @@ public class FilmReportController {
public Object directorDetail(String playactor_name) {
return Rjx.jsonOk().setData(filmReportService.directorDetail(playactor_name));
}
@ResponseBody
@PostMapping("film_report")
@ApiOperation("影片报表")
public Object filmReport(String playactor_name) {
return Rjx.jsonOk().setData(filmReportService.queryFilmReport());
}
}
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