diff --git a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs index 3a6bdb4d..26abef70 100644 --- a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs +++ b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs @@ -210,7 +210,10 @@ public class AppointmentService : IAppointmentService { return await _dbContext.Queryable() .LeftJoin((x, ga) => ga.IdNo == x.IdNo) - .Where(x => SqlFunc.Subqueryable().Where(p => p.Factory == factory).Any()) + .Where(x => SqlFunc.Subqueryable() + .Where(p => p.No == x.No) + .Where(p => p.Factory == factory).Any() + ) .Where(x => x.IsEnterDoorArea) .WhereIF(status.HasValue, x => x.DoorStatus == status) .Where(x => x.DoorStart >= start && x.DoorEnd <= end) diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs index 88601a8a..4253b7ff 100644 --- a/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs +++ b/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs @@ -145,6 +145,10 @@ public class BalanceService : IBalanceService .ExecuteCommandThrowVersionAsync(); }, 5); } + else + { + await _balanceRepository.CalculateBalanceAsync(balanceRecord.UserCode); + } } } }