| | |
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import com.moral.common.bean.ResultBean;
|
| | | import com.moral.service.DataService;
|
| | | import com.moral.service.HistoryMinutelyService;
|
| | |
|
| | | @RestController
|
| | | @RequestMapping("report")
|
| | |
| | | public class ReportController {
|
| | |
|
| | | @Resource
|
| | | private DataService dataService;
|
| | | private HistoryMinutelyService historyMinutelyService;
|
| | |
|
| | | @GetMapping("compare")
|
| | | public ResultBean<Map<String, List<Object>>> getCompareReport(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | Map<String, List<Object>> demo = dataService.getCompareReport(parameters); |
| | | Map<String, List<Object>> demo = historyMinutelyService.getCompareReport(parameters); |
| | | return new ResultBean<Map<String,List<Object>>>(demo);
|
| | | }
|
| | |
|
| | | @GetMapping("excel")
|
| | | public ResultBean<Boolean> getExcelReport(HttpServletRequest request,HttpServletResponse response) throws Exception {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | List<Map<String, Object>> list = dataService.getMonitorPointOrDeviceAvgData4Excel(parameters); |
| | | List<Map<String, Object>> list = historyMinutelyService.getMonitorPointOrDeviceAvgData(parameters); |
| | | String[][] exportColumn = new String[2][];
|
| | | exportColumn[0] = new String[] { "时间", "20", "time" };
|
| | | if (parameters.containsKey("sensors")) {
|