Browse Source

1117

master
wxd 4 weeks ago
parent
commit
0b406d5c27
  1. 14
      src/Shentun.Peis.Application.Contracts/PatientRegisters/BatchRecoverGuideByPatientRegisterNoInputDto.cs
  2. 2
      src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs
  3. 4
      src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs
  4. 21
      src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
  5. 54
      src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs
  6. 15
      src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs
  7. 28
      src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs

14
src/Shentun.Peis.Application.Contracts/PatientRegisters/BatchRecoverGuideByPatientRegisterNoInputDto.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.PatientRegisters
{
public class BatchRecoverGuideByPatientRegisterNoInputDto
{
/// <summary>
/// 条码号集合
/// </summary>
public List<string> PatientRegisterNos { get; set; } = new List<string>();
}
}

2
src/Shentun.Peis.Application/CCTJExportDatas/CCTJExportDataAppService.cs

@ -3414,7 +3414,7 @@ namespace Shentun.Peis.CCTJExportDatas
{
Guid tempRegisterCheckPictureId = GuidGenerator.Create();
var fileName = checkPictureRow["picture_filename"].ToString();
fileName = fileName.Replace("\\\\192.168.0.3", "");
fileName = fileName.Replace("\\\\192.168.0.3", "").Replace(@"\", "/").Replace("//", "/");
var tempRegisterCheckPicture = new RegisterCheckPicture(tempRegisterCheckPictureId)
{
DisplayOrder = dt_check_picture.Rows.IndexOf(checkPictureRow) + 1,

4
src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs

@ -36,6 +36,7 @@ using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
using Volo.Abp.Security.Claims;
@ -235,6 +236,7 @@ namespace Shentun.Peis.PacsBusiness
/// <param name="input"></param>
/// <returns></returns>Result
/// <exception cref="UserFriendlyException"></exception>
[DisableAuditing]
[HttpPost("api/app/PacsBusiness/ImportElectrocardiogramPictureByPatientRegisterNo")]
public async Task ImportElectrocardiogramPictureByPatientRegisterNoAsync(ImportElectrocardiogramPictureByPatientRegisterNoInputDto input)
{
@ -347,6 +349,7 @@ namespace Shentun.Peis.PacsBusiness
/// <returns></returns>Result
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("api/app/PacsBusiness/ImportElectrocardiogramResultByPatientRegisterNo")]
[DisableAuditing]
public async Task ImportElectrocardiogramResultByPatientRegisterNoAsync(ImportElectrocardiogramResultByPatientRegisterNoInputDto input)
{
Random rd = new Random();
@ -462,6 +465,7 @@ namespace Shentun.Peis.PacsBusiness
/// <returns></returns>Result
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("api/app/PacsBusiness/ImportDeviceReportFileByPatientRegisterNo")]
[DisableAuditing]
public async Task ImportDeviceReportFileByPatientRegisterNoAsync(ImportDeviceReportFileByPatientRegisterNoInputDto input)
{
Random rd = new Random();

21
src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs

@ -2346,6 +2346,27 @@ namespace Shentun.Peis.PatientRegisters
return msg;
}
/// <summary>
/// 批量回收指引单 根据条码号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("api/app/PatientRegister/BatchRecoverGuideByPatientRegisterNo")]
public async Task BatchRecoverGuideByPatientRegisterNoAsync(BatchRecoverGuideByPatientRegisterNoInputDto input)
{
if (!input.PatientRegisterNos.Any())
throw new UserFriendlyException("条码号不能为空");
foreach (var patientRegisterNo in input.PatientRegisterNos)
{
var patientRegister = await _repository.FirstOrDefaultAsync(f => f.PatientRegisterNo == patientRegisterNo);
await _patientRegisterManager.BatchRecoverGuideByPatientRegisterNoAsync(patientRegister);
}
}
///// <summary>
///// 人员签到
///// </summary>

54
src/Shentun.Peis.Application/TransToWebPeis/TransToWebPeisAppService.cs

@ -67,6 +67,7 @@ namespace Shentun.Peis.TransToWebPeis
private readonly IConfiguration _configuration;
private readonly IRepository<Patient, Guid> _patientRepository;
private readonly ThirdBookingPushAppService _thirdBookingPushAppService;
private readonly CacheService _cacheService;
private readonly SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
{
@ -103,7 +104,8 @@ namespace Shentun.Peis.TransToWebPeis
PrintReportAppService printReportAppService,
IConfiguration configuration,
IRepository<Patient, Guid> patientRepository,
ThirdBookingPushAppService thirdBookingPushAppService)
ThirdBookingPushAppService thirdBookingPushAppService,
CacheService cacheService)
{
_itemTypeRepository = itemTypeRepository;
_logger = logger;
@ -125,6 +127,7 @@ namespace Shentun.Peis.TransToWebPeis
_configuration = configuration;
_patientRepository = patientRepository;
_thirdBookingPushAppService = thirdBookingPushAppService;
_cacheService = cacheService;
}
@ -506,13 +509,39 @@ namespace Shentun.Peis.TransToWebPeis
var itemTypes = await _itemTypeRepository.GetListAsync();
if (itemTypes.Count > 0)
{
var isMedicalReportTypeId = WebDb.Ado.GetInt(@" SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = 'item_type'
AND column_name = 'medical_report_type_id'");
foreach (var itemType in itemTypes)
{
await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id) " +
"VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id);",
new List<SugarParameter>() {
if (isMedicalReportTypeId > 0)
{
await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id,medical_report_type_id) " +
"VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id,@medical_report_type_id);",
new List<SugarParameter>() {
new SugarParameter("@item_type_id",itemType.Id),
new SugarParameter("@item_type_name",itemType.DisplayName),
new SugarParameter("@simple_code",itemType.SimpleCode),
new SugarParameter("@parent_id",itemType.ParentId),
new SugarParameter("@path_code",itemType.PathCode),
new SugarParameter("@check_type_flag",itemType.CheckTypeFlag),
new SugarParameter("@display_order",itemType.DisplayOrder),
new SugarParameter("@is_wrap",itemType.IsWrap),
new SugarParameter("@concurrency_stamp",itemType.ConcurrencyStamp),
new SugarParameter("@creation_time",itemType.CreationTime),
new SugarParameter("@creator_id",itemType.CreatorId),
new SugarParameter("@last_modification_time",itemType.LastModificationTime),
new SugarParameter("@last_modifier_id",itemType.LastModifierId),
new SugarParameter("@medical_report_type_id",itemType.MedicalReportTypeId)
});
}
else
{
await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id) " +
"VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id);",
new List<SugarParameter>() {
new SugarParameter("@item_type_id",itemType.Id),
new SugarParameter("@item_type_name",itemType.DisplayName),
new SugarParameter("@simple_code",itemType.SimpleCode),
@ -526,7 +555,8 @@ namespace Shentun.Peis.TransToWebPeis
new SugarParameter("@creator_id",itemType.CreatorId),
new SugarParameter("@last_modification_time",itemType.LastModificationTime),
new SugarParameter("@last_modifier_id",itemType.LastModifierId)
});
});
}
}
_logger.LogInformation($"项目类别数据处理完毕,数量{itemTypes.Count}");
@ -1079,6 +1109,16 @@ namespace Shentun.Peis.TransToWebPeis
foreach (var registerCheckWithDetail in registerCheckWithDetails)
{
var checkDoctorIdConvert = registerCheckWithDetail.CheckDoctorId;
if (!string.IsNullOrWhiteSpace(checkDoctorIdConvert))
{
if (Guid.TryParse(checkDoctorIdConvert, out var checkDoctorIdGuid))
{
checkDoctorIdConvert = await _cacheService.GetSurnameAsync(checkDoctorIdGuid);
}
}
#region register_check
await WebDb.Ado.ExecuteCommandAsync("INSERT INTO public.register_check(register_check_id, patient_register_id, check_request_no, third_info, complete_flag, critical_value, critical_value_flag, critical_value_process_content," +
"critical_value_process_flag, critical_value_process_doctor, critical_value_process_date, critical_value_create_date, check_doctor_id, check_date, is_audit," +
@ -1099,7 +1139,7 @@ namespace Shentun.Peis.TransToWebPeis
new SugarParameter("critical_value_process_doctor",""),
new SugarParameter("critical_value_process_date",null),
new SugarParameter("critical_value_create_date",null),
new SugarParameter("check_doctor_id",registerCheckWithDetail.CheckDoctorId),
new SugarParameter("check_doctor_id",checkDoctorIdConvert),
new SugarParameter("check_date",registerCheckWithDetail.CheckDate),
new SugarParameter("is_audit",registerCheckWithDetail.IsAudit),
new SugarParameter("auditor_user_id",registerCheckWithDetail.AuditorUserId),

15
src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs

@ -23,6 +23,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
using Volo.Abp.Guids;
@ -1212,6 +1213,20 @@ namespace Shentun.Peis.PatientRegisters
}
}
/// <summary>
/// 回收表格
/// </summary>
/// <param name="PatientRegisterId">登记表ID</param>
/// <returns></returns>
public async Task BatchRecoverGuideByPatientRegisterNoAsync(PatientRegister patientRegister)
{
if (patientRegister != null)
{
patientRegister.IsRecoverGuide = 'Y';
await _repository.UpdateAsync(patientRegister);
}
}
private bool IsParmNotNUll(object obj)
{
if (obj == null)

28
src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs

@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
@ -7,9 +9,12 @@ using Shentun.Peis.Filter;
using Shentun.WebApi.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
namespace Shentun.Peis
@ -34,9 +39,24 @@ namespace Shentun.Peis
//异常日志记录
string error = string.Empty;
ReadException(exceptionContext.Exception, ref error);
//LogHelper.Logger.LogError(error);
_logger.LogError("异常:" + error + Environment.NewLine + "异常堆栈:" + exceptionContext.Exception.StackTrace
);
bool isWriteLog = true;
if (exceptionContext.ActionDescriptor is ControllerActionDescriptor actionDescriptor)
{
// 1. 先检查方法上的特性
var methodAttribute = actionDescriptor.MethodInfo
.GetCustomAttributes<DisableAuditingAttribute>(inherit: true)
.FirstOrDefault();
if (methodAttribute != null)
{
isWriteLog = false;
}
}
if (isWriteLog)
_logger.LogError("异常:" + error + Environment.NewLine + "异常堆栈:" + exceptionContext.Exception.StackTrace
);
//处理异常信息
string errorMessage;
@ -89,7 +109,7 @@ namespace Shentun.Peis
List<string> filterApiUrl = new List<string> { "/api/third/thirdpartypublicinterface/getpatientitems", "api/third/thirdpartypublicinterface/updatechecknostate" };
if (filterApiUrl.Contains(exceptionContext.HttpContext.Request.Path.ToString().ToLower()))
{
ThirdReturn msg = new ThirdReturn

Loading…
Cancel
Save