From 7101588d0765780ce18aff3a380c8f3f29efc472 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 08 Apr 2026 20:18:46 +0800
Subject: [PATCH] opt:优化

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java
index bf7f0f3..8fbef5c 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringUtil;
@@ -46,6 +47,7 @@
 import java.util.Set;
 
 @Service
+@Slf4j
 public class CockpitServiceImpl implements ICockpitService {
 
 	@Resource
@@ -77,6 +79,7 @@
 			Region byCode = RegionCache.getByCode(dept.getAreaCode());
 			fwDevice.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode()));
 			fwDevice.setCurrentDeptId(AuthUtil.getDeptId());
+			fwDevice.setFlyTime(new Date());
 		IPage<CockpitFwDeviceVO> cockpitFwDeviceVOIPage = fwDeviceService.selectCockpitDevicePage(page, fwDevice);
 		return cockpitFwDeviceVOIPage;
 	}
@@ -115,8 +118,8 @@
 		fwEffectEvalEntity.setDeviceName(device.getDeviceName());
 		fwEffectEvalEntity.setDeviceModel(device.getDeviceModel());
 		fwEffectEvalEntity.setDeviceType(device.getDeviceType());
-		fwEffectEvalEntity.setDeployLongitude(device.getLongitude() != null ? Double.parseDouble(device.getLongitude()) : null);
-		fwEffectEvalEntity.setDeployLatitude(device.getLatitude() != null ? Double.parseDouble(device.getLatitude()) : null);
+		fwEffectEvalEntity.setDeployLongitude(StringUtil.isNotBlank(device.getLongitude()) ? Double.parseDouble(device.getLongitude()) : null);
+		fwEffectEvalEntity.setDeployLatitude(StringUtil.isNotBlank(device.getLatitude()) ? Double.parseDouble(device.getLatitude()) : null);
 		fwEffectEvalEntity.setAreaCode(device.getAreaCode());
 
 		// 反制效果及工作模式(从参数获取,否则使用默认值)
@@ -148,10 +151,16 @@
 	@Override
 	public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) {
 		FwDeviceDTO fwDeviceDTO = new FwDeviceDTO();
+		// 打印用户信息
+		log.info("用户信息:{}", AuthUtil.getUser());
+		// 获取部门信息
 		Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId()));
+		log.info("部门信息:{}", dept);
 		Region byCode = RegionCache.getByCode(dept.getAreaCode());
+		log.info("区域信息:{}", byCode);
 		fwDeviceDTO.setCurrentDeptId(AuthUtil.getDeptId());
 		fwDeviceDTO.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode()));
+		fwDeviceDTO.setFlyTime(new Date());
 		return fwDeviceService.getDeviceStatistics(fwDeviceDTO);
 	}
 
@@ -166,8 +175,8 @@
 	}
 
 	@Override
-	public SceneManageStatisticsVO statisticsSceneManageAndArea() {
-		List<FwDefenseSceneManageVO> sceneManageList = iFwDefenseSceneManageService.selectFwDefenseSceneManageCockpitList(buildFwBaseInfo());
+	public SceneManageStatisticsVO statisticsSceneManageAndArea(Date filterTime) {
+		List<FwDefenseSceneManageVO> sceneManageList = iFwDefenseSceneManageService.selectFwDefenseSceneManageCockpitList(buildFwBaseInfo(), filterTime);
 		SceneManageStatisticsVO statisticsVO = new SceneManageStatisticsVO();
 		if (sceneManageList == null || sceneManageList.isEmpty()) {
 			statisticsVO.setSceneManageCount(0);

--
Gitblit v1.9.3