修改site 代码
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
443b94b332
commit
824b165723
|
@ -29,6 +29,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
public string DirectorPhone { get; set; } = string.Empty;
|
public string DirectorPhone { get; set; } = string.Empty;
|
||||||
public string ContactName { get; set; } = string.Empty;
|
public string ContactName { get; set; } = string.Empty;
|
||||||
public string ContactPhone { get; set; } = string.Empty;
|
public string ContactPhone { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public Guid? TrialSiteId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SiteSelectionDTO
|
public class SiteSelectionDTO
|
||||||
|
@ -44,6 +46,17 @@ namespace IRaCIS.Application.Contracts
|
||||||
public string Country { get; set; } = String.Empty;
|
public string Country { get; set; } = String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TrialSiteAddView
|
||||||
|
{
|
||||||
|
public Guid TrialSiteId { get; set; }
|
||||||
|
public string TrialCode { get; set; }
|
||||||
|
|
||||||
|
public string TrialSiteName { get; set; }
|
||||||
|
|
||||||
|
public string TrialSiteAliasName { get; set; } = String.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
public class SiteSelectDTO : SiteDTO
|
public class SiteSelectDTO : SiteDTO
|
||||||
{
|
{
|
||||||
public string HospitalName { get; set; } = String.Empty;
|
public string HospitalName { get; set; } = String.Empty;
|
||||||
|
|
|
@ -5,6 +5,8 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
using System.Security.Policy;
|
||||||
|
using Site = IRaCIS.Core.Domain.Models.Site;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
@ -21,7 +23,7 @@ namespace IRaCIS.Application.Services
|
||||||
_siteRepository = siteRepository;
|
_siteRepository = siteRepository;
|
||||||
_trialSiteUserRepository = trialSiteUserRepository;
|
_trialSiteUserRepository = trialSiteUserRepository;
|
||||||
_distributedLockProvider = distributedLockProvider;
|
_distributedLockProvider = distributedLockProvider;
|
||||||
_hospitalRepository= hospitalRepository;
|
_hospitalRepository = hospitalRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> 分页获取研究中心列表 </summary>
|
/// <summary> 分页获取研究中心列表 </summary>
|
||||||
|
@ -35,7 +37,7 @@ namespace IRaCIS.Application.Services
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
|
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
|
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Province.Contains(searchModel.Province))
|
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Province.Contains(searchModel.Province))
|
||||||
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||||
|
|
||||||
|
|
||||||
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
|
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
|
||||||
|
@ -49,6 +51,17 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<List<TrialSiteAddView>> GetTrialSiteList()
|
||||||
|
{
|
||||||
|
return _repository.Where<TrialSite>(t => t.SiteId == null).Select(t => new TrialSiteAddView()
|
||||||
|
{
|
||||||
|
TrialCode = t.Trial.TrialCode,
|
||||||
|
TrialSiteAliasName = t.TrialSiteAliasName,
|
||||||
|
TrialSiteId = t.Id,
|
||||||
|
TrialSiteName = t.TrialSiteName
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary> 添加研究中心 </summary>
|
/// <summary> 添加研究中心 </summary>
|
||||||
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateSite(SiteCommand siteCommand)
|
public async Task<IResponseOutput> AddOrUpdateSite(SiteCommand siteCommand)
|
||||||
|
@ -56,7 +69,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
var exp = new EntityVerifyExp<Site>()
|
var exp = new EntityVerifyExp<Site>()
|
||||||
{
|
{
|
||||||
VerifyExp = h => h.SiteName.Equals(siteCommand.SiteName) || h.SiteCode.Equals(siteCommand.SiteCode),
|
VerifyExp = h => h.SiteName.Equals(siteCommand.SiteName) || h.SiteNameCN.Equals(siteCommand.SiteNameCN),
|
||||||
//---已经存在同名的中心,请确认。
|
//---已经存在同名的中心,请确认。
|
||||||
VerifyMsg = _localizer["Site_DupName"]
|
VerifyMsg = _localizer["Site_DupName"]
|
||||||
};
|
};
|
||||||
|
@ -82,15 +95,22 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
//手动绑
|
//手动绑
|
||||||
if(siteCommand.HospitalId != null)
|
if (siteCommand.HospitalId != null)
|
||||||
{
|
{
|
||||||
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == siteCommand.HospitalId, u => new Hospital() { SiteId = site.Id });
|
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == siteCommand.HospitalId, u => new Hospital() { SiteId = site.Id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (siteCommand.TrialSiteId != null)
|
||||||
|
{
|
||||||
|
await _repository.BatchUpdateAsync<TrialSite>(t => t.Id == siteCommand.TrialSiteId, u => new TrialSite() { SiteId = site.Id });
|
||||||
|
}
|
||||||
|
|
||||||
return ResponseOutput.Ok(site.Id.ToString());
|
return ResponseOutput.Ok(site.Id.ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> 删除研究中心 </summary>
|
/// <summary> 删除研究中心 </summary>
|
||||||
|
|
|
@ -19,7 +19,6 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
||||||
|
|
||||||
public string UserKeyInfo { get; set; } = String.Empty;
|
public string UserKeyInfo { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SiteCRCExportQueryDTO
|
public class SiteCRCExportQueryDTO
|
||||||
|
|
Loading…
Reference in New Issue