From 497e3161f4e8fc2be2a78a348ccf3dfcfe4ea602 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Sat, 17 Jan 2026 15:40:01 +0800
Subject: [PATCH] 反制

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java
index 12709fc..0a74419 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/cockpit/service/impl/CockpitServiceImpl.java
+++ b/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);
 	}
 

--
Gitblit v1.9.3