增加层级
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")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("NUM")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("ORG_ID")
|
||||
.IsRequired()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
@ -36128,6 +36131,9 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.Property<bool>("IS_DELETED")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IS_LEAF")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("LEVEL")
|
||||
.HasColumnType("int");
|
||||
|
||||
@ -36145,15 +36151,24 @@ namespace APT.Data.Migrations.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("PARENT_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("STATUS")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("TEXT")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("DEPARTMENT_ID");
|
||||
|
||||
b.HasIndex("ORG_ID");
|
||||
|
||||
b.HasIndex("PARENT_ID");
|
||||
|
||||
b.ToTable("T_HM_RISK_AREA");
|
||||
});
|
||||
|
||||
@ -57317,9 +57332,16 @@ namespace APT.Data.Migrations.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.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_Org");
|
||||
|
||||
b.Navigation("Nav_Parent");
|
||||
});
|
||||
|
||||
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");
|
||||
});
|
||||
|
||||
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 =>
|
||||
{
|
||||
b.Navigation("Nav_Details");
|
||||
|
||||
@ -1632,7 +1632,7 @@ builder.HasOne(t => t.Nav_ImgFile).WithMany().HasForeignKey(t => t.IMG_FILE_ID).
|
||||
}
|
||||
#endregion
|
||||
#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)
|
||||
{
|
||||
|
||||
@ -15,7 +15,7 @@ namespace APT.MS.Domain.Entities.HM
|
||||
/// 辨识区域
|
||||
/// </summary>
|
||||
[Description("辨识区域")]
|
||||
public class T_HM_RISK_AREA : MesEntityBase
|
||||
public partial class T_HM_RISK_AREA : TreeEntityBase<T_HM_RISK_AREA>
|
||||
{
|
||||
/// <summary>
|
||||
/// 编码
|
||||
|
||||
@ -20,7 +20,7 @@ using System.Linq.Expressions;
|
||||
namespace APT.HM.WebApi.Controllers.Api
|
||||
{
|
||||
[Route("api/HM/HMRiskArea")]
|
||||
public partial class RiskAreaController : AuthorizeApiController<T_HM_RISK_AREA>
|
||||
public partial class RiskAreaController : AuthorizeTreeApiController<T_HM_RISK_AREA>
|
||||
{
|
||||
/// 排序分页查询数据
|
||||
/// </summary>
|
||||
|
||||
@ -1176,7 +1176,7 @@ using APT.BaseData.Domain.ApiModel.PF;
|
||||
/// 辨识区域
|
||||
/// </summary>
|
||||
[Route("api/HM/RiskArea")]
|
||||
public partial class RiskAreaController : AuthorizeApiController<T_HM_RISK_AREA>
|
||||
public partial class RiskAreaController : AuthorizeTreeApiController<T_HM_RISK_AREA>
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询所有数据
|
||||
@ -1273,7 +1273,17 @@ using APT.BaseData.Domain.ApiModel.PF;
|
||||
{
|
||||
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
|
||||
#region RiskTaskIdentifying-辨识对象
|
||||
|
||||
Loading…
Reference in New Issue
Block a user