Uat_Study
he 2022-08-19 11:09:36 +08:00
parent 8f2a8a301d
commit ba1c7a7a8e
4 changed files with 74 additions and 5 deletions

View File

@ -24,6 +24,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public string CriterionName { get; set; }
}
public class ReadingTableQuestionTrialView: ReadingTableQuestionSystemView
{
}
public class ReadingTableQuestionSystemView
{
public Guid Id { get; set; }
@ -75,6 +80,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public TableQuestionType? TableQuestionType { get; set; }
}
public class ReadingTableQuestionTrialAddOrEdit: ReadingTableQuestionSystemAddOrEdit
{
}
///<summary> ReadingTableQuestionSystemAddOrEdit 列表查询参数模型</summary>

View File

@ -199,6 +199,25 @@ namespace IRaCIS.Application.Services
}
/// <summary>
/// 获取项目的表格问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<ReadingTableQuestionTrialView>> GetReadingTableQuestionTrialList(ReadingTableQuestionSystemQuery inDto)
{
var readingTableQuestionSystemQueryable = _readingTableQuestionTrialRepository
.WhereIf(inDto.TableQuestionType != null, x => x.TableQuestionType == inDto.TableQuestionType!)
.Where(x => x.ReadingQuestionId == inDto.ReadingQuestionId).ProjectTo<ReadingTableQuestionTrialView>(_mapper.ConfigurationProvider);
var result = await readingTableQuestionSystemQueryable.ToListAsync();
return result;
}
/// <summary>
/// 新增修改系统表格问题
/// </summary>
@ -214,6 +233,40 @@ namespace IRaCIS.Application.Services
}
/// <summary>
/// 新增修改想想项目表格问题
/// </summary>
/// <param name="addOrEditReadingTableQuestionTrial"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> AddOrUpdateReadingTableQuestionTrial(ReadingTableQuestionTrialAddOrEdit addOrEditReadingTableQuestionTrial)
{
var entity = await _readingTableQuestionTrialRepository.InsertOrUpdateAsync(addOrEditReadingTableQuestionTrial, true);
return ResponseOutput.Ok(entity.Id.ToString());
}
/// <summary>
/// 删除项目表格问题
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpDelete("{Id:guid}")]
public async Task<IResponseOutput> DeleteReadingTableQuestionTrial(Guid Id)
{
if (await _readingTableQuestionTrialRepository.AnyAsync(x => x.ParentId == Id || x.RelevanceId == Id))
{
return ResponseOutput.NotOk("当前问题存在子问题 删除失败");
}
await _readingTableQuestionTrialRepository.DeleteFromQueryAsync(t => t.Id == Id);
var success = await _readingTableQuestionTrialRepository.SaveChangesAsync();
return ResponseOutput.Result(success);
}
/// <summary>
/// 删除系统表格问题
@ -228,7 +281,7 @@ namespace IRaCIS.Application.Services
return ResponseOutput.NotOk("当前问题存在子问题 删除失败");
}
await _readingTableQuestionSystemRepository.BatchDeleteNoTrackingAsync(t => t.Id == Id);
await _readingTableQuestionSystemRepository.DeleteFromQueryAsync(t => t.Id == Id);
var success= await _readingTableQuestionSystemRepository.SaveChangesAsync();
return ResponseOutput.Result(success);
}

View File

@ -52,8 +52,13 @@ namespace IRaCIS.Core.Application.Service
#region 阅片问题
CreateMap<ReadingTableQuestionSystem, ReadingTableQuestionSystemView>();
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>();
CreateMap<ReadingTableQuestionSystemAddOrEdit, ReadingTableQuestionSystem>();
CreateMap<ReadingTableQuestionTrialAddOrEdit, ReadingTableQuestionTrial>();
CreateMap<ReadingCriterionPageAddOrEdit, ReadingCriterionPage>();

View File

@ -113,7 +113,7 @@ namespace IRaCIS.Core.Domain.Models
/// <summary>
/// TableQuestionType
/// </summary>
public int TableQuestionType { get; set; }
public TableQuestionType? TableQuestionType { get; set; }
/// <summary>
/// DependParentId