DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
170a3d5d97
  1. 8
      src/Shentun.Peis.Application.Contracts/Asbitems/AsbitemDto.cs
  2. 2
      src/Shentun.Peis.Application/Asbitems/AsbitemAppService.cs
  3. 19
      src/Shentun.Peis.Application/ChargeReports/ChargeReportAppService.cs
  4. 2
      src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
  5. 2
      src/Shentun.Peis.Application/MedicalPackageDetails/MedicalPackageDetailAppService.cs
  6. 2
      src/Shentun.Peis.Application/SampleGroupDetails/SampleGroupDetailAppService.cs
  7. 24
      src/Shentun.Peis.Domain/Asbitems/Asbitem.cs
  8. 8
      src/Shentun.Peis.Domain/Asbitems/AsbitemEntity.cs
  9. 9
      src/Shentun.Peis.Domain/Asbitems/AsbitemManager.cs
  10. 63
      src/Shentun.Peis.Domain/CollectItemTypes/CollectItemType.cs
  11. 11
      src/Shentun.Peis.Domain/InvoiceItemTypes/InvoiceItemType.cs
  12. 12
      src/Shentun.Peis.Domain/InvoiceItemTypes/InvoiceItemTypeManager.cs
  13. 2
      src/Shentun.Peis.EntityFrameworkCore/CustomerOrgGroupDetails/CustomerOrgGroupDetailRepository.cs
  14. 8
      src/Shentun.Peis.EntityFrameworkCore/DbMapping/Asbitems/AsbitemDbMapping.cs
  15. 14136
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502112155_init20240502001.Designer.cs
  16. 114
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502112155_init20240502001.cs
  17. 14151
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502112642_init20240502002.Designer.cs
  18. 35
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502112642_init20240502002.cs
  19. 111
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

8
src/Shentun.Peis.Application.Contracts/Asbitems/AsbitemDto.cs

@ -42,10 +42,10 @@ namespace Shentun.Peis.Asbitems
public Guid? DeviceTypeId { get; set; }
/// <summary>
/// 发票类别
/// </summary>
public Guid InvoiceItemTypeId { get; set; }
///// <summary>
///// 发票类别
///// </summary>
//public Guid InvoiceItemTypeId { get; set; }
/// <summary>

2
src/Shentun.Peis.Application/Asbitems/AsbitemAppService.cs

@ -122,7 +122,7 @@ namespace Shentun.Peis.Asbitems
DisplayOrder = s.a.DisplayOrder,
ForSexId = s.a.ForSexId,
Id = s.a.Id,
InvoiceItemTypeId = s.a.InvoiceItemTypeId,
//InvoiceItemTypeId = s.a.InvoiceItemTypeId,
IsActive = s.a.IsActive,
IsBeforeEat = s.a.IsBeforeEat,
IsCheck = s.a.IsCheck,

19
src/Shentun.Peis.Application/ChargeReports/ChargeReportAppService.cs

@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using NPOI.SS.Formula.Functions;
using Shentun.Peis.Charges;
using Shentun.Peis.CollectItemTypes;
using Shentun.Peis.Enums;
using Shentun.Peis.ItemTypes;
using Shentun.Peis.Models;
@ -47,6 +48,7 @@ namespace Shentun.Peis.ChargeReports
private readonly IRepository<Patient, Guid> _patientRepository;
private readonly IRepository<Sex> _sexRepository;
private readonly ItemTypeManager _itemTypeManager;
private readonly IRepository<CollectItemType,Guid> _collectItemTypeRepository;
public ChargeReportAppService(
IRepository<Charge, Guid> chargeRepository,
IRepository<ChargeBack, Guid> chargeBackRepository,
@ -62,10 +64,12 @@ namespace Shentun.Peis.ChargeReports
IRepository<CustomerOrgRegister, Guid> customerOrgRegisterRepository,
IRepository<CustomerOrg, Guid> customerOrgRepository,
IRepository<ItemType, Guid> itemTypeRepository,
ItemTypeManager itemTypeManager
,
ItemTypeManager itemTypeManager,
IRepository<Patient, Guid> patientRepository,
IRepository<Sex> sexRepository)
IRepository<Sex> sexRepository
,
IRepository<CollectItemType, Guid> collectItemTypeRepository
)
{
_chargeRepository = chargeRepository;
_chargeBackRepository = chargeBackRepository;
@ -84,6 +88,7 @@ namespace Shentun.Peis.ChargeReports
_itemTypeManager = itemTypeManager;
_patientRepository = patientRepository;
_sexRepository = sexRepository;
_collectItemTypeRepository = collectItemTypeRepository;
}
@ -262,7 +267,7 @@ namespace Shentun.Peis.ChargeReports
join b in await _chargeAsbitemRepository.GetQueryableAsync() on a.Id equals b.ChargeId
join c in await _asbitemRepository.GetQueryableAsync() on b.AsbitemId equals c.Id into cc
from ac in cc.DefaultIfEmpty()
join e in await _invoiceItemTypeRepository.GetQueryableAsync() on ac.InvoiceItemTypeId equals e.Id into ee
join e in await _collectItemTypeRepository.GetQueryableAsync() on ac.CollectItemTypeId equals e.Id into ee
from ae in ee.DefaultIfEmpty()
join d in await _userRepository.GetQueryableAsync() on a.CreatorId equals d.Id into dd
from ad in dd.DefaultIfEmpty()
@ -287,7 +292,7 @@ namespace Shentun.Peis.ChargeReports
}
//收费归总
var chargeDetails = chargeQuery.GroupBy(g => g.ac.InvoiceItemTypeId).Select(s => new GetTollCollectorFeeReportInInvoiceType_InvoiceTypeDetail
var chargeDetails = chargeQuery.GroupBy(g => g.ac.CollectItemTypeId).Select(s => new GetTollCollectorFeeReportInInvoiceType_InvoiceTypeDetail
{
InvoiceTypeName = s.FirstOrDefault().InvoiceItemTypeName,
InvoiceTypeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.b.Amount * ss.b.ChargePrice), 2)
@ -301,7 +306,7 @@ namespace Shentun.Peis.ChargeReports
join c in await _chargeAsbitemRepository.GetQueryableAsync() on b.Id equals c.ChargeId
join d in await _asbitemRepository.GetQueryableAsync() on c.AsbitemId equals d.Id into dd
from ad in dd.DefaultIfEmpty()
join e in await _invoiceItemTypeRepository.GetQueryableAsync() on ad.InvoiceItemTypeId equals e.Id into ee
join e in await _collectItemTypeRepository.GetQueryableAsync() on ad.CollectItemTypeId equals e.Id into ee
from ae in ee.DefaultIfEmpty()
join f in await _userRepository.GetQueryableAsync() on a.CreatorId equals f.Id into ff
from af in ff.DefaultIfEmpty()
@ -326,7 +331,7 @@ namespace Shentun.Peis.ChargeReports
}
//收费归总
var chargeBackDetails = chargeBackQuery.GroupBy(g => g.ad.InvoiceItemTypeId).Select(s => new GetTollCollectorFeeReportInInvoiceType_InvoiceTypeDetail
var chargeBackDetails = chargeBackQuery.GroupBy(g => g.ad.CollectItemTypeId).Select(s => new GetTollCollectorFeeReportInInvoiceType_InvoiceTypeDetail
{
InvoiceTypeName = s.FirstOrDefault().InvoiceItemTypeName,
InvoiceTypeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.c.Amount * ss.c.ChargePrice), 2)

2
src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs

@ -788,7 +788,7 @@ namespace Shentun.Peis.DataMigrations
DeviceTypeId = deviceTypeId,
ClinicalMeaning = row["clinical_meaning"].ToString(),
ForSexId = ConvertForSex(row["for_sex_id"].ToString()),
InvoiceItemTypeId = InvoiceItemTypeId,
//InvoiceItemTypeId = InvoiceItemTypeId,
IsBeforeEat = Convert.ToChar(row["before_eat_flag"].ToString()),
IsCheck = Convert.ToChar(row["check_flag"].ToString()),
IsItemResultMerger = Convert.ToChar(row["item_result_merger_flag"].ToString()),

2
src/Shentun.Peis.Application/MedicalPackageDetails/MedicalPackageDetailAppService.cs

@ -128,7 +128,7 @@ namespace Shentun.Peis.MedicalPackageDetails
DisplayOrder = s.Asbitem.DisplayOrder,
ForSexId = s.Asbitem.ForSexId,
Id = s.Asbitem.Id,
InvoiceItemTypeId = s.Asbitem.InvoiceItemTypeId,
//InvoiceItemTypeId = s.Asbitem.InvoiceItemTypeId,
IsActive = s.Asbitem.IsActive,
IsBeforeEat = s.Asbitem.IsBeforeEat,
IsCheck = s.Asbitem.IsCheck,

2
src/Shentun.Peis.Application/SampleGroupDetails/SampleGroupDetailAppService.cs

@ -128,7 +128,7 @@ namespace Shentun.Peis.SampleGroupDetails
DisplayOrder = s.Asbitem.DisplayOrder,
ForSexId = s.Asbitem.ForSexId,
Id = s.Asbitem.Id,
InvoiceItemTypeId = s.Asbitem.InvoiceItemTypeId,
//InvoiceItemTypeId = s.Asbitem.InvoiceItemTypeId,
IsActive = s.Asbitem.IsActive,
IsBeforeEat = s.Asbitem.IsBeforeEat,
IsCheck = s.Asbitem.IsCheck,

24
src/Shentun.Peis.Domain/Asbitems/Asbitem.cs

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.CollectItemTypes;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@ -59,10 +60,17 @@ namespace Shentun.Peis.Models
[Column("device_type_id")]
public Guid? DeviceTypeId { get; set; }
/// <summary>
/// 发票类别
///// 发票类别
///// </summary>
//[Column("invoice_item_type_id")]
//public Guid InvoiceItemTypeId { get; set; }
/// <summary>
/// 汇总项目类别ID
/// </summary>
[Column("invoice_item_type_id")]
public Guid InvoiceItemTypeId { get; set; }
[Column("collect_item_type_id")]
public Guid CollectItemTypeId { get; set; }
/// <summary>
/// 项目结果合并
/// </summary>
@ -139,9 +147,14 @@ namespace Shentun.Peis.Models
public string ConcurrencyStamp { get; set; }
[ForeignKey(nameof(InvoiceItemTypeId))]
//[ForeignKey(nameof(InvoiceItemTypeId))]
//[InverseProperty("Asbitems")]
//public virtual InvoiceItemType InvoiceItemType { get; set; }
[ForeignKey(nameof(CollectItemTypeId))]
[InverseProperty("Asbitems")]
public virtual InvoiceItemType InvoiceItemType { get; set; } = null!;
public virtual CollectItemType CollectItemType { get; set; }
[ForeignKey(nameof(ItemTypeId))]
[InverseProperty("Asbitems")]
public virtual ItemType ItemType { get; set; } = null!;
@ -165,6 +178,7 @@ namespace Shentun.Peis.Models
[ForeignKey("AsbitemId")]
[InverseProperty(nameof(Room.Asbitems))]
public virtual ICollection<Room> Rooms { get; set; }
#region 审计属性

8
src/Shentun.Peis.Domain/Asbitems/AsbitemEntity.cs

@ -41,10 +41,10 @@ namespace Shentun.Peis.Asbitems
public Guid? DeviceTypeId { get; set; }
/// <summary>
/// 发票类别
/// </summary>
public Guid InvoiceItemTypeId { get; set; }
///// <summary>
///// 发票类别
///// </summary>
//public Guid InvoiceItemTypeId { get; set; }
/// <summary>

9
src/Shentun.Peis.Domain/Asbitems/AsbitemManager.cs

@ -87,7 +87,8 @@ namespace Shentun.Peis.Asbitems
DeviceTypeId = entity.DeviceTypeId,
DiagnosisFunction = entity.DiagnosisFunction,
ForSexId = entity.ForSexId,
InvoiceItemTypeId = entity.InvoiceItemTypeId,
//InvoiceItemTypeId = entity.InvoiceItemTypeId,
CollectItemTypeId = entity.CollectItemTypeId,
IsActive = entity.IsActive,
IsBeforeEat = entity.IsBeforeEat,
IsCheck = entity.IsCheck,
@ -127,7 +128,7 @@ namespace Shentun.Peis.Asbitems
targetEntity.DeviceTypeId = sourceEntity.DeviceTypeId;
targetEntity.DiagnosisFunction = sourceEntity.DiagnosisFunction;
targetEntity.ForSexId = sourceEntity.ForSexId;
targetEntity.InvoiceItemTypeId = sourceEntity.InvoiceItemTypeId;
targetEntity.CollectItemTypeId = sourceEntity.CollectItemTypeId;
targetEntity.IsActive = sourceEntity.IsActive;
targetEntity.IsBeforeEat = sourceEntity.IsBeforeEat;
targetEntity.IsCheck = sourceEntity.IsCheck;
@ -154,9 +155,9 @@ namespace Shentun.Peis.Asbitems
DataHelper.CheckEntityIsNull(entity);
DataHelper.CheckStringIsNull(entity.DisplayName, "名称");
DataHelper.CheckForSex(entity.ForSexId);
DataHelper.CheckGuidIsDefaultValue(entity.ItemTypeId, "项目类别");
DataHelper.CheckGuidIsDefaultValue(entity.InvoiceItemTypeId, "发票类别");
DataHelper.CheckGuidIsDefaultValue(entity.CollectItemTypeId, "汇总项目类别");
DataHelper.CheckCharIsYOrN(entity.IsItemResultMerger, "是否合并项目结果");
DataHelper.CheckCharIsYOrN(entity.IsBeforeEat, "是否餐前项目");
DataHelper.CheckCharIsYOrN(entity.IsDiagnosisFunction, "是否启用诊断函数");

63
src/Shentun.Peis.Domain/CollectItemTypes/CollectItemType.cs

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Domain.Entities;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using Shentun.Peis.Models;
namespace Shentun.Peis.CollectItemTypes
{
/// <summary>
/// 汇总项目类别
/// </summary>
[Table("collect_item_type")]
public class CollectItemType : AuditedEntity<Guid>, IDisplayName, IDisplayOrder, IHasConcurrencyStamp
{
public CollectItemType(Guid id) : base(id)
{
}
public CollectItemType()
{
Asbitems = new HashSet<Asbitem>();
}
/// <summary>
/// 名称
/// </summary>
[Column("display_name")]
[StringLength(50)]
public string DisplayName { get; set; }
[Column("simple_code")]
[StringLength(50)]
public string SimpleCode { get; set; }
[Column("display_order")]
public int DisplayOrder { get; set; }
/// <summary>
/// 发票项目类别ID
/// </summary>
[Column("invoice_item_type_id")]
public Guid InvoiceItemTypeId { get; set; }
[Column("concurrency_stamp")]
public string ConcurrencyStamp { get; set; }
[ForeignKey(nameof(InvoiceItemTypeId))]
public virtual InvoiceItemType InvoiceItemType { get; set; }
[InverseProperty(nameof(Asbitem.CollectItemType))]
public virtual ICollection<Asbitem> Asbitems { get; set; }
}
}

11
src/Shentun.Peis.Domain/InvoiceItemTypes/InvoiceItemType.cs

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.CollectItemTypes;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;
@ -17,8 +18,8 @@ namespace Shentun.Peis.Models
{
public InvoiceItemType()
{
Asbitems = new HashSet<Asbitem>();
PriceItems = new HashSet<PriceItem>();
CollectItemTypes = new HashSet<CollectItemType>();
}
/// <summary>
@ -47,11 +48,15 @@ namespace Shentun.Peis.Models
[Column("concurrency_stamp")]
public string ConcurrencyStamp { get; set; }
[InverseProperty(nameof(Asbitem.InvoiceItemType))]
public virtual ICollection<Asbitem> Asbitems { get; set; }
//[InverseProperty(nameof(Asbitem.InvoiceItemType))]
//public virtual ICollection<Asbitem> Asbitems { get; set; }
[InverseProperty(nameof(PriceItem.InvoiceItemType))]
public virtual ICollection<PriceItem> PriceItems { get; set; }
[InverseProperty(nameof(CollectItemType.InvoiceItemType))]
public virtual ICollection<CollectItemType> CollectItemTypes { get; set; }
//public override object[] GetKeys()
//{
// return new object[] { InvoiceItemTypeId };

12
src/Shentun.Peis.Domain/InvoiceItemTypes/InvoiceItemTypeManager.cs

@ -1,4 +1,5 @@
using Shentun.Peis.HelperDto;
using Shentun.Peis.CollectItemTypes;
using Shentun.Peis.HelperDto;
using Shentun.Peis.Models;
using Shentun.Utilities;
using System;
@ -20,14 +21,17 @@ namespace Shentun.Peis.InvoiceItemTypes
{
private readonly IRepository<InvoiceItemType, Guid> _repository;
private readonly IRepository<Asbitem, Guid> _asbitemRepository;
private readonly IRepository<CollectItemType, Guid> _collectItemTypeRepository;
public InvoiceItemTypeManager(
IRepository<InvoiceItemType, Guid> repository,
IRepository<Asbitem, Guid> asbitemRepository
)
,
IRepository<CollectItemType, Guid> collectItemTypeRepository)
{
this._repository = repository;
this._asbitemRepository = asbitemRepository;
_collectItemTypeRepository = collectItemTypeRepository;
}
/// <summary>
/// 创建
@ -109,11 +113,11 @@ namespace Shentun.Peis.InvoiceItemTypes
/// <exception cref="UserFriendlyException"></exception>
public async Task CheckAndDeleteAsync(InvoiceItemType entity)
{
var queryable = await _asbitemRepository.GetQueryableAsync();
var queryable = await _collectItemTypeRepository.GetQueryableAsync();
var item = queryable.Where(o => o.InvoiceItemTypeId.Equals(entity.Id)).FirstOrDefault();
if (item != null)
{
throw new BusinessException("", $"发票项目类别\"{entity.DisplayName}\"已在组合项目\"{item.DisplayName}\"中使用,不能删除");
throw new BusinessException("", $"发票项目类别\"{entity.DisplayName}\"已在汇总项目\"{item.DisplayName}\"中使用,不能删除");
}
await _repository.DeleteAsync(entity);

2
src/Shentun.Peis.EntityFrameworkCore/CustomerOrgGroupDetails/CustomerOrgGroupDetailRepository.cs

@ -61,7 +61,7 @@ namespace Shentun.Peis.CustomerOrgGroupDetails
DisplayName = b.DisplayName,
DisplayOrder = b.DisplayOrder,
ForSexId = b.ForSexId,
InvoiceItemTypeId = b.InvoiceItemTypeId,
//InvoiceItemTypeId = b.InvoiceItemTypeId,
IsActive = b.IsActive,
IsBeforeEat = b.IsBeforeEat,
IsCheck = b.IsCheck,

8
src/Shentun.Peis.EntityFrameworkCore/DbMapping/Asbitems/AsbitemDbMapping.cs

@ -22,7 +22,7 @@ namespace Shentun.Peis.DbMapping
entity.Property(t => t.ItemTypeId).HasComment("项目类别").IsRequired().IsFixedLength();
entity.Property(t => t.Price).HasComment("价格").IsRequired().HasDefaultValueSql("0");
entity.Property(t => t.DeviceTypeId).HasComment("仪器类别");
entity.Property(t => t.InvoiceItemTypeId).HasComment("发票类别").IsRequired().IsFixedLength();
entity.Property(t => t.CollectItemTypeId).HasComment("汇总项目类别").IsRequired().IsFixedLength();
entity.Property(t => t.IsItemResultMerger).HasComment("项目结果合并").IsRequired().HasDefaultValueSql("'N'");
entity.Property(t => t.IsBeforeEat).HasComment("餐前项目").IsRequired().HasDefaultValueSql("'N'");
entity.Property(t => t.ClinicalMeaning).HasComment("临床意义");
@ -40,11 +40,11 @@ namespace Shentun.Peis.DbMapping
.IsFixedLength()
.HasComment("编号").HasColumnName("id");
entity.HasOne(d => d.InvoiceItemType)
entity.HasOne(d => d.CollectItemType)
.WithMany(p => p.Asbitems)
.HasForeignKey(d => d.InvoiceItemTypeId)
.HasForeignKey(d => d.CollectItemTypeId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_asbitem_invoice_item_type");
.HasConstraintName("fk_asbitem_collect_item_type");
entity.HasOne(d => d.ItemType)
.WithMany(p => p.Asbitems)

14136
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502112155_init20240502001.Designer.cs
File diff suppressed because it is too large
View File

114
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502112155_init20240502001.cs

@ -0,0 +1,114 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class init20240502001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_asbitem_invoice_item_type",
table: "asbitem");
migrationBuilder.DropPrimaryKey(
name: "PK_third_interface",
table: "third_interface");
migrationBuilder.DropIndex(
name: "IX_asbitem_invoice_item_type_id",
table: "asbitem");
migrationBuilder.DropColumn(
name: "invoice_item_type_id",
table: "asbitem");
migrationBuilder.AddColumn<Guid>(
name: "collect_item_type_id",
table: "asbitem",
type: "uuid",
fixedLength: true,
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
comment: "汇总项目类别");
migrationBuilder.AddPrimaryKey(
name: "PK_third_interface",
table: "third_interface",
column: "id");
migrationBuilder.CreateTable(
name: "collect_item_type",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
display_name = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
simple_code = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
display_order = table.Column<int>(type: "integer", nullable: false),
invoice_item_type_id = table.Column<Guid>(type: "uuid", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
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_collect_item_type", x => x.Id);
table.ForeignKey(
name: "FK_collect_item_type_invoice_item_type_invoice_item_type_id",
column: x => x.invoice_item_type_id,
principalTable: "invoice_item_type",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_collect_item_type_invoice_item_type_id",
table: "collect_item_type",
column: "invoice_item_type_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "collect_item_type");
migrationBuilder.DropPrimaryKey(
name: "PK_third_interface",
table: "third_interface");
migrationBuilder.DropColumn(
name: "collect_item_type_id",
table: "asbitem");
migrationBuilder.AddColumn<Guid>(
name: "invoice_item_type_id",
table: "asbitem",
type: "uuid",
fixedLength: true,
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
comment: "发票类别");
migrationBuilder.AddPrimaryKey(
name: "PK_third_interface",
table: "third_interface",
column: "medical_center_id");
migrationBuilder.CreateIndex(
name: "IX_asbitem_invoice_item_type_id",
table: "asbitem",
column: "invoice_item_type_id");
migrationBuilder.AddForeignKey(
name: "fk_asbitem_invoice_item_type",
table: "asbitem",
column: "invoice_item_type_id",
principalTable: "invoice_item_type",
principalColumn: "id");
}
}
}

14151
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502112642_init20240502002.Designer.cs
File diff suppressed because it is too large
View File

35
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502112642_init20240502002.cs

@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class init20240502002 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_asbitem_collect_item_type_id",
table: "asbitem",
column: "collect_item_type_id");
migrationBuilder.AddForeignKey(
name: "fk_asbitem_collect_item_type",
table: "asbitem",
column: "collect_item_type_id",
principalTable: "collect_item_type",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_asbitem_collect_item_type",
table: "asbitem");
migrationBuilder.DropIndex(
name: "IX_asbitem_collect_item_type_id",
table: "asbitem");
}
}
}

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

@ -414,6 +414,58 @@ namespace Shentun.Peis.Migrations
b.ToTable("test_ct");
});
modelBuilder.Entity("Shentun.Peis.CollectItemTypes.CollectItemType", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("character varying(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uuid")
.HasColumnName("CreatorId");
b.Property<string>("DisplayName")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("display_name");
b.Property<int>("DisplayOrder")
.HasColumnType("integer")
.HasColumnName("display_order");
b.Property<Guid>("InvoiceItemTypeId")
.HasColumnType("uuid")
.HasColumnName("invoice_item_type_id");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uuid")
.HasColumnName("LastModifierId");
b.Property<string>("SimpleCode")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("simple_code");
b.HasKey("Id");
b.HasIndex("InvoiceItemTypeId");
b.ToTable("collect_item_type");
});
modelBuilder.Entity("Shentun.Peis.Models.AbpUserDepartment", b =>
{
b.Property<Guid>("UserId")
@ -469,6 +521,12 @@ namespace Shentun.Peis.Migrations
.HasColumnName("clinical_meaning")
.HasComment("临床意义");
b.Property<Guid>("CollectItemTypeId")
.HasColumnType("uuid")
.HasColumnName("collect_item_type_id")
.IsFixedLength()
.HasComment("汇总项目类别");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
@ -520,12 +578,6 @@ namespace Shentun.Peis.Migrations
.HasDefaultValueSql("'A'")
.HasComment("适用性别,M-男,F-女,A-全部");
b.Property<Guid>("InvoiceItemTypeId")
.HasColumnType("uuid")
.HasColumnName("invoice_item_type_id")
.IsFixedLength()
.HasComment("发票类别");
b.Property<char>("IsActive")
.ValueGeneratedOnAdd()
.HasMaxLength(1)
@ -627,7 +679,7 @@ namespace Shentun.Peis.Migrations
b.HasKey("Id");
b.HasIndex("InvoiceItemTypeId");
b.HasIndex("CollectItemTypeId");
b.HasIndex("ItemTypeId");
@ -10156,10 +10208,11 @@ namespace Shentun.Peis.Migrations
modelBuilder.Entity("Shentun.Peis.Models.ThirdInterface", b =>
{
b.Property<Guid>("MedicalCenterId")
.ValueGeneratedOnAdd()
b.Property<Guid>("Id")
.HasColumnType("uuid")
.HasColumnName("medical_center_id");
.HasColumnName("id")
.IsFixedLength()
.HasComment("编号");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -10188,12 +10241,6 @@ namespace Shentun.Peis.Migrations
.HasColumnName("display_order")
.HasComment("显示顺序");
b.Property<Guid>("Id")
.HasColumnType("uuid")
.HasColumnName("id")
.IsFixedLength()
.HasComment("编号");
b.Property<char>("IsActive")
.HasMaxLength(1)
.HasColumnType("character(1)")
@ -10210,6 +10257,10 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid")
.HasColumnName("last_modifier_id");
b.Property<Guid>("MedicalCenterId")
.HasColumnType("uuid")
.HasColumnName("medical_center_id");
b.Property<string>("ParmValue")
.HasMaxLength(2000)
.HasColumnType("character varying(2000)")
@ -10222,7 +10273,7 @@ namespace Shentun.Peis.Migrations
.HasColumnName("third_interface_type")
.HasComment("接口类型");
b.HasKey("MedicalCenterId");
b.HasKey("Id");
b.ToTable("third_interface");
@ -12319,13 +12370,24 @@ namespace Shentun.Peis.Migrations
b.Navigation("TestAs");
});
modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b =>
modelBuilder.Entity("Shentun.Peis.CollectItemTypes.CollectItemType", b =>
{
b.HasOne("Shentun.Peis.Models.InvoiceItemType", "InvoiceItemType")
.WithMany("Asbitems")
.WithMany("CollectItemTypes")
.HasForeignKey("InvoiceItemTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InvoiceItemType");
});
modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b =>
{
b.HasOne("Shentun.Peis.CollectItemTypes.CollectItemType", "CollectItemType")
.WithMany("Asbitems")
.HasForeignKey("CollectItemTypeId")
.IsRequired()
.HasConstraintName("fk_asbitem_invoice_item_type");
.HasConstraintName("fk_asbitem_collect_item_type");
b.HasOne("Shentun.Peis.Models.ItemType", "ItemType")
.WithMany("Asbitems")
@ -12333,7 +12395,7 @@ namespace Shentun.Peis.Migrations
.IsRequired()
.HasConstraintName("fk_asbitem_item_type");
b.Navigation("InvoiceItemType");
b.Navigation("CollectItemType");
b.Navigation("ItemType");
});
@ -13659,6 +13721,11 @@ namespace Shentun.Peis.Migrations
b.Navigation("TestBs");
});
modelBuilder.Entity("Shentun.Peis.CollectItemTypes.CollectItemType", b =>
{
b.Navigation("Asbitems");
});
modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b =>
{
b.Navigation("AsbitemDetails");
@ -13826,7 +13893,7 @@ namespace Shentun.Peis.Migrations
modelBuilder.Entity("Shentun.Peis.Models.InvoiceItemType", b =>
{
b.Navigation("Asbitems");
b.Navigation("CollectItemTypes");
b.Navigation("PriceItems");
});

Loading…
Cancel
Save