Browse Source

0818

bjmzak
wxd 3 years ago
parent
commit
496355c1a3
  1. 18
      src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
  2. 2
      src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
  3. 2
      src/Shentun.Peis.Application/SysParmValues/SysParmValueAppService.cs
  4. 13
      src/Shentun.Peis.Domain/Models/Report.cs
  5. 16
      src/Shentun.Peis.Domain/Models/ReportFormat.cs
  6. 5
      src/Shentun.Peis.Domain/Models/ReportFormatTemplate.cs
  7. 5
      src/Shentun.Peis.Domain/Models/ReportPrinter.cs
  8. 2
      src/Shentun.Peis.Domain/PrintReports/PatientRegisterGuideReportDto.cs
  9. 33
      src/Shentun.Peis.Domain/SysParmValues/SysParmValueManager.cs
  10. 26
      src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs
  11. 11572
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20230817102124_i0817002.Designer.cs
  12. 140
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20230817102124_i0817002.cs
  13. 279
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
  14. 25
      src/Shentun.Peis.EntityFrameworkCore/PrintReports/PatientRegisterGuideReportRepository.cs

18
src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs

@ -741,6 +741,18 @@ namespace Shentun.Peis.PatientRegisters
}
/// <summary>
/// 批量修改指引单打印次数 原有基础上加1
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
[HttpPost("api/app/patientregister/updatepatientregisterguideprinttimesmany")]
public async Task UpdatePatientRegisterGuidePrintTimesManyAsync(List<Guid> Ids)
{
var entlist = await _repository.GetListAsync(m => Ids.Contains(m.Id));
entlist.ForEach(f => f.GuidePrintTimes = (f.GuidePrintTimes == null ? (short?)1 : (short?)(f.GuidePrintTimes + 1)));
}
/// <summary>
/// 导入体检名单操作
/// </summary>
@ -756,7 +768,7 @@ namespace Shentun.Peis.PatientRegisters
{
//自动创建部门
#region 转换性别、出生地、婚姻状况、民族数据、单位分组、人员类别、体检类别、性激素期限
//转换性别ID
@ -902,7 +914,7 @@ namespace Shentun.Peis.PatientRegisters
#region 判断重名逻辑 先不判断 直接生成新的
#endregion
#region 生成档案信息
@ -925,7 +937,7 @@ namespace Shentun.Peis.PatientRegisters
};
if (input.IsAutoCreatePatientNo == 'Y')
{

2
src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs

@ -18,7 +18,7 @@ namespace Shentun.Peis.PrintReports
/// 打印报告服务
/// </summary>
[ApiExplorerSettings(GroupName = "Work")]
//[Authorize]
[Authorize]
public class PrintReportAppService : ApplicationService
{
private readonly IPatientRegisterGuideReportRepository _patientRegisterGuideReportRepository;

2
src/Shentun.Peis.Application/SysParmValues/SysParmValueAppService.cs

@ -171,8 +171,6 @@ namespace Shentun.Peis.SysParmValues
else
{
//修改
entity.ParmValue = item.ParmValue;
entity.Remark = item.Remark;

13
src/Shentun.Peis.Domain/Models/Report.cs

@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using NPOI.SS.Formula.Functions;
using Shentun.Peis.Books;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -13,9 +14,10 @@ using Volo.Abp.Domain.Entities.Auditing;
namespace Shentun.Peis.Models
{
[Table("report")]
public class Report:AuditedEntity<string>, IDisplayName
public class Report : AuditedEntity<string>, IDisplayName
{
public Report() {
public Report()
{
}
@ -36,6 +38,13 @@ namespace Shentun.Peis.Models
[DefaultValue('N')]
public char IsActive { get; set; }
[InverseProperty(nameof(ReportFormat.Report))]
public virtual ICollection<ReportFormat> ReportFormats { get; set; }
[InverseProperty(nameof(ReportPrinter.Report))]
public virtual ICollection<ReportPrinter> ReportPrinters { get; set; }
public void SetId(string id)
{
Id = id;

16
src/Shentun.Peis.Domain/Models/ReportFormat.cs

@ -12,10 +12,11 @@ using Volo.Abp.Domain.Entities.Auditing;
namespace Shentun.Peis.Models
{
[Table("report_format")]
public class ReportFormat:AuditedEntity<string>, IDisplayName
public class ReportFormat : AuditedEntity<string>, IDisplayName
{
public ReportFormat() {
public ReportFormat()
{
}
@ -36,13 +37,20 @@ namespace Shentun.Peis.Models
[DefaultValue('N')]
public char IsDefault { get; set; }
[ForeignKey("ReportId")]
public Report Report { get; set; }
[ForeignKey(nameof(ReportId))]
[InverseProperty("ReportFormats")]
public virtual Report Report { get; set; }
[Column("report_id")]
[Comment("报表ID")]
public string ReportId { get; set; }
[InverseProperty(nameof(ReportFormatTemplate.ReportFormat))]
public virtual ICollection<ReportFormatTemplate> ReportFormatTemplates { get; set; }
public void SetId(string id)
{

5
src/Shentun.Peis.Domain/Models/ReportFormatTemplate.cs

@ -20,8 +20,9 @@ namespace Shentun.Peis.Models
[StringLength(16)]
public override string Id { get => base.Id; protected set => base.Id = value; }
[ForeignKey("ReportFormatId")]
public ReportFormat ReportFormat { get; set; }
[ForeignKey(nameof(ReportFormatId))]
[InverseProperty("ReportFormatTemplates")]
public virtual ReportFormat ReportFormat { get; set; }
[Column("report_format_id")]
[Comment("报表格式ID")]

5
src/Shentun.Peis.Domain/Models/ReportPrinter.cs

@ -28,8 +28,9 @@ namespace Shentun.Peis.Models
[StringLength(64)]
public string PrinterName { get; set; } = null!;
[ForeignKey("ReportId")]
public Report Report { get; set; }
[ForeignKey(nameof(ReportId))]
[InverseProperty("ReportPrinters")]
public virtual Report Report { get; set; }
[Column("report_id")]
[Comment("报表ID")]

2
src/Shentun.Peis.Domain/PrintReports/PatientRegisterGuideReportDto.cs

@ -125,6 +125,8 @@ namespace Shentun.Peis.PrintReports
/// </summary>
public string GuideName { get; set; }
public int DisplayOrder { get; set; }
public List<PatientRegisterGuideReport_Detail_Asbitem> Detail_Name { get; set; }
}

33
src/Shentun.Peis.Domain/SysParmValues/SysParmValueManager.cs

@ -15,11 +15,11 @@ namespace Shentun.Peis.SysParmValues
{
public class SysParmValueManager : DomainService
{
private readonly IRepository<SysParmValue> repository;
private readonly IRepository<SysParmValue> _sysParmValueRepository;
public SysParmValueManager(IRepository<SysParmValue> repository)
public SysParmValueManager(IRepository<SysParmValue> sysParmValueRepository)
{
this.repository = repository;
this._sysParmValueRepository = sysParmValueRepository;
}
/// <summary>
@ -55,8 +55,33 @@ namespace Shentun.Peis.SysParmValues
}
/// <summary>
/// 根据体检中心获取系统参数值(优先找体检中心的参数,未找到获取全局参数)
/// </summary>
/// <param name="OrganizationUnitId"></param>
/// <param name="SysParmId"></param>
/// <returns></returns>
public async Task<string> GetSysParmValueInOrOrganizationUnitId(Guid OrganizationUnitId, string SysParmId)
{
string msg = "";
var sysParmValueList = await _sysParmValueRepository.GetListAsync(m => m.SysParmId == SysParmId);
if (sysParmValueList.Any())
{
if (sysParmValueList.Where(m => m.OrganizationUnitId == OrganizationUnitId).Count() > 0)
{
msg = sysParmValueList.Where(m => m.OrganizationUnitId == OrganizationUnitId).FirstOrDefault().ParmValue;
}
else
{
msg = sysParmValueList.Where(m => m.OrganizationUnitId == Guid.Empty).FirstOrDefault().ParmValue;
}
}
return msg;
}
}
}

26
src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs

@ -2649,7 +2649,7 @@ public class PeisDbContext :
entity.HasComment("自定义报表主表");
entity.Property(e => e.IsActive).HasDefaultValueSql("N");
entity.Property(e => e.IsActive).HasDefaultValue('N');
entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
@ -2660,12 +2660,18 @@ public class PeisDbContext :
{
entity.HasComment("自定义报表格式表");
entity.Property(e => e.IsDefault).HasDefaultValueSql("N");
entity.Property(e => e.IsDefault).HasDefaultValue('N');
entity.Property(e => e.ReportId).IsFixedLength();
entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
//指定关系
entity.HasOne(d => d.Report)
.WithMany(p => p.ReportFormats)
.HasForeignKey(d => d.ReportId)
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_reportformat_report_1");
entity.ConfigureByConvention();
});
@ -2674,12 +2680,18 @@ public class PeisDbContext :
{
entity.HasComment("自定义报表格式模板表");
entity.Property(e => e.IsDefault).HasDefaultValueSql("N");
entity.Property(e => e.IsSystem).HasDefaultValueSql("N");
entity.Property(e => e.IsDefault).HasDefaultValue('N');
entity.Property(e => e.IsSystem).HasDefaultValue('N');
entity.Property(e => e.TemplateFileType).HasDefaultValueSql("1");
entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
//指定关系
entity.HasOne(d => d.ReportFormat)
.WithMany(p => p.ReportFormatTemplates)
.HasForeignKey(d => d.ReportFormatId)
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_reportformattemplate_reportprinter_1");
entity.ConfigureByConvention();
});
@ -2690,6 +2702,12 @@ public class PeisDbContext :
entity.Property(e => e.CreationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
//指定关系
entity.HasOne(d => d.Report)
.WithMany(p => p.ReportPrinters)
.HasForeignKey(d => d.ReportId)
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_reportprinter_report_1");
entity.ConfigureByConvention();
});

11572
src/Shentun.Peis.EntityFrameworkCore/Migrations/20230817102124_i0817002.Designer.cs
File diff suppressed because it is too large
View File

140
src/Shentun.Peis.EntityFrameworkCore/Migrations/20230817102124_i0817002.cs

@ -0,0 +1,140 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class i0817002 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "report",
columns: table => new
{
Id = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false, comment: "主键Id"),
display_name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true, comment: "报表名称"),
isActive = table.Column<char>(type: "character(1)", maxLength: 1, nullable: false, defaultValue: 'N', comment: "启用标志(N:禁用,Y:启用)"),
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, defaultValueSql: "(date(timezone('UTC-8'::text, now())) - 1)"),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_report", x => x.Id);
},
comment: "自定义报表主表");
migrationBuilder.CreateTable(
name: "report_format",
columns: table => new
{
Id = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false, comment: "主键Id"),
display_name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true, comment: "格式名称"),
isDefault = table.Column<char>(type: "character(1)", maxLength: 1, nullable: false, defaultValue: 'N', comment: "默认标志(N:不默认,Y:默认)"),
report_id = table.Column<string>(type: "character(16)", fixedLength: true, nullable: true, comment: "报表ID"),
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, defaultValueSql: "(date(timezone('UTC-8'::text, now())) - 1)"),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_report_format", x => x.Id);
table.ForeignKey(
name: "fk_reportformat_report_1",
column: x => x.report_id,
principalTable: "report",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
},
comment: "自定义报表格式表");
migrationBuilder.CreateTable(
name: "report_printer",
columns: table => new
{
Id = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false, comment: "主键Id"),
pc_name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true, comment: "计算机名称"),
printer_name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true, comment: "打印机名称"),
report_id = table.Column<string>(type: "character varying(16)", nullable: true, comment: "报表ID"),
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, defaultValueSql: "(date(timezone('UTC-8'::text, now())) - 1)"),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_report_printer", x => x.Id);
table.ForeignKey(
name: "fk_reportprinter_report_1",
column: x => x.report_id,
principalTable: "report",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
},
comment: "自定义报表客户端打印机设置表");
migrationBuilder.CreateTable(
name: "report_format_template",
columns: table => new
{
Id = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false, comment: "主键Id"),
report_format_id = table.Column<string>(type: "character varying(16)", nullable: true, comment: "报表格式ID"),
display_name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "模板名称"),
template_file_type = table.Column<char>(type: "character(1)", maxLength: 1, nullable: false, defaultValueSql: "1", comment: "模板文件类型(0:FastReport,1:Grid++Report)"),
template_file = table.Column<string>(type: "text", nullable: true, comment: "模板文件"),
data_set_json = table.Column<string>(type: "text", nullable: true, comment: "模板文件"),
isSystem = table.Column<char>(type: "character(1)", maxLength: 1, nullable: false, defaultValue: 'N', comment: "是否系统自定义(N:停用,Y:启用)"),
isDefault = table.Column<char>(type: "character(1)", maxLength: 1, nullable: false, defaultValue: 'N', comment: "是否默认(N:不默认,Y:默认)"),
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, defaultValueSql: "(date(timezone('UTC-8'::text, now())) - 1)"),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_report_format_template", x => x.Id);
table.ForeignKey(
name: "fk_reportformattemplate_reportprinter_1",
column: x => x.report_format_id,
principalTable: "report_format",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
},
comment: "自定义报表格式模板表");
migrationBuilder.CreateIndex(
name: "IX_report_format_report_id",
table: "report_format",
column: "report_id");
migrationBuilder.CreateIndex(
name: "IX_report_format_template_report_format_id",
table: "report_format_template",
column: "report_format_id");
migrationBuilder.CreateIndex(
name: "IX_report_printer_report_id",
table: "report_printer",
column: "report_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "report_format_template");
migrationBuilder.DropTable(
name: "report_printer");
migrationBuilder.DropTable(
name: "report_format");
migrationBuilder.DropTable(
name: "report");
}
}
}

279
src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -6362,6 +6362,240 @@ namespace Shentun.Peis.Migrations
b.HasComment("登记检查综述");
});
modelBuilder.Entity("Shentun.Peis.Models.Report", b =>
{
b.Property<string>("Id")
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasColumnName("Id")
.HasComment("主键Id");
b.Property<DateTime>("CreationTime")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp without time zone")
.HasColumnName("CreationTime")
.HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uuid")
.HasColumnName("CreatorId");
b.Property<string>("DisplayName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("display_name")
.HasComment("报表名称");
b.Property<char>("IsActive")
.ValueGeneratedOnAdd()
.HasMaxLength(1)
.HasColumnType("character(1)")
.HasDefaultValue('N')
.HasColumnName("isActive")
.HasComment("启用标志(N:禁用,Y:启用)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uuid")
.HasColumnName("LastModifierId");
b.HasKey("Id");
b.ToTable("report");
b.HasComment("自定义报表主表");
});
modelBuilder.Entity("Shentun.Peis.Models.ReportFormat", b =>
{
b.Property<string>("Id")
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasColumnName("Id")
.HasComment("主键Id");
b.Property<DateTime>("CreationTime")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp without time zone")
.HasColumnName("CreationTime")
.HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uuid")
.HasColumnName("CreatorId");
b.Property<string>("DisplayName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("display_name")
.HasComment("格式名称");
b.Property<char>("IsDefault")
.ValueGeneratedOnAdd()
.HasMaxLength(1)
.HasColumnType("character(1)")
.HasDefaultValue('N')
.HasColumnName("isDefault")
.HasComment("默认标志(N:不默认,Y:默认)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uuid")
.HasColumnName("LastModifierId");
b.Property<string>("ReportId")
.HasColumnType("character(16)")
.HasColumnName("report_id")
.IsFixedLength()
.HasComment("报表ID");
b.HasKey("Id");
b.HasIndex("ReportId");
b.ToTable("report_format");
b.HasComment("自定义报表格式表");
});
modelBuilder.Entity("Shentun.Peis.Models.ReportFormatTemplate", b =>
{
b.Property<string>("Id")
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasColumnName("Id")
.HasComment("主键Id");
b.Property<DateTime>("CreationTime")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp without time zone")
.HasColumnName("CreationTime")
.HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uuid")
.HasColumnName("CreatorId");
b.Property<string>("DataSetJson")
.HasColumnType("text")
.HasColumnName("data_set_json")
.HasComment("模板文件");
b.Property<string>("DisplayName")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("display_name")
.HasComment("模板名称");
b.Property<char>("IsDefault")
.ValueGeneratedOnAdd()
.HasMaxLength(1)
.HasColumnType("character(1)")
.HasDefaultValue('N')
.HasColumnName("isDefault")
.HasComment("是否默认(N:不默认,Y:默认)");
b.Property<char>("IsSystem")
.ValueGeneratedOnAdd()
.HasMaxLength(1)
.HasColumnType("character(1)")
.HasDefaultValue('N')
.HasColumnName("isSystem")
.HasComment("是否系统自定义(N:停用,Y:启用)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uuid")
.HasColumnName("LastModifierId");
b.Property<string>("ReportFormatId")
.HasColumnType("character varying(16)")
.HasColumnName("report_format_id")
.HasComment("报表格式ID");
b.Property<string>("TemplateFile")
.HasColumnType("text")
.HasColumnName("template_file")
.HasComment("模板文件");
b.Property<char>("TemplateFileType")
.ValueGeneratedOnAdd()
.HasMaxLength(1)
.HasColumnType("character(1)")
.HasColumnName("template_file_type")
.HasDefaultValueSql("1")
.HasComment("模板文件类型(0:FastReport,1:Grid++Report)");
b.HasKey("Id");
b.HasIndex("ReportFormatId");
b.ToTable("report_format_template");
b.HasComment("自定义报表格式模板表");
});
modelBuilder.Entity("Shentun.Peis.Models.ReportPrinter", b =>
{
b.Property<string>("Id")
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasColumnName("Id")
.HasComment("主键Id");
b.Property<string>("ComputerName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("pc_name")
.HasComment("计算机名称");
b.Property<DateTime>("CreationTime")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp without time zone")
.HasColumnName("CreationTime")
.HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uuid")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uuid")
.HasColumnName("LastModifierId");
b.Property<string>("PrinterName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("printer_name")
.HasComment("打印机名称");
b.Property<string>("ReportId")
.HasColumnType("character varying(16)")
.HasColumnName("report_id")
.HasComment("报表ID");
b.HasKey("Id");
b.HasIndex("ReportId");
b.ToTable("report_printer");
b.HasComment("自定义报表客户端打印机设置表");
});
modelBuilder.Entity("Shentun.Peis.Models.ResultStatus", b =>
{
b.Property<string>("Id")
@ -10455,6 +10689,39 @@ namespace Shentun.Peis.Migrations
b.Navigation("RegisterCheck");
});
modelBuilder.Entity("Shentun.Peis.Models.ReportFormat", b =>
{
b.HasOne("Shentun.Peis.Models.Report", "Report")
.WithMany("ReportFormats")
.HasForeignKey("ReportId")
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_reportformat_report_1");
b.Navigation("Report");
});
modelBuilder.Entity("Shentun.Peis.Models.ReportFormatTemplate", b =>
{
b.HasOne("Shentun.Peis.Models.ReportFormat", "ReportFormat")
.WithMany("ReportFormatTemplates")
.HasForeignKey("ReportFormatId")
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_reportformattemplate_reportprinter_1");
b.Navigation("ReportFormat");
});
modelBuilder.Entity("Shentun.Peis.Models.ReportPrinter", b =>
{
b.HasOne("Shentun.Peis.Models.Report", "Report")
.WithMany("ReportPrinters")
.HasForeignKey("ReportId")
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_reportprinter_report_1");
b.Navigation("Report");
});
modelBuilder.Entity("Shentun.Peis.Models.Room", b =>
{
b.HasOne("Shentun.Peis.Models.Department", "Department")
@ -11181,6 +11448,18 @@ namespace Shentun.Peis.Migrations
b.Navigation("RegisterCheckSummaries");
});
modelBuilder.Entity("Shentun.Peis.Models.Report", b =>
{
b.Navigation("ReportFormats");
b.Navigation("ReportPrinters");
});
modelBuilder.Entity("Shentun.Peis.Models.ReportFormat", b =>
{
b.Navigation("ReportFormatTemplates");
});
modelBuilder.Entity("Shentun.Peis.Models.ResultStatus", b =>
{
b.Navigation("RegisterCheckItems");

25
src/Shentun.Peis.EntityFrameworkCore/PrintReports/PatientRegisterGuideReportRepository.cs

@ -4,6 +4,7 @@ using Shentun.Peis.CustomerOrgs;
using Shentun.Peis.EntityFrameworkCore;
using Shentun.Peis.Models;
using Shentun.Peis.SumSummaryReports;
using Shentun.Peis.SysParmValues;
using System;
using System.Collections.Generic;
using System.Linq;
@ -23,29 +24,34 @@ namespace Shentun.Peis.PrintReports
private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository;
private static IRepository<RegisterAsbitem, Guid> _registerAsbitemRepository;
private readonly CustomerOrgManager _customerOrgManager;
private readonly SysParmValueManager _sysParmValueManager;
public PatientRegisterGuideReportRepository(IDbContextProvider<PeisDbContext> dbContextProvider,
IRepository<SysParmValue> sysParmValueRepository,
IRepository<CustomerOrg, Guid> customerOrgRepository,
IRepository<RegisterAsbitem, Guid> registerAsbitemRepository,
CustomerOrgManager customerOrgManager
CustomerOrgManager customerOrgManager,
SysParmValueManager sysParmValueManager
) : base(dbContextProvider)
{
this._sysParmValueRepository = sysParmValueRepository;
this._customerOrgRepository = customerOrgRepository;
_registerAsbitemRepository = registerAsbitemRepository;
this._customerOrgManager = customerOrgManager;
this._sysParmValueManager = sysParmValueManager;
}
public async Task<PatientRegisterGuideReportDto> GetPatientRegisterGuideReportAsync(Guid PatientRegisterId)
{
Guid OrOrganizationUnitId = (await GetAsync(f => f.Id == PatientRegisterId)).OrganizationUnitId.Value;
#region 系统参数配置
List<string> sysparmid = new List<string> { "medical_center_telphone", "medical_center_address", "medical_center_fax" };
var sysparmvaluelist = await _sysParmValueRepository.GetListAsync(m => sysparmid.Contains(m.SysParmId));
var MedicalCenterAddress = sysparmvaluelist.Where(ms => ms.SysParmId == "medical_center_address").FirstOrDefault().ParmValue;
var MedicalCenterFax = sysparmvaluelist.Where(ms => ms.SysParmId == "medical_center_fax").FirstOrDefault().ParmValue;
var MedicalCenterTelphone = sysparmvaluelist.Where(ms => ms.SysParmId == "medical_center_telphone").FirstOrDefault().ParmValue;
var MedicalCenterAddress = await _sysParmValueManager.GetSysParmValueInOrOrganizationUnitId(OrOrganizationUnitId,"medical_center_address");
var MedicalCenterFax = await _sysParmValueManager.GetSysParmValueInOrOrganizationUnitId(OrOrganizationUnitId, "medical_center_fax");
var MedicalCenterTelphone = await _sysParmValueManager.GetSysParmValueInOrOrganizationUnitId(OrOrganizationUnitId, "medical_center_telphone");
#endregion
var dbContext = await GetDbContextAsync();
@ -107,15 +113,16 @@ namespace Shentun.Peis.PrintReports
GuideName = s.Asbitem.ItemType.GuidType.DisplayName
})
.OrderBy(o => o.GuideDisplayOrder)
.GroupBy(g => g.GuideName)
.GroupBy(g => new { g.GuideName, g.GuideDisplayOrder })
.Select(s => new PatientRegisterGuideReport_Detail
{
GuideName = s.Key,
GuideName = s.Key.GuideName,
DisplayOrder = s.Key.GuideDisplayOrder,
Detail_Name = s.ToList().Select(ss => new PatientRegisterGuideReport_Detail_Asbitem
{
AsbitemName = ss.AsbitemName
}).ToList()
}).ToList();
}).OrderBy(o => o.DisplayOrder).ToList();
return entlist;

Loading…
Cancel
Save