吉安感知网项目-后端
linwei
2026-01-17 497e3161f4e8fc2be2a78a348ccf3dfcfe4ea602
drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java
@@ -1,12 +1,12 @@
package org.sxkj.fw.cockpit.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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.entity.FwEffectEvalEntity;
import org.sxkj.fw.detection.param.FwEffectEvalParam;
import org.sxkj.fw.detection.service.IFwEffectEvalService;
import org.sxkj.fw.device.dto.FwDeviceDTO;
import org.sxkj.fw.device.entity.FwDeviceEntity;
@@ -49,11 +49,36 @@
   }
   @Override
   public boolean saveOrUpdate(FwEffectEvalEntity fwEffectEvalEntity) {
      FwDroneAlarmRecordEntity alarmRecordEntity = fwDroneAlarmRecordService.getById(fwEffectEvalEntity.getAlarmRecordId());
   public boolean interferenceAndExpulsion(FwEffectEvalParam fwEffectEvalParam) {
      FwDroneAlarmRecordEntity alarmRecordEntity = fwDroneAlarmRecordService.getById(fwEffectEvalParam.getAlarmRecordId());
      FwDeviceEntity device = fwDeviceService.getById(alarmRecordEntity.getDeviceId());
      FwEffectEvalEntity fwEffectEvalEntity = new FwEffectEvalEntity();
      // 告警记录相关字段
      fwEffectEvalEntity.setAlarmRecordId(fwEffectEvalParam.getAlarmRecordId());
      fwEffectEvalEntity.setDroneName(alarmRecordEntity.getDroneName());
      fwEffectEvalEntity.setDroneType(alarmRecordEntity.getDroneType());
      fwEffectEvalEntity.setDroneDeviceCode(alarmRecordEntity.getDroneSerialNo());
      fwEffectEvalEntity.setFindTime(alarmRecordEntity.getAlarmTime());
      // 从参数获取反制方式,否则使用告警记录中的值
      fwEffectEvalEntity.setCounterWay(fwEffectEvalParam.getCounterWay());
      // 设备相关字段
      fwEffectEvalEntity.setDeviceId(alarmRecordEntity.getDeviceId());
      fwEffectEvalEntity.setCounterEffect("1");
      fwEffectEvalEntity.setDeviceSn(device.getDeviceSn());
      fwEffectEvalEntity.setDeviceName(device.getDeviceName());
      fwEffectEvalEntity.setDeviceModel(device.getDeviceModel());
      fwEffectEvalEntity.setDeviceType(device.getDeviceType());
      fwEffectEvalEntity.setDeployLongitude(device.getLongitude() != null ? Double.parseDouble(device.getLongitude()) : null);
      fwEffectEvalEntity.setDeployLatitude(device.getLatitude() != null ? Double.parseDouble(device.getLatitude()) : null);
      fwEffectEvalEntity.setAreaCode(device.getAreaCode());
      // 反制效果及工作模式(从参数获取,否则使用默认值)
      fwEffectEvalEntity.setCounterEffect( "1"); // 1.success/2.fail
      fwEffectEvalEntity.setCoverRadiusM(2500); // 覆盖范围(米)
      fwEffectEvalEntity.setWorkMode( "1"); // 1.机动/2.固定
      return fwEffectEvalService.saveOrUpdate(fwEffectEvalEntity);
   }