From 4e88466bff1e88b1d8ebbf6046868f1b9b4c2b89 Mon Sep 17 00:00:00 2001 From: cheche <717840555@qq.com> Date: Tue, 30 Jan 2024 17:31:12 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E8=AE=BE=E5=A4=87=E5=92=8C=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=BB=84=E5=8A=9F=E8=83=BD=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs | 6 ++++ .../Device/Entities/DeviceGroupEntity.cs | 10 +++++- .../Enums/DeviceGroupFunctionEnumType.cs | 33 +++++++++++++++++++ .../Implements/DeviceTaskAssignmentService.cs | 2 +- Src/Dlhis.ScheduledTask/appsettings.json | 2 +- 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 Src/Dlhis.Entity/Device/Enums/DeviceGroupFunctionEnumType.cs diff --git a/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs b/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs index 18cdee52..b577bcb2 100644 --- a/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs +++ b/Src/Dlhis.Entity/Basic/Entity/DeviceEntity.cs @@ -41,6 +41,12 @@ public class DeviceEntity : SugarBaseEntity, ITenantId [SugarColumn(ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能", DefaultValue = "[]")] public List Funcs { get; set; } + /// + /// 设备机功能类型 + /// + [SugarColumn(ColumnDataType = "varchar(150)", ColumnDescription = "设备机功能类型")] + public DeviceGroupFunctionEnumType Type { get; set; } + /// /// 部署点 /// diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs index 95e0dad6..3008f9cd 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs @@ -1,4 +1,5 @@ -using Kurisu.Core.DataAccess.Entity; +using Dlhis.Entity.Device.Enums; +using Kurisu.Core.DataAccess.Entity; using Kurisu.SqlSugar; using SqlSugar; @@ -10,6 +11,13 @@ namespace Dlhis.Entity.Device.Entities; [SugarTable(TableName = "DeviceGroup", TableDescription = "设备组")] public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted { + + /// + /// 设备组功能类型 + /// + [SugarColumn(ColumnDataType = "varchar(150)", ColumnDescription = "设备组功能类型")] + public DeviceGroupFunctionEnumType Type { get; set; } + /// /// 上级设备组code /// diff --git a/Src/Dlhis.Entity/Device/Enums/DeviceGroupFunctionEnumType.cs b/Src/Dlhis.Entity/Device/Enums/DeviceGroupFunctionEnumType.cs new file mode 100644 index 00000000..e7838266 --- /dev/null +++ b/Src/Dlhis.Entity/Device/Enums/DeviceGroupFunctionEnumType.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Dlhis.Entity.Device.Enums; + +/// +/// 设备/设备组功能类型 +/// +[Description("设备/设备组功能类型")] +public enum DeviceGroupFunctionEnumType +{ + /// + /// 门禁 + /// + [Description("门禁")] + Door = 1, + + /// + /// 就餐 + /// + [Description("就餐")] + Meal = 2, + + /// + /// 考勤 + /// + [Description("考勤")] + Attendance = 3 , +} diff --git a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs index 4169a7e1..36bcdc1b 100644 --- a/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs +++ b/Src/Dlhis.ScheduledTask/TaskAssignment/Services/Implements/DeviceTaskAssignmentService.cs @@ -51,7 +51,7 @@ public class DeviceTaskAssignmentService : IDeviceTaskAssignmentService { //获取启用的功能设备 var devices = await _dbContext.Queryable() - .Where(x => x.Enable && x.Funcs.Contains(request.type)) + .Where(x => x.Funcs.Contains(request.type)) //.Where(x=>x.UniqueNo == "717840555") .Select(x => x.UniqueNo) .ToListAsync(); diff --git a/Src/Dlhis.ScheduledTask/appsettings.json b/Src/Dlhis.ScheduledTask/appsettings.json index f1ea382d..8604bb0c 100644 --- a/Src/Dlhis.ScheduledTask/appsettings.json +++ b/Src/Dlhis.ScheduledTask/appsettings.json @@ -14,7 +14,7 @@ "EnableSqlLog": false }, "ConnectionStrings": { - "HangfireConnection": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=hangfire;charset=utf8mb4;Allow User Variables=true;" + "HangfireConnection": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=hangfire;default command timeout=100;Connection Timeout=30;Charset=utf8mb4;Allow User Variables=true;IgnoreCommandTransaction=true" }, "FaceUrlOptions": { "Url": "https://yikatong.isawesome.cn/api/basic/gainfos/face?token=",