代码修改
continuous-integration/drone/push Build is passing Details

IRC_NewDev
he 2024-12-02 15:01:17 +08:00
parent 2ce0306311
commit 2f77c0ecef
2 changed files with 52 additions and 0 deletions

View File

@ -415,6 +415,27 @@ namespace IRaCIS.Application.Contracts
/// 项目Id
/// </summary>
public Guid? TrialId { get; set; }
public SaveSummarizeInfo SaveSummarizeInfoType { get; set; } = SaveSummarizeInfo.SaveSelf;
}
public enum SaveSummarizeInfo
{
/// <summary>
/// 保存自己
/// </summary>
SaveSelf = 0,
/// <summary>
/// 保存并覆盖
/// </summary>
SaveAndCover = 1,
/// <summary>
/// 保存并新增
/// </summary>
SaveAndAdd = 2,
}
public class UpdateGneralSituationDto

View File

@ -262,6 +262,37 @@ namespace IRaCIS.Core.Application.Service
}
}
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType!= SaveSummarizeInfo.SaveSelf)
{
switch (inDto.SaveSummarizeInfoType)
{
case SaveSummarizeInfo.SaveAndCover:
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x =>
x.DoctorId == inDto.DoctorId && x.TrialId == null &&
x.IndicationEn == inDto.IndicationEn && x.Indication == inDto.Indication, x => new DoctorSummarize()
{
Summarize = inDto.Summarize,
SummarizeEn = inDto.SummarizeEn
});
break;
case SaveSummarizeInfo.SaveAndAdd:
var exists = await _doctorSummarizeRepository.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null &&
(x.IndicationEn == inDto.IndicationEn || x.Indication == inDto.Indication));
if (exists)
{
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
}
else
{
var needData = inDto.Clone();
needData.TrialId = null;
await _doctorSummarizeRepository.InsertOrUpdateAsync(needData, true);
}
break;
}
}
if (inDto.TrialId == null && inDto.IsMain)
{