道路污染事件时间显示去掉时分秒

This commit is contained in:
wuweida 2022-08-09 09:13:04 +08:00
parent 0e958c92ea
commit 793fdaec52
1 changed files with 10 additions and 4 deletions

View File

@ -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<RoadData> list = roadDataService.listRoadData(dt);
return Result.success(list);
List<RoadData> 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<RoadData> list = roadDataService.listRoadDataByTimeRegion(start,end);
return Result.success(list);
List<RoadData> roadData = roadDataService.listRoadDataByTimeRegion(start,end);
roadData.forEach(roadData1 -> {
roadData1.setDt(roadData1.getDt().substring(0,10));
});
return Result.success(roadData);
}
/**