From 4f09d432d8afa0c3bd7137f33822fd8c7b4d0b8f Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 27 Mar 2025 14:41:51 +0800 Subject: [PATCH] add . --- .../Services/Implements/SapBusinessTripService.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/SapBusinessTripService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/SapBusinessTripService.cs index a89f549d..75084bc2 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/SapBusinessTripService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/SapBusinessTripService.cs @@ -34,7 +34,7 @@ public class SapBusinessTripService : ISapBusinessTripService /// public async Task HandlerBusinessTripsByFactoryAsync(string factory) { - var today = DateTime.Today; + var today =DateTime.Today; var yesterday = today.AddDays(-1); try @@ -64,6 +64,7 @@ public class SapBusinessTripService : ISapBusinessTripService var tripInfos = await _dbContext.Queryable() .Where(x => SqlFunc.DateIsSame(x.BeginDate, today) || SqlFunc.DateIsSame(x.BeginDate, yesterday)) .Where(x => !SqlFunc.IsNullOrEmpty(x.Destination)) + .Where(x => !SqlFunc.IsNullOrEmpty(x.BeginDateTime) && !SqlFunc.IsNullOrEmpty(x.EndDateTime)) .Where(x => x.Destination == factory) .ToListAsync(); @@ -72,9 +73,14 @@ public class SapBusinessTripService : ISapBusinessTripService .Where(x => x.Type == DeviceTypeEnumType.Door) .Where(x => x.TenantId == factory) .Where(x => x.IsBusinessTrip) + .Where(x => x.IsDeleted == false) .SingleAsync(); - var deviceCodes = await _dbContext.Queryable().Where(x => x.GroupCode == tripGroup.Code).Select(x => x.DeviceCode).ToListAsync(); + var deviceCodes = await _dbContext.Queryable() + .Where(x => x.GroupCode == tripGroup.Code) + .Where(x => x.IsDeleted == false) + .Select(x => x.DeviceCode) + .ToListAsync(); if (deviceCodes.Any()) {