修改一版
parent
ac070717c3
commit
7d91009ece
|
@ -59,6 +59,25 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
}
|
||||
|
||||
|
||||
public class GetReadingMedicineTrialOtherQuestionOutDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string QuestionName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目的其他问题
|
||||
/// </summary>
|
||||
public class GetReadingMedicineTrialOtherQuestionInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? Id { get; set; }
|
||||
}
|
||||
|
||||
|
||||
///<summary> ReadingMedicineSystemQuestionAddOrEdit 列表查询参数模型</summary>
|
||||
public class ReadingMedicineSystemQuestionAddOrEdit
|
||||
{
|
||||
|
|
|
@ -58,6 +58,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除系统的医学审核问题
|
||||
/// </summary>
|
||||
|
@ -66,6 +69,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpDelete("{id:guid}")]
|
||||
public async Task<IResponseOutput> DeleteReadingMedicineSystemQuestion(Guid id)
|
||||
{
|
||||
if (await _readingMedicineSystemQuestionRepository.AnyAsync(x => x.ParentId == id))
|
||||
{
|
||||
return ResponseOutput.NotOk("此问题存在子问题,请先删除子问题");
|
||||
}
|
||||
var success = await _readingMedicineSystemQuestionRepository.DeleteFromQueryAsync(t => t.Id == id);
|
||||
var result = await _readingMedicineSystemQuestionRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(result);
|
||||
|
@ -104,6 +111,31 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目的其他医学审核问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetReadingMedicineTrialOtherQuestionOutDto>> GetReadingMedicineTrialOtherQuestion(GetReadingMedicineTrialOtherQuestionInDto inDto)
|
||||
{
|
||||
var types = new List<string>()
|
||||
{
|
||||
"select","radio"
|
||||
};
|
||||
var questionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||
.Where(x => types.Contains(x.Type))
|
||||
.WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id)
|
||||
.Select(x => new GetReadingMedicineTrialOtherQuestionOutDto()
|
||||
{
|
||||
Id = x.Id,
|
||||
QuestionName = x.QuestionName,
|
||||
}).ToListAsync();
|
||||
|
||||
return questionList;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除项目的医学审核问题
|
||||
/// </summary>
|
||||
|
@ -112,6 +144,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpDelete("{id:guid}")]
|
||||
public async Task<IResponseOutput> DeleteReadingMedicineTrialQuestion(Guid id)
|
||||
{
|
||||
if (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.ParentId == id))
|
||||
{
|
||||
return ResponseOutput.NotOk("此问题存在子问题,请先删除子问题");
|
||||
}
|
||||
var success = await _readingMedicineTrialQuestionRepository.DeleteFromQueryAsync(t => t.Id == id);
|
||||
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(result);
|
||||
|
|
|
@ -707,23 +707,6 @@ namespace IRaCIS.Application.Services
|
|||
return questionList;
|
||||
}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 设置问题为裁判问题
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//public async Task<IResponseOutput> SetTrialQuestionIsIsJudgeQuestion(SetTrialQuestionIsIsJudgeQuestionInDto inDto)
|
||||
//{
|
||||
// var trialCriterionId = (await _readingQuestionTrialRepository.FirstOrDefaultAsync(x => x.Id == inDto.Id)).IfNullThrowException();
|
||||
|
||||
// if (inDto.IsJudgeQuestion)
|
||||
// {
|
||||
// if()
|
||||
// }
|
||||
|
||||
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 删除项目问题(项目)
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue