From 7dad20e6a1a0bd073fa9467e8bd4878acc2dbc65 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Sat, 2 Apr 2022 10:33:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/FrontAuditConfigService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs index d641ee572..b7d9402e5 100644 --- a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs @@ -34,7 +34,9 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task CopyOtherToThisItem(CopyOtherToThisItem item) { - + + var names = _frontAuditConfigRepository.Where(x => x.ParentId == item.AddItem).Select(x => x.ValueCN).ToList(); + 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(), @@ -59,7 +61,7 @@ namespace IRaCIS.Core.Application.Service Id=Guid.NewGuid(), }).ToList(); - + list = list.Where(x => !names.Contains(x.ValueCN)).ToList(); await _repository.AddRangeAsync(list); await _repository.SaveChangesAsync();