修改
This commit is contained in:
@@ -354,11 +354,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准ID
|
||||
/// </summary>
|
||||
public Guid CriterionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准
|
||||
/// </summary>
|
||||
@@ -368,6 +363,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int ShowOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完成配置
|
||||
/// </summary>
|
||||
public bool IsCompleteConfig { get; set; } = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1099,6 +1104,18 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
public string OrderMark { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class GetSystemCriterionSelectDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的对象
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准
|
||||
/// </summary>
|
||||
public string CriterionName { get; set; }
|
||||
}
|
||||
|
||||
public class ReadingQuestionCriterionSystemView
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface IReadingQuestionService
|
||||
{
|
||||
Task<IResponseOutput> SetSystemCriterionDisable(Guid dictionaryId, Guid? parentId);
|
||||
//Task<IResponseOutput> SetSystemCriterionDisable(Guid dictionaryId, Guid? parentId);
|
||||
|
||||
Task SynchronizeCriterion(SynchronizeCriterionInDto inDto);
|
||||
|
||||
|
||||
@@ -675,7 +675,7 @@ namespace IRaCIS.Application.Services
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<ReadingQuestionCriterionSystemView>> GetReadingQuestionCriterionSystemList(ReadingQuestionCriterionSystemViewInDto inDto)
|
||||
{
|
||||
await AddSystemQuestionCriterion();
|
||||
//await AddSystemQuestionCriterion();
|
||||
var query= _readingQuestionCriterionSystemRepository.AsQueryable()
|
||||
.WhereIf(!inDto.CriterionName.IsNullOrEmpty(), x => x.CriterionName.Contains(inDto.CriterionName))
|
||||
.ProjectTo<ReadingQuestionCriterionSystemView>(_mapper.ConfigurationProvider)
|
||||
@@ -686,30 +686,48 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置系统标准被禁用
|
||||
/// 获取系统问题标准下拉
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonDynamicMethod]
|
||||
public async Task<IResponseOutput> SetSystemCriterionDisable(Guid dictionaryId, Guid? parentId)
|
||||
[HttpPost]
|
||||
public async Task<List<GetSystemCriterionSelectDto>> GetSystemCriterionSelectList()
|
||||
{
|
||||
// 判断是否是阅片
|
||||
if (await _dictionaryRepository.AnyAsync(x => x.Id == parentId && x.Code == "ReadingStandard"))
|
||||
{
|
||||
// 判断当前阅片是否在项目里面存在
|
||||
var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x => x.CriterionId == dictionaryId);
|
||||
if (systemCriterion != null)
|
||||
{
|
||||
var trialCriterionIds = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterion.Id).Select(x=>x.ReadingQuestionCriterionSystemId).ToListAsync();
|
||||
await _readingQuestionCriterionTrialRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == systemCriterion.Id);
|
||||
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId));
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
var criterionList = await _readingQuestionCriterionSystemRepository.AsQueryable()
|
||||
.Select(x => new GetSystemCriterionSelectDto()
|
||||
{
|
||||
Id = x.Id,
|
||||
CriterionName = x.CriterionName
|
||||
}).ToListAsync();
|
||||
return criterionList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 设置系统标准被禁用
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[NonDynamicMethod]
|
||||
//public async Task<IResponseOutput> SetSystemCriterionDisable(Guid dictionaryId, Guid? parentId)
|
||||
//{
|
||||
// // 判断是否是阅片
|
||||
// if (await _dictionaryRepository.AnyAsync(x => x.Id == parentId && x.Code == "ReadingStandard"))
|
||||
// {
|
||||
// // 判断当前阅片是否在项目里面存在
|
||||
// var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x => x.CriterionId == dictionaryId);
|
||||
// if (systemCriterion != null)
|
||||
// {
|
||||
// var trialCriterionIds = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterion.Id).Select(x=>x.ReadingQuestionCriterionSystemId).ToListAsync();
|
||||
// await _readingQuestionCriterionTrialRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == systemCriterion.Id);
|
||||
// await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId));
|
||||
// return ResponseOutput.Ok();
|
||||
// }
|
||||
// }
|
||||
|
||||
// return ResponseOutput.Ok();
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置系统问题标准是否完成配置
|
||||
/// </summary>
|
||||
@@ -897,37 +915,58 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加系统问题标准
|
||||
/// 新增修改系统问题标准
|
||||
/// </summary>
|
||||
/// <param name="indto"></param>
|
||||
/// <returns></returns>
|
||||
[NonDynamicMethod]
|
||||
private async Task AddSystemQuestionCriterion()
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingQuestionCriterionSystem(AddOrUpdateReadingQuestionCriterionSystemInDto indto)
|
||||
{
|
||||
var useSystemQuestionCriterionIds = _readingQuestionCriterionSystemRepository.Select(x => x.CriterionId);
|
||||
var dictionaryParentId =await _dictionaryRepository.Where(x => x.Code == "ReadingStandard").Select(x => x.Id).FirstOrDefaultAsync();
|
||||
var criterionList = await _dictionaryRepository.Where(x => x.ParentId == dictionaryParentId && !useSystemQuestionCriterionIds.Contains(x.Id))
|
||||
.Select(x => new CriterionList()
|
||||
{
|
||||
Id = x.Id,
|
||||
Value = x.Value,
|
||||
ShowOrder=x.ShowOrder,
|
||||
}).ToListAsync();
|
||||
List<ReadingQuestionCriterionSystem> needAddCriterionList = new List<ReadingQuestionCriterionSystem>();
|
||||
criterionList.ForEach(x =>
|
||||
var entity = await _readingQuestionCriterionSystemRepository.InsertOrUpdateAsync(indto, true);
|
||||
|
||||
if (indto.Id != null)
|
||||
{
|
||||
needAddCriterionList.Add(new ReadingQuestionCriterionSystem()
|
||||
{
|
||||
CriterionId = x.Id,
|
||||
ShowOrder=x.ShowOrder,
|
||||
CriterionName = x.Value,
|
||||
IsEnable = false,
|
||||
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == indto.Id, x => new ReadingQuestionCriterionTrial() {
|
||||
CriterionName=indto.CriterionName
|
||||
|
||||
});
|
||||
});
|
||||
await _readingQuestionCriterionSystemRepository.AddRangeAsync(needAddCriterionList);
|
||||
await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
|
||||
}
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 添加系统问题标准
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[NonDynamicMethod]
|
||||
//private async Task AddSystemQuestionCriterion()
|
||||
//{
|
||||
// var useSystemQuestionCriterionIds = _readingQuestionCriterionSystemRepository.Select(x => x.CriterionId);
|
||||
// var dictionaryParentId =await _dictionaryRepository.Where(x => x.Code == "ReadingStandard").Select(x => x.Id).FirstOrDefaultAsync();
|
||||
// var criterionList = await _dictionaryRepository.Where(x => x.ParentId == dictionaryParentId && !useSystemQuestionCriterionIds.Contains(x.Id))
|
||||
// .Select(x => new CriterionList()
|
||||
// {
|
||||
// Id = x.Id,
|
||||
// Value = x.Value,
|
||||
// ShowOrder=x.ShowOrder,
|
||||
// }).ToListAsync();
|
||||
// List<ReadingQuestionCriterionSystem> needAddCriterionList = new List<ReadingQuestionCriterionSystem>();
|
||||
// criterionList.ForEach(x =>
|
||||
// {
|
||||
// needAddCriterionList.Add(new ReadingQuestionCriterionSystem()
|
||||
// {
|
||||
// CriterionId = x.Id,
|
||||
// ShowOrder=x.ShowOrder,
|
||||
// CriterionName = x.Value,
|
||||
// IsEnable = false,
|
||||
// });
|
||||
// });
|
||||
// await _readingQuestionCriterionSystemRepository.AddRangeAsync(needAddCriterionList);
|
||||
// await _readingQuestionCriterionSystemRepository.SaveChangesAsync();
|
||||
//}
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 删除系统问题标准
|
||||
|
||||
Reference in New Issue
Block a user