Merge branch 'Test.IRC' of http://192.168.3.69:2000/XCKJ/irc-netcore-api into Test.IRC
						commit
						70362b8f96
					
				| 
						 | 
					@ -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
 | 
					    public class TrialQCQuestionConfigureBatchAdd
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,6 +6,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using IRaCIS.Core.Application.Auth;
 | 
					using IRaCIS.Core.Application.Auth;
 | 
				
			||||||
using IRaCIS.Core.Application.Filter;
 | 
					using IRaCIS.Core.Application.Filter;
 | 
				
			||||||
 | 
					using IRaCIS.Core.Application.ViewModel;
 | 
				
			||||||
using IRaCIS.Core.Infra.EFCore;
 | 
					using IRaCIS.Core.Infra.EFCore;
 | 
				
			||||||
using IRaCIS.Core.Infrastructure;
 | 
					using IRaCIS.Core.Infrastructure;
 | 
				
			||||||
using MassTransit;
 | 
					using MassTransit;
 | 
				
			||||||
| 
						 | 
					@ -146,6 +147,34 @@ namespace IRaCIS.Core.Application.Contracts
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 批量删除项目QC问题
 | 
				
			||||||
 | 
					        /// </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>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 批量添加 QC 问题
 | 
					        /// 批量添加 QC 问题
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -473,9 +473,22 @@ namespace IRaCIS.Core.Application.Service
 | 
				
			||||||
        [HttpPost]
 | 
					        [HttpPost]
 | 
				
			||||||
        public async Task<IResponseOutput> BatchDeteteCriterionMedicineQuestion(BatchDeteteCriterionMedicineQuestionInDto inDto)
 | 
					        public async Task<IResponseOutput> BatchDeteteCriterionMedicineQuestion(BatchDeteteCriterionMedicineQuestionInDto inDto)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => inDto.Ids.Contains(x.Id));
 | 
					
 | 
				
			||||||
	    	var result=	await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
 | 
								var questionlist =await _readingMedicineTrialQuestionRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).ToListAsync();
 | 
				
			||||||
			return ResponseOutput.Result(result);
 | 
					
 | 
				
			||||||
 | 
								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