From bc427c64d8c9066eda7a817c7c7926954e39abb0 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期一, 26 一月 2026 14:55:26 +0800
Subject: [PATCH] 删除操作添加日志记录,系统添加定时删除操作日志

---
 fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIotPR.java |  125 +++++++++++++++++++++--------------------
 1 files changed, 65 insertions(+), 60 deletions(-)

diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIotPR.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIotPR.java
index 7ec57a9..634a9ae 100644
--- a/fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIotPR.java
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIotPR.java
@@ -6,12 +6,16 @@
 import com.bstek.dorado.data.entity.EntityState;
 import com.bstek.dorado.data.entity.EntityUtils;
 import com.bstek.dorado.data.provider.Page;
+import com.fzzy.common.constant.BizTypeEnum;
 import com.fzzy.igds.data.DeviceIotParam;
 import com.fzzy.igds.domain.DeviceIot;
 import com.fzzy.igds.service.DeviceIotService;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.enums.BusinessType;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
+
 import javax.annotation.Resource;
 import java.util.List;
 
@@ -23,68 +27,69 @@
 @Component
 public class DeviceIotPR {
 
-	@Resource
-	private DeviceIotService deviceIotService;
+    @Resource
+    private DeviceIotService deviceIotService;
 
-	/**
-	 * 鏌ヨ璁惧,灏嗘搷浣滀俊鎭皟鏁翠负绌�
-	 * 
-	 * deviceIotPR#loadDeviceIotPage
-	 *
-	 * @param page
-	 * @param param
-	 * @return
-	 */
-	@DataProvider
-	public void loadDeviceIotPage(Page<DeviceIot> page, DeviceIotParam param) {
-		com.baomidou.mybatisplus.extension.plugins.pagination.Page<DeviceIot> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page.getPageNo(), page.getPageSize());
+    /**
+     * 鏌ヨ璁惧,灏嗘搷浣滀俊鎭皟鏁翠负绌�
+     * <p>
+     * deviceIotPR#loadDeviceIotPage
+     *
+     * @param page
+     * @param param
+     * @return
+     */
+    @DataProvider
+    public void loadDeviceIotPage(Page<DeviceIot> page, DeviceIotParam param) {
+        com.baomidou.mybatisplus.extension.plugins.pagination.Page<DeviceIot> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(page.getPageNo(), page.getPageSize());
 
-		if(null == param) {
-			param = new DeviceIotParam();
-		}
-		deviceIotService.listPageData(corePage, param);
+        if (null == param) {
+            param = new DeviceIotParam();
+        }
+        deviceIotService.listPageData(corePage, param);
 
-		// 閲嶆柊灏佽
-		page.setEntities(corePage.getRecords());
-		page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal())));
-	}
+        // 閲嶆柊灏佽
+        page.setEntities(corePage.getRecords());
+        page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal())));
+    }
 
-	/**
-	 * 淇濆瓨 devicePR#saveAll
-	 * 
-	 * @param depotDeviceIots
-	 * @return
-	 */
-	@DataResolver
-	@Transactional
-	public String saveAll(List<DeviceIot> depotDeviceIots) {
-		String msg = "";
-		DeviceIot deviceIot;
-		for (DeviceIot depotDeviceIot : depotDeviceIots) {
-			EntityState state = EntityUtils.getState(depotDeviceIot);
-			deviceIot = new DeviceIot();
-			BeanUtils.copyProperties(depotDeviceIot, deviceIot);
-			if (state == EntityState.NEW) {
-				deviceIotService.updateDeviceIot(deviceIot);
-				msg = "娣诲姞鎴愬姛!";
-			}
-			if (state == EntityState.DELETED) {
-				deviceIotService.delDepotDeviceIot(deviceIot);
-				msg = "鍒犻櫎鎴愬姛!";
-			}
-			if (state == EntityState.MODIFIED) {
-				deviceIotService.updateDeviceIot(deviceIot);
-				msg = "淇敼鎴愬姛!";
-			}
-		}
-		return msg;
-	}
-	
-	/**
-	 * devicePR#refreshCache
-	 */
-	@Expose
-	public void refreshCache(){
-		deviceIotService.refreshCache(null);
-	}
+    /**
+     * 淇濆瓨 devicePR#saveAll
+     *
+     * @param depotDeviceIots
+     * @return
+     */
+    @DataResolver
+    @Transactional
+    @Log(title = "Iot璁惧閰嶇疆", businessType = BusinessType.OTHER, bizType = BizTypeEnum.SYS)
+    public String saveAll(List<DeviceIot> depotDeviceIots) {
+        String msg = "";
+        DeviceIot deviceIot;
+        for (DeviceIot depotDeviceIot : depotDeviceIots) {
+            EntityState state = EntityUtils.getState(depotDeviceIot);
+            deviceIot = new DeviceIot();
+            BeanUtils.copyProperties(depotDeviceIot, deviceIot);
+            if (state == EntityState.NEW) {
+                deviceIotService.updateDeviceIot(deviceIot);
+                msg = "娣诲姞鎴愬姛!";
+            }
+            if (state == EntityState.DELETED) {
+                deviceIotService.delDepotDeviceIot(deviceIot);
+                msg = "鍒犻櫎鎴愬姛!";
+            }
+            if (state == EntityState.MODIFIED) {
+                deviceIotService.updateDeviceIot(deviceIot);
+                msg = "淇敼鎴愬姛!";
+            }
+        }
+        return msg;
+    }
+
+    /**
+     * devicePR#refreshCache
+     */
+    @Expose
+    public void refreshCache() {
+        deviceIotService.refreshCache(null);
+    }
 }

--
Gitblit v1.9.3