代码修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
2ce0306311
commit
2f77c0ecef
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue