diff --git a/20220103后端提示语.xlsx b/20220103后端提示语.xlsx index 6442fdec..396d4e63 100644 Binary files a/20220103后端提示语.xlsx and b/20220103后端提示语.xlsx differ diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index d1fe2dff..fda9c5b8 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -205,7 +205,7 @@ "ReadingImage_Idnotcorrespond": "Failed to add lesion mark. the instanceId and SeriesId of the image did not match.", "ReadingImage_Twice": "Incorrect system calls, duplicate submitted questions and answers.", "ReadingImage_MaxQuestion": "According to Charter, the number of current lesion does not exceed {0}.", - "ReadingImage_Maxlesion": "According to Charter, the number of target lesion of same organ does not exceed . Please confirm.", + "ReadingImage_Maxlesion": "According to Charter, the number of target lesion of same organ does not exceed {0} . Please confirm.", "ReadingImage_Maximum": "The number of repeats of \"{0}\" is limited to {1} and it has been repeated {2} times at present.", "ReadingImage_RequiredQuestion": "\"{0}\" is a required field, and the current input is empty or not saved.", "ReadingImage_ClinicalRead": "The clinical data has not been read, please confirm!", @@ -231,7 +231,11 @@ "MedicalReview_NotClosed": "The current operation cannot be performed, and the current medical inquiry conversation has not been closed.", "MedicalReview_Finish": "The current medical review task has been completed", //UserService - "User_CheckNameOrPw": "Please check the username or password." + "User_CheckNameOrPw": "Please check the username or password.", + //Repository + "Repository_UpdateError": "Update object not exist in db,Please check if the parameter Id is passed incorrectly.", + "Repository_DeleteError": "Delete object not exist in db,Please check if the parameter Id is passed incorrectly" + diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index 075b1bf7..249bde7f 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -232,11 +232,15 @@ "MedicalReview_NotClosed": "无法执行当前操作,当前医学质询对话未关闭。", "MedicalReview_Finish": "当前医学审核已做完。", //UserService - "User_CheckNameOrPw": "请检查用户名或者密码。" + "User_CheckNameOrPw": "请检查用户名或者密码。", + //Repository + "Repository_UpdateError": "修改的数据在数据库不存在。", + "Repository_DeleteError": "删除的数据在数据库不存在。" + + - diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 567fd721..d366160b 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1284,12 +1284,27 @@ namespace IRaCIS.Application.Services var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => tableQuestionIds.Contains(x.Id) && x.MaxRowCount != null && x.MaxRowCount != 0).ToListAsync(); + List questionMarks = new List() + { + QuestionMark.Part, + QuestionMark.Organ, + + }; foreach (var item in tableQuestions) { var answer = inDto.AnswerList.Where(x => x.TableQuestionId == item.Id).Select(x => x.Answer).FirstOrDefault(); if (!answer.IsNullOrEmpty()) { - var rowCount = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == item.Id && ((x.RowIndex % 1) == 0) && x.Answer == answer && x.RowIndex != inDto.RowIndex).CountAsync(); + var rowCount = 0; + if (questionMarks.Contains(item.QuestionMark)) + { + rowCount = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && ((x.RowIndex % 1) == 0) && x.OrganInfoId == inDto.OrganInfoId && x.OrganInfoId != null && x.RowIndex != inDto.RowIndex).CountAsync(); + } + else + { + rowCount = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == item.Id && ((x.RowIndex % 1) == 0) && x.Answer == answer && x.RowIndex != inDto.RowIndex).CountAsync(); + } + if (rowCount > item.MaxRowCount.Value - 1) { diff --git a/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj b/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj index 9f08fd7a..df6df308 100644 --- a/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj +++ b/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj @@ -22,6 +22,7 @@ + diff --git a/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs b/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs index 55d16e3c..251a746a 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs @@ -13,6 +13,7 @@ using System.Linq.Expressions; using System.Threading.Tasks; using IRaCIS.Core.Domain.Share; using EFCore.BulkExtensions; +using Microsoft.Extensions.Localization; namespace IRaCIS.Core.Infra.EFCore { @@ -85,8 +86,11 @@ namespace IRaCIS.Core.Infra.EFCore public IUserInfo _userInfo { get; set; } - public Repository(IRaCISDBContext dbContext, IMapper mapper, IUserInfo userInfo) + public IStringLocalizer _localizer { get; set; } + + public Repository(IRaCISDBContext dbContext, IMapper mapper, IUserInfo userInfo, IStringLocalizer localizer) { + _localizer = localizer; _dbContext = dbContext; _mapper = mapper; _userInfo = userInfo; @@ -173,8 +177,8 @@ namespace IRaCIS.Core.Infra.EFCore if (dbEntity == null) { - throw new BusinessValidationFailedException( - " Update object not exist in db,Please check if the parameter Id is passed incorrectly"); + + throw new BusinessValidationFailedException(_localizer["Repository_UpdateError"]); } var dbBeforEntity = dbEntity.Clone(); diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index ac895deb..586e9ea3 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -14,6 +14,8 @@ using EFCore.BulkExtensions; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; +using Microsoft.Extensions.Localization; + namespace IRaCIS.Core.Infra.EFCore { public interface IRepository : ICommandRepository, IQueryRepository where TEntity : Entity @@ -30,12 +32,15 @@ namespace IRaCIS.Core.Infra.EFCore public IMapper _mapper { get; set; } public IRaCISDBContext _dbContext { get; set; } + public IStringLocalizer _localizer { get; set; } + public DbSet _dbSet => _dbContext.Set(); public IUserInfo _userInfo { get; set; } - public Repository(IRaCISDBContext dbContext, IMapper mapper, IUserInfo userInfo) + public Repository(IRaCISDBContext dbContext, IMapper mapper, IUserInfo userInfo, IStringLocalizer localizer) { + _localizer = localizer; _dbContext = dbContext; _mapper = mapper; _userInfo = userInfo; @@ -103,8 +108,8 @@ namespace IRaCIS.Core.Infra.EFCore if (dbEntity == null) { - throw new BusinessValidationFailedException( - " Update object not exist in db,Please check if the parameter Id is passed incorrectly"); + + throw new BusinessValidationFailedException(_localizer["Repository_UpdateError"]); } var dbBeforEntity = dbEntity.Clone(); @@ -208,8 +213,7 @@ namespace IRaCIS.Core.Infra.EFCore if (searchEntity == null) { - throw new BusinessValidationFailedException( - " Update object not exist in db,Please check if the parameter Id is passed incorrectly"); + throw new BusinessValidationFailedException(_localizer["Repository_UpdateError"]); } _dbContext.EntityModifyPartialFiled(searchEntity, updateFactory); @@ -261,8 +265,7 @@ namespace IRaCIS.Core.Infra.EFCore if (waitDelete == null) { - throw new BusinessValidationFailedException( - " Delete object not exist in db,Please check if the parameter Id is passed incorrectly"); + throw new BusinessValidationFailedException(_localizer["Repository_DeleteError"]); } await DeleteAsync(waitDelete, autoSave);