From 5c5544a07c683965b86a2bfd4c878503c4c73a48 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 30 三月 2026 18:08:26 +0800
Subject: [PATCH] yys 1.设备备件字段补全

---
 src/main/java/com/ruoyi/device/controller/DeviceMaintenanceController.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ruoyi/device/controller/DeviceMaintenanceController.java b/src/main/java/com/ruoyi/device/controller/DeviceMaintenanceController.java
index 09e7b22..8b41ba0 100644
--- a/src/main/java/com/ruoyi/device/controller/DeviceMaintenanceController.java
+++ b/src/main/java/com/ruoyi/device/controller/DeviceMaintenanceController.java
@@ -3,6 +3,8 @@
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.device.dto.DeviceMaintenanceDto;
+import com.ruoyi.device.dto.DeviceMonthlyRepairTableDTO;
+import com.ruoyi.device.dto.RepairAmountGroupDTO;
 import com.ruoyi.device.pojo.DeviceLedger;
 import com.ruoyi.device.pojo.DeviceMaintenance;
 import com.ruoyi.device.service.IDeviceLedgerService;
@@ -15,6 +17,7 @@
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
+import java.util.List;
 
 @Api(tags = "璁惧淇濆吇")
 @RestController
@@ -61,6 +64,7 @@
     @PostMapping ("maintenance")
     @ApiModelProperty("淇敼璁惧淇濆吇")
     public AjaxResult maintenance(@RequestBody DeviceMaintenance deviceMaintenance) {
+        deviceMaintenance.setStatus(1);
         return deviceMaintenanceService.updateDeviceDeviceMaintenance(deviceMaintenance);
     }
 
@@ -82,4 +86,27 @@
     }
 
 
+    /**
+     * 鎸夊勾浠芥煡璇㈡瘡鏈堟姤淇噾棰濓紙鎸夎澶囧彴璐﹀垎缁勶級
+     * @param year 鍓嶇浼犲叆鐨勫勾浠斤紙濡�2025锛�
+     */
+    @GetMapping("/monthlyAmount")
+    @ApiModelProperty("鎸夊勾浠芥煡璇㈡瘡鏈堟姤淇噾棰濓紙鎸夎澶囧彴璐﹀垎缁勶級")
+    public AjaxResult getMonthlyAmount(@RequestParam(defaultValue = "2025", required = true,name = "year") String year) {
+        List<DeviceMonthlyRepairTableDTO> result = deviceMaintenanceService.getMonthlyRepairAmountByYear(year);
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 鎸夊勾浠芥煡璇㈡姤淇噾棰濓紙鎸夎澶囧彴璐﹀垎缁勶級
+     * @param year 鍓嶇浼犲叆鐨勫勾浠斤紙濡�2025锛�
+     */
+    @GetMapping("/yearlyAmount")
+    @ApiModelProperty("鎸夊勾浠芥煡璇㈡姤淇噾棰濓紙鎸夎澶囧彴璐﹀垎缁勶級")
+    public AjaxResult yearlyAmount(@RequestParam(defaultValue = "2025", required = true,name = "year") String year) {
+        List<RepairAmountGroupDTO> result = deviceMaintenanceService.getRepairAmountByYear(year);
+        return AjaxResult.success(result);
+    }
+
+
 }

--
Gitblit v1.9.3