From 66d041ed14b3ed3ed7183a28a5c588e235fc21d0 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 26 五月 2026 11:14:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro_河南鹤壁' into dev_鹤壁_强信宇_pro

---
 src/main/java/com/ruoyi/device/controller/DeviceLedgerController.java |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/ruoyi/device/controller/DeviceLedgerController.java b/src/main/java/com/ruoyi/device/controller/DeviceLedgerController.java
index f4b807d..824ef6b 100644
--- a/src/main/java/com/ruoyi/device/controller/DeviceLedgerController.java
+++ b/src/main/java/com/ruoyi/device/controller/DeviceLedgerController.java
@@ -12,6 +12,8 @@
 import com.ruoyi.device.pojo.DeviceMaintenance;
 import com.ruoyi.device.service.IDeviceLedgerService;
 import com.ruoyi.framework.aspectj.lang.annotation.Anonymous;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.Operation;
@@ -35,32 +37,34 @@
     private DeviceMaintenanceMapper deviceMaintenanceMapper;
 
 
-
     @Operation(summary = "璁惧鍙拌处鍒楄〃")
     @GetMapping("/page")
-    public AjaxResult page(Page page , DeviceLedgerDto deviceLedger) {
-        return AjaxResult.success(deviceLedgerService.queryPage(page,deviceLedger));
+    public AjaxResult page(Page page, DeviceLedgerDto deviceLedger) {
+        return AjaxResult.success(deviceLedgerService.queryPage(page, deviceLedger));
     }
 
+    @Log(title = "鏂板璁惧鍙拌处", businessType = BusinessType.INSERT)
     @PostMapping()
     @Operation(summary = "娣诲姞璁惧鍙拌处")
-    public AjaxResult add(@RequestBody DeviceLedger deviceLedger) {
-
-        return deviceLedgerService.saveDeviceLedger(deviceLedger);
+    public AjaxResult add(@RequestBody DeviceLedgerDto deviceLedgerDto) {
+        return deviceLedgerService.saveDeviceLedger(deviceLedgerDto);
     }
 
     @Operation(summary = "鏍规嵁id鏌ヨ璁惧鍙拌处")
     @GetMapping("/{id}")
     public AjaxResult detail(@PathVariable Long id) {
-        return AjaxResult.success(deviceLedgerService.getById(id));
+        DeviceLedgerDto deviceLedgerDto = deviceLedgerService.getDeviceLedgerDetail(id);
+        return AjaxResult.success(deviceLedgerDto);
     }
 
-    @PutMapping ()
+    @Log(title = "淇敼璁惧鍙拌处", businessType = BusinessType.UPDATE)
+    @PutMapping()
     @Operation(summary = "淇敼璁惧鍙拌处")
-    public AjaxResult update(@RequestBody DeviceLedger deviceLedger) {
-        return deviceLedgerService.updateDeviceLedger(deviceLedger);
+    public AjaxResult update(@RequestBody DeviceLedgerDto deviceLedgerDto) {
+        return deviceLedgerService.updateDeviceLedger(deviceLedgerDto);
     }
 
+    @Log(title = "鍒犻櫎璁惧鍙拌处", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @Operation(summary = "鍒犻櫎璁惧鍙拌处")
     public AjaxResult delete(@PathVariable("ids") ArrayList<Long> ids) {
@@ -71,12 +75,14 @@
         return AjaxResult.success();
     }
 
+    @Log(title = "瀵煎嚭璁惧鍙拌处", businessType = BusinessType.EXPORT)
     @PostMapping("export")
     @Operation(summary = "瀵煎嚭璁惧鍙拌处")
     public void export(HttpServletResponse response, Long[] ids) {
-         deviceLedgerService.export(response, ids);
+        deviceLedgerService.export(response, ids);
     }
 
+    @Log(title = "涓嬭浇璁惧鍙拌处妯℃澘", businessType = BusinessType.EXPORT)
     @Operation(summary = "涓嬭浇妯℃澘")
     @PostMapping("/downloadTemplate")
     public void downloadTemplate(HttpServletResponse response) {
@@ -84,6 +90,7 @@
         util.importTemplateExcel(response, "璁惧瀵煎叆妯℃澘");
     }
 
+    @Log(title = "瀵煎叆璁惧鍙拌处", businessType = BusinessType.IMPORT)
     @PostMapping("/import")
     @Operation(summary = "瀵煎叆璁惧鍙拌处")
     public AjaxResult importData(MultipartFile file) throws IOException {
@@ -97,9 +104,9 @@
 
     @GetMapping("getDeviceLedger")
     @Operation(summary = "鑾峰彇璁惧鍙拌处")
-    public AjaxResult getDeviceLedger( ) {
+    public AjaxResult getDeviceLedger() {
         return AjaxResult.success(deviceLedgerService.list(new QueryWrapper<DeviceLedger>().lambda()
-                .select(DeviceLedger::getId, DeviceLedger::getDeviceName,DeviceLedger::getDeviceModel)));
+                .select(DeviceLedger::getId, DeviceLedger::getDeviceName, DeviceLedger::getDeviceModel)));
     }
 
     @GetMapping("scanDevice")
@@ -108,8 +115,8 @@
     public AjaxResult scanDevice(Long id) {
         List<DeviceMaintenance> list = deviceMaintenanceMapper.list1(id);
         DeviceLedger deviceLedger = deviceLedgerMapper.selectById1(id);
-        if (list.size()>0){
-            deviceLedger.setUpdateTime(list.get(0).getMaintenanceActuallyTime());//鏈�鍚庣淮鎶ゆ椂闂�
+        if (!list.isEmpty()) {
+            deviceLedger.setUpdateTime(list.getFirst().getMaintenanceActuallyTime());//鏈�鍚庣淮鎶ゆ椂闂�
         }
         deviceLedger.setCreateTime(deviceLedger.getUpdateTime().plusMonths(1));//涓嬫缁存姢鏃堕棿
         return AjaxResult.success(deviceLedger);

--
Gitblit v1.9.3