From 5b23a8cb9294506d88330f0750f39b9a2cbabbdc Mon Sep 17 00:00:00 2001
From: rain <1679827795@qq.com>
Date: Thu, 29 Jan 2026 18:06:19 +0800
Subject: [PATCH] 区域划分调整
---
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java | 52 ++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
index 3475c5f..60a621e 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -16,10 +16,12 @@
*/
package org.sxkj.fw.device.service.impl;
+import org.springblade.core.secure.utils.AuthUtil;
import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO;
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;
@@ -37,6 +39,7 @@
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.StringUtil;
+import org.sxkj.system.cache.SysCache;
import java.math.BigDecimal;
import java.util.List;
@@ -63,7 +66,10 @@
@Override
public IPage<FwDeviceVO> selectFwDevicePageVo(FwDevicePageParam fwDevice, Query query) {
- IPage<FwDeviceEntity> pages = selectFwDevicePage(Condition.getPage(query), GenericConverter.convert(fwDevice, FwDeviceDTO.class));
+ 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);
IPage<FwDeviceVO> result = FwDeviceWrapper.build().pageVO(pages);
List<FwDeviceVO> records = result.getRecords();
if (records != null && !records.isEmpty()) {
@@ -81,15 +87,20 @@
}
@Override
- public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status) {
- return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status);
+ 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);
}
@Override
public List<FwDeviceExcel> exportFwDevice(Wrapper<FwDeviceEntity> queryWrapper) {
List<FwDeviceExcel> fwDeviceList = baseMapper.exportFwDevice(queryWrapper);
- //fwDeviceList.forEach(fwDevice -> {
+ // fwDeviceList.forEach(fwDevice -> {
// fwDevice.setTypeName(DictCache.getValue(DictEnum.YES_NO, FwDevice.getType()));
//});
return fwDeviceList;
@@ -97,6 +108,7 @@
/**
* 获取设备列表
+ *
* @param page
* @param fwDevice
* @return
@@ -108,39 +120,45 @@
/**
* 设备类型统计
+ *
* @return
*/
@Override
- public List<DeviceStatisticsVO> statisticalDeviceType() {
- return baseMapper.statisticalDeviceType();
+ public List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList,String currentDeptId) {
+ return baseMapper.statisticalDeviceType(deptList,currentDeptId);
}
/**
* 设备统计 - 按类型统计
+ *
* @return 统计数据
*/
@Override
public List<DeviceTypeStatisticsVO> getDeviceTypeStatistics() {
- return baseMapper.getDeviceTypeStatistics();
+ List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
+ return baseMapper.getDeviceTypeStatistics(deptList);
}
@Override
public List<DeviceStatisticsVO> getDeviceOutStatistics(String effectiveRangeKmIsNotNull) {
- return baseMapper.getDeviceOutStatistics(effectiveRangeKmIsNotNull);
+ List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
+ return baseMapper.getDeviceOutStatistics(effectiveRangeKmIsNotNull, deptList);
}
@Override
public List<DeviceStatisticsVO> getDeviceManufacturerStatistics() {
- return baseMapper.getDeviceManufacturerStatistics();
+ List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
+ return baseMapper.getDeviceManufacturerStatistics(deptList);
}
/**
* 设备属性统计
+ *
* @return
*/
@Override
- public AlarmStatisticsVO statisticalDeviceAtt() {
- return baseMapper.statisticalDeviceAtt();
+ public AlarmStatisticsVO statisticalDeviceAtt(List<Long> deptList, String currentDeptId) {
+ return baseMapper.statisticalDeviceAtt(deptList, currentDeptId);
}
@Override
@@ -155,15 +173,21 @@
/**
* 保存或更新设备信息
+ *
* @param fwDeviceEntity
* @return
*/
@Override
public boolean saveOrUpdateDevice(FwDeviceEntity fwDeviceEntity) {
- if (fwDeviceEntity.getEffectiveRangeKm() == null || fwDeviceEntity.getEffectiveRangeKm().compareTo(BigDecimal.ZERO) == 0 ) {
- fwDeviceEntity.setLatitude(null);
- fwDeviceEntity.setLongitude(null);
+ if (fwDeviceEntity.getEffectiveRangeKm() == null || fwDeviceEntity.getEffectiveRangeKm().compareTo(BigDecimal.ZERO) == 0) {
+ fwDeviceEntity.setLatitude("");
+ fwDeviceEntity.setLongitude("");
}
return saveOrUpdate(fwDeviceEntity);
}
+
+ @Override
+ public boolean updateTrackStatusByDeviceId(Long deviceId, Integer trackStatus) {
+ return baseMapper.updateTrackStatusByDeviceId(deviceId, trackStatus) > 0;
+ }
}
--
Gitblit v1.9.3