From 44ceeb29340272485a9a46e5c9420eea3a2893d1 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Thu, 25 Aug 2022 11:25:16 +0800 Subject: [PATCH] 1 --- .../hisense/monitormanage/controller/QidiController.java | 9 +++++---- .../monitormanage/service/BuildingRecordsService.java | 2 +- .../hisense/monitormanage/service/MonitorService.java | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/QidiController.java b/src/main/java/com/hisense/monitormanage/controller/QidiController.java index 1ddfe23..be84ac6 100644 --- a/src/main/java/com/hisense/monitormanage/controller/QidiController.java +++ b/src/main/java/com/hisense/monitormanage/controller/QidiController.java @@ -287,11 +287,12 @@ public class QidiController { } //查询道路污染数据 - //输入参考:2022-05-10 00:00:00,只能查询当前日期前一天及以前的 + //查询道路污染数据,根据dt从表中最新时间的数据 @GetMapping(value="listRoadData") - @ApiOperation("查询道路污染数据,根据dt从表中查询,参考输入-2022-05-10 00:00:00,只能查询当前日期前一天及以前的") - @ApiImplicitParam(name="dt",value = "时间",paramType = "query",required = true,dataType = "string") - public Result listRoadData(@RequestParam(value="dt") String dt){ + @ApiOperation("查询道路污染数据,根据dt从表中最新时间的数据") + public Result listRoadData(){ + RoadData byMaxId = roadDataMapper.getByMaxId(); + String dt = byMaxId.getDt(); List roadData = roadDataService.listRoadData(dt); roadData.forEach(roadData1 -> { roadData1.setDt(roadData1.getDt().substring(0,10)); diff --git a/src/main/java/com/hisense/monitormanage/service/BuildingRecordsService.java b/src/main/java/com/hisense/monitormanage/service/BuildingRecordsService.java index 1ce952d..231bdfd 100644 --- a/src/main/java/com/hisense/monitormanage/service/BuildingRecordsService.java +++ b/src/main/java/com/hisense/monitormanage/service/BuildingRecordsService.java @@ -66,7 +66,7 @@ public class BuildingRecordsService { return maps; } - @Scheduled(cron = "0 0 8/1 * * ?") + //@Scheduled(cron = "0 0 8/1 * * ?") public boolean getAndSaveRecords() { List maps = this.getRecords(); boolean result = false; diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index 4f1a2a6..cf275e6 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -306,7 +306,7 @@ public class MonitorService{ } } - //@Scheduled(cron = "0 30 8 * * ?") + @Scheduled(cron = "0 30 8 * * ?") public void buildingImage() { try { List buildingSites = buildingSiteMapper.selectByList();