吉安感知网项目-后端
linwei
2026-01-21 23e1f1330b144f63780c1a5d438e2b3c53be2d7f
Merge remote-tracking branch 'origin/master'
5 files modified
66 ■■■■■ changed files
drone-service/drone-desk/pom.xml 4 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java 17 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java 11 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java 26 ●●●●● patch | view | raw | blame | history
drone-service/pom.xml 8 ●●●●● patch | view | raw | blame | history
drone-service/drone-desk/pom.xml
@@ -15,10 +15,6 @@
    <packaging>jar</packaging>
    <dependencies>
        <dependency>
            <groupId>org.springblade</groupId>
            <artifactId>blade-starter-swagger</artifactId>
        </dependency>
        <!--Oss-->
        <dependency>
            <groupId>org.springblade</groupId>
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java
@@ -32,7 +32,6 @@
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO;
import org.sxkj.fw.common.GenericConverter;
@@ -104,21 +103,7 @@
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入fwDevice")
    public R<IPage<FwDeviceVO>> page(FwDevicePageParam fwDevice, Query query) {
        IPage<FwDeviceEntity> pages = fwDeviceService.selectFwDevicePage(Condition.getPage(query), GenericConverter.convert(fwDevice, FwDeviceDTO.class));
        IPage<FwDeviceVO> result = FwDeviceWrapper.build().pageVO(pages);
        List<FwDeviceVO> records = result.getRecords();
        if (records != null && !records.isEmpty()) {
            List<Long> deviceIds = records.stream()
                .map(FwDeviceVO::getId)
                .filter(id -> id != null)
                .collect(Collectors.toList());
            Map<Long, String> sceneNameMap = fwDeviceService.selectSceneNameByDeviceIds(deviceIds);
            for (FwDeviceVO record : records) {
                String sceneName = sceneNameMap.get(record.getId());
                record.setSceneName(StringUtil.isBlank(sceneName) ? "/" : sceneName);
            }
        }
        return R.data(result);
        return R.data(fwDeviceService.selectFwDevicePageVo(fwDevice, query));
    }
    /**
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java
@@ -21,12 +21,14 @@
import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO;
import org.sxkj.fw.device.dto.FwDeviceDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.param.FwDevicePageParam;
import org.sxkj.fw.device.vo.CockpitFwDeviceVO;
import org.sxkj.fw.device.vo.DeviceTypeStatisticsVO;
import org.sxkj.fw.device.vo.FwDeviceVO;
import org.sxkj.fw.device.excel.FwDeviceExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import java.util.List;
import java.util.Map;
@@ -47,6 +49,15 @@
    IPage<FwDeviceEntity> selectFwDevicePage(IPage<FwDeviceEntity> page, FwDeviceDTO fwDevice);
    /**
     * 自定义分页返回
     *
     * @param fwDevice
     * @param query
     * @return
     */
    IPage<FwDeviceVO> selectFwDevicePageVo(FwDevicePageParam fwDevice, Query query);
    /**
     * 列表查询
     *
     * @param isAreaSelect 是否过滤区域
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -18,8 +18,10 @@
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.entity.FwDeviceEntity;
import org.sxkj.fw.device.param.FwDevicePageParam;
import org.sxkj.fw.device.vo.CockpitFwDeviceVO;
import org.sxkj.fw.device.vo.DeviceTypeStatisticsVO;
import org.sxkj.fw.device.vo.FwDeviceVO;
@@ -27,12 +29,17 @@
import org.sxkj.fw.device.mapper.FwDeviceMapper;
import org.sxkj.fw.device.service.IFwDeviceService;
import org.sxkj.fw.area.service.IFwAreaDivideService;
import org.sxkj.fw.device.wrapper.FwDeviceWrapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.StringUtil;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
/**
@@ -53,6 +60,25 @@
    }
    @Override
    public IPage<FwDeviceVO> selectFwDevicePageVo(FwDevicePageParam fwDevice, Query query) {
        IPage<FwDeviceEntity> pages = selectFwDevicePage(Condition.getPage(query), GenericConverter.convert(fwDevice, FwDeviceDTO.class));
        IPage<FwDeviceVO> result = FwDeviceWrapper.build().pageVO(pages);
        List<FwDeviceVO> records = result.getRecords();
        if (records != null && !records.isEmpty()) {
            List<Long> deviceIds = records.stream()
                .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());
                record.setSceneName(StringUtil.isBlank(sceneName) ? "/" : sceneName);
            }
        }
        return result;
    }
    @Override
    public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status) {
        return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status);
    }
drone-service/pom.xml
@@ -34,6 +34,10 @@
        </dependency>
        <dependency>
            <groupId>org.springblade</groupId>
            <artifactId>blade-starter-swagger</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springblade</groupId>
            <artifactId>blade-starter-metrics</artifactId>
        </dependency>
        <dependency>
@@ -81,6 +85,10 @@
            <artifactId>jnats</artifactId>
            <version>2.11.2</version>
        </dependency>
        <dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>knife4j-core</artifactId>
        </dependency>
    </dependencies>
</project>