验证是否有重复的概况
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)
|
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType!= SaveSummarizeInfo.SaveSelf)
|
||||||
{
|
{
|
||||||
switch (inDto.SaveSummarizeInfoType)
|
switch (inDto.SaveSummarizeInfoType)
|
||||||
|
@ -278,19 +285,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
case SaveSummarizeInfo.SaveAndAdd:
|
case SaveSummarizeInfo.SaveAndAdd:
|
||||||
|
|
||||||
await _doctorSummarizeRepository.BatchDeleteNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId);
|
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));
|
var needData = inDto.Clone();
|
||||||
if (exists)
|
needData.TrialId = null;
|
||||||
{
|
await _doctorSummarizeRepository.InsertOrUpdateAsync(needData, true);
|
||||||
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var needData = inDto.Clone();
|
|
||||||
needData.TrialId = null;
|
|
||||||
await _doctorSummarizeRepository.InsertOrUpdateAsync(needData, true);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue