From 6a8762f95544819eeea4a4d5503232e1925ca04c Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Tue, 03 Feb 2026 17:28:49 +0800
Subject: [PATCH] 反无驾驶舱优化

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java |   66 +++++++++++++++++++++++++-------
 1 files changed, 51 insertions(+), 15 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 5ffaa9a..3811d56 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
@@ -4,6 +4,11 @@
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springframework.stereotype.Service;
+import org.sxkj.common.utils.HeaderUtils;
+import org.sxkj.fw.area.service.IFwAreaDivideService;
+import org.sxkj.fw.area.service.IFwDefenseSceneManageService;
+import org.sxkj.fw.area.vo.FwAreaDivideVO;
+import org.sxkj.fw.area.vo.FwDefenseSceneManageVO;
 import org.sxkj.fw.cockpit.service.ICockpitService;
 import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO;
 import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO;
@@ -24,6 +29,8 @@
 import org.sxkj.system.entity.Region;
 
 import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.util.Date;
 import java.util.List;
 import java.util.Optional;
 
@@ -39,6 +46,12 @@
 	@Resource
 	private IFwEffectEvalService fwEffectEvalService;
 
+	@Resource
+	private IFwAreaDivideService iFwAreaDivideService;
+
+	@Resource
+	private IFwDefenseSceneManageService iFwDefenseSceneManageService;
+
 
 	@Override
 	public IPage<FwDroneAlarmRecordVO> selectFwDroneAlarmRecordPage(IPage<FwDroneAlarmRecordVO> page, FwDroneAlarmRecordDTO fwDroneAlarmRecord) {
@@ -47,14 +60,10 @@
 
 	@Override
 	public IPage<CockpitFwDeviceVO> selectCockpitDevicePage(IPage<CockpitFwDeviceVO> page, FwDeviceDTO fwDevice) {
-		// List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
-		// fwDevice.setDeptList(deptList);
-		// fwDevice.setCurrentDeptId(AuthUtil.getDeptId());
-		Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId()));
-		Region byCode = RegionCache.getByCode(dept.getAreaCode());
-		String regionName = byCode.getName();
-		fwDevice.setRegionName(regionName);
-		fwDevice.setCurrentDeptId(AuthUtil.getDeptId());
+			Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId()));
+			Region byCode = RegionCache.getByCode(dept.getAreaCode());
+			fwDevice.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode()));
+			fwDevice.setCurrentDeptId(AuthUtil.getDeptId());
 		IPage<CockpitFwDeviceVO> cockpitFwDeviceVOIPage = fwDeviceService.selectCockpitDevicePage(page, fwDevice);
 		return cockpitFwDeviceVOIPage;
 	}
@@ -64,8 +73,7 @@
 		// List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
 		Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId()));
 		Region byCode = RegionCache.getByCode(dept.getAreaCode());
-		String regionName = byCode.getName();
-		return fwDeviceService.statisticalDeviceType(regionName, AuthUtil.getDeptId());
+		return fwDeviceService.statisticalDeviceType(HeaderUtils.formatAreaCode(byCode.getCode()), AuthUtil.getDeptId());
 	}
 
 	@Override
@@ -112,23 +120,51 @@
 		// List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
 		Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId()));
 		Region byCode = RegionCache.getByCode(dept.getAreaCode());
-		String regionName = byCode.getName();
+		String regionCode = HeaderUtils.formatAreaCode(byCode.getCode());
 		// 设备统计
-		AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(regionName, AuthUtil.getDeptId());
+		AlarmStatisticsVO alarmStatisticsVO = fwDeviceService.statisticalDeviceAtt(regionCode, AuthUtil.getDeptId());
 		// 告警统计
-		AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(regionName, AuthUtil.getDeptId());
+		AlarmStatisticsVO alarmStatistics = fwDroneAlarmRecordService.alarmTypeStatistics(regionCode, AuthUtil.getDeptId());
 		alarmStatisticsVO.setHistoryAlarmCount(alarmStatistics.getHistoryAlarmCount());
 		alarmStatisticsVO.setRealTimeAlarmCount(alarmStatistics.getRealTimeAlarmCount());
 		return alarmStatisticsVO;
 	}
 
 	/**
-	 *
 	 * @param effectiveRangeKmIsNotNull
 	 * @return
 	 */
 	@Override
 	public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) {
-		return fwDeviceService.getDeviceOutStatistics(effectiveRangeKmIsNotNull);
+		FwDeviceDTO fwDeviceDTO = new FwDeviceDTO();
+		Dept dept = SysCache.getDept(Long.valueOf(AuthUtil.getDeptId()));
+		Region byCode = RegionCache.getByCode(dept.getAreaCode());
+		fwDeviceDTO.setCurrentDeptId(AuthUtil.getDeptId());
+		fwDeviceDTO.setRegionCode(HeaderUtils.formatAreaCode(byCode.getCode()));
+		return fwDeviceService.getDeviceStatistics(fwDeviceDTO);
+	}
+
+	/**
+	 *
+	 * @param filterTime
+	 * @return
+	 */
+	@Override
+	public List<FwDefenseSceneManageVO> selectFwDefenseSceneManageList(Date filterTime) {
+		return iFwDefenseSceneManageService.selectFwDefenseSceneManageList(filterTime);
+	}
+
+	/**
+	 *
+	 * @param filterSelected
+	 * @param sceneId
+	 * @param areaTypeKeys
+	 * @param isSetSceneManage
+	 * @param flyTime
+	 * @return
+	 */
+	@Override
+	public List<FwAreaDivideVO> selectFwAreaDivideList(Integer filterSelected, Long sceneId, String areaTypeKeys, Integer isSetSceneManage, LocalDateTime flyTime) {
+		return iFwAreaDivideService.selectFwAreaDivideList(filterSelected, sceneId, areaTypeKeys, isSetSceneManage, flyTime);
 	}
 }

--
Gitblit v1.9.3