项目绑定医院,防止演示切换医院
parent
c479574905
commit
77444e35fa
|
|
@ -53,6 +53,7 @@ using System.Dynamic;
|
||||||
using System.Threading.Channels;
|
using System.Threading.Channels;
|
||||||
using NPOI.HSSF.Record.Chart;
|
using NPOI.HSSF.Record.Chart;
|
||||||
using IRaCIS.Core.Application.Helper.OtherTool;
|
using IRaCIS.Core.Application.Helper.OtherTool;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
|
|
@ -195,6 +196,8 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput<PageOutput<NewTrialView>>> GetTrialList(NewTrialQuery inQuery)
|
public async Task<IResponseOutput<PageOutput<NewTrialView>>> GetTrialList(NewTrialQuery inQuery)
|
||||||
{
|
{
|
||||||
|
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hIRHospitalRepository), TimeSpan.FromDays(7));
|
||||||
|
|
||||||
var trialQuery = _trialRepository
|
var trialQuery = _trialRepository
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ResearchProgramNo), t => t.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ResearchProgramNo), t => t.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), t => t.ExperimentName.Contains(inQuery.ExperimentName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), t => t.ExperimentName.Contains(inQuery.ExperimentName))
|
||||||
|
|
@ -202,6 +205,8 @@ namespace IRaCIS.Application.Services
|
||||||
.WhereIf(inQuery.TrialType != null, t => t.TrialType == inQuery.TrialType)
|
.WhereIf(inQuery.TrialType != null, t => t.TrialType == inQuery.TrialType)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialCode), t => t.TrialCode.Contains(inQuery.TrialCode))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialCode), t => t.TrialCode.Contains(inQuery.TrialCode))
|
||||||
|
|
||||||
|
//过滤医院,切换会有问题
|
||||||
|
.Where(t => t.HospitalId == hospitalInfo.Id)
|
||||||
//GA 要过滤课题组
|
//GA 要过滤课题组
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => _userInfo.HospitalGroupIdList.Contains(t.HospitalGroupId))
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => _userInfo.HospitalGroupIdList.Contains(t.HospitalGroupId))
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OA && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.GA
|
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OA && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.GA
|
||||||
|
|
|
||||||
|
|
@ -307,6 +307,8 @@ public partial class Trial : BaseFullDeleteAuditEntity
|
||||||
|
|
||||||
public Guid HospitalGroupId { get; set; }
|
public Guid HospitalGroupId { get; set; }
|
||||||
|
|
||||||
|
public Guid HospitalId { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18823
IRaCIS.Core.Infra.EFCore/Migrations/20250820052429_addHospitalId.Designer.cs
generated
Normal file
18823
IRaCIS.Core.Infra.EFCore/Migrations/20250820052429_addHospitalId.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,30 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addHospitalId : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "HospitalId",
|
||||||
|
table: "Trial",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "HospitalId",
|
||||||
|
table: "Trial");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10751,6 +10751,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Property<Guid>("HospitalGroupId")
|
b.Property<Guid>("HospitalGroupId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid>("HospitalId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<string>("Indication")
|
b.Property<string>("Indication")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(400)
|
.HasMaxLength(400)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue