From c67424492ad1001bbb968580f74ffaeba14c771f Mon Sep 17 00:00:00 2001 From: lyndonliu Date: Fri, 29 Mar 2024 18:05:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9F=A5=E4=BA=86=E5=86=8D=E5=88=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exams/ExamManager.cs | 14 +++++++++++--- .../DolphinExamPictureCutHttpApiHostModule.cs | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs index aee40b1..7464b60 100644 --- a/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs +++ b/Dolphin.ExamPictureCut.Application/Exams/ExamManager.cs @@ -105,7 +105,7 @@ public class ExamManager : DomainService, IExamManager }).ToListAsync(); var gotoCount = 0; -dotPenOriginalImg: + dotPenOriginalImg: var zgtSettingDtls = await DbBiz.Queryable().Where(w => w.ExamSubjectId == eto.ExamSubjectId).ToListAsync(); // 割原题 @@ -413,11 +413,19 @@ dotPenOriginalImg: await DbBiz.BeginTranAsync(); // 删除 - await DbBiz.Deleteable().Where(w => w.ExamSubjectId == eto.ExamSubjectId && w.StudentNo == penSerial).ExecuteCommandAsync(); + var delObjectiveIds = await DbBiz.Queryable() + .Where(w => w.ExamSubjectId == eto.ExamSubjectId && w.StudentNo == penSerial) + .Select(s => s.Id).ToListAsync(); + await DbBiz.Deleteable().Where(w => delObjectiveIds.Contains(w.Id)).ExecuteCommandAsync(); + + var delSubjectiveIds = await DbBiz.Queryable() + .Where(w => w.ExamSubjectId == eto.ExamSubjectId && w.StudentExamNum == penSerial && w.IsDeleted == false) + .Select(s => s.Id).ToListAsync(); await DbBiz.Updateable() .SetColumns(s => new SubjectiveMarkingResult { IsDeleted = true, UpdateDate = Clock.Now }) - .Where(w => w.ExamSubjectId == eto.ExamSubjectId && w.StudentExamNum == penSerial && w.IsDeleted == false) + .Where(w => delSubjectiveIds.Contains(w.Id)) .ExecuteCommandAsync(); + // 新增 await DbBiz.Insertable(kgtDtls).ExecuteCommandAsync(); await DbBiz.Insertable(zgtDtls).ExecuteCommandAsync(); diff --git a/Dolphin.ExamPictureCut.HttpApi.Host/DolphinExamPictureCutHttpApiHostModule.cs b/Dolphin.ExamPictureCut.HttpApi.Host/DolphinExamPictureCutHttpApiHostModule.cs index d441447..f69d096 100644 --- a/Dolphin.ExamPictureCut.HttpApi.Host/DolphinExamPictureCutHttpApiHostModule.cs +++ b/Dolphin.ExamPictureCut.HttpApi.Host/DolphinExamPictureCutHttpApiHostModule.cs @@ -63,7 +63,7 @@ public class DolphinExamPictureCutHttpApiHostModule : AbpModule }, db => { - db.QueryFilter.AddTableFilter(s => s.IsDeleted == false); + //db.QueryFilter.AddTableFilter(s => s.IsDeleted == false); var config = new SqlSugarConfig(); db.Aop.DataExecuting = config.DataExecuting(context.Services); -- 2.40.1