From 0cf5aa07aeb9e0a0ceb0dceaa7b21a75f6cdd6ea Mon Sep 17 00:00:00 2001
From: xiebin <vip_xiaobin810@163.com>
Date: Wed, 21 Jan 2026 08:55:10 +0800
Subject: [PATCH] update-设备入库增加sn

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java |   11 +++++++++++
 1 files changed, 11 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 89644b3..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
@@ -96,6 +96,17 @@
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "新增或修改", notes = "传入fwDeviceMaintainPlan")
 	public R submit(@Valid @RequestBody FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) {
+		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