Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development
This commit is contained in:
@@ -33,6 +33,17 @@ public class DeviceGroupsController : ControllerBase
|
|||||||
return await _deviceGroupService.GetPageAsync(request);
|
return await _deviceGroupService.GetPageAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取设备分组树
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="showDevices">是否显示设备</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("tree")]
|
||||||
|
public async Task<List<DeviceGroupTreeResponse>> GetTreeAsync(bool showDevices)
|
||||||
|
{
|
||||||
|
return await _deviceGroupService.GetTreeAsync(showDevices);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备分组保存
|
/// 设备分组保存
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -61,7 +72,7 @@ public class DeviceGroupsController : ControllerBase
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("assign")]
|
[HttpPost("assign")]
|
||||||
public async Task AssignDevicesAsync(AssignDevicesRequest request)
|
public async Task AssignDevicesAsync(DeviceAssignRequest request)
|
||||||
{
|
{
|
||||||
await _deviceGroupService.AssignDevicesAsync(request);
|
await _deviceGroupService.AssignDevicesAsync(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using Dlhis.Basic.Device.Request;
|
||||||
|
using Dlhis.Basic.Device.Services;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Controllers;
|
||||||
|
|
||||||
|
[Authorize]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class DevicePermissionsController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IDevicePermissionService _devicePermissionService;
|
||||||
|
|
||||||
|
public DevicePermissionsController(IDevicePermissionService devicePermissionService)
|
||||||
|
{
|
||||||
|
_devicePermissionService = devicePermissionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分配权限
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="requests"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("assign")]
|
||||||
|
public async Task AssignmentAsync(List<DevicePermissionSaveReuqest> requests)
|
||||||
|
{
|
||||||
|
await _devicePermissionService.AssignmentAsync(requests);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前类型的权限分配
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("assignments")]
|
||||||
|
public async Task<List<Guid>> GetAssignmentsAsync(DeviceGetAssignmentsRequest request)
|
||||||
|
{
|
||||||
|
return await _devicePermissionService.GetAssignmentsAsync(request.UserId, request.UniqueType, request.UniqueValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,11 +2,16 @@
|
|||||||
|
|
||||||
namespace Dlhis.Basic.Device.Request;
|
namespace Dlhis.Basic.Device.Request;
|
||||||
|
|
||||||
public class AssignDevicesRequest
|
public class DeviceAssignRequest
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 设备组
|
||||||
|
/// </summary>
|
||||||
[Required(ErrorMessage = "设备组不能为空")]
|
[Required(ErrorMessage = "设备组不能为空")]
|
||||||
public Guid GroupCode { get; set; }
|
public Guid GroupCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备code
|
||||||
|
/// </summary>
|
||||||
public List<Guid> DeviceCodes { get; set; } = new List<Guid>();
|
public List<Guid> DeviceCodes { get; set; } = new List<Guid>();
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using Dlhis.Entity.Sys.Enums;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Request;
|
||||||
|
|
||||||
|
public class DeviceGetAssignmentsRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 用户档案号
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public string UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 权限分配类型 MenuAssignmentTypeEnumType
|
||||||
|
/// </summary>
|
||||||
|
[EnumDataType(typeof(DeviceAssignmentTypeEnumType))]
|
||||||
|
public DeviceAssignmentTypeEnumType UniqueType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类型对应的唯一值(可为空)
|
||||||
|
/// </summary>
|
||||||
|
public Guid? UniqueValue { get; set; }
|
||||||
|
}
|
||||||
@@ -6,6 +6,11 @@ public class DeviceGroupSaveRequest
|
|||||||
{
|
{
|
||||||
public long? Id { get; set; }
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上级分组
|
||||||
|
/// </summary>
|
||||||
|
public Guid? PCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备组名称
|
/// 设备组名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Dlhis.Entity.Sys.Enums;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Request;
|
||||||
|
|
||||||
|
public class DevicePermissionSaveReuqest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 人员档案号
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "人员档案号不能为空")]
|
||||||
|
public string UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分配权限类型 DevicePermissionTypeEnumType
|
||||||
|
/// </summary>
|
||||||
|
[EnumDataType(typeof(DeviceAssignmentTypeEnumType), ErrorMessage = "枚举类型错误")]
|
||||||
|
public DeviceAssignmentTypeEnumType UniqueType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分配权限值不能为空
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "分配权限值不能为空")]
|
||||||
|
public Guid UniqueValue { get; set; }
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
using SqlSugar;
|
namespace Dlhis.Basic.Device.Response;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Response;
|
|
||||||
|
|
||||||
public class DeviceGroupPageResponse
|
public class DeviceGroupPageResponse
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 设备分组code
|
||||||
|
/// </summary>
|
||||||
public Guid Code { get; set; }
|
public Guid Code { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
24
Src/Dlhis.Basic/Device/Response/DeviceGroupTreeResponse.cs
Normal file
24
Src/Dlhis.Basic/Device/Response/DeviceGroupTreeResponse.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
namespace Dlhis.Basic.Device.Response;
|
||||||
|
|
||||||
|
public class DeviceGroupTreeResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 上级分组code
|
||||||
|
/// </summary>
|
||||||
|
public Guid? PCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分组code/设备code
|
||||||
|
/// </summary>
|
||||||
|
public Guid Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分组名称/设备名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 下级
|
||||||
|
/// </summary>
|
||||||
|
public List<DeviceGroupTreeResponse> Next { get; set; } = new();
|
||||||
|
}
|
||||||
@@ -8,9 +8,11 @@ public interface IDeviceGroupService : IScopeDependency
|
|||||||
{
|
{
|
||||||
Task<Pagination<DeviceGroupPageResponse>> GetPageAsync(DeviceGroupPageRequest request);
|
Task<Pagination<DeviceGroupPageResponse>> GetPageAsync(DeviceGroupPageRequest request);
|
||||||
|
|
||||||
|
Task<List<DeviceGroupTreeResponse>> GetTreeAsync(bool showDevices);
|
||||||
|
|
||||||
Task SaveAsync(DeviceGroupSaveRequest request);
|
Task SaveAsync(DeviceGroupSaveRequest request);
|
||||||
|
|
||||||
Task<List<DeviceUnderGroupResponse>> GetDevicesAsync(Guid code);
|
Task<List<DeviceUnderGroupResponse>> GetDevicesAsync(Guid code);
|
||||||
|
|
||||||
Task AssignDevicesAsync(AssignDevicesRequest requests);
|
Task AssignDevicesAsync(DeviceAssignRequest requests);
|
||||||
}
|
}
|
||||||
|
|||||||
16
Src/Dlhis.Basic/Device/Services/IDevicePermissionService.cs
Normal file
16
Src/Dlhis.Basic/Device/Services/IDevicePermissionService.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using Dlhis.Basic.Device.Request;
|
||||||
|
using Dlhis.Entity.Sys.Enums;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Services;
|
||||||
|
|
||||||
|
public interface IDevicePermissionService : IScopeDependency
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 保存设备权限
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="reuqests"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task AssignmentAsync(List<DevicePermissionSaveReuqest> reuqests);
|
||||||
|
|
||||||
|
Task<List<Guid>> GetAssignmentsAsync(string userId, DeviceAssignmentTypeEnumType uniqueType, Guid? uniqueValue);
|
||||||
|
}
|
||||||
@@ -27,8 +27,26 @@ public class DeviceGroupService : IDeviceGroupService
|
|||||||
.ToPageListAsync(request);
|
.ToPageListAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<DeviceGroupTreeResponse>> GetTreeAsync(bool showDevices)
|
||||||
|
{
|
||||||
|
var deviceGroups = await _dbContext.Queryable<DeviceGroupEntity>()
|
||||||
|
.Select<DeviceGroupTreeResponse>()
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
var tops = deviceGroups.Where(x => !x.PCode.HasValue).ToList();
|
||||||
|
tops.ForEach(x =>
|
||||||
|
{
|
||||||
|
RecursionGetNext(x, deviceGroups, showDevices);
|
||||||
|
});
|
||||||
|
|
||||||
|
return tops;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task SaveAsync(DeviceGroupSaveRequest request)
|
public async Task SaveAsync(DeviceGroupSaveRequest request)
|
||||||
{
|
{
|
||||||
|
//检查父级节点
|
||||||
|
await CheckPCodeExistsDeviceAsync(request.PCode);
|
||||||
|
|
||||||
if (!request.Id.HasValue)
|
if (!request.Id.HasValue)
|
||||||
{
|
{
|
||||||
var entity = request.Adapt<DeviceGroupEntity>();
|
var entity = request.Adapt<DeviceGroupEntity>();
|
||||||
@@ -52,11 +70,13 @@ public class DeviceGroupService : IDeviceGroupService
|
|||||||
await _dbContext.DeleteAsync(deviceGroup);
|
await _dbContext.DeleteAsync(deviceGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task AssignDevicesAsync(AssignDevicesRequest request)
|
public async Task AssignDevicesAsync(DeviceAssignRequest request)
|
||||||
{
|
{
|
||||||
var group = await _dbContext.Queryable<DeviceGroupEntity>().Where(x => x.Code == request.GroupCode).FirstAsync();
|
var group = await _dbContext.Queryable<DeviceGroupEntity>().Where(x => x.Code == request.GroupCode).FirstAsync();
|
||||||
group.ThrowIfNull("设备组不存在");
|
group.ThrowIfNull("设备组不存在");
|
||||||
|
|
||||||
|
await CheckNoNextGroupAsync(group.Code);
|
||||||
|
|
||||||
if (!request.DeviceCodes.Any())
|
if (!request.DeviceCodes.Any())
|
||||||
{
|
{
|
||||||
//todo 删除时候判断权限是否分配
|
//todo 删除时候判断权限是否分配
|
||||||
@@ -75,7 +95,6 @@ public class DeviceGroupService : IDeviceGroupService
|
|||||||
|
|
||||||
await _dbContext.InsertAsync(entities);
|
await _dbContext.InsertAsync(entities);
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo 生成下发任务
|
//todo 生成下发任务
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,4 +109,63 @@ public class DeviceGroupService : IDeviceGroupService
|
|||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************** help methods *********************************************************/
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检查
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task CheckPCodeExistsDeviceAsync(Guid? pCode)
|
||||||
|
{
|
||||||
|
if (pCode.HasValue)
|
||||||
|
{
|
||||||
|
var exists = await _dbContext.Queryable<DeviceGroupRelationshipEntity>().Where(x => x.GroupCode == pCode).AnyAsync();
|
||||||
|
exists.ThrowIfTrue("父级分组存在设备");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currentCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task CheckNoNextGroupAsync(Guid currentCode)
|
||||||
|
{
|
||||||
|
var exists = await _dbContext.Queryable<DeviceGroupEntity>().Where(x => x.PCode == currentCode).AnyAsync();
|
||||||
|
exists.ThrowIfTrue("存在下级设备分组");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 递归获取树
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="current"></param>
|
||||||
|
/// <param name="departments"></param>
|
||||||
|
/// <param name="showDevices"></param>
|
||||||
|
private void RecursionGetNext(DeviceGroupTreeResponse current, List<DeviceGroupTreeResponse> departments, bool showDevices)
|
||||||
|
{
|
||||||
|
var next = departments.Where(x => x.PCode == current.Code).ToList();
|
||||||
|
current.Next = next;
|
||||||
|
foreach (var item in next)
|
||||||
|
{
|
||||||
|
RecursionGetNext(item, departments, showDevices);
|
||||||
|
}
|
||||||
|
|
||||||
|
//最后层级附加设备信息
|
||||||
|
if (!current.Next.Any() && showDevices)
|
||||||
|
{
|
||||||
|
current.Next = _dbContext.Queryable<DeviceGroupRelationshipEntity>()
|
||||||
|
.LeftJoin<DeviceEntity>((relation, device) => relation.DeviceCode == device.Code)
|
||||||
|
.Where((relation, device) => relation.GroupCode == current.Code)
|
||||||
|
.Select((relation, device) => new DeviceGroupTreeResponse
|
||||||
|
{
|
||||||
|
Code = device.Code,
|
||||||
|
Name = device.UniqueNo,
|
||||||
|
PCode = relation.GroupCode
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using Dlhis.Basic.Device.Request;
|
||||||
|
using Dlhis.Entity.Sys.Entities;
|
||||||
|
using Dlhis.Entity.Sys.Enums;
|
||||||
|
using Kurisu.SqlSugar.Services;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Device.Services.Implements;
|
||||||
|
|
||||||
|
public class DevicePermissionService : IDevicePermissionService
|
||||||
|
{
|
||||||
|
private readonly IDbContext _dbContext;
|
||||||
|
|
||||||
|
public DevicePermissionService(IDbContext dbContext)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task AssignmentAsync(List<DevicePermissionSaveReuqest> reuqests)
|
||||||
|
{
|
||||||
|
foreach (var item in reuqests)
|
||||||
|
{
|
||||||
|
var permissions = await _dbContext.Queryable<DevicePermissionEntity>()
|
||||||
|
.Where(x => x.UniqueType == item.UniqueType)
|
||||||
|
.Where(x => x.UniqueValue == item.UniqueValue)
|
||||||
|
.Where(x => x.UserId == item.UserId)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
//todo 差异数据
|
||||||
|
await _dbContext.Client.Deleteable(permissions).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
await _dbContext.InsertAsync(new DevicePermissionEntity
|
||||||
|
{
|
||||||
|
UserId = item.UserId,
|
||||||
|
UniqueType = item.UniqueType,
|
||||||
|
UniqueValue = item.UniqueValue,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<Guid>> GetAssignmentsAsync(string userId, DeviceAssignmentTypeEnumType uniqueType, Guid? uniqueValue)
|
||||||
|
{
|
||||||
|
var assignments = await _dbContext.Queryable<DevicePermissionEntity>()
|
||||||
|
.Where(x => x.UniqueType == uniqueType)
|
||||||
|
.WhereIF(uniqueValue.HasValue, x => x.UniqueValue == uniqueValue)
|
||||||
|
.Where(x => x.UserId == userId)
|
||||||
|
.Select(x => x.UniqueValue)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return assignments;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using SqlSugar;
|
using Kurisu.SqlSugar;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity;
|
namespace Dlhis.Entity.Basic.Entity;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity;
|
namespace Dlhis.Entity.Basic.Entity;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using SqlSugar;
|
using Kurisu.SqlSugar;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity;
|
namespace Dlhis.Entity.Basic.Entity;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Dlhis.Entity.Device.Enums;
|
using Dlhis.Entity.Device.Enums;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity;
|
namespace Dlhis.Entity.Basic.Entity;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity;
|
namespace Dlhis.Entity.Basic.Entity;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Entity.Basic.Enums;
|
using Dlhis.Entity.Basic.Enums;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using SqlSugar;
|
using Kurisu.SqlSugar;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Basic.Entity;
|
namespace Dlhis.Entity.Basic.Entity;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Entity;
|
using Dlhis.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.ScheduledTask.Entities
|
namespace Dlhis.ScheduledTask.Entities
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Entity;
|
using Dlhis.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.ScheduledTask.Entities
|
namespace Dlhis.ScheduledTask.Entities
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
|
|||||||
@@ -40,4 +40,5 @@ public class CanteenOrderEntity : BalanceRecordEntity, ITenantId
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDescription = "处理结果")]
|
[SugarColumn(ColumnDescription = "处理结果")]
|
||||||
public string Result { get; set; }
|
public string Result { get; set; }
|
||||||
|
public string TenantId { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Device.Entities;
|
namespace Dlhis.Entity.Device.Entities;
|
||||||
@@ -9,6 +10,12 @@ namespace Dlhis.Entity.Device.Entities;
|
|||||||
[SugarTable(TableName = "DeviceGroup", TableDescription = "设备组")]
|
[SugarTable(TableName = "DeviceGroup", TableDescription = "设备组")]
|
||||||
public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted
|
public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 上级设备组code
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "上级设备组code")]
|
||||||
|
public Guid? PCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备组code
|
/// 设备组code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -21,6 +28,7 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted
|
|||||||
[SugarColumn(ColumnDescription = "设备组名称")]
|
[SugarColumn(ColumnDescription = "设备组名称")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Device.Entities;
|
namespace Dlhis.Entity.Device.Entities;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Device.Entities;
|
namespace Dlhis.Entity.Device.Entities;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using SqlSugar;
|
using Kurisu.SqlSugar;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Device.Entities;
|
namespace Dlhis.Entity.Device.Entities;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.SqlSugar" Version="0.0.3" />
|
<PackageReference Include="Kurisu.SqlSugar" Version="0.0.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Dlhis.Entity.Sys.Enums;
|
using Dlhis.Entity.Sys.Enums;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
namespace Dlhis.Entity.Sys.Entities;
|
namespace Dlhis.Entity.Sys.Entities;
|
||||||
|
|
||||||
@@ -8,25 +10,27 @@ namespace Dlhis.Entity.Sys.Entities;
|
|||||||
/// 设备权限
|
/// 设备权限
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable(TableName = "DevicePermission", TableDescription = "设备权限")]
|
[SugarTable(TableName = "DevicePermission", TableDescription = "设备权限")]
|
||||||
public class DevicePermissionEntity : ITenantId
|
public class DevicePermissionEntity : SugarBaseEntity, ITenantId, ISoftDeleted
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 人员档案
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "人员档案")]
|
||||||
|
public string UserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备权限类型
|
/// 设备权限类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "设备权限类型", SqlParameterDbType = typeof(DevicePermissionTypeEnumType))]
|
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "设备权限类型", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
public DevicePermissionTypeEnumType UniqueType { get; set; }
|
public DeviceAssignmentTypeEnumType UniqueType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 类型值
|
/// 类型值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "类型值")]
|
[SugarColumn(ColumnDescription = "类型值")]
|
||||||
public string UniqueValue { get; set; }
|
public Guid UniqueValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 设备code
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "设备code")]
|
|
||||||
public string Code { get; set; }
|
|
||||||
|
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
|
|
||||||
|
public bool IsDeleted { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Entity.Sys.Enums;
|
using Dlhis.Entity.Sys.Enums;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Dlhis.Entity.Sys.Enums;
|
using Dlhis.Entity.Sys.Enums;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
|
using Kurisu.SqlSugar;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
|
||||||
|
|||||||
22
Src/Dlhis.Entity/Sys/Entities/TenantEntity.cs
Normal file
22
Src/Dlhis.Entity/Sys/Entities/TenantEntity.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Dlhis.Entity.Sys.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable(TableName = "Tenants")]
|
||||||
|
public class TenantEntity
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基地code
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 租户名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
@@ -5,18 +5,18 @@ namespace Dlhis.Entity.Sys.Enums;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备权限类型
|
/// 设备权限类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("设备权限类型")]
|
[Description("设备分配权限类型")]
|
||||||
public enum DevicePermissionTypeEnumType
|
public enum DeviceAssignmentTypeEnumType
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 设备
|
||||||
|
/// </summary>
|
||||||
|
[Description("设备")]
|
||||||
|
Device = 1,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备组
|
/// 设备组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("设备组")]
|
[Description("设备组")]
|
||||||
Group = 1,
|
Group = 2
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 人员
|
|
||||||
/// </summary>
|
|
||||||
[Description("人员")]
|
|
||||||
Person = 2
|
|
||||||
}
|
}
|
||||||
@@ -20,8 +20,7 @@
|
|||||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.7" />
|
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.7" />
|
||||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||||
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
|
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.8" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ namespace Dlhis.ScheduledTask.Job
|
|||||||
{
|
{
|
||||||
SapNo = item.ano,
|
SapNo = item.ano,
|
||||||
No = item.guestno,
|
No = item.guestno,
|
||||||
//GType = item.@class,
|
Type = item.@class,
|
||||||
Name = item.gname,
|
Name = item.gname,
|
||||||
Code = item.ename,
|
Code = item.ename,
|
||||||
CountryNo = item.country,
|
CountryNo = item.country,
|
||||||
|
|||||||
@@ -17,8 +17,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.8" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user