From e413959eae979e1c3418c2f3e95cea2dfa81501e Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Mon, 8 May 2023 15:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=80=BC=E4=B8=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Dict/SysDictDataService.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Myshipping.Core/Service/Dict/SysDictDataService.cs b/Myshipping.Core/Service/Dict/SysDictDataService.cs index 36902da4..108a652e 100644 --- a/Myshipping.Core/Service/Dict/SysDictDataService.cs +++ b/Myshipping.Core/Service/Dict/SysDictDataService.cs @@ -72,7 +72,7 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT [HttpPost("/sysDictData/add")] public async Task AddDictData(AddDictDataInput input) { - var isExist = await _sysDictDataRep.AnyAsync(u => (u.Code == input.Code || u.Value == input.Value) && u.TypeId == input.TypeId); + var isExist = await _sysDictDataRep.AnyAsync(u => u.Code == input.Code && u.TypeId == input.TypeId); if (isExist) throw Oops.Oh(ErrorCode.D3003); var dictData = input.Adapt(); @@ -199,7 +199,7 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT /// /// [NonAction] - public async Task CacheData(bool falg=false) + public async Task CacheData(bool falg = false) { if (falg) { @@ -218,7 +218,9 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT }).ToListAsync(); await _cache.SetAllDictData(list); } - } else { + } + else + { var list = await _sysDictDataRep.AsQueryable().InnerJoin((d, t) => d.TypeId == t.Id).Filter(null, true).Where((d, t) => t.Status == CommonStatus.ENABLE && d.Status == CommonStatus.ENABLE).Select((d, t) => new DictDataDto { Id = d.Id, @@ -232,10 +234,10 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT }).ToListAsync(); await _cache.SetAllDictData(list); } - - - + + + } - + }