diff --git a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs index b7d9402e5..6e79e44f9 100644 --- a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs @@ -37,6 +37,8 @@ namespace IRaCIS.Core.Application.Service var names = _frontAuditConfigRepository.Where(x => x.ParentId == item.AddItem).Select(x => x.ValueCN).ToList(); + var additem = await _frontAuditConfigRepository.FirstOrDefaultAsync(x => x.Id == item.AddItem); + var list = _frontAuditConfigRepository.Where(x => item.DataSource.Contains(x.ParentId)).ToList().GroupBy(x => new { x.ValueCN }, (key, lst) => new FrontAuditConfig { Sort = lst.Select(x => x.Sort).FirstOrDefault(), @@ -58,7 +60,11 @@ namespace IRaCIS.Core.Application.Service ValueCN = lst.Select(x => x.ValueCN).FirstOrDefault(), Value = lst.Select(x => x.Value).FirstOrDefault(), UpdateUserId = _userInfo.Id, - Id=Guid.NewGuid(), + ChildrenTypeId= additem?.ChildrenTypeId, + ModuleTypeId = additem?.ModuleTypeId, + ObjectTypeId = additem?.ObjectTypeId, + OptTypeId = additem?.OptTypeId, + Id =Guid.NewGuid(), }).ToList(); list = list.Where(x => !names.Contains(x.ValueCN)).ToList();