From 4e48664942bbefe70699ca43d25cbbd56ecc8daa Mon Sep 17 00:00:00 2001
From: xiebin <vip_xiaobin810@163.com>
Date: Mon, 19 Jan 2026 15:17:12 +0800
Subject: [PATCH] update-维修计划状态更新、新增定时器修改状态

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java
index 8fba3cc..8d2dd25 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceMaintainPlanServiceImpl.java
@@ -16,6 +16,9 @@
  */
 package org.sxkj.fw.device.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import org.sxkj.fw.device.dto.FwDeviceMaintainPlanDTO;
 import org.sxkj.fw.device.entity.FwDeviceMaintainPlanEntity;
 import org.sxkj.fw.device.vo.FwDeviceMaintainPlanVO;
 import org.sxkj.fw.device.excel.FwDeviceMaintainPlanExcel;
@@ -30,14 +33,20 @@
 /**
  * 设备维护计划表 服务实现类
  *
- * @author lw
- * @since 2026-01-07
+ * @author Aix
+ * @since 2026-01-09
  */
 @Service
 public class FwDeviceMaintainPlanServiceImpl extends BaseServiceImpl<FwDeviceMaintainPlanMapper, FwDeviceMaintainPlanEntity> implements IFwDeviceMaintainPlanService {
 
+
 	@Override
-	public IPage<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage<FwDeviceMaintainPlanVO> page, FwDeviceMaintainPlanVO fwDeviceMaintainPlan) {
+	public FwDeviceMaintainPlanVO getFwDeviceMaintainPlanById(Long id) {
+		return baseMapper.getFwDeviceMaintainPlanById(id);
+	}
+
+	@Override
+	public IPage<FwDeviceMaintainPlanVO> selectFwDeviceMaintainPlanPage(IPage<FwDeviceMaintainPlanVO> page, FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) {
 		return page.setRecords(baseMapper.selectFwDeviceMaintainPlanPage(page, fwDeviceMaintainPlan));
 	}
 
@@ -51,4 +60,18 @@
 		return fwDeviceMaintainPlanList;
 	}
 
+	@Override
+	public void batchUpdateExpiredPlans(List<Long> planIds) {
+		if (planIds == null || planIds.isEmpty()) {
+			return;
+		}
+
+		// 构建更新条件
+		LambdaUpdateWrapper<FwDeviceMaintainPlanEntity> updateWrapper = new LambdaUpdateWrapper<>();
+		updateWrapper.in(FwDeviceMaintainPlanEntity::getId, planIds)
+				.set(FwDeviceMaintainPlanEntity::getMaintainStatus, 0); // 未维护状态
+
+		// 执行批量更新
+		update(updateWrapper);
+	}
 }

--
Gitblit v1.9.3