diff --git a/src/Shentun.Peis.Application.Contracts/PacsBusiness/ImportRegisterCheckPictureByCheckRequestNoInputDto.cs b/src/Shentun.Peis.Application.Contracts/PacsBusiness/ImportRegisterCheckPictureByCheckRequestNoInputDto.cs index e3a24a9..0d699be 100644 --- a/src/Shentun.Peis.Application.Contracts/PacsBusiness/ImportRegisterCheckPictureByCheckRequestNoInputDto.cs +++ b/src/Shentun.Peis.Application.Contracts/PacsBusiness/ImportRegisterCheckPictureByCheckRequestNoInputDto.cs @@ -25,5 +25,10 @@ namespace Shentun.Peis.PacsBusiness /// 是否打印 /// public char IsPrint { get; set; } = 'Y'; + + /// + /// 图片文件类型 0-仪器图片,1-报告文件,默认是0 + /// + public char PictureFileType { get; set; } = '0'; } } diff --git a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs index 4626cf3..1e1d516 100644 --- a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs +++ b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs @@ -1049,6 +1049,7 @@ namespace Shentun.Peis.CustomerReports string documentUrl = _customerOrgReportManager.CreateCustomerOrgPeisFromTemplate(documentData); + return new GetUnitPhysicalExaminationReportExportWordDto { ReportUrl = documentUrl diff --git a/src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs b/src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs index 79d43d0..92702b3 100644 --- a/src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs +++ b/src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs @@ -2,6 +2,7 @@ using Shentun.Peis.CustomerOrgs; using Shentun.Peis.Enums; using Shentun.Peis.Models; +using Shentun.Peis.SysParmValues; using System; using System.Collections.Generic; using System.Drawing; @@ -36,6 +37,7 @@ namespace Shentun.Peis.ReportTemplates private readonly IRepository _diagnosisRepository; private readonly IRepository _suggestionRepository; private readonly string DirectoryName = System.AppDomain.CurrentDomain.BaseDirectory + @"\ReportFile"; + private readonly SysParmValueManager _sysParmValueManager; public CustomerOrgReportManager( IRepository patientRegisterRepository, @@ -51,7 +53,8 @@ namespace Shentun.Peis.ReportTemplates IRepository customerOrgRepository, CacheService cacheService, IRepository diagnosisRepository, - IRepository suggestionRepository) + IRepository suggestionRepository, + SysParmValueManager sysParmValueManager) { _patientRegisterRepository = patientRegisterRepository; _customerOrgManager = customerOrgManager; @@ -67,6 +70,7 @@ namespace Shentun.Peis.ReportTemplates _cacheService = cacheService; _diagnosisRepository = diagnosisRepository; _suggestionRepository = suggestionRepository; + _sysParmValueManager = sysParmValueManager; } @@ -76,6 +80,9 @@ namespace Shentun.Peis.ReportTemplates /// public string CreateCustomerOrgPeisFromTemplate(UnitPhysicalExaminationReportExportWordData documentData) { + + + DocX template = DocX.Load(DirectoryName + @"\CustomerOrgTemplate\单位体检报告模板.docx"); template.DifferentFirstPage = true; template.AddHeaders(); @@ -218,7 +225,7 @@ namespace Shentun.Peis.ReportTemplates table4.Rows[rowIndex].Cells[7].Paragraphs[0].Append(item.TotalSumCheckNumber.ToString()); table4.Rows[rowIndex].Cells[8].Paragraphs[0].Append(item.MaleAsbitemCheckRatio.ToString()); table4.Rows[rowIndex].Cells[9].Paragraphs[0].Append(item.FemaleAsbitemCheckRatio.ToString()); - table4.Rows[rowIndex].Cells[10].Paragraphs[0].Append(item.TotalAsbitemCheckRatio.ToString()); + //table4.Rows[rowIndex].Cells[10].Paragraphs[0].Append(item.TotalAsbitemCheckRatio.ToString()); rowIndex++; if (rowIndex - 2 < table4Data.Count) table4.InsertRow(); @@ -265,7 +272,7 @@ namespace Shentun.Peis.ReportTemplates table6.Rows[rowIndex].Cells[4].Paragraphs[0].Append(item.TotalNumber.ToString()); table6.Rows[rowIndex].Cells[5].Paragraphs[0].Append(item.MaleRatio); table6.Rows[rowIndex].Cells[6].Paragraphs[0].Append(item.FemaleRatio); - table6.Rows[rowIndex].Cells[7].Paragraphs[0].Append(""); + //table6.Rows[rowIndex].Cells[7].Paragraphs[0].Append(""); // table6.Rows[rowIndex].Cells[7].Paragraphs[0].Append(item.AverageRatio); rowIndex++; if (rowIndex - 2 < table6Data.Count) table6.InsertRow(); @@ -378,10 +385,12 @@ namespace Shentun.Peis.ReportTemplates /// /// 创建模板 /// - public void CreateCustomerOrgPeisTemplate() + public async void CreateCustomerOrgPeisTemplate() { - DocX document = DocX.Create(DirectoryName + @"\CustomerOrgTemplate\单位体检报告模板.docx"); + string medicalCenterName = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "medical_center_name"); + + DocX document = DocX.Create(DirectoryName + @"\CustomerOrgTemplate\单位体检报告模板.docx"); //第一页 Table p1Titletable = document.AddTable(1, 2); @@ -490,7 +499,7 @@ namespace Shentun.Peis.ReportTemplates List rowsFootTable = p1FootTable.Rows; Row row0Foot = rowsFootTable[0]; - row0Foot.Cells[0].Paragraphs[0].Append("医院体检中心 编制", p1TableContentFormatting).FontSize(14).Alignment = Alignment.right; + row0Foot.Cells[0].Paragraphs[0].Append($"{medicalCenterName}体检中心 编制", p1TableContentFormatting).FontSize(14).Alignment = Alignment.right; row0Foot.Cells[0].VerticalAlignment = VerticalAlignment.Center; row0Foot.Cells[0].SetBorder(TableCellBorderType.Bottom, bTableContent); @@ -498,7 +507,8 @@ namespace Shentun.Peis.ReportTemplates p1Foot.InsertTableAfterSelf(p1FootTable); var p1Foot1 = document.InsertParagraph(); - p1Foot1.Append("体检中心地址:", p1TableContentFormatting).FontSize(10).Alignment = Alignment.right; + //p1Foot1.Append("体检中心地址:", p1TableContentFormatting).FontSize(10).Alignment = Alignment.right; + p1Foot1.Append("", p1TableContentFormatting).FontSize(10).Alignment = Alignment.right; //第二页 p1Foot1.InsertPageBreakAfterSelf(); @@ -515,7 +525,7 @@ namespace Shentun.Peis.ReportTemplates document.InsertParagraph(@"第六部份: 体检者未完成情况").Font(f).FontSize(12).IndentationFirstLine = 32.0f; document.InsertParagraph(@"第七部分:常见体检异常结果分析及健康指导").Font(f).FontSize(12).IndentationFirstLine = 32.0f; document.InsertParagraph(); - document.InsertParagraph(@"医院体检中心另提供完善的后续服务,包括护理咨询服务、特色医院导诊服务、营养咨询等。有任何需要,请电洽相关部门,或拨打咨询专线咨询相关事宜。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"体检中心另提供完善的后续服务,包括护理咨询服务、特色医院导诊服务、营养咨询等。有任何需要,请电洽相关部门,或拨打咨询专线咨询相关事宜。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; document.InsertParagraph(); document.InsertParagraph(@"定期健康检查对于员工健康的重要性相信您已知道,然而,更重要的是完成健康检查后,改善健康活动的开始,也就是健康促进的一级预防医学(适当的运动、均衡的饮食、身心休闲),这才是健康检查最终的目标。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; document.InsertParagraph(); @@ -667,7 +677,7 @@ namespace Shentun.Peis.ReportTemplates //第四页 document.Paragraphs[document.Paragraphs.Count - 1].InsertPageBreakAfterSelf(); document.InsertParagraph(@"二、体检项目与体检项目的参检情况").Font(f).FontSize(16); - Table p4Contenttable = document.AddTable(3, 11); + Table p4Contenttable = document.AddTable(3, 10); p4Contenttable.Design = TableDesign.TableGrid; List p4rowsContent = p4Contenttable.Rows; @@ -684,7 +694,7 @@ namespace Shentun.Peis.ReportTemplates p4Row0.MergeCells(2, 4); p4Row0.Cells[2].Paragraphs[0].Append("总体参检人数").Font(f).FontSize(10.5).Alignment = Alignment.center; p4Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); - p4Row0.MergeCells(3, 5); + p4Row0.MergeCells(3, 4); p4Row0.Cells[3].Paragraphs[0].Append("该项参检百分比").Font(f).FontSize(10.5).Alignment = Alignment.center; p4Row0.Cells[3].FillColor = Color.FromArgb(209, 245, 203); @@ -709,8 +719,8 @@ namespace Shentun.Peis.ReportTemplates p4Row1.Cells[8].FillColor = Color.FromArgb(209, 245, 203); p4Row1.Cells[9].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; p4Row1.Cells[9].FillColor = Color.FromArgb(209, 245, 203); - p4Row1.Cells[10].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; - p4Row1.Cells[10].FillColor = Color.FromArgb(209, 245, 203); + //p4Row1.Cells[10].Paragraphs[0].Append("合计").Font(f).FontSize(10.5).Alignment = Alignment.center; + //p4Row1.Cells[10].FillColor = Color.FromArgb(209, 245, 203); var p4Content = document.InsertParagraph(); p4Content.InsertTableAfterSelf(p4Contenttable); @@ -746,16 +756,16 @@ namespace Shentun.Peis.ReportTemplates document.InsertParagraph(@"四、本次体检异常结果检出统计").Font(f).FontSize(16); var p5Content1 = document.InsertParagraph(@"贵单位此次在我中心进行员工体检,内容包括[登记组合项目][实检组合项目],现将检出的按男女综合检出数量最高的部分异常情况进行统计分析,以反映出员工的健康状况。").Font(f).FontSize(10.5); - Table p5Contenttable2 = document.AddTable(3, 8); + Table p5Contenttable2 = document.AddTable(3, 7); p5Contenttable2.Design = TableDesign.TableGrid; p5Contenttable2.SetColumnWidth(0, 95f); p5Contenttable2.SetColumnWidth(1, 130f); p5Contenttable2.SetColumnWidth(2, 40f); p5Contenttable2.SetColumnWidth(3, 40f); p5Contenttable2.SetColumnWidth(4, 40f); - p5Contenttable2.SetColumnWidth(5, 40f); - p5Contenttable2.SetColumnWidth(6, 40f); - p5Contenttable2.SetColumnWidth(7, 40f); + p5Contenttable2.SetColumnWidth(5, 60f); + p5Contenttable2.SetColumnWidth(6, 60f); + //p5Contenttable2.SetColumnWidth(7, 40f); List p5rowsContent2 = p5Contenttable2.Rows; Row p5Table2Row0 = p5rowsContent2[0]; @@ -765,7 +775,7 @@ namespace Shentun.Peis.ReportTemplates p5Table2Row0.MergeCells(1, 3); p5Table2Row0.Cells[1].Paragraphs[0].Append("人数").Font(f).FontSize(10.5).Alignment = Alignment.center; p5Table2Row0.Cells[1].FillColor = Color.FromArgb(209, 245, 203); - p5Table2Row0.MergeCells(2, 4); + p5Table2Row0.MergeCells(2, 3); p5Table2Row0.Cells[2].Paragraphs[0].Append("百分比").Font(f).FontSize(10.5).Alignment = Alignment.center; p5Table2Row0.Cells[2].FillColor = Color.FromArgb(209, 245, 203); @@ -784,8 +794,8 @@ namespace Shentun.Peis.ReportTemplates p5Table2Row1.Cells[5].FillColor = Color.FromArgb(209, 245, 203); p5Table2Row1.Cells[6].Paragraphs[0].Append("女性").Font(f).FontSize(10.5).Alignment = Alignment.center; p5Table2Row1.Cells[6].FillColor = Color.FromArgb(209, 245, 203); - p5Table2Row1.Cells[7].Paragraphs[0].Append("").Font(f).FontSize(10.5).Alignment = Alignment.center; - p5Table2Row1.Cells[7].FillColor = Color.FromArgb(209, 245, 203); + //p5Table2Row1.Cells[7].Paragraphs[0].Append("").Font(f).FontSize(10.5).Alignment = Alignment.center; + //p5Table2Row1.Cells[7].FillColor = Color.FromArgb(209, 245, 203); p5Content1.InsertTableAfterSelf(p5Contenttable2); //第六页 @@ -1056,43 +1066,43 @@ namespace Shentun.Peis.ReportTemplates document.InsertParagraph().InsertPageBreakAfterSelf(); document.InsertParagraph(@"结束语").Font(f).FontSize(14).Bold(true); document.InsertParagraph(); - document.InsertParagraph(@"影响健康的因素很多,包括遗传基因、日常生活习惯、社会环境、医疗资源等等,其中,与一般民众息息相关的医疗资源,仅占影响健康因素的10%,最大的影响因素还是日常生活习惯及社会环境。根据世界卫生组织(WHO)的估计,75%的癌症是已知的环境因素所引起,而这些因素都是可以预防的,例如抽烟、酗酒。").Font(f).FontSize(10.5).IndentationFirstLine = 32.0f; + document.InsertParagraph(@"影响健康的因素很多,包括遗传基因、日常生活习惯、社会环境、医疗资源等等,其中,与一般民众息息相关的医疗资源,仅占影响健康因素的10%,最大的影响因素还是日常生活习惯及社会环境。根据世界卫生组织(WHO)的估计,75%的癌症是已知的环境因素所引起,而这些因素都是可以预防的,例如抽烟、酗酒。").Font(f).FontSize(12).IndentationFirstLine = 32.0f; document.InsertParagraph(); - document.InsertParagraph(@"世界卫生组织(WHO)指出:“二十一世纪的医学不应该继续以疾病为主要研究对象,而应该以人类健康作为医学研究的主要方向。” 这个精神旨在宣告预防医学和健康保健将成为医学的主导。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + document.InsertParagraph(@"世界卫生组织(WHO)指出:“二十一世纪的医学不应该继续以疾病为主要研究对象,而应该以人类健康作为医学研究的主要方向。” 这个精神旨在宣告预防医学和健康保健将成为医学的主导。").Font(f).FontSize(12).IndentationFirstLine = 32f; document.InsertParagraph(); - document.InsertParagraph(@"我中心愿以卓越的服务、优质的技术继续为贵单位提供医疗保健服务,从体检中发现健康问题,从保健中解决健康问题。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + document.InsertParagraph(@"我中心愿以卓越的服务、优质的技术继续为贵单位提供健康体检服务。").Font(f).FontSize(12).IndentationFirstLine = 32f; document.InsertParagraph(); - document.InsertParagraph(@"最后,感谢您对国宾的支持,别忘了定期为员工安排健康检查。您的任何意见,都是我们成长的来源!敬请不吝指教。").Font(f).FontSize(10.5).IndentationFirstLine = 32f; + document.InsertParagraph(@$"最后,感谢您对{medicalCenterName}的支持。您的任何意见,都是我们成长的来源!敬请不吝指教。").Font(f).FontSize(12).IndentationFirstLine = 32f; document.InsertParagraph().InsertPageBreakAfterSelf(); - //检后服务 - Xceed.Document.NET.Font f1 = new Xceed.Document.NET.Font("黑体"); - Xceed.Document.NET.Font f2 = new Xceed.Document.NET.Font("楷体"); - Formatting pBottomFirstFormatting = new Formatting(); - pBottomFirstFormatting.FontFamily = new Xceed.Document.NET.Font("黑体"); - pBottomFirstFormatting.Size = 14; - Formatting pBottomLastFormatting = new Formatting(); - pBottomLastFormatting.FontFamily = new Xceed.Document.NET.Font("黑体"); - pBottomLastFormatting.Size = 10.5; - document.InsertParagraph(@"检后服务").Font(f1).FontSize(18); - document.InsertParagraph(@"健康体检后,您需要健康维护和管理:").Font(f1).FontSize(10.5); - var svr1 = document.InsertParagraph().Font(f1).FontSize(10.5); - svr1.InsertText("1.", false, pBottomLastFormatting); - svr1.InsertText("检后就诊", false, pBottomFirstFormatting); - svr1.InsertText("--体检中发现的疾病由国内著名、省内著名的专家为您对接就诊,真正起到早发现、早诊断、早治疗。", false, pBottomLastFormatting); - var svr2 = document.InsertParagraph().Font(f1).FontSize(10.5); - svr2.InsertText("2.", false, pBottomLastFormatting); - svr2.InsertText("常见病、疑难病预约就诊服务", false, pBottomFirstFormatting); - svr2.InsertText("--请拨打健康服务热线。我们可以帮您用最短的时间预约上最合适您病情的专家,他们为国内著名、省内著名的专家在您需要时我们还可以通过绿色通道帮您预约外省外院著名专家。", false, pBottomLastFormatting); - document.InsertParagraph("3.体检报告电话咨询服务。").Font(f1).FontSize(10.5); - document.InsertParagraph("4.特殊检查预约服务(CT、MR等大型检查设备)。").Font(f1).FontSize(10.5); - document.InsertParagraph("5.住院预约服务。").Font(f1).FontSize(10.5); - document.InsertParagraph("6.外院就诊指导。").Font(f1).FontSize(10.5); - document.InsertParagraph("您 健 康 的 管 家").Font(f1).FontSize(18).Italic(true).Alignment = Alignment.center; - document.InsertParagraph("人生中偶然的病痛--有我们的关怀").Font(f2).FontSize(18).Bold(true).Italic(true).Alignment = Alignment.center; - document.InsertParagraph("健康体检中心").Font(f).FontSize(16).Alignment = Alignment.center; - document.InsertParagraph("团体体检汇总报告").Font(f).FontSize(16).Alignment = Alignment.center; - document.InsertParagraph("企业员工健康检查统计报告").Font(f1).FontSize(22).Alignment = Alignment.center; - document.InsertParagraph("【版权所有,翻印必究】").Font(f).FontSize(10.5).Alignment = Alignment.center; + ////检后服务 + //Xceed.Document.NET.Font f1 = new Xceed.Document.NET.Font("黑体"); + //Xceed.Document.NET.Font f2 = new Xceed.Document.NET.Font("楷体"); + //Formatting pBottomFirstFormatting = new Formatting(); + //pBottomFirstFormatting.FontFamily = new Xceed.Document.NET.Font("黑体"); + //pBottomFirstFormatting.Size = 14; + //Formatting pBottomLastFormatting = new Formatting(); + //pBottomLastFormatting.FontFamily = new Xceed.Document.NET.Font("黑体"); + //pBottomLastFormatting.Size = 10.5; + //document.InsertParagraph(@"检后服务").Font(f1).FontSize(18); + //document.InsertParagraph(@"健康体检后,您需要健康维护和管理:").Font(f1).FontSize(10.5); + //var svr1 = document.InsertParagraph().Font(f1).FontSize(10.5); + //svr1.InsertText("1.", false, pBottomLastFormatting); + //svr1.InsertText("检后就诊", false, pBottomFirstFormatting); + //svr1.InsertText("--体检中发现的疾病由国内著名、省内著名的专家为您对接就诊,真正起到早发现、早诊断、早治疗。", false, pBottomLastFormatting); + //var svr2 = document.InsertParagraph().Font(f1).FontSize(10.5); + //svr2.InsertText("2.", false, pBottomLastFormatting); + //svr2.InsertText("常见病、疑难病预约就诊服务", false, pBottomFirstFormatting); + //svr2.InsertText("--请拨打健康服务热线。我们可以帮您用最短的时间预约上最合适您病情的专家,他们为国内著名、省内著名的专家在您需要时我们还可以通过绿色通道帮您预约外省外院著名专家。", false, pBottomLastFormatting); + //document.InsertParagraph("3.体检报告电话咨询服务。").Font(f1).FontSize(10.5); + //document.InsertParagraph("4.特殊检查预约服务(CT、MR等大型检查设备)。").Font(f1).FontSize(10.5); + //document.InsertParagraph("5.住院预约服务。").Font(f1).FontSize(10.5); + //document.InsertParagraph("6.外院就诊指导。").Font(f1).FontSize(10.5); + //document.InsertParagraph("您 健 康 的 管 家").Font(f1).FontSize(18).Italic(true).Alignment = Alignment.center; + //document.InsertParagraph("人生中偶然的病痛--有我们的关怀").Font(f2).FontSize(18).Bold(true).Italic(true).Alignment = Alignment.center; + //document.InsertParagraph("健康体检中心").Font(f).FontSize(16).Alignment = Alignment.center; + //document.InsertParagraph("团体体检汇总报告").Font(f).FontSize(16).Alignment = Alignment.center; + //document.InsertParagraph("企业员工健康检查统计报告").Font(f1).FontSize(22).Alignment = Alignment.center; + //document.InsertParagraph("【版权所有,翻印必究】").Font(f).FontSize(10.5).Alignment = Alignment.center; document.Save(); }