fix 重复数据下发处理
This commit is contained in:
@@ -23,12 +23,17 @@ public class AutoConfirmAppointmentJob : BaseJob
|
||||
protected override async Task RunAsync(IServiceProvider serviceProvider)
|
||||
{
|
||||
var details = await DbContext.Queryable<VisitorAppointmentDetailEntity>()
|
||||
.Where(x => x.DoorStatus == VisitorAppointmentDetailStatusEnumType.Wait || x.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait)
|
||||
.Where(x => x.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var detail in details)
|
||||
{
|
||||
var areaCodes = GetValidAreaCodes(detail);
|
||||
var areaCodes = GetValidAreaCodes(detail).ToList();
|
||||
if (!areaCodes.Any())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var existsAreaCodes = await DbContext.Queryable<AppointmentAreaEntity>().Where(x => areaCodes.Contains(x.CustomCode)).Select(x => x.CustomCode).ToListAsync();
|
||||
|
||||
//当前分配的设备组code
|
||||
@@ -53,7 +58,6 @@ public class AutoConfirmAppointmentJob : BaseJob
|
||||
Version = 0
|
||||
}).ToList());
|
||||
|
||||
|
||||
if (detail.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait)
|
||||
{
|
||||
detail.WorkplaceStatus = VisitorAppointmentDetailStatusEnumType.Arrived;
|
||||
@@ -68,7 +72,7 @@ public class AutoConfirmAppointmentJob : BaseJob
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
|
||||
if (detail.IsEnterWorkplace && now >= detail.WorkplaceStart)
|
||||
if (detail.IsEnterWorkplace && detail.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait && now >= detail.WorkplaceStart)
|
||||
{
|
||||
foreach (var item in detail.ApplyWorkplaceAreas)
|
||||
{
|
||||
|
||||
@@ -76,12 +76,12 @@ public class AutoRemoveAppointmentJob : BaseJob
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
|
||||
if (detail.IsEnterDoorArea && detail.DoorEnd <= now)
|
||||
if (detail.IsEnterDoorArea && detail.DoorStatus == VisitorAppointmentDetailStatusEnumType.Arrived && detail.DoorEnd <= now)
|
||||
{
|
||||
yield return detail.ApplyDoorArea;
|
||||
}
|
||||
|
||||
if (detail.IsEnterWorkplace && detail.WorkplaceEnd <= now)
|
||||
if (detail.IsEnterWorkplace && detail.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Arrived && detail.WorkplaceEnd <= now)
|
||||
{
|
||||
foreach (var item in detail.ApplyWorkplaceAreas)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user