From dab98d2c0f573d8e17a7786a879e595e6d535a9a Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 28 Jan 2026 19:45:36 +0800
Subject: [PATCH] 工单-机构权限控制
---
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java | 46 ++++++++++++++++++++++++++++++++--------------
1 files changed, 32 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..386bf11 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,6 +16,7 @@
*/
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;
@@ -37,6 +38,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 +65,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 +86,15 @@
}
@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<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 +102,7 @@
/**
* 获取设备列表
+ *
* @param page
* @param fwDevice
* @return
@@ -108,39 +114,45 @@
/**
* 设备类型统计
+ *
* @return
*/
@Override
- public List<DeviceStatisticsVO> statisticalDeviceType() {
- return baseMapper.statisticalDeviceType();
+ public List<DeviceStatisticsVO> statisticalDeviceType(List<Long> deptList) {
+ return baseMapper.statisticalDeviceType(deptList);
}
/**
* 设备统计 - 按类型统计
+ *
* @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) {
+ return baseMapper.statisticalDeviceAtt(deptList);
}
@Override
@@ -155,15 +167,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