| | |
| | | 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.service.AlarmService;
|
| | | 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" })
|
| | |
| | | private HistoryMinutelyService historyMinutelyService;
|
| | |
|
| | | @Resource
|
| | | private AlarmService alarmService;
|
| | | private AlarmDailyService alarmDailyService;
|
| | |
|
| | | @GetMapping("compare")
|
| | | public ResultBean<Map<String, List>> getCompareReport(HttpServletRequest request) throws Exception {
|
| | |
| | | @GetMapping("pie")
|
| | | public ResultBean<Map<String, Object>> getPieData(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | Map pieData = alarmService.getPieData(parameters);
|
| | | Map pieData = alarmDailyService.getPieData(parameters);
|
| | |
|
| | | return new ResultBean<Map<String, Object>>(pieData);
|
| | | }
|
| | |
|
| | | @GetMapping("alarm-year")
|
| | | public ResultBean<List<Integer>> getAlarmDataByYear(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | List<Integer> result = alarmDailyService.getAlarmDataByYear(parameters);
|
| | | |
| | | return new ResultBean<List<Integer>>(result);
|
| | | }
|
| | |
|
| | | @GetMapping("alarm-month")
|
| | | public ResultBean<List<Map<String, Object>>> getAlarmDataByMonth(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | List<Map<String, Object>> result = alarmDailyService.getAlarmDataByMonth(parameters);
|
| | | |
| | | 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);
|
| | | }
|
| | | }
|