From 228c303ab926ac60e07f0d4a4b7577422d7307b4 Mon Sep 17 00:00:00 2001
From: "DESKTOP-G961P6V\\Zhh" <839860190@qq.com>
Date: Mon, 22 Apr 2024 00:02:55 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BD=93=E6=A3=80=E6=8A=A5=E5=91=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 .../PrintReports/MedicalReportDto.cs          | 23 +++++++--
 .../PrintReports/PrintReportAppService.cs     | 50 +++++++++++++++----
 .../ItemTypes/ItemTypeManager.cs              |  2 +-
 3 files changed, 60 insertions(+), 15 deletions(-)
diff --git a/src/Shentun.Peis.Application.Contracts/PrintReports/MedicalReportDto.cs b/src/Shentun.Peis.Application.Contracts/PrintReports/MedicalReportDto.cs
index f865006..626632e 100644
--- a/src/Shentun.Peis.Application.Contracts/PrintReports/MedicalReportDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/PrintReports/MedicalReportDto.cs
@@ -129,8 +129,11 @@ namespace Shentun.Peis.PrintReports
         /// 
         public string MedicalCenterTelphone { get; set; }
         #endregion
-
-
+        /// 
+        /// 体检报告类别
+        /// 
+        public List MedicalReportTypes { get; set; } = new List();
+        public List ItemTypes { get; set; } = new List();
         #endregion
         /// 
         /// 综述
@@ -145,6 +148,8 @@ namespace Shentun.Peis.PrintReports
         /// 
         public List RegisterChecks { get; set; }
 
+
+
     }
     /// 
     /// 综述
@@ -370,8 +375,20 @@ namespace Shentun.Peis.PrintReports
     /// 
     public class MedicalReportItemTypeDto
     {
-        public char ItemTypeId { get; set; }
+        /// 
+        /// 项目类别编号
+        /// 
+        public Guid ItemTypeId { get; set; }
+        /// 
+        /// 项目类别多级编码
+        /// 
+        public string PathCode { get; set; }
+        /// 
+        /// 项目类别名
+        /// 
         public string ItemTypeName { get; set; }
+
+        public char IsTop { get; set; }
         /// 
         /// 显示顺序
         /// 
diff --git a/src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs b/src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
index 2160c40..0d9df2a 100644
--- a/src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
+++ b/src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
@@ -305,17 +305,9 @@ namespace Shentun.Peis.PrintReports
             #endregion
             var resultStatusList = (await _resultStatusRepository.GetListAsync());
             //获取体检报告类别
-            var medicalReportTypes = (await _medicalReportTypeRepository.GetListAsync()).OrderBy(o=>o.DisplayOrder);
-            var MedicalReportMedicalReportTypeDtos = new List();
-            foreach (var medicalReportType in medicalReportTypes)
-            {
-                MedicalReportMedicalReportTypeDtos.Add(new MedicalReportMedicalReportTypeDto()
-                {
-                    MedicalReportTypeId = medicalReportType.Id,
-                    MedicalReportTypeName = medicalReportType.DisplayName,
-                    DisplayOrder = medicalReportType.DisplayOrder,
-                });
-            }
+            medicalReportDto.MedicalReportTypes = await GetMedicalReportTypeList();
+            //获取项目类别
+            medicalReportDto.ItemTypes = await GetItemTypeList();
             #region 综述
 
             var sumSummarylist = (await _sumSummaryHeaderRepository.GetDbSetAsync())
@@ -480,5 +472,41 @@ namespace Shentun.Peis.PrintReports
             return await _chargeReportRepository.GetChargeReportAsync(ChargeId);
         }
 
+        private async Task> GetItemTypeList()
+        {
+            var itemTypes = await _itemTypeRepository.GetListAsync();
+            var medicalReportItemTypeDtos = new List();
+            foreach (var itemType in itemTypes)
+            {
+                var medicalReportItemTypeDto = new MedicalReportItemTypeDto()
+                {
+                    ItemTypeId = itemType.Id,
+                    ItemTypeName = itemType.DisplayName,
+                    PathCode = itemType.PathCode,
+                    DisplayOrder = itemType.DisplayOrder,
+                    IsTop = 'N'
+                };
+                if(itemType.PathCode.Length <= 5)
+                {
+                    medicalReportItemTypeDto.IsTop = 'Y';
+                }
+            }
+            return medicalReportItemTypeDtos;
+        }
+        private async Task> GetMedicalReportTypeList()
+        {
+            var medicalReportTypes = (await _medicalReportTypeRepository.GetListAsync()).OrderBy(o => o.DisplayOrder);
+            var MedicalReportMedicalReportTypeDtos = new List();
+            foreach (var medicalReportType in medicalReportTypes)
+            {
+                MedicalReportMedicalReportTypeDtos.Add(new MedicalReportMedicalReportTypeDto()
+                {
+                    MedicalReportTypeId = medicalReportType.Id,
+                    MedicalReportTypeName = medicalReportType.DisplayName,
+                    DisplayOrder = medicalReportType.DisplayOrder,
+                });
+            }
+            return MedicalReportMedicalReportTypeDtos;
+        }
     }
 }
diff --git a/src/Shentun.Peis.Domain/ItemTypes/ItemTypeManager.cs b/src/Shentun.Peis.Domain/ItemTypes/ItemTypeManager.cs
index faef189..308d542 100644
--- a/src/Shentun.Peis.Domain/ItemTypes/ItemTypeManager.cs
+++ b/src/Shentun.Peis.Domain/ItemTypes/ItemTypeManager.cs
@@ -229,6 +229,6 @@ namespace Shentun.Peis.ItemTypes
             return itmeTypeIds;
         }
 
-
+       
     }
 }