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); } /**