From 45b02c3528ac137aed0cb373133efb2bf3537a5a Mon Sep 17 00:00:00 2001 From: Claude Lee Date: Thu, 26 Sep 2024 13:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/system/DhcDataAuthController.java | 8 ++++++++ .../com/ruoyi/dhc/service/IDhcDataAuthService.java | 2 ++ .../ruoyi/dhc/service/impl/DhcDataAuthServiceImpl.java | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DhcDataAuthController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DhcDataAuthController.java index aa852f9..6f59723 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DhcDataAuthController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DhcDataAuthController.java @@ -96,6 +96,14 @@ public class DhcDataAuthController extends BaseController return toAjax(dhcDataAuthService.updateDhcDataAuth(dhcDataAuth)); } + @PreAuthorize("@ss.hasPermi('dhc:authData:add')") + @Log(title = "数据权限", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult batchAdd(@RequestBody List dhcDataAuth) + { + return toAjax(dhcDataAuthService.insertDhcDataAuthBatch(dhcDataAuth)); + } + /** * 删除数据权限 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/dhc/service/IDhcDataAuthService.java b/ruoyi-system/src/main/java/com/ruoyi/dhc/service/IDhcDataAuthService.java index 41b7714..92bfc4c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/dhc/service/IDhcDataAuthService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/dhc/service/IDhcDataAuthService.java @@ -67,4 +67,6 @@ public interface IDhcDataAuthService * @return 数据权限集合 */ public List selectDhcDataAuthByPage(DhcDataAuth dhcDataAuth); + + int insertDhcDataAuthBatch(List dhcDataAuth); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/dhc/service/impl/DhcDataAuthServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/dhc/service/impl/DhcDataAuthServiceImpl.java index bcc37a8..496358a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/dhc/service/impl/DhcDataAuthServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/dhc/service/impl/DhcDataAuthServiceImpl.java @@ -151,4 +151,14 @@ public class DhcDataAuthServiceImpl implements IDhcDataAuthService }); return list; } + + @Override + public int insertDhcDataAuthBatch(List dhcDataAuthList) + { + int count = 0; + for (DhcDataAuth dhcDataAuth : dhcDataAuthList) { + count += insertDhcDataAuth(dhcDataAuth); + } + return count; + } }