修改一版
This commit is contained in:
@@ -52,10 +52,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
///<summary>ReadingMedicineSystemQuestionQuery 列表查询参数模型</summary>
|
||||
public class ReadingMedicineSystemQuestionQuery:PageInput
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string ParentTriggerValue { get; set; }
|
||||
public string QuestionName { get; set; }
|
||||
public string TypeValue { get; set; }
|
||||
public string Type { get; set; }=string.Empty;
|
||||
public string ParentTriggerValue { get; set; } = string.Empty;
|
||||
public string QuestionName { get; set; } = string.Empty;
|
||||
public string TypeValue { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,13 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public string QuestionName { get; set; }
|
||||
}
|
||||
|
||||
public class AddTrialDataFromSystemInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public List<Guid> SystemQuestionIds { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目的其他问题
|
||||
/// </summary>
|
||||
@@ -151,15 +158,15 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
public string ParentTriggerValue { get; set; }
|
||||
public string ParentTriggerValue { get; set; } = string.Empty;
|
||||
|
||||
public string QuestionName { get; set; }
|
||||
public string QuestionName { get; set; } = string.Empty;
|
||||
|
||||
public string TypeValue { get; set; }
|
||||
public string TypeValue { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
///<summary> ReadingMedicineTrialQuestionAddOrEdit 列表查询参数模型</summary>
|
||||
public class ReadingMedicineTrialQuestionAddOrEdit
|
||||
|
||||
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using MassTransit;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -135,6 +136,31 @@ namespace IRaCIS.Core.Application.Service
|
||||
return questionList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从系统里面选择问题添加到项目里面
|
||||
/// </summary>
|
||||
/// <param name="InDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddTrialDataFromSystem(AddTrialDataFromSystemInDto inDto)
|
||||
{
|
||||
var needList = _readingMedicineSystemQuestionRepository.Where(x => inDto.SystemQuestionIds.Contains(x.Id))
|
||||
.Select(x => new ReadingMedicineTrialQuestion()
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
ShowOrder = x.ShowOrder,
|
||||
IsEnable = x.IsEnable,
|
||||
IsRequired = x.IsRequired,
|
||||
QuestionName = x.QuestionName,
|
||||
Type = x.Type,
|
||||
TypeValue = x.TypeValue,
|
||||
TrialId=inDto.TrialId,
|
||||
});
|
||||
|
||||
await _readingMedicineTrialQuestionRepository.AddRangeAsync(needList);
|
||||
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除项目的医学审核问题
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<ReadingMedicineSystemQuestion, ReadingMedicineSystemQuestionView>();
|
||||
|
||||
CreateMap<ReadingMedicineTrialQuestionAddOrEdit, ReadingMedicineTrialQuestion>();
|
||||
CreateMap<ReadingMedicineSystemQuestion, ReadingMedicineSystemQuestionView>();
|
||||
CreateMap<ReadingMedicineTrialQuestion, ReadingMedicineTrialQuestionView>();
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user