From d18ef72c533fe6b18d487bcd9fd333c63ca50f04 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Tue, 03 Feb 2026 15:20:27 +0800
Subject: [PATCH] 反无驾驶舱优化
---
drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java | 30 +++++++++++++++---------------
1 files changed, 15 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..1f10398 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,7 @@
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.cockpit.service.ICockpitService;
import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO;
import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO;
@@ -47,14 +48,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 +61,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 +108,27 @@
// 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);
}
}
--
Gitblit v1.9.3