diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteEquipmentSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteEquipmentSurveyService.cs index 1eb6ff320..5fd3f3746 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteEquipmentSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteEquipmentSurveyService.cs @@ -61,9 +61,10 @@ namespace IRaCIS.Core.Application.Contracts //---已锁定,不允许操作 return ResponseOutput.NotOk(_localizer["TrialSiteEquipment_Locked"]); } - var success = await _trialSiteEquipmentSurveyRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialSiteEquipmentSurveyId); + await _trialSiteEquipmentSurveyRepository.DeleteFromQueryAsync(t => t.Id == trialSiteEquipmentSurveyId); + var success = await _trialSiteEquipmentSurveyRepository.SaveChangesAsync(); - return ResponseOutput.Result(success); + return ResponseOutput.Result(success); } diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs index 472be8d48..1a842aad9 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs @@ -142,9 +142,10 @@ namespace IRaCIS.Core.Application.Contracts return ResponseOutput.NotOk(_localizer["TrialSiteUser_Locked"]); } - var success = await _trialSiteUserSurveyRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialSiteUserSurveyId); + await _trialSiteUserSurveyRepository.DeleteFromQueryAsync(t => t.Id == trialSiteUserSurveyId); + var success = await _trialSiteUserSurveyRepository.SaveChangesAsync(); - return ResponseOutput.Result(success); + return ResponseOutput.Result(success); } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 02c444f89..e2fc03275 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1504,12 +1504,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteUserSurvey))) { var type = GetEntityAuditOpt(item); + var entity = item.Entity as TrialSiteUserSurvey; - var entity = item.Entity as TrialSiteUserSurvey; + var trialid = await _dbContext.TrialSiteSurvey.Where(x => x.Id == entity.TrialSiteSurveyId).Select(x=>x.TrialId).FirstOrDefaultAsync(); + + await InsertInspection(entity, type, x => new InspectionConvertDTO() { - IsDistinctionInterface = false + TrialId= trialid, + + IsDistinctionInterface = false }); } @@ -1518,10 +1523,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common var type = GetEntityAuditOpt(item); var entity = item.Entity as TrialSiteEquipmentSurvey; + var trialid = await _dbContext.TrialSiteSurvey.Where(x => x.Id == entity.TrialSiteSurveyId).Select(x => x.TrialId).FirstOrDefaultAsync(); - await InsertInspection(entity, type, x => new InspectionConvertDTO() + await InsertInspection(entity, type, x => new InspectionConvertDTO() { - IsDistinctionInterface = false + TrialId = trialid, + IsDistinctionInterface = false }); } @@ -2527,6 +2534,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as TaskAllocationRule; + var userRealName =await _dbContext.User.Where(x => x.Id == entity.DoctorUserId).Select(x => x.FullName).FirstOrDefaultAsync(); + await InsertInspection(entity, type, x => new InspectionConvertDTO() { IsDistinctionInterface = false, @@ -2535,7 +2544,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId2 = entity.DoctorUserId - }); + }, new { + UserRealName= userRealName + }); } // suject 医生绑定关系 @@ -3115,8 +3126,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common var type = GetEntityAuditOpt(item); var entity = item.Entity as VisitTask; - - var obj = new object() { }; + var userRealName = await _dbContext.User.Where(x => x.Id == entity.DoctorUserId).Select(x => x.FullName).FirstOrDefaultAsync(); + var obj = new { UserRealName= userRealName }; #region 标识区分