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
5e046b847d
|
@ -260,7 +260,9 @@ public static class ExcelExportHelper
|
|||
/// </summary>
|
||||
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>
|
||||
/// 动态的列名 如果Id 重复,那么就按照名称填充,否则就按照Id 填充列数据
|
||||
|
@ -301,6 +303,8 @@ public static class ExcelExportHelper
|
|||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public string CDISCCode { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is not ColumItem other) return false;
|
||||
|
@ -489,7 +493,9 @@ public static class ExcelExportHelper
|
|||
|
||||
if (dynamicColumnConfig != null)
|
||||
{
|
||||
var isCdics = dynamicColumnConfig.CDISCList.Count > 0;
|
||||
//var isCdics = dynamicColumnConfig.CDISCList.Count > 0;
|
||||
|
||||
var isCdics = dynamicColumnConfig.IsCDISCExport;
|
||||
|
||||
var sheet = workbook.GetSheetAt(0);
|
||||
|
||||
|
@ -546,7 +552,7 @@ public static class ExcelExportHelper
|
|||
//创建新的列
|
||||
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
|
||||
{
|
||||
|
||||
|
||||
titelRow.CreateCell(i + 1);
|
||||
templateRow.CreateCell(i + 1);
|
||||
|
||||
|
@ -565,6 +571,11 @@ public static class ExcelExportHelper
|
|||
titelRow.GetCell(i).SetCellValue(titelRow.GetCell(i - gap).StringCellValue);
|
||||
|
||||
templateRow.GetCell(i).SetCellValue(templateRow.GetCell(i - gap).StringCellValue);
|
||||
|
||||
if (isCdics)
|
||||
{
|
||||
cdicsRow.GetCell(i).SetCellValue(cdicsRow.GetCell(i - gap).StringCellValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -580,7 +591,7 @@ public static class ExcelExportHelper
|
|||
|
||||
if (isCdics)
|
||||
{
|
||||
var cdicsCode = dynamicColumnConfig.CDISCList[i - dynamicColunmStartIndex];
|
||||
var cdicsCode = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].CDISCCode;
|
||||
|
||||
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
||||
}
|
||||
|
@ -907,7 +918,7 @@ public static class ExcelExportHelper
|
|||
{
|
||||
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);
|
||||
titelRow.GetCell(i).SetCellValue(name);
|
||||
|
|
|
@ -2479,15 +2479,34 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
// CDISC 导出 只管到 外层问题层级 和阅片结果表是保持一致
|
||||
else if (inQuery.ReadingExportType == ExportResult.CDISC)
|
||||
{
|
||||
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();
|
||||
|
||||
if (criterion.CriterionType == CriterionType.SelfDefine)
|
||||
{
|
||||
taskList = await query.ProjectTo<CommonLessionExport>(_mapper.ConfigurationProvider,
|
||||
new
|
||||
{
|
||||
readingExportType = inQuery.ReadingExportType,
|
||||
criterionType = criterion.CriterionType,
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -2546,7 +2565,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
QuestionName = _userInfo.IsEn_Us ? t.QuestionEnName : t.QuestionName,
|
||||
CDISCCode = t.CDISCCode,
|
||||
TranslateDicName = t.DictionaryCode
|
||||
}).Distinct().ToList();
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
|
@ -2850,11 +2869,11 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
DynamicListName = "QuestionAnswerList",
|
||||
RemoveColunmIndexList = removeColumnIndexList,
|
||||
ColumnIdNameList = configCoumNameList,
|
||||
CDISCList = new List<string>(),
|
||||
//CDISCList = new List<string>(),
|
||||
TranslateDicNameList = translateDicNameList
|
||||
};
|
||||
|
||||
if(export_Template == StaticData.Export.ReadingLession_Export || export_Template == StaticData.Export.CommonJudgeReadingDetail_Export)
|
||||
if (export_Template == StaticData.Export.ReadingLession_Export || export_Template == StaticData.Export.CommonJudgeReadingDetail_Export)
|
||||
{
|
||||
dynamicColumnConfig.TempalteLastColumnIndex = 8;
|
||||
}
|
||||
|
@ -2863,32 +2882,171 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
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()
|
||||
if (criterion.CriterionType == CriterionType.SelfDefine)
|
||||
{
|
||||
AutoColumnTitleRowIndex = 1,
|
||||
AutoColumnStartIndex = 6,
|
||||
TempalteLastColumnIndex = 10,
|
||||
DynamicItemDicName = "TranslateDicName",
|
||||
DynamicItemValueName = "QuestionValue",
|
||||
DynamicItemTitleName = "QuestionName",
|
||||
DynamicItemTitleId = "QuestionId",
|
||||
DynamicListName = "QuestionAnswerList",
|
||||
RemoveColunmIndexList = removeColumnIndexList,
|
||||
ColumnIdNameList = configCoumNameList,
|
||||
CDISCList = cdiscCodeList,
|
||||
TranslateDicNameList = translateDicList
|
||||
};
|
||||
//最终EXCEL 列
|
||||
var configCoumNameList = new List<DynamicColumnConfig.ColumItem>();
|
||||
|
||||
//表格全问题名
|
||||
var trialConfigTableQuestionList = _trialReadingTableQuestionRepository.Where(t => t.TrialId == trialId && t.TrialCriterionId == trialReadingCriterionId).Where(t => t.ExportResultStr.Contains(((int)inQuery.ReadingExportType).ToString()))
|
||||
.Select(t => new ExportQuestionBasicInfo()
|
||||
{
|
||||
QuestionId = t.Id,
|
||||
TableName = _userInfo.IsEn_Us ? t.ReadingQuestionTrial.QuestionEnName : t.ReadingQuestionTrial.QuestionName,
|
||||
QuestionName = _userInfo.IsEn_Us ? t.QuestionEnName : t.QuestionName,
|
||||
CDISCCode = t.CDISCCode,
|
||||
TranslateDicName = t.DictionaryCode,
|
||||
ShowOrder = t.ShowOrder
|
||||
}).OrderBy(t => t.TableName).ThenBy(t => t.ShowOrder).ToList();
|
||||
|
||||
//外层问题处理
|
||||
var fistLeveLNameList = trialConfigQuestionList.Select(t => new DynamicColumnConfig.ColumItem()
|
||||
{
|
||||
Id = t.QuestionId,
|
||||
Name = t.QuestionName,
|
||||
CDISCCode = t.CDISCCode
|
||||
}).ToList();
|
||||
|
||||
var translateDicNameList = trialConfigQuestionList.Union(trialConfigTableQuestionList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Distinct().ToList();
|
||||
|
||||
#region 表格问题处理 问题名称是 表格名称_表格子问题名
|
||||
|
||||
var isMutiTable = trialConfigTableQuestionList.Select(t => t.TableName).Distinct().Count() > 1;
|
||||
|
||||
//多表格问题
|
||||
if (isMutiTable)
|
||||
{
|
||||
//多表格,增加的一列,就用Guid.Empty 标识
|
||||
//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, CDISCCode = t.CDISCCode }).ToList();
|
||||
|
||||
configCoumNameList = fistLeveLNameList/*.Union(extralNameList)*/.Union(tableQuestionNameList).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
//单表格问题(直接用表格问题名称) 或者没有表格问题
|
||||
|
||||
var tableNameList = trialConfigTableQuestionList.Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.QuestionName, CDISCCode = t.CDISCCode }).ToList();
|
||||
|
||||
configCoumNameList = fistLeveLNameList.Union(tableNameList).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#region 扩展表格问题
|
||||
|
||||
|
||||
//最终的病灶列表 要把裁判的也要加进去,需要处理裁判标记
|
||||
foreach (var item in taskList.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum))
|
||||
{
|
||||
//有病灶,并且至少配置了一个病灶问题
|
||||
if (item.LesionList.Count > 0 && item.LesionList.SelectMany(t => t.LessionAnswerList).Any())
|
||||
{
|
||||
foreach (var lession in item.LesionList.OrderBy(t => t.LessionType).ThenBy(t => t.LessionCode))
|
||||
{
|
||||
//病灶配置了问题 才进行导出
|
||||
if (lession.LessionAnswerList.Count > 0)
|
||||
{
|
||||
var firstLessionAnser = lession.LessionAnswerList.FirstOrDefault();
|
||||
|
||||
var dynamicLessionInfoList = new List<CommonQuesionInfo>();
|
||||
|
||||
if (isMutiTable)
|
||||
{
|
||||
var addLessionInfoList = new List<CommonQuesionInfo>();
|
||||
|
||||
//addLessionInfoList.Add(new CommonQuesionInfo() { QuestionId = Guid.Empty, QuestionName = _userInfo.IsEn_Us ? "Table Name" : "表格名称", QuestionValue = firstLessionAnser.TableName });
|
||||
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionId = t.TableQuesionId, QuestionName = t.TableName + "_" + t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode });
|
||||
|
||||
//有三部分组成 外层问题+ 固定列表格名称 + 动态的表格问题
|
||||
dynamicLessionInfoList = item.QuestionAnswerList.Union(addLessionInfoList).Union(dynamicPartialLessionInfoList).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionId = t.TableQuesionId, QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode });
|
||||
|
||||
//两部分组成 外层问题+ 动态的表格问题
|
||||
dynamicLessionInfoList = item.QuestionAnswerList.Union(dynamicPartialLessionInfoList).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//要把裁判任务加进去 裁判任务上没有病灶
|
||||
|
||||
list.Add(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
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
|
||||
{
|
||||
//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()
|
||||
{
|
||||
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 = translateDicList
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1220,6 +1220,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string CDISCCode { get; set; }
|
||||
|
||||
public string GroupName { get; set; }
|
||||
|
||||
public int ShowOrder { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue