From a112241dc75725e6525d5faa305e4f1f8f2adeb6 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Mon, 27 Nov 2023 09:26:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=98=A0=E5=B0=84=E6=9C=89?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=9A=84=E9=85=8D=E7=BD=AE=E9=A1=B9=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E6=98=AF=E6=8F=90=E7=A4=BA=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Core/Service/CommonDB/CommonDBService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs index f726be8f..7d19fc74 100644 --- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs +++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs @@ -194,10 +194,6 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie { var list = await _sysCacheService.GetAllMappingCarrier(); var count = list.Where(x => x.Module == dto.Module && x.Code == dto.Code && x.GID != dto.GID).Count(); - if (count > 0) - { - throw Oops.Bah(ErrorCode.D1006); - } var entity = dto.Adapt(); if (string.IsNullOrWhiteSpace(dto.GID)) { @@ -213,9 +209,13 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie entity.ModifyTime = DateTime.Now; entity.ModifyUser = UserManager.DjyUserId; await _mappingCarrierRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); - } await GetAllMappingCarrier(); + + if (count > 0) //提醒有相同配置项 + { + throw Oops.Bah("操作成功,但需注意存在多个相同模块和船司代码的映射配置"); + } }