From 93bea3cfe6fa5b208ce01428ccdcb7ff5dbac9ee Mon Sep 17 00:00:00 2001 From: "DESKTOP-G961P6V\\Zhh" <839860190@qq.com> Date: Fri, 31 May 2024 02:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=AD=97=E8=8A=82=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckTypeDto.cs | 14 +++ .../MedicalPackageAsbitemDto.cs | 96 +++++++++++++++++++ .../MedicalPackages/MedicalPackageDto.cs | 62 ++++++++++++ .../MedicalPackages/MedicalPackageIdInput.cs | 11 +++ .../MedicalPackageAppservice.cs | 59 ++++++++++++ .../WebPeisApplicationAutoMapperProfile.cs | 3 + .../Models/MedicalPackageDetail.cs | 8 +- .../Controllers/WeChatController.cs | 6 +- .../WebPeisHttpApiHostModule.cs | 25 +++-- 9 files changed, 275 insertions(+), 9 deletions(-) create mode 100644 src/Shentun.WebPeis.Application.Contracts/CheckTypeDto.cs create mode 100644 src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageAsbitemDto.cs create mode 100644 src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageDto.cs create mode 100644 src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageIdInput.cs create mode 100644 src/Shentun.WebPeis.Application/MedicalPackages/MedicalPackageAppservice.cs diff --git a/src/Shentun.WebPeis.Application.Contracts/CheckTypeDto.cs b/src/Shentun.WebPeis.Application.Contracts/CheckTypeDto.cs new file mode 100644 index 0000000..6a8624e --- /dev/null +++ b/src/Shentun.WebPeis.Application.Contracts/CheckTypeDto.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.WebPeis +{ + + public class CheckTypeDto + { + public char CheckTypeFlag { get; set; } + public string CheckTypeFlagName { get; set; } + public int DisplayOrder { get; set; } + } +} diff --git a/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageAsbitemDto.cs b/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageAsbitemDto.cs new file mode 100644 index 0000000..d82161b --- /dev/null +++ b/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageAsbitemDto.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.WebPeis.MedicalPackages +{ + public class MedicalPackageAsbitemDto + { + public List CheckTypes = new List(); + public List Asbitems = new List(); + + } + + public class MedicalPackageAsbitem + { + /// + /// 编号 + /// + public Guid AsbitemId { get; set; } + + /// + /// 名称 + /// + public string AsbitemName { get; set; } = null!; + + /// + /// 简称 + /// + public string? ShortName { get; set; } + + /// + /// 适用性别,M-男,F-女,A-全部 + /// + public char ForSexId { get; set; } + + /// + /// 项目类别 + /// + public Guid ItemTypeId { get; set; } + + /// + /// 价格 + /// + public decimal Price { get; set; } + + /// + /// 仪器类别 + /// + public Guid? DeviceTypeId { get; set; } + + /// + /// 餐前项目 + /// + public char IsBeforeEat { get; set; } + + /// + /// 临床意义 + /// + public string? ClinicalMeaning { get; set; } + + /// + /// 默认结果 + /// + public string? DefaultResult { get; set; } + + /// + /// 体检报告图片旋转90° + /// + public char IsPictureRotate { get; set; } + + /// + /// 是检查项目 + /// + public char IsCheck { get; set; } + + /// + /// 是启用 + /// + public char IsActive { get; set; } + + public string? Warn { get; set; } + + public Guid? DiseaseScreeningTypeId { get; set; } + + public string? SimpleCode { get; set; } + + public int DisplayOrder { get; set; } + + + + public char? IsWebAppoint { get; set; } + + + } + +} diff --git a/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageDto.cs b/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageDto.cs new file mode 100644 index 0000000..88ae57d --- /dev/null +++ b/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageDto.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.WebPeis.MedicalPackages +{ + public class MedicalPackageDto + { + /// + /// 套餐主档编号 + /// + public Guid MedicalPackageId { get; set; } + + /// + /// 名称 + /// + public string MedicalPackageName { get; set; } = null!; + + /// + /// 价格 + /// + public decimal Price { get; set; } + + /// + /// 适用性别 + /// + public char ForSexId { get; set; } + + public string ForSexName { get; set; } + + /// + /// 启用标志 + /// + public char IsActive { get; set; } + + /// + /// 备注 + /// + public string? Remark { get; set; } + + /// + /// 显示顺序 + /// + public int DisplayOrder { get; set; } + + public string? SimpleCode { get; set; } + + public string? ConcurrencyStamp { get; set; } + + + + public char? IsWebAppoint { get; set; } + + /// + /// 适用婚姻状况 + /// + public char MaritalStatusId { get; set; } + + public string MaritalStatusName { get;set; } + + } +} diff --git a/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageIdInput.cs b/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageIdInput.cs new file mode 100644 index 0000000..88d899f --- /dev/null +++ b/src/Shentun.WebPeis.Application.Contracts/MedicalPackages/MedicalPackageIdInput.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.WebPeis.MedicalPackages +{ + public class MedicalPackageIdInput + { + public Guid MedicalPackageId { get; set; } + } +} diff --git a/src/Shentun.WebPeis.Application/MedicalPackages/MedicalPackageAppservice.cs b/src/Shentun.WebPeis.Application/MedicalPackages/MedicalPackageAppservice.cs new file mode 100644 index 0000000..bd0fa6b --- /dev/null +++ b/src/Shentun.WebPeis.Application/MedicalPackages/MedicalPackageAppservice.cs @@ -0,0 +1,59 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Shentun.WebPeis.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; + +namespace Shentun.WebPeis.MedicalPackages +{ + [ApiExplorerSettings(GroupName = "Work")] + [Authorize] + public class MedicalPackageAppservice : ApplicationService + { + private readonly IRepository _repository; + private readonly IRepository _asbitemRepository; + private readonly IRepository _medicalPackageDetailRepository; + private readonly CacheService _cacheService; + + public MedicalPackageAppservice(IRepository repository, + CacheService cacheService, + IRepository asbitemRepository, + IRepository medicalPackageDetailRepository + ) + { + _repository = repository; + _cacheService = cacheService; + _asbitemRepository = asbitemRepository; + _medicalPackageDetailRepository = medicalPackageDetailRepository; + + } + /// + /// 获取能预约的套餐信息 + /// + /// + [HttpPost("api/app/MedicalPackage/GetCanAppointList")] + public async Task> GetCanAppointListAsync() + { + var list = (await _repository.GetListAsync(o=>o.IsActive == 'Y' && o.IsWebAppoint == 'Y')) + .OrderBy(o => o.DisplayOrder).ToList(); + var returnList = ObjectMapper.Map, List>(list); ; + foreach (var item in returnList) + { + item.ForSexName = await _cacheService.GetForSexNameAsync(item.ForSexId); + item.MaritalStatusName = await _cacheService.GetForSexNameAsync(item.MaritalStatusId); + } + return returnList; ; + + } + //public async Task> GetAsbitemListByMedicalPackageIdAsync(MedicalPackageIdInput input) + //{ + // from medicalPackage in await _medicalPackageDetailRepository.GetQueryableAsync() + + //} + } +} diff --git a/src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs b/src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs index eedcec8..f5cfa1c 100644 --- a/src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs +++ b/src/Shentun.WebPeis.Application/WebPeisApplicationAutoMapperProfile.cs @@ -2,6 +2,7 @@ using Shentun.Peis.MaritalStatuss; using Shentun.WebPeis.Kinships; using Shentun.WebPeis.MaritalStatuss; +using Shentun.WebPeis.MedicalPackages; using Shentun.WebPeis.Models; using Shentun.WebPeis.Nations; using Shentun.WebPeis.OrganizationUnits; @@ -49,6 +50,8 @@ public class WebPeisApplicationAutoMapperProfile : Profile CreateMap(); CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); diff --git a/src/Shentun.WebPeis.Domain/Models/MedicalPackageDetail.cs b/src/Shentun.WebPeis.Domain/Models/MedicalPackageDetail.cs index 41a7382..5e7ee33 100644 --- a/src/Shentun.WebPeis.Domain/Models/MedicalPackageDetail.cs +++ b/src/Shentun.WebPeis.Domain/Models/MedicalPackageDetail.cs @@ -1,12 +1,13 @@ using System; using System.Collections.Generic; +using Volo.Abp.Domain.Entities; namespace Shentun.WebPeis.Models; /// /// 体检套餐包含的组合项目设置 /// -public partial class MedicalPackageDetail +public partial class MedicalPackageDetail:Entity { /// /// 套餐编号 @@ -27,4 +28,9 @@ public partial class MedicalPackageDetail public virtual Asbitem Asbitem { get; set; } = null!; public virtual MedicalPackage MedicalPackage { get; set; } = null!; + + public override object?[] GetKeys() + { + return [MedicalPackageId, AsbitemId]; + } } diff --git a/src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs b/src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs index 9dabb0a..4821e4e 100644 --- a/src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs +++ b/src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs @@ -121,7 +121,11 @@ namespace Shentun.WebPeis.Controllers { throw new Exception("用户不存在"); } - + if(!user.IsActive) + { + throw new Exception("用户已被禁用"); + } + principal = await SignInManager.CreateUserPrincipalAsync(user); if (principal == null) { diff --git a/src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs b/src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs index 462c5ae..f83f09e 100644 --- a/src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs +++ b/src/Shentun.WebPeis.HttpApi.Host/WebPeisHttpApiHostModule.cs @@ -51,6 +51,7 @@ using Microsoft.Extensions.Hosting.Internal; using Microsoft.IdentityModel.Tokens; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Server.Kestrel.Core; namespace Shentun.WebPeis; @@ -145,6 +146,16 @@ public class WebPeisHttpApiHostModule : AbpModule }); + context.Services.Configure(options => + { + options.MaxRequestBodySize = 52428800; // Ϊnullʾƣ + }); + + context.Services.Configure(options => + { + options.Limits.MaxRequestBodySize = 52428800; // Ϊnullʾƣ + }); + //Configure(x => //{ // //x.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); @@ -314,13 +325,13 @@ public class WebPeisHttpApiHostModule : AbpModule //postС - app.UseWhen(ct => ct.Request.Method == HttpMethods.Post, - builder => builder.UseWhen(ct => true, appBuilder => - appBuilder.Use((ct, next) => - { - ct.Features.Get().MaxRequestBodySize = 50 * 1024 * 1024; // 10MB - return next(); - }))); + //app.UseWhen(ct => ct.Request.Method == HttpMethods.Post, + // builder => builder.UseWhen(ct => true, appBuilder => + // appBuilder.Use((ct, next) => + // { + // ct.Features.Get().MaxRequestBodySize = 50 * 1024 * 1024; // 10MB + // return next(); + // }))); app.UseCorrelationId();