From 51a551a7f8eae7654f973d45cd2fa2952774673d Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Fri, 07 Aug 2026 10:56:55 +0800
Subject: [PATCH] perf(task): 优化巡查任务审核性能并添加详细日志记录

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/controller/CockpitController.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/controller/CockpitController.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/controller/CockpitController.java
index 90b06e6..a4d948c 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/controller/CockpitController.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/controller/CockpitController.java
@@ -105,8 +105,10 @@
 	@GetMapping("/sceneManageStatistics")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "场景管理统计", notes = "返回场景管理数量与区域数量")
-	public R<SceneManageStatisticsVO> getSceneManageStatistics() {
-		SceneManageStatisticsVO statistics = cockpitService.statisticsSceneManageAndArea();
+	public R<SceneManageStatisticsVO> getSceneManageStatistics(
+		@ApiParam(value = "时间筛选(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date time) {
+		Date filterTime = time == null ? new Date() : time;
+		SceneManageStatisticsVO statistics = cockpitService.statisticsSceneManageAndArea(filterTime);
 		return R.data(statistics);
 	}
 
@@ -132,7 +134,11 @@
 		@ApiParam(value = "区域类型key集合(逗号分隔)") @RequestParam(required = false) String areaTypeKeys,
 		@ApiParam(value = "是否按场景管理过滤(1是 0或空否)") @RequestParam(required = false) Integer isSetSceneManage,
 		@ApiParam(value = "时间筛选(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime flyTime) {
-		List<FwAreaDivideVO> list = cockpitService.selectFwAreaDivideList(filterSelected, sceneId, areaTypeKeys, isSetSceneManage, flyTime);
+		LocalDateTime filterFlyTime = flyTime;
+		if (isSetSceneManage != null && isSetSceneManage == 1 && flyTime == null) {
+			filterFlyTime = LocalDateTime.now();
+		}
+		List<FwAreaDivideVO> list = cockpitService.selectFwAreaDivideList(filterSelected, sceneId, areaTypeKeys, isSetSceneManage, filterFlyTime);
 		return R.data(list);
 	}
 

--
Gitblit v1.9.3