From 375ace27ad6afbc3c83d92add0fb5a0347a6edbf Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期一, 08 十二月 2025 21:24:24 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs"
index fb668b1..8762d58 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_RoleService.cs"
@@ -187,12 +187,11 @@
//褰撳墠鐢ㄦ埛鐨勬潈闄�
List<Permissions> permissions = _MenuService.GetPermissions(App.User.RoleId);
- List<int> menuIds = _MenuService.Repository.QueryData(x => x.MenuId, x => x.MenuType == 1);
-
List<int> originalMeunIds = new List<int>();
//琚垎閰嶈鑹茬殑鏉冮檺
- List<Sys_RoleAuth> roleAuths = _RoleAuthService.Repository.QueryData(x => x.RoleId == roleId && menuIds.Contains(x.MenuId));
+ List<Sys_RoleAuth> roleAuths = _RoleAuthService.Repository.QueryData(x => x.RoleId == roleId);
List<Sys_RoleAuth> updateAuths = new List<Sys_RoleAuth>();
+ List<Sys_RoleAuth> addAuths = new List<Sys_RoleAuth>();
foreach (UserPermissionDTO x in userPermissions)
{
Permissions per = permissions.FirstOrDefault(p => p.MenuId == x.Id);
@@ -208,7 +207,21 @@
var auth = roleAuths.Where(r => r.MenuId == x.Id).Select(s => new { s.AuthId, s.AuthValue, s.MenuId }).FirstOrDefault();
string newAuthValue = string.Join(",", arr);
//鏉冮檺娌℃湁鍙戠敓鍙樺寲鍒欎笉澶勭悊
- if (auth == null || auth.AuthValue != newAuthValue)
+ if (auth == null)
+ {
+ addAuths.Add(new Sys_RoleAuth()
+ {
+ RoleId = roleId,
+ MenuId = x.Id,
+ AuthValue = string.Join(",", arr),
+ AuthId = auth == null ? 0 : auth.AuthId,
+ ModifyDate = DateTime.Now,
+ Modifier = App.User.UserName,
+ CreateDate = DateTime.Now,
+ Creater = App.User.UserName
+ });
+ }
+ else if (auth.AuthValue != newAuthValue)
{
updateAuths.Add(new Sys_RoleAuth()
{
@@ -231,7 +244,7 @@
//鏇存柊鏉冮檺
_RoleAuthService.Repository.UpdateData(updateAuths);
//鏂板鐨勬潈闄�
- _RoleAuthService.Repository.AddData(updateAuths);
+ _RoleAuthService.Repository.AddData(addAuths);
//鑾峰彇鏉冮檺鍙栨秷鐨勬潈闄�
int[] authIds = roleAuths.Where(x => userPermissions.Select(u => u.Id)
--
Gitblit v1.9.3