diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index 29f38af..29bdc66 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -389,8 +389,9 @@ public class Controller { //获取最新的实时客流列表,从表获取 @GetMapping("listPassengerFlow") @ApiOperation("获取最新的实时客流列表,从表获取,热力图") - public List listPassengerFlow(){ - List list = passengerFlowService.listPassengerFlow(); + @ApiImplicitParam(name="timeId",value = "时间点",required = false,paramType = "query",dataType = "string") + public List listPassengerFlow(@RequestParam(value="timeId",required = false,defaultValue = "1970000000") String timeId){ + List list = passengerFlowService.listPassengerFlow(timeId); return list; } diff --git a/src/main/java/com/hisense/monitormanage/service/PassengerFlowService.java b/src/main/java/com/hisense/monitormanage/service/PassengerFlowService.java index 5298a68..7780429 100644 --- a/src/main/java/com/hisense/monitormanage/service/PassengerFlowService.java +++ b/src/main/java/com/hisense/monitormanage/service/PassengerFlowService.java @@ -106,13 +106,17 @@ public class PassengerFlowService { return list; } //从表中获取最新的实时客流 - public List listPassengerFlow(){ - PassengerFlow passengerFlow = passengerFlowMapper.getByMaxId(); - String timeId = passengerFlow.getTimeId(); - + public List listPassengerFlow(String timeId){ + List lists = new ArrayList<>(); + long longTimeId = Long.valueOf(timeId); + if(longTimeId == 1970000000){ + PassengerFlow passengerFlow = passengerFlowMapper.getByMaxId(); + timeId = passengerFlow.getTimeId(); + } QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("time_id",timeId); - List lists = passengerFlowMapper.selectList(wrapper); + lists = passengerFlowMapper.selectList(wrapper); + return lists; } @Scheduled(cron = "0 31 10-22/1 * * ? ")