ZhuDongming
2019-08-22 148727793cc4ab3e7038c1bdcd6a217217b37e03
src/main/java/com/moral/controller/ReportController.java
@@ -20,8 +20,12 @@
import org.springframework.web.bind.annotation.RestController;
import com.moral.common.bean.ResultBean;
import com.moral.common.util.WebUtils;
import com.moral.entity.charts.LineChartCriteria;
import com.moral.security.auth.JwtAuthenticationToken;
import com.moral.security.model.UserContext;
import com.moral.service.AlarmDailyService;
import com.moral.service.HistoryDailyService;
import com.moral.service.HistoryMinutelyService;
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -95,4 +99,28 @@
      return new ResultBean<List<Map<String, Object>>>(result);
   }
   @Resource
   private HistoryDailyService historyDailyService;
   @GetMapping("emissions")
   public ResultBean<List<Map<String, Object>>> getemissionsData(HttpServletRequest request, JwtAuthenticationToken token) throws Exception {
      Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
      UserContext userContext = token.getPrincipal();
      Integer orgId = userContext.getOrganizationId();
      parameters.put("orgId", orgId);
      List<Map<String, Object>> result = historyDailyService.getEmissionsData(parameters);
      return new ResultBean<List<Map<String, Object>>>(result);
   }
   @GetMapping("overproof")
   public ResultBean<Map> getOverproofData(HttpServletRequest request, JwtAuthenticationToken token) throws Exception {
      Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
      UserContext userContext = token.getPrincipal();
      Integer orgId = userContext.getOrganizationId();
      parameters.put("orgId", orgId);
      //List<Map<String, Object>> result = null;
      Map result = historyDailyService.getOverproofData(parameters);
      return new ResultBean<Map>(result);
   }
}