fengxiang
2018-03-19 00d2837b0056d84394df6ebcb4e779698c283c0d
src/main/java/com/moral/controller/ScreenController.java
@@ -424,4 +424,22 @@
      List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByOrganizationId(orgId);
      return new ResultBean<List<MonitorPoint>>(monitorPoints);
   }
   @GetMapping("report_avg_datas")
   public ResultBean<List<Map<String, Object>>> getMonitorPointOrDeviceAvgData(HttpServletRequest request) throws Exception {
      Map<String, Object> parameters = getParametersStartingWith(request, null);
      parameters.put("type", "month");
      parameters.put("format", "yyyy-MM");
      parameters.put("typeFormat", "%Y-%m-%d");
      List<Map<String, Object>> list = historyMinutelyService.getMonitorPointOrDeviceAvgData(parameters);
      String sensorKey = parameters.get("sensorKey").toString();
      for (Map<String, Object> map : list) {
         String time = map.get("time").toString();
         time = time.substring(time.length() - 2);
         map.put("time", Integer.valueOf(time));
         map.put("value", map.get(sensorKey));
         map.remove(sensorKey);
      }
      return new ResultBean<List<Map<String, Object>>>(list);
   }
}