导出覆盖
parent
2cb196200a
commit
68c2af5d3e
|
|
@ -261,7 +261,9 @@ public static class ExcelExportHelper
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TempalteLastColumnIndex { get; set; }
|
public int TempalteLastColumnIndex { get; set; }
|
||||||
|
|
||||||
public List<string> CDISCList { get; set; } = new List<string>();
|
public bool IsCDISCExport { get; set; }=false;
|
||||||
|
|
||||||
|
//public List<string> CDISCList { get; set; } = new List<string>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 动态的列名 如果Id 重复,那么就按照名称填充,否则就按照Id 填充列数据
|
/// 动态的列名 如果Id 重复,那么就按照名称填充,否则就按照Id 填充列数据
|
||||||
|
|
@ -302,6 +304,8 @@ public static class ExcelExportHelper
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string CDISCCode { get; set; }
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj is not ColumItem other) return false;
|
if (obj is not ColumItem other) return false;
|
||||||
|
|
@ -490,7 +494,9 @@ public static class ExcelExportHelper
|
||||||
|
|
||||||
if (dynamicColumnConfig != null)
|
if (dynamicColumnConfig != null)
|
||||||
{
|
{
|
||||||
var isCdics = dynamicColumnConfig.CDISCList.Count > 0;
|
//var isCdics = dynamicColumnConfig.CDISCList.Count > 0;
|
||||||
|
|
||||||
|
var isCdics = dynamicColumnConfig.IsCDISCExport;
|
||||||
|
|
||||||
var sheet = workbook.GetSheetAt(0);
|
var sheet = workbook.GetSheetAt(0);
|
||||||
|
|
||||||
|
|
@ -545,9 +551,9 @@ public static class ExcelExportHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
//创建新的列
|
//创建新的列
|
||||||
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
|
for (int i = originRemoveEndIndex; i < originRemoveEndIndex + needAddCount; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
titelRow.CreateCell(i + 1);
|
titelRow.CreateCell(i + 1);
|
||||||
templateRow.CreateCell(i + 1);
|
templateRow.CreateCell(i + 1);
|
||||||
|
|
||||||
|
|
@ -566,6 +572,11 @@ public static class ExcelExportHelper
|
||||||
titelRow.GetCell(i).SetCellValue(titelRow.GetCell(i - gap).StringCellValue);
|
titelRow.GetCell(i).SetCellValue(titelRow.GetCell(i - gap).StringCellValue);
|
||||||
|
|
||||||
templateRow.GetCell(i).SetCellValue(templateRow.GetCell(i - gap).StringCellValue);
|
templateRow.GetCell(i).SetCellValue(templateRow.GetCell(i - gap).StringCellValue);
|
||||||
|
|
||||||
|
if (isCdics)
|
||||||
|
{
|
||||||
|
cdicsRow.GetCell(i).SetCellValue(cdicsRow.GetCell(i - gap).StringCellValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -574,6 +585,7 @@ public static class ExcelExportHelper
|
||||||
|
|
||||||
for (int i = dynamicColunmStartIndex; i < dynamicColunmStartIndex + needAddCount; i++)
|
for (int i = dynamicColunmStartIndex; i < dynamicColunmStartIndex + needAddCount; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
var name = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].Name;
|
var name = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].Name;
|
||||||
|
|
||||||
titelRow.GetCell(i).SetCellValue(name);
|
titelRow.GetCell(i).SetCellValue(name);
|
||||||
|
|
@ -581,13 +593,15 @@ public static class ExcelExportHelper
|
||||||
|
|
||||||
if (isCdics)
|
if (isCdics)
|
||||||
{
|
{
|
||||||
var cdicsCode = dynamicColumnConfig.CDISCList[i - dynamicColunmStartIndex];
|
var cdicsCode = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].CDISCCode;
|
||||||
|
|
||||||
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
using (var memoryStream2 = new MemoryStream())
|
using (var memoryStream2 = new MemoryStream())
|
||||||
{
|
{
|
||||||
workbook.Write(memoryStream2, true);
|
workbook.Write(memoryStream2, true);
|
||||||
|
|
@ -610,8 +624,11 @@ public static class ExcelExportHelper
|
||||||
IgnoreTemplateParameterMissing = true,
|
IgnoreTemplateParameterMissing = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//await MiniExcel.SaveAsByTemplateAsync("testmini.xlsx", templateStream.ToArray(), translateData);
|
||||||
|
|
||||||
await MiniExcel.SaveAsByTemplateAsync(memoryStream, templateStream.ToArray(), translateData, config);
|
await MiniExcel.SaveAsByTemplateAsync(memoryStream, templateStream.ToArray(), translateData, config);
|
||||||
|
|
||||||
|
|
||||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
if (dynamicColumnConfig != null)
|
if (dynamicColumnConfig != null)
|
||||||
|
|
@ -908,7 +925,7 @@ public static class ExcelExportHelper
|
||||||
{
|
{
|
||||||
var name = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].Name;
|
var name = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].Name;
|
||||||
|
|
||||||
var cdicsCode = dynamicColumnConfig.CDISCList[i - dynamicColunmStartIndex];
|
var cdicsCode = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].CDISCCode;
|
||||||
|
|
||||||
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
||||||
titelRow.GetCell(i).SetCellValue(name);
|
titelRow.GetCell(i).SetCellValue(name);
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,54 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IActionResult> GetTrialVisitImageStatList_Export(TrialVisitImageQuery inQuery,
|
||||||
|
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
|
[FromServices] IRepository<Trial> _trialRepository,
|
||||||
|
[FromServices] IDictionaryService _dictionaryService)
|
||||||
|
{
|
||||||
|
var query = _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
|
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||||
|
.WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
||||||
|
.WhereIf(inQuery.BeginScanDate != null, t => t.LatestScanDate >= inQuery.BeginScanDate)
|
||||||
|
.WhereIf(inQuery.EndScanDate != null, t => t.LatestScanDate == inQuery.EndScanDate)
|
||||||
|
.Select(t => new TrialVisitImageStatView()
|
||||||
|
{
|
||||||
|
TrialId = t.TrialId,
|
||||||
|
SubjectVisitId = t.Id,
|
||||||
|
SubjectCode = t.Subject.Code,
|
||||||
|
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||||
|
TrialSiteId = t.TrialSiteId,
|
||||||
|
VisitName = t.VisitName,
|
||||||
|
VisitNum = t.VisitNum,
|
||||||
|
EarliestScanDate = t.EarliestScanDate,
|
||||||
|
LatestScanDate = t.LatestScanDate,
|
||||||
|
|
||||||
|
IsHaveDicom = t.StudyList.Any(),
|
||||||
|
|
||||||
|
IsHaveNoneDicom = t.NoneDicomStudyList.Any(),
|
||||||
|
|
||||||
|
|
||||||
|
TotalStudyCount = t.StudyList.Count() + t.NoneDicomStudyList.Count(),
|
||||||
|
|
||||||
|
TotalImageCount = t.StudyList.Sum(t => t.InstanceCount) + t.NoneDicomStudyList.Sum(t => t.FileCount),
|
||||||
|
|
||||||
|
TotalImageSize = t.StudyList.SelectMany(t => t.InstanceList).Sum(t => t.FileSize) + t.NoneDicomStudyList.SelectMany(t => t.NoneDicomFileList).Sum(t => t.FileSize),
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var list = await query.Where(t => t.TotalImageCount > 0).SortToListAsync(inQuery);
|
||||||
|
|
||||||
|
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||||
|
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||||
|
|
||||||
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TriaVisitImageStat_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialMaintenanceDTO));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#region 后续需要移动过来
|
#region 后续需要移动过来
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -716,6 +764,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
|
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
|
||||||
|
|
||||||
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||||
|
.Where(t => t.Subject.IsSubjectQuit == false || t.SubmitState >= SubmitStateEnum.ToSubmit)
|
||||||
|
|
||||||
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
.Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId)
|
.WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId)
|
||||||
|
|
@ -763,6 +813,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
{
|
{
|
||||||
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
|
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
|
||||||
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||||
|
|
||||||
|
.Where(t => t.Subject.IsSubjectQuit == false || t.AuditState > AuditStateEnum.ToAudit)
|
||||||
|
|
||||||
.WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId)
|
.WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId)
|
||||||
.WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId)
|
.WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId)
|
||||||
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
|
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
|
||||||
|
|
@ -1173,6 +1226,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||||
|
|
||||||
var dicomStudyQuery = _dicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId)
|
var dicomStudyQuery = _dicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId)
|
||||||
|
|
||||||
|
.Where(t => t.Subject.IsSubjectQuit == false || t.SubjectVisit.CheckState >= CheckStateEnum.CVIng)
|
||||||
|
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||||
|
|
@ -1201,6 +1257,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
|
|
||||||
var nodeDicomStudyQuery = _noneDicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId)
|
var nodeDicomStudyQuery = _noneDicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId)
|
||||||
|
|
||||||
|
.Where(t => t.Subject.IsSubjectQuit == false || t.SubjectVisit.CheckState >= CheckStateEnum.CVIng)
|
||||||
|
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
|
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||||
|
|
@ -1264,6 +1323,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
|
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
|
||||||
|
|
||||||
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
|
||||||
|
|
||||||
|
.Where(t => t.Subject.IsSubjectQuit == false || t.CheckState >= CheckStateEnum.CVIng)
|
||||||
|
|
||||||
.Where(x => x.AuditState == AuditStateEnum.QCPassed) //一致性核查中的,或者还没一致性核查的
|
.Where(x => x.AuditState == AuditStateEnum.QCPassed) //一致性核查中的,或者还没一致性核查的
|
||||||
.WhereIf(inQuery.CheckState != null, t => t.CheckState == inQuery.CheckState)
|
.WhereIf(inQuery.CheckState != null, t => t.CheckState == inQuery.CheckState)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||||
|
|
@ -1302,7 +1364,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
[FromServices] IRepository<Trial> _trialRepository)
|
[FromServices] IRepository<Trial> _trialRepository)
|
||||||
{
|
{
|
||||||
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
||||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||||
|
|
||||||
|
.Where(t => t.Subject.IsSubjectQuit == false || t.ReadingTaskState >= ReadingTaskState.Reading)
|
||||||
|
|
||||||
.WhereIf(inQuery.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
.WhereIf(inQuery.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||||
.WhereIf(inQuery.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
|
.WhereIf(inQuery.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
|
||||||
|
|
@ -1686,7 +1750,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
//.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
//.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||||
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
||||||
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
||||||
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
|
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeList.Any(c => c == inQuery.CriterionTypeEnum))
|
||||||
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
||||||
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
||||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||||
|
|
@ -1827,7 +1891,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
//两个人都做了
|
//两个人都做了
|
||||||
if (resultExceptJudgeList.Count(t => t.VisitTaskNum == item.VisitTaskNum && t.SubjectCode == item.SubjectCode) == 2)
|
if (resultExceptJudgeList.Where(t => t.VisitTaskNum == item.VisitTaskNum && t.SubjectCode == item.SubjectCode).Select(t => t.ArmEnum).Distinct().Count() == 2)
|
||||||
{
|
{
|
||||||
//如果没有产生裁判,默认选择R1
|
//如果没有产生裁判,默认选择R1
|
||||||
if (item.ArmEnum == Arm.DoubleReadingArm1)
|
if (item.ArmEnum == Arm.DoubleReadingArm1)
|
||||||
|
|
@ -1882,6 +1946,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
//已完成的全局数量
|
//已完成的全局数量
|
||||||
finishedGlobalCount = resultExceptJudgeList.Where(t => t.SubjectCode == visitItem.SubjectCode && subjectReadingPeriondVisitNumList.Any(c => (c + addReadingPeriodNum) == t.VisitTaskNum)
|
finishedGlobalCount = resultExceptJudgeList.Where(t => t.SubjectCode == visitItem.SubjectCode && subjectReadingPeriondVisitNumList.Any(c => (c + addReadingPeriodNum) == t.VisitTaskNum)
|
||||||
/*&& t.ReadingCategory == ReadingCategory.Global*/)
|
/*&& t.ReadingCategory == ReadingCategory.Global*/)
|
||||||
|
.Select(t => new { t.VisitTaskNum, t.ArmEnum }).Distinct()
|
||||||
.GroupBy(t => t.VisitTaskNum).Where(g => g.Count() == 2).Select(g => g.Key).Count();
|
.GroupBy(t => t.VisitTaskNum).Where(g => g.Count() == 2).Select(g => g.Key).Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1895,7 +1960,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
var subjectMaxFinishedGlobalTaskNum = resultExceptJudgeList.Where(t => t.SubjectCode == visitItem.SubjectCode && subjectReadingPeriondVisitNumList.Any(c => (c + addReadingPeriodNum) == t.VisitTaskNum)
|
var subjectMaxFinishedGlobalTaskNum = resultExceptJudgeList.Where(t => t.SubjectCode == visitItem.SubjectCode && subjectReadingPeriondVisitNumList.Any(c => (c + addReadingPeriodNum) == t.VisitTaskNum)
|
||||||
/*&& t.ReadingCategory == ReadingCategory.Global*/)
|
/*&& t.ReadingCategory == ReadingCategory.Global*/)
|
||||||
.GroupBy(t => t.VisitTaskNum).Where(g => g.Count() == 2).Select(g => g.Key).DefaultIfEmpty().Max();
|
.Select(t => new { t.VisitTaskNum, t.ArmEnum }).Distinct()
|
||||||
|
.GroupBy(t => t.VisitTaskNum).Where(g => g.Count() == 2).Select(g => g.Key).DefaultIfEmpty().Max();
|
||||||
|
|
||||||
//最大的完成的全局是否产生裁判
|
//最大的完成的全局是否产生裁判
|
||||||
if (subjectJudgeList.Any(t => t.VisitTaskNum == (subjectMaxFinishedGlobalTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge])))
|
if (subjectJudgeList.Any(t => t.VisitTaskNum == (subjectMaxFinishedGlobalTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge])))
|
||||||
|
|
@ -2505,15 +2571,34 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
// CDISC 导出 只管到 外层问题层级 和阅片结果表是保持一致
|
// CDISC 导出 只管到 外层问题层级 和阅片结果表是保持一致
|
||||||
else if (inQuery.ReadingExportType == ExportResult.CDISC)
|
else if (inQuery.ReadingExportType == ExportResult.CDISC)
|
||||||
{
|
{
|
||||||
list = await query.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider,
|
|
||||||
new
|
if (criterion.CriterionType == CriterionType.SelfDefine)
|
||||||
{
|
{
|
||||||
readingExportType = inQuery.ReadingExportType,
|
taskList = await query.ProjectTo<CommonLessionExport>(_mapper.ConfigurationProvider,
|
||||||
criterionType = criterion.CriterionType,
|
new
|
||||||
arbitrationRule = criterion.ArbitrationRule,
|
{
|
||||||
trialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
readingExportType = inQuery.ReadingExportType,
|
||||||
isEn_Us = _userInfo.IsEn_Us
|
criterionType = criterion.CriterionType,
|
||||||
}).ToListAsync();
|
arbitrationRule = criterion.ArbitrationRule,
|
||||||
|
trialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
||||||
|
isEn_Us = _userInfo.IsEn_Us
|
||||||
|
}).ToListAsync();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
list = await query.ProjectTo<CommonEvaluationExport>(_mapper.ConfigurationProvider,
|
||||||
|
new
|
||||||
|
{
|
||||||
|
readingExportType = inQuery.ReadingExportType,
|
||||||
|
criterionType = criterion.CriterionType,
|
||||||
|
arbitrationRule = criterion.ArbitrationRule,
|
||||||
|
trialReadingCriterionId = inQuery.TrialReadingCriterionId,
|
||||||
|
isEn_Us = _userInfo.IsEn_Us
|
||||||
|
}).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2786,7 +2871,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
//多表格,增加的一列,就用Guid.Empty 标识
|
//多表格,增加的一列,就用Guid.Empty 标识
|
||||||
var extralNameList = new List<DynamicColumnConfig.ColumItem>() { new DynamicColumnConfig.ColumItem() { Id = Guid.Empty, Name = _userInfo.IsEn_Us ? "Table Name" : "表格名称" } };
|
var extralNameList = new List<DynamicColumnConfig.ColumItem>() { new DynamicColumnConfig.ColumItem() { Id = Guid.Empty, Name = _userInfo.IsEn_Us ? "Table Name" : "表格名称" } };
|
||||||
|
|
||||||
var tableQuestionNameList = trialConfigTableQuestionList.Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.TableName + "_" + t.QuestionName }).ToList();
|
var tableQuestionNameList = trialConfigTableQuestionList.OrderBy(t => t.TableName).Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.TableName + "_" + t.QuestionName }).ToList();
|
||||||
|
|
||||||
configCoumNameList = fistLeveLNameList.Union(extralNameList).Union(tableQuestionNameList).ToList();
|
configCoumNameList = fistLeveLNameList.Union(extralNameList).Union(tableQuestionNameList).ToList();
|
||||||
}
|
}
|
||||||
|
|
@ -2876,7 +2961,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
DynamicListName = "QuestionAnswerList",
|
DynamicListName = "QuestionAnswerList",
|
||||||
RemoveColunmIndexList = removeColumnIndexList,
|
RemoveColunmIndexList = removeColumnIndexList,
|
||||||
ColumnIdNameList = configCoumNameList,
|
ColumnIdNameList = configCoumNameList,
|
||||||
CDISCList = new List<string>(),
|
//CDISCList = new List<string>(),
|
||||||
TranslateDicNameList = translateDicNameList
|
TranslateDicNameList = translateDicNameList
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2963,6 +3048,23 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dynamicColumnConfig = new DynamicColumnConfig()
|
||||||
|
{
|
||||||
|
AutoColumnTitleRowIndex = 1,
|
||||||
|
AutoColumnStartIndex = 6,
|
||||||
|
TempalteLastColumnIndex = 10,
|
||||||
|
DynamicItemDicName = "TranslateDicName",
|
||||||
|
DynamicItemValueName = "QuestionValue",
|
||||||
|
DynamicItemTitleName = "QuestionName",
|
||||||
|
DynamicItemTitleId = "QuestionId",
|
||||||
|
DynamicListName = "QuestionAnswerList",
|
||||||
|
RemoveColunmIndexList = removeColumnIndexList,
|
||||||
|
ColumnIdNameList = configCoumNameList,
|
||||||
|
IsCDISCExport = true,
|
||||||
|
//CDISCList = cdiscCodeList,
|
||||||
|
TranslateDicNameList = translateDicNameList
|
||||||
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -3004,8 +3106,8 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
cloneItem.Group = lessionItem.TableName;
|
cloneItem.Group = lessionItem.TableName;
|
||||||
cloneItem.TRLINKID = lessionItem.RowId.ToString();
|
cloneItem.TRLINKID = lessionItem.RowId.ToString();
|
||||||
cloneItem.TRORRES = lessionItem.CDISCCode;
|
cloneItem.TRORRES = lessionItem.QuestionValue;
|
||||||
cloneItem.TRTEST = lessionItem.QuestionValue;
|
cloneItem.TRTEST = lessionItem.CDISCCode;
|
||||||
cloneItem.TRORRESU = unitText;
|
cloneItem.TRORRESU = unitText;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3032,16 +3134,46 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dynamicColumnConfig = new DynamicColumnConfig()
|
||||||
|
{
|
||||||
|
AutoColumnTitleRowIndex = 1,
|
||||||
|
AutoColumnStartIndex = 6,
|
||||||
|
TempalteLastColumnIndex = 15,
|
||||||
|
DynamicItemDicName = "TranslateDicName",
|
||||||
|
DynamicItemValueName = "QuestionValue",
|
||||||
|
DynamicItemTitleName = "QuestionName",
|
||||||
|
DynamicItemTitleId = "QuestionId",
|
||||||
|
DynamicListName = "QuestionAnswerList",
|
||||||
|
RemoveColunmIndexList = removeColumnIndexList,
|
||||||
|
ColumnIdNameList = configCoumNameList,
|
||||||
|
IsCDISCExport = true,
|
||||||
|
//CDISCList = cdiscCodeList,
|
||||||
|
TranslateDicNameList = translateDicNameList
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//CDISC 导出 只到外层问题级别 使用Id 填充Excel
|
||||||
|
|
||||||
|
var totalConfigCoumNameList = trialConfigQuestionList.ToList();
|
||||||
|
|
||||||
|
var configCoumNameList = totalConfigCoumNameList.Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.QuestionName, CDISCCode = t.CDISCCode }).ToList();
|
||||||
|
|
||||||
|
var translateDicList = totalConfigCoumNameList.Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Distinct().ToList();
|
||||||
|
|
||||||
|
var cdiscCodeList = totalConfigCoumNameList.Select(t => t.CDISCCode).ToList();
|
||||||
|
|
||||||
dynamicColumnConfig = new DynamicColumnConfig()
|
dynamicColumnConfig = new DynamicColumnConfig()
|
||||||
{
|
{
|
||||||
AutoColumnTitleRowIndex = 1,
|
AutoColumnTitleRowIndex = 1,
|
||||||
AutoColumnStartIndex = 6,
|
AutoColumnStartIndex = 6,
|
||||||
TempalteLastColumnIndex = 15,
|
TempalteLastColumnIndex = 10,
|
||||||
DynamicItemDicName = "TranslateDicName",
|
DynamicItemDicName = "TranslateDicName",
|
||||||
DynamicItemValueName = "QuestionValue",
|
DynamicItemValueName = "QuestionValue",
|
||||||
DynamicItemTitleName = "QuestionName",
|
DynamicItemTitleName = "QuestionName",
|
||||||
|
|
@ -3051,38 +3183,14 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
ColumnIdNameList = configCoumNameList,
|
ColumnIdNameList = configCoumNameList,
|
||||||
IsCDISCExport = true,
|
IsCDISCExport = true,
|
||||||
//CDISCList = cdiscCodeList,
|
//CDISCList = cdiscCodeList,
|
||||||
TranslateDicNameList = translateDicNameList
|
TranslateDicNameList = translateDicList
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
//CDISC 导出 只到外层问题级别 使用Id 填充Excel
|
|
||||||
|
|
||||||
var totalConfigCoumNameList = trialConfigQuestionList.ToList();
|
|
||||||
|
|
||||||
var configCoumNameList = totalConfigCoumNameList.Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.QuestionName }).ToList();
|
|
||||||
|
|
||||||
var translateDicList = totalConfigCoumNameList.Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Distinct().ToList();
|
|
||||||
|
|
||||||
var cdiscCodeList = totalConfigCoumNameList.Select(t => t.CDISCCode).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
dynamicColumnConfig = new DynamicColumnConfig()
|
|
||||||
{
|
|
||||||
AutoColumnTitleRowIndex = 1,
|
|
||||||
AutoColumnStartIndex = 6,
|
|
||||||
TempalteLastColumnIndex = 10,
|
|
||||||
DynamicItemDicName = "TranslateDicName",
|
|
||||||
DynamicItemValueName = "QuestionValue",
|
|
||||||
DynamicItemTitleName = "QuestionName",
|
|
||||||
DynamicItemTitleId = "QuestionId",
|
|
||||||
DynamicListName = "QuestionAnswerList",
|
|
||||||
RemoveColunmIndexList = removeColumnIndexList,
|
|
||||||
ColumnIdNameList = configCoumNameList,
|
|
||||||
CDISCList = cdiscCodeList,
|
|
||||||
TranslateDicNameList = translateDicList
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue