fix .
This commit is contained in:
@@ -347,6 +347,7 @@ public class AppointmentService : IAppointmentService
|
|||||||
var gainfoLeaves = await _dbContext.Queryable<GainfoLeaveEntity>()
|
var gainfoLeaves = await _dbContext.Queryable<GainfoLeaveEntity>()
|
||||||
.Where(x => x.Type == GainfoUserTypeEnumType.External)
|
.Where(x => x.Type == GainfoUserTypeEnumType.External)
|
||||||
.Where(x => SqlFunc.DateIsSame(x.ResignationDate, day))
|
.Where(x => SqlFunc.DateIsSame(x.ResignationDate, day))
|
||||||
|
.Where(x => SqlFunc.Subqueryable<GainfoEntity>().Where(p => p.No == x.No).NotAny())
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
foreach (var gainfoLeave in gainfoLeaves)
|
foreach (var gainfoLeave in gainfoLeaves)
|
||||||
@@ -359,9 +360,17 @@ public class AppointmentService : IAppointmentService
|
|||||||
await _dbContext.InsertAsync(gainfo);
|
await _dbContext.InsertAsync(gainfo);
|
||||||
await _dbContext.DeleteReallyAsync(gainfoLeave);
|
await _dbContext.DeleteReallyAsync(gainfoLeave);
|
||||||
|
|
||||||
var detail = await _dbContext.Queryable<VisitorAppointmentDetailEntity>().Where(x => x.UserNo == gainfo.No).SingleAsync();
|
var detail = await _dbContext.Queryable<VisitorAppointmentDetailEntity>().Where(x => x.UserNo == gainfo.No).OrderByDescending(x => x.Id).FirstAsync();
|
||||||
detail.ThrowIfNull("数据不存在");
|
detail.ThrowIfNull("数据不存在");
|
||||||
|
if (detail.IsEnterDoorArea)
|
||||||
|
{
|
||||||
|
detail.DoorStatus = VisitorAppointmentDetailStatusEnumType.Arrived;
|
||||||
|
}
|
||||||
|
if (detail.IsEnterWorkplace)
|
||||||
|
{
|
||||||
|
detail.WorkplaceStatus = VisitorAppointmentDetailStatusEnumType.Arrived;
|
||||||
|
}
|
||||||
|
await _dbContext.UpdateAsync(detail);
|
||||||
await GenerateDeviceTasksAsync(detail, true, DeviceTaskEnumType.Update, "数据恢复");
|
await GenerateDeviceTasksAsync(detail, true, DeviceTaskEnumType.Update, "数据恢复");
|
||||||
|
|
||||||
await _dbContext.Client.Ado.CommitTranAsync();
|
await _dbContext.Client.Ado.CommitTranAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user