允许映射有重复的配置项,只是提示一下

optimize
wanghaomei 1 year ago
parent 757ec793b8
commit a112241dc7

@ -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<MappingCarrier>();
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("操作成功,但需注意存在多个相同模块和船司代码的映射配置");
}
}

Loading…
Cancel
Save