导入修改
parent
21925f6d88
commit
aca261ace2
|
@ -81,6 +81,37 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
File.Delete(filePath);
|
File.Delete(filePath);
|
||||||
|
|
||||||
|
// 创建一个要删除的行集合
|
||||||
|
var rowsToRemove = new System.Collections.Generic.List<DataRow>();
|
||||||
|
|
||||||
|
// 遍历DataTable的每一行
|
||||||
|
foreach (DataRow row in result.Rows)
|
||||||
|
{
|
||||||
|
bool allEmpty = true;
|
||||||
|
|
||||||
|
// 遍历每一列,检查值
|
||||||
|
foreach (var item in row.ItemArray)
|
||||||
|
{
|
||||||
|
if (item!=null&&!item.ToString().IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
allEmpty = false;
|
||||||
|
break; // 只要有一个不为空,跳出循环
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果所有列都是空字符串,则添加到待删除的行集合中
|
||||||
|
if (allEmpty)
|
||||||
|
{
|
||||||
|
rowsToRemove.Add(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移除标记为待删除的行
|
||||||
|
foreach (var row in rowsToRemove)
|
||||||
|
{
|
||||||
|
result.Rows.Remove(row);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -620,23 +620,34 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (int i = 3; i < dataTable.Rows.Count; i++)
|
for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
measuredValueList.Add(new IVUSMeasuredValue()
|
IVUSMeasuredValue iVUSMeasuredValue = new IVUSMeasuredValue() { };
|
||||||
|
try
|
||||||
|
{
|
||||||
|
iVUSMeasuredValue = new IVUSMeasuredValue()
|
||||||
{
|
{
|
||||||
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
Emm = decimal.Parse(dataTable.Rows[i]["B"].ToString()),
|
Emm = decimal.Parse(dataTable.Rows[i]["B"].ToString()),
|
||||||
Lumen = decimal.Parse(dataTable.Rows[i]["C"].ToString()),
|
Lumen = decimal.Parse(dataTable.Rows[i]["C"].ToString()),
|
||||||
});
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
||||||
throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (iVUSMeasuredValue.Emm <= iVUSMeasuredValue.Lumen)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["IVUS_EmmBiggerThenLumen"]);
|
||||||
|
}
|
||||||
|
measuredValueList.Add(iVUSMeasuredValue);
|
||||||
|
}
|
||||||
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
|
|
||||||
|
|
||||||
var questionInfo = await _readingQuestionTrialRepository.Where(x =>x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId&& x.LesionType == LesionType.MatchValues).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x =>x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId&& x.LesionType == LesionType.MatchValues).FirstNotNullAsync();
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
||||||
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
|
|
|
@ -499,6 +499,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
ThirdData = int.Parse(dataTable.Rows[i]["D"].ToString()),
|
ThirdData = int.Parse(dataTable.Rows[i]["D"].ToString()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
@ -673,6 +674,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue