添加SiteId

Uat_Study
he 2023-01-09 10:54:05 +08:00
parent df0f50187e
commit 7dec6bbc1a
4 changed files with 24 additions and 1 deletions

View File

@ -23,6 +23,8 @@ namespace IRaCIS.Application.Contracts
public string CountryCN { get; set; } = String.Empty; public string CountryCN { get; set; } = String.Empty;
public string ProvinceCN { get; set; } = String.Empty; public string ProvinceCN { get; set; } = String.Empty;
public string CityCN { get; set; } = String.Empty; public string CityCN { get; set; } = String.Empty;
public Guid? SiteId { get; set; }
} }
public class HospitalQueryDTO : PageInput public class HospitalQueryDTO : PageInput

View File

@ -2,6 +2,7 @@
using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts;
using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infra.EFCore;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Infrastructure;
namespace IRaCIS.Application.Services namespace IRaCIS.Application.Services
{ {
@ -33,6 +34,11 @@ namespace IRaCIS.Application.Services
VerifyMsg = "已经存在同名的医院,请确认。" VerifyMsg = "已经存在同名的医院,请确认。"
}; };
if (await _hospitalRepository.AnyAsync(x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null))
{
throw new BusinessValidationFailedException("当前Site已经添加到其他Hospital了");
}
var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp); var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp);
return ResponseOutput.Ok(hospital.Id.ToString()); return ResponseOutput.Ok(hospital.Id.ToString());

View File

@ -26,6 +26,11 @@ namespace IRaCIS.Core.Domain.Models
public DateTime UpdateTime { get; set; } = DateTime.Now; public DateTime UpdateTime { get; set; } = DateTime.Now;
public Guid UpdateUserId { get; set; } = Guid.Empty; public Guid UpdateUserId { get; set; } = Guid.Empty;
/// <summary>
/// 中心Id
/// </summary>
public Guid? SiteId { get; set; } = Guid.Empty;
[JsonIgnore] [JsonIgnore]
public List<Doctor> DoctorList { get; set; } public List<Doctor> DoctorList { get; set; }

View File

@ -195,3 +195,13 @@ inner join ReadingMedicineQuestionAnswer on ReadingMedicineQuestionAnswer.TaskMe
update frontAuditConfig set DictionaryCode ='' where Code='AuditState' and DictionaryCode='AuditState' update frontAuditConfig set DictionaryCode ='' where Code='AuditState' and DictionaryCode='AuditState'
---- TrialCode ---- TrialCode
----------------------------2023-1-09
-- 修改Hospital 的SiteId
update Hospital set Hospital.SiteId=Site.Id from Site
inner join Hospital on Hospital.HospitalName=Site.SiteName