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);