From 793fdaec52a5a69f9d2c34a87900a306d600ca8b Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Tue, 9 Aug 2022 09:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=93=E8=B7=AF=E6=B1=A1=E6=9F=93=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E6=97=B6=E5=88=86=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/QidiController.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/QidiController.java b/src/main/java/com/hisense/monitormanage/controller/QidiController.java index ae42cbf..de48274 100644 --- a/src/main/java/com/hisense/monitormanage/controller/QidiController.java +++ b/src/main/java/com/hisense/monitormanage/controller/QidiController.java @@ -273,8 +273,11 @@ public class QidiController { @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){ - List list = roadDataService.listRoadData(dt); - return Result.success(list); + List roadData = roadDataService.listRoadData(dt); + roadData.forEach(roadData1 -> { + roadData1.setDt(roadData1.getDt().substring(0,10)); + }); + return Result.success(roadData); } //根据输入的日期间隔查询道路污染数据(例如:2022-05-10 00:00:00至2022-05-11 00:00:00) @GetMapping(value="listRoadDataByTimeRegion") @@ -287,8 +290,11 @@ public class QidiController { @RequestParam(value="start") String start, @RequestParam(value="end") String end ){ - List list = roadDataService.listRoadDataByTimeRegion(start,end); - return Result.success(list); + List roadData = roadDataService.listRoadDataByTimeRegion(start,end); + roadData.forEach(roadData1 -> { + roadData1.setDt(roadData1.getDt().substring(0,10)); + }); + return Result.success(roadData); } /**