From 2f07589b54d56085af77b50d580890cd4130b444 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期一, 19 十月 2026 15:19:53 +0800
Subject: [PATCH] 设备模块后端业务规则、计划接口与日期联动
---
cnas-device/src/main/java/com/ruoyi/device/controller/DeviceMaintenancePlanController.java | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/cnas-device/src/main/java/com/ruoyi/device/controller/DeviceMaintenancePlanController.java b/cnas-device/src/main/java/com/ruoyi/device/controller/DeviceMaintenancePlanController.java
index 81be805..3de42ec 100644
--- a/cnas-device/src/main/java/com/ruoyi/device/controller/DeviceMaintenancePlanController.java
+++ b/cnas-device/src/main/java/com/ruoyi/device/controller/DeviceMaintenancePlanController.java
@@ -3,8 +3,11 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.Result;
+import com.ruoyi.device.dto.DeviceMaintenancePlanDetailsDto;
import com.ruoyi.device.dto.DeviceMaintenancePlanDto;
import com.ruoyi.device.pojo.DeviceMaintenancePlan;
+import com.ruoyi.device.pojo.DeviceMaintenancePlanDetails;
+import com.ruoyi.device.service.DeviceMaintenancePlanDetailsService;
import com.ruoyi.device.service.DeviceMaintenancePlanService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
@@ -29,6 +32,9 @@
public class DeviceMaintenancePlanController {
@Resource
private DeviceMaintenancePlanService deviceMaintenancePlanService;
+
+ @Resource
+ private DeviceMaintenancePlanDetailsService deviceMaintenancePlanDetailsService;
/**
* 鍒嗛〉鏌ヨ璁惧淇濆吇璁″垝
@@ -80,6 +86,42 @@
}
/**
+ * 鎸夊勾浠芥煡璇㈣澶囦繚鍏昏鍒掞紙涓嶅瓨鍦ㄥ垯鑷姩鍒涘缓锛夛紝骞惰嚜鍔ㄨˉ鍏ㄥ凡鍒扮偣鐨勮澶囨槑缁�
+ */
+ @Operation(summary = "鎸夊勾浠芥煡璇㈣澶囦繚鍏昏鍒掞紙鑷姩鍒涘缓骞惰ˉ鍏ㄥ埌鐐规槑缁嗭級")
+ @GetMapping("/getPlanByYear")
+ public Result<DeviceMaintenancePlanDto> getPlanByYear(String planYear) {
+ return Result.success(deviceMaintenancePlanService.getOrCreatePlanByYear(planYear));
+ }
+
+ /**
+ * 璁惧淇濆吇璁″垝璇︽儏鍒楄〃锛堝惈鍒扮偣鏍囩孩锛�
+ */
+ @Operation(summary = "璁惧淇濆吇璁″垝璇︽儏鍒楄〃")
+ @GetMapping("/pageMaintenancePlanDetail")
+ public Result<IPage<DeviceMaintenancePlanDetailsDto>> pageMaintenancePlanDetail(Page page, Integer planId, String deviceName, String deviceNumber) {
+ return Result.success(deviceMaintenancePlanService.pageMaintenancePlanDetail(page, planId, deviceName, deviceNumber));
+ }
+
+ /**
+ * 淇敼璁惧淇濆吇璁″垝璇︽儏
+ */
+ @Operation(summary = "淇敼璁惧淇濆吇璁″垝璇︽儏")
+ @PostMapping("/updateMaintenancePlanDetail")
+ public Result updateMaintenancePlanDetail(@RequestBody DeviceMaintenancePlanDetails deviceMaintenancePlanDetails) {
+ return Result.success(deviceMaintenancePlanDetailsService.updateById(deviceMaintenancePlanDetails));
+ }
+
+ /**
+ * 鍒犻櫎璁惧淇濆吇璁″垝璇︽儏
+ */
+ @Operation(summary = "鍒犻櫎璁惧淇濆吇璁″垝璇︽儏")
+ @DeleteMapping("/delMaintenancePlanDetail")
+ public Result delMaintenancePlanDetail(Integer maintenancePlanDetailId) {
+ return Result.success(deviceMaintenancePlanDetailsService.removeById(maintenancePlanDetailId));
+ }
+
+ /**
* 瀵煎嚭璁惧淇濆吇璁″垝
*/
@Operation(summary = "瀵煎嚭璁惧淇濆吇璁″垝")
--
Gitblit v1.9.3