IRC_NewDev
parent
fae51b4444
commit
7f063cf626
|
@ -106,6 +106,13 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
|
||||
public class BatchDeteteTrialQCQuestionInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public List<Guid> Ids { get; set; }
|
||||
}
|
||||
public class TrialQCQuestionConfigureBatchAdd
|
||||
{
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using MassTransit;
|
||||
|
@ -146,6 +147,34 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量删除项目标准医学审核问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> BatchDeteteTrialQCQuestion(BatchDeteteTrialQCQuestionInDto inDto)
|
||||
{
|
||||
|
||||
var questionlist = await _trialQcQuestionRepository.Where(x => x.TrialId == inDto.TrialId).ToListAsync();
|
||||
|
||||
var count = inDto.Ids.Count();
|
||||
var childids = new List<Guid>();
|
||||
while (count > 0)
|
||||
{
|
||||
childids = questionlist.Where(x => inDto.Ids.Contains(x.ParentId ?? default(Guid))).Select(x => x.Id).ToList();
|
||||
inDto.Ids.AddRange(childids);
|
||||
count = childids.Count();
|
||||
|
||||
}
|
||||
|
||||
await _trialQcQuestionRepository.BatchDeleteNoTrackingAsync(x => inDto.Ids.Contains(x.Id));
|
||||
//var result= await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加 QC 问题
|
||||
/// </summary>
|
||||
|
|
|
@ -473,9 +473,22 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> BatchDeteteCriterionMedicineQuestion(BatchDeteteCriterionMedicineQuestionInDto inDto)
|
||||
{
|
||||
await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => inDto.Ids.Contains(x.Id));
|
||||
var result= await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(result);
|
||||
|
||||
var questionlist =await _readingMedicineTrialQuestionRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).ToListAsync();
|
||||
|
||||
var count = inDto.Ids.Count();
|
||||
var childids = new List<Guid>();
|
||||
while (count > 0)
|
||||
{
|
||||
childids = questionlist.Where(x => inDto.Ids.Contains(x.ParentId ?? default(Guid))).Select(x => x.Id).ToList();
|
||||
inDto.Ids.AddRange(childids);
|
||||
count = childids.Count();
|
||||
|
||||
}
|
||||
|
||||
await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => inDto.Ids.Contains(x.Id));
|
||||
//var result= await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(true);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue