Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
c6d74309f4
|
@ -407,6 +407,12 @@ namespace IRaCIS.Core.API.Controllers
|
|||
//IR 上传的时候跟任务绑定
|
||||
public Guid? VisitTaskId { get; set; }
|
||||
|
||||
public string RecordPath { get; set; }
|
||||
|
||||
public int FailedFileCount { get; set; }
|
||||
|
||||
public long FileSize { get; set; }
|
||||
|
||||
|
||||
public List<OSSFileDTO> UploadedFileList { get; set; } = new List<OSSFileDTO>();
|
||||
|
||||
|
@ -420,6 +426,14 @@ namespace IRaCIS.Core.API.Controllers
|
|||
public string FileType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 非dicom 上传预上传接口
|
||||
/// </summary>
|
||||
/// <param name="preArchiveStudyCommand"></param>
|
||||
/// <param name="_studyService"></param>
|
||||
/// <param name="_studyMonitorRepository"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Study/PreArchiveStudy")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
public async Task<IResponseOutput> PreArchiveStudy(PreArchiveStudyCommand preArchiveStudyCommand,
|
||||
|
@ -437,6 +451,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
|
||||
IsSuccess = false,
|
||||
UploadStartTime = DateTime.Now,
|
||||
FileCount=preArchiveStudyCommand.FileCount,
|
||||
IsDicom = preArchiveStudyCommand.IsDicom,
|
||||
IP = _userInfo.IP
|
||||
};
|
||||
|
@ -500,7 +515,9 @@ namespace IRaCIS.Core.API.Controllers
|
|||
|
||||
noneDicomStudy.FileCount = noneDicomStudy.FileCount + (incommand.VisitTaskId != null ? 0 : incommand.UploadedFileList.Count);
|
||||
|
||||
studyMonitor.FileCount = incommand.UploadedFileList.Count;
|
||||
studyMonitor.RecordPath = incommand.RecordPath;
|
||||
studyMonitor.FailedFileCount = incommand.FailedFileCount;
|
||||
studyMonitor.IsSuccess = incommand.FailedFileCount == 0;
|
||||
studyMonitor.FileSize = incommand.UploadedFileList.Sum(t => t.FileFize);
|
||||
studyMonitor.IsDicom = false;
|
||||
studyMonitor.IsDicomReUpload = false;
|
||||
|
@ -508,7 +525,6 @@ namespace IRaCIS.Core.API.Controllers
|
|||
studyMonitor.StudyCode = noneDicomStudy.StudyCode;
|
||||
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||
studyMonitor.IP = _userInfo.IP;
|
||||
studyMonitor.IsSuccess = true;
|
||||
|
||||
await _noneDicomStudyRepository.SaveChangesAsync();
|
||||
|
||||
|
|
|
@ -281,6 +281,15 @@
|
|||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.ArchiveStudyNew(System.Guid,System.Guid,System.String,System.Nullable{System.Guid},System.Guid,Microsoft.Extensions.Logging.ILogger{IRaCIS.Core.API.Controllers.UploadDownLoadController},IRaCIS.Core.Application.Contracts.IStudyService,Microsoft.AspNetCore.SignalR.IHubContext{IRaCIS.Core.API.UploadHub,IRaCIS.Core.API.IUploadClient},IRaCIS.Core.Application.Contracts.Dicom.IDicomArchiveService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor})">
|
||||
<summary>Dicom 归档</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.PreArchiveStudy(IRaCIS.Core.Application.Contracts.PreArchiveStudyCommand,IRaCIS.Core.Application.Contracts.IStudyService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor})">
|
||||
<summary>
|
||||
非dicom 上传预上传接口
|
||||
</summary>
|
||||
<param name="preArchiveStudyCommand"></param>
|
||||
<param name="_studyService"></param>
|
||||
<param name="_studyMonitorRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFile(IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFileCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile})">
|
||||
<summary>
|
||||
上传非Dicom 文件 支持压缩包 多文件上传
|
||||
|
|
|
@ -4263,7 +4263,7 @@
|
|||
临床答案
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ClinicalAnswerService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialClinicalQuestion},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemClinicalQuestion},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemClinicalTableQuestion},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialClinicalTableQuestion},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalForm},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModuleCriterionFrom},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalTableAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Application.Interfaces.IClinicalQuestionService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ClinicalAnswerService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialClinicalQuestion},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialClinicalTableQuestion},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalForm},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModuleCriterionFrom},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalTableAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Application.Interfaces.IClinicalQuestionService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService)">
|
||||
<summary>
|
||||
临床答案
|
||||
</summary>
|
||||
|
|
|
@ -207,9 +207,6 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
|
||||
public long FileSize { get; set; }
|
||||
|
||||
public bool IsDicomReUpload { get; set; }
|
||||
|
||||
|
||||
|
@ -390,7 +387,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public string HtmlPath { get; set; } = string.Empty;
|
||||
|
||||
public decimal FileFize { get; set; }
|
||||
public long FileSize { get; set; }
|
||||
}
|
||||
|
||||
public class CRCUploadTaskQuery
|
||||
|
@ -582,6 +579,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public string IP { get; set; }
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class TrialIamgeDownQuery:PageInput
|
||||
|
|
|
@ -90,7 +90,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
IP = _userInfo.IP,
|
||||
|
||||
IsDicomReUpload = preArchiveStudyCommand.IsDicomReUpload,
|
||||
FileSize = preArchiveStudyCommand.FileSize,
|
||||
FileCount = preArchiveStudyCommand.FileCount,
|
||||
|
||||
};
|
||||
|
@ -165,6 +164,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
studyMonitor.FailedFileCount = incommand.FailedFileCount;
|
||||
studyMonitor.IsSuccess = incommand.FailedFileCount == 0;
|
||||
studyMonitor.RecordPath = incommand.RecordPath;
|
||||
studyMonitor.FileSize = incommand.Study.SeriesList.SelectMany(t=>t.InstanceList).Sum(t => t.FileSize);
|
||||
|
||||
var studyId = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString());
|
||||
var findStudy = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == studyId);
|
||||
|
|
|
@ -145,6 +145,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<TrialImageDownload, TrialImageDownloadView>()
|
||||
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUser.FullName))
|
||||
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUser.UserTypeEnum))
|
||||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName));
|
||||
|
||||
}
|
||||
|
|
|
@ -25,8 +25,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
[ApiExplorerSettings(GroupName = "Reading")]
|
||||
public class ClinicalAnswerService(
|
||||
IRepository<TrialClinicalQuestion> _trialClinicalQuestionRepository,
|
||||
IRepository<SystemClinicalQuestion> _systemClinicalQuestionRepository,
|
||||
IRepository<SystemClinicalTableQuestion> _systemClinicalTableQuestionRepository,
|
||||
IRepository<TrialClinicalTableQuestion> _trialClinicalTableQuestionRepository,
|
||||
IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository,
|
||||
IRepository<ClinicalForm> _clinicalFormRepository,
|
||||
|
|
|
@ -15,13 +15,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
//是否英文环境
|
||||
var isEn_Us=false;
|
||||
var isEn_Us = false;
|
||||
|
||||
//标准Id
|
||||
List<Guid> CriterionIds = new List<Guid>();
|
||||
|
||||
#region 临床问题
|
||||
CreateMap<TrialClinicalQuestion, TrialClinicalQuestionDto>()
|
||||
#region 临床问题
|
||||
CreateMap<TrialClinicalQuestion, TrialClinicalQuestionDto>()
|
||||
.ForMember(d => d.GroupName, opt => opt.MapFrom(src => src.GroupQuestin.QuestionName))
|
||||
.ForMember(d => d.GroupEnName, opt => opt.MapFrom(src => src.GroupQuestin.QuestionEnName));
|
||||
|
||||
|
@ -42,20 +42,23 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.SystemClinicalQuestionId, opt => opt.MapFrom(src => src.Id));
|
||||
|
||||
CreateMap<SystemClinicalQuestion, TrialClinicalQuestionSynchronize>()
|
||||
.ForMember(d => d.CreateUser, opt => opt.Ignore())
|
||||
.ForMember(d => d.SystemClinicalQuestionId, opt => opt.MapFrom(src => src.Id));
|
||||
|
||||
|
||||
CreateMap<SystemClinicalTableQuestion, TrialClinicalTableQuestion>()
|
||||
.ForMember(d => d.SystemTableQuestionId, u => u.MapFrom(s => s.Id));
|
||||
|
||||
CreateMap<SystemClinicalTableQuestion, TrialClinicalTableQuestionSynchronize>()
|
||||
.ForMember(d => d.SystemTableQuestionId, opt => opt.MapFrom(src => src.Id));
|
||||
.ForMember(d => d.SystemTableQuestionId, opt => opt.MapFrom(src => src.Id))
|
||||
.ForMember(d => d.CreateUser, opt => opt.Ignore());
|
||||
|
||||
|
||||
// 预览
|
||||
CreateMap<TrialClinicalQuestion, ClinicalQuestionPreviewDto>();
|
||||
|
||||
CreateMap<SystemClinicalQuestion, ClinicalQuestionPreviewDto>();
|
||||
|
||||
|
||||
CreateMap<SystemClinicalTableQuestion, ClinicalTablePreviewDto>();
|
||||
CreateMap<TrialClinicalTableQuestion, ClinicalTablePreviewDto>();
|
||||
#endregion
|
||||
|
@ -69,38 +72,38 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<ReadingCustomTagDto, ReadingCustomTag>();
|
||||
|
||||
CreateMap<UserWLTemplate, UserWLTemplateView>();
|
||||
CreateMap<UserWLTemplate,UserWLTemplateAddOrEdit>().ReverseMap();
|
||||
CreateMap<UserWLTemplate, UserWLTemplateAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<ReadingPeriodSetAddOrEdit, ReadingPeriodSet>();
|
||||
CreateMap<ReadingTableQuestionAnswer, TableQuestionAnswerInfo>().ReverseMap();
|
||||
CreateMap<ReadingTableQuestionAnswer, TableQuestionAnswerInfo>()
|
||||
.ForMember(d => d.QuestionMark, u => u.MapFrom(s => s.ReadingTableQuestionTrial == null ? null : s.ReadingTableQuestionTrial.QuestionMark));
|
||||
CreateMap<ReadingPeriodSetAddOrEdit, ReadingPeriodSet>();
|
||||
CreateMap<ReadingTableQuestionAnswer, TableQuestionAnswerInfo>().ReverseMap();
|
||||
CreateMap<ReadingTableQuestionAnswer, TableQuestionAnswerInfo>()
|
||||
.ForMember(d => d.QuestionMark, u => u.MapFrom(s => s.ReadingTableQuestionTrial == null ? null : s.ReadingTableQuestionTrial.QuestionMark));
|
||||
|
||||
CreateMap<AddOrUpdateTumorAssessmentInDto, TumorAssessment_RECIST1Point1>();
|
||||
CreateMap<AddOrUpdateTumorAssessmentInDto, TumorAssessment_RECIST1Point1>();
|
||||
|
||||
CreateMap<ReadingPeriodSet, ReadingPeriodSetView>()
|
||||
.ForMember(d => d.SubjectVisitName, u => u.MapFrom(s => s.VisitStage==null?string.Empty: s.VisitStage.VisitName))
|
||||
.ForMember(d => d.SubjectVisitName, u => u.MapFrom(s => s.VisitStage == null ? string.Empty : s.VisitStage.VisitName))
|
||||
.ForMember(d => d.SiteIds, u => u.MapFrom(s => s.ReadingPeriodSites.Select(x => x.TrialSiteId)))
|
||||
.ForMember(d => d.SiteCodes, u => u.MapFrom(s => s.ReadingPeriodSites.Select(x => x.TrialSite.TrialSiteCode)))
|
||||
.ForMember(d => d.PlanCount, u => u.MapFrom(s => s.ReadingPeriodPlanList.Count));
|
||||
|
||||
CreateMap<ReadingSystemCriterionDictionary, CriterionDictionaryInfo>()
|
||||
.ForMember(d => d.ChildGroup, u => u.MapFrom(s => s.Dictionary.ChildGroup))
|
||||
.ForMember(d => d.Code, u => u.MapFrom(s => s.Dictionary.Code))
|
||||
.ForMember(d => d.Code, u => u.MapFrom(s => s.Dictionary.Code))
|
||||
.ForMember(d => d.Description, u => u.MapFrom(s => s.Dictionary.Description))
|
||||
.ForMember(d => d.ShowOrder, u => u.MapFrom(s => s.Dictionary.ShowOrder))
|
||||
.ForMember(d => d.ParentCode, u => u.MapFrom(s => s.Dictionary.Parent.Code))
|
||||
.ForMember(d => d.Value, u => u.MapFrom(s => s.Dictionary.Value))
|
||||
.ForMember(d => d.ValueCN, u => u.MapFrom(s => s.Dictionary.ValueCN));
|
||||
|
||||
CreateMap<ReadingTrialCriterionDictionary, CriterionDictionaryInfo>()
|
||||
.ForMember(d => d.ChildGroup, u => u.MapFrom(s => s.Dictionary.ChildGroup))
|
||||
.ForMember(d => d.Code, u => u.MapFrom(s => s.Dictionary.Code))
|
||||
.ForMember(d => d.Description, u => u.MapFrom(s => s.Dictionary.Description))
|
||||
.ForMember(d => d.ShowOrder, u => u.MapFrom(s => s.Dictionary.ShowOrder))
|
||||
.ForMember(d => d.ParentCode, u => u.MapFrom(s => s.Dictionary.Parent.Code))
|
||||
.ForMember(d => d.Value, u => u.MapFrom(s => s.Dictionary.Value))
|
||||
.ForMember(d => d.ValueCN, u => u.MapFrom(s => s.Dictionary.ValueCN));
|
||||
CreateMap<ReadingTrialCriterionDictionary, CriterionDictionaryInfo>()
|
||||
.ForMember(d => d.ChildGroup, u => u.MapFrom(s => s.Dictionary.ChildGroup))
|
||||
.ForMember(d => d.Code, u => u.MapFrom(s => s.Dictionary.Code))
|
||||
.ForMember(d => d.Description, u => u.MapFrom(s => s.Dictionary.Description))
|
||||
.ForMember(d => d.ShowOrder, u => u.MapFrom(s => s.Dictionary.ShowOrder))
|
||||
.ForMember(d => d.ParentCode, u => u.MapFrom(s => s.Dictionary.Parent.Code))
|
||||
.ForMember(d => d.Value, u => u.MapFrom(s => s.Dictionary.Value))
|
||||
.ForMember(d => d.ValueCN, u => u.MapFrom(s => s.Dictionary.ValueCN));
|
||||
|
||||
CreateMap<ReadingTaskQuestionMark, GetTableAnswerRowInfoOutDto>()
|
||||
.ForMember(d => d.FristAddTaskId, u => u.MapFrom(s => s.FirstAddTaskId!.Value));
|
||||
|
@ -127,14 +130,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<ClinicalDataSystemSet, ClinicalDataSystemSetAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<ClinicalDataTrialSet, ClinicalDataTrialSetView>()
|
||||
.ForMember(t => t.TrialCriterionNameList, u => u.MapFrom(c => c.TrialClinicalDataSetCriteriaList.Where(x=>
|
||||
CriterionIds.Contains(x.TrialReadingCriterionId) ).Select(t => t.TrialReadingCriterion.CriterionName)))
|
||||
.ForMember(t => t.TrialCriterionNameList, u => u.MapFrom(c => c.TrialClinicalDataSetCriteriaList.Where(x =>
|
||||
CriterionIds.Contains(x.TrialReadingCriterionId)).Select(t => t.TrialReadingCriterion.CriterionName)))
|
||||
.ForMember(t => t.TrialCriterionIdList, u => u.MapFrom(c => c.TrialClinicalDataSetCriteriaList.Select(t => t.TrialReadingCriterion.Id)))
|
||||
.ForMember(d => d.IsUsed, u => u.MapFrom(s => s.ReadingClinicalDataList.Count()>0));
|
||||
.ForMember(d => d.IsUsed, u => u.MapFrom(s => s.ReadingClinicalDataList.Count() > 0));
|
||||
|
||||
CreateMap<ClinicalDataSystemSet, ClinicalDataSystemSetView>();
|
||||
//.ForMember(t=>t.SystemCriterionNameList,u=>u.MapFrom(c=>c.SystemClinicalDataCriterionList.Select(t=>t.SystemReadingCriterion.CriterionName)))
|
||||
//.ForMember(t => t.SystemCriterionIdList, u => u.MapFrom(c => c.SystemClinicalDataCriterionList.Select(t => t.SystemReadingCriterion.Id)));
|
||||
//.ForMember(t=>t.SystemCriterionNameList,u=>u.MapFrom(c=>c.SystemClinicalDataCriterionList.Select(t=>t.SystemReadingCriterion.CriterionName)))
|
||||
//.ForMember(t => t.SystemCriterionIdList, u => u.MapFrom(c => c.SystemClinicalDataCriterionList.Select(t => t.SystemReadingCriterion.Id)));
|
||||
|
||||
CreateMap<PreviousPDF, PreviousPDFAddOrEdit>().ReverseMap();
|
||||
|
||||
|
@ -149,15 +152,15 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<ReadingTableAnswerRowInfo, CopyTableAnswerRowInfo>()
|
||||
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id));
|
||||
//.ForMember(dest => dest.Instance, opt => opt.Ignore())
|
||||
//.ForMember(dest => dest.ReadingQuestionTrial, opt => opt.Ignore());
|
||||
//.ForMember(dest => dest.Instance, opt => opt.Ignore())
|
||||
//.ForMember(dest => dest.ReadingQuestionTrial, opt => opt.Ignore());
|
||||
|
||||
#region 阅片问题
|
||||
|
||||
|
||||
|
||||
// 忽略列
|
||||
CreateMap<ReadingQuestionTrial, DicomReadingQuestionAnswer>()
|
||||
.ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us?s.QuestionEnName:s.QuestionName))
|
||||
.ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName))
|
||||
.ForMember(d => d.GroupName, u => u.MapFrom(s => isEn_Us ? s.GroupEnName : s.GroupName))
|
||||
.ForMember(dest => dest.ReadingCriterionPage, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.ParentReadingQuestionTrial, opt => opt.Ignore())
|
||||
|
@ -207,7 +210,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<ReadingCriterionPageAddOrEdit, ReadingCriterionPage>();
|
||||
|
||||
CreateMap<ReadingQuestionTrial, ReadingQuestionSystem>();
|
||||
CreateMap<ReadingQuestionTrial, ReadingQuestionSystem>()
|
||||
.ForMember(d => d.CreateUser, u => u.Ignore());
|
||||
|
||||
CreateMap<Dictionary, OrganDictionary>();
|
||||
|
||||
|
@ -218,12 +222,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id));
|
||||
|
||||
CreateMap<ReadingQuestionSystem, ReadingQuestionTrial>()
|
||||
.ForMember(d => d.ReadingQuestionSystemId, u => u.MapFrom(s => s.Id));
|
||||
.ForMember(d => d.CreateUser, u => u.Ignore())
|
||||
.ForMember(d => d.ReadingQuestionSystemId, u => u.MapFrom(s => s.Id));
|
||||
|
||||
CreateMap<ReadingTableAnswerRowInfo, TableAnsweRowInfo>()
|
||||
.ForMember(d => d.MergeName, u => u.MapFrom(s => s.MergeRow == null ? string.Empty : s.MergeRow.ReadingQuestionTrial.OrderMark + s.MergeRow.RowIndex.GetLesionMark()))
|
||||
.ForMember(d => d.SplitName, u => u.MapFrom(s => s.SplitRow == null ? string.Empty : s.SplitRow.ReadingQuestionTrial.OrderMark + s.SplitRow.RowIndex.GetLesionMark()))
|
||||
.ForMember(d => d.LesionType, u => u.MapFrom(s => s.ReadingQuestionTrial == null ?null : s.ReadingQuestionTrial.LesionType));
|
||||
.ForMember(d => d.LesionType, u => u.MapFrom(s => s.ReadingQuestionTrial == null ? null : s.ReadingQuestionTrial.LesionType));
|
||||
|
||||
|
||||
CreateMap<ReadingTableQuestionSystem, ReadingTrialTableQuestionData>()
|
||||
|
@ -237,10 +242,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<ReadingTrialTableQuestionData, ReadingTableQuestionTrial>();
|
||||
|
||||
|
||||
CreateMap<ReadingQuestionCriterionSystem, ReadingQuestionCriterionTrial>()
|
||||
CreateMap<ReadingQuestionCriterionSystem, ReadingQuestionCriterionTrial>()
|
||||
.ForMember(dest => dest.ReadingQuestionTrialList, opt => opt.Ignore())
|
||||
.ForMember(d => d.ReadingQuestionCriterionSystemId, u => u.MapFrom(s => s.Id)); ;
|
||||
|
||||
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
|
||||
.ForMember(d => d.ReadingQuestionCriterionSystemId, u => u.MapFrom(s => s.Id));
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateReadingQuestionCriterionSystemInDto, ReadingQuestionCriterionSystem>();
|
||||
CreateMap<ReadingQuestionCriterionSystem, ReadingQuestionCriterionSystemView>()
|
||||
|
@ -251,19 +257,19 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<ReadingQuestionSystem, AddOrUpdateReadingQuestionSystemInDto>();
|
||||
CreateMap<AddOrUpdateReadingQuestionSystemInDto, ReadingQuestionSystem>();
|
||||
CreateMap<ReadingQuestionSystem, ReadingQuestionSystemView>()
|
||||
.ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo==null?s.GroupName:s.GroupInfo.GroupName))
|
||||
.ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentReadingQuestionSystem==null?string.Empty: s.ParentReadingQuestionSystem.QuestionName))
|
||||
.ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupName : s.GroupInfo.GroupName))
|
||||
.ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentReadingQuestionSystem == null ? string.Empty : s.ParentReadingQuestionSystem.QuestionName))
|
||||
.ForMember(d => d.ParentQuestionShowOrder, u => u.MapFrom(s => s.ParentReadingQuestionSystem.ShowOrder))
|
||||
.ForMember(d => d.ParentDictionaryCode, u => u.MapFrom(s => s.ParentReadingQuestionSystem.DictionaryCode))
|
||||
.ForMember(d => d.ParentQuestionGenre, u => u.MapFrom(s => s.ParentReadingQuestionSystem.QuestionGenre))
|
||||
.ForMember(d => d.RelevanceShowOrder, u => u.MapFrom(s => s.RelevanceReadingQuestionSystem.ShowOrder))
|
||||
.ForMember(d => d.RelevanceDictionaryCode, u => u.MapFrom(s => s.RelevanceReadingQuestionSystem.DictionaryCode))
|
||||
.ForMember(d => d.RelevanceQuestionGenre, u => u.MapFrom(s => s.RelevanceReadingQuestionSystem.QuestionGenre));
|
||||
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateReadingQuestionCriterionTrialInDto, ReadingQuestionCriterionTrial>();
|
||||
CreateMap<ReadingQuestionCriterionTrial, ReadingQuestionCriterionTrialView>()
|
||||
.ForMember(d => d.QuestionCount, u => u.MapFrom(s => s.ReadingQuestionTrialList.Count()));
|
||||
.ForMember(d => d.QuestionCount, u => u.MapFrom(s => s.ReadingQuestionTrialList.Count()));
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateReadingQuestionTrialInDto, ReadingQuestionTrial>();
|
||||
|
@ -282,7 +288,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
#region IR阅片
|
||||
CreateMap<ReadingQuestionTrial, GetTrialReadingQuestionOutDto>()
|
||||
.ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName))
|
||||
.ForMember(x=>x.Id, y=>y.MapFrom(z=>z.Id));
|
||||
.ForMember(x => x.Id, y => y.MapFrom(z => z.Id));
|
||||
|
||||
//CreateMap<VisitTask, GetReadingPastResultListOutDto>()
|
||||
// .ForMember(x => x.VisitTaskId, y => y.MapFrom(z => z.Id))
|
||||
|
@ -299,7 +305,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<ReadingMedicineTrialQuestionAddOrEdit, ReadingMedicineTrialQuestion>();
|
||||
CreateMap<ReadingMedicineTrialQuestion, ReadingMedicineTrialQuestionView>()
|
||||
.ForMember(x=>x.ParentShowOrder,y=>y.MapFrom(n=>n.ParentQuestion.ShowOrder));
|
||||
.ForMember(x => x.ParentShowOrder, y => y.MapFrom(n => n.ParentQuestion.ShowOrder));
|
||||
|
||||
CreateMap<ReadingMedicineTrialQuestion, GetMedicineQuestionPreviewOutDto>();
|
||||
|
||||
|
@ -311,12 +317,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
//.ForMember(x => x.FileList, y => y.MapFrom(n => n.FileList))
|
||||
.ForMember(x => x.CreateUserName, y => y.MapFrom(n => n.CreateUser.UserName));
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 阅片部位
|
||||
#region 阅片部位
|
||||
|
||||
CreateMap<CriterionNidusTrial, CriterionNidusView>();
|
||||
CreateMap<CriterionNidusSystem, CriterionNidusView>();
|
||||
CreateMap<CriterionNidusTrial, CriterionNidusView>();
|
||||
CreateMap<CriterionNidusSystem, CriterionNidusView>();
|
||||
CreateMap<CriterionNidusSystem, CriterionNidusAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<OrganInfoAddOrEdit, OrganInfo>();
|
||||
|
@ -329,13 +335,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
// .ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.subject.Code))
|
||||
// .ForMember(d => d.SubjectStatus, u => u.MapFrom(s => s.subject.Status));
|
||||
|
||||
|
||||
CreateMap<SubjectCriteriaEvaluationAddOrEdit, SubjectCriteriaEvaluation>().ReverseMap();
|
||||
|
||||
CreateMap<SubjectCriteriaEvaluationAddOrEdit, SubjectCriteriaEvaluation>().ReverseMap();
|
||||
CreateMap<SubjectCriteriaEvaluation, SubjectCriteriaEvaluationView>().ReverseMap();
|
||||
CreateMap<SubjectCriteriaEvaluationVisitFilter, SubjectCriteriaEvaluationVisitFilterAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<SubjectCriteriaEvaluationVisitStudyFilterAddOrEdit, SubjectCriteriaEvaluationVisitStudyFilter>().ReverseMap();
|
||||
|
||||
|
||||
CreateMap<DicomStudy, SelectStudyView>()
|
||||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUser.LastName + " / " + u.CreateUser.FirstName))
|
||||
|
@ -347,5 +353,5 @@ namespace IRaCIS.Core.Application.Service
|
|||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -281,6 +281,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public bool IsDicom { get; set; }
|
||||
|
||||
public int FileCount { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -110,27 +110,25 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
public Guid TestId { get; set; }
|
||||
|
||||
public string TestName { get; set; }
|
||||
public string TestName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IResponseOutput TestJson()
|
||||
public async Task<IResponseOutput> TestJson()
|
||||
{
|
||||
var trial=new Trial();
|
||||
|
||||
trial.ExperimentName = null;
|
||||
|
||||
_trialRepository.AddAsync(trial,true);
|
||||
await _trialBodyPartRepository.FirstOrDefaultAsync();
|
||||
|
||||
await _trialBodyPartRepository.Where(t=>t.Trial.Id==Guid.Empty).FirstOrDefaultAsync();
|
||||
|
||||
return ResponseOutput.Ok(new TestModel(), IRCEmailPasswordHelper.GenerateRandomPassword(10));
|
||||
}
|
||||
|
||||
public string TestHoliday(DateTime startdate,DateTime endDate)
|
||||
public string TestHoliday(DateTime startdate, DateTime endDate)
|
||||
{
|
||||
var timeSpan= HolidayHelper.GetChinaWorkTimeSpan(startdate, endDate);
|
||||
var timeSpan = HolidayHelper.GetChinaWorkTimeSpan(startdate, endDate);
|
||||
|
||||
_userRepository.Where(t => t.Id == _userInfo.Id).Select(t => t.FullName).FirstOrDefault();
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
[ForeignKey("CreateUserId")]
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
public virtual User CreateUser { get; set; }
|
||||
}
|
||||
|
||||
public abstract class BaseAddDeleteAuditEntity : Entity, IAuditAdd, ISoftDelete
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations.Operations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Convention
|
||||
{
|
||||
public class MigrationRemoveForeignKeysSqlGenerator : MigrationsSqlGenerator
|
||||
{
|
||||
public MigrationRemoveForeignKeysSqlGenerator(MigrationsSqlGeneratorDependencies dependencies, IMigrationsAnnotationProvider migrationsAnnotations) : base(dependencies)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Generate(Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
|
||||
{
|
||||
operation.ForeignKeys.Clear();
|
||||
base.Generate(operation, model, builder, terminate);
|
||||
}
|
||||
|
||||
protected override void Generate(AddForeignKeyOperation operation, IModel? model, MigrationCommandListBuilder builder,
|
||||
bool terminate = true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
using Microsoft.EntityFrameworkCore.Metadata.Conventions;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
namespace IRaCIS.Core.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// 这种方式不行
|
||||
/// </summary>
|
||||
public class NoForeignKeyConvention : IModelFinalizingConvention
|
||||
{
|
||||
public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
|
||||
{
|
||||
foreach (var entityType in modelBuilder.Metadata.GetEntityTypes())
|
||||
{
|
||||
foreach (var foreignKey in entityType.GetForeignKeys())
|
||||
{
|
||||
// 设置删除行为为 NoAction,避免生成外键约束
|
||||
foreignKey.Builder.OnDelete(DeleteBehavior.NoAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations.Operations;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations.Internal;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
|
||||
namespace IRaCIS.Core.Test
|
||||
{
|
||||
public class NoForeignKeyMigrationsSqlGenerator : MigrationsSqlGenerator
|
||||
{
|
||||
public NoForeignKeyMigrationsSqlGenerator(
|
||||
MigrationsSqlGeneratorDependencies dependencies) : base(dependencies)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
|
||||
{
|
||||
if (operation is AddForeignKeyOperation || operation is DropForeignKeyOperation)
|
||||
{
|
||||
// 跳过外键的生成
|
||||
return;
|
||||
}
|
||||
|
||||
base.Generate(operation, model, builder);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL;
|
||||
using IRaCIS.Core.Test.CodeFirstTest.MSSQL.Convention;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
@ -42,8 +41,9 @@ public partial class IRCContext : DbContext
|
|||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
//移除外键约束
|
||||
optionsBuilder.ReplaceService<IMigrationsSqlGenerator, MigrationRemoveForeignKeysSqlGenerator>();
|
||||
|
||||
// 替换默认的 MigrationsSqlGenerator
|
||||
optionsBuilder.ReplaceService<IMigrationsSqlGenerator, NoForeignKeyMigrationsSqlGenerator>();
|
||||
optionsBuilder.UseSqlServer("Server=106.14.89.110,1433;Database=IRC_Code;User ID=sa;Password=mssql_KnTs2a;TrustServerCertificate=true");
|
||||
|
||||
|
||||
|
@ -59,12 +59,14 @@ public partial class IRCContext : DbContext
|
|||
modelBuilder.ApplyConfiguration(configurationInstance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
|
||||
{
|
||||
|
||||
|
||||
//针对字符串使用默认的长度配置
|
||||
configurationBuilder.Conventions.Add(_ => new MaxStringLengthConvention());
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240912012757_RemoveForeignKey")]
|
||||
[Migration("20240912054434_RemoveForeignKey")]
|
||||
partial class RemoveForeignKey
|
||||
{
|
||||
/// <inheritdoc />
|
|
@ -151,16 +151,21 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
|||
#region 测试生成迁移移除外键约束
|
||||
|
||||
#endregion
|
||||
|
||||
#region 测试迁移不生成外键约束,ef知道外键关系,但是数据库不保存外键
|
||||
public class Project : BaseFullAuditEntity
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class ProjectUser: BaseFullAuditEntity
|
||||
public class ProjectUser : BaseFullAuditEntity
|
||||
{
|
||||
//外键
|
||||
public Guid ProjectId { get; set; }
|
||||
|
||||
public Project Project { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue