From 6d519a2e6ed96b887220cd0e87dd434589e096d9 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Fri, 15 Jul 2022 17:29:21 +0800 Subject: [PATCH] 1 --- .../monitormanage/config/ScheduleConfig.java | 6 +++--- .../monitormanage/controller/KeyAreaController.java | 13 ++++++++++--- .../monitormanage/mapper/CameraChannelMapper.java | 2 +- .../hisense/monitormanage/mapper/KeyAreaMapper.java | 4 +--- .../hisense/monitormanage/service/QidiService.java | 2 +- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/config/ScheduleConfig.java b/src/main/java/com/hisense/monitormanage/config/ScheduleConfig.java index 13366b6..d4e3bfa 100644 --- a/src/main/java/com/hisense/monitormanage/config/ScheduleConfig.java +++ b/src/main/java/com/hisense/monitormanage/config/ScheduleConfig.java @@ -7,11 +7,11 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar; import java.util.concurrent.Executors; @Configuration -//所有的定时任务都放在一个线程池中,定时任务启动时使用不同都线程 +//所有的定时任务都放在一个线程池中,定时任务启动时使用不同的线程 public class ScheduleConfig implements SchedulingConfigurer { @Override public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { - //设定一个长度20的定时任务线程池 - scheduledTaskRegistrar.setScheduler(Executors.newScheduledThreadPool(20)); + //设定一个长度10的定时任务线程池 + scheduledTaskRegistrar.setScheduler(Executors.newScheduledThreadPool(10)); } } diff --git a/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java b/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java index 17cabda..cf84b80 100644 --- a/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java +++ b/src/main/java/com/hisense/monitormanage/controller/KeyAreaController.java @@ -6,6 +6,7 @@ import com.hisense.monitormanage.entity.Result; import com.hisense.monitormanage.mapper.KeyAreaMapper; import com.hisense.monitormanage.mapper.PassengerFlowMapper; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -24,11 +25,17 @@ public class KeyAreaController { @Autowired private PassengerFlowMapper passengerFlowMapper; - @GetMapping("seelctKeyAreaList") - public Result seelctKeyAreaList(String type){ + /** + * 根据区域类型查询区域的最新时间的人数 + * @param type + * @return + */ + @GetMapping("selectKeyAreaList") + @ApiOperation("根据区域类型查询区域的最新时间的人数") + public Result selectKeyAreaList(String type){ PassengerFlow maxId = passengerFlowMapper.getByMaxId(); String timeId = maxId.getTimeId(); - List keyAreaDtos = keyAreaMapper.seelctKeyAreaList(type,timeId); + List keyAreaDtos = keyAreaMapper.selectKeyAreaList(type,timeId); keyAreaDtos.forEach(keyAreaDto -> { keyAreaDto.setTimeId(timeId); }); diff --git a/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java b/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java index afc0fc3..51fab9e 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/CameraChannelMapper.java @@ -58,6 +58,6 @@ public interface CameraChannelMapper extends BaseMapper { List selectNLAll(@Param("page") Integer page,@Param("pageSize") Integer pageSize); - @Select("SELECT * FROM t_camera_channel WHERE channel_code < '404_37020303541317325034' AND channel_code > '404_37020300001310016729' ORDER BY channel_code DESC" ) + @Select("SELECT * FROM t_camera_channel WHERE channel_code < '404_37020300001310016759' AND channel_code > '183_37028352001328635450' ORDER BY channel_code DESC" ) List selectCameraChannel(); } diff --git a/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java b/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java index 32b533c..ee6d297 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/KeyAreaMapper.java @@ -13,8 +13,6 @@ import java.util.List; public interface KeyAreaMapper extends BaseMapper { @Select("select ka.type,ka.area_name,ka.location,ss.allNums from t_key_area ka LEFT JOIN (select pt.area_name,SUM(pf.all_nums) as allNums from t_passenger_flow pf JOIN t_passenger_test pt ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude WHERE pf.time_id = #{timeId} AND pt.type = #{type} GROUP BY pt.area_name) ss ON ka.area_name = ss.area_name WHERE ka.type = #{type}") - List seelctKeyAreaList(@Param("type") String type,@Param("timeId") String timeId); - - + List selectKeyAreaList(@Param("type") String type,@Param("timeId") String timeId); } diff --git a/src/main/java/com/hisense/monitormanage/service/QidiService.java b/src/main/java/com/hisense/monitormanage/service/QidiService.java index a990c71..d855052 100644 --- a/src/main/java/com/hisense/monitormanage/service/QidiService.java +++ b/src/main/java/com/hisense/monitormanage/service/QidiService.java @@ -8,6 +8,7 @@ import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -252,7 +253,6 @@ public class QidiService { LocalDate localDate = LocalDate.now(); LocalDate yestDay = localDate.minusDays(1); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - return yestDay.format(formatter); } }