From a3b1d7bfe497ca5ece2a51eb15a5534a98b33dcb Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 16 六月 2025 17:28:41 +0800
Subject: [PATCH] 1

---
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_RoleService.cs               |   18 ++++++
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs         |   18 +++--
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json                         |    2 
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserFaceService.cs           |    2 
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_RoleService.cs             |    2 
 项目代码/后端/后台管理/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs              |    8 ++
 项目代码/后端/后台管理/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs    |   43 +++++++++++---
 项目代码/后端/后台管理/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_MaintenanceTeam.cs  |   38 +++++++-----
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_RoleController.cs |    8 ++
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs               |   19 +++--
 项目代码/后端/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs     |    2 
 11 files changed, 114 insertions(+), 46 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_RoleService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_RoleService.cs"
index 1a9c6cb..36c7b10 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_RoleService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_RoleService.cs"
@@ -18,6 +18,8 @@
 
         WebResponseContent GetUserTreePermission(int role_Id);
 
+        WebResponseContent GetUserTreeUserRole(string url);
+
         WebResponseContent SavePermission(List<UserPermissionDTO> userPermissions, int roleId);
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_RoleController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_RoleController.cs"
index 711558d..0723645 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_RoleController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_RoleController.cs"
@@ -8,6 +8,7 @@
 using WIDESEAWCS_ISystemServices;
 using WIDESEAWCS_Model.Models;
 using WIDESEAWCS_Model.Models.System;
+using Microsoft.AspNetCore.Authorization;
 
 namespace WIDESEAWCS_WCSServer.Controllers.System
 {
@@ -55,6 +56,13 @@
             return Json(Service.GetUserTreePermission(roleId));
         }
 
+        [HttpPost, Route("GetUserTreeUserRole"), AllowAnonymous]
+        public IActionResult GetUserTreeUserRole(string url)
+        {
+
+            return Json(Service.GetUserTreeUserRole(url));
+        }
+
         [HttpPost, Route("savePermission")]
         public IActionResult SavePermission([FromBody] List<UserPermissionDTO> userPermissions, int roleId)
         {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
index 9b27856..58e50ac 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
@@ -18,6 +18,8 @@
   "DBType": "SqlServer",
   //杩炴帴瀛楃涓�
   "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_MXSSG;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  //"ConnectionString": "Data Source=192.168.1.103;Initial Catalog=WIDESEAWCS_MXSSG;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+
 
 
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_RoleService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_RoleService.cs"
index def2375..35895bc 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_RoleService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_RoleService.cs"
@@ -116,6 +116,24 @@
             return WebResponseContent.Instance.OK(null, data);
         }
 
+
+        /// <summary>
+        /// 鑾峰彇瑙掕壊鏄惁鍙繘鍏ユ搷浣滈〉闈�
+        /// </summary>
+        /// <param name="roleId"></param>
+        /// <returns></returns>
+        public WebResponseContent GetUserTreeUserRole(string url)
+        {
+            List<MenuDTO> menus = _MenuService.GetUserMenuList(App.User.RoleId);
+
+            if (menus.Where(x => x.Url == url).Count() == 0)
+            {
+                return WebResponseContent.Instance.Error("璇ヨ处鍙锋病鏈夎闂綋鍓嶅姛鑳芥潈闄�");
+            }
+            return WebResponseContent.Instance.OK();
+        }
+
+
         /// <summary>
         /// 淇濆瓨瑙掕壊鏉冮檺
         /// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserFaceService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserFaceService.cs"
index 1ebd22b..cd2d9c9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserFaceService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserFaceService.cs"
@@ -211,6 +211,8 @@
                 };
                 base.AddData(userFace);
 
+                
+
                 return WebResponseContent.Instance.OK(data: filePath);
             }
             catch (Exception ex)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
index 15a7b55..dc0cf6f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
@@ -33,8 +33,9 @@
         private readonly IRepository<Dt_Maintenance> _MainServer;
         private readonly IRepository<Sys_Role> _RoleServer;
         private readonly IRepository<Dt_AuthorizationRecord> _AuthorizatRecServer;
+        private readonly IRepository<Sys_UserFace> _userFace;
 
-        public Sys_UserService(IRepository<Dt_AuthorizationRecord> AuthorizatRecServer,IRepository<Sys_Role> RoleServer,IRepository<Dt_Loginhsy> LoginhsyServer,IRepository<Dt_FaceRecognition> faceServer, IRepository<Sys_User> repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService, IRepository<Dt_Maintenance> MainServer) : base(repository)
+        public Sys_UserService(IRepository<Sys_UserFace> _userFace,IRepository<Dt_AuthorizationRecord> AuthorizatRecServer,IRepository<Sys_Role> RoleServer,IRepository<Dt_Loginhsy> LoginhsyServer,IRepository<Dt_FaceRecognition> faceServer, IRepository<Sys_User> repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService, IRepository<Dt_Maintenance> MainServer) : base(repository)
         {
             _faceServer = faceServer;
             _LoginhsyServer = LoginhsyServer;
@@ -695,7 +696,7 @@
                         UserTeam = addUserDTO.userteam,
                         EnableTime = addUserDTO.enable == 1 ? DateTime.Now : (DateTime?)null, //鍚敤
                         DisableTime = addUserDTO.enable == 0 ? DateTime.Now : (DateTime?)null,//涓嶅惎鐢�
-                       
+                      
                     };
 
 
@@ -742,15 +743,17 @@
                 //dynamic resultObj = JsonConvert.DeserializeObject(apiResult);
                 //if (resultObj.error_code == 0)
                 //{
-                    // 鐧惧害鍒犻櫎鎴愬姛鍚庯紝鍒犻櫎鏁版嵁搴撲腑鐨勭敤鎴�
-                  var user = BaseDal.QueryData(x => x.UserName == account).FirstOrDefault();
+                // 鐧惧害鍒犻櫎鎴愬姛鍚庯紝鍒犻櫎鏁版嵁搴撲腑鐨勭敤鎴�
+                var user = BaseDal.QueryData(x => x.UserName == account).FirstOrDefault();
                 var main = _MainServer.QueryData(x => x.UserAccount == account).FirstOrDefault();
-                if (user != null&&main!=null)
-                    {
-                        BaseDal.DeleteData(user);
+                var face = _userFace.QueryData(x => x.UserName == account).FirstOrDefault();
+                if (user != null && main != null && face != null)
+                {
+                    BaseDal.DeleteData(user);
                     _MainServer.DeleteData(main);
+                    _userFace.DeleteData(face);
                 }
-                    return WebResponseContent.Instance.OK("鐢ㄦ埛鍒犻櫎鎴愬姛");
+                return WebResponseContent.Instance.OK("鐢ㄦ埛鍒犻櫎鎴愬姛");
                 //}
                 //else
                 //{
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
index 29f169b..f714a20 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceService.cs"
@@ -235,11 +235,12 @@
             {
                 // 1. 鏌ユ壘鐩爣鐢ㄦ埛锛堣琚己鍒朵笅绾跨殑浜猴級
                 var maint = BaseDal.QueryData().FirstOrDefault(x => x.ID == id);
-                var sysuer = _user.QueryData(x => x.UserName == maint.UserAccount).FirstOrDefault();//user琛�
-                if (maint == null || sysuer==null)
+                if (maint==null)
                 {
                     return new WebResponseContent { Status = false, Message = "娌℃湁鎵惧埌璇ョ敤鎴�" };
                 }
+                var sysuer = _user.QueryData(x => x.UserName == maint.UserAccount).FirstOrDefault();//user琛�
+               
                
 
                 // 2. 鏌ユ壘褰撳墠鐧诲綍鐢ㄦ埛锛堟墽琛屾搷浣滅殑浜猴級
@@ -262,7 +263,7 @@
                 maint.MaintenanceStatus = 0;  // 鏀瑰彉鐘舵�佷负涓嬬嚎
                 BaseDal.UpdateData(maint);
 
-                var ip = LocalIP.Replace("::ffff:", "");
+                var ip = LocalIP?.Replace("::ffff:", "") ?? ""; // 濡傛灉 LocalIP 鏄� null锛宨p 浼氭槸 ""
 
                 // 5. 璁板綍鎿嶄綔鏃ュ織
                 var recording = new Dt_MaintenanceTeam
@@ -539,7 +540,8 @@
                     }
 
                 }
-                var ip = LocalIP.Replace("::ffff:", "");
+               
+                var ip = LocalIP?.Replace("::ffff:", "") ?? ""; // 濡傛灉 LocalIP 鏄� null锛宨p 浼氭槸 ""
                 //濡傛灉婊¤冻涓嬮潰鐨勬潯浠跺氨寮�濮�
                 maint.MaintenancStartTime = DateTime.Now;//璁板綍寮�濮嬫椂闂�
                 maint.MaintenanceStatus = 1;//鏇存敼鐘舵��
@@ -561,7 +563,7 @@
                     Account = account,
                     MaintenanceStatus=1,
                     OperatorName = sysuer.UserTrueName,
-                    TeamName = sysuer.RoleName,
+                    TeamName = sysuer.Userteam,
                     DistributionTime = DateTime.Now,
                     IPAddress = addressIp,
                 };
@@ -619,7 +621,7 @@
                             return new WebResponseContent
                             {
                                 Status = false,
-                                Message = "鎮ㄦ槸鏈�鍚庝竴涓湪鍦虹殑缁勯暱锛岃绛夊緟鎵�鏈夌粍鍛樺畬鎴愭淇悗鍐嶇粨鏉�"
+                                Message = "鎮ㄦ槸鏈�鍚庝竴涓湪鍦虹殑涓�绾т汉鍛橈紝璇风瓑寰呮墍鏈変簩绾т汉鍛樺畬鎴愭淇悗鍐嶇粨鏉�"
                             };
                         }
                     }
@@ -629,7 +631,7 @@
                 //    return new WebResponseContent { Status = false, Message = "鎿嶄綔璁惧涓嶅悓锛岃鍥炲埌鍘熸湰璁惧鍐嶇偣鍑荤粨鏉熸淇�" };
                 //}
                 var address = _ipaddress.QueryData(x => x.IPaddress == LocalIP).FirstOrDefault();
-                var ip = LocalIP.Replace("::ffff:", "");
+                var ip = LocalIP?.Replace("::ffff:", "") ?? ""; // 濡傛灉 LocalIP 鏄� null锛宨p 浼氭槸 ""
                 var addressIp = "";
                 if (address != null) //鎵惧埌浜�
                 {
@@ -651,7 +653,7 @@
                     Account = account,
                     MaintenanceStatus = 0,
                     OperatorName = sysuer.UserTrueName,
-                    TeamName = sysuer.RoleName,
+                    TeamName = sysuer.Userteam,
                     IPAddress = addressIp,
                     EndTime = DateTime.Now,
                 };
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
index 494b910..04f4732 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
@@ -114,7 +114,7 @@
                     a.RoleName,//瑙掕壊鍚嶇О
                     a.Unit,//鍗曚綅
                     b.IPAddress,//鐢佃剳ip鍦板潃
-                    b.OperatorName,
+                    b.OperatorName,//濮撳悕
                     b.TeamName,//鐝粍
                     b.MaintenanceStatus,//妫�淇姸鎬�
                     b.Creater,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_MaintenanceTeam.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_MaintenanceTeam.cs"
index f88ca30..ac19800 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_MaintenanceTeam.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/Telescopic/Dt_MaintenanceTeam.cs"
@@ -8,7 +8,7 @@
 
 namespace WIDESEAWCS_Model.Models
 {
-    [SugarTable("Dt_MaintenanceTeam", "妫�淇彮缁勮〃")] //('鏁版嵁搴撹〃鍚�'锛�'鏁版嵁搴撹〃澶囨敞')
+    [SugarTable("Dt_MaintenanceTeam", "妫�淇彮缁勮褰曡〃")] //('鏁版嵁搴撹〃鍚�'锛�'鏁版嵁搴撹〃澶囨敞')
     public class Dt_MaintenanceTeam : BaseEntity
     {
         /// <summary>
@@ -16,8 +16,6 @@
         /// </summary>
         [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
         public int ID { get; set; }
-
-
 
         /// <summary>
         /// 璐﹀彿
@@ -33,6 +31,17 @@
 
 
 
+        /// <summary>
+        /// 鐝粍鍚�
+        /// </summary>
+        [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "鐝粍鍚�")]
+        public string TeamName { get; set; }
+
+        /// <summary>
+        /// ip鍦板潃
+        /// </summary>
+        [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "ip鍦板潃")]
+        public string IPAddress { get; set; }
 
 
         /// <summary>
@@ -41,26 +50,21 @@
         [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "妫�淇姸鎬�")]
         public int MaintenanceStatus { get; set; }
 
-        /// <summary>
-        /// 鐝粍鍚�
-        /// </summary>
-        [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "鐝粍鍚�")]
-        public string TeamName { get; set; }
-
-
-        /// <summary>
-        /// ip鍦板潃
-        /// </summary>
-        [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "ip鍦板潃")]
-        public string IPAddress { get; set; }
 
         /// <summary>
         /// 鍒嗛厤鏃堕棿
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "鍒嗛厤鏃堕棿")]
-        public DateTime DistributionTime { get; set; }
+        public DateTime? DistributionTime { get; set; }
 
-       
+
+        /// <summary>
+        /// 瀹屾垚妫�淇椂闂�
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "瀹屾垚妫�淇椂闂�")]
+        public DateTime? EndTime { get; set; }
+
+
 
 
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
index 4de239f..1883e4a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs"
@@ -29,7 +29,9 @@
         private readonly IRepository<Dt_Maintenance> _MainServer;
         private readonly IRepository<Sys_Role> _RoleServer;
         private readonly IRepository<Dt_AuthorizationRecord> _AuthorizatRecServer;
-        public Sys_UserService(IRepository<Dt_AuthorizationRecord> AuthorizatRecServer ,IRepository<Sys_Role> RoleServer,IRepository<Dt_Loginhsy> LoginhsyServer,IRepository<Dt_FaceRecognition> faceServer, IRepository<Sys_User> repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService, IRepository<Dt_Maintenance> MainServer) : base(repository)
+        private readonly IRepository<Sys_UserFace> _userFace;
+        
+        public Sys_UserService(IRepository<Sys_UserFace> _userFace,IRepository<Dt_AuthorizationRecord> AuthorizatRecServer ,IRepository<Sys_Role> RoleServer,IRepository<Dt_Loginhsy> LoginhsyServer,IRepository<Dt_FaceRecognition> faceServer, IRepository<Sys_User> repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService, IRepository<Dt_Maintenance> MainServer) : base(repository)
         {
             _faceServer = faceServer;
             _LoginhsyServer = LoginhsyServer;
@@ -731,10 +733,12 @@
                 // 鐧惧害鍒犻櫎鎴愬姛鍚庯紝鍒犻櫎鏁版嵁搴撲腑鐨勭敤鎴�
                 var user = BaseDal.QueryData(x => x.UserName == account).FirstOrDefault();
                 var main = _MainServer.QueryData(x => x.UserAccount == account).FirstOrDefault();
-                if (user != null && main != null)
+                var face= _userFace.QueryData(x=>x.UserName== account).FirstOrDefault();
+                if (user != null && main != null&&face!=null)
                 {
                     BaseDal.DeleteData(user);
                     _MainServer.DeleteData(main);
+                    _userFace.DeleteData(face);
                 }
                 return WebResponseContent.Instance.OK("鐢ㄦ埛鍒犻櫎鎴愬姛");
                 //}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
index 291c7d3..2a6fd12 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\345\220\216\347\253\257/\345\220\216\345\217\260\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
@@ -38,11 +38,15 @@
                 var main = Db.Queryable<Dt_MaintenanceTeam>();
 
 
+
+                var query = sys.InnerJoin<Dt_MaintenanceTeam>((a, b) => a.UserTrueName == b.OperatorName)
+                               ;
+
+
                 //妯$硦鏌ヨ
-                var query = sys.InnerJoin<Dt_MaintenanceTeam>((a, b) => a.UserTrueName == b.OperatorName);
-                if (!string .IsNullOrEmpty(pagination.searchKeyword))
+                if (!string.IsNullOrEmpty(pagination.searchKeyword))
                 {
-                   
+
                     query = query.Where((a, b) =>
                        b.OperatorName.Contains(pagination.searchKeyword) ||
                        b.TeamName.Contains(pagination.searchKeyword) ||
@@ -50,7 +54,7 @@
                    );
                 }
                 //鏃堕棿鏌ヨ
-                if (pagination.startDate.HasValue&&pagination.endDate.HasValue)
+                if (pagination.startDate.HasValue && pagination.endDate.HasValue)
                 {
                     query = query.Where((a, b) => b.DistributionTime >= pagination.startDate && b.DistributionTime <= pagination.endDate);
                 }
@@ -78,24 +82,43 @@
                     query = query.OrderByDescending((a, b) => b.Creater);
                 }
 
+                //// 濡傛灉涓嶆槸绠$悊鍛橈紝鏍规嵁閮ㄩ棬杩囨护
+                //if (pagination.account != "admin")
+                //{
+                //    var currentUser = _user.Db.Queryable<Sys_User>()
+                //        .Where(u => u.UserName == pagination.account)
+                //        .First();
+
+                //    if (currentUser == null)
+                //    {
+                //        return new WebResponseContent { Status = false, Data = "鏈幏鍙栧埌鐢ㄦ埛淇℃伅" };
+                //    }
+
+                //    int? deptId = currentUser.Dept_Id;
+
+                //    query = query.Where((a, b) => a.Dept_Id == deptId);
+                //}
+
+
                 //杩斿洖缁撴灉
-                var result=query
+                var result = query
                 .Select((a, b) => new
                 {
-
                     a.User_Id,
                     a.Dept_Id,//杞ㄩ亾绔�
                     a.IsLeader,//鏄惁鏄彮闀�
-                    a.RoleName,
                     a.Role_Id,
+                    a.RoleName,//瑙掕壊鍚嶇О
+                    a.Unit,//鍗曚綅
                     b.IPAddress,//鐢佃剳ip鍦板潃
                     b.OperatorName,
-                    b.TeamName,
+                    b.TeamName,//鐝粍
+                    b.MaintenanceStatus,//妫�淇姸鎬�
                     b.Creater,
                     a.HeadImageUrl,
                     b.DistributionTime,
+                    b.EndTime,
                     b.Modifier,
-
                 }).ToPageList(pagination.pageIndex, pagination.pageSize, ref totalCount);
                 return new WebResponseContent
                 {
@@ -113,7 +136,7 @@
             catch (Exception ex)
             {
 
-                return new WebResponseContent { Status = false,Message="閿欒淇℃伅锛�"+ex.Message };
+                return new WebResponseContent { Status = false, Message = "閿欒淇℃伅锛�" + ex.Message };
             }
 
         }

--
Gitblit v1.9.3