Package org.jeecgframework.core.common.model.json

Examples of org.jeecgframework.core.common.model.json.Highchart


   */
  @RequestMapping(params = "studentCount")
  @ResponseBody
  public List<Highchart> studentCount(HttpServletRequest request,String reportType, HttpServletResponse response) {
    List<Highchart> list = new ArrayList<Highchart>();
    Highchart hc = new Highchart();
    StringBuffer sb = new StringBuffer();
    sb.append("SELECT className ,count(className) FROM TSStudent group by className");
    List userBroswerList = systemService.findByQueryString(sb.toString());
    Long count = systemService.getCountForJdbc("SELECT COUNT(1) FROM T_S_student WHERE 1=1");
    List lt = new ArrayList();
    hc = new Highchart();
    hc.setName("班级人数统计分析");
    hc.setType(reportType);
    Map<String, Object> map;
    if (userBroswerList.size() > 0) {
      for (Object object : userBroswerList) {
        map = new HashMap<String, Object>();
        Object[] obj = (Object[]) object;
        map.put("name", obj[0]);
        map.put("y", obj[1]);
        Long groupCount = (Long) obj[1];
        Double  percentage = 0.0;
        if (count != null && count.intValue() != 0) {
          percentage = new Double(groupCount)/count;
        }
        map.put("percentage", percentage*100);
        lt.add(map);
      }
    }
    hc.setData(lt);
    list.add(hc);
    return list;
  }
View Full Code Here


   */
  @RequestMapping(params = "getBroswerBar")
  @ResponseBody
  public List<Highchart> getBroswerBar(HttpServletRequest request,String reportType, HttpServletResponse response) {
    List<Highchart> list = new ArrayList<Highchart>();
    Highchart hc = new Highchart();
    StringBuffer sb = new StringBuffer();
    sb.append("SELECT broswer ,count(broswer) FROM TSLog group by broswer");
    List userBroswerList = systemService.findByQueryString(sb.toString());
    Long count = systemService.getCountForJdbc("SELECT COUNT(1) FROM T_S_Log WHERE 1=1");
    List lt = new ArrayList();
    hc = new Highchart();
    hc.setName("用户浏览器统计分析");
    hc.setType(reportType);
    Map<String, Object> map;
    if (userBroswerList.size() > 0) {
      for (Object object : userBroswerList) {
        map = new HashMap<String, Object>();
        Object[] obj = (Object[]) object;
        map.put("name", obj[0]);
        map.put("y", obj[1]);
        Long groupCount = (Long) obj[1];
        Double  percentage = 0.0;
        if (count != null && count.intValue() != 0) {
          percentage = new Double(groupCount)/count;
        }
        map.put("percentage", percentage*100);
        lt.add(map);
      }
    }
    hc.setData(lt);
    list.add(hc);
    return list;
  }
View Full Code Here

TOP

Related Classes of org.jeecgframework.core.common.model.json.Highchart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.