From b29a49a5ef467ff5c96b5590d76018721bdf8e98 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期五, 21 十一月 2025 13:27:09 +0800
Subject: [PATCH] yys 1.设备去掉名称唯一性验证

---
 src/main/java/com/ruoyi/device/controller/DeviceRepairController.java |   41 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/ruoyi/device/controller/DeviceRepairController.java b/src/main/java/com/ruoyi/device/controller/DeviceRepairController.java
index 44021a9..7b386bd 100644
--- a/src/main/java/com/ruoyi/device/controller/DeviceRepairController.java
+++ b/src/main/java/com/ruoyi/device/controller/DeviceRepairController.java
@@ -2,7 +2,9 @@
 
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.device.dto.DeviceMonthlyRepairTableDTO;
 import com.ruoyi.device.dto.DeviceRepairDto;
+import com.ruoyi.device.dto.RepairAmountGroupDTO;
 import com.ruoyi.device.pojo.DeviceLedger;
 import com.ruoyi.device.pojo.DeviceRepair;
 import com.ruoyi.device.service.IDeviceLedgerService;
@@ -16,14 +18,18 @@
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
 @Api(tags = "璁惧鎶ヤ慨绠$悊")
-@RequestMapping("/device/reppair")
+@RequestMapping("/device/repair")
 @RestController
 public class DeviceRepairController {
 
     @Autowired
     private IDeviceRepairService deviceRepairService;
+
+    @Autowired
+    private IDeviceLedgerService deviceLedgerService;
 
     @ApiModelProperty("璁惧鎶ヤ慨鍒楄〃")
     @GetMapping("/page")
@@ -40,12 +46,20 @@
     @ApiModelProperty("鏍规嵁id鏌ヨ璁惧鎶ヤ慨")
     @GetMapping("/{id}")
     public AjaxResult detail(@PathVariable Long id) {
-        return AjaxResult.success(deviceRepairService.getById(id));
+        DeviceRepairDto byId = deviceRepairService.detailById(id);
+        return AjaxResult.success(byId);
     }
 
     @PutMapping ()
     @ApiModelProperty("淇敼璁惧鎶ヤ慨")
     public AjaxResult update( @RequestBody DeviceRepair deviceRepair) {
+        return deviceRepairService.updateDeviceRepair(deviceRepair);
+    }
+
+    @PostMapping ("repair")
+    @ApiModelProperty("璁惧缁翠慨")
+    public AjaxResult repair( @RequestBody DeviceRepair deviceRepair) {
+        deviceRepair.setStatus(1);
         return deviceRepairService.updateDeviceRepair(deviceRepair);
     }
 
@@ -64,4 +78,27 @@
     public void export(HttpServletResponse response, Long[] ids) {
         deviceRepairService.export(response, ids);
     }
+
+    /**
+     * 鎸夊勾浠芥煡璇㈡瘡鏈堟姤淇噾棰濓紙鎸夎澶囧彴璐﹀垎缁勶級
+     * @param year 鍓嶇浼犲叆鐨勫勾浠斤紙濡�2025锛�
+     */
+    @GetMapping("/monthlyAmount")
+    @ApiModelProperty("鎸夊勾浠芥煡璇㈡瘡鏈堟姤淇噾棰濓紙鎸夎澶囧彴璐﹀垎缁勶級")
+    public AjaxResult getMonthlyAmount(@RequestParam(defaultValue = "2025", required = true,name = "year") String year) {
+        List<DeviceMonthlyRepairTableDTO> result = deviceRepairService.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 = deviceRepairService.getRepairAmountByYear(year);
+        return AjaxResult.success(result);
+    }
+
 }

--
Gitblit v1.9.3