diff --git a/Shentun.WebPeis.Plugins/AppQueueRegisterPlugIns.cs b/Shentun.WebPeis.Plugins/AppQueueRegisterPlugIns.cs index a674299..e07fba7 100644 --- a/Shentun.WebPeis.Plugins/AppQueueRegisterPlugIns.cs +++ b/Shentun.WebPeis.Plugins/AppQueueRegisterPlugIns.cs @@ -29,6 +29,8 @@ namespace Shentun.WebPeis.Plugins private string? _appQueueRegisterUrl; private string? _appIsPeisRegisterUrl; private string? _appUpdateAppointPatientAsbitemStatusUrl; + private string? _appCreateGiveUpAsbitemUrl; + private string? _appCreateNewAsbitemTriageUrl; public AppQueueRegisterPlugIns() { Init(); @@ -52,6 +54,10 @@ namespace Shentun.WebPeis.Plugins .GetSection("AppIsPeisRegisterUrl").Value; _appUpdateAppointPatientAsbitemStatusUrl= AppConfig.GetSection("Peis") .GetSection("AppUpdateAppointPatientAsbitemStatusUrl").Value; + _appCreateGiveUpAsbitemUrl = AppConfig.GetSection("Peis") + .GetSection("CreateGiveUpAsbitemUrl").Value; + _appCreateNewAsbitemTriageUrl = AppConfig.GetSection("Peis") + .GetSection("CreateNewAsbitemTriageUrl").Value; } @@ -70,6 +76,33 @@ namespace Shentun.WebPeis.Plugins + /// + /// 放弃项目 + /// + /// + /// + public async Task CreateGiveUpAsbitemAsync(CreateGiveUpAsbitemInputDto input) + { + var appCreateGiveUpAsbitemDto= await CallAppServiceAsync(_appCreateGiveUpAsbitemUrl, + input); + + return appCreateGiveUpAsbitemDto; + } + + /// + /// 创建新的项目分诊 + /// + /// + /// + public async Task CreateNewAsbitemTriageAsync(CreateNewAsbitemTriageInputDto input) + { + var appCreateNewAsbitemTriageDto = await CallAppServiceAsync(_appCreateNewAsbitemTriageUrl, + input); + + return appCreateNewAsbitemTriageDto; + } + + /// /// 获取预约记录是否在体检系统登记,用于判断是否能退款 /// diff --git a/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/CreateGiveUpAsbitemInputDto.cs b/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/CreateGiveUpAsbitemInputDto.cs new file mode 100644 index 0000000..a7eea1a --- /dev/null +++ b/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/CreateGiveUpAsbitemInputDto.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.WebPeis.QueueRegisters +{ + public class CreateGiveUpAsbitemInputDto + { + /// + /// 检查ID + /// + public Guid RegisterCheckId { get; set; } + + /// + /// 是否放弃 Y=放弃 N=未放弃 + /// + public char IsGiveUp { get; set; } + } +} diff --git a/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/CreateNewAsbitemTriageInputDto.cs b/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/CreateNewAsbitemTriageInputDto.cs new file mode 100644 index 0000000..0559737 --- /dev/null +++ b/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/CreateNewAsbitemTriageInputDto.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.WebPeis.QueueRegisters +{ + public class CreateNewAsbitemTriageInputDto + { + /// + /// 人员ID + /// + public Guid PatientRegisterId { get; set; } + + /// + /// 排队房间Id + /// + public Guid RoomId { get; set; } + } +} diff --git a/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/GetAppQueueRegisterByPersonIdDto.cs b/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/GetAppQueueRegisterByPersonIdDto.cs index b495ba5..0958a05 100644 --- a/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/GetAppQueueRegisterByPersonIdDto.cs +++ b/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/GetAppQueueRegisterByPersonIdDto.cs @@ -6,6 +6,11 @@ namespace Shentun.WebPeis.QueueRegisters { public class GetAppQueueRegisterByPersonIdDto { + /// + /// 人员ID + /// + public Guid PatientRegisterId { get; set; } + /// /// 姓名 /// @@ -47,6 +52,10 @@ namespace Shentun.WebPeis.QueueRegisters /// public string RoomName { get; set; } + /// + /// 排队房间Id + /// + public Guid RoomId { get; set; } /// /// 候诊人数 @@ -54,8 +63,49 @@ namespace Shentun.WebPeis.QueueRegisters public int QueueCount { get; set; } /// - /// 完成标志 (o=候诊 1=已呼 2=过号) + /// 完成标志 (o=候诊 1=已呼 2=过号 3=放弃) /// public char CompleteFlag { get; set; } + + /// + /// 分诊过的项目,只取已呼人员 + /// + public List TriageAsbitemDetail { get; set; } = new List(); + } + + /// + /// 分诊项目 + /// + public class TriageAsbitemDetailDto + { + + /// + /// 组合项目名称 + /// + public string AsbitemName { get; set; } + + /// + /// 检查ID + /// + public Guid RegisterCheckId { get; set; } + + + + /// + /// 房间名称 + /// + public string RoomName { get; set; } + + /// + /// 状态(o=候诊 1=已呼 2=过号 ) + /// + public char? CompleteFlag { get; set; } + + /// + /// 是否放弃检查 Y=放弃 N=未放弃 + /// + public char IsGiveUp { get; set; } + + } } diff --git a/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/SmallProgramResultDto.cs b/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/SmallProgramResultDto.cs new file mode 100644 index 0000000..783bf6e --- /dev/null +++ b/src/Shentun.WebPeis.Application.Contracts/QueueRegisters/SmallProgramResultDto.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.WebPeis.QueueRegisters +{ + public class SmallProgramResultDto + { + public bool IsSuccess { get; set; } + } +} diff --git a/src/Shentun.WebPeis.Application/QueueRegisters/QueueRegisterAppService.cs b/src/Shentun.WebPeis.Application/QueueRegisters/QueueRegisterAppService.cs index 6e48d9f..57c25fb 100644 --- a/src/Shentun.WebPeis.Application/QueueRegisters/QueueRegisterAppService.cs +++ b/src/Shentun.WebPeis.Application/QueueRegisters/QueueRegisterAppService.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; using Shentun.WebPeis.Models; using Shentun.WebPeis.PatientRegisters; using Shentun.WebPeis.Persons; @@ -23,11 +24,14 @@ namespace Shentun.WebPeis.QueueRegisters public class QueueRegisterAppService : ApplicationService { private readonly IRepository _personRepository; + private readonly IConfiguration _configuration; + public QueueRegisterAppService( - IRepository personRepository - ) + IRepository personRepository, + IConfiguration configuration) { _personRepository = personRepository; + _configuration = configuration; } /// @@ -46,7 +50,41 @@ namespace Shentun.WebPeis.QueueRegisters throw new UserFriendlyException("人员不存在"); var appQueueRegisterPlugIns = new AppQueueRegisterPlugIns(); msg = await appQueueRegisterPlugIns.GetAppQueueRegisterByIdNoAsync(new IdNoInputDto { IdNo = personEnt.IdNo }); + + #region 转换图片 + string peisBaseUrl = _configuration.GetValue("Peis:PeisBaseUrl", ""); + if (!string.IsNullOrWhiteSpace(peisBaseUrl) && !string.IsNullOrWhiteSpace(msg.Photo)) + { + msg.Photo = await DataHelper.ConvertImageToBase64($"{peisBaseUrl}/{msg.Photo}"); + } + #endregion + return msg; } + + /// + /// 放弃项目 + /// + /// + /// + [HttpPost("api/app/QueueRegister/CreateGiveUpAsbitem")] + public async Task CreateGiveUpAsbitemAsync(CreateGiveUpAsbitemInputDto input) + { + var appQueueRegisterPlugIns = new AppQueueRegisterPlugIns(); + await appQueueRegisterPlugIns.CreateGiveUpAsbitemAsync(input); + } + + + /// + /// 创建新的项目分诊 + /// + /// + /// + [HttpPost("api/app/QueueRegister/CreateNewAsbitemTriage")] + public async Task CreateNewAsbitemTriageAsync(CreateNewAsbitemTriageInputDto input) + { + var appQueueRegisterPlugIns = new AppQueueRegisterPlugIns(); + await appQueueRegisterPlugIns.CreateNewAsbitemTriageAsync(input); + } } } diff --git a/src/Shentun.WebPeis.Domain/DataHelper.cs b/src/Shentun.WebPeis.Domain/DataHelper.cs index cacb75a..4755092 100644 --- a/src/Shentun.WebPeis.Domain/DataHelper.cs +++ b/src/Shentun.WebPeis.Domain/DataHelper.cs @@ -1,6 +1,10 @@ using System; using System.Collections.Generic; +using System.DrawingCore; +using System.DrawingCore.Imaging; +using System.IO; using System.Linq; +using System.Net.Http; using System.Text; using System.Threading.Tasks; using Volo.Abp; @@ -394,5 +398,33 @@ namespace Shentun.WebPeis } #endregion + + + #region 图片转base64 + + public static async Task ConvertImageToBase64(string imageUrl) + { + try + { + using (HttpClient client = new HttpClient()) + using (HttpResponseMessage response = await client.GetAsync(imageUrl)) + using (Stream inputStream = await response.Content.ReadAsStreamAsync()) + using (Bitmap bitmap = new Bitmap(inputStream)) + using (MemoryStream outputStream = new MemoryStream()) + { + bitmap.Save(outputStream, ImageFormat.Jpeg); // 选择适当的格式 + byte[] imageBytes = outputStream.ToArray(); + + string base64String = Convert.ToBase64String(imageBytes); + return base64String; + } + } + catch (Exception ex) + { + return ""; + } + } + + #endregion } }