From 8ad863082097ffdcab4a8e7f426d344a1fe6f892 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期六, 07 十一月 2026 00:27:02 +0800
Subject: [PATCH] 修复人员管理接口校验与导出,完善设备保养计划与文件受控功能
---
cnas-device/src/main/java/com/ruoyi/device/controller/DeviceMaintenancePlanController.java | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 44 insertions(+), 7 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 3de42ec..bed07d2 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
@@ -5,17 +5,19 @@
import com.ruoyi.common.core.domain.Result;
import com.ruoyi.device.dto.DeviceMaintenancePlanDetailsDto;
import com.ruoyi.device.dto.DeviceMaintenancePlanDto;
+import com.ruoyi.device.pojo.DeviceMaintenanceAttachment;
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;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
+import java.util.List;
import java.util.Map;
/**
@@ -32,9 +34,6 @@
public class DeviceMaintenancePlanController {
@Resource
private DeviceMaintenancePlanService deviceMaintenancePlanService;
-
- @Resource
- private DeviceMaintenancePlanDetailsService deviceMaintenancePlanDetailsService;
/**
* 鍒嗛〉鏌ヨ璁惧淇濆吇璁″垝
@@ -95,6 +94,15 @@
}
/**
+ * 淇濆吇璁″垝骞翠唤鍒楄〃锛堣嚜鍔ㄥ垹闄ゆ病鏈夋槑缁嗙殑绌哄勾浠借鍒掞級
+ */
+ @Operation(summary = "淇濆吇璁″垝骞翠唤鍒楄〃")
+ @GetMapping("/getPlanYears")
+ public Result<List<String>> getPlanYears() {
+ return Result.success(deviceMaintenancePlanService.getMaintenancePlanYears());
+ }
+
+ /**
* 璁惧淇濆吇璁″垝璇︽儏鍒楄〃锛堝惈鍒扮偣鏍囩孩锛�
*/
@Operation(summary = "璁惧淇濆吇璁″垝璇︽儏鍒楄〃")
@@ -109,7 +117,7 @@
@Operation(summary = "淇敼璁惧淇濆吇璁″垝璇︽儏")
@PostMapping("/updateMaintenancePlanDetail")
public Result updateMaintenancePlanDetail(@RequestBody DeviceMaintenancePlanDetails deviceMaintenancePlanDetails) {
- return Result.success(deviceMaintenancePlanDetailsService.updateById(deviceMaintenancePlanDetails));
+ return Result.success(deviceMaintenancePlanService.updateMaintenancePlanDetail(deviceMaintenancePlanDetails));
}
/**
@@ -118,7 +126,7 @@
@Operation(summary = "鍒犻櫎璁惧淇濆吇璁″垝璇︽儏")
@DeleteMapping("/delMaintenancePlanDetail")
public Result delMaintenancePlanDetail(Integer maintenancePlanDetailId) {
- return Result.success(deviceMaintenancePlanDetailsService.removeById(maintenancePlanDetailId));
+ return Result.success(deviceMaintenancePlanService.removeMaintenancePlanDetail(maintenancePlanDetailId));
}
/**
@@ -126,7 +134,8 @@
*/
@Operation(summary = "瀵煎嚭璁惧淇濆吇璁″垝")
@GetMapping("/exportDeviceMaintenancePlan")
- public Result exportDeviceMaintenancePlan(@RequestParam("maintenancePlanId") Integer maintenancePlanId, HttpServletResponse response) {
+ public Result exportDeviceMaintenancePlan(@RequestParam("maintenancePlanId") Integer maintenancePlanId,
+ HttpServletResponse response) {
return deviceMaintenancePlanService.exportDeviceMaintenancePlanDto(maintenancePlanId, response);
}
@@ -147,4 +156,32 @@
public Result reviewMaintenancePlanStatus(@RequestBody DeviceMaintenancePlanDto deviceMaintenancePlanDto) {
return deviceMaintenancePlanService.reviewMaintenancePlanStatus(deviceMaintenancePlanDto);
}
+
+ /**
+ * 鏌ヨ淇濆吇璁″垝鏄庣粏闄勪欢
+ */
+ @Operation(summary = "鏌ヨ淇濆吇璁″垝鏄庣粏闄勪欢")
+ @GetMapping("/selectAttachments")
+ public Result<List<DeviceMaintenanceAttachment>> selectAttachments(Integer maintenancePlanDetailId) {
+ return Result.success(deviceMaintenancePlanService.selectAttachments(maintenancePlanDetailId));
+ }
+
+ /**
+ * 涓婁紶淇濆吇璁″垝鏄庣粏闄勪欢
+ */
+ @Operation(summary = "涓婁紶淇濆吇璁″垝鏄庣粏闄勪欢")
+ @PostMapping("/uploadAttachment")
+ public Result uploadAttachment(@RequestParam("maintenancePlanDetailId") Integer maintenancePlanDetailId,
+ @RequestParam("file") MultipartFile file) {
+ return Result.success(deviceMaintenancePlanService.uploadAttachment(maintenancePlanDetailId, file));
+ }
+
+ /**
+ * 鍒犻櫎淇濆吇璁″垝鏄庣粏闄勪欢
+ */
+ @Operation(summary = "鍒犻櫎淇濆吇璁″垝鏄庣粏闄勪欢")
+ @DeleteMapping("/deleteAttachment")
+ public Result deleteAttachment(Long id) {
+ return Result.success(deviceMaintenancePlanService.deleteAttachment(id));
+ }
}
--
Gitblit v1.9.3