Browse Source

预约

bjmzak
DESKTOP-G961P6V\Zhh 1 year ago
parent
commit
126accf1fe
  1. 13
      src/Shentun.ColumnReferencePlugIns/WebAppointPatientRegisterIdInput.cs
  2. 15
      src/Shentun.ColumnReferencePlugIns/WebAppointPlugInsBase.cs
  3. 26
      src/Shentun.ColumnReferencePlugIns/WebAppointWebPeisPlugIns.cs
  4. 1
      src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterIdInputDto.cs
  5. 15
      src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterPlugInsInputDto.cs
  6. 29
      src/Shentun.Peis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs
  7. 2
      test/Shentun.Peis.ColumnReference.Tests/WebAppointWebPeisPlugInsTest.cs

13
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; }
}
}

15
src/Shentun.ColumnReferencePlugIns/WebAppointPlugInsBase.cs

@ -18,12 +18,23 @@ namespace Shentun.Peis.PlugIns
}
public virtual async Task<List<AppointPatientRegisterDto>> GetAppointPatientRegisterListByFilterAsync(AppointPatientRegisterPlugInsInputDto input)
/// <summary>
/// 获取预约人员列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public virtual async Task<List<AppointPatientRegisterDto>> GetAppointPatientRegisterListByFilterAsync(AppointPatientRegisterInputDto input)
{
throw new NotImplementedException();
}
/// <summary>
/// 获取预约组合项目列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public virtual async Task<List<AppointRegisterAsbitemDto>> GetAppointRegisterAsbitemListByIdAsync(AppointPatientRegisterIdInputDto input)
{
throw new NotImplementedException();

26
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<List<AppointPatientRegisterDto>> GetAppointPatientRegisterListByFilterAsync(AppointPatientRegisterPlugInsInputDto input)
/// <summary>
/// 获取预约人员列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<List<AppointPatientRegisterDto>> GetAppointPatientRegisterListByFilterAsync(AppointPatientRegisterInputDto input)
{
var medicalCenterId = _medicalCenterId;
var webAppointPatientRegisterInput = new WebAppointPatientRegisterInput()
@ -58,12 +62,20 @@ namespace Shentun.Peis.PlugIns
return appointPatientRegisterDtos;
}
/// <summary>
/// 获取组合项目列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<List<AppointRegisterAsbitemDto>> GetAppointRegisterAsbitemListByIdAsync(AppointPatientRegisterIdInputDto input)
{
var appointRegisterAsbitemDtos = await CallWePeisAppServiceAsync<AppointPatientRegisterIdInputDto,
var webAppointPatientRegisterIdInput = new WebAppointPatientRegisterIdInput()
{
AppointPatientRegisterId = new Guid(input.AppointPatientRegisterId)
};
var appointRegisterAsbitemDtos = await CallWePeisAppServiceAsync<WebAppointPatientRegisterIdInput,
List<AppointRegisterAsbitemDto>>
(_webPeisGetAppointRegisterAsbitemListByIdUrl, input);
(_webPeisGetAppointRegisterAsbitemListByIdUrl, webAppointPatientRegisterIdInput);
return appointRegisterAsbitemDtos;
}
public async virtual Task<WebApiOutDtoExter<LoginOutDataDto>> LoginWebPeisAsync()
@ -182,7 +194,7 @@ namespace Shentun.Peis.PlugIns
{
throw new Exception($"调用WebApi失败,返回-1,消息:" + resultDto.Message);
}
return resultDto.Data;
}
return resultDto.Data;

1
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; }
}
}

15
src/Shentun.Peis.Application.Contracts/AppointPatientRegisters/AppointPatientRegisterPlugInsInputDto.cs

@ -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; }
}
}

29
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
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("api/app/AppointPatientRegister/GetListByFilter")]
public async Task<List<AppointPatientRegisterDto>> 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<List<AppointPatientRegisterDto>>(assemblyName,
className, [thirdInterface.Id], "GetListByFilterAsync", objects);
className, [thirdInterface.Id], "GetAppointPatientRegisterListByFilterAsync", objects);
return pluginsOut;
}
[HttpPost("api/app/AppointPatientRegister/GetAppointRegisterAsbitemListById")]
public async Task<List<AppointRegisterAsbitemDto>> 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<List<AppointRegisterAsbitemDto>>(assemblyName,
className, [thirdInterface.Id], "GetAppointRegisterAsbitemListByIdAsync", objects);
return pluginsOut;
}

2
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)

Loading…
Cancel
Save