Browse Source

单位体检报表

bjmzak
wxd 2 years ago
parent
commit
b14c9d2087
  1. 10
      src/Shentun.Peis.Application.Contracts/CustomerReports/GetPatientRegisterPositiveReportRequestDto.cs
  2. 243
      src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportExportWordDto.cs
  3. 56
      src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportReduceDto.cs
  4. 60
      src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportStandardDto.cs
  5. 11
      src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs
  6. 277
      src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs
  7. 56
      src/Shentun.Peis.Domain/DataHelper.cs
  8. 269
      src/Shentun.Peis.Domain/ReportTemplates/ChartData.cs
  9. 43
      src/Shentun.Peis.Domain/ReportTemplates/CreateInspectionPersonnelPara.cs
  10. 2330
      src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs
  11. 339
      src/Shentun.Peis.Domain/ReportTemplates/UnitPhysicalExaminationReportExportWordData.cs
  12. 2
      src/Shentun.Peis.Domain/Shentun.Peis.Domain.csproj
  13. 12
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
  14. BIN
      src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/Page1.jpg
  15. BIN
      src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/logo_template.jpg

10
src/Shentun.Peis.Application.Contracts/CustomerReports/GetPatientRegisterPositiveReportRequestDto.cs

@ -12,15 +12,5 @@ namespace Shentun.Peis.CustomerReports
/// </summary>
public List<GetPeisReportDetailRequest_CustomerOrg> CustomerOrgs { get; set; } = new List<GetPeisReportDetailRequest_CustomerOrg>();
/// <summary>
/// 检查状态(正式登记,部份已检,已总检)
/// </summary>
public char? CompleteFlag { get; set; }
/// <summary>
/// 审核状态( Y N )
/// </summary>
public char? IsAudit { get; set; }
}
}

243
src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportExportWordDto.cs

@ -7,247 +7,8 @@ namespace Shentun.Peis.CustomerReports
public class GetUnitPhysicalExaminationReportExportWordDto
{
/// <summary>
/// 体检年度
/// 报告url 需拼接http前缀地址
/// </summary>
public string MedicalYear { get; set; }
/// <summary>
/// 单位名称
/// </summary>
public string CustomerOrgName { get; set; }
/// <summary>
/// 体检次数
/// </summary>
public int MedicalTimes { get; set; }
/// <summary>
/// 体检开始月份 格式:2009年09月
/// </summary>
public string MedicalStartDate { get; set; }
/// <summary>
/// 体检结束月份 格式:2009年09月
/// </summary>
public string MedicalEndDate { get; set; }
/// <summary>
/// 制表日期 格式:2009年09月09日
/// </summary>
public string TabulationDate { get; set; }
/// <summary>
/// 打印日期 格式:2009年09月09日
/// </summary>
public string PrintDate { get; set; }
/// <summary>
/// 参加人员构成情况 第一部分
/// </summary>
public GetUnitPhysicalExaminationReportExportWord_InspectionPersonnel InspectionPersonnel { get; set; }
/// <summary>
/// 体检项目得参检情况 第二部分
/// </summary>
public List<GetUnitPhysicalExaminationReportExportWord_MedicalItemExamineSituation> MedicalItemExamineSituations { get; set; }
/// <summary>
/// 全体员工体检结果汇总 第三部分
/// </summary>
public List<GetUnitPhysicalExaminationReportExportWord_MedicalResultSummary> MedicalResultSummarys { get; set; }
}
/// <summary>
/// 参加人员构成情况
/// </summary>
public class GetUnitPhysicalExaminationReportExportWord_InspectionPersonnel
{
/// <summary>
/// 男性登记人数
/// </summary>
public int MaleRegisterNumber { get; set; }
/// <summary>
/// 女性登记人数
/// </summary>
public int FemaleRegisterNumber { get; set; }
/// <summary>
/// 其他登记人数
/// </summary>
public int OtherRegisterNumber { get; set; }
/// <summary>
/// 合计登记人数
/// </summary>
public int SumRegisterNumber { get; set; }
/// <summary>
/// 登记明细
/// </summary>
public InspectionPersonnel_Detail RegisterDetail { get; set; }
/// <summary>
/// 实检明细
/// </summary>
public InspectionPersonnel_Detail CheckedDetail { get; set; }
/// <summary>
/// 未检明细
/// </summary>
public InspectionPersonnel_Detail UnCheckedDetail { get; set; }
}
/// <summary>
/// 检查明细
/// </summary>
public class InspectionPersonnel_Detail
{
/// <summary>
/// 男性人数
/// </summary>
public int MaleNumber { get; set; }
/// <summary>
/// 女性人数
/// </summary>
public int FemaleNumber { get; set; }
/// <summary>
/// 其他人数
/// </summary>
public int OtherNumber { get; set; }
/// <summary>
/// 合计人数
/// </summary>
public int TotalNumber { get; set; }
/// <summary>
/// 男性比例
/// </summary>
public string MaleRatio { get; set; }
/// <summary>
/// 女性比例
/// </summary>
public string FemaleRatio { get; set; }
/// <summary>
/// 男性参检比例
/// </summary>
public string MaleExamineRatio { get; set; }
/// <summary>
/// 女性参检比例
/// </summary>
public string FemaleExamineRatio { get; set; }
/// <summary>
/// 平均参检比例
/// </summary>
public string AverageExamineRatio { get; set; }
}
/// <summary>
/// 体检项目得参检情况
/// </summary>
public class GetUnitPhysicalExaminationReportExportWord_MedicalItemExamineSituation
{
/// <summary>
/// 科室
/// </summary>
public string ItemTypeName { get; set; }
/// <summary>
/// 组合项目名称
/// </summary>
public string AsbitemName { get; set; }
/// <summary>
/// 男性该项目参检人数
/// </summary>
public int MaleAsbitemCheckNumber { get; set; }
/// <summary>
/// 女性该项目参检人数
/// </summary>
public int FemaleAsbitemCheckNumber { get; set; }
/// <summary>
/// 合计该项目参检人数
/// </summary>
public int TotalAsbitemCheckNumber { get; set; }
/// <summary>
/// 男性总体参检人数 所有项目
/// </summary>
public int MaleSumCheckNumber { get; set; }
/// <summary>
/// 女性总体参检人数 所有项目
/// </summary>
public int FemaleSumCheckNumber { get; set; }
/// <summary>
/// 合计总体参检人数 所有项目
/// </summary>
public int TotalSumCheckNumber { get; set; }
/// <summary>
/// 男性该项目参检比例
/// </summary>
public int MaleAsbitemCheckRatio { get; set; }
/// <summary>
/// 女性该项目参检比例
/// </summary>
public int FemaleAsbitemCheckRatio { get; set; }
/// <summary>
/// 合计该项目参检比例
/// </summary>
public int TotalAsbitemCheckRatio { get; set; }
}
/// <summary>
/// 全体员工体检结果汇总 统计已总检的名单
/// </summary>
public class GetUnitPhysicalExaminationReportExportWord_MedicalResultSummary
{
/// <summary>
/// 档案号
/// </summary>
public string PatientNo { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set; }
/// <summary>
/// 性别
/// </summary>
public string SexName { get; set; }
/// <summary>
/// 年龄
/// </summary>
public string Age { get; set; }
/// <summary>
/// 体检结果
/// </summary>
public string MedicalResult { get; set; }
public string ReportUrl { get; set; }
}
}

56
src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportReduceDto.cs

@ -6,6 +6,62 @@ namespace Shentun.Peis.CustomerReports
{
public class GetUnitPhysicalExaminationReportReduceDto
{
/// <summary>
/// 标题
/// </summary>
public string ReportTitle { get; set; }
/// <summary>
/// 单位名称
/// </summary>
public string CustomerOrgName { get; set; }
/// <summary>
/// 体检次数
/// </summary>
public int MedicalTimes { get; set; }
/// <summary>
/// 开始月份
/// </summary>
public string StartMonth { get; set; }
/// <summary>
/// 结束月份
/// </summary>
public string EndMonth { get; set; }
/// <summary>
/// 开始日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public string EndDate { get; set; }
/// <summary>
/// 总共体检人数
/// </summary>
public int SumMedicalNumber { get; set; }
/// <summary>
/// 男性体检人数
/// </summary>
public int MaleMedicalNumber { get; set; }
/// <summary>
/// 女性体检人数
/// </summary>
public int FemaleMedicalNumber { get; set; }
/// <summary>
/// 其他体检人数
/// </summary>
public int OtherMedicalNumber { get; set; }
/// <summary>
/// 人员阳性结果清单
/// </summary>

60
src/Shentun.Peis.Application.Contracts/CustomerReports/GetUnitPhysicalExaminationReportStandardDto.cs

@ -5,8 +5,68 @@ using System.Text;
namespace Shentun.Peis.CustomerReports
{
/// <summary>
/// 标准格式
/// </summary>
public class GetUnitPhysicalExaminationReportStandardDto
{
/// <summary>
/// 标题
/// </summary>
public string ReportTitle { get; set; }
/// <summary>
/// 单位名称
/// </summary>
public string CustomerOrgName { get; set; }
/// <summary>
/// 体检次数
/// </summary>
public int MedicalTimes { get; set; }
/// <summary>
/// 开始月份
/// </summary>
public string StartMonth { get; set; }
/// <summary>
/// 结束月份
/// </summary>
public string EndMonth { get; set; }
/// <summary>
/// 开始日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public string EndDate { get; set; }
/// <summary>
/// 总共体检人数
/// </summary>
public int SumMedicalNumber { get; set; }
/// <summary>
/// 男性体检人数
/// </summary>
public int MaleMedicalNumber { get; set; }
/// <summary>
/// 女性体检人数
/// </summary>
public int FemaleMedicalNumber { get; set; }
/// <summary>
/// 其他体检人数
/// </summary>
public int OtherMedicalNumber { get; set; }
/// <summary>
/// 人员阳性结果清单
/// </summary>

11
src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs

@ -12,7 +12,7 @@ namespace Shentun.Peis.PeisReports
/// <summary>
/// 单位相关
/// </summary>
public List<GetPeisReportDetailRequest_CustomerOrg> CustomerOrgs { get; set; } = new List<GetPeisReportDetailRequest_CustomerOrg> ();
public List<GetPeisReportDetailRequest_CustomerOrg> CustomerOrgs { get; set; } = new List<GetPeisReportDetailRequest_CustomerOrg>();
/// <summary>
@ -95,17 +95,20 @@ namespace Shentun.Peis.PeisReports
/// <summary>
/// 日期类型(1、登记日期 2、体检日期 3、总检日期)
/// </summary>
public char? DateType { get; set; }
[Required(ErrorMessage = "日期类型不能为空")]
public char DateType { get; set; }
/// <summary>
/// 开始日期
/// </summary>
public string? StartDate { get; set; }
[Required(ErrorMessage = "开始日期不能为空")]
public string StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public string? EndDate { get; set; }
[Required(ErrorMessage = "结束日期不能为空")]
public string EndDate { get; set; }
}
}

277
src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs

@ -2,19 +2,26 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using NPOI.HPSF;
using NPOI.POIFS.Storage;
using NPOI.SS.Formula.Functions;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel.Extensions;
using Org.BouncyCastle.Crypto.Tls;
using Shentun.Peis.CustomerOrgs;
using Shentun.Peis.Enums;
using Shentun.Peis.Models;
using Shentun.Peis.PeisReports;
using Shentun.Peis.ReportTemplates;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using TencentCloud.Ame.V20190916.Models;
using TencentCloud.Scf.V20180416.Models;
using TencentCloud.Ticm.V20181127.Models;
using TencentCloud.Wedata.V20210820.Models;
@ -30,7 +37,7 @@ namespace Shentun.Peis.CustomerReports
/// 客户报表
/// </summary>
[ApiExplorerSettings(GroupName = "Work")]
[Authorize]
//[Authorize]
public class CustomerReportAppService : ApplicationService
{
private readonly IRepository<Patient, Guid> _patientRepository;
@ -46,11 +53,12 @@ namespace Shentun.Peis.CustomerReports
private readonly IRepository<RegisterCheckSummary, Guid> _registerCheckSummaryRepository;
private readonly IRepository<RegisterCheckItem> _registerCheckItemRepository;
private readonly IRepository<Asbitem, Guid> _asbitemRepository;
private readonly IRepository<Item, Guid> _itemRepository;
private readonly IRepository<Models.Item, Guid> _itemRepository;
private readonly IRepository<ItemType, Guid> _itemTypeRepository;
private readonly IRepository<SumSuggestionHeader, Guid> _sumSuggestionHeaderRepository;
private readonly IRepository<SumSuggestionContent, Guid> _sumSuggestionContentRepository;
private readonly CustomerOrgManager _customerOrgManager;
private readonly CustomerOrgReportManager _customerOrgReportManager;
public CustomerReportAppService(
IRepository<Patient, Guid> patientRepository,
@ -66,12 +74,12 @@ namespace Shentun.Peis.CustomerReports
IRepository<RegisterCheckSummary, Guid> registerCheckSummaryRepository,
IRepository<RegisterCheckItem> registerCheckItemRepository,
IRepository<Asbitem, Guid> asbitemRepository,
IRepository<Item, Guid> itemRepository,
IRepository<Models.Item, Guid> itemRepository,
IRepository<ItemType, Guid> itemTypeRepository,
IRepository<SumSuggestionHeader, Guid> sumSuggestionHeaderRepository,
IRepository<SumSuggestionContent, Guid> sumSuggestionContentRepository,
CustomerOrgManager customerOrgManager
)
CustomerOrgManager customerOrgManager,
CustomerOrgReportManager customerOrgReportManager)
{
this._patientRepository = patientRepository;
this._patientRegisterRepository = patientRegisterRepository;
@ -91,6 +99,7 @@ namespace Shentun.Peis.CustomerReports
this._sumSuggestionContentRepository = sumSuggestionContentRepository;
this._customerOrgManager = customerOrgManager;
this._itemTypeRepository = itemTypeRepository;
_customerOrgReportManager = customerOrgReportManager;
}
@ -200,15 +209,7 @@ namespace Shentun.Peis.CustomerReports
if (input.CompleteFlag != null)
{
sumquery = sumquery.Where(m => m.a.CompleteFlag == input.CompleteFlag);
}
if (input.IsAudit != null)
{
sumquery = sumquery.Where(m => m.a.IsAudit == input.IsAudit);
}
var entlist = sumquery.GroupBy(g => g.c.PatientRegisterId).Select(s => new GetPatientRegisterPositiveReportDto
@ -409,7 +410,7 @@ namespace Shentun.Peis.CustomerReports
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value);
sumquery_count = sumquery_count.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId));
}
if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate))
if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate))
{
if (item.DateType == '1')
{
@ -449,7 +450,7 @@ namespace Shentun.Peis.CustomerReports
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item2.CustomerOrgId.Value);
newquery = newquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId));
}
if (item2.DateType != null && !string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate))
if (!string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate))
{
if (item2.DateType == '1')
{
@ -519,7 +520,7 @@ namespace Shentun.Peis.CustomerReports
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value);
sumquery = sumquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId));
}
if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate))
if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate))
{
if (item.DateType == '1')
{
@ -559,7 +560,7 @@ namespace Shentun.Peis.CustomerReports
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item2.CustomerOrgId.Value);
newquery = newquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId));
}
if (item2.DateType != null && !string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate))
if (!string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate))
{
if (item2.DateType == '1')
{
@ -649,7 +650,7 @@ namespace Shentun.Peis.CustomerReports
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value);
sumquery_count = sumquery_count.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId));
}
if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate))
if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate))
{
if (item.DateType == '1')
{
@ -689,7 +690,7 @@ namespace Shentun.Peis.CustomerReports
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item2.CustomerOrgId.Value);
newquery = newquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId));
}
if (item2.DateType != null && !string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate))
if (!string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate))
{
if (item2.DateType == '1')
{
@ -748,7 +749,7 @@ namespace Shentun.Peis.CustomerReports
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value);
sumquery = sumquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId));
}
if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate))
if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate))
{
if (item.DateType == '1')
{
@ -788,7 +789,7 @@ namespace Shentun.Peis.CustomerReports
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item2.CustomerOrgId.Value);
newquery = newquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId));
}
if (item2.DateType != null && !string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate))
if (!string.IsNullOrEmpty(item2.StartDate) && !string.IsNullOrEmpty(item2.EndDate))
{
if (item2.DateType == '1')
{
@ -841,6 +842,21 @@ namespace Shentun.Peis.CustomerReports
[HttpPost("api/customerreport/getunitphysicalexaminationreportstandard")]
public async Task<GetUnitPhysicalExaminationReportStandardDto> GetUnitPhysicalExaminationReportStandardAsync(GetUnitPhysicalExaminationReportRequestDto input)
{
if (input.CustomerOrgs.Count != 1)
{
throw new UserFriendlyException("必须选择并且只能选择一个单位");
}
if (input.CustomerOrgs.FirstOrDefault().CustomerOrgId == null || input.CustomerOrgs.FirstOrDefault().CustomerOrgId == GuidFlag.PersonCustomerOrgId)
{
throw new UserFriendlyException("单位不能为空");
}
if (input.CustomerOrgs.FirstOrDefault().CustomerOrgRegisterId == null || input.CustomerOrgs.FirstOrDefault().CustomerOrgRegisterId == GuidFlag.PersonCustomerOrgRegisterId)
{
throw new UserFriendlyException("单位体检次数不能为空");
}
//人员阳性结果清单
var PatientRegisterPositiveReports = await GetPatientRegisterPositiveReportAsync(new GetPatientRegisterPositiveReportRequestDto { CustomerOrgs = input.CustomerOrgs });
@ -886,6 +902,12 @@ namespace Shentun.Peis.CustomerReports
[HttpPost("api/customerreport/getunitphysicalexaminationreportreduce")]
public async Task<GetUnitPhysicalExaminationReportReduceDto> GetUnitPhysicalExaminationReportReduceAsync(GetUnitPhysicalExaminationReportRequestDto input)
{
if (input.CustomerOrgs.Count != 1)
{
throw new UserFriendlyException("必须选择并且只能选择一个单位");
}
//人员阳性结果清单
var PatientRegisterPositiveReports = await GetPatientRegisterPositiveReportAsync(new GetPatientRegisterPositiveReportRequestDto { CustomerOrgs = input.CustomerOrgs });
@ -924,54 +946,189 @@ namespace Shentun.Peis.CustomerReports
///// <summary>
///// 单位体检报表 导出word
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpPost("api/customerreport/getunitphysicalexaminationreportreduce")]
//public async Task<GetUnitPhysicalExaminationReportExportWordDto> GetUnitPhysicalExaminationReportExportWordAsync(GetUnitPhysicalExaminationReportExportWordRequestDto input)
//{
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/customerreport/getunitphysicalexaminationreportreduce")]
public async Task<GetUnitPhysicalExaminationReportExportWordDto> GetUnitPhysicalExaminationReportExportWordAsync(GetUnitPhysicalExaminationReportExportWordRequestDto input)
{
if (input.CustomerOrgs.Count != 1)
{
throw new UserFriendlyException("必须选择并且只能选择一个单位");
}
// if (input.CustomerOrgs.Count != 1)
// {
// throw new UserFriendlyException("必须选择并且只能选择一个单位");
// }
// //人员阳性结果清单
// var PatientRegisterPositiveReports = await GetPatientRegisterPositiveReportAsync(new GetPatientRegisterPositiveReportRequestDto { CustomerOrgs = input.CustomerOrgs });
var customerOrgs = input.CustomerOrgs.FirstOrDefault();
// //阳性结果包含人员清单 精简模式
// var PositivePatientRegisterReportReduces = await GetPositivePatientRegisterReportReduceAsync(new GetPositivePatientRegisterReportRequestDto { CustomerOrgs = input.CustomerOrgs });
if (customerOrgs.CustomerOrgId == null || customerOrgs.CustomerOrgId == GuidFlag.PersonCustomerOrgId)
{
throw new UserFriendlyException("单位不能为空");
}
// //疾病人数统计
// var DiseaseCountStatisticsReports = await GetDiseaseCountStatisticsReportAsync(new GetDiseaseCountStatisticsReportRequestDto { CustomerOrgs = input.CustomerOrgs });
if (customerOrgs.CustomerOrgRegisterId == null || customerOrgs.CustomerOrgRegisterId == GuidFlag.PersonCustomerOrgRegisterId)
{
throw new UserFriendlyException("单位体检次数不能为空");
}
// var query = from a in await _customerOrgRegisterRepository.GetQueryableAsync()
// join b in await _customerOrgRepository.GetQueryableAsync() on a.CustomerOrgId equals b.Id into bb
// from ab in bb.DefaultIfEmpty()
// select new { a, ab };
#region 请求参数
// if (input.CustomerOrgs.Any())
// {
// query = query.Where(m => input.CustomerOrgs.Where(m => m.CustomerOrgRegisterId != null && m.CustomerOrgRegisterId != Guid.Empty).Select(s => s.CustomerOrgRegisterId).Contains(m.a.Id));
// }
var createInspectionPersonnelPara = new CreateInspectionPersonnelPara
{
CustomerOrgGroupId = customerOrgs.CustomerOrgGroupId,
CustomerOrgId = customerOrgs.CustomerOrgId.Value,
EndDate = customerOrgs.EndDate,
DateType = customerOrgs.DateType,
StartDate = customerOrgs.StartDate,
CustomerOrgRegisterId = customerOrgs.CustomerOrgRegisterId.Value
};
// var entlist = new GetUnitPhysicalExaminationReportReduceDto
// {
// CustomerOrgs = query.Select(s => new GetUnitPhysicalExaminationStandardReport_CustomerOrg
// {
// BeginTime = s.a.BeginTime.ToString(),
// EndTime = s.a.EndTime != null ? s.a.EndTime.ToString() : "",
// CustomerOrgName = s.ab != null ? s.ab.DisplayName : "",
// MedicalTimes = s.a.MedicalTimes
// }).ToList(),
// DiseaseCountStatisticsReports = DiseaseCountStatisticsReports,
// PatientRegisterPositiveReports = PatientRegisterPositiveReports,
// PositivePatientRegisterReportReduces = PositivePatientRegisterReportReduces
// };
#endregion
// return entlist;
//}
#region 封面参数
var customerOrgRegisterEntity = (await _customerOrgRegisterRepository.GetQueryableAsync())
.Include(x => x.CustomerOrg)
.FirstOrDefault(f => f.Id == customerOrgs.CustomerOrgRegisterId);
var documentData = new UnitPhysicalExaminationReportExportWordData();
documentData.MedicalTitle = customerOrgRegisterEntity.BeginTime.Year.ToString() + "年度" + customerOrgRegisterEntity.CustomerOrg.DisplayName;
documentData.MedicalTimes = customerOrgRegisterEntity.MedicalTimes;
documentData.MedicalStartDate = customerOrgRegisterEntity.BeginTime.ToString("yyyy年MM月");
documentData.MedicalEndDate = customerOrgRegisterEntity.EndTime != null ? customerOrgRegisterEntity.EndTime.Value.ToString("yyyy年MM月") : DateTime.Now.ToString("yyyy年MM月");
documentData.TabulationDate = DateTime.Now.ToString("yyyy年MM月dd日");
documentData.PrintDate = DateTime.Now.ToString("yyyy年MM月dd日");
#endregion
#region 参检人员 第一部分
await _customerOrgReportManager.CreateInspectionPersonnelData(documentData, createInspectionPersonnelPara);
#endregion
#region 体检项目与体检项目的参检情况 第二部分
await _customerOrgReportManager.CreateMedicalItemExamineSituationData(documentData, createInspectionPersonnelPara);
#endregion
#region 全体员工体检结果汇总 第三部分
await _customerOrgReportManager.CreateMedicalResultSummarysData(documentData, createInspectionPersonnelPara);
#endregion
#region 本次体检异常结果检出统计 第四部分
await _customerOrgReportManager.CreateMedicalAbnormalResultStatisticsData(documentData, createInspectionPersonnelPara);
#endregion
#region 本次体检前十大异常结果分析 第五部分
await _customerOrgReportManager.CreateMedicalTenAbnormalResultsData(documentData, createInspectionPersonnelPara);
#endregion
#region 体检者未完成情况 第六部分
await _customerOrgReportManager.CreateMedicalUnCheckedStatisticsData(documentData, createInspectionPersonnelPara);
#endregion
#region 判断是否存在模板
string TemplateUrl = System.AppDomain.CurrentDomain.BaseDirectory + @"\ReportFile\CustomerOrgTemplate\单位体检报告模板.docx";
if (!File.Exists(TemplateUrl))
_customerOrgReportManager.CreateCustomerOrgPeisTemplate();
#endregion
string documentUrl = _customerOrgReportManager.CreateCustomerOrgPeisFromTemplate(documentData);
return new GetUnitPhysicalExaminationReportExportWordDto
{
ReportUrl = documentUrl
};
}
/// <summary>
///
/// </summary>
[HttpPost("api/customerreport/createtemplate")]
public void CreateTemplate()
{
#region 判断是否存在模板
string TemplateUrl = System.AppDomain.CurrentDomain.BaseDirectory + @"\ReportFile\CustomerOrgTemplate\单位体检报告模板.docx";
if (!File.Exists(TemplateUrl))
_customerOrgReportManager.CreateCustomerOrgPeisTemplate();
#endregion
#region 生成报告
var documentData = new UnitPhysicalExaminationReportExportWordData
{
MedicalTitle = "2024年度长沙神豚",
MedicalTimes = 1,
MedicalStartDate = "2023年09月01日",
MedicalEndDate = "2024年04月09日",
TabulationDate = "2024年04月09日",
PrintDate = "2024年04月09日",
RegisterDetail = new InspectionPersonnel_Detail
{
AverageExamineRatio = "50%",
FemaleExamineRatio = "40%",
MaleExamineRatio = "40%",
FemaleNumber = 20,
FemaleRatio = "30%",
MaleNumber = 20,
MaleRatio = "30%",
OtherNumber = 20,
TotalNumber = 60
},
CheckedDetail = new InspectionPersonnel_Detail
{
AverageExamineRatio = "50%",
FemaleExamineRatio = "40%",
MaleExamineRatio = "40%",
FemaleNumber = 10,
FemaleRatio = "30%",
MaleNumber = 10,
MaleRatio = "30%",
OtherNumber = 10,
TotalNumber = 30
},
UnCheckedDetail = new InspectionPersonnel_Detail
{
AverageExamineRatio = "50%",
FemaleExamineRatio = "40%",
MaleExamineRatio = "40%",
FemaleNumber = 10,
FemaleRatio = "30%",
MaleNumber = 10,
MaleRatio = "30%",
OtherNumber = 10,
TotalNumber = 30
},
MedicalAbnormalResultStatistics = new List<UnitPhysicalExaminationReportExportWordData_MedicalAbnormalResultStatistics>(),
MedicalItemExamineSituations = new List<UnitPhysicalExaminationReportExportWordData_MedicalItemExamineSituation>(),
MedicalResultSummarys = new List<UnitPhysicalExaminationReportExportWordData_MedicalResultSummary>(),
MedicalTenAbnormalResults = new List<UnitPhysicalExaminationReportExportWordData_MedicalTenAbnormalResult>(),
MedicalUnCheckedStatistics = new List<UnitPhysicalExaminationReportExportWordData_MedicalUnCheckedStatistics>()
};
_customerOrgReportManager.CreateCustomerOrgPeisFromTemplate(documentData);
#endregion
}
///// <summary>
@ -2133,6 +2290,8 @@ namespace Shentun.Peis.CustomerReports
}

56
src/Shentun.Peis.Domain/DataHelper.cs

@ -14,6 +14,60 @@ namespace Shentun.Peis
{
public static class DataHelper
{
/// <summary>
/// 生成历次综述医生小结
/// </summary>
/// <param name="SumSummaryHeaders"></param>
/// <returns></returns>
public static string SetSumSummarys(List<SumSummaryHeader> SumSummaryHeaders)
{
StringBuilder msg = new StringBuilder();
if (SumSummaryHeaders.Count > 0)
{
foreach (var item in SumSummaryHeaders)
{
msg.Append("* " + item.SummaryTitle + ":" + "<br/>");
if (item.SumSummaryContents.Count > 0)
{
var SumSummaryContents = item.SumSummaryContents.ToList();
foreach (var item2 in SumSummaryContents)
{
msg.Append("(" + SumSummaryContents.IndexOf(item2) + 1 + ")" + item2.SummaryContent + "<br/>");
}
}
}
}
return msg.ToString();
}
/// <summary>
/// 生成总诊建议
/// </summary>
/// <param name="SumSummaryHeaders"></param>
/// <returns></returns>
public static string SetSumSuggestion(List<SumSuggestionHeader> SumSuggestionHeaders)
{
StringBuilder msg = new StringBuilder();
if (SumSuggestionHeaders.Count > 0)
{
foreach (var item in SumSuggestionHeaders)
{
msg.Append("* " + item.SumSuggestionContents + ":" + "<br/>");
if (item.SumSuggestionContents.Count > 0)
{
var SumSuggestionContents = item.SumSuggestionContents.ToList();
foreach (var item2 in SumSuggestionContents)
{
msg.Append("(" + SumSuggestionContents.IndexOf(item2) + 1 + ")" + item2.SuggestionContent + "<br/>");
}
}
}
}
return msg.ToString();
}
/// <summary>
/// 验证是否为空或者空字符串
/// </summary>
@ -570,5 +624,7 @@ namespace Shentun.Peis
#endregion
}
}

269
src/Shentun.Peis.Domain/ReportTemplates/ChartData.cs

@ -0,0 +1,269 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.Peis.ReportTemplates
{
public class Table4
{
public string DeptName { get; set; }
public string ProjectName { get; set; }
public int ProManNum { get; set; }
public int ProWomanNum { get; set; }
public int ProTotalmanNum { get; set; }
public int ManNum { get; set; }
public int WomanNum { get; set; }
public int TotalmanNum { get; set; }
public int ProManRate { get; set; }
public int ProWomanRate { get; set; }
public int ProTotalmanRate { get; set; }
}
public class Table5
{
public string PatientNo { get; set; }
public string PatientName { get; set; }
public string SexName { get; set; }
public string Age { get; set; }
public string Result { get; set; }
}
public class Table6
{
public string Conclusion { get; set; }
public string Credit { get; set; }
public int ManNum { get; set; }
public int WomanNum { get; set; }
public int TotalmanNum { get; set; }
public int ManRate { get; set; }
public int WomanRate { get; set; }
public int AvgRate { get; set; }
}
public class Table7
{
public string IcdName { get; set; }
public string Notes { get; set; }
}
public class Table8
{
public string PatientNo { get; set; }
public string PatientName { get; set; }
public string SexName { get; set; }
public string Age { get; set; }
public string DeptName { get; set; }
}
public class ChartData
{
public string Category
{
get;
set;
}
public double Expenses
{
get;
set;
}
public static List<ChartData> CreateCanadaExpenses()
{
var canada = new List<ChartData>();
canada.Add(new ChartData() { Category = "Food", Expenses = 100 });
canada.Add(new ChartData() { Category = "Housing", Expenses = 120 });
canada.Add(new ChartData() { Category = "Transportation", Expenses = 140 });
canada.Add(new ChartData() { Category = "Health Care", Expenses = 150 });
return canada;
}
public static List<ChartData> CreateUSAExpenses()
{
var usa = new List<ChartData>();
usa.Add(new ChartData() { Category = "Food", Expenses = 200 });
usa.Add(new ChartData() { Category = "Housing", Expenses = 150 });
usa.Add(new ChartData() { Category = "Transportation", Expenses = 110 });
usa.Add(new ChartData() { Category = "Health Care", Expenses = 100 });
return usa;
}
public static List<ChartData> CreateBrazilExpenses()
{
var brazil = new List<ChartData>();
brazil.Add(new ChartData() { Category = "Food", Expenses = 125 });
brazil.Add(new ChartData() { Category = "Housing", Expenses = 80 });
brazil.Add(new ChartData() { Category = "Transportation", Expenses = 110 });
brazil.Add(new ChartData() { Category = "Health Care", Expenses = 60 });
return brazil;
}
public static List<ChartData> CreateReferenceRate()
{
var brazil = new List<ChartData>();
brazil.Add(new ChartData() { Category = "未检", Expenses = 50 });
brazil.Add(new ChartData() { Category = "已检", Expenses = 50 });
return brazil;
}
public static List<ChartData> CreateReferenceRateSex()
{
var brazil = new List<ChartData>();
brazil.Add(new ChartData() { Category = "男性", Expenses = 50 });
brazil.Add(new ChartData() { Category = "女性", Expenses = 40 });
brazil.Add(new ChartData() { Category = "其他", Expenses = 10 });
return brazil;
}
public static List<ChartData> CreateDisease()
{
var brazil = new List<ChartData>();
brazil.Add(new ChartData() { Category = "疾病1", Expenses = 1 });
brazil.Add(new ChartData() { Category = "疾病2", Expenses = 22 });
brazil.Add(new ChartData() { Category = "疾病3", Expenses = 3 });
brazil.Add(new ChartData() { Category = "疾病4", Expenses = 4 });
brazil.Add(new ChartData() { Category = "疾病5", Expenses = 5 });
brazil.Add(new ChartData() { Category = "疾病6", Expenses = 6 });
brazil.Add(new ChartData() { Category = "疾病7", Expenses = 7 });
brazil.Add(new ChartData() { Category = "疾病8", Expenses = 8 });
brazil.Add(new ChartData() { Category = "疾病9", Expenses = 9 });
brazil.Add(new ChartData() { Category = "疾病10", Expenses = 10 });
return brazil;
}
public static List<ChartData> CreateException()
{
var brazil = new List<ChartData>();
brazil.Add(new ChartData() { Category = "疾病1", Expenses = 22 });
brazil.Add(new ChartData() { Category = "疾病2", Expenses = 22 });
brazil.Add(new ChartData() { Category = "疾病3", Expenses = 22 });
brazil.Add(new ChartData() { Category = "疾病4", Expenses = 4 });
brazil.Add(new ChartData() { Category = "疾病5", Expenses = 5 });
brazil.Add(new ChartData() { Category = "疾病6", Expenses = 6 });
brazil.Add(new ChartData() { Category = "疾病7", Expenses = 7 });
brazil.Add(new ChartData() { Category = "疾病8", Expenses = 8 });
brazil.Add(new ChartData() { Category = "疾病9", Expenses = 9 });
brazil.Add(new ChartData() { Category = "疾病10", Expenses = 10 });
return brazil;
}
public static List<Table4> CreateTable4()
{
var tb4 = new List<Table4>();
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "血常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "便常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
tb4.Add(new Table4() { DeptName = "门诊内科", ProjectName = "尿常规", ProManNum = 10, ProWomanNum = 3, ProTotalmanNum = 13, ManNum = 20, WomanNum = 6, TotalmanNum = 26, ProManRate = 50, ProWomanRate = 50, ProTotalmanRate = 50 });
return tb4;
}
public static List<Table5> CreateTable5()
{
var tb5 = new List<Table5>();
tb5.Add(new Table5() { PatientNo = "2401091235293785", PatientName = "李四", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293781", PatientName = "李四1", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293782", PatientName = "李四2", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293783", PatientName = "李四3", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293784", PatientName = "李四4", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293786", PatientName = "李四5", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293787", PatientName = "李四6", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293788", PatientName = "李四7", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293789", PatientName = "李四8", SexName = "男性", Age = "40岁", Result = "正常" });
tb5.Add(new Table5() { PatientNo = "2401091235293725", PatientName = "李四9", SexName = "男性", Age = "40岁", Result = "正常" });
return tb5;
}
public static List<Table6> CreateTable6()
{
var tb6 = new List<Table6>();
tb6.Add(new Table6() { Conclusion = "结论1", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论2", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论3", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论4", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论5", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论12", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论6", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论7", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论8", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
tb6.Add(new Table6() { Conclusion = "结论11", Credit = "张三,张三2,张三2,张三2,张三2,张三2,张三2,张三2", ManNum = 20, WomanNum = 6, TotalmanNum = 26, ManRate = 50, WomanRate = 50, AvgRate = 50 });
return tb6;
}
public static List<Table7> CreateTable7()
{
var tb = new List<Table7>();
tb.Add(new Table7() { IcdName = "XXXXXX疾病1", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病2", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病3", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病4", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病5", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病6", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病7", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病8", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病9", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
tb.Add(new Table7() { IcdName = "XXXXXX疾病10", Notes = "建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议建议" });
return tb;
}
public static List<Table8> CreateTable8()
{
var tb = new List<Table8>();
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四", SexName = "男性", Age = "40岁", DeptName = "放射科" });
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四1", SexName = "男性", Age = "40岁", DeptName = "放射科" });
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四2", SexName = "男性", Age = "40岁", DeptName = "放射科" });
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四3", SexName = "男性", Age = "40岁", DeptName = "放射科" });
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四4", SexName = "男性", Age = "40岁", DeptName = "放射科" });
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四5", SexName = "男性", Age = "40岁", DeptName = "放射科" });
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四6", SexName = "男性", Age = "40岁", DeptName = "放射科" });
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四7", SexName = "男性", Age = "40岁", DeptName = "放射科" });
tb.Add(new Table8() { PatientNo = "2401091235293785", PatientName = "李四8", SexName = "男性", Age = "40岁", DeptName = "放射科" });
return tb;
}
}
}

43
src/Shentun.Peis.Domain/ReportTemplates/CreateInspectionPersonnelPara.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.Peis.ReportTemplates
{
public class CreateInspectionPersonnelPara
{
/// <summary>
/// 单位ID 需要包含查出子级ID
/// </summary>
public Guid CustomerOrgId { get; set; }
/// <summary>
/// 单位体检次数ID
/// </summary>
public Guid CustomerOrgRegisterId { get; set; }
/// <summary>
///
/// </summary>
public List<Guid> CustomerOrgGroupId { get; set; } = new List<Guid>();
/// <summary>
/// 日期类型(1、登记日期 2、体检日期 3、总检日期)
/// </summary>
public char DateType { get; set; }
/// <summary>
/// 开始日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public string EndDate { get; set; }
}
}

2330
src/Shentun.Peis.Domain/ReportTemplates/CustomerOrgReportManager.cs
File diff suppressed because it is too large
View File

339
src/Shentun.Peis.Domain/ReportTemplates/UnitPhysicalExaminationReportExportWordData.cs

@ -0,0 +1,339 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.Peis.ReportTemplates
{
public class UnitPhysicalExaminationReportExportWordData
{
/// <summary>
/// 体检年度标题
/// </summary>
public string MedicalTitle { get; set; }
/// <summary>
/// 体检次数
/// </summary>
public int MedicalTimes { get; set; }
/// <summary>
/// 体检开始月份 格式:2009年09月
/// </summary>
public string MedicalStartDate { get; set; }
/// <summary>
/// 体检结束月份 格式:2009年09月
/// </summary>
public string MedicalEndDate { get; set; }
/// <summary>
/// 制表日期 格式:2009年09月09日
/// </summary>
public string TabulationDate { get; set; }
/// <summary>
/// 打印日期 格式:2009年09月09日
/// </summary>
public string PrintDate { get; set; }
/// <summary>
/// 登记明细 参加人员构成情况 第一部分
/// </summary>
public InspectionPersonnel_Detail RegisterDetail { get; set; }
/// <summary>
/// 实检明细 参加人员构成情况 第一部分
/// </summary>
public InspectionPersonnel_Detail CheckedDetail { get; set; }
/// <summary>
/// 未检明细 参加人员构成情况 第一部分
/// </summary>
public InspectionPersonnel_Detail UnCheckedDetail { get; set; }
/// <summary>
/// 体检项目得参检情况 第二部分
/// </summary>
public List<UnitPhysicalExaminationReportExportWordData_MedicalItemExamineSituation> MedicalItemExamineSituations { get; set; } = new List<UnitPhysicalExaminationReportExportWordData_MedicalItemExamineSituation>();
/// <summary>
/// 全体员工体检结果汇总 第三部分
/// </summary>
public List<UnitPhysicalExaminationReportExportWordData_MedicalResultSummary> MedicalResultSummarys { get; set; } = new List<UnitPhysicalExaminationReportExportWordData_MedicalResultSummary>();
/// <summary>
/// 体检异常结果检出统计 第四部分
/// </summary>
public List<UnitPhysicalExaminationReportExportWordData_MedicalAbnormalResultStatistics> MedicalAbnormalResultStatistics { get; set; } = new List<UnitPhysicalExaminationReportExportWordData_MedicalAbnormalResultStatistics>();
/// <summary>
/// 十大异常结果分析 第五部分
/// </summary>
public List<UnitPhysicalExaminationReportExportWordData_MedicalTenAbnormalResult> MedicalTenAbnormalResults { get; set; } = new List<UnitPhysicalExaminationReportExportWordData_MedicalTenAbnormalResult>();
/// <summary>
/// 体检者未完成情况 第六部分
/// </summary>
public List<UnitPhysicalExaminationReportExportWordData_MedicalUnCheckedStatistics> MedicalUnCheckedStatistics { get; set; } = new List<UnitPhysicalExaminationReportExportWordData_MedicalUnCheckedStatistics>();
}
/// <summary>
/// 检查明细 1
/// </summary>
public class InspectionPersonnel_Detail
{
/// <summary>
/// 男性人数
/// </summary>
public int MaleNumber { get; set; }
/// <summary>
/// 女性人数
/// </summary>
public int FemaleNumber { get; set; }
/// <summary>
/// 其他人数
/// </summary>
public int OtherNumber { get; set; }
/// <summary>
/// 合计人数
/// </summary>
public int TotalNumber { get; set; }
/// <summary>
/// 男性比例
/// </summary>
public string MaleRatio { get; set; }
/// <summary>
/// 女性比例
/// </summary>
public string FemaleRatio { get; set; }
/// <summary>
/// 男性参检比例
/// </summary>
public string MaleExamineRatio { get; set; }
/// <summary>
/// 女性参检比例
/// </summary>
public string FemaleExamineRatio { get; set; }
/// <summary>
/// 平均参检比例
/// </summary>
public string AverageExamineRatio { get; set; }
}
/// <summary>
/// 体检项目得参检情况 2
/// </summary>
public class UnitPhysicalExaminationReportExportWordData_MedicalItemExamineSituation
{
/// <summary>
/// 科室
/// </summary>
public string ItemTypeName { get; set; }
/// <summary>
/// 组合项目名称
/// </summary>
public string AsbitemName { get; set; }
/// <summary>
/// 男性该项目参检人数
/// </summary>
public int MaleAsbitemCheckNumber { get; set; }
/// <summary>
/// 女性该项目参检人数
/// </summary>
public int FemaleAsbitemCheckNumber { get; set; }
/// <summary>
/// 合计该项目参检人数
/// </summary>
public int TotalAsbitemCheckNumber { get; set; }
/// <summary>
/// 男性总体参检人数 所有项目
/// </summary>
public int MaleSumCheckNumber { get; set; }
/// <summary>
/// 女性总体参检人数 所有项目
/// </summary>
public int FemaleSumCheckNumber { get; set; }
/// <summary>
/// 合计总体参检人数 所有项目
/// </summary>
public int TotalSumCheckNumber { get; set; }
/// <summary>
/// 男性该项目参检比例
/// </summary>
public string MaleAsbitemCheckRatio { get; set; }
/// <summary>
/// 女性该项目参检比例
/// </summary>
public string FemaleAsbitemCheckRatio { get; set; }
/// <summary>
/// 合计该项目参检比例
/// </summary>
public string TotalAsbitemCheckRatio { get; set; }
}
/// <summary>
/// 全体员工体检结果汇总 统计已总检的名单 3
/// </summary>
public class UnitPhysicalExaminationReportExportWordData_MedicalResultSummary
{
/// <summary>
/// 档案号
/// </summary>
public string PatientNo { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set; }
/// <summary>
/// 性别
/// </summary>
public string SexName { get; set; }
/// <summary>
/// 年龄
/// </summary>
public string Age { get; set; }
/// <summary>
/// 体检结果
/// </summary>
public string MedicalResult { get; set; }
}
/// <summary>
/// 体检异常结果检出统计 4
/// </summary>
public class UnitPhysicalExaminationReportExportWordData_MedicalAbnormalResultStatistics
{
/// <summary>
/// 诊断名称
/// </summary>
public string DiagnosisName { get; set; }
/// <summary>
/// 人员名单 多个、组合到一起
/// </summary>
public string PatientDetail { get; set; }
/// <summary>
/// 男性人数
/// </summary>
public int MaleNumber { get; set; }
/// <summary>
/// 女性人数
/// </summary>
public int FemaleNumber { get; set; }
/// <summary>
/// 合计人数
/// </summary>
public int TotalNumber { get; set; }
/// <summary>
/// 男性比例
/// </summary>
public string MaleRatio { get; set; }
/// <summary>
/// 女性比例
/// </summary>
public string FemaleRatio { get; set; }
/// <summary>
/// 平均比例
/// </summary>
public string AverageRatio { get; set; }
}
/// <summary>
/// 十大异常结果分析 5
/// </summary>
public class UnitPhysicalExaminationReportExportWordData_MedicalTenAbnormalResult
{
/// <summary>
/// 诊断名称
/// </summary>
public string DiagnosisName { get; set; }
/// <summary>
/// 诊断建议
/// </summary>
public string DiagnosisSuggestion { get; set; }
}
/// <summary>
/// 体检者未完成情况 6
/// </summary>
public class UnitPhysicalExaminationReportExportWordData_MedicalUnCheckedStatistics
{
/// <summary>
/// 档案号
/// </summary>
public string PatientNo { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set; }
/// <summary>
/// 性别
/// </summary>
public string SexName { get; set; }
/// <summary>
/// 年龄
/// </summary>
public string Age { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DepartmentName { get; set; }
}
}

2
src/Shentun.Peis.Domain/Shentun.Peis.Domain.csproj

@ -13,8 +13,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DocX" Version="3.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="7.0.0" />
<PackageReference Include="System.IO.Packaging" Version="6.0.0" />
<PackageReference Include="Volo.Abp.Emailing" Version="6.0.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="6.0.0" />

12
src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

@ -87,7 +87,7 @@ public class PeisHttpApiHostModule : AbpModule
builder.SetAccessTokenLifetime(TimeSpan.FromDays(30)).SetRefreshTokenLifetime(TimeSpan.FromDays(60));
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
@ -175,7 +175,7 @@ public class PeisHttpApiHostModule : AbpModule
});
});
*/
}
private void ConfigureAuthentication(ServiceConfigurationContext context)
@ -425,13 +425,19 @@ public class PeisHttpApiHostModule : AbpModule
app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "ReportFile")),
RequestPath = "/ReportFile"
});
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "UpLoad")),
RequestPath = "/UpLoad"
});
//虚拟目录
app.UseStaticFiles(new StaticFileOptions

BIN
src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/Page1.jpg

After

Width: 524  |  Height: 167  |  Size: 31 KiB

BIN
src/Shentun.Peis.HttpApi.Host/ReportFile/CustomerOrgTemplate/logo_template.jpg

After

Width: 193  |  Height: 158  |  Size: 8.7 KiB

Loading…
Cancel
Save