影响上传导出
This commit is contained in:
@@ -55,7 +55,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
|
||||
public Guid[] SubjectVisitIds { get; set; }=new Guid[0];
|
||||
public Guid[] SubjectVisitIds { get; set; } = new Guid[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public class CRCVisitExportDTO
|
||||
{
|
||||
public ChallengeStateEnum ChallengeState { get; set; }
|
||||
public ChallengeStateEnum ChallengeState { get; set; }
|
||||
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsUrgent { get; set; }
|
||||
public string BlindName { get; set; } = String.Empty;
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
@@ -134,7 +136,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public DateTime? SubmitTime { get; set; }
|
||||
|
||||
|
||||
|
||||
[DictionaryTranslateAttribute("SubmitState")]
|
||||
public SubmitStateEnum SubmitState { get; set; }
|
||||
|
||||
@@ -149,6 +151,78 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
}
|
||||
|
||||
|
||||
public class QCChanllengeExportDto
|
||||
{
|
||||
|
||||
[DictionaryTranslateAttribute("Subject_Visit_Status")]
|
||||
public SubjectStatus SubjectState { get; set; }
|
||||
|
||||
public string ChallengeCode { get; set; } = String.Empty;
|
||||
|
||||
public String TrialSiteCode { get; set; } = String.Empty;
|
||||
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
|
||||
public string CreateUserName { get; set; } = String.Empty;
|
||||
|
||||
|
||||
|
||||
public DateTime? LatestMsgTime { get; set; }
|
||||
|
||||
|
||||
public string LatestReplyUserName { get; set; } = String.Empty;
|
||||
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsClosed { get; set; }
|
||||
|
||||
public DateTime? ClosedTime { get; set; }
|
||||
|
||||
public DateTime? DeadlineTime { get; set; }
|
||||
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsOverTime => IsClosed ? ClosedTime > DeadlineTime : DateTime.Now > DeadlineTime;
|
||||
|
||||
public string ChallengeDuration
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!ClosedTime.HasValue)
|
||||
return "";
|
||||
else return string.Format("{0}天{1}小时{2}分钟", (ClosedTime - CreateTime)?.Days, (ClosedTime - CreateTime)?.Hours, (ClosedTime - CreateTime)?.Minutes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//public QCChanllengeReuploadEnum ReuploadEnum { get; set; }
|
||||
//public SubmitStateEnum SubmitState { get; set; }
|
||||
//public string? CurrentActionUserName { get; set; }
|
||||
|
||||
//public bool IsUrgent { get; set; }
|
||||
|
||||
//public DateTime? ReUploadedTime { get; set; }
|
||||
|
||||
//public RequestBackStateEnum RequestBackState { get; set; }
|
||||
|
||||
//public string PreliminaryAuditUserName { get; set; } = String.Empty;
|
||||
//public AuditStateEnum AuditState { get; set; }
|
||||
//public CurrentQC CurrentQCEnum { get; set; }
|
||||
//public string ChallengeType { get; set; } = string.Empty;
|
||||
//public string Note { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public class QCCRCVisitViewModel : QCVisitBasicListViewModel
|
||||
{
|
||||
@@ -174,7 +248,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public bool IsHaveClinicalData { get; set; }
|
||||
|
||||
public string MedicalNo { get; set; }
|
||||
public string MedicalNo { get; set; }
|
||||
|
||||
public int? Age { get; set; }
|
||||
public string Sex { get; set; } = string.Empty;
|
||||
@@ -386,9 +460,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public class CheckDialogDTO
|
||||
{
|
||||
public QCCheckViewModel SubjectVisitCheck { get; set; }
|
||||
public QCCheckViewModel SubjectVisitCheck { get; set; }
|
||||
|
||||
public List<CheckChanllengeDialogDTO> DialogList { get; set; }
|
||||
public List<CheckChanllengeDialogDTO> DialogList { get; set; }
|
||||
}
|
||||
|
||||
public class QCCheckViewModel
|
||||
|
||||
@@ -41,7 +41,13 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
#region 导表查询
|
||||
|
||||
|
||||
//影像上传列表
|
||||
/// <summary>
|
||||
/// 影像上传列表 只导出已上传状态的访视记录
|
||||
/// </summary>
|
||||
/// <param name="visitSearchDTO"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> CRCVisitListExport(CRCVisitSearchDTO visitSearchDTO,
|
||||
@@ -49,7 +55,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
[FromServices] IDictionaryService _dictionaryService)
|
||||
{
|
||||
|
||||
|
||||
var svExpression = QCCommon.GetSubjectVisitFilter(visitSearchDTO.VisitPlanArray);
|
||||
|
||||
var list = await _subjectVisitRepository.Where(x => x.TrialId == visitSearchDTO.TrialId)
|
||||
@@ -67,24 +72,54 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.ProjectTo<CRCVisitExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
//var needTranslatePropertyList = typeof(CRCVisitExportDTO).GetProperties().Where(t => t.IsDefined(typeof(DictionaryTranslateAttribute), false))
|
||||
// .Select(c => new { c.Name, DicParentCode = ((DictionaryTranslateAttribute?)c.GetCustomAttributes(typeof(DictionaryTranslateAttribute), false)[0])?.DicParentCode }).ToList()
|
||||
// ;
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == visitSearchDTO.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
//var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).ToArray());
|
||||
|
||||
//var obj = new { cc = "aa", list };
|
||||
exportInfo.List = list;
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == visitSearchDTO.TrialId).IgnoreQueryFilters().ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialCRCUploadImageList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
dynamic obj = exportInfo;
|
||||
|
||||
((IDictionary<string, object>)obj).Add("List", list);
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialCRCUploadImageList_Export, obj, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO));
|
||||
/// <summary>
|
||||
/// 质疑列表
|
||||
/// </summary>
|
||||
/// <param name="challengeQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> GetQCChallengeList_EXport(ChallengeQuery challengeQuery,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService)
|
||||
|
||||
{
|
||||
|
||||
var svExpression = QCCommon.GetQCChallengeFilter(challengeQuery.VisitPlanArray);
|
||||
|
||||
var list =await _repository.Where<QCChallenge>(x => x.TrialId == challengeQuery.TrialId)
|
||||
//.WhereIf(challengeQuery.ChallengeState != null, t => t.SubjectVisit.ChallengeState == challengeQuery.ChallengeState)
|
||||
.WhereIf(challengeQuery.ReuploadEnum != null, t => t.ReuploadEnum == challengeQuery.ReuploadEnum)
|
||||
.WhereIf(challengeQuery.IsClosed != null, t => t.IsClosed == challengeQuery.IsClosed)
|
||||
.WhereIf(challengeQuery.SiteId != null, t => t.SubjectVisit.SiteId == challengeQuery.SiteId)
|
||||
.WhereIf(challengeQuery.SubjectId != null, t => t.SubjectVisit.SubjectId == challengeQuery.SubjectId)
|
||||
.WhereIf(challengeQuery.CreateUserId != null, t => t.CreateUserId == challengeQuery.CreateUserId)
|
||||
.WhereIf(!string.IsNullOrEmpty(challengeQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(challengeQuery.SubjectCode))
|
||||
.WhereIf(challengeQuery.VisitPlanArray != null && challengeQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
//.WhereIf(!string.IsNullOrEmpty(challengeQuery.VisitPlanInfo), challengeQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.InPlan == false : t => t.SubjectVisit.VisitNum == decimal.Parse(challengeQuery.VisitPlanInfo))
|
||||
.WhereIf(challengeQuery.IsUrgent != null, t => t.SubjectVisit.IsUrgent == challengeQuery.IsUrgent)
|
||||
.WhereIf(challengeQuery.IsOverTime != null, t => DateTime.Now > t.DeadlineTime)
|
||||
.ProjectTo<QCChanllengeExportDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == challengeQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = list;
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCImageChanllengeList_Export, exportInfo, "", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.EquivalencyExpression;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts.DTO;
|
||||
using IRaCIS.Core.Application.MediatR.CommandAndQueries;
|
||||
@@ -13,17 +14,28 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
#region 导出列表
|
||||
|
||||
|
||||
|
||||
CreateMap<SubjectVisit, CRCVisitExportDTO>()
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
||||
.ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.FullName))
|
||||
|
||||
.ForMember(d => d.IsHaveClinicalData, u => u.MapFrom(t => t.IsBaseLine ? t.PreviousHistoryList.Any() || t.PreviousOtherList.Any()
|
||||
|| t.ReadingClinicalDataList.Any(x => x.ClinicalDataTrialSet.UploadRole == Domain.Share.UploadRole.CRC && x.ReadingClinicalDataPDFList.Count() > 0)
|
||||
|| t.PreviousSurgeryList.Any() : false));
|
||||
CreateMap<Trial, ExcelExportInfo>();
|
||||
CreateMap<SubjectVisit, CRCVisitExportDTO>()
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
||||
.ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.FullName))
|
||||
|
||||
.ForMember(d => d.IsHaveClinicalData, u => u.MapFrom(t => t.IsBaseLine ? t.PreviousHistoryList.Any() || t.PreviousOtherList.Any()
|
||||
|| t.ReadingClinicalDataList.Any(x => x.ClinicalDataTrialSet.UploadRole == Domain.Share.UploadRole.CRC && x.ReadingClinicalDataPDFList.Count() > 0)
|
||||
|| t.PreviousSurgeryList.Any() : false));
|
||||
|
||||
|
||||
|
||||
CreateMap<QCChallenge, QCChanllengeExportDto>()
|
||||
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.SubjectVisit.Subject.Code))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.SubjectVisit.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName))
|
||||
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUser.UserName))
|
||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
||||
.ForMember(d => d.SubjectState, u => u.MapFrom(s => s.SubjectVisit.Subject.Status));
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -85,7 +97,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<QCQuestion, QCQuestionConfigureView>()
|
||||
.ForMember(d => d.ParentShowOrder, u => u.MapFrom(s => s.ParentQuestion.ShowOrder))
|
||||
.ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentQuestion.QuestionName));
|
||||
.ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentQuestion.QuestionName));
|
||||
|
||||
CreateMap<QCQuestion, QCQuestionAddOrEdit>();
|
||||
|
||||
@@ -119,7 +131,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<SubjectVisit, SubjectVisitDTO>();
|
||||
CreateMap<SubjectVisit, SubjectVisitSelectItem>()
|
||||
.ForMember(d => d.IsUploadedImage, u => u.MapFrom(s => s.StudyList.Count() > 0 || s.NoneDicomStudyList.SelectMany(u => u.NoneDicomFileList).Count() > 0));
|
||||
|
||||
|
||||
CreateMap<PreviousPDF, PreviousPDFView>()
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
||||
|
||||
@@ -249,18 +261,18 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
// 一致性核查文件
|
||||
CreateMap<ConsistencyCheckFile, GetConsistencyCheckFileDto>()
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName +"/"+ t.User.LastName));
|
||||
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName + "/" + t.User.LastName));
|
||||
|
||||
|
||||
//CRC 质疑列表
|
||||
CreateMap<QCChallenge, QCCRCChallengeViewModel>()
|
||||
.ForMember(d => d.PreliminaryAuditUserName, u => u.MapFrom(s => s.SubjectVisit.PreliminaryAuditUser.UserName))
|
||||
.ForMember(d => d.PreliminaryAuditUserId, u => u.MapFrom(s => s.SubjectVisit.PreliminaryAuditUserId))
|
||||
.ForMember(d => d.CurrentActionUserId, u => u.MapFrom(s => s.SubjectVisit.CurrentActionUserId))
|
||||
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(s => s.SubjectVisit .CurrentActionUser.UserName))
|
||||
.ForMember(d => d.CurrentActionUserName, u => u.MapFrom(s => s.SubjectVisit.CurrentActionUser.UserName))
|
||||
.ForMember(d => d.SubmitState, u => u.MapFrom(s => s.SubjectVisit.SubmitState))
|
||||
|
||||
|
||||
|
||||
.ForMember(d => d.SiteId, u => u.MapFrom(s => s.SubjectVisit.SiteId))
|
||||
.ForMember(d => d.AuditState, u => u.MapFrom(s => s.SubjectVisit.AuditState))
|
||||
.ForMember(d => d.IsUrgent, u => u.MapFrom(s => s.SubjectVisit.IsUrgent))
|
||||
@@ -277,7 +289,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUser.UserName))
|
||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
||||
.ForMember(d => d.ChallengeCode, u => u.MapFrom(s => s.ChallengeCode)); //排序的时候有坑 把这个带到sql 中去了
|
||||
//.AfterMap((src, dest) => dest.ChallengeCode = "Q" + src.ChallengeCode.ToString("D5"));//实测没有效果
|
||||
//.AfterMap((src, dest) => dest.ChallengeCode = "Q" + src.ChallengeCode.ToString("D5"));//实测没有效果
|
||||
|
||||
|
||||
|
||||
@@ -314,5 +326,5 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user