fix 逻辑处理问题

This commit is contained in:
2025-12-17 12:25:17 +08:00
parent 54ed9e5933
commit a74c2fa48b

View File

@@ -139,18 +139,22 @@ public class GainfoOutsourceService : IGainfoOutsourceService
.Select(x => new { x.Id, x.Code, x.Factory, x.CreateTime })
.ToListAsync();
var settings = await _factorySettingService.GetListAsync(false);
var settings = new List<FactorySettingResponse>
{
new FactorySettingResponse
{
Factory = "1234",
NoRecordAutoResignOutsourceDays = 1
},
};// await _factorySettingService.GetListAsync(false);
var holidaies = await _dbContext
.Queryable<HolidayEntity>()
.Select(x => new
{
x.Type,
Period = new DatePeriod
{
Start = x.Start,
End = x.End
}
x.Start,
x.End
})
.ToListAsync();
@@ -182,7 +186,7 @@ public class GainfoOutsourceService : IGainfoOutsourceService
//date.DayOfWeek
foreach (var holiday in holidaies)
{
var isPresent = date >= holiday.Period.Start && date <= holiday.Period.Start;
var isPresent = date >= holiday.Start && date <= holiday.Start;
if (isPresent)
{
if (holiday.Type == HolidayEnumType.Rest)
@@ -190,15 +194,12 @@ public class GainfoOutsourceService : IGainfoOutsourceService
days--;
}
}
else
{
}
if (weekends.Contains(date.DayOfWeek))
{
days--;
}
}
}
}
if (days >= setting.NoRecordAutoResignOutsourceDays)
{
try