fix 自动创建出差分组
This commit is contained in:
@@ -61,6 +61,12 @@ public class DeviceGroupEntity : SugarBaseEntity, ITenantId, ISoftDeleted
|
||||
[SugarColumn(ColumnDataType = "bit", DefaultValue = "0")]
|
||||
public bool AsAppointment { get; set; } = false;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否为出差分组
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "bit", DefaultValue = "0")]
|
||||
public bool IsBusinessTrip { get; set; } = false;
|
||||
|
||||
public string TenantId { get; set; }
|
||||
|
||||
|
||||
@@ -117,10 +117,11 @@ public class CreateDefinitelyGroupJob : BaseJob
|
||||
var factoryName = $"*{type.GetDescription()}厂区系统组({factory.Name})";
|
||||
if (!await DbContext.Queryable<DeviceGroupEntity>().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
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user