From 870b84820381df8c773f02f40651ae28a73c2a92 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 4 Jul 2024 18:19:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=87=BA=E5=B7=AE=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Device/Entities/DeviceGroupEntity.cs | 6 ++++++ .../Jobs/CreateDefinitelyGroupJob.cs | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs index 1b7a35d3..4b2b916f 100644 --- a/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs +++ b/Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs @@ -61,6 +61,12 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted [SugarColumn(ColumnDataType = "bit", DefaultValue = "0")] public bool AsAppointment { get; set; } = false; + + /// + /// 是否为出差分组 + /// + [SugarColumn(ColumnDataType = "bit", DefaultValue = "0")] + public bool IsBusinessTrip { get; set; } = false; public string TenantId { get; set; } diff --git a/Src/Dlhis.ScheduledTask/Jobs/CreateDefinitelyGroupJob.cs b/Src/Dlhis.ScheduledTask/Jobs/CreateDefinitelyGroupJob.cs index 40cc38fe..6c47d56c 100644 --- a/Src/Dlhis.ScheduledTask/Jobs/CreateDefinitelyGroupJob.cs +++ b/Src/Dlhis.ScheduledTask/Jobs/CreateDefinitelyGroupJob.cs @@ -117,10 +117,11 @@ public class CreateDefinitelyGroupJob : BaseJob var factoryName = $"*{type.GetDescription()}厂区系统组({factory.Name})"; if (!await DbContext.Queryable().Where(x => x.PCode == workplaceGrp.Code).AnyAsync(x => x.Name == factoryName)) { + var currentCode = Guid.NewGuid(); await DbContext.InsertAsync(new DeviceGroupEntity { PCode = workplaceGrp.Code, - Code = Guid.NewGuid(), + Code = currentCode, Type = type, Name = factoryName, Editable = false, @@ -129,6 +130,22 @@ public class CreateDefinitelyGroupJob : BaseJob TenantId = factory.Code, }); + + if (type == DeviceTypeEnumType.Door) + { + await DbContext.InsertAsync(new DeviceGroupEntity + { + PCode = currentCode, + Code = currentCode, + Type = type, + Name = "出差组", + Editable = false, + AbleSetNext = false, + Remark = _remark, + IsBusinessTrip = true, + TenantId = factory.Code + }); + } } } }