Browse Source

添加数据权限批量插入方法

master
Claude Lee 2 months ago
parent
commit
45b02c3528
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DhcDataAuthController.java
  2. 2
      ruoyi-system/src/main/java/com/ruoyi/dhc/service/IDhcDataAuthService.java
  3. 10
      ruoyi-system/src/main/java/com/ruoyi/dhc/service/impl/DhcDataAuthServiceImpl.java

8
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)); return toAjax(dhcDataAuthService.updateDhcDataAuth(dhcDataAuth));
} }
@PreAuthorize("@ss.hasPermi('dhc:authData:add')")
@Log(title = "数据权限", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult batchAdd(@RequestBody List<DhcDataAuth> dhcDataAuth)
{
return toAjax(dhcDataAuthService.insertDhcDataAuthBatch(dhcDataAuth));
}
/** /**
* 删除数据权限 * 删除数据权限
*/ */

2
ruoyi-system/src/main/java/com/ruoyi/dhc/service/IDhcDataAuthService.java

@ -67,4 +67,6 @@ public interface IDhcDataAuthService
* @return 数据权限集合 * @return 数据权限集合
*/ */
public List<DhcDataAuth> selectDhcDataAuthByPage(DhcDataAuth dhcDataAuth); public List<DhcDataAuth> selectDhcDataAuthByPage(DhcDataAuth dhcDataAuth);
int insertDhcDataAuthBatch(List<DhcDataAuth> dhcDataAuth);
} }

10
ruoyi-system/src/main/java/com/ruoyi/dhc/service/impl/DhcDataAuthServiceImpl.java

@ -151,4 +151,14 @@ public class DhcDataAuthServiceImpl implements IDhcDataAuthService
}); });
return list; return list;
} }
@Override
public int insertDhcDataAuthBatch(List<DhcDataAuth> dhcDataAuthList)
{
int count = 0;
for (DhcDataAuth dhcDataAuth : dhcDataAuthList) {
count += insertDhcDataAuth(dhcDataAuth);
}
return count;
}
} }

Loading…
Cancel
Save