Browse Source

汇总项目类别

bjmzak
wxd 2 years ago
parent
commit
08bd4ee1c4
  1. 9
      src/Shentun.Peis.Application/CollectItemTypes/CollectItemTypeAppService.cs
  2. 2
      src/Shentun.Peis.Domain/CollectItemTypes/CollectItemType.cs
  3. 33
      src/Shentun.Peis.EntityFrameworkCore/DbMapping/CollectItemTypes/CollectItemTypeDbMapping.cs
  4. 7
      src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs
  5. 14165
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502143341_init20240502003.Designer.cs
  6. 242
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502143341_init20240502003.cs
  7. 152
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

9
src/Shentun.Peis.Application/CollectItemTypes/CollectItemTypeAppService.cs

@ -24,18 +24,19 @@ namespace Shentun.Peis.CollectItemTypes
public class CollectItemTypeAppService : ApplicationService public class CollectItemTypeAppService : ApplicationService
{ {
private readonly IRepository<CollectItemType, Guid> _collectItemTypeRepository; private readonly IRepository<CollectItemType, Guid> _collectItemTypeRepository;
private readonly CollectItemTypeManager _manager;
private readonly CacheService _cacheService; private readonly CacheService _cacheService;
private readonly CollectItemTypeManager _manager;
private readonly IRepository<IdentityUser, Guid> _userRepository; private readonly IRepository<IdentityUser, Guid> _userRepository;
public CollectItemTypeAppService( public CollectItemTypeAppService(
IRepository<CollectItemType, Guid> collectItemTypeRepository, IRepository<CollectItemType, Guid> collectItemTypeRepository,
IRepository<IdentityUser, Guid> userRepository, IRepository<IdentityUser, Guid> userRepository,
CollectItemTypeManager manager)
CollectItemTypeManager manager,
CacheService cacheService)
{ {
_collectItemTypeRepository = collectItemTypeRepository; _collectItemTypeRepository = collectItemTypeRepository;
_userRepository = userRepository;
_cacheService = cacheService;
_manager = manager; _manager = manager;
_userRepository = userRepository;
} }
/// <summary> /// <summary>

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

@ -9,7 +9,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Shentun.Peis.Models; using Shentun.Peis.Models;
namespace Shentun.Peis.CollectItemTypes
namespace Shentun.Peis.Models
{ {
/// <summary> /// <summary>
/// 汇总项目类别 /// 汇总项目类别

33
src/Shentun.Peis.EntityFrameworkCore/DbMapping/CollectItemTypes/CollectItemTypeDbMapping.cs

@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Shentun.Peis.CollectItemTypes;
using Shentun.Peis.EntityFrameworkCore;
namespace Shentun.Peis.DbMapping
{
internal class CollectItemTypeDbMapping : IEntityTypeConfiguration<CollectItemType>
{
public void Configure(EntityTypeBuilder<CollectItemType> entity)
{
entity.HasComment("汇总项目类别");
entity.Property(t => t.DisplayName).HasComment("名称").IsRequired();
entity.Property(t => t.DisplayOrder).HasComment("显示顺序").IsRequired();
entity.Property(t => t.InvoiceItemTypeId).HasComment("发票项目类别ID").IsRequired();
entity.Property(t => t.SimpleCode).HasComment("简码").IsRequired();
entity.Property(e => e.Id)
.IsFixedLength()
.HasComment("编号").HasColumnName("id");
entity.ConfigureByConvention();
}
}
}

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

@ -331,6 +331,10 @@ public class PeisDbContext :
#region 第三方接口 #region 第三方接口
public DbSet<ThirdInterface> ThirdInterfaces { get; set; } = null!; public DbSet<ThirdInterface> ThirdInterfaces { get; set; } = null!;
#endregion #endregion
public DbSet<CollectItemType> CollectItemTypes { get; set; } = null!;
public PeisDbContext(DbContextOptions<PeisDbContext> options) public PeisDbContext(DbContextOptions<PeisDbContext> options)
: base(options) : base(options)
{ {
@ -561,7 +565,8 @@ public class PeisDbContext :
.ApplyConfiguration(new ThirdLisRequestDbMapping()) .ApplyConfiguration(new ThirdLisRequestDbMapping())
.ApplyConfiguration(new ChargeRequestDbMapping()) .ApplyConfiguration(new ChargeRequestDbMapping())
.ApplyConfiguration(new ChargeRequestAsbitemDbMapping()) .ApplyConfiguration(new ChargeRequestAsbitemDbMapping())
.ApplyConfiguration(new ThirdInterfaceDbMapping());
.ApplyConfiguration(new ThirdInterfaceDbMapping())
.ApplyConfiguration(new CollectItemTypeDbMapping());
#endregion #endregion

14165
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502143341_init20240502003.Designer.cs
File diff suppressed because it is too large
View File

242
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240502143341_init20240502003.cs

@ -0,0 +1,242 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class init20240502003 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Id",
table: "collect_item_type",
newName: "id");
migrationBuilder.RenameColumn(
name: "LastModifierId",
table: "collect_item_type",
newName: "last_modifier_id");
migrationBuilder.RenameColumn(
name: "LastModificationTime",
table: "collect_item_type",
newName: "last_modification_time");
migrationBuilder.RenameColumn(
name: "CreatorId",
table: "collect_item_type",
newName: "creator_id");
migrationBuilder.RenameColumn(
name: "CreationTime",
table: "collect_item_type",
newName: "creation_time");
migrationBuilder.RenameColumn(
name: "ConcurrencyStamp",
table: "collect_item_type",
newName: "concurrency_stamp");
migrationBuilder.AlterTable(
name: "collect_item_type",
comment: "汇总项目类别");
migrationBuilder.AlterColumn<string>(
name: "simple_code",
table: "collect_item_type",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
comment: "简码",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "invoice_item_type_id",
table: "collect_item_type",
type: "uuid",
nullable: false,
comment: "发票项目类别ID",
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AlterColumn<int>(
name: "display_order",
table: "collect_item_type",
type: "integer",
nullable: false,
comment: "显示顺序",
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<string>(
name: "display_name",
table: "collect_item_type",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
comment: "名称",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "id",
table: "collect_item_type",
type: "uuid",
fixedLength: true,
nullable: false,
comment: "编号",
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AlterColumn<Guid>(
name: "last_modifier_id",
table: "collect_item_type",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uuid",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "last_modification_time",
table: "collect_item_type",
type: "timestamp without time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "creator_id",
table: "collect_item_type",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uuid",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "id",
table: "collect_item_type",
newName: "Id");
migrationBuilder.RenameColumn(
name: "last_modifier_id",
table: "collect_item_type",
newName: "LastModifierId");
migrationBuilder.RenameColumn(
name: "last_modification_time",
table: "collect_item_type",
newName: "LastModificationTime");
migrationBuilder.RenameColumn(
name: "creator_id",
table: "collect_item_type",
newName: "CreatorId");
migrationBuilder.RenameColumn(
name: "creation_time",
table: "collect_item_type",
newName: "CreationTime");
migrationBuilder.RenameColumn(
name: "concurrency_stamp",
table: "collect_item_type",
newName: "ConcurrencyStamp");
migrationBuilder.AlterTable(
name: "collect_item_type",
oldComment: "汇总项目类别");
migrationBuilder.AlterColumn<string>(
name: "simple_code",
table: "collect_item_type",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldComment: "简码");
migrationBuilder.AlterColumn<Guid>(
name: "invoice_item_type_id",
table: "collect_item_type",
type: "uuid",
nullable: false,
oldClrType: typeof(Guid),
oldType: "uuid",
oldComment: "发票项目类别ID");
migrationBuilder.AlterColumn<int>(
name: "display_order",
table: "collect_item_type",
type: "integer",
nullable: false,
oldClrType: typeof(int),
oldType: "integer",
oldComment: "显示顺序");
migrationBuilder.AlterColumn<string>(
name: "display_name",
table: "collect_item_type",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldComment: "名称");
migrationBuilder.AlterColumn<Guid>(
name: "Id",
table: "collect_item_type",
type: "uuid",
nullable: false,
oldClrType: typeof(Guid),
oldType: "uuid",
oldFixedLength: true,
oldComment: "编号");
migrationBuilder.AlterColumn<Guid>(
name: "LastModifierId",
table: "collect_item_type",
type: "uuid",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AlterColumn<DateTime>(
name: "LastModificationTime",
table: "collect_item_type",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<Guid>(
name: "CreatorId",
table: "collect_item_type",
type: "uuid",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
}
}
}

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

@ -414,58 +414,6 @@ namespace Shentun.Peis.Migrations
b.ToTable("test_ct"); 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 => modelBuilder.Entity("Shentun.Peis.Models.AbpUserDepartment", b =>
{ {
b.Property<Guid>("UserId") b.Property<Guid>("UserId")
@ -1901,6 +1849,72 @@ namespace Shentun.Peis.Migrations
b.HasComment("收费申请包含组合项目"); b.HasComment("收费申请包含组合项目");
}); });
modelBuilder.Entity("Shentun.Peis.Models.CollectItemType", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid")
.HasColumnName("id")
.IsFixedLength()
.HasComment("编号");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("character varying(40)")
.HasColumnName("concurrency_stamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("creation_time");
b.Property<Guid?>("CreatorId")
.IsRequired()
.HasColumnType("uuid")
.HasColumnName("creator_id");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("display_name")
.HasComment("名称");
b.Property<int>("DisplayOrder")
.HasColumnType("integer")
.HasColumnName("display_order")
.HasComment("显示顺序");
b.Property<Guid>("InvoiceItemTypeId")
.HasColumnType("uuid")
.HasColumnName("invoice_item_type_id")
.HasComment("发票项目类别ID");
b.Property<DateTime?>("LastModificationTime")
.IsRequired()
.HasColumnType("timestamp without time zone")
.HasColumnName("last_modification_time");
b.Property<Guid?>("LastModifierId")
.IsRequired()
.HasColumnType("uuid")
.HasColumnName("last_modifier_id");
b.Property<string>("SimpleCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("simple_code")
.HasComment("简码");
b.HasKey("Id");
b.HasIndex("InvoiceItemTypeId");
b.ToTable("collect_item_type");
b.HasComment("汇总项目类别");
});
modelBuilder.Entity("Shentun.Peis.Models.ColumnReference", b => modelBuilder.Entity("Shentun.Peis.Models.ColumnReference", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -12370,20 +12384,9 @@ namespace Shentun.Peis.Migrations
b.Navigation("TestAs"); b.Navigation("TestAs");
}); });
modelBuilder.Entity("Shentun.Peis.CollectItemTypes.CollectItemType", b =>
{
b.HasOne("Shentun.Peis.Models.InvoiceItemType", "InvoiceItemType")
.WithMany("CollectItemTypes")
.HasForeignKey("InvoiceItemTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InvoiceItemType");
});
modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b => modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b =>
{ {
b.HasOne("Shentun.Peis.CollectItemTypes.CollectItemType", "CollectItemType")
b.HasOne("Shentun.Peis.Models.CollectItemType", "CollectItemType")
.WithMany("Asbitems") .WithMany("Asbitems")
.HasForeignKey("CollectItemTypeId") .HasForeignKey("CollectItemTypeId")
.IsRequired() .IsRequired()
@ -12622,6 +12625,17 @@ namespace Shentun.Peis.Migrations
b.Navigation("ChargeRequest"); b.Navigation("ChargeRequest");
}); });
modelBuilder.Entity("Shentun.Peis.Models.CollectItemType", b =>
{
b.HasOne("Shentun.Peis.Models.InvoiceItemType", "InvoiceItemType")
.WithMany("CollectItemTypes")
.HasForeignKey("InvoiceItemTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InvoiceItemType");
});
modelBuilder.Entity("Shentun.Peis.Models.ColumnReferenceCode", b => modelBuilder.Entity("Shentun.Peis.Models.ColumnReferenceCode", b =>
{ {
b.HasOne("Shentun.Peis.Models.ColumnReference", "ColumnReference") b.HasOne("Shentun.Peis.Models.ColumnReference", "ColumnReference")
@ -13721,11 +13735,6 @@ namespace Shentun.Peis.Migrations
b.Navigation("TestBs"); b.Navigation("TestBs");
}); });
modelBuilder.Entity("Shentun.Peis.CollectItemTypes.CollectItemType", b =>
{
b.Navigation("Asbitems");
});
modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b => modelBuilder.Entity("Shentun.Peis.Models.Asbitem", b =>
{ {
b.Navigation("AsbitemDetails"); b.Navigation("AsbitemDetails");
@ -13789,6 +13798,11 @@ namespace Shentun.Peis.Migrations
b.Navigation("ChargeRequestAsbitems"); b.Navigation("ChargeRequestAsbitems");
}); });
modelBuilder.Entity("Shentun.Peis.Models.CollectItemType", b =>
{
b.Navigation("Asbitems");
});
modelBuilder.Entity("Shentun.Peis.Models.ColumnReference", b => modelBuilder.Entity("Shentun.Peis.Models.ColumnReference", b =>
{ {
b.Navigation("ColumnReferenceCodes"); b.Navigation("ColumnReferenceCodes");

Loading…
Cancel
Save