From 07d9afdd297a5d286af416e7a419f696d82c9a34 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 28 Apr 2022 17:34:57 +0800 Subject: [PATCH] xxx --- .../Service/QC/QCOperationService.cs | 5 --- IRaCIS.Core.Application/TestService.cs | 36 ++++++++++++------- IRaCIS.Core.Domain/Common/Dictionary.cs | 4 +-- .../Context/IRaCISDBContext.cs | 16 ++++----- .../EntityConfigration/DoctorConfigration.cs | 4 +-- 5 files changed, 35 insertions(+), 30 deletions(-) diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index e2bde77f4..b77622d60 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -1144,11 +1144,6 @@ namespace IRaCIS.Core.Application.Image.QA #region 处理验证 - if (dbSubjectVisit.IsTake && dbSubjectVisit.CurrentActionUserId != _userInfo.Id) - { - return ResponseOutput.NotOk("当前已被领取,不允许领取"); - } - if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit) { return ResponseOutput.NotOk("项目配置为不审,没有领取QC Task"); diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 30ab7b050..d1bdf2fdb 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -11,9 +11,9 @@ namespace IRaCIS.Application.Services public class TestService : BaseService { private readonly IRepository _dicRepository; - private readonly IRepository _trialRepository; + private readonly IRepository _trialRepository; - public TestService(IRepository dicRepository, IRepository trialRepository) + public TestService(IRepository dicRepository, IRepository trialRepository) { _dicRepository = dicRepository; _trialRepository = trialRepository; @@ -23,20 +23,30 @@ namespace IRaCIS.Application.Services public string Get(testModel testModel) { - var waitModifyEntity= _dicRepository.FirstOrDefaultAsync(t=>t.Id== Guid.Parse("e2b97a6c-35a6-4aa3-7f27-08da13ab33ff")).GetAwaiter().GetResult(); - - var tt= _dicRepository.UpdateAsync(waitModifyEntity, t => new Dictionary() { Description = "xxxxx"}, true).Result; - - - //var d = _repository.Where(t => t.FullName.Contains("cc")).Select(t => t.FullName).FirstOrDefault(); - //var c = _dicRepository.Where(t => t.ParentId != null).Select(t => t.MappedValue).First(); - //CultureInfo culture = CultureInfo.CurrentUICulture; - - //var dd = _dicRepository.UpdatePartialFields(Guid.Parse("8a90c96e-0776-4f7b-82a6-18933d339584"), - // u => new Dictionary() { ParentId = null, Code = "test" }, true); + var aaabb = _trialRepository.BatchDeleteNoTrackingAsync(t => t.Id == Guid.Empty).Result; var aaaa = _dicRepository.BatchDeleteNoTrackingAsync(t => t.Id == Guid.Empty).Result; + + var waitModifyEntity = _dicRepository.FirstOrDefaultAsync(t => t.Id == Guid.Parse("e2b97a6c-35a6-4aa3-7f27-08da13ab33ff")).GetAwaiter().GetResult(); + + var tt = _dicRepository.UpdateAsync(waitModifyEntity, t => new Dictionary() { Description = "xxxxx" }, true).Result; + + + + var tt2 = _trialRepository.UpdateFromQueryAsync(Guid.Parse("543d0000-3e10-0016-77e9-08da2827228a"), t => new Trial() { Indication = "WCH测试稽查002" }, true).Result; + + + + + //var d = _repository.Where(t => t.FullName.Contains("cc")).Select(t => t.FullName).FirstOrDefault(); + //var c = _dicRepository.Where(t => t.ParentId != null).Select(t => t.MappedValue).First(); + //CultureInfo culture = CultureInfo.CurrentUICulture; + + //var dd = _dicRepository.UpdatePartialFields(Guid.Parse("8a90c96e-0776-4f7b-82a6-18933d339584"), + // u => new Dictionary() { ParentId = null, Code = "test" }, true); + + //var ggggg = _dicRepository.UpdateFromQueryAsync(t => t.ParentId == Guid.Parse("8a90c96e-0776-4f7b-82a6-18933d339584"), u=>new Dictionary(){Code = "test"}).Result; //var ddd = _dicRepository.BatchUpdateAsync(t => t.Id == Guid.Parse("8a90c96e-0776-4f7b-82a6-18933d339584"), diff --git a/IRaCIS.Core.Domain/Common/Dictionary.cs b/IRaCIS.Core.Domain/Common/Dictionary.cs index 4b6beb301..af3c6296b 100644 --- a/IRaCIS.Core.Domain/Common/Dictionary.cs +++ b/IRaCIS.Core.Domain/Common/Dictionary.cs @@ -59,8 +59,8 @@ namespace IRaCIS.Core.Domain.Models public string KeyName { get; set; } = string.Empty; - [NotMapped] - public string MappedValue { get; set; } + // [NotMapped] + //public string MappedValue { get; set; } } diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index e4050c9a0..f86c04eec 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -82,14 +82,14 @@ namespace IRaCIS.Core.Infra.EFCore //modelBuilder.HasDbFunction(typeof(DbContext).GetMethod(nameof(GetTableList))); - if (_userInfo.IsEn_Us) - { - modelBuilder.Entity().Property(t => t.MappedValue).HasColumnName(nameof(Domain.Models.Dictionary.Value)); - } - else - { - modelBuilder.Entity().Property(t => t.MappedValue).HasColumnName(nameof(Domain.Models.Dictionary.ValueCN)); - } + //if (_userInfo.IsEn_Us) + //{ + // modelBuilder.Entity().Property(t => t.MappedValue).HasColumnName(nameof(Domain.Models.Dictionary.Value)); + //} + //else + //{ + // modelBuilder.Entity().Property(t => t.MappedValue).HasColumnName(nameof(Domain.Models.Dictionary.ValueCN)); + //} //遍历实体模型手动配置 diff --git a/IRaCIS.Core.Infra.EFCore/EntityConfigration/DoctorConfigration.cs b/IRaCIS.Core.Infra.EFCore/EntityConfigration/DoctorConfigration.cs index afcafa48f..459a9bf76 100644 --- a/IRaCIS.Core.Infra.EFCore/EntityConfigration/DoctorConfigration.cs +++ b/IRaCIS.Core.Infra.EFCore/EntityConfigration/DoctorConfigration.cs @@ -30,8 +30,8 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration public void Configure(EntityTypeBuilder builder) { - builder.Property(e => e.MappedValue).Metadata.SetBeforeSaveBehavior(PropertySaveBehavior.Ignore); - builder.Property(e => e.MappedValue).Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore); + //builder.Property(e => e.MappedValue).Metadata.SetBeforeSaveBehavior(PropertySaveBehavior.Ignore); + //builder.Property(e => e.MappedValue).Metadata.SetAfterSaveBehavior(PropertySaveBehavior.Ignore); } }