修改一版
parent
a3f8245077
commit
c5fd28b809
|
@ -80,6 +80,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public bool IsCopyQuestion { get; set; }
|
||||
}
|
||||
|
||||
public class SetCriterionDictionaryInDto
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid CriterionId { get; set; }
|
||||
|
||||
public string ParentCode { get; set; }
|
||||
|
||||
public List<SetCriterionDictionaryDto> DictionaryList { get; set; }
|
||||
}
|
||||
public class SetAssessTypeInDto
|
||||
{
|
||||
|
||||
|
@ -88,7 +97,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public string ParentCode { get; set; }
|
||||
|
||||
public List<SetCriterionDictionaryDto> DictionaryList { get; set; }
|
||||
public List<Guid> DictionaryIds { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -462,6 +462,30 @@ namespace IRaCIS.Core.Application.Service.RC
|
|||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置标准字典
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SetCriterionDictionary(SetCriterionDictionaryInDto inDto)
|
||||
{
|
||||
await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == inDto.CriterionId && x.ParentCode == inDto.ParentCode);
|
||||
|
||||
await _readingCriterionDictionaryRepository.AddRangeAsync(inDto.DictionaryList.Select(x => new ReadingCriterionDictionary()
|
||||
{
|
||||
CriterionId = inDto.CriterionId,
|
||||
DictionaryId = x.DictionaryId,
|
||||
IsBaseLineUse = x.IsBaseLineUse,
|
||||
IsFollowVisitUse = x.IsFollowVisitUse,
|
||||
IsSystemCriterion = true,
|
||||
ParentCode = inDto.ParentCode
|
||||
}));
|
||||
|
||||
await _readingCriterionDictionaryRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置标准字典(系统用)
|
||||
|
@ -473,12 +497,10 @@ namespace IRaCIS.Core.Application.Service.RC
|
|||
{
|
||||
await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == inDto.CriterionId && x.ParentCode == inDto.ParentCode);
|
||||
|
||||
await _readingCriterionDictionaryRepository.AddRangeAsync(inDto.DictionaryList.Select(x => new ReadingCriterionDictionary()
|
||||
await _readingCriterionDictionaryRepository.AddRangeAsync(inDto.DictionaryIds.Select(x => new ReadingCriterionDictionary()
|
||||
{
|
||||
CriterionId = inDto.CriterionId,
|
||||
DictionaryId = x.DictionaryId,
|
||||
IsBaseLineUse=x.IsBaseLineUse,
|
||||
IsFollowVisitUse=x.IsFollowVisitUse,
|
||||
DictionaryId = x,
|
||||
IsSystemCriterion = true,
|
||||
ParentCode = inDto.ParentCode
|
||||
}));
|
||||
|
|
Loading…
Reference in New Issue