吉安感知网项目-后端
rain
2026-01-29 335552671e353fff124298a1cf819e9354b1b304
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -21,6 +21,7 @@
import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO;
import org.sxkj.fw.common.GenericConverter;
import org.sxkj.fw.device.dto.FwDeviceDTO;
import org.sxkj.fw.device.dto.FwDevicePolygonQueryDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.param.FwDevicePageParam;
import org.sxkj.fw.device.vo.CockpitFwDeviceVO;
@@ -66,6 +67,7 @@
   @Override
   public IPage<FwDeviceVO> selectFwDevicePageVo(FwDevicePageParam fwDevice, Query query) {
      FwDeviceDTO fwDeviceDTO = GenericConverter.convert(fwDevice, FwDeviceDTO.class);
      // 按当前部门及下级部门范围过滤数据
      List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
      fwDeviceDTO.setDeptList(deptList);
      IPage<FwDeviceEntity> pages = selectFwDevicePage(Condition.getPage(query), fwDeviceDTO);
@@ -76,6 +78,7 @@
            .map(FwDeviceVO::getId)
            .filter(id -> id != null)
            .collect(Collectors.toList());
         // 批量补充设备关联场景名称
         Map<Long, String> sceneNameMap = selectSceneNameByDeviceIds(deviceIds);
         for (FwDeviceVO record : records) {
            String sceneName = sceneNameMap.get(record.getId());
@@ -88,6 +91,11 @@
   @Override
   public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack) {
      return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status, isTrack);
   }
   @Override
   public List<FwDeviceEntity> selectFwDeviceListByPolygons(FwDevicePolygonQueryDTO query) {
      return baseMapper.selectFwDeviceListByPolygons(query);
   }
@@ -118,8 +126,8 @@
    * @return
    */
   @Override
   public List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList) {
      return baseMapper.statisticalDeviceType(deptList);
   public List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList,String currentDeptId) {
      return baseMapper.statisticalDeviceType(deptList,currentDeptId);
   }
   /**
@@ -129,18 +137,21 @@
    */
   @Override
   public List<DeviceTypeStatisticsVO> getDeviceTypeStatistics() {
      // 统计范围限定在当前部门及下级部门
      List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
      return baseMapper.getDeviceTypeStatistics(deptList);
   }
   @Override
   public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) {
      // 统计范围限定在当前部门及下级部门
      List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
      return baseMapper.getDeviceOutStatistics(effectiveRangeKmIsNotNull, deptList);
   }
   @Override
   public List<DeviceStatisticsVO> getDeviceManufacturerStatistics() {
      // 统计范围限定在当前部门及下级部门
      List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
      return baseMapper.getDeviceManufacturerStatistics(deptList);
   }
@@ -151,8 +162,8 @@
    * @return
    */
   @Override
   public AlarmStatisticsVO statisticalDeviceAtt(List<Long> deptList) {
      return baseMapper.statisticalDeviceAtt(deptList);
   public AlarmStatisticsVO statisticalDeviceAtt(List<Long> deptList, String currentDeptId) {
      return baseMapper.statisticalDeviceAtt(deptList, currentDeptId);
   }
   @Override
@@ -173,6 +184,7 @@
    */
   @Override
   public boolean saveOrUpdateDevice(FwDeviceEntity fwDeviceEntity) {
      // 无效范围时清空坐标,避免显示无意义位置
      if (fwDeviceEntity.getEffectiveRangeKm() == null || fwDeviceEntity.getEffectiveRangeKm().compareTo(BigDecimal.ZERO) == 0) {
         fwDeviceEntity.setLatitude("");
         fwDeviceEntity.setLongitude("");