中心调研返回空对象,方便前端渲染
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
4f91874b82
commit
d9eaa06de3
|
|
@ -753,26 +753,29 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
/// 直接查询相关所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}/{trialSiteSurveyId:guid}")]
|
||||
public async Task<LoginReturnDTO> GetSiteSurveyInfo(Guid trialSiteSurveyId, Guid trialId)
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<LoginReturnDTO> GetSiteSurveyInfo(Guid? trialSiteSurveyId, Guid trialId)
|
||||
{
|
||||
LoginReturnDTO result = new LoginReturnDTO();
|
||||
|
||||
//有可能填表人提交了,但是此时PM手动对人员信息进行了更改,此时需要将数据同步下(选择在这里同步是因为 不想改动 中心人员哪里的两个接口的逻辑)
|
||||
var find = await _trialSiteSurveyRepository.FirstOrDefaultAsync(t => t.Id == trialSiteSurveyId, true);
|
||||
|
||||
|
||||
if (find.State != TrialSiteSurveyEnum.PMCreatedAndLock && find.IsDeleted != true)
|
||||
if (trialSiteSurveyId != null)
|
||||
{
|
||||
var userList = await _trialSiteUserRoleRepository.Where(t => t.TrialId == find.TrialId && t.TrialSiteId == find.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
//有可能填表人提交了,但是此时PM手动对人员信息进行了更改,此时需要将数据同步下(选择在这里同步是因为 不想改动 中心人员哪里的两个接口的逻辑)
|
||||
var find = await _trialSiteSurveyRepository.FirstOrDefaultAsync(t => t.Id == trialSiteSurveyId, true);
|
||||
|
||||
|
||||
await UnlockSyncSiteUserAsync(find.TrialId, find.TrialSiteId, find.Id, userList);
|
||||
if (find.State != TrialSiteSurveyEnum.PMCreatedAndLock && find.IsDeleted != true)
|
||||
{
|
||||
var userList = await _trialSiteUserRoleRepository.Where(t => t.TrialId == find.TrialId && t.TrialSiteId == find.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
await UnlockSyncSiteUserAsync(find.TrialId, find.TrialSiteId, find.Id, userList);
|
||||
}
|
||||
|
||||
result = await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId && t.TrialId == trialId).IgnoreQueryFilters()
|
||||
.ProjectTo<LoginReturnDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).FirstOrDefaultAsync().IfNullThrowException();
|
||||
}
|
||||
|
||||
|
||||
var result = await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId && t.TrialId == trialId).IgnoreQueryFilters()
|
||||
.ProjectTo<LoginReturnDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).FirstOrDefaultAsync().IfNullThrowException();
|
||||
|
||||
var siteSurveryConfig = _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).IgnoreQueryFilters().Select(t => t.Trial.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty;
|
||||
|
||||
result.SiteSurveyFiledConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(siteSurveryConfig) ?? new TrialExtraConfig();
|
||||
|
|
|
|||
Loading…
Reference in New Issue