修改重复验证的问题
parent
0f03dbc75b
commit
ab6ec064fa
|
@ -11,6 +11,7 @@ using IRaCIS.Core.Application.ViewModel;
|
|||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using System.Threading.Tasks;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
|
||||
/// <summary>
|
||||
|
@ -58,17 +59,12 @@ public class TrialFinalRecordService(IRepository<TrialFinalRecord> _trialFinalRe
|
|||
if (inDto.SignFileRecord != null) inDto.SignFileRecord.TrialFileTypeId = inDto.TrialFileTypeId;
|
||||
if (inDto.HistoryFileRecord != null) inDto.HistoryFileRecord.TrialFileTypeId = inDto.TrialFileTypeId;
|
||||
|
||||
|
||||
|
||||
|
||||
var verifyExp = new EntityVerifyExp<TrialFinalRecord>()
|
||||
if (await _trialFinalRecordRepository.AnyAsync(x => x.Id != inDto.Id && x.TrialFileTypeId == inDto.TrialFileTypeId && x.Name == inDto.Name && x.Version == inDto.Version))
|
||||
{
|
||||
VerifyExp = u => u.Name == inDto.Name,
|
||||
throw new BusinessValidationFailedException(_localizer["TrialFinalRecord_NameRepeat"]);
|
||||
}
|
||||
|
||||
// "当前类型启用的文件类型名称重复"
|
||||
VerifyMsg = _localizer["TrialFileType_NameRepeat"],
|
||||
|
||||
};
|
||||
if (inDto.Id != null)
|
||||
{
|
||||
var trialFinalRecord = await _trialFinalRecordRepository.Where(x => x.Id == inDto.Id.Value).FirstNotNullAsync();
|
||||
|
|
Loading…
Reference in New Issue