吉安感知网项目-后端
linwei
2026-02-11 dbc7e62be76ff48b26461ffaef9c3fc87be018cb
drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/controller/CockpitController.java
@@ -2,32 +2,29 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import org.sxkj.fw.area.vo.FwAreaDivideVO;
import org.sxkj.fw.area.vo.FwDefenseSceneManageVO;
import org.sxkj.fw.cockpit.service.ICockpitService;
import org.sxkj.fw.cockpit.vo.AlarmStatisticsVO;
import org.sxkj.fw.cockpit.vo.DeviceStatisticsVO;
import org.sxkj.fw.detection.dto.FwEffectEvalDTO;
import org.sxkj.fw.detection.entity.FwEffectEvalEntity;
import org.sxkj.fw.detection.service.IFwEffectEvalService;
import org.sxkj.fw.cockpit.vo.SceneManageStatisticsVO;
import org.sxkj.fw.detection.param.FwEffectEvalParam;
import org.sxkj.fw.device.dto.FwDeviceDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
import org.sxkj.fw.device.service.IFwDeviceService;
import org.sxkj.fw.device.vo.FwDeviceVO;
import org.sxkj.fw.device.wrapper.FwDeviceWrapper;
import org.sxkj.fw.device.vo.CockpitFwDeviceVO;
import org.sxkj.fw.record.dto.FwDroneAlarmRecordDTO;
import org.sxkj.fw.record.service.IFwDroneAlarmRecordService;
import org.sxkj.fw.record.vo.FwDroneAlarmRecordVO;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
 * 数据驾驶舱
@@ -61,9 +58,9 @@
   @GetMapping("/deviceSearch")
   @ApiOperationSupport(order = 2)
   @ApiOperation(value = "设备查询", notes = "传入fwDevice")
   public R<IPage<FwDeviceVO>> page(FwDeviceDTO fwDevice, Query query) {
      IPage<FwDeviceEntity> pages = cockpitService.selectFwDevicePage(Condition.getPage(query), fwDevice);
      return R.data(FwDeviceWrapper.build().pageVO(pages));
   public R<IPage<CockpitFwDeviceVO>> page(FwDeviceDTO fwDevice, Query query) {
      IPage<CockpitFwDeviceVO> pages = cockpitService.selectCockpitDevicePage(Condition.getPage(query), fwDevice);
      return R.data(pages);
   }
   /**
@@ -78,6 +75,20 @@
   }
   /**
    * 设备出库去向统计
    * @return 统计数据
    */
   @GetMapping("/statisticalDeviceOut")
   @ApiOperationSupport(order = 7)
   @ApiOperation(value = "设备出库去向统计", notes = "设备出库去向统计")
   @ApiImplicitParams({
      @ApiImplicitParam(name = "effectiveRangeKmIsNotNull", value = "有效范围是否为空:0-不处理 1-不为空 2-为空", paramType = "query", dataType = "string")
   })
   public R<List<DeviceStatisticsVO>> statisticalDeviceOut(String effectiveRangeKmIsNotNull) {
      return R.data(cockpitService.getDeviceOutStatistics(effectiveRangeKmIsNotNull));
   }
   /**
    * 告警记录统计接口
    */
   @GetMapping("/alarmStatistics")
@@ -89,13 +100,54 @@
   }
   /**
    * 场景管理与区域数量统计
    */
   @GetMapping("/sceneManageStatistics")
   @ApiOperationSupport(order = 6)
   @ApiOperation(value = "场景管理统计", notes = "返回场景管理数量与区域数量")
   public R<SceneManageStatisticsVO> getSceneManageStatistics(
      @ApiParam(value = "时间筛选(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date time) {
      Date filterTime = time == null ? new Date() : time;
      SceneManageStatisticsVO statistics = cockpitService.statisticsSceneManageAndArea(filterTime);
      return R.data(statistics);
   }
   /**
    * 信号干扰,诱导驱离
    */
   @PostMapping("/interferenceAndExpulsion")
   @ApiOperationSupport(order = 5)
   @ApiOperation(value = "信号干扰,诱导驱离", notes = "传入fwEffectEval")
   public R submit(@Valid @RequestBody FwEffectEvalDTO fwEffectEval) {
      FwEffectEvalEntity fwEffectEvalEntity = Objects.requireNonNull(BeanUtil.copy(fwEffectEval, FwEffectEvalEntity.class));
      return R.status(cockpitService.saveOrUpdate(fwEffectEvalEntity));
   public R interferenceAndExpulsion(@Valid @RequestBody FwEffectEvalParam fwEffectEvalParam) {
       return R.status(cockpitService.interferenceAndExpulsion(fwEffectEvalParam));
   }
   /**
    * 区域划分表 列表
    */
   @GetMapping("/areaDivideList")
   @ApiOperationSupport(order = 2)
   @ApiOperation(value = "列表-不带分页", notes = "传入filterSelected或sceneId或areaTypeKeys或isSetSceneManage或flyTime")
   public R<List<FwAreaDivideVO>> list(
      @ApiParam(value = "是否过滤已被选择的数据(1过滤 0不过滤)") @RequestParam(required = false) Integer filterSelected,
      @ApiParam(value = "场景id") @RequestParam(required = false) Long sceneId,
      @ApiParam(value = "区域类型key集合(逗号分隔)") @RequestParam(required = false) String areaTypeKeys,
      @ApiParam(value = "是否按场景管理过滤(1是 0或空否)") @RequestParam(required = false) Integer isSetSceneManage,
      @ApiParam(value = "时间筛选(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime flyTime) {
      List<FwAreaDivideVO> list = cockpitService.selectFwAreaDivideList(filterSelected, sceneId, areaTypeKeys, isSetSceneManage, flyTime);
      return R.data(list);
   }
   /**
    * 场景管理表 列表
    */
   @GetMapping("/defenseSceneManageList")
   @ApiOperationSupport(order = 4)
   @ApiOperation(value = "列表", notes = "传入time")
   public R<List<FwDefenseSceneManageVO>> list(
      @ApiParam(value = "时间筛选(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date time) {
      Date filterTime = time == null ? new Date() : time;
      List<FwDefenseSceneManageVO> list = cockpitService.selectFwDefenseSceneManageList(filterTime);
      return R.data(list);
   }
}