diff --git a/src/Shentun.ColumnReferencePlugIns/WebAppointPatientRegisterIdInput.cs b/src/Shentun.ColumnReferencePlugIns/WebAppointPatientRegisterIdInput.cs new file mode 100644 index 0000000..f381e8e --- /dev/null +++ b/src/Shentun.ColumnReferencePlugIns/WebAppointPatientRegisterIdInput.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Shentun.Peis.PlugIns +{ + public class WebAppointPatientRegisterIdInput + { + public Guid AppointPatientRegisterId { get; set; } + } +} diff --git a/src/Shentun.ColumnReferencePlugIns/WebAppointPlugInsBase.cs b/src/Shentun.ColumnReferencePlugIns/WebAppointPlugInsBase.cs index 38df6af..fdc3caa 100644 --- a/src/Shentun.ColumnReferencePlugIns/WebAppointPlugInsBase.cs +++ b/src/Shentun.ColumnReferencePlugIns/WebAppointPlugInsBase.cs @@ -18,12 +18,23 @@ namespace Shentun.Peis.PlugIns } - public virtual async Task> GetAppointPatientRegisterListByFilterAsync(AppointPatientRegisterPlugInsInputDto input) + /// + /// 获取预约人员列表 + /// + /// + /// + /// + public virtual async Task> GetAppointPatientRegisterListByFilterAsync(AppointPatientRegisterInputDto input) { throw new NotImplementedException(); } - + /// + /// 获取预约组合项目列表 + /// + /// + /// + /// public virtual async Task> GetAppointRegisterAsbitemListByIdAsync(AppointPatientRegisterIdInputDto input) { throw new NotImplementedException(); diff --git a/src/Shentun.ColumnReferencePlugIns/WebAppointWebPeisPlugIns.cs b/src/Shentun.ColumnReferencePlugIns/WebAppointWebPeisPlugIns.cs index 637bdc6..c13b0c6 100644 --- a/src/Shentun.ColumnReferencePlugIns/WebAppointWebPeisPlugIns.cs +++ b/src/Shentun.ColumnReferencePlugIns/WebAppointWebPeisPlugIns.cs @@ -31,7 +31,7 @@ namespace Shentun.Peis.PlugIns InterfaceConfig = configurationBuilder.Build(); var medicalCenterIdStr = InterfaceConfig.GetSection("Interface").GetSection("MedicalCenterId").Value; - if (!Guid.TryParse(medicalCenterIdStr, out _medicalCenterId)) + if (!Guid.TryParse(medicalCenterIdStr, out _medicalCenterId)) { throw new Exception("体检中心ID格式不正确"); } @@ -41,8 +41,12 @@ namespace Shentun.Peis.PlugIns _webPeisGetAppointPatientRegisterListByFilterUrl = InterfaceConfig.GetSection("Interface").GetSection("GetAppointPatientRegisterListByFilterUrl").Value; _webPeisGetAppointRegisterAsbitemListByIdUrl = InterfaceConfig.GetSection("Interface").GetSection("GetAppointRegisterAsbitemListByIdUrl").Value; } - - public override async Task> GetAppointPatientRegisterListByFilterAsync(AppointPatientRegisterPlugInsInputDto input) + /// + /// 获取预约人员列表 + /// + /// + /// + public override async Task> GetAppointPatientRegisterListByFilterAsync(AppointPatientRegisterInputDto input) { var medicalCenterId = _medicalCenterId; var webAppointPatientRegisterInput = new WebAppointPatientRegisterInput() @@ -58,12 +62,20 @@ namespace Shentun.Peis.PlugIns return appointPatientRegisterDtos; } - + /// + /// 获取组合项目列表 + /// + /// + /// public override async Task> GetAppointRegisterAsbitemListByIdAsync(AppointPatientRegisterIdInputDto input) { - var appointRegisterAsbitemDtos = await CallWePeisAppServiceAsync> - (_webPeisGetAppointRegisterAsbitemListByIdUrl, input); + (_webPeisGetAppointRegisterAsbitemListByIdUrl, webAppointPatientRegisterIdInput); return appointRegisterAsbitemDtos; } public async virtual Task> LoginWebPeisAsync() @@ -182,7 +194,7 @@ namespace Shentun.Peis.PlugIns { throw new Exception($"调用WebApi失败,返回-1,消息:" + resultDto.Message); } - + return resultDto.Data; } return resultDto.Data; diff --git a/src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterIdInputDto.cs b/src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterIdInputDto.cs index e0e6c41..e2a788c 100644 --- a/src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterIdInputDto.cs +++ b/src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterIdInputDto.cs @@ -8,6 +8,7 @@ namespace Shentun.Peis.PlugIns { public class AppointPatientRegisterIdInputDto { + public Guid ThirdInterFaceId { get; set; } public string AppointPatientRegisterId { get; set; } } } diff --git a/src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterPlugInsInputDto.cs b/src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterPlugInsInputDto.cs deleted file mode 100644 index 6669338..0000000 --- a/src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterPlugInsInputDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Shentun.Peis.AppointPatientRegisters -{ - public class AppointPatientRegisterPlugInsInputDto - { - public string IdNo { get; set; } - public string MobilePhone { get; set; } - - public DateTime? AppointStartDate { get; set; } - public DateTime? AppointStopDate { get; set; } - } -} diff --git a/src/Shentun.Peis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs b/src/Shentun.Peis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs index 9f05a52..030ac61 100644 --- a/src/Shentun.Peis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs +++ b/src/Shentun.Peis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using NUglify.JavaScript.Syntax; +using Shentun.Peis.AppointRegisterAsbitems; using Shentun.Peis.Enums; using Shentun.Peis.Models; using Shentun.Peis.PlugIns; @@ -34,6 +35,7 @@ namespace Shentun.Peis.AppointPatientRegisters /// /// /// + [HttpPost("api/app/AppointPatientRegister/GetListByFilter")] public async Task> GetListByFilterAsync(AppointPatientRegisterInputDto input) { var thirdInterface = await _thirdInterfaceRepository.GetAsync(input.ThirdInterFaceId); @@ -42,8 +44,9 @@ namespace Shentun.Peis.AppointPatientRegisters throw new UserFriendlyException("该接口已禁用"); } - var appointPatientRegisterPlugInsInputDto = new AppointPatientRegisterPlugInsInputDto() + var appointPatientRegisterPlugInsInputDto = new AppointPatientRegisterInputDto() { + ThirdInterFaceId = input.ThirdInterFaceId, IdNo = input.IdNo, MobilePhone = input.MobilePhone, AppointStartDate = input.AppointStartDate, @@ -58,7 +61,29 @@ namespace Shentun.Peis.AppointPatientRegisters var className = config.GetSection("Interface").GetSection("ClassName").Value; var pluginsOut = await Utilities.ReflectionHelper.InvokeAsync>(assemblyName, - className, [thirdInterface.Id], "GetListByFilterAsync", objects); + className, [thirdInterface.Id], "GetAppointPatientRegisterListByFilterAsync", objects); + return pluginsOut; + + } + [HttpPost("api/app/AppointPatientRegister/GetAppointRegisterAsbitemListById")] + public async Task> GetAppointRegisterAsbitemListByIdAsync(AppointPatientRegisterIdInputDto input) + { + var thirdInterface = await _thirdInterfaceRepository.GetAsync(input.ThirdInterFaceId); + if (thirdInterface.IsActive != 'Y') + { + throw new UserFriendlyException("该接口已禁用"); + } + + object[] objects = [input]; + var parmValue = thirdInterface.ParmValue; + var configurationBuilder = new ConfigurationBuilder() + .AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue))); + var config = configurationBuilder.Build(); + var assemblyName = config.GetSection("Interface").GetSection("AssemblyName").Value; + var className = config.GetSection("Interface").GetSection("ClassName").Value; + + var pluginsOut = await Utilities.ReflectionHelper.InvokeAsync>(assemblyName, + className, [thirdInterface.Id], "GetAppointRegisterAsbitemListByIdAsync", objects); return pluginsOut; } diff --git a/test/Shentun.Peis.ColumnReference.Tests/WebAppointWebPeisPlugInsTest.cs b/test/Shentun.Peis.ColumnReference.Tests/WebAppointWebPeisPlugInsTest.cs index 72dab7d..9f43943 100644 --- a/test/Shentun.Peis.ColumnReference.Tests/WebAppointWebPeisPlugInsTest.cs +++ b/test/Shentun.Peis.ColumnReference.Tests/WebAppointWebPeisPlugInsTest.cs @@ -22,7 +22,7 @@ namespace Shentun.Peis.PlugIns.Tests { var plugIns = new WebAppointWebPeisPlugIns(new Guid("43a9c3a5-8741-4c64-b869-bc304712d88e")); - var items = await plugIns.GetAppointPatientRegisterListByFilterAsync(new AppointPatientRegisterPlugInsInputDto() + var items = await plugIns.GetAppointPatientRegisterListByFilterAsync(new AppointPatientRegisterInputDto() { MobilePhone = "18911254911", AppointStartDate = DateTime.Now.Date.AddDays(-10)