序号修改

This commit is contained in:
he
2024-09-11 16:37:30 +08:00
parent eccb5dc562
commit 6a1a56f0bc
3 changed files with 21 additions and 2 deletions
@@ -297,6 +297,24 @@ namespace IRaCIS.Core.Application.Contracts
}
if (addOrEditTrialQCQuestionConfigure.ParentId != null)
{
var parentShowOrder = await _trialQcQuestionRepository.Where(x => x.Id == addOrEditTrialQCQuestionConfigure.ParentId).Select(x => x.ShowOrder).FirstOrDefaultAsync();
if(parentShowOrder< addOrEditTrialQCQuestionConfigure.ShowOrder)
{
//---父问题的显示序号要比子问题的显示序号小,请确认。
throw new BusinessValidationFailedException(_localizer["TrialConfig_InvalidParentQuestionId"]);
}
}
var child = await _trialQcQuestionRepository.FirstOrDefaultAsync(x => x.ParentId == addOrEditTrialQCQuestionConfigure.Id);
if (child != null && child.ShowOrder > addOrEditTrialQCQuestionConfigure.ShowOrder)
{
//---父问题的显示序号要比子问题的显示序号小,请确认。
throw new BusinessValidationFailedException(_localizer["TrialConfig_InvalidParentQuestionId"]);
}
await VerifyIsQCConfirmedAsync(addOrEditTrialQCQuestionConfigure.TrialId);
var entity = await _trialQcQuestionRepository.InsertOrUpdateAsync(addOrEditTrialQCQuestionConfigure, true);