From 1f035abc680051c4a46f6b82221e22905903ddaf Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 2 Jul 2024 10:30:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=B0=B1=E9=A4=90=E6=97=B6=E6=AE=B5?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/BusinessPlaceShiftService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs b/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs index 91e3dc5d..a7683551 100644 --- a/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs +++ b/Src/Dlhis.Basic/BusinessShift/Services/Implements/BusinessPlaceShiftService.cs @@ -88,9 +88,14 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService public async Task SaveMealShiftsAsync(List requests) { + var shiftCode = requests[0].ShiftCode; + + await _dbContext.Deleteable().Where(x => x.ShiftCode == shiftCode).ExecuteCommandAsync(); + + var shift = await CheckExistsShiftAsync(shiftCode); + foreach (var request in requests) { - var shift = await CheckExistsShiftAsync(request.ShiftCode); await CheckExistsMealShiftAsync(request); await DuplicateTimePeriodAsync(request);