diff --git a/IRaCIS.Core.Application/Service/Reading/Segment/SegmentationService.cs b/IRaCIS.Core.Application/Service/Reading/Segment/SegmentationService.cs index e836a2d32..0278d9fe7 100644 --- a/IRaCIS.Core.Application/Service/Reading/Segment/SegmentationService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Segment/SegmentationService.cs @@ -111,7 +111,8 @@ public class SegmentationService(IRepository _segmentationReposito var startTime = maxVersion != null ? maxVersion.CreateTime :(data.SEGUpdateTime==null? DateTime.MinValue: data.SEGUpdateTime.Value); var segmentList = await _segmentRepository - .Where(x=>x.CreateTime<= startTime) + .Where(x=>x.CreateTime<= startTime && (!x.IsDeleted||x.DeletedTime> startTime)) + .Where(x => x.SegmentationId == inDto.SegmentationId).OrderBy(x=>x.SegmentNumber).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); if (data.SEGUrl != string.Empty&&(inDto.SEGUrl!=data.SEGUrl||inDto.IsRestore)) @@ -268,7 +269,7 @@ public class SegmentationService(IRepository _segmentationReposito public async Task DeleteSegment(Guid segmentId) { await DeleteBindingsAndAnswersAsync(null, segmentId); - var success = await _segmentRepository.DeleteFromQueryAsync(t => t.Id == segmentId, true); + var success = await _segmentRepository.SoftDeleteFromQueryAsync(t => t.Id == segmentId, true); return ResponseOutput.Ok(); }