From 2a1f15996d624ee1c71d18addce84bc71265427e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 8 Apr 2022 16:06:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E8=A1=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 8 +++- .../Service/Common/DTO/DictionaryModel.cs | 2 - .../Service/Common/DictionaryService.cs | 44 ++++++++++++++++--- .../Document/DTO/SystemDocumentViewModel.cs | 2 + .../Document/DTO/TrialDocumentViewModel.cs | 2 + .../Service/Document/_MapConfig.cs | 3 +- .../TrialSiteUser/TrialExternalUserService.cs | 2 +- 7 files changed, 50 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 502029487..9e4fcdb00 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -337,6 +337,7 @@ 不带Token 访问 页面获取项目基本信息 和参与情况 (已经确认了 就不允许再次确认) Id: TrialExternalUserId/TrialSiteSurveyUserId + @@ -1662,18 +1663,21 @@ - New + 添加和编辑 - New + 获取子项数组 + + 删除字典数据 + 传递父亲 code 字符串 数组 返回多个下拉框数据 diff --git a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs index d5f94fb10..454bbddb0 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs @@ -58,12 +58,10 @@ namespace IRaCIS.Application.Contracts public class BasicDicSelect { public Guid Id { get; set; } - public string KeyName { get; set; } = string.Empty; public string ValueCN { get; set; } = string.Empty; public string Value { get; set; } = string.Empty; public string Code { get; set; } = string.Empty; - public string ChildGroup { get; set; } = string.Empty; public int ShowOrder { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index 6ade8ac17..164d57a05 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -1,9 +1,7 @@ -using IRaCIS.Core.Infrastructure.ExpressionExtend; -using IRaCIS.Application.Interfaces; +using IRaCIS.Application.Interfaces; using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Panda.DynamicWebApi.Attributes; namespace IRaCIS.Application.Services { @@ -21,7 +19,7 @@ namespace IRaCIS.Application.Services private readonly IRepository _trialRepository; public DictionaryService(IRepository sysDicRepository, IRepository doctorDictionaryRepository, IRepository trialDictionaryRepository, - IRepository doctorRepository, IRepository trialRepository) + IRepository doctorRepository, IRepository trialRepository) { _dicRepository = sysDicRepository; _doctorDictionaryRepository = doctorDictionaryRepository; @@ -31,6 +29,7 @@ namespace IRaCIS.Application.Services } + /// /// New 查询条件 IsConfig 代表是字典类型配置项 否就是我们普通的项 和普通项的子项 /// @@ -53,7 +52,7 @@ namespace IRaCIS.Application.Services /// - /// New + /// 添加和编辑 /// /// /// @@ -68,7 +67,7 @@ namespace IRaCIS.Application.Services /// - /// New + /// 获取子项数组 /// /// /// @@ -80,6 +79,29 @@ namespace IRaCIS.Application.Services } + + /// 删除字典数据 + [HttpDelete("{id:guid}")] + public async Task DeleteDictionary(Guid id) + { + if ((await _doctorDictionaryRepository.AnyAsync(t => t.DictionaryId == id)) || + (await _doctorRepository.AnyAsync(t => t.SpecialityId == id || t.PositionId == id || t.DepartmentId == id || t.RankId == id)) + + ) + { + return ResponseOutput.NotOk("This item is referenced by content of the reviewer's resume."); + } + + if (await _trialDictionaryRepository.AnyAsync(t => t.DictionaryId == id) || + await _trialRepository.AnyAsync(t => t.ReviewModeId == id)) + { + return ResponseOutput.NotOk("This item is referenced by content of the trial infomation."); + } + + var success = await _dicRepository.DeleteFromQueryAsync(t => t.Id == id); + return ResponseOutput.Result(success); + } + /// /// 传递父亲 code 字符串 数组 返回多个下拉框数据 /// @@ -103,6 +125,14 @@ namespace IRaCIS.Application.Services } + [AllowAnonymous] + public async Task>> GetBasicDataAllSelect() + { + var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.ToList()); + } + } } diff --git a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs index f5f4615c9..dfc936450 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs @@ -18,6 +18,8 @@ namespace IRaCIS.Core.Application.Contracts public DateTime CreateTime { get; set; } public DateTime UpdateTime { get; set; } + public string FileType { get; set; } = string.Empty; + public List NeedConfirmedUserTypeList { get; set; }=new List(); } diff --git a/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentViewModel.cs index ba92a1fea..f1aa90467 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentViewModel.cs @@ -21,6 +21,8 @@ namespace IRaCIS.Core.Application.Contracts public DateTime UpdateTime { get; set; } public Guid UpdateUserId { get; set; } + public string FileType { get; set; } = string.Empty; + public List NeedConfirmedUserTypeList { get; set; } = new List(); diff --git a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs index 066da7fc4..dea01b523 100644 --- a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs @@ -14,10 +14,11 @@ namespace IRaCIS.Core.Application.Service var userId = Guid.Empty; var token = string.Empty; CreateMap() - //.ForMember(d => d.UserConfirmInfo, u => u.MapFrom(s => s.SystemDocConfirmedUserList.FirstOrDefault(t=>t.ConfirmUserId==userId))) + .ForMember(d => d.FileType, u => u.MapFrom(s => s.FileType.Value)) .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token)); CreateMap() + .ForMember(d => d.FileType, u => u.MapFrom(s => s.FileType.Value)) .ForMember(d => d.IsSomeUserSigned, u => u.MapFrom(s => s.TrialDocConfirmedUserList.Any())) .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token)); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs index 112ef6ca8..6443a6040 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs @@ -616,11 +616,11 @@ namespace IRaCIS.Core.Application.Service } - /// /// 不带Token 访问 页面获取项目基本信息 和参与情况 (已经确认了 就不允许再次确认) Id: TrialExternalUserId/TrialSiteSurveyUserId /// /// + /// /// [AllowAnonymous] public async Task JoinBasicInfo(Guid id, bool isExternalUser)