From 1077a2a78e0dadc612a2b093b08ba7edefc303cf Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Fri, 31 May 2024 19:11:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8C=E4=B8=9A=E7=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OccupationalDiseaseAppService.cs | 8 ++++++++ .../PeisHttpApiHostModule.cs | 17 ++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs b/src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs index c54a1d9..3784af6 100644 --- a/src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs +++ b/src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs @@ -147,6 +147,14 @@ namespace Shentun.Peis.OccupationalDiseases List patientPoisonList = new List(); foreach (var item in patientPoisonsInput) { + if (patientPoisonList.Select(s => s.PoisonId).Contains(item.PoisonId)) + { + string errPoisonName = ""; + var errPoison = await _poisonRepository.FirstOrDefaultAsync(f => f.Id == item.PoisonId); + if (errPoison != null) + errPoisonName = errPoison.DisplayName; + throw new UserFriendlyException($"接害因素{errPoisonName}不能重复选择"); + } patientPoisonList.Add(new PatientPoison { PatientRegisterId = input.PatientRegisterId, diff --git a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs index a928ca1..da5e4b0 100644 --- a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs +++ b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs @@ -64,6 +64,7 @@ using Volo.Abp.BackgroundWorkers; using Shentun.Peis.Schedulers; using System.Threading.Tasks; using Shentun.Peis.ThirdInterfaces; +using Microsoft.AspNetCore.Server.Kestrel.Core; namespace Shentun.Peis; [DependsOn( @@ -135,14 +136,16 @@ public class PeisHttpApiHostModule : AbpModule opt.Password.RequiredLength = 1; }); - ////密码策略配置 - //context.Services.Configure(opt => + + + //context.Services.Configure(opt => + //{ + // opt.MaxRequestBodySize = 52428800; + //}); + + //context.Services.Configure(opt => //{ - // opt.Password.RequireDigit = false; - // opt.Password.RequireLowercase = false; - // opt.Password.RequireUppercase = false; - // opt.Password.RequireNonAlphanumeric = false; - // opt.Password.RequiredLength = 1; + // opt.Limits.MaxRequestBodySize = 52428800; //}); #region 临时去掉日志