fix 状态更新,时间判断
This commit is contained in:
@@ -28,10 +28,7 @@ public class AutoConfirmAppointmentJob : BaseJob
|
||||
|
||||
foreach (var detail in details)
|
||||
{
|
||||
var gainfo = await DbContext.Queryable<GainfoEntity>().Where(x => x.No == detail.UserNo).SingleAsync();
|
||||
var isExternal = gainfo.Type == GainfoUserTypeEnumType.External;
|
||||
|
||||
var areaCodes = GetValidAreaCodes(isExternal, detail);
|
||||
var areaCodes = GetValidAreaCodes(detail);
|
||||
var existsAreaCodes = await DbContext.Queryable<AppointmentAreaEntity>().Where(x => areaCodes.Contains(x.CustomCode)).Select(x => x.CustomCode).ToListAsync();
|
||||
|
||||
//当前分配的设备组code
|
||||
@@ -57,9 +54,9 @@ public class AutoConfirmAppointmentJob : BaseJob
|
||||
}).ToList());
|
||||
|
||||
|
||||
if (detail.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Arrived)
|
||||
if (detail.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait)
|
||||
{
|
||||
detail.WorkplaceStatus = VisitorAppointmentDetailStatusEnumType.Leave;
|
||||
detail.WorkplaceStatus = VisitorAppointmentDetailStatusEnumType.Arrived;
|
||||
}
|
||||
|
||||
await DbContext.UpdateAsync(detail);
|
||||
@@ -67,7 +64,7 @@ public class AutoConfirmAppointmentJob : BaseJob
|
||||
}
|
||||
|
||||
|
||||
private static IEnumerable<string> GetValidAreaCodes(bool isExternal, VisitorAppointmentDetailEntity detail)
|
||||
private static IEnumerable<string> GetValidAreaCodes(VisitorAppointmentDetailEntity detail)
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class AutoRemoveAppointmentJob : BaseJob
|
||||
{
|
||||
detail.DoorStatus = VisitorAppointmentDetailStatusEnumType.Leave;
|
||||
}
|
||||
|
||||
|
||||
if (detail.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Arrived)
|
||||
{
|
||||
detail.WorkplaceStatus = VisitorAppointmentDetailStatusEnumType.Leave;
|
||||
@@ -71,12 +71,12 @@ public class AutoRemoveAppointmentJob : BaseJob
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
|
||||
if (detail.IsEnterDoorArea && detail.DoorEnd >= now)
|
||||
if (detail.IsEnterDoorArea && detail.DoorEnd <= now)
|
||||
{
|
||||
yield return detail.ApplyDoorArea;
|
||||
}
|
||||
|
||||
if (detail.IsEnterWorkplace && detail.WorkplaceEnd >= now)
|
||||
if (detail.IsEnterWorkplace && detail.WorkplaceEnd <= now)
|
||||
{
|
||||
foreach (var item in detail.ApplyWorkplaceAreas)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user