验证是否有重复的概况
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
004f73b24d
commit
393bce5f5c
|
@ -262,6 +262,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
}
|
||||
|
||||
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"]);
|
||||
}
|
||||
|
||||
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType!= SaveSummarizeInfo.SaveSelf)
|
||||
{
|
||||
switch (inDto.SaveSummarizeInfoType)
|
||||
|
@ -278,19 +285,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
case SaveSummarizeInfo.SaveAndAdd:
|
||||
|
||||
await _doctorSummarizeRepository.BatchDeleteNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
var needData = inDto.Clone();
|
||||
needData.TrialId = null;
|
||||
await _doctorSummarizeRepository.InsertOrUpdateAsync(needData, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue