代码移动

Uat_Study
hang 2022-10-18 13:38:28 +08:00
parent 2ccb4d69dd
commit 8b329e6006
2 changed files with 56 additions and 423 deletions

View File

@ -334,6 +334,62 @@ namespace IRaCIS.Core.Application.Service.RC
#endregion
#region 全局评估类型 肿瘤学评估类型
/// <summary>
/// 获取标准字典
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetAssessTypeOutDto>> GetAssessType(GetAssessTypeInDto inDto)
{
List<GetAssessTypeOutDto> result = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.CriterionId
&& x.ParentCode == inDto.ParentCode
)
.Select(x => new GetAssessTypeOutDto()
{
Id = x.Id,
DictionaryId = x.DictionaryId,
ChildGroup = x.Dictionary.ChildGroup,
Code = x.Dictionary.Code,
Description = x.Dictionary.Description,
ShowOrder = x.Dictionary.ShowOrder,
ParentCode = x.Dictionary.Parent.Code,
Value = x.Dictionary.Value,
ValueCN = x.Dictionary.ValueCN
}).OrderBy(x => x.ParentCode).ThenBy(x => x.ShowOrder).ToListAsync();
return result;
}
/// <summary>
/// 设置标准字典(系统用)
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> SetAssessType(SetAssessTypeInDto inDto)
{
await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == inDto.CriterionId && x.ParentCode == inDto.ParentCode);
await _readingCriterionDictionaryRepository.AddRangeAsync(inDto.DictionaryIds.Select(x => new ReadingCriterionDictionary()
{
CriterionId = inDto.CriterionId,
DictionaryId = x,
IsSystemCriterion = true,
ParentCode = inDto.ParentCode
}));
await _readingCriterionDictionaryRepository.SaveChangesAsync();
return ResponseOutput.Ok(true);
}
#endregion
/// <summary>
/// 添加系统数据到项目里面
/// </summary>

View File

@ -73,60 +73,6 @@ namespace IRaCIS.Application.Services
this._previousPDFRepository = previousPDFRepository;
}
#region 全局评估类型 肿瘤学评估类型
/// <summary>
/// 获取标准字典
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetAssessTypeOutDto>> GetAssessType(GetAssessTypeInDto inDto)
{
List<GetAssessTypeOutDto> result = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.CriterionId
&&x.ParentCode==inDto.ParentCode
)
.Select(x => new GetAssessTypeOutDto()
{
Id = x.Id,
DictionaryId = x.DictionaryId,
ChildGroup = x.Dictionary.ChildGroup,
Code = x.Dictionary.Code,
Description = x.Dictionary.Description,
ShowOrder = x.Dictionary.ShowOrder,
ParentCode = x.Dictionary.Parent.Code,
Value = x.Dictionary.Value,
ValueCN = x.Dictionary.ValueCN
}).OrderBy(x => x.ParentCode).ThenBy(x => x.ShowOrder).ToListAsync();
return result;
}
/// <summary>
/// 设置标准字典(系统用)
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> SetAssessType(SetAssessTypeInDto inDto)
{
await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == inDto.CriterionId && x.ParentCode == inDto.ParentCode);
await _readingCriterionDictionaryRepository.AddRangeAsync(inDto.DictionaryIds.Select(x => new ReadingCriterionDictionary()
{
CriterionId = inDto.CriterionId,
DictionaryId = x,
IsSystemCriterion = true,
ParentCode = inDto.ParentCode
}));
await _readingCriterionDictionaryRepository.SaveChangesAsync();
return ResponseOutput.Ok(true);
}
#endregion
@ -1189,374 +1135,5 @@ namespace IRaCIS.Application.Services
#endregion
#region 移动到其他服务 废弃
//#region 项目阅片标准问题分页
///// <summary>
///// 新增修改项目标准分页
///// </summary>
///// <param name="addOrEditReadingCriterionPage"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<IResponseOutput> AddOrUpdateReadingCriterionPage(ReadingCriterionPageAddOrEdit addOrEditReadingCriterionPage)
//{
// var entity = await _readingCriterionPageRepository.InsertOrUpdateAsync(addOrEditReadingCriterionPage, true);
// return ResponseOutput.Ok(entity.Id.ToString());
//}
///// <summary>
///// 删除标准分页
///// </summary>
///// <param name="Id"></param>
///// <returns></returns>
//[HttpDelete("{Id:guid}")]
//public async Task<IResponseOutput> DeleteReadingCriterionPage(Guid Id)
//{
// var success = await _readingCriterionPageRepository.DeleteFromQueryAsync(t => t.Id == Id, true);
// return ResponseOutput.Ok();
//}
//#endregion
//#region 疗效对照表
///// <summary>
///// 获取疗效对照
///// </summary>
///// <returns></returns>
//[HttpPost]
//public async Task<List<TumorAssessmentView>> GetTumorAssessmentList(GetTumorAssessmentListInDto inDto)
//{
// var result = await _tumorAssessmentRepository
// .Where(x => x.CriterionId == inDto.CriterionId)
// .WhereIf(inDto.OverallEfficacy != null, x => x.OverallEfficacy == inDto.OverallEfficacy)
// .WhereIf(inDto.TargetLesion != null, x => x.TargetLesion == inDto.TargetLesion)
// .WhereIf(inDto.NonTargetLesions != null, x => x.NonTargetLesions == inDto.NonTargetLesions)
// .WhereIf(inDto.NewLesion != null, x => x.NewLesion == inDto.NewLesion)
// .ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider).ToListAsync();
// return result;
//}
///// <summary>
///// 获取疗效对照
///// </summary>
///// <returns></returns>
//[HttpPost]
//public async Task<PageOutput<TumorAssessmentView>> GetTumorAssessmentPageList(GetTumorAssessmentListInDto inQuery)
//{
// var query = _tumorAssessmentRepository
// .Where(x => x.CriterionId == inQuery.CriterionId)
// .WhereIf(inQuery.OverallEfficacy != null, x => x.OverallEfficacy == inQuery.OverallEfficacy)
// .WhereIf(inQuery.TargetLesion != null, x => x.TargetLesion == inQuery.TargetLesion)
// .WhereIf(inQuery.NonTargetLesions != null, x => x.NonTargetLesions == inQuery.NonTargetLesions)
// .WhereIf(inQuery.NewLesion != null, x => x.NewLesion == inQuery.NewLesion)
// .ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider);
// return await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
//}
///// <summary>
///// 新增修改疗效对照
///// </summary>
///// <param name="indto"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<IResponseOutput> AddOrUpdateTumorAssessment(AddOrUpdateTumorAssessmentInDto indto)
//{
// var entity = await _tumorAssessmentRepository.InsertOrUpdateAsync(indto, true);
// return ResponseOutput.Ok(entity.Id.ToString());
//}
///// <summary>
///// 删除疗效对照
///// </summary>
///// <param name="Id"></param>
///// <returns></returns>
//[HttpDelete("{Id:guid}")]
//public async Task<IResponseOutput> DeleteTumorAssessment(Guid Id)
//{
// await _tumorAssessmentRepository.DeleteFromQueryAsync(t => t.Id == Id);
// var success = await _tumorAssessmentRepository.SaveChangesAsync();
// return ResponseOutput.Result(success);
//}
//#endregion
//#region 系统标准
///// <summary>
///// 获取获取系统阅片标准下拉
///// </summary>
///// <returns></returns>
//[HttpPost]
//public async Task<List<GetSystemCriterionListOutDto>> GetSystemCriterionList()
//{
// List<GetSystemCriterionListOutDto> result = await _readingQuestionCriterionSystemRepository.Select(x => new GetSystemCriterionListOutDto()
// {
// CriterionId = x.Id,
// CriterionName = x.CriterionName,
// }).ToListAsync();
// return result;
//}
///// <summary>
///// 获取系统问题标准
///// </summary>
///// <returns></returns>
//[HttpPost]
//public async Task<PageOutput<ReadingQuestionCriterionSystemView>> GetReadingQuestionCriterionSystemList(ReadingQuestionCriterionSystemViewInDto inDto)
//{
// //await AddSystemQuestionCriterion();
// var query = _readingQuestionCriterionSystemRepository.AsQueryable()
// .WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName))
// .ProjectTo<ReadingQuestionCriterionSystemView>(_mapper.ConfigurationProvider);
// return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField.IsNullOrEmpty() ? nameof(ReadingQuestionCriterionSystemView.ShowOrder) : inDto.SortField,
// inDto.Asc);
//}
///// <summary>
///// 获取系统问题标准下拉
///// </summary>
///// <returns></returns>
//[HttpPost]
//public async Task<List<GetSystemCriterionSelectDto>> GetSystemCriterionSelectList()
//{
// var criterionList = await _readingQuestionCriterionSystemRepository.AsQueryable()
// .OrderBy(x => x.ShowOrder)
// .Select(x => new GetSystemCriterionSelectDto()
// {
// Id = x.Id,
// CriterionName = x.CriterionName,
// }).ToListAsync();
// return criterionList;
//}
///// <summary>
///// 新增修改系统问题标准
///// </summary>
///// <param name="indto"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<IResponseOutput> AddOrUpdateReadingQuestionCriterionSystem(AddOrUpdateReadingQuestionCriterionSystemInDto indto)
//{
// var entity = await _readingQuestionCriterionSystemRepository.InsertOrUpdateAsync(indto, true);
// if (indto.Id != null)
// {
// await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == indto.Id, x => new ReadingQuestionCriterionTrial()
// {
// CriterionName = indto.CriterionName,
// CriterionType = indto.CriterionType,
// });
// }
// return ResponseOutput.Ok(entity.Id.ToString());
//}
///// <summary>
///// 删除系统问题标准
///// </summary>
///// <param name="id"></param>
///// <returns></returns>
//[HttpDelete("{id:guid}")]
//public async Task<IResponseOutput> DeleteReadingQuestionCriterionSystem(Guid id)
//{
// if (await _readingQuestionCriterionTrialRepository.AnyAsync(x => x.IsConfirm && x.ReadingQuestionCriterionSystemId == id))
// {
// throw new BusinessValidationFailedException("当前标准被引用过了,不可以删除");
// }
// await _readingQuestionCriterionSystemRepository.DeleteFromQueryAsync(t => t.Id == id);
// var success = await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
// return ResponseOutput.Result(success);
//}
///// <summary>
///// 设置系统问题标准是否完成配置
///// </summary>
///// <param name="inDto"></param>
///// <returns></returns>
//public async Task<IResponseOutput> SetSystemReadingQuestionCriterionIsCompleteConfig(SetSystemReadingQuestionCriterionIsIsCompleteConfig inDto)
//{
// if (!inDto.IsCompleteConfig)
// {
// var trialCriterionIds = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.Id).Select(x => x.Id).ToListAsync();
// if (await _readingTaskQuestionAnswer.AnyAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId)))
// {
// return ResponseOutput.NotOk("此标准在项目里面已被使用,操作失败");
// }
// }
// var systemCriterion = await _readingQuestionCriterionSystemRepository.Where(x => x.Id == inDto.Id).AsNoTracking().FirstOrDefaultAsync();
// var confirmTime = systemCriterion.ConfirmTime;
// if (inDto.IsCompleteConfig)
// {
// confirmTime = DateTime.Now;
// }
// await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new ReadingQuestionCriterionSystem()
// {
// IsCompleteConfig = inDto.IsCompleteConfig,
// ConfirmTime = confirmTime,
// });
// if (inDto.IsCompleteConfig)
// {
// //await SynchronizeSystemCriterion(inDto.Id);
// }
// else
// {
// await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == inDto.Id, x => new ReadingQuestionCriterionTrial()
// {
// IsCompleteConfig = inDto.IsCompleteConfig
// });
// }
// var result = await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
// return ResponseOutput.Ok(result);
//}
//#endregion
//#region 项目标准
///// <summary>
///// 获取项目裁判信息
///// </summary>
///// <param name="inDto"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<GetTrialJudgyInfoOutDto> GetTrialJudgyInfo(GetTrialJudgyInfoInDto inDto)
//{
// GetTrialJudgyInfoOutDto result = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => new GetTrialJudgyInfoOutDto
// {
// TrialId = x.TrialId,
// IsReadingTaskViewInOrder = x.IsReadingTaskViewInOrder,
// ArbitrationRule = x.ArbitrationRule,
// IsArbitrationReading = x.IsArbitrationReading
// }).FirstNotNullAsync();
// return result;
//}
///// <summary>
///// 新增修改项目问题标准(项目)
///// </summary>
///// <param name="indto"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<IResponseOutput> AddOrUpdateReadingQuestionCriterionTrial(AddOrUpdateReadingQuestionCriterionTrialInDto indto)
//{
// var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
// return ResponseOutput.Ok(entity.Id.ToString());
//}
///// <summary>
///// 设置项目标准是否完成配置
///// </summary>
///// <param name="inDto"></param>
///// <returns></returns>
//public async Task<IResponseOutput> SetTrialReadingQuestionCriterionIsIsCompleteConfig(SetSystemReadingQuestionCriterionIsIsCompleteConfig inDto)
//{
// await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new ReadingQuestionCriterionTrial()
// {
// IsCompleteConfig = inDto.IsCompleteConfig
// });
// var result = await _readingQuestionCriterionTrialRepository.SaveChangesAsync();
// return ResponseOutput.Ok(result);
//}
///// <summary>
///// 获取项目问题标准(项目)
///// </summary>
///// <returns></returns>
//[HttpPost]
//public async Task<PageOutput<ReadingQuestionCriterionTrialView>> GetReadingQuestionCriterionTrialList(ReadingQuestionCriterionTrialViewInDto inDto)
//{
// await AddSystemDataToTrila(inDto.TrialId);
// var query = _readingQuestionCriterionTrialRepository.AsQueryable()
// .Where(x => x.TrialId == inDto.TrialId)
// .Where(x => (x.ReadingQuestionCriterionSystemId != null && x.IsEnable) || x.ReadingQuestionCriterionSystemId == null)
// .WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName))
// .ProjectTo<ReadingQuestionCriterionTrialView>(_mapper.ConfigurationProvider);
// return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField.IsNullOrEmpty() ? nameof(ReadingQuestionCriterionTrialView.ShowOrder) : inDto.SortField,
// inDto.Asc);
//}
///// <summary>
///// 删除项目问题标准(项目)
///// </summary>
///// <param name="id"></param>
///// <returns></returns>
//[HttpDelete("{id:guid}")]
//public async Task<IResponseOutput> DeleteReadingQuestionCriterionTrial(Guid id)
//{
// await _readingQuestionCriterionTrialRepository.DeleteFromQueryAsync(t => t.Id == id);
// var success = await _readingQuestionCriterionTrialRepository.SaveChangesAsync();
// return ResponseOutput.Result(success);
//}
///// <summary>
///// 设置项目裁判信息
///// </summary>
///// <param name="inDto"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<IResponseOutput> SetTrialJudgyInfo(SetTrialJudgyInfoInDto inDto)
//{
// var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.Id == inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
// var judgeCount = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id && x.IsJudgeQuestion)
// .WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null)
// .WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null).CountAsync();
// if (judgeCount == 0 && (inDto.ArbitrationRule == ArbitrationRule.Visit || inDto.ArbitrationRule == ArbitrationRule.Reading))
// {
// throw new BusinessValidationFailedException("无裁判问题却有仲裁对象,操作失败");
// }
// await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
// {
// ArbitrationRule = inDto.ArbitrationRule,
// //IsArbitrationReading = inDto.IsArbitrationReading,
// });
// var result = await _trialRepository.SaveChangesAsync();
// return ResponseOutput.Ok(result);
//}
//#endregion
#endregion
}
}