增加层级
This commit is contained in:
parent
9393dc4e3e
commit
0ed3f4eea3
61964
APT.Data.Migrations/Migrations/20240719034958_wjn202407-1902.Designer.cs
generated
Normal file
61964
APT.Data.Migrations/Migrations/20240719034958_wjn202407-1902.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,67 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace APT.Data.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class wjn2024071902 : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IS_LEAF",
|
||||||
|
table: "T_HM_RISK_AREA",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "PARENT_ID",
|
||||||
|
table: "T_HM_RISK_AREA",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "TEXT",
|
||||||
|
table: "T_HM_RISK_AREA",
|
||||||
|
type: "nvarchar(50)",
|
||||||
|
maxLength: 50,
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_T_HM_RISK_AREA_PARENT_ID",
|
||||||
|
table: "T_HM_RISK_AREA",
|
||||||
|
column: "PARENT_ID");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_T_HM_RISK_AREA_T_HM_RISK_AREA_PARENT_ID",
|
||||||
|
table: "T_HM_RISK_AREA",
|
||||||
|
column: "PARENT_ID",
|
||||||
|
principalTable: "T_HM_RISK_AREA",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_T_HM_RISK_AREA_T_HM_RISK_AREA_PARENT_ID",
|
||||||
|
table: "T_HM_RISK_AREA");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_T_HM_RISK_AREA_PARENT_ID",
|
||||||
|
table: "T_HM_RISK_AREA");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IS_LEAF",
|
||||||
|
table: "T_HM_RISK_AREA");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PARENT_ID",
|
||||||
|
table: "T_HM_RISK_AREA");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "TEXT",
|
||||||
|
table: "T_HM_RISK_AREA");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4873,6 +4873,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<DateTime?>("MODIFY_TIME")
|
b.Property<DateTime?>("MODIFY_TIME")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("NUM")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<Guid?>("ORG_ID")
|
b.Property<Guid?>("ORG_ID")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
@ -36128,6 +36131,9 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Property<bool>("IS_DELETED")
|
b.Property<bool>("IS_DELETED")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<bool>("IS_LEAF")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
b.Property<int>("LEVEL")
|
b.Property<int>("LEVEL")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
@ -36145,15 +36151,24 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("PARENT_ID")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int>("STATUS")
|
b.Property<int>("STATUS")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("TEXT")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("nvarchar(50)");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
b.HasIndex("DEPARTMENT_ID");
|
b.HasIndex("DEPARTMENT_ID");
|
||||||
|
|
||||||
b.HasIndex("ORG_ID");
|
b.HasIndex("ORG_ID");
|
||||||
|
|
||||||
|
b.HasIndex("PARENT_ID");
|
||||||
|
|
||||||
b.ToTable("T_HM_RISK_AREA");
|
b.ToTable("T_HM_RISK_AREA");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -57317,9 +57332,16 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Restrict)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("APT.MS.Domain.Entities.HM.T_HM_RISK_AREA", "Nav_Parent")
|
||||||
|
.WithMany("Nav_Children")
|
||||||
|
.HasForeignKey("PARENT_ID")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
b.Navigation("Nav_Department");
|
b.Navigation("Nav_Department");
|
||||||
|
|
||||||
b.Navigation("Nav_Org");
|
b.Navigation("Nav_Org");
|
||||||
|
|
||||||
|
b.Navigation("Nav_Parent");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("APT.MS.Domain.Entities.HM.T_HM_RISK_RECORD", b =>
|
modelBuilder.Entity("APT.MS.Domain.Entities.HM.T_HM_RISK_RECORD", b =>
|
||||||
@ -61639,6 +61661,11 @@ namespace APT.Data.Migrations.Migrations
|
|||||||
b.Navigation("Nav_Files");
|
b.Navigation("Nav_Files");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("APT.MS.Domain.Entities.HM.T_HM_RISK_AREA", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Nav_Children");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("APT.MS.Domain.Entities.HM.T_HM_RISK_RECORD", b =>
|
modelBuilder.Entity("APT.MS.Domain.Entities.HM.T_HM_RISK_RECORD", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Nav_Details");
|
b.Navigation("Nav_Details");
|
||||||
|
|||||||
@ -1632,7 +1632,7 @@ builder.HasOne(t => t.Nav_ImgFile).WithMany().HasForeignKey(t => t.IMG_FILE_ID).
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region RiskArea
|
#region RiskArea
|
||||||
public partial class HMRiskAreaMap :APTEntityBaseMap<T_HM_RISK_AREA>
|
public partial class HMRiskAreaMap :TreeEntityBaseMap<T_HM_RISK_AREA>
|
||||||
{
|
{
|
||||||
public override void Configure(EntityTypeBuilder<T_HM_RISK_AREA> builder)
|
public override void Configure(EntityTypeBuilder<T_HM_RISK_AREA> builder)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,7 +15,7 @@ namespace APT.MS.Domain.Entities.HM
|
|||||||
/// 辨识区域
|
/// 辨识区域
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("辨识区域")]
|
[Description("辨识区域")]
|
||||||
public class T_HM_RISK_AREA : MesEntityBase
|
public partial class T_HM_RISK_AREA : TreeEntityBase<T_HM_RISK_AREA>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 编码
|
/// 编码
|
||||||
|
|||||||
@ -20,7 +20,7 @@ using System.Linq.Expressions;
|
|||||||
namespace APT.HM.WebApi.Controllers.Api
|
namespace APT.HM.WebApi.Controllers.Api
|
||||||
{
|
{
|
||||||
[Route("api/HM/HMRiskArea")]
|
[Route("api/HM/HMRiskArea")]
|
||||||
public partial class RiskAreaController : AuthorizeApiController<T_HM_RISK_AREA>
|
public partial class RiskAreaController : AuthorizeTreeApiController<T_HM_RISK_AREA>
|
||||||
{
|
{
|
||||||
/// 排序分页查询数据
|
/// 排序分页查询数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1176,7 +1176,7 @@ using APT.BaseData.Domain.ApiModel.PF;
|
|||||||
/// 辨识区域
|
/// 辨识区域
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("api/HM/RiskArea")]
|
[Route("api/HM/RiskArea")]
|
||||||
public partial class RiskAreaController : AuthorizeApiController<T_HM_RISK_AREA>
|
public partial class RiskAreaController : AuthorizeTreeApiController<T_HM_RISK_AREA>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询所有数据
|
/// 查询所有数据
|
||||||
@ -1273,6 +1273,16 @@ using APT.BaseData.Domain.ApiModel.PF;
|
|||||||
{
|
{
|
||||||
return WitEntity(null, filter);
|
return WitEntity(null, filter);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获得树形实体数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost, Route("TreeData")]
|
||||||
|
public JsonActionResult<IEnumerable<TreeNode<T_HM_RISK_AREA>>> TreeData([FromBody] KeywordFilter filter)
|
||||||
|
{
|
||||||
|
return WitTreeOrderEntities(null, filter);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user