Преглед на файлове

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf преди 3 месеца
родител
ревизия
82471b1c3a

+ 27 - 25
OASystem/OASystem.Api/Controllers/MarketCustomerResourcesController.cs

@@ -10,6 +10,7 @@ using System.Collections;
 using System.Data;
 using System.Data;
 using System.Diagnostics;
 using System.Diagnostics;
 using System.Linq;
 using System.Linq;
+using OASystem.Domain.Attributes;
 
 
 namespace OASystem.API.Controllers
 namespace OASystem.API.Controllers
 {
 {
@@ -65,6 +66,7 @@ namespace OASystem.API.Controllers
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
+        [ApiLog("Crm_NewClientData", OperationEnum.List)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QueryNewClientData(NewClientDataQueryDto dto)
         public async Task<IActionResult> QueryNewClientData(NewClientDataQueryDto dto)
         {
         {
@@ -83,7 +85,7 @@ namespace OASystem.API.Controllers
                 if (resultData.Code == 0)
                 if (resultData.Code == 0)
                 {
                 {
                     #region 客户资料表操作记录
                     #region 客户资料表操作记录
-                    await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.NoOperation, dto.OperationUserId, 0, "");
+                    //await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.NoOperation, dto.OperationUserId, 0, "");
                     #endregion
                     #endregion
 
 
                     jw = JsonView(true, resultData.Msg, resultData.Data);
                     jw = JsonView(true, resultData.Msg, resultData.Data);
@@ -107,6 +109,7 @@ namespace OASystem.API.Controllers
         /// </summary>
         /// </summary>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
+        [ApiLog("Crm_NewClientData", OperationEnum.Details)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostNewClientDataDetails(NewClientDataDetailsDto dto)
         public async Task<IActionResult> PostNewClientDataDetails(NewClientDataDetailsDto dto)
         {
         {
@@ -128,7 +131,7 @@ namespace OASystem.API.Controllers
                 if (resultData.Code == 0)
                 if (resultData.Code == 0)
                 {
                 {
                     #region 客户资料表操作记录
                     #region 客户资料表操作记录
-                    await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Details, dto.UserId, dto.Id, "");
+                    //await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Details, dto.UserId, dto.Id, "");
                     #endregion
                     #endregion
                     jw = JsonView(true, "查询成功!", resultData.Data);
                     jw = JsonView(true, "查询成功!", resultData.Data);
                 }
                 }
@@ -151,6 +154,7 @@ namespace OASystem.API.Controllers
         /// <param name="dto"></param>
         /// <param name="dto"></param>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
+        [ApiLog("Crm_NewClientData", OperationEnum.NoOperation)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> NewClientOp(NewClientOpDto dto)
         public async Task<IActionResult> NewClientOp(NewClientOpDto dto)
         {
         {
@@ -175,15 +179,14 @@ namespace OASystem.API.Controllers
                     return Ok(JsonView(false, result.Msg));
                     return Ok(JsonView(false, result.Msg));
                 }
                 }
                 #region 客户资料操作记录
                 #region 客户资料操作记录
-                OperationEnum operationEnum = OperationEnum.NoOperation;
-                if (dto.Status == 1)
-                {
-                    operationEnum = OperationEnum.Add;
-                    dto.Id = Convert.ToInt32(result.Data);
-                }
-                else if (dto.Status == 2) operationEnum = OperationEnum.Edit;
-
-                await GeneralMethod.NewClientOperationRecord(dto.PortType, operationEnum, dto.CreateUserId, dto.Id, "");
+                //OperationEnum operationEnum = OperationEnum.NoOperation;
+                //if (dto.Status == 1)
+                //{
+                //    operationEnum = OperationEnum.Add;
+                //    dto.Id = Convert.ToInt32(result.Data);
+                //}
+                //else if (dto.Status == 2) operationEnum = OperationEnum.Edit;
+                //await GeneralMethod.NewClientOperationRecord(dto.PortType, operationEnum, dto.CreateUserId, dto.Id, "");
                 #endregion
                 #endregion
 
 
                 return Ok(JsonView(true, result.Msg + "Id:" + dto.Id));
                 return Ok(JsonView(true, result.Msg + "Id:" + dto.Id));
@@ -200,6 +203,7 @@ namespace OASystem.API.Controllers
         /// <param name="dto"></param>
         /// <param name="dto"></param>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
+        [ApiLog("Crm_NewClientData", OperationEnum.Del)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> NewClientDel(DelBaseDto dto)
         public async Task<IActionResult> NewClientDel(DelBaseDto dto)
         {
         {
@@ -226,7 +230,7 @@ namespace OASystem.API.Controllers
             }
             }
 
 
             #region 客户资料表操作记录
             #region 客户资料表操作记录
-            await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Del, dto.DeleteUserId, dto.Id, "");
+            //await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Del, dto.DeleteUserId, dto.Id, "");
             #endregion
             #endregion
 
 
             return Ok(JsonView(true, "删除成功!"));
             return Ok(JsonView(true, "删除成功!"));
@@ -238,6 +242,7 @@ namespace OASystem.API.Controllers
         /// <param name="dto"></param>
         /// <param name="dto"></param>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
+        [ApiLog("Crm_NewClientData", OperationEnum.Details)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QuerySelectAndSingleData(QuerySingleDto dto)
         public async Task<IActionResult> QuerySelectAndSingleData(QuerySingleDto dto)
         {
         {
@@ -246,7 +251,7 @@ namespace OASystem.API.Controllers
             if (result.Code == 0)
             if (result.Code == 0)
             {
             {
                 #region 客户资料表操作记录
                 #region 客户资料表操作记录
-                await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Details, dto.UserId, dto.Id, "");
+                //await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Details, dto.UserId, dto.Id, "");
                 #endregion
                 #endregion
 
 
                 jw = JsonView(true, result.Msg, result.Data);
                 jw = JsonView(true, result.Msg, result.Data);
@@ -300,6 +305,7 @@ namespace OASystem.API.Controllers
         /// <param name="dto"></param>
         /// <param name="dto"></param>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
+        [ApiLog("Crm_NewClientData", OperationEnum.BatchAssignment)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostBatchAssignment(BatchAssignmentDto dto)
         public async Task<IActionResult> PostBatchAssignment(BatchAssignmentDto dto)
         {
         {
@@ -569,6 +575,7 @@ namespace OASystem.API.Controllers
         /// <param name="dto"></param>
         /// <param name="dto"></param>
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost]
         [HttpPost]
+        [ApiLog("Crm_NewClientData", OperationEnum.Download)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> NewClientDataExcelDownload(NewClientDataExcelDownloadDto dto)
         public async Task<IActionResult> NewClientDataExcelDownload(NewClientDataExcelDownloadDto dto)
         {
         {
@@ -601,14 +608,13 @@ namespace OASystem.API.Controllers
 
 
                 #region 客户资料表操作记录
                 #region 客户资料表操作记录
                 var respose = JsonView(true, "成功", url);
                 var respose = JsonView(true, "成功", url);
-                var paramData = new
-                {
-                    APIName = @"MarketCustomerResources/NewClientDataExcelDownload",
-                    RequestParam = dto,
-                    ResposeParam = respose
-                };
-
-                await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Download, dto.OperationUserId, 0, JsonConvert.SerializeObject(paramData));
+                //var paramData = new
+                //{
+                //    APIName = @"MarketCustomerResources/NewClientDataExcelDownload",
+                //    RequestParam = dto,
+                //    ResposeParam = respose
+                //};
+                //await GeneralMethod.NewClientOperationRecord(dto.PortType, OperationEnum.Download, dto.OperationUserId, 0, JsonConvert.SerializeObject(paramData));
                 #endregion
                 #endregion
 
 
                 return Ok(respose);
                 return Ok(respose);
@@ -619,8 +625,6 @@ namespace OASystem.API.Controllers
 
 
         }
         }
 
 
-
-
         #region 修改数据
         #region 修改数据
         //[HttpPost]
         //[HttpPost]
         //public IActionResult SynchronizationData()
         //public IActionResult SynchronizationData()
@@ -828,8 +832,6 @@ namespace OASystem.API.Controllers
 
 
         #endregion
         #endregion
 
 
-
-
         /// <summary>
         /// <summary>
         /// 客户资料 操作记录记录查询
         /// 客户资料 操作记录记录查询
         /// </summary>
         /// </summary>

+ 32 - 11
OASystem/OASystem.Api/Middlewares/RecordAPIOperationMiddleware.cs

@@ -13,6 +13,7 @@ using UAParser;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using XAct;
 using XAct;
 using NPOI.SS.Formula.Functions;
 using NPOI.SS.Formula.Functions;
+using QuzrtzJob.Factory;
 
 
 namespace OASystem.API.Middlewares
 namespace OASystem.API.Middlewares
 {
 {
@@ -25,8 +26,9 @@ namespace OASystem.API.Middlewares
         private readonly HttpClient _httpClient;
         private readonly HttpClient _httpClient;
         private readonly IConfiguration _config;
         private readonly IConfiguration _config;
         private readonly SqlSugarClient _sqlSugar;
         private readonly SqlSugarClient _sqlSugar;
+        private readonly ILogger<RecordAPIOperationMiddleware> _logger;
 
 
-        public RecordAPIOperationMiddleware(RequestDelegate next, IConfiguration config, HttpClient httpClient, SqlSugarClient sqlSugar)
+        public RecordAPIOperationMiddleware(RequestDelegate next, IConfiguration config, ILogger<RecordAPIOperationMiddleware> logger, HttpClient httpClient, SqlSugarClient sqlSugar)
         {
         {
             _next = next;
             _next = next;
             _httpClient = httpClient;
             _httpClient = httpClient;
@@ -57,7 +59,8 @@ namespace OASystem.API.Middlewares
 
 
                     if (!string.IsNullOrEmpty(requestBodyText))
                     if (!string.IsNullOrEmpty(requestBodyText))
                     {
                     {
-                        object param1 = string.Empty, param2 = string.Empty, param3 = string.Empty, param4 = string.Empty, param5 = string.Empty, param6 = string.Empty;
+                        object param1 = string.Empty, param2 = string.Empty, param3 = string.Empty, param4 = string.Empty,
+                               param5 = string.Empty, param6 = string.Empty, param7 = string.Empty, param8 = string.Empty;
                         var requestBodyJson = JsonConvert.DeserializeObject<Dictionary<string, object>>(requestBodyText);
                         var requestBodyJson = JsonConvert.DeserializeObject<Dictionary<string, object>>(requestBodyText);
                         bool exists1 = requestBodyJson.TryGetValue("portType", out param1);
                         bool exists1 = requestBodyJson.TryGetValue("portType", out param1);
                         bool exists2 = requestBodyJson.TryGetValue("userId", out param2);
                         bool exists2 = requestBodyJson.TryGetValue("userId", out param2);
@@ -65,6 +68,8 @@ namespace OASystem.API.Middlewares
                         bool exists4 = requestBodyJson.TryGetValue("createUserId", out param4);
                         bool exists4 = requestBodyJson.TryGetValue("createUserId", out param4);
                         bool exists5 = requestBodyJson.TryGetValue("id", out param5);
                         bool exists5 = requestBodyJson.TryGetValue("id", out param5);
                         bool exists6 = requestBodyJson.TryGetValue("status", out param6);
                         bool exists6 = requestBodyJson.TryGetValue("status", out param6);
+                        bool exists7 = requestBodyJson.TryGetValue("operationUserId", out param7);
+                        bool exists8 = requestBodyJson.TryGetValue("deleteUserId", out param8); 
 
 
                         if (exists1) int.TryParse(param1.ToString(), out portType);
                         if (exists1) int.TryParse(param1.ToString(), out portType);
 
 
@@ -73,7 +78,6 @@ namespace OASystem.API.Middlewares
                         //用户Id处理
                         //用户Id处理
                         if (userId < 1)
                         if (userId < 1)
                         {
                         {
-
                             if (apiLogAttribute.OperationEnum == OperationEnum.Login)
                             if (apiLogAttribute.OperationEnum == OperationEnum.Login)
                             {
                             {
                                 var number = requestBodyJson?["number"].ToString();
                                 var number = requestBodyJson?["number"].ToString();
@@ -85,9 +89,11 @@ namespace OASystem.API.Middlewares
                             }
                             }
                             else
                             else
                             {
                             {
-                                if (exists2) if (int.TryParse(param2.ToString(), out userId)) { }
-                                else if (exists3) if (int.TryParse(param3.ToString(), out userId)) { }
-                                else if (exists4) if (int.TryParse(param4.ToString(), out userId)) { }
+                                if (exists2) int.TryParse(param2.ToString(), out userId);
+                                else if (exists3) int.TryParse(param3.ToString(), out userId);
+                                else if (exists4) int.TryParse(param4.ToString(), out userId);
+                                else if (exists7) int.TryParse(param7.ToString(), out userId);
+                                else if (exists8) int.TryParse(param8.ToString(), out userId);
                             }
                             }
                         }
                         }
                         //编辑前数据查询;
                         //编辑前数据查询;
@@ -97,12 +103,22 @@ namespace OASystem.API.Middlewares
                         if (param6Bool)
                         if (param6Bool)
                         {
                         {
                             //  2 修改 
                             //  2 修改 
-                            if (status == 2) updatePreData = await TableInfoToJson(apiLogAttribute.TableName, id);
+                            if (status == 1) apiLogAttribute.OperationEnum = OperationEnum.Add;
+                            else if (status == 2)
+                            {
+                                apiLogAttribute.OperationEnum = OperationEnum.Edit;
+                                updatePreData = await TableInfoToJson(apiLogAttribute.TableName, id);
+                            }
                         }
                         }
                         else if (param5Bool)
                         else if (param5Bool)
                         {
                         {
                             //  id > 0 修改 
                             //  id > 0 修改 
-                            if (id > 0) updatePreData = await TableInfoToJson(apiLogAttribute.TableName, id);
+                            if (id < 1) apiLogAttribute.OperationEnum = OperationEnum.Add;
+                            else if (id > 0)
+                            {
+                                apiLogAttribute.OperationEnum = OperationEnum.Edit;
+                                updatePreData = await TableInfoToJson(apiLogAttribute.TableName, id);
+                            }
                         }
                         }
                     }
                     }
                 }
                 }
@@ -138,16 +154,21 @@ namespace OASystem.API.Middlewares
                     //  id > 0 修改 
                     //  id > 0 修改 
                     if (id > 0) updateBefData = await TableInfoToJson(apiLogAttribute.TableName, id);
                     if (id > 0) updateBefData = await TableInfoToJson(apiLogAttribute.TableName, id);
                 }
                 }
-                string remoteIp = context.Connection.RemoteIpAddress?.ToString(), 
+                string remoteIp = string.Empty, 
                        location = string.Empty;
                        location = string.Empty;
 
 
                 // 检查请求头中的X-Forwarded-For,以获取真实的客户端IP地址
                 // 检查请求头中的X-Forwarded-For,以获取真实的客户端IP地址
                 if (context.Request.Headers.ContainsKey("X-Forwarded-For"))
                 if (context.Request.Headers.ContainsKey("X-Forwarded-For"))
                 {
                 {
                     remoteIp = context.Request.Headers["X-Forwarded-For"].ToString().Split(',', StringSplitOptions.RemoveEmptyEntries)[0];
                     remoteIp = context.Request.Headers["X-Forwarded-For"].ToString().Split(',', StringSplitOptions.RemoveEmptyEntries)[0];
+                    _logger.LogInformation($"IP:{remoteIp}");
+                }
+                else
+                {
+                    remoteIp = context.Connection.RemoteIpAddress?.ToString();
                 }
                 }
 
 
-                (remoteIp, location) = await GetIpInfo();
+                //(remoteIp, location) = await GetIpInfo();
                 //remoteIp = await GetExternalIp();
                 //remoteIp = await GetExternalIp();
                 //location = await GetIpLocation(remoteIp);
                 //location = await GetIpLocation(remoteIp);
 
 
@@ -188,7 +209,7 @@ namespace OASystem.API.Middlewares
                     TableName = apiLogAttribute.TableName,
                     TableName = apiLogAttribute.TableName,
                     PortType = portType,
                     PortType = portType,
                     OperationItem = apiLogAttribute.OperationEnum,
                     OperationItem = apiLogAttribute.OperationEnum,
-                    DataId = apiLogAttribute.DataId,
+                    DataId = id,
                     RequestUrl = context.Request.Path,
                     RequestUrl = context.Request.Path,
                     RemoteIp = remoteIp,
                     RemoteIp = remoteIp,
                     Location = location,
                     Location = location,

+ 0 - 1
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -5135,7 +5135,6 @@ namespace OASystem.API.OAMethodLib
 
 
         #endregion
         #endregion
 
 
-
         #region aspose
         #region aspose
 
 
         /// <summary>
         /// <summary>

+ 1 - 8
OASystem/OASystem.Domain/Attributes/ApiLogAttribute.cs

@@ -23,22 +23,15 @@ namespace OASystem.Domain.Attributes
         /// </summary>
         /// </summary>
         public OperationEnum OperationEnum { get; set; }
         public OperationEnum OperationEnum { get; set; }
 
 
-        /// <summary>
-        /// 操作数据Id
-        /// </summary>
-        public int DataId { get; set; } = 0;
-
         /// <summary>
         /// <summary>
         /// 记录操作日志
         /// 记录操作日志
         /// </summary>
         /// </summary>
         /// <param name="tableName">表名称</param>
         /// <param name="tableName">表名称</param>
         /// <param name="operationEnum">操作类型</param>
         /// <param name="operationEnum">操作类型</param>
-        /// <param name="dataId">DataId Defualt 0</param>
-        public ApiLogAttribute(string tableName, OperationEnum operationEnum, int dataId = 0)
+        public ApiLogAttribute(string tableName, OperationEnum operationEnum)
         {
         {
             TableName = tableName;
             TableName = tableName;
             OperationEnum = operationEnum;
             OperationEnum = operationEnum;
-            DataId = dataId;
         }
         }
     }
     }
 }
 }

+ 1 - 1
OASystem/OASystem.Domain/Dtos/CRM/NewClientDataQueryDto.cs

@@ -119,7 +119,7 @@ namespace OASystem.Domain.Dtos.CRM
         /// <summary>
         /// <summary>
         /// 护照日期
         /// 护照日期
         /// </summary>
         /// </summary>
-        public string PassportDate { get; set; }
+        public DateTime PassportDate { get; set; }
 
 
         /// <summary>
         /// <summary>
         /// 职位
         /// 职位

+ 36 - 35
OASystem/OASystem.Infrastructure/Repositories/CRM/NewClientDataRepository.cs

@@ -1003,14 +1003,16 @@ namespace OASystem.Infrastructure.Repositories.CRM
                 BirthdayStr = isParse ? Birthday.ToString("yyyy-MM-dd") : "";
                 BirthdayStr = isParse ? Birthday.ToString("yyyy-MM-dd") : "";
             }
             }
 
 
-            if (string.IsNullOrWhiteSpace(dto.PassportDate))
-            {
-                dto.PassportDate = string.Empty;
-            }
+            //if (string.IsNullOrWhiteSpace(dto.PassportDate))
+            //{
+            //    dto.PassportDate = string.Empty;
+            //}
 
 
             var newClientDataUnEncrypted = _mapper.Map<Crm_NewClientData>(dto);
             var newClientDataUnEncrypted = _mapper.Map<Crm_NewClientData>(dto);
             newClientDataUnEncrypted.Birthday = BirthdayStr;
             newClientDataUnEncrypted.Birthday = BirthdayStr;
-            
+            if (newClientDataUnEncrypted.PassportDate == DateTime.MinValue) newClientDataUnEncrypted.PassportDate = null;
+
+
             var newClientDataEncrypted = newClientDataUnEncrypted; 
             var newClientDataEncrypted = newClientDataUnEncrypted; 
             EncryptionProcessor.EncryptProperties(newClientDataEncrypted); //加密
             EncryptionProcessor.EncryptProperties(newClientDataEncrypted); //加密
 
 
@@ -1044,15 +1046,15 @@ namespace OASystem.Infrastructure.Repositories.CRM
                 }
                 }
                 else if (dto.Status == 2)//修改
                 else if (dto.Status == 2)//修改
                 {
                 {
-                    DateTime? PassportDate = null;
-                    try
-                    {
-                        PassportDate = DateTime.Parse(dto.PassportDate);
-                    }
-                    catch (Exception)
-                    {
-                        PassportDate = null;
-                    }
+                    //DateTime? PassportDate = null;
+                    //try
+                    //{
+                    //    PassportDate = DateTime.Parse(dto.PassportDate);
+                    //}
+                    //catch (Exception)
+                    //{
+                    //    PassportDate = null;
+                    //}
 
 
                     var res = await _sqlSugar.Updateable(newClientDataEncrypted).IgnoreColumns(x => new { x.DeleteTime, x.DeleteUserId, x.CreateTime, x.CreateUserId }).ExecuteCommandAsync();
                     var res = await _sqlSugar.Updateable(newClientDataEncrypted).IgnoreColumns(x => new { x.DeleteTime, x.DeleteUserId, x.CreateTime, x.CreateUserId }).ExecuteCommandAsync();
 
 
@@ -1345,27 +1347,26 @@ namespace OASystem.Infrastructure.Repositories.CRM
                 {
                 {
                     #region 客户资料表操作记录 批量添加
                     #region 客户资料表操作记录 批量添加
 
 
-                    List<Crm_TableOperationRecord> _TableOperationRecords = new List<Crm_TableOperationRecord>();
-
-                    foreach (var item in _ClientDataAndUsers)
-                    {
-                        _TableOperationRecords.Add(
-                            new Crm_TableOperationRecord() { 
-                                TableName = "Crm_TableOperationRecord",
-                                PortType = dto.PortType,
-                                OperationItem = OperationEnum.BatchAssignment,
-                                DataId = item.NewClientDataId,
-                                CreateUserId = dto.UserId,
-                                CreateTime = DateTime.Now,
-                                Remark = "",
-                                IsDel = 0
-                            });
-                    }
-
-                    if (_TableOperationRecords.Count > 0)
-                    {
-                        await _sqlSugar.Insertable(_TableOperationRecords).ExecuteCommandAsync();
-                    }
+                    //List<Crm_TableOperationRecord> _TableOperationRecords = new List<Crm_TableOperationRecord>();
+
+                    //foreach (var item in _ClientDataAndUsers)
+                    //{
+                    //    _TableOperationRecords.Add(
+                    //        new Crm_TableOperationRecord() { 
+                    //            TableName = "Crm_TableOperationRecord",
+                    //            PortType = dto.PortType,
+                    //            OperationItem = OperationEnum.BatchAssignment,
+                    //            DataId = item.NewClientDataId,
+                    //            CreateUserId = dto.UserId,
+                    //            CreateTime = DateTime.Now,
+                    //            Remark = "",
+                    //            IsDel = 0
+                    //        });
+                    //}
+                    //if (_TableOperationRecords.Count > 0)
+                    //{
+                    //    await _sqlSugar.Insertable(_TableOperationRecords).ExecuteCommandAsync();
+                    //}
 
 
                     #endregion
                     #endregion