From 8da786625a796e66ec91261f176ee026c77f7bf6 Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Tue, 24 Sep 2024 16:24:39 +0800 Subject: [PATCH] =?UTF-8?q?pacs=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PacsBusiness/PacsBusinessAppService.cs | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs b/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs index bc1af2f..711c9fe 100644 --- a/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs +++ b/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs @@ -22,6 +22,7 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; +using Volo.Abp.Users; namespace Shentun.Peis.PacsBusiness { @@ -46,6 +47,9 @@ namespace Shentun.Peis.PacsBusiness private readonly RegisterCheckPictureAppService _registerCheckPictureAppService; private readonly IRepository _registerCheckAsbitemRepository; private readonly IRepository _asbitemRepository; + private readonly ICurrentUser _currentUser; + private readonly IRepository _userItemTypeRepository; + public PacsBusinessAppService( IConfiguration configuration, IRepository registerCheckRepository, @@ -60,7 +64,9 @@ namespace Shentun.Peis.PacsBusiness SumSummaryReportAppService sumSummaryReportAppService, RegisterCheckPictureAppService registerCheckPictureAppService, IRepository registerCheckAsbitemRepository, - IRepository asbitemRepository) + IRepository asbitemRepository, + ICurrentUser currentUser, + IRepository userItemTypeRepository) { _configuration = configuration; _registerCheckRepository = registerCheckRepository; @@ -76,6 +82,8 @@ namespace Shentun.Peis.PacsBusiness _registerCheckPictureAppService = registerCheckPictureAppService; _registerCheckAsbitemRepository = registerCheckAsbitemRepository; _asbitemRepository = asbitemRepository; + _currentUser = currentUser; + _userItemTypeRepository = userItemTypeRepository; } @@ -327,6 +335,7 @@ namespace Shentun.Peis.PacsBusiness patientName = patientRegister.PatientName, checkRequestNo = registerCheck.CheckRequestNo, asbitemName = asbitem.DisplayName, + asbitemId = registerCheckAsbitem.AsbitemId, pacsCheckDate = registerCheck.PacsCheckDate, pacsUploadDate = registerCheck.PacsUploadDate }; @@ -358,6 +367,34 @@ namespace Shentun.Peis.PacsBusiness } + #region 增加项目类别权限 + + string AdminId = _configuration.GetValue("AdminId"); + + if (_currentUser.Id == null) + { + new PagedResultDto(0, new List()); + } + if (_currentUser.Id.Value != Guid.Parse(AdminId)) + { + var asbitemIds = (from userItemType in await _userItemTypeRepository.GetQueryableAsync() + join asbitem in await _asbitemRepository.GetQueryableAsync() on userItemType.ItemTypeId equals asbitem.ItemTypeId + where userItemType.UserId == _currentUser.Id.Value + select asbitem.Id).ToList(); + + if (asbitemIds.Any()) + { + query = query.Where(m => asbitemIds.Contains(m.asbitemId)); + } + else + { + new PagedResultDto(0, new List()); + } + + } + + #endregion + var checkRequestNoGroup = query.ToList().GroupBy(g => g.checkRequestNo); @@ -374,7 +411,7 @@ namespace Shentun.Peis.PacsBusiness PacsUploadDate = DataHelper.ConversionDateToString(s.FirstOrDefault().pacsUploadDate) }).ToList(); - return new PagedResultDto(totalCount, entListDto); ; + return new PagedResultDto(totalCount, entListDto); } }