Browse Source

添加 页面锁定

dev_DY_CC
郑勃旭 1 year ago
parent
commit
98aa02fab4
  1. 24
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/DTOs/PageLockDto.cs
  2. 11
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/IPageLockAppService.cs
  3. 5
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/Inputs/PageLockCreateInput.cs
  4. 24
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/Inputs/PageLockCreateUpdateInputBase.cs
  5. 14
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/Inputs/PageLockUpdateInput.cs
  6. 27
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/PageLockPermissions.cs
  7. 1
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/Permissions/AuthPermissionDefinitionProvider.cs
  8. 76
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/PageLock/PageLockAppService.cs
  9. 29
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/PageLock/PageLockAutoMapperProfile.cs
  10. 5
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Domain/PageLock/IUserMenuRepository.cs
  11. 22
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Domain/PageLock/PageLock.cs
  12. 1
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/EntityFrameworkCore/AuthDbContext.cs
  13. 2
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/EntityFrameworkCore/AuthDbContextModelCreatingExtensions.cs
  14. 1
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/EntityFrameworkCore/AuthEntityFrameworkCoreModule.cs
  15. 2
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/EntityFrameworkCore/IAuthDbContext.cs
  16. 2679
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/Migrations/20240415074354_Added_PageLock.Designer.cs
  17. 237
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/Migrations/20240415074354_Added_PageLock.cs
  18. 105
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/Migrations/AuthDbContextModelSnapshot.cs
  19. 27
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/PageLock/PageLockDbContextModelCreatingExtensions.cs
  20. 11
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/PageLock/PageLockEfCoreRepository.cs
  21. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Win_in.Sfs.Wms.Store.Domain.csproj

24
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/DTOs/PageLockDto.cs

@ -0,0 +1,24 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Auth.Application.Contracts;
public class PageLockDto : SfsAuthDtoBase
{
/// <summary>
/// 菜单代码
/// </summary>
public string MenuCode { get; set; }
/// <summary>
/// 用户账户
/// </summary>
public string UserAccount { get; set; }
/// <summary>
/// 登录时间
/// </summary>
public string LoginTime { get; set; }
}

11
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/IPageLockAppService.cs

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Win_in.Sfs.Auth.Application.Contracts;
public interface IPageLockAppService : ISfsAuthCrudAppService<PageLockDto, SfsAuthRequestInputBase, PageLockCreateInput>
{
Task LockLoginAsync(string menuCode,string userAccount);
Task LockLogoutAsync(string menuCode, string userAccount);
}

5
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/Inputs/PageLockCreateInput.cs

@ -0,0 +1,5 @@
namespace Win_in.Sfs.Auth.Application.Contracts;
public class PageLockCreateInput : PageLockCreateUpdateInputBase
{
}

24
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/Inputs/PageLockCreateUpdateInputBase.cs

@ -0,0 +1,24 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Auth.Application.Contracts;
public abstract class PageLockCreateUpdateInputBase : SfsAuthCreateUpdateInputBase
{
/// <summary>
/// 菜单代码
/// </summary>
public string MenuCode { get; set; }
/// <summary>
/// 用户账户
/// </summary>
public string UserAccount { get; set; }
/// <summary>
/// 登录时间
/// </summary>
public string LoginTime { get; set; }
}

14
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/Inputs/PageLockUpdateInput.cs

@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;
namespace Win_in.Sfs.Auth.Application.Contracts;
public class PageLockUpdateInput : PageLockCreateUpdateInputBase, IHasConcurrencyStamp
{
/// <summary>
/// 乐观锁
/// </summary>
[Display(Name = "乐观锁")]
[Required(ErrorMessage = "{0}是必填项")]
public string ConcurrencyStamp { get; set; }
}

27
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/PageLock/PageLockPermissions.cs

@ -0,0 +1,27 @@
using Volo.Abp.Authorization.Permissions;
using Win_in.Sfs.Auth.Domain;
using Win_in.Sfs.Auth.Permissions;
namespace Win_in.Sfs.Auth.Application.Contracts;
public static class PageLockPermissions
{
public const string Default = AuthPermissions.GroupName + "." + nameof(PageLock);
public const string Create = Default + "." + AuthPermissions.CreateStr;
public const string Update = Default + "." + AuthPermissions.UpdateStr;
public const string Delete = Default + "." + AuthPermissions.DeleteStr;
//POA菜单
public const string PageLock = AuthPermissions.GroupName + "." + nameof(PageLock);
public static void AddPageLockPermission(this PermissionGroupDefinition permissionGroup)
{
var PageLockPermission = permissionGroup.AddPermission(Default, AuthPermissionDefinitionProvider.L(nameof(PageLock)));
PageLockPermission.AddChild(Create, AuthPermissionDefinitionProvider.L(AuthPermissions.CreateStr));
PageLockPermission.AddChild(Update, AuthPermissionDefinitionProvider.L(AuthPermissions.UpdateStr));
PageLockPermission.AddChild(Delete, AuthPermissionDefinitionProvider.L(AuthPermissions.DeleteStr));
permissionGroup.AddPermission(PageLock, AuthPermissionDefinitionProvider.L(nameof(PageLock)));
}
}

1
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application.Contracts/Permissions/AuthPermissionDefinitionProvider.cs

@ -21,6 +21,7 @@ public class AuthPermissionDefinitionProvider : PermissionDefinitionProvider
authGroup.AddUserMenuPermission();
authGroup.AddUserWorkGroupPermission();
authGroup.AddDepartmentPermission();
authGroup.AddPageLockPermission();
}
public static LocalizableString L(string name)

76
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/PageLock/PageLockAppService.cs

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Office2010.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Identity;
using Volo.Abp.ObjectMapping;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Uow;
using Volo.Abp.Users;
using Win_in.Sfs.Auth.Application.Contracts;
using Win_in.Sfs.Auth.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Auth.Application;
[AllowAnonymous]
[Route($"{AuthConsts.RootPath}page-lock")]
public class PageLockAppService :
SfsAuthCrudAppServiceBase<PageLock, PageLockDto, SfsAuthRequestInputBase, PageLockCreateInput>,
IPageLockAppService
{
public PageLockAppService(
IPageLockRepository repository) : base(repository)
{
base.CreatePolicyName = PageLockPermissions.Create;
base.UpdatePolicyName = PageLockPermissions.Update;
base.DeletePolicyName = PageLockPermissions.Delete;
}
[HttpGet("lock-login")]
[AllowAnonymous]
[UnitOfWork]
public async Task LockLoginAsync(string menuCode,string userAccount)
{
var pageLock=await _repository.GetListAsync(p=>p.MenuCode==menuCode).ConfigureAwait(false);
if (pageLock.Count == 1&& pageLock.First().UserAccount== userAccount)
{
return;
}
if (pageLock.Count>1)
{
throw new UserFriendlyException($"该页面已被多人锁定锁定,请联系管理员清除锁定信息");
}
if (pageLock.Count == 1 && userAccount != pageLock.First().UserAccount)
{
throw new UserFriendlyException($"该页面已被{pageLock.First().UserAccount}用户锁定");
}
await _repository.InsertAsync(new PageLock()
{
UserAccount = userAccount,
LoginTime = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"),
MenuCode = menuCode
}).ConfigureAwait(false);
}
[HttpGet("lock-logout")]
[AllowAnonymous]
[UnitOfWork]
public async Task LockLogoutAsync(string menuCode, string userAccount)
{
var pageLock = await _repository.GetListAsync(p => p.MenuCode == menuCode&&p.UserAccount==userAccount).ConfigureAwait(false);
if (pageLock.Count==1)
{
await _repository.DeleteAsync(pageLock.First()).ConfigureAwait(false);
}
}
}

29
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/PageLock/PageLockAutoMapperProfile.cs

@ -0,0 +1,29 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Auth.Application.Contracts;
using Win_in.Sfs.Auth.Domain;
namespace Win_in.Sfs.Auth.Application;
public class PageLockAutoMapperProfile : Profile
{
public PageLockAutoMapperProfile()
{
CreateMap<PageLock, PageLockDto>()
.IgnoreAuditedObjectProperties()
;
CreateMap<PageLockCreateInput, PageLock>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id)
;
CreateMap<PageLockUpdateInput, PageLock>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.Id)
;
;
}
}

5
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Domain/PageLock/IUserMenuRepository.cs

@ -0,0 +1,5 @@
namespace Win_in.Sfs.Auth.Domain;
public interface IPageLockRepository : ISfsAuthRepository<PageLock>
{
}

22
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Domain/PageLock/PageLock.cs

@ -0,0 +1,22 @@
using System;
using Win_in.Sfs.Auth.Domain;
namespace Win_in.Sfs.Auth.Domain;
public class PageLock : SfsAuthAggregateRootBase
{
/// <summary>
/// 菜单代码
/// </summary>
public string MenuCode { get; set; }
/// <summary>
/// 用户账户
/// </summary>
public string UserAccount { get; set; }
/// <summary>
/// 登录时间
/// </summary>
public string LoginTime { get; set; }
}

1
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/EntityFrameworkCore/AuthDbContext.cs

@ -70,6 +70,7 @@ public class AuthDbContext :
public DbSet<Menu> Menus { get; set; }
public DbSet<UserMenu> UserMenus { get; set; }
public DbSet<UserWorkGroup> UserWorkGroups { get; set; }
public DbSet<PageLock> PageLocks { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.EnableDetailedErrors();

2
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/EntityFrameworkCore/AuthDbContextModelCreatingExtensions.cs

@ -26,6 +26,6 @@ public static class AuthDbContextModelCreatingExtensions
builder.ConfigureUserMenu(options);
builder.ConfigureUserWorkGroup(options);
builder.ConfigureDepartment(options);
builder.ConfigurePageLock(options);
}
}

1
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/EntityFrameworkCore/AuthEntityFrameworkCoreModule.cs

@ -44,6 +44,7 @@ public class AuthEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient<IUserMenuRepository, UserMenuEfCoreRepository>();
context.Services.AddTransient<IUserWorkGroupRepository, UserWorkGroupEfCoreRepository>();
context.Services.AddTransient<IDepartmentRepository, DepartmentEfCoreRepository>();
context.Services.AddTransient<IPageLockRepository, PageLockEfCoreRepository>();
});
//Configure<AbpDbContextOptions>(options =>

2
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/EntityFrameworkCore/IAuthDbContext.cs

@ -18,5 +18,5 @@ public interface IAuthDbContext : IEfCoreDbContext
public DbSet<UserMenu> UserMenus { get; }
public DbSet<UserWorkGroup> UserWorkGroups { get; }
public DbSet<Department> Departments { get; }
public DbSet<PageLock> PageLocks{ get; }
}

2679
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/Migrations/20240415074354_Added_PageLock.Designer.cs

File diff suppressed because it is too large

237
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/Migrations/20240415074354_Added_PageLock.cs

@ -0,0 +1,237 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Auth.Migrations
{
public partial class Added_PageLock : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Remark",
table: "Auth_UserWorkGroup",
type: "nvarchar(3072)",
maxLength: 3072,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldMaxLength: 4096,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Remark",
table: "Auth_UserMenu",
type: "nvarchar(3072)",
maxLength: 3072,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldMaxLength: 4096,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Portal",
table: "Auth_UserMenu",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<string>(
name: "Status",
table: "Auth_Menu",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
defaultValue: "Enable",
oldClrType: typeof(int),
oldType: "int",
oldDefaultValue: 1);
migrationBuilder.AlterColumn<string>(
name: "Remark",
table: "Auth_Menu",
type: "nvarchar(3072)",
maxLength: 3072,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldMaxLength: 4096,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Portal",
table: "Auth_Menu",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<string>(
name: "Component",
table: "Auth_Menu",
type: "nvarchar(1024)",
maxLength: 1024,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Remark",
table: "Auth_Department",
type: "nvarchar(3072)",
maxLength: 3072,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldMaxLength: 4096,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Auth_Department",
type: "nvarchar(1024)",
maxLength: 1024,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldMaxLength: 4096,
oldNullable: true);
migrationBuilder.CreateTable(
name: "Auth_PageLock",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
MenuCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
UserAccount = table.Column<string>(type: "nvarchar(max)", nullable: true),
LoginTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Auth_PageLock", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Auth_PageLock_MenuCode",
table: "Auth_PageLock",
column: "MenuCode",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Auth_PageLock");
migrationBuilder.AlterColumn<string>(
name: "Remark",
table: "Auth_UserWorkGroup",
type: "nvarchar(max)",
maxLength: 4096,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(3072)",
oldMaxLength: 3072,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Remark",
table: "Auth_UserMenu",
type: "nvarchar(max)",
maxLength: 4096,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(3072)",
oldMaxLength: 3072,
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "Portal",
table: "Auth_UserMenu",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64);
migrationBuilder.AlterColumn<int>(
name: "Status",
table: "Auth_Menu",
type: "int",
nullable: false,
defaultValue: 1,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64,
oldDefaultValue: "Enable");
migrationBuilder.AlterColumn<string>(
name: "Remark",
table: "Auth_Menu",
type: "nvarchar(max)",
maxLength: 4096,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(3072)",
oldMaxLength: 3072,
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "Portal",
table: "Auth_Menu",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64);
migrationBuilder.AlterColumn<string>(
name: "Component",
table: "Auth_Menu",
type: "nvarchar(64)",
maxLength: 64,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(1024)",
oldMaxLength: 1024,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Remark",
table: "Auth_Department",
type: "nvarchar(max)",
maxLength: 4096,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(3072)",
oldMaxLength: 3072,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Auth_Department",
type: "nvarchar(max)",
maxLength: 4096,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(1024)",
oldMaxLength: 1024,
oldNullable: true);
}
}
}

105
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/Migrations/AuthDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace Win_in.Sfs.Auth.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "6.0.12")
.HasAnnotation("ProductVersion", "6.0.13")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
@ -1985,8 +1985,8 @@ namespace Win_in.Sfs.Auth.Migrations
.HasColumnName("CreatorId");
b.Property<string>("Description")
.HasMaxLength(4096)
.HasColumnType("nvarchar(max)");
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
@ -2010,8 +2010,8 @@ namespace Win_in.Sfs.Auth.Migrations
.HasColumnType("nvarchar(64)");
b.Property<string>("Remark")
.HasMaxLength(4096)
.HasColumnType("nvarchar(max)")
.HasMaxLength(3072)
.HasColumnType("nvarchar(3072)")
.HasColumnName("Remark");
b.Property<Guid?>("TenantId")
@ -2037,8 +2037,8 @@ namespace Win_in.Sfs.Auth.Migrations
.HasColumnType("nvarchar(64)");
b.Property<string>("Component")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -2097,12 +2097,14 @@ namespace Win_in.Sfs.Auth.Migrations
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("Portal")
.HasColumnType("int");
b.Property<string>("Portal")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Remark")
.HasMaxLength(4096)
.HasColumnType("nvarchar(max)")
.HasMaxLength(3072)
.HasColumnType("nvarchar(3072)")
.HasColumnName("Remark");
b.Property<string>("Route")
@ -2112,10 +2114,12 @@ namespace Win_in.Sfs.Auth.Migrations
b.Property<int>("Sort")
.HasColumnType("int");
b.Property<int>("Status")
b.Property<string>("Status")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasDefaultValue(1);
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasDefaultValue("Enable");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
@ -2129,6 +2133,65 @@ namespace Win_in.Sfs.Auth.Migrations
b.ToTable("Auth_Menu", (string)null);
});
modelBuilder.Entity("Win_in.Sfs.Auth.Domain.PageLock", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("LoginTime")
.HasColumnType("nvarchar(max)");
b.Property<string>("MenuCode")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Remark")
.HasMaxLength(3072)
.HasColumnType("nvarchar(3072)")
.HasColumnName("Remark");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
b.Property<string>("UserAccount")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("MenuCode")
.IsUnique();
b.ToTable("Auth_PageLock", (string)null);
});
modelBuilder.Entity("Win_in.Sfs.Auth.Domain.UserMenu", b =>
{
b.Property<Guid>("Id")
@ -2165,12 +2228,14 @@ namespace Win_in.Sfs.Auth.Migrations
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<int>("Portal")
.HasColumnType("int");
b.Property<string>("Portal")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Remark")
.HasMaxLength(4096)
.HasColumnType("nvarchar(max)")
.HasMaxLength(3072)
.HasColumnType("nvarchar(3072)")
.HasColumnName("Remark");
b.Property<Guid?>("TenantId")
@ -2220,8 +2285,8 @@ namespace Win_in.Sfs.Auth.Migrations
.HasColumnName("LastModifierId");
b.Property<string>("Remark")
.HasMaxLength(4096)
.HasColumnType("nvarchar(max)")
.HasMaxLength(3072)
.HasColumnType("nvarchar(3072)")
.HasColumnName("Remark");
b.Property<Guid?>("TenantId")

27
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/PageLock/PageLockDbContextModelCreatingExtensions.cs

@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Win_in.Sfs.Auth.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.EntityFrameworkCore;
namespace Win_in.Sfs.Auth.EntityFrameworkCore;
public static class PageLockDbContextModelCreatingExtensions
{
public static void ConfigurePageLock(this ModelBuilder builder, AuthModelBuilderConfigurationOptions options)
{
builder.Entity<PageLock>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(PageLock), options.Schema);
b.ConfigureByConvention();
b.ConfigureSfsBase();
//Properties
b.Property(q => q.MenuCode).IsRequired().HasMaxLength(64);
//Indexes
b.HasIndex(q => new { q.MenuCode }).IsUnique();
});
}
}

11
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.EntityFrameworkCore/PageLock/PageLockEfCoreRepository.cs

@ -0,0 +1,11 @@
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Auth.Domain;
namespace Win_in.Sfs.Auth.EntityFrameworkCore;
public class PageLockEfCoreRepository : SfsAuthEfCoreRepositoryBase<AuthDbContext, PageLock>, IPageLockRepository
{
public PageLockEfCoreRepository(IDbContextProvider<AuthDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Win_in.Sfs.Wms.Store.Domain.csproj

@ -10,10 +10,13 @@
<ItemGroup>
<Compile Remove="DocumentSettings\**" />
<Compile Remove="JisContainers\**" />
<Compile Remove="PageLock\**" />
<EmbeddedResource Remove="DocumentSettings\**" />
<EmbeddedResource Remove="JisContainers\**" />
<EmbeddedResource Remove="PageLock\**" />
<None Remove="DocumentSettings\**" />
<None Remove="JisContainers\**" />
<None Remove="PageLock\**" />
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save