fix 逻辑处理问题
This commit is contained in:
@@ -139,18 +139,22 @@ public class GainfoOutsourceService : IGainfoOutsourceService
|
|||||||
.Select(x => new { x.Id, x.Code, x.Factory, x.CreateTime })
|
.Select(x => new { x.Id, x.Code, x.Factory, x.CreateTime })
|
||||||
.ToListAsync();
|
.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
|
var holidaies = await _dbContext
|
||||||
.Queryable<HolidayEntity>()
|
.Queryable<HolidayEntity>()
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.Type,
|
x.Type,
|
||||||
Period = new DatePeriod
|
x.Start,
|
||||||
{
|
x.End
|
||||||
Start = x.Start,
|
|
||||||
End = x.End
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
@@ -182,7 +186,7 @@ public class GainfoOutsourceService : IGainfoOutsourceService
|
|||||||
//date.DayOfWeek
|
//date.DayOfWeek
|
||||||
foreach (var holiday in holidaies)
|
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 (isPresent)
|
||||||
{
|
{
|
||||||
if (holiday.Type == HolidayEnumType.Rest)
|
if (holiday.Type == HolidayEnumType.Rest)
|
||||||
@@ -190,13 +194,10 @@ public class GainfoOutsourceService : IGainfoOutsourceService
|
|||||||
days--;
|
days--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
if (weekends.Contains(date.DayOfWeek))
|
||||||
if (weekends.Contains(date.DayOfWeek))
|
{
|
||||||
{
|
days--;
|
||||||
days--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (days >= setting.NoRecordAutoResignOutsourceDays)
|
if (days >= setting.NoRecordAutoResignOutsourceDays)
|
||||||
|
|||||||
Reference in New Issue
Block a user