修复部分警告
parent
06a760eeff
commit
a678e0f8e1
|
@ -194,6 +194,7 @@
|
|||
<summary>
|
||||
一致性核查 excel上传 支持三种格式
|
||||
</summary>
|
||||
<param name="file"></param>
|
||||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
else
|
||||
{
|
||||
var systemNotice = await _systemNoticeRepository.Where(t => t.Id == addOrEditSystemNotice.Id, true, true).Include(t => t.NoticeUserTypeList).FirstOrDefaultAsync();
|
||||
var systemNotice = (await _systemNoticeRepository.Where(t => t.Id == addOrEditSystemNotice.Id, true, true).Include(t => t.NoticeUserTypeList).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
|
||||
if (addOrEditSystemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && systemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.NotPublish)
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
subjectVisit = _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == sujectVisitId).Result.IfNullThrowException();
|
||||
}
|
||||
|
||||
if (subjectVisit.CurrentActionUserId != _userInfo.Id)
|
||||
if (subjectVisit!.CurrentActionUserId != _userInfo.Id)
|
||||
{
|
||||
throw new BusinessValidationFailedException("您不是该质控任务当前领取人,没有操作权限!");
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public async Task<IResponseOutput<NoneDicomStudyAddReturnDto>> AddOrUpdateNoneDicomStudy(NoneDicomStudyAddOrEdit addOrEditNoneDicomStudy)
|
||||
{
|
||||
|
||||
NoneDicomStudy optEntity = null;
|
||||
NoneDicomStudy? optEntity = null;
|
||||
using (await _mutex.LockAsync())
|
||||
{
|
||||
if (addOrEditNoneDicomStudy.Id == Guid.Empty || addOrEditNoneDicomStudy.Id == null)
|
||||
|
|
|
@ -29,8 +29,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
if (isNeedVisitSearch)
|
||||
{
|
||||
var inPlanArray = VisitPlanArray.Where(t => !t.Contains('.')).Select(t => decimal.Parse(t)).ToArray();
|
||||
var isSelectOutPlan = VisitPlanArray.Any(t => t.Contains('.'));
|
||||
var inPlanArray = VisitPlanArray!.Where(t => !t.Contains('.')).Select(t => decimal.Parse(t)).ToArray();
|
||||
var isSelectOutPlan = VisitPlanArray!.Any(t => t.Contains('.'));
|
||||
|
||||
|
||||
if (inPlanArray.Length > 0)
|
||||
|
@ -60,8 +60,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
if (isNeedVisitSearch)
|
||||
{
|
||||
var inPlanArray = VisitPlanArray.Where(t => !t.Contains('.')).Select(t => decimal.Parse(t)).ToArray();
|
||||
var isSelectOutPlan = VisitPlanArray.Any(t => t.Contains('.'));
|
||||
var inPlanArray = VisitPlanArray!.Where(t => !t.Contains('.')).Select(t => decimal.Parse(t)).ToArray();
|
||||
var isSelectOutPlan = VisitPlanArray!.Any(t => t.Contains('.'));
|
||||
|
||||
|
||||
if (inPlanArray.Length > 0)
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
var selectItem = initList.FirstOrDefault(t => t.Id == trialQCQuestionFilterSelect.Id);
|
||||
|
||||
initList = initList.WhereIf(selectItem!=null, t => t.Id != selectItem.Id && t.ShowOrder < selectItem.ShowOrder).ToList();
|
||||
initList = initList.WhereIf(selectItem != null, t => t.Id != selectItem!.Id && t.ShowOrder < selectItem.ShowOrder).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var builder = new BodyBuilder();
|
||||
|
||||
var sysUserInfo = await _userRepository.Where(t => t.Id == userInfo.SystemUserId).FirstOrDefaultAsync();
|
||||
var sysUserInfo = (await _userRepository.Where(t => t.Id == userInfo.SystemUserId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
|
||||
builder.HtmlBody = @$"<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
|
||||
|
@ -338,7 +338,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var builder = new BodyBuilder();
|
||||
|
||||
|
||||
var sysUserInfo = await _userRepository.Where(t => t.Id == needUpdate.SystemUserId).Include(t => t.UserTypeRole).FirstOrDefaultAsync();
|
||||
var sysUserInfo = (await _userRepository.Where(t => t.Id == needUpdate.SystemUserId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
int verificationCode = new Random().Next(100000, 1000000);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
bool isadd = false;
|
||||
|
||||
Subject mapedSubject = null;
|
||||
Subject? mapedSubject = null;
|
||||
|
||||
if (subjectCommand.Id == null) //insert
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
svCommand.VisitExecuted = svCommand.IsLostVisit ? VisitExecutedEnum.Executed : svCommand.VisitExecuted;
|
||||
|
||||
|
||||
SubjectVisit dbBeforeEntity = null;
|
||||
SubjectVisit? dbBeforeEntity = null;
|
||||
//Add
|
||||
if (svCommand.Id == null)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
{
|
||||
//Site变更
|
||||
|
||||
if ( context.Entity.SiteId != context.UnmodifiedEntity.SiteId)
|
||||
if ( context.Entity.SiteId != context.UnmodifiedEntity?.SiteId)
|
||||
{
|
||||
var subjectId = context.Entity.Id;
|
||||
var siteId = context.Entity.SiteId;
|
||||
|
@ -59,7 +59,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
|
||||
|
||||
// 出组 状态发生了变更
|
||||
if (context.Entity.Status == SubjectStatus.OutOfVisit && context.Entity.Status != context.UnmodifiedEntity.Status)
|
||||
if (context.Entity.Status == SubjectStatus.OutOfVisit && context.Entity.Status != context.UnmodifiedEntity?.Status)
|
||||
{
|
||||
if (context.Entity.FinalSubjectVisitId != null)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
{
|
||||
|
||||
// 修改了IsFinalVisit
|
||||
if (context.UnmodifiedEntity.IsFinalVisit != subjectVisit.IsFinalVisit)
|
||||
if (context.UnmodifiedEntity?.IsFinalVisit != subjectVisit.IsFinalVisit)
|
||||
{
|
||||
if (context.Entity.IsFinalVisit)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
{
|
||||
|
||||
//项目访视计划确认 状态改变触发
|
||||
if (trial.VisitPlanConfirmed && trial.VisitPlanConfirmed != context.UnmodifiedEntity.VisitPlanConfirmed)
|
||||
if (trial.VisitPlanConfirmed && trial.VisitPlanConfirmed != context.UnmodifiedEntity?.VisitPlanConfirmed)
|
||||
{
|
||||
//找到访视计划修改的Item
|
||||
var changedList = await _visitStageRepository.Where(t => t.TrialId == trial.Id && t.IsConfirmed == false)
|
||||
|
|
|
@ -324,7 +324,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
{
|
||||
var query = ignoreQueryFilter ? _dbSet.AsNoTracking().IgnoreQueryFilters() : _dbSet.AsNoTracking();
|
||||
|
||||
var waitDelete = await query.Where(t=>t.Id== id).FirstOrDefaultAsync();
|
||||
var waitDelete = await query.Where(t => t.Id == id).FirstOrDefaultAsync();
|
||||
|
||||
if (waitDelete == null)
|
||||
{
|
||||
|
@ -572,11 +572,11 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
{
|
||||
foreach (var item in dto.Items)
|
||||
{
|
||||
item.Json = await GetInspectionEnumValue(item.Identification,item.Json);
|
||||
item.Json = await GetInspectionEnumValue(item.Identification, item.Json);
|
||||
item.Json = await SetEnum(dto.TrialId, item.Identification, item.Json);
|
||||
}
|
||||
|
||||
return dto.Items.Select(x=>x.Json).ToList();
|
||||
return dto.Items.Select(x => x.Json).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
@ -647,7 +647,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
public async Task<string> SetEnum(Guid trilaid, string identification, string json)
|
||||
{
|
||||
var list = await (from u in _dbContext.FrontAuditConfig.Where(x => x.Identification == identification)
|
||||
join p in _dbContext.FrontAuditConfig.Where(x => x.Code != "AuditState" && x.EnumType=="Date") on u.Id equals p.ParentId
|
||||
join p in _dbContext.FrontAuditConfig.Where(x => x.Code != "AuditState" && x.EnumType == "Date") on u.Id equals p.ParentId
|
||||
select new
|
||||
{
|
||||
Key = p.Code,
|
||||
|
@ -775,7 +775,8 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
private async Task AddInspectionAsync(TEntity entity, bool isSaveAudit = false)
|
||||
{
|
||||
bool needsave = true;
|
||||
DataInspection inspectionData = new DataInspection() {
|
||||
DataInspection inspectionData = new DataInspection()
|
||||
{
|
||||
Identification = $"{GetRequestUrl()}/{ typeof(TEntity).ToString().Substring(typeof(TEntity).ToString().LastIndexOf('.') + 1)}/Add",
|
||||
};
|
||||
|
||||
|
@ -1331,9 +1332,15 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
{
|
||||
query = query.IgnoreQueryFilters();
|
||||
}
|
||||
if (exp == null)
|
||||
|
||||
|
||||
if (exp != null)
|
||||
{
|
||||
query = query.Where(exp);
|
||||
}
|
||||
|
||||
return await query.FirstOrDefaultAsync().ConfigureAwait(false);
|
||||
return await query.FirstOrDefaultAsync(exp).ConfigureAwait(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in New Issue