diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index f6f50df03..79ffad22a 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -128,6 +128,7 @@ //UserWLTemplateService "UserWLTS_MaxTemplate": "The same user can add a maximum of 10 templates.", "UserWLTS_NameRepeated": "The template name is repeated", + "UserWLTS_ContentRepeated": "The template content is repeated", // ------------------------------------------------------------Allocation-------------------------------------------------------------------- //TaskAllocationRuleService diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index 7b0e809de..339ed9903 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -128,6 +128,7 @@ //UserWLTemplateService "UserWLTS_MaxTemplate": "同一个用户最多只能添加10个模板", "UserWLTS_NameRepeated": "模板名称存在重复", + "UserWLTS_ContentRepeated": "模板内容存在重复", // ------------------------------------------------------------Allocation-------------------------------------------------------------------- //TaskAllocationRuleService diff --git a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs index ad17595f8..1d574c465 100644 --- a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs @@ -100,10 +100,11 @@ namespace IRaCIS.Core.Application.Contracts .WhereIf(!string.IsNullOrWhiteSpace(queryQCQuestionConfigure.Type), t => t.Type.Contains(queryQCQuestionConfigure.Type)) .WhereIf(queryQCQuestionConfigure.LanguageType!=null, t =>t.LanguageType== queryQCQuestionConfigure.LanguageType) .WhereIf(queryQCQuestionConfigure.IsDefeaultViewParent==true,t=>t.ParentId==null) - .OrderBy(t=>t.ShowOrder) + .OrderByDescending(x=>x.LanguageType) + .ThenBy(t=>t.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider); - return await QCQuestionQueryable.ToPagedListAsync(queryQCQuestionConfigure.PageIndex, queryQCQuestionConfigure.PageSize, queryQCQuestionConfigure.SortField.IsNullOrEmpty()?nameof(queryQCQuestionConfigure.QuestionName): queryQCQuestionConfigure.SortField, queryQCQuestionConfigure.Asc); + return await QCQuestionQueryable.ToPagedListAsync(queryQCQuestionConfigure.PageIndex, queryQCQuestionConfigure.PageSize, new string[2] { "LanguageType desc", "ShowOrder asc" }); } public async Task AddOrUpdateQCQuestionConfigure(QCQuestionAddOrEdit addOrEditQCQuestionConfigure) diff --git a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs index dd384b16e..c46d9550a 100644 --- a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs @@ -48,7 +48,7 @@ namespace IRaCIS.Core.Application.Contracts .ProjectTo(_mapper.ConfigurationProvider); - var list = await trialQCQuestionQueryable.OrderBy(t => t.ShowOrder).ToListAsync(); + var list = await trialQCQuestionQueryable.OrderByDescending(x=>x.LanguageType).ThenBy(t => t.ShowOrder).ToListAsync(); var isHaveQCQuestion = _repository.Where(t => t.TrialId == queryTrialQCQuestionConfigure.TrialId).Any(); diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs index dfa6fc058..f903e9ff2 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs @@ -62,7 +62,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inDto.LanguageType != null, x => x.LanguageType == inDto.LanguageType.Value) .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder); - return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize,inDto.SortField,inDto.Asc); + return await query.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, new string[2] { "LanguageType desc", "ShowOrder asc" }); } /// @@ -158,7 +158,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) .WhereIf(inDto.LanguageType != null, x => x.LanguageType == inDto.LanguageType) - .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder); + .ProjectTo(_mapper.ConfigurationProvider).OrderByDescending(x=>x.LanguageType).ThenBy(x => x.ShowOrder); var isConfirmMedicineQuestion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => x.IsConfirmMedicineQuestion).FirstOrDefaultAsync(); diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs index 9ae14cf62..8fd25bc66 100644 --- a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs @@ -65,8 +65,11 @@ namespace IRaCIS.Core.Application.Service { throw new BusinessValidationFailedException(_localizer["UserWLTS_NameRepeated"]); } - + if (await _userWLTemplateRepository.AnyAsync(x => x.UserId == _userInfo.Id && x.WW == addOrEditUserWLTemplate.WW && x.WL == addOrEditUserWLTemplate.WL && x.Id != addOrEditUserWLTemplate.Id)) + { + throw new BusinessValidationFailedException(_localizer["UserWLTS_ContentRepeated"]); + } var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); return ResponseOutput.Ok(entity.Id.ToString()); diff --git a/后端提示语.xlsx b/后端提示语.xlsx index 0d03604bb..a297c71ff 100644 Binary files a/后端提示语.xlsx and b/后端提示语.xlsx differ