fix sql逻辑处理替换
This commit is contained in:
@@ -23,7 +23,8 @@ public class AutoConfirmAppointmentJob : BaseJob
|
||||
protected override async Task RunAsync(IServiceProvider serviceProvider)
|
||||
{
|
||||
var details = await DbContext.Queryable<VisitorAppointmentDetailEntity>()
|
||||
.Where(x => x.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait)
|
||||
.Where(x => x.IsEnterDoorArea == false || (x.IsEnterDoorArea && x.DoorStatus == VisitorAppointmentDetailStatusEnumType.Arrived))
|
||||
.Where(x => x.IsEnterWorkplace && x.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait && DateTime.Now >= x.WorkplaceStart)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var detail in details)
|
||||
@@ -70,15 +71,6 @@ public class AutoConfirmAppointmentJob : BaseJob
|
||||
|
||||
private static IEnumerable<string> GetValidAreaCodes(VisitorAppointmentDetailEntity detail)
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
|
||||
var before = (detail.IsEnterDoorArea = false) || (detail.IsEnterDoorArea && detail.DoorStatus == VisitorAppointmentDetailStatusEnumType.Arrived);
|
||||
if (before && detail.IsEnterWorkplace && detail.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait && now >= detail.WorkplaceStart)
|
||||
{
|
||||
foreach (var item in detail.ApplyWorkplaceAreas)
|
||||
{
|
||||
yield return item;
|
||||
}
|
||||
}
|
||||
return detail.ApplyWorkplaceAreas;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user