修改hospital

This commit is contained in:
2023-06-28 11:59:23 +08:00
parent c63251b832
commit 4c4905e60b
2 changed files with 18 additions and 5 deletions
@@ -35,12 +35,14 @@ namespace IRaCIS.Application.Services
VerifyMsg = _localizer["Hospital_DupName"]
};
if (await _hospitalRepository.AnyAsync(x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null))
var exp1 = new EntityVerifyExp<Hospital>()
{
//---当前Site已经添加到其他Hospital了
throw new BusinessValidationFailedException(_localizer["Hospital_SiteAdded"]);
}
VerifyExp = x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null,
//---已经存在同名的医院,请确认。
VerifyMsg = _localizer["Hospital_SiteAdded"]
};
var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp);
return ResponseOutput.Ok(hospital.Id.ToString());