diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs index 9357f9f8c..7f6742ce3 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs @@ -75,6 +75,14 @@ namespace IRaCIS.Core.Application.ViewModel } + public class SetIsIgnoreUncommonlyInDto + { + public Guid Id { get; set; } + + public bool IsIgnoreUncommonly { get; set; } + } + + ///UserLogQuery 列表查询参数模型 public class UserLogQuery : PageInput { diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index e21617596..bc1aeca08 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -919,7 +919,17 @@ namespace IRaCIS.Core.Application.Service } - + /// + /// 设置是否忽略异地登录 + /// + /// + /// + [HttpPost] + public async Task SetIsIgnoreUncommonly(SetIsIgnoreUncommonlyInDto inDto) + { + await _userLogRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new UserLog() { IsIgnoreUncommonly = inDto.IsIgnoreUncommonly }, true); + return ResponseOutput.Ok(); + } @@ -1155,7 +1165,7 @@ namespace IRaCIS.Core.Application.Service var lastLoginIPRegion = await _userLogRepository.Where(t => t.ActionUserName == actionUserName && userOptTypes.Contains(t.OptType)) .OrderByDescending(t => t.CreateTime).Select(t => t.IPRegion).FirstOrDefaultAsync(); - if (lastLoginIPRegion != string.Empty) + if (lastLoginIPRegion != string.Empty&& lastLoginIPRegion!=null) { // 与上一次区域不一致 //if (SplitAndConcatenate(existUserLoginInfo.LastLoginIP) != SplitAndConcatenate(iPRegion)) diff --git a/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs b/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs index c7afc5d1f..accf313e2 100644 --- a/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs +++ b/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs @@ -82,6 +82,27 @@ namespace IRaCIS.Core.Application.Service return list; } + /// + /// 获取访视下拉 + /// + /// + /// + [HttpGet("{trialId:guid}")] + public async Task> GetTrialVisitSelect(Guid trialId) + { + var query = _subjectVisitRepository.Where(u => u.TrialId == trialId) + .GroupBy(x => new { x.VisitNum, x.VisitName,x.IsBaseLine }) + .Select(x => new VisitStageSelectDTO() { + + IsBaseLine = x.Key.IsBaseLine, + VisitName = x.Key.VisitName, + VisitNum = x.Key.VisitNum, + }) + .OrderBy(t => t.VisitNum); + var list = await query.ToListAsync(); + return list; + } + /// 添加或更新访视计划某项 [UnitOfWork]