From 91671c5003ff1cec80550331bcd2d064585b8258 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 30 Nov 2023 17:58:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AD=A6=E5=91=8A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Helper/FileStoreHelper.cs | 2 +- .../Service/Allocation/VisitTaskService.cs | 2 +- .../Service/Common/MailService.cs | 5 ----- .../Service/ImageAndDoc/StudyService.cs | 4 ++-- .../Service/Inspection/FrontAuditConfigService.cs | 12 ++++++------ .../Service/Management/UserService.cs | 4 ++-- .../_IRaCIS/NUllCheckExtension.cs | 6 +++--- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs index 6e0197ecc..cb8d71b66 100644 --- a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs @@ -685,7 +685,7 @@ public static class FileStoreHelper var json = File.ReadAllText( Path.Combine(_hostEnvironment.ContentRootPath, "appsettings.json")); - JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load }); + JObject jsonObject = (JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load })).IfNullThrowException(); int switchingRatio = 80; diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index e7654f3c9..bdc855c77 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -642,7 +642,6 @@ namespace IRaCIS.Core.Application.Service.Allocation /// 获取有序阅片IQuery对象 /// /// - /// public async Task<(int, List)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto) { @@ -967,6 +966,7 @@ namespace IRaCIS.Core.Application.Service.Allocation /// /// /// + /// private void ReReadingTaskTrackingDeal(VisitTask origenalTask, ConfirmReReadingCommand agreeReReadingCommand) { if (origenalTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || origenalTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed) diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index d821708b6..e41a99c63 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -42,12 +42,10 @@ namespace IRaCIS.Application.Services private readonly IRepository _systemBasicDatarepository; - private readonly IWebHostEnvironment _hostEnvironment; private readonly IRepository _userRepository; private readonly ITokenService _tokenService; - private readonly IMapper _mapper; private readonly IRepository _trialRepository; private readonly IRepository _userTypeRepository; @@ -61,7 +59,6 @@ namespace IRaCIS.Application.Services public MailVerificationService(IRepository verificationCodeRepository, IRepository systemBasicDatarepository, - IWebHostEnvironment hostEnvironment, IRepository userRepository, ITokenService tokenService, IRepository trialRepository, @@ -72,9 +69,7 @@ namespace IRaCIS.Application.Services _verificationCodeRepository = verificationCodeRepository; _systemBasicDatarepository = systemBasicDatarepository; - _hostEnvironment = hostEnvironment; - _mapper = mapper; _tokenService = tokenService; _userRepository = userRepository; diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index adb1f224a..54880b1ed 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -723,7 +723,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc { // $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能早于前序访视检查时间{before?.ToString("yyyy-MM-dd")},请核对检查数据是否有误", - result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitBeforePrevError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd"), before?.ToString("yyyy-MM-dd")], StudyInstanceUid = waitUploadItem.StudyInstanceUid }); + result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitBeforePrevError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")!, before?.ToString("yyyy-MM-dd")!], StudyInstanceUid = waitUploadItem.StudyInstanceUid }); return; } @@ -733,7 +733,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc if (after != null && waitUploadItem.StudyDate != null && after < waitUploadItem.StudyDate) { // $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能晚于该访视之后的检查时间{after?.ToString("yyyy-MM-dd")},请核对检查数据是否有误" - result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitAfterSubseqError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd"), after?.ToString("yyyy-MM-dd")], StudyInstanceUid = waitUploadItem.StudyInstanceUid }); + result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitAfterSubseqError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")!, after?.ToString("yyyy-MM-dd")!], StudyInstanceUid = waitUploadItem.StudyInstanceUid }); return; } } diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 8ad6ba52e..cc01c5153 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -241,7 +241,7 @@ namespace IRaCIS.Core.Application.Service var listIdentification = auditDatas.Select(x => x.Identification).Distinct().ToList(); foreach (var item in auditDatas) { - Dictionary jsonDict = JsonConvert.DeserializeObject>(item.JsonStr); + Dictionary jsonDict = (JsonConvert.DeserializeObject>(item.JsonStr)).IfNullThrowException(); if (!jsonDict.ContainsKey(nameof(InspectionJsonDetail.CommonData))) { @@ -386,7 +386,7 @@ namespace IRaCIS.Core.Application.Service if (relationParentInspection != null) { - Dictionary jsonDic = JsonConvert.DeserializeObject>(relationParentInspection.JsonDetail); + Dictionary jsonDic = (JsonConvert.DeserializeObject>(relationParentInspection.JsonDetail)).IfNullThrowConvertException(); //避免对象信息记录 把 Data里面的信息也取过去 但是加上稽查对象的前缀 @@ -539,7 +539,7 @@ namespace IRaCIS.Core.Application.Service }).ToList(); - var jsonDataValueDic = JsonConvert.DeserializeObject>(jsonStr); + var jsonDataValueDic = (JsonConvert.DeserializeObject>(jsonStr)).IfNullThrowConvertException(); foreach (var item in list) { if (!jsonDataValueDic.ContainsKey(item.Key)) @@ -881,7 +881,7 @@ namespace IRaCIS.Core.Application.Service DateType = child.DateType, }).ToListAsync(); - var JsonData = JsonConvert.DeserializeObject>(Data.JsonDetail); + var JsonData = (JsonConvert.DeserializeObject>(Data.JsonDetail)).IfNullThrowException(); foreach (var item in JsonData.Keys) { @@ -892,12 +892,12 @@ namespace IRaCIS.Core.Application.Service { if (datefirst.DateType == FrontAuditDateType.Date.GetDescription()) { - JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd"); + JsonData[item] = DateTime.Parse(JsonData[item].ToString()!).ToString("yyyy-MM-dd"); } if (datefirst.DateType == FrontAuditDateType.DateTime.GetDescription()) { - JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd HH:mm:ss"); + JsonData[item] = DateTime.Parse(JsonData[item].ToString()!).ToString("yyyy-MM-dd HH:mm:ss"); } } catch (Exception) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 3a6af0f62..2047dcf58 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -699,8 +699,8 @@ namespace IRaCIS.Application.Services .WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType) .WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate) .WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate) - .WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.LoginFaildName.Contains(inQuery.LoginFaildName)) - .WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP)) + .WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.LoginFaildName.Contains(inQuery.LoginFaildName!)) + .WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!)) .ProjectTo(_mapper.ConfigurationProvider); var pageList = await userLogQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "Id" : inQuery.SortField, inQuery.Asc); diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/NUllCheckExtension.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/NUllCheckExtension.cs index 9023d7030..f4a8aae3c 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/NUllCheckExtension.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/NUllCheckExtension.cs @@ -12,7 +12,7 @@ namespace IRaCIS.Core.Infrastructure.Extention { if(businessObject == null) { - throw new QueryBusinessObjectNotExistException($"The query object {typeof(TEntity).Name} does not exist in database, Please check the query parameters"); + throw new QueryBusinessObjectNotExistException($"The query object {typeof(TEntity).Name} is null, Please check "); } else { @@ -25,7 +25,7 @@ namespace IRaCIS.Core.Infrastructure.Extention { if (businessStruct == null) { - throw new QueryBusinessObjectNotExistException($"The query object {typeof(TEntity).Name} does not exist in database, Please check the query parameters"); + throw new QueryBusinessObjectNotExistException($"The query object {typeof(TEntity).Name} is null, Please check "); } else { @@ -38,7 +38,7 @@ namespace IRaCIS.Core.Infrastructure.Extention { if (businessObject == null) { - throw new QueryBusinessObjectNotExistException($" Can not Convert to {typeof(TEntity).Name} Type, Please check parameter"); + throw new QueryBusinessObjectNotExistException($" {typeof(TEntity).Name} Type object should not null, Please check "); } else {