17 changed files with 30719 additions and 85 deletions
-
10src/Shentun.Peis.Application.Contracts/Rooms/CreateRoomDto.cs
-
10src/Shentun.Peis.Application.Contracts/Rooms/RoomDto.cs
-
11src/Shentun.Peis.Application.Contracts/Rooms/UpdateRoomDto.cs
-
103src/Shentun.Peis.Application/Rooms/RoomAppService.cs
-
23src/Shentun.Peis.Domain.Shared/Enums/RoomTypeFlag.cs
-
8src/Shentun.Peis.Domain/Asbitems/Asbitem.cs
-
54src/Shentun.Peis.Domain/RoomDetail/RoomDetail.cs
-
19src/Shentun.Peis.Domain/Rooms/Room.cs
-
164src/Shentun.Peis.Domain/Rooms/RoomManager.cs
-
47src/Shentun.Peis.EntityFrameworkCore/DbMapping/RoomDetails/RoomDetailDbMapping.cs
-
32src/Shentun.Peis.EntityFrameworkCore/DbMapping/Rooms/RoomDbMapping.cs
-
5src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs
-
15008src/Shentun.Peis.EntityFrameworkCore/Migrations/20240715090732_room_asbitem_remove.Designer.cs
-
82src/Shentun.Peis.EntityFrameworkCore/Migrations/20240715090732_room_asbitem_remove.cs
-
15035src/Shentun.Peis.EntityFrameworkCore/Migrations/20240715094915_room_detail_add.Designer.cs
-
82src/Shentun.Peis.EntityFrameworkCore/Migrations/20240715094915_room_detail_add.cs
-
111src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.Rooms |
|||
{ |
|||
public class CreateRoomDto |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.Rooms |
|||
{ |
|||
public class RoomDto |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.Rooms |
|||
{ |
|||
public class UpdateRoomDto |
|||
{ |
|||
public Guid RoomId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,103 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Shentun.Peis.Asbitems; |
|||
using Shentun.Peis.HelperDto; |
|||
using Shentun.Peis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.ObjectMapping; |
|||
|
|||
namespace Shentun.Peis.Rooms |
|||
{ |
|||
/// <summary>
|
|||
/// 分诊叫号房间设置
|
|||
/// </summary>
|
|||
[Authorize] |
|||
[ApiExplorerSettings(GroupName = "Work")] |
|||
public class RoomAppService : ApplicationService |
|||
{ |
|||
private readonly IRepository<Room, Guid> _roomRepository; |
|||
private readonly IRepository<Asbitem, Guid> _asbitemRepository; |
|||
private readonly RoomManager _roomManager; |
|||
public RoomAppService( |
|||
IRepository<Room, Guid> roomRepository, |
|||
IRepository<Asbitem, Guid> asbitemRepository, |
|||
RoomManager roomManager) |
|||
{ |
|||
_roomRepository = roomRepository; |
|||
_asbitemRepository = asbitemRepository; |
|||
_roomManager = roomManager; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 创建
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/Room/Create")] |
|||
public async Task<RoomDto> CreateAsync(CreateRoomDto input) |
|||
{ |
|||
var createEntity = ObjectMapper.Map<CreateRoomDto, Room>(input); |
|||
var entity = await _roomManager.CreateAsync(createEntity); |
|||
entity = await _roomRepository.InsertAsync(entity); |
|||
var dto = ObjectMapper.Map<Room, RoomDto>(entity); |
|||
return dto; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 更新
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/Room/Update")] |
|||
public async Task<RoomDto> UpdateAsync(UpdateRoomDto input) |
|||
{ |
|||
var entity = await _roomRepository.GetAsync(input.RoomId); |
|||
var sourceEntity = ObjectMapper.Map<UpdateRoomDto, Room>(input); |
|||
await _roomManager.UpdateAsync(sourceEntity, entity); |
|||
entity = await _roomRepository.UpdateAsync(entity); |
|||
return ObjectMapper.Map<Room, RoomDto>(entity); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/Room/Delete")] |
|||
public async Task DeleteAsync(Guid id) |
|||
{ |
|||
await _roomManager.CheckAndDeleteAsync(id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 修改排序 置顶,置底
|
|||
/// </summary>
|
|||
/// <param name="id">需要修改的ID</param>
|
|||
/// <param name="SortType">修改方式:1 置顶 2 置底</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/Room/UpdateManySort")] |
|||
public async Task UpdateManySortAsync(Guid id, int SortType) |
|||
{ |
|||
await _roomManager.UpdateManySortAsync(id, SortType); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 修改排序 拖拽
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/Room/UpdateSortMany")] |
|||
public async Task UpdateSortManyAsync(UpdateSortManyDto input) |
|||
{ |
|||
await _roomManager.UpdateSortManyAsync(input); |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.Enums |
|||
{ |
|||
public static class RoomTypeFlag |
|||
{ |
|||
/// <summary>
|
|||
/// 普通
|
|||
/// </summary>
|
|||
[Description("普通")] |
|||
public const char Ordinary = '0'; |
|||
|
|||
/// <summary>
|
|||
/// 抽血室
|
|||
/// </summary>
|
|||
[Description("抽血室")] |
|||
public const char BloodlettingRoom = '1'; |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
using Shentun.Peis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace Shentun.Peis.Models |
|||
{ |
|||
/// <summary>
|
|||
/// 房间对应的项目
|
|||
/// </summary>
|
|||
[Table("room_detail")] |
|||
public class RoomDetail : Entity, IHasConcurrencyStamp |
|||
{ |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 组合项目ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("asbitem_id")] |
|||
public Guid AsbitemId { get; set; } |
|||
/// <summary>
|
|||
/// 房间ID
|
|||
/// </summary>
|
|||
[Key] |
|||
[Column("room_id")] |
|||
public Guid RoomId { get; set; } |
|||
|
|||
[Column("concurrency_stamp")] |
|||
public string ConcurrencyStamp { get; set; } |
|||
|
|||
|
|||
|
|||
[ForeignKey(nameof(AsbitemId))] |
|||
[InverseProperty("RoomDetails")] |
|||
public virtual Asbitem Asbitem { get; set; } = null!; |
|||
|
|||
|
|||
[ForeignKey(nameof(RoomId))] |
|||
[InverseProperty("RoomDetails")] |
|||
public virtual Room Room { get; set; } = null!; |
|||
|
|||
public override object[] GetKeys() |
|||
{ |
|||
return new object[] { AsbitemId, RoomId }; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,164 @@ |
|||
using Shentun.Peis.AsbitemDetails; |
|||
using Shentun.Peis.CustomerOrgGroupDetails; |
|||
using Shentun.Peis.Enums; |
|||
using Shentun.Peis.HelperDto; |
|||
using Shentun.Peis.MedicalPackageDetails; |
|||
using Shentun.Peis.Models; |
|||
using Shentun.Peis.SampleGroupDetails; |
|||
using Shentun.Utilities; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Entities; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Shentun.Peis.Rooms |
|||
{ |
|||
/// <summary>
|
|||
/// 房间
|
|||
/// </summary>
|
|||
public class RoomManager : DomainService |
|||
{ |
|||
private readonly IRepository<Room, Guid> _roomRepository; |
|||
//private readonly IRepository<RoomAs>
|
|||
public RoomManager( |
|||
IRepository<Room, Guid> roomRepository |
|||
) |
|||
{ |
|||
_roomRepository = roomRepository; |
|||
} |
|||
|
|||
public async Task<Room> CreateAsync(Room entity) |
|||
{ |
|||
Verify(entity); |
|||
await EntityHelper.CheckSameName<Room, Guid>(_roomRepository, entity.DisplayName); |
|||
return new Room |
|||
{ |
|||
DisplayName = entity.DisplayName, |
|||
SimpleCode = LanguageConverter.GetPYSimpleCode(entity.DisplayName), |
|||
DisplayOrder = await EntityHelper.CreateMaxDisplayOrder<Room>(_roomRepository), |
|||
ForSexId = entity.ForSexId, |
|||
IsActive = entity.IsActive, |
|||
ItemTypeId = entity.ItemTypeId, |
|||
QueueTime = entity.QueueTime, |
|||
MedicalCenterId = entity.MedicalCenterId, |
|||
RoomTypeFlag = entity.RoomTypeFlag |
|||
}; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 更新
|
|||
/// </summary>
|
|||
/// <param name="sourceEntity"></param>
|
|||
/// <param name="targetEntity"></param>
|
|||
/// <returns></returns>
|
|||
public async Task UpdateAsync( |
|||
Room sourceEntity, |
|||
Room targetEntity |
|||
) |
|||
{ |
|||
DataHelper.CheckEntityIsNull(targetEntity); |
|||
Verify(sourceEntity); |
|||
if (sourceEntity.DisplayName != targetEntity.DisplayName) |
|||
{ |
|||
await EntityHelper.CheckSameName<Room, Guid>(_roomRepository, sourceEntity.DisplayName, targetEntity); |
|||
targetEntity.DisplayName = sourceEntity.DisplayName; |
|||
targetEntity.SimpleCode = LanguageConverter.GetPYSimpleCode(targetEntity.DisplayName); |
|||
} |
|||
|
|||
|
|||
targetEntity.ForSexId = sourceEntity.ForSexId; |
|||
targetEntity.IsActive = sourceEntity.IsActive; |
|||
targetEntity.ItemTypeId = sourceEntity.ItemTypeId; |
|||
targetEntity.QueueTime = sourceEntity.QueueTime; |
|||
targetEntity.MedicalCenterId=sourceEntity.MedicalCenterId; |
|||
targetEntity.RoomTypeFlag = sourceEntity.RoomTypeFlag; |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 1.已登记使用过(register_asbitem)的不允许删除。
|
|||
/// 2.已收费过(charge_asbitem)的不允许删除。
|
|||
/// 3.删除时,同步删除组合项目包含的项目(asbitem_detail)、套餐包含的组合项目(medical_package_detail)、标本分组明细(sample_group_detail)、单位分组明细(customer_org_group_detail)。
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
/// <exception cref="UserFriendlyException"></exception>
|
|||
public async Task CheckAndDeleteAsync(Guid id) |
|||
{ |
|||
var roomEnt = await _roomRepository.FirstOrDefaultAsync(m => m.Id == id); |
|||
if (roomEnt != null) |
|||
{ |
|||
|
|||
////删除组合项目明细
|
|||
//await _asbitemDetailManager.CheckAndDeleteAsync(id);
|
|||
|
|||
|
|||
//删除组合项目
|
|||
await _roomRepository.DeleteAsync(id); |
|||
} |
|||
else |
|||
{ |
|||
throw new UserFriendlyException("数据不存在"); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 修改排序 置顶,置底
|
|||
/// </summary>
|
|||
/// <param name="id">需要修改的ID</param>
|
|||
/// <param name="SortType">修改方式:1 置顶 2 置底</param>
|
|||
/// <returns></returns>
|
|||
public async Task UpdateManySortAsync(Guid id, int SortType) |
|||
{ |
|||
await EntityHelper.UpdateManySortAsync(_roomRepository, id, SortType); |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 修改排序 拖拽
|
|||
/// </summary>
|
|||
/// <typeparam name="TEntity"></typeparam>
|
|||
/// <param name="repository"></param>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
public async Task UpdateSortManyAsync(UpdateSortManyDto input) |
|||
{ |
|||
await EntityHelper.UpdateSortManyAsync(_roomRepository, input); |
|||
|
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 验证新增、修改字段
|
|||
/// </summary>
|
|||
/// <param name="entity"></param>
|
|||
/// <exception cref="ArgumentException"></exception>
|
|||
private void Verify(Room entity) |
|||
{ |
|||
DataHelper.CheckEntityIsNull(entity); |
|||
DataHelper.CheckStringIsNull(entity.DisplayName, "名称"); |
|||
DataHelper.CheckForSex(entity.ForSexId); |
|||
DataHelper.CheckGuidIsDefaultValue(entity.ItemTypeId, "项目类别"); |
|||
DataHelper.CheckGuidIsDefaultValue(entity.MedicalCenterId, "体检中心"); |
|||
DataHelper.CheckDecimalIsGeaterThanZero(entity.QueueTime,"候诊时间"); |
|||
DataHelper.CheckCharIsYOrN(entity.IsActive, "是否启用"); |
|||
if (entity.RoomTypeFlag != RoomTypeFlag.Ordinary |
|||
&& entity.RoomTypeFlag != RoomTypeFlag.BloodlettingRoom) |
|||
{ |
|||
throw new ArgumentException($"RoomTypeFlag参数为:{entity.RoomTypeFlag},是无效值,只能为{RoomTypeFlag.Ordinary},{RoomTypeFlag.BloodlettingRoom}"); |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
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.EntityFrameworkCore; |
|||
|
|||
|
|||
namespace Shentun.Peis.DbMapping |
|||
{ |
|||
|
|||
|
|||
internal class RoomDetailDbMapping : IEntityTypeConfiguration<RoomDetail> |
|||
{ |
|||
public void Configure(EntityTypeBuilder<RoomDetail> entity) |
|||
{ |
|||
|
|||
entity.HasKey(e => new { e.AsbitemId, e.RoomId }) |
|||
.HasName("pk_room_detail"); |
|||
|
|||
entity.HasComment("组合项目包含项目"); |
|||
|
|||
entity.Property(t => t.RoomId).HasComment("房间编码").IsRequired().IsFixedLength(); ; |
|||
|
|||
entity.Property(e => e.AsbitemId).IsFixedLength().IsRequired(); |
|||
|
|||
|
|||
|
|||
entity.HasOne(d => d.Asbitem) |
|||
.WithMany(p => p.RoomDetails) |
|||
.HasForeignKey(d => d.AsbitemId) |
|||
.HasConstraintName("fk_room_detail_asbitem"); |
|||
|
|||
entity.HasOne(d => d.Room) |
|||
.WithMany(p => p.RoomDetails) |
|||
.HasForeignKey(d => d.RoomId) |
|||
.HasConstraintName("fk_room_detail_room"); |
|||
|
|||
entity.ConfigureByConvention(); |
|||
|
|||
|
|||
} |
|||
} |
|||
} |
|||
15008
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240715090732_room_asbitem_remove.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,82 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class room_asbitem_remove : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "room_asbitem"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AsbitemRoom_RoomId", |
|||
table: "AsbitemRoom", |
|||
column: "RoomId"); |
|||
|
|||
migrationBuilder.AddForeignKey( |
|||
name: "FK_AsbitemRoom_asbitem_AsbitemId", |
|||
table: "AsbitemRoom", |
|||
column: "AsbitemId", |
|||
principalTable: "asbitem", |
|||
principalColumn: "id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
|
|||
migrationBuilder.AddForeignKey( |
|||
name: "FK_AsbitemRoom_room_RoomId", |
|||
table: "AsbitemRoom", |
|||
column: "RoomId", |
|||
principalTable: "room", |
|||
principalColumn: "id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropForeignKey( |
|||
name: "FK_AsbitemRoom_asbitem_AsbitemId", |
|||
table: "AsbitemRoom"); |
|||
|
|||
migrationBuilder.DropForeignKey( |
|||
name: "FK_AsbitemRoom_room_RoomId", |
|||
table: "AsbitemRoom"); |
|||
|
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AsbitemRoom_RoomId", |
|||
table: "AsbitemRoom"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "room_asbitem", |
|||
columns: table => new |
|||
{ |
|||
room_id = table.Column<Guid>(type: "uuid", fixedLength: true, maxLength: 5, nullable: false), |
|||
asbitem_id = table.Column<Guid>(type: "uuid", fixedLength: true, maxLength: 6, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("pk_room_asbitem", x => new { x.room_id, x.asbitem_id }); |
|||
table.ForeignKey( |
|||
name: "fk_room_asbitem_asbitem", |
|||
column: x => x.asbitem_id, |
|||
principalTable: "asbitem", |
|||
principalColumn: "id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
table.ForeignKey( |
|||
name: "fk_room_asbitem_room", |
|||
column: x => x.room_id, |
|||
principalTable: "room", |
|||
principalColumn: "id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}, |
|||
comment: "房间包含组合项目设置"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_room_asbitem_asbitem_id", |
|||
table: "room_asbitem", |
|||
column: "asbitem_id"); |
|||
} |
|||
} |
|||
} |
|||
15035
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240715094915_room_detail_add.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,82 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class room_detail_add : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AsbitemRoom"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "room_detail", |
|||
columns: table => new |
|||
{ |
|||
asbitem_id = table.Column<Guid>(type: "uuid", fixedLength: true, nullable: false), |
|||
room_id = table.Column<Guid>(type: "uuid", fixedLength: true, nullable: false, comment: "房间编码"), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("pk_room_detail", x => new { x.asbitem_id, x.room_id }); |
|||
table.ForeignKey( |
|||
name: "fk_room_detail_asbitem", |
|||
column: x => x.asbitem_id, |
|||
principalTable: "asbitem", |
|||
principalColumn: "id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
table.ForeignKey( |
|||
name: "fk_room_detail_room", |
|||
column: x => x.room_id, |
|||
principalTable: "room", |
|||
principalColumn: "id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}, |
|||
comment: "组合项目包含项目"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_room_detail_room_id", |
|||
table: "room_detail", |
|||
column: "room_id"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "room_detail"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AsbitemRoom", |
|||
columns: table => new |
|||
{ |
|||
AsbitemId = table.Column<Guid>(type: "uuid", nullable: false), |
|||
RoomId = table.Column<Guid>(type: "uuid", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AsbitemRoom", x => new { x.AsbitemId, x.RoomId }); |
|||
table.ForeignKey( |
|||
name: "FK_AsbitemRoom_asbitem_AsbitemId", |
|||
column: x => x.AsbitemId, |
|||
principalTable: "asbitem", |
|||
principalColumn: "id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
table.ForeignKey( |
|||
name: "FK_AsbitemRoom_room_RoomId", |
|||
column: x => x.RoomId, |
|||
principalTable: "room", |
|||
principalColumn: "id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AsbitemRoom_RoomId", |
|||
table: "AsbitemRoom", |
|||
column: "RoomId"); |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue