用户数据导入 导入默认角色
This commit is contained in:
parent
19f02ebab9
commit
80ce862176
@ -11,14 +11,15 @@ namespace APT.BaseData.Domain.Entities.FM
|
||||
/// 角色
|
||||
/// </summary>
|
||||
[Redis("")]
|
||||
[IgnoreT4] public partial class T_FM_ROLE : MesEntityBase
|
||||
{
|
||||
public T_FM_ROLE()
|
||||
{
|
||||
this.ROLE_TYPE = 0;
|
||||
}
|
||||
[IgnoreT4]
|
||||
public partial class T_FM_ROLE : MesEntityBase
|
||||
{
|
||||
public T_FM_ROLE()
|
||||
{
|
||||
this.ROLE_TYPE = 0;
|
||||
}
|
||||
|
||||
[Description("编码")]
|
||||
[Description("编码")]
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
@ -42,22 +43,22 @@ namespace APT.BaseData.Domain.Entities.FM
|
||||
[Description("平台类型")]
|
||||
public int PLATFORM_TYPE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色类型
|
||||
/// </summary>
|
||||
[EnumName("FMRoleTypeEnum")]
|
||||
[Description("角色类型")]
|
||||
public int? ROLE_TYPE { get; set; }
|
||||
/// <summary>
|
||||
/// 角色类型
|
||||
/// </summary>
|
||||
[EnumName("FMRoleTypeEnum")]
|
||||
[Description("角色类型")]
|
||||
public int? ROLE_TYPE { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// FMEnableStatusEnum
|
||||
/// </summary>
|
||||
[Description("启用标志")]
|
||||
[EnumName("FMEnableStatusEnum")]
|
||||
public int ENABLE_STATUS { get; set; }
|
||||
/// <summary>
|
||||
/// FMEnableStatusEnum
|
||||
/// </summary>
|
||||
[Description("启用标志")]
|
||||
[EnumName("FMEnableStatusEnum")]
|
||||
public int ENABLE_STATUS { get; set; }
|
||||
|
||||
[Description("备注")]
|
||||
public string REMARK { get; set; }
|
||||
[Description("备注")]
|
||||
public string REMARK { get; set; }
|
||||
|
||||
[Description("授权数据")]
|
||||
[DataFieldIngore]
|
||||
@ -92,8 +93,11 @@ namespace APT.BaseData.Domain.Entities.FM
|
||||
[DataFieldIngore]
|
||||
public List<OrgRuleDeptCheck> DepartmentCheckedKeys { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否默认角色
|
||||
/// </summary>
|
||||
[Description("是否默认角色")]
|
||||
public bool ISDEFAULT { get; set; } = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
139026
APT.Data.Migrations/Migrations/20260416024242_wyw2026041601.Designer.cs
generated
Normal file
139026
APT.Data.Migrations/Migrations/20260416024242_wyw2026041601.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace APT.Data.Migrations.Migrations
|
||||
{
|
||||
public partial class wyw2026041601 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "ISDEFAULT",
|
||||
table: "T_FM_ROLE",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ISDEFAULT",
|
||||
table: "T_FM_ROLE");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5405,6 +5405,9 @@ namespace APT.Data.Migrations.Migrations
|
||||
b.Property<Guid?>("FORM_ID")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("ISDEFAULT")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IS_CHECK_MESSAGE")
|
||||
.HasColumnType("bit");
|
||||
|
||||
|
||||
@ -808,7 +808,7 @@ namespace APT.BS.WebApi.Controllers.Api
|
||||
List<T_FM_USER_POST> listUserPost = GetEntities<T_FM_USER_POST>(e => e.STATUS == ((int)FMPostStatusType.启用), null).ToList();
|
||||
List<T_PF_APPROVAL_ROLE> listApproveRole = GetEntities<T_PF_APPROVAL_ROLE>(null, null).ToList();//导入自动添加
|
||||
List<T_FM_USER_BELONG_ROLE> listUserRole = GetEntities<T_FM_USER_BELONG_ROLE>(null, null).ToList();
|
||||
List<T_FM_ROLE> listRole = GetEntities<T_FM_ROLE>(null, null).ToList();//不做添加 平台类型前端不好改
|
||||
List<T_FM_ROLE> listRole = GetEntities<T_FM_ROLE>(e => !e.IS_DELETED && e.ENABLE_STATUS == 0 && e.ISDEFAULT, null).ToList();//不做添加 平台类型前端不好改
|
||||
List<T_OP_ALLUSER> listAll = new List<T_OP_ALLUSER>();
|
||||
|
||||
List<T_FM_DEPARTMENT> listDepAdd = new List<T_FM_DEPARTMENT>();//需要新增的组织
|
||||
@ -909,10 +909,11 @@ namespace APT.BS.WebApi.Controllers.Api
|
||||
//操作角色 16
|
||||
//string strRole = string.Empty;
|
||||
char[] charSplit = new char[] { ';', ';' };
|
||||
List<string> listStrRole = new List<string>() { "App用户" };//操作角色列删除 配置默认角色 “App用户”
|
||||
List<T_FM_ROLE> listRoleItem = new List<T_FM_ROLE>();
|
||||
List<string> listRoleName = new List<string>();
|
||||
List<int> listRoleIndex = new List<int>();
|
||||
|
||||
//List<string> listStrRole = new List<string>() { "App用户" };//操作角色列删除 配置默认角色 “App用户”
|
||||
//List<T_FM_ROLE> listRoleItem = new List<T_FM_ROLE>();
|
||||
//List<string> listRoleName = new List<string>();
|
||||
//List<int> listRoleIndex = new List<int>();
|
||||
T_FM_USER_BELONG_ROLE modelUserRole = null;
|
||||
|
||||
//0:公司名称* 1:部门名称 2:部门编号 3:车间名称 4:车间编号 5:班组名称 6:班组编号
|
||||
@ -1310,14 +1311,14 @@ namespace APT.BS.WebApi.Controllers.Api
|
||||
//if (!string.IsNullOrEmpty(strRole))
|
||||
//{
|
||||
// listStrRole = strRole.Split(charSplit, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
try
|
||||
{
|
||||
listRoleItem = listRole.FindAll(e => listStrRole.Contains(e.NAME)).ToList();
|
||||
}
|
||||
catch
|
||||
{
|
||||
listRoleItem = null;
|
||||
}
|
||||
//try
|
||||
//{
|
||||
// listRoleItem = listRole.FindAll(e => listStrRole.Contains(e.NAME)).ToList();
|
||||
//}
|
||||
//catch
|
||||
//{
|
||||
// listRoleItem = null;
|
||||
//}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
@ -1405,9 +1406,9 @@ namespace APT.BS.WebApi.Controllers.Api
|
||||
listPerson.Add(modelPerson);
|
||||
//}
|
||||
|
||||
if (listRoleItem != null && listRoleItem.Count > 0)
|
||||
if (listRole != null && listRole.Count > 0)
|
||||
{
|
||||
foreach (var item in listRoleItem)
|
||||
foreach (var item in listRole)
|
||||
{
|
||||
if (!isAddUser)
|
||||
{
|
||||
@ -1415,13 +1416,15 @@ namespace APT.BS.WebApi.Controllers.Api
|
||||
}
|
||||
|
||||
if (modelUserRole == null)
|
||||
{
|
||||
modelUserRole = new T_FM_USER_BELONG_ROLE();
|
||||
|
||||
modelUserRole.ID = Guid.NewGuid();
|
||||
modelUserRole.ID = Guid.NewGuid();
|
||||
modelUserRole.CREATE_TIME = dtNow;
|
||||
}
|
||||
modelUserRole.ORG_ID = OrgID;
|
||||
modelUserRole.USER_ID = modelUser.ID;
|
||||
modelUserRole.BELONG_ROLE_ID = item.ID;
|
||||
modelUserRole.CREATE_TIME = dtNow;
|
||||
modelUserRole.MODIFY_TIME = dtNow;
|
||||
|
||||
listUserRoleAdd.Add(modelUserRole);
|
||||
listUserRole.Add(modelUserRole);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user