@Override public String queryRegisterInfo(PageSearch pageSearch) { ESBaseVO<RegisterVO> base = new ESBaseVO<RegisterVO>(); int total = customerDao.selectRegisterCount(pageSearch); base.setTotal(total); List<RegisterVO> registerList = customerDao.selectRegisters(pageSearch); base.setRows(registerList); return GsonUtil.toJson(base); }
@Override public String queryRegisterChart() { List<RegisterVO> registerList = customerDao.selectRegisterChart(); String[] names = new String[registerList.size()]; Integer[] datas = new Integer[registerList.size()]; for (int index = 0; index < registerList.size(); index++) { names[index] = registerList.get(index).getCalendarId(); datas[index] = registerList.get(index).getTodayAddNum(); } Echart echart = new Echart(); echart.setTitle("每日新增客户数趋势图"); echart.setTooltip(true, "axis"); echart.setLegend(new String[] {"每日新增客户数"}); echart.setxAxis("category", names); echart.setyAxis("value"); BaseSerie serie = new Serie<Integer>("每日新增客户数", "line", datas); List<BaseSerie> series = new ArrayList<BaseSerie>(); series.add(serie); echart.setSeries(series); return GsonUtil.toJson(echart); }
@Override public List<ArrayList<String>> queryRegisterForExport(PageSearch pageSearch) { List<RegisterVO> registerList = customerDao.selectRegisters(pageSearch); List<ArrayList<String>> datas = new ArrayList<ArrayList<String>>(); for (RegisterVO each : registerList) { ArrayList<String> data = new ArrayList<String>(); data.add(each.getCalendarId()); data.add(each.getTodayAddNum() + ""); data.add(each.getTotalNum() + ""); datas.add(data); } return datas; }
@Override public String queryRegisterMap() { Echart echart = new Echart(); echart.setTitle("注册人数区域分布"); echart.setTooltip(true, "item"); echart.setLegend(new String[] {"注册用户数"}); echart.setDataRange(new DataRange()); List<MapData> datas = customerDao.selectRegisterMap(); MapSerie serie = new MapSerie("注册用户数", datas); serie.setItemStyle(new ItemStyle()); List<BaseSerie> series = new ArrayList<BaseSerie>(); series.add(serie); echart.setSeries(series); return GsonUtil.toJson(echart); }