| | |
| | |
|
| | |
|
| | |
|
| | | public static List<Object> dayOrMonthDataFactory(List<String> listDate , List<Map<String, Object>> list) throws Exception {
|
| | | public static List<Object> dayOrMonthDataFactory(Integer dateType, List<String> listDate , |
| | | List<Map<String, Object>> list) throws Exception {
|
| | |
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | for (int i = 0; i < listDate.size(); i++) {
|
| | | |
| | | Object showValue = null;
|
| | | if (list != null && list.size() > 0) {
|
| | | // 日期匹配赋值
|
| | |
| | | Map<String, Object> map = list.get(j);
|
| | |
|
| | | String showDate = listDate.get(i);
|
| | | Object reslutDate = map.get("showDate");
|
| | | String month = reslutDate.toString();
|
| | | if (dateType == 2 && Integer.parseInt(showDate) < 10 ) {
|
| | | showDate = "0" + showDate;
|
| | | }
|
| | |
|
| | | if (showDate.equalsIgnoreCase(month)) {
|
| | | Object reslutDate = map.get("showDate");
|
| | | String reslutTime = reslutDate.toString();
|
| | | |
| | | if (showDate.equalsIgnoreCase(reslutTime)) {
|
| | | showValue = map.get("showValue");
|
| | | break;
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (showValue == null) {
|
| | | showValue = 0;
|
| | |
| | | innerList.put("name", "总计");
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateList, list)));
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = yearsDataFactory(list);
|