From f799d1ec5a439003baf2ec6d7a5919718cfdcc14 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Sat, 17 Jan 2026 17:19:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java
index 8fdb320..4f5a61f 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java
@@ -99,6 +99,14 @@
 		if (null == fwDeviceMaintainPlan.getDeviceId()) {
 			return R.fail("参数错误");
 		}
+
+		long count = fwDeviceMaintainPlanService.count(new QueryWrapper<FwDeviceMaintainPlanEntity>().lambda()
+				.eq(FwDeviceMaintainPlanEntity::getDeviceId, fwDeviceMaintainPlan.getDeviceId()));
+
+		if (count > 0) {
+			return R.fail("该设备已建立维护计划");
+		}
+
 		return R.status(fwDeviceMaintainPlanService.saveOrUpdate(FwDeviceMaintainPlanWrapper.build().entityDTO(fwDeviceMaintainPlan)));
 	}
 

--
Gitblit v1.9.3