fix 排除不可用用人员的设备

This commit is contained in:
2025-02-07 14:32:54 +08:00
parent 8f370899e9
commit cc93121402

View File

@@ -122,13 +122,14 @@ public class DevicePermissionAnalyzeService : IDevicePermissionAnalyzeService
internalIgnoreAssignTypes.Add(AssignTypeEnumType.Tenant);
}
var excludes = new[] { GainfoUserTypeEnumType.Outsource, GainfoUserTypeEnumType.External };
var analyzePack = new AnalyzePackDto
{
UserNo = gainfo.No,
UserDepartment = gainfo.DepartmentNo,
UserFactory = gainfo.Factory,
UserGainfoGroupCodes = gainfoGroupRelationships.Where(x => x.UserNo == gainfo.No).Select(x => x.GroupCode),
DeviceCodes = devices.WhereIf(gainfo.Type == GainfoUserTypeEnumType.Outsource, x => x.Type != DeviceTypeEnumType.Meal).Select(x => x.Code), //外包人员不允许餐饮
DeviceCodes = devices.WhereIf(excludes.Contains(gainfo.Type), x => x.Type != DeviceTypeEnumType.Meal).Select(x => x.Code), //不允许餐饮
IgnoreAssignValue = ignoreAssignValue,
IgnoreAssignTypes = internalIgnoreAssignTypes,
IgnoreUniqueType = ignoreUniqueType