feat 按设备,设备组,营业点维度添加人员

This commit is contained in:
2024-06-11 10:42:35 +08:00
parent 452192d36e
commit 02e3e5c63b
5 changed files with 133 additions and 16 deletions

View File

@@ -0,0 +1,49 @@
using System.ComponentModel.DataAnnotations;
using Dlhis.Entity.Sys.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Basic.Device.Request;
public class DevicePermissionsAssignToDeviceRequest : IValidatableObject
{
/// <summary>
/// 分配类型
/// </summary>
public DeviceAssignmentTypeEnumType UniqueType { get; set; }
/// <summary>
/// 分配值
/// </summary>
public Guid UniqueValue { get; set; }
/// <summary>
/// 来源
/// </summary>
public AssignTypeEnumType AssignType { get; set; }
/// <summary>
/// 来源值
/// </summary>
public List<string> Values { get; set; }
/// <summary>
/// 只删除权限
/// </summary>
public bool IsDelete { get; set; }
/// <summary>
/// AssignType == AssignTypeEnumType.Department 需要传入
/// </summary>
public string TenantId { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (AssignType == AssignTypeEnumType.Department)
{
if (TenantId.IsEmpty())
{
yield return new ValidationResult("请明确具体的厂区", new[] { nameof(TenantId) });
}
}
}
}