diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index 5ea307176..b8080284a 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -152,7 +152,7 @@ namespace IRaCIS.Application.Services //var test = _trialRepository.Where(t => t.CreateTime.Year == DateTime.Now.Year + 1).Select(t => t.Code).DefaultIfEmpty(1).ToList(); var trial = _mapper.Map(trialAddModel); - //trial.Id = NewId.NextGuid(); + trial.Id = NewId.NextGuid(); var yearStr = DateTime.Now.Year.ToString(); trial.Code = currentYearMaxCodeNext; diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index 383d18646..21b3a7676 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -71,7 +71,7 @@ namespace IRaCIS.Core.Domain.Models public string Indication { get; set; } = string.Empty; //入组那一块的状态 - [ConcurrencyCheck] + //[ConcurrencyCheck] public int TrialEnrollStatus { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index bb036b7fe..b0a6369bc 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -361,7 +361,7 @@ namespace IRaCIS.Core.Infra.EFCore //娣诲姞鐨勬椂鍊欙紝鏇存柊瀹¤瀛楁涔熻祴鍊 case EntityState.Added: - // 浠撳偍娣诲姞鏃 灏辨湁id浜 + //// 浠撳偍娣诲姞鏃 灏辨湁id浜 //if (t.Entity is Entity entity && entity.Id == Guid.Empty) //{ // entity.Id = NewId.NextGuid(); diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index 31ddcf3af..c54f93cf3 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -460,6 +460,13 @@ namespace IRaCIS.Core.Infra.EFCore return await SaveChangesAsync(true); } + /// + /// 閮ㄥ垎瀛楁鏇存柊锛屾敞鎰 妯″瀷鏍囨敞浜 ConcurrencyCheck鐨勫睘鎬э紝杩欐牱鐨勫疄浣擄紝涓嶉傚悎鐢ㄩ儴鍒嗗瓧娈垫洿鏂帮紝ef鐢熸垚鐨勬洿鏂皊ql浼氳嚜鍔ㄥ甫涓奀oncurrencyCheck鐨勫睘鎬ф潯浠 + /// + /// + /// + /// + /// private async Task SetPartialFieldUpdateAsync(Guid id, Expression> updateFactory, params EntityVerifyExp[] verify) { await EntityVerifyAsync(false, verify, id);