diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs index 377660e19..175e7fbe2 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs @@ -81,6 +81,37 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } File.Delete(filePath); + + // 创建一个要删除的行集合 + var rowsToRemove = new System.Collections.Generic.List(); + + // 遍历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; } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs index db2528d6a..226e8d6a4 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs @@ -620,22 +620,33 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate List measuredValueList = new List(); - try - { + for (int i = 3; i < dataTable.Rows.Count; i++) { - measuredValueList.Add(new IVUSMeasuredValue() + IVUSMeasuredValue iVUSMeasuredValue = new IVUSMeasuredValue() { }; + try { - PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()), - Emm = decimal.Parse(dataTable.Rows[i]["B"].ToString()), - Lumen = decimal.Parse(dataTable.Rows[i]["C"].ToString()), - }); + iVUSMeasuredValue = new IVUSMeasuredValue() + { + PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()), + Emm = decimal.Parse(dataTable.Rows[i]["B"].ToString()), + Lumen = decimal.Parse(dataTable.Rows[i]["C"].ToString()), + }; + } + catch (Exception) + { + + throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]); + } + + if (iVUSMeasuredValue.Emm <= iVUSMeasuredValue.Lumen) + { + throw new BusinessValidationFailedException(_localizer["IVUS_EmmBiggerThenLumen"]); + } + measuredValueList.Add(iVUSMeasuredValue); } - } - catch (Exception) - { - throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]); - } + measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList(); + 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(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs index 616e6bb05..5079a850a 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs @@ -499,6 +499,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ThirdData = int.Parse(dataTable.Rows[i]["D"].ToString()), }); } + measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList(); } catch (Exception) { @@ -673,6 +674,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }); } + + measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList(); } catch (Exception) {