Browse Source

0821

master
wxd 2 years ago
parent
commit
6f2adbe8c1
  1. 5
      src/Shentun.Peis.Application.Contracts/PatientRegisters/GetListInSearchDto.cs
  2. 41
      src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/InstrumentMappingDto.cs
  3. 9
      src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs
  4. 196
      src/Shentun.Peis.Application/LisRequests/LisRequestAppService.cs
  5. 23
      src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
  6. 9
      src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
  7. 93
      src/Shentun.Peis.Application/RegisterCheckPictures/RegisterCheckPictureAppService.cs
  8. 4
      src/Shentun.Peis.DbMigrator/appsettings.json
  9. 4
      src/Shentun.Peis.Domain/ImageHelper.cs
  10. 6
      src/Shentun.Peis.Domain/RegisterCheckPictures/RegisterCheckPicture.cs
  11. 1
      src/Shentun.Peis.EntityFrameworkCore/DbMapping/RegisterCheckPictures/RegisterCheckPictureDbMapping.cs
  12. 15439
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240820094537_insert_register_check_picture_local_path_name.Designer.cs
  13. 26
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240820094537_insert_register_check_picture_local_path_name.cs
  14. 5
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
  15. 10
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
  16. 5
      src/Shentun.Peis.HttpApi.Host/appsettings.json

5
src/Shentun.Peis.Application.Contracts/PatientRegisters/GetListInSearchDto.cs

@ -20,6 +20,11 @@ namespace Shentun.Peis.PatientRegisters
public Guid? CustomerOrgRegisterId { get; set; }
/// <summary>
/// 单位分组
/// </summary>
public List<Guid> CustomerOrgGroupIds { get; set; } = new List<Guid>();
/// <summary>
/// 姓名
/// </summary>

41
src/Shentun.Peis.Application.Contracts/RegisterCheckPictures/InstrumentMappingDto.cs

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Shentun.Peis.RegisterCheckPictures
{
public class InstrumentMappingDto
{
/// <summary>
/// 检查单ID
/// </summary>
public Guid RegisterCheckId { get; set; }
/// <summary>
/// 图片
/// </summary>
public List<InstrumentMappingDetailDto> PictureBaseStrs { get; set; } = new List<InstrumentMappingDetailDto>() { };
/// <summary>
/// 图片文件类型 0-仪器图片,1-报告文件
/// </summary>
public char PictureFileType { get; set; } = '0';
}
public class InstrumentMappingDetailDto
{
/// <summary>
/// 图片名称
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 本地路径
/// </summary>
public string LocalPathName { get; set; }
public string PictureBaseStr { get; set; }
}
}

9
src/Shentun.Peis.Application/ImportLisResults/ImportLisResultAppService.cs

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using NPOI.SS.Formula.Functions;
using NPOI.Util;
@ -732,10 +733,18 @@ namespace Shentun.Peis.ImportLisResults
if (input.BarcodeMode == '0')
{
if (await _patientRegisterRepository.CountAsync(f => f.PatientRegisterNo == input.BarCode) == 0)
throw new UserFriendlyException($"条码号{input.BarCode}不正确");
await ImportResultByPatientRegisterNoAsync(inputDtoList);
}
else if (input.BarcodeMode == '1')
{
var isBarCode = await (from registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync()
join lisRequest in await _lisRequestRepository.GetQueryableAsync() on registerCheckAsbitem.LisRequestId equals lisRequest.Id
where lisRequest.LisRequestNo == input.BarCode
select lisRequest.LisRequestNo).CountAsync();
if (isBarCode == 0)
throw new UserFriendlyException($"条码号{input.BarCode}不正确");
await ImportResultAsync(inputDtoList);
}
}

196
src/Shentun.Peis.Application/LisRequests/LisRequestAppService.cs

@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query.Internal;
using Org.BouncyCastle.Asn1.Ocsp;
using Shentun.Peis.CustomerOrgs;
using Shentun.Peis.Enums;
@ -20,6 +21,7 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
using Volo.Abp.Uow;
using Volo.Abp.Users;
namespace Shentun.Peis.LisRequests
@ -49,6 +51,7 @@ namespace Shentun.Peis.LisRequests
private readonly IRepository<SampleType, Guid> _sampleTypeRepository;
private readonly IRepository<LisRequest, Guid> _lisRequestRepository;
private readonly SysParmValueManager _sysParmValueManager;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public LisRequestAppService(
IRepository<IdentityUser, Guid> userRepository,
IRepository<PatientRegister, Guid> patientRegisterRepository,
@ -65,10 +68,10 @@ namespace Shentun.Peis.LisRequests
IRepository<SampleType, Guid> sampleTypeRepository,
IRepository<SampleGroup, Guid> sampleGroupRepository,
IRepository<SampleGroupDetail> sampleGroupDetailRepository,
IRepository<ItemType, Guid> itemTypeRepository
,
IRepository<ItemType, Guid> itemTypeRepository,
IRepository<LisRequest, Guid> lisRequestRepository,
SysParmValueManager sysParmValueManager)
SysParmValueManager sysParmValueManager,
IUnitOfWorkManager unitOfWorkManager)
{
this._userRepository = userRepository;
this._patientRegisterRepository = patientRegisterRepository;
@ -88,6 +91,7 @@ namespace Shentun.Peis.LisRequests
_itemTypeRepository = itemTypeRepository;
_lisRequestRepository = lisRequestRepository;
_sysParmValueManager = sysParmValueManager;
_unitOfWorkManager = unitOfWorkManager;
}
[HttpPost("api/app/LisRequest/GetListInFilter")]
@ -622,96 +626,130 @@ namespace Shentun.Peis.LisRequests
lisRequestNoPrintMode = "0";
Guid patientRegisterId;
if (lisRequestNoPrintMode == "0")
{
patientRegisterId = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
join lisRequest in await _lisRequestRepository.GetQueryableAsync() on registerCheckAsbitem.LisRequestId equals lisRequest.Id
where lisRequest.LisRequestNo == input.LisRequestNo
select patientRegister.Id).FirstOrDefault();
}
else
{
patientRegisterId = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
where patientRegister.PatientRegisterNo == input.LisRequestNo
select patientRegister.Id).FirstOrDefault();
}
var query = (from lisRequest in await _lisRequestRepository.GetQueryableAsync()
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on lisRequest.Id equals registerCheckAsbitem.LisRequestId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on registerCheckAsbitem.RegisterCheckId equals registerCheck.Id
join patientRegister in await _patientRegisterRepository.GetQueryableAsync() on registerCheck.PatientRegisterId equals patientRegister.Id
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
where lisRequest.LisRequestNo == input.LisRequestNo
select new
{
lisRequest,
registerCheckAsbitem,
asbitem,
registerCheck,
patientRegister,
patient
}).ToList();
if (query.Count == 0)
{
throw new UserFriendlyException("检验单号不存在");
}
if (patientRegisterId == Guid.Empty)
{
throw new UserFriendlyException("条码不正确");
}
var patientRegisterGroup = query.GroupBy(g => g.patientRegister);
//生成LIS条码
var lisRequests = await _lisRequestManager.SetLisRequestAsync(patientRegisterId);
await _unitOfWorkManager.Current.SaveChangesAsync();
await _unitOfWorkManager.Current.CompleteAsync();
var resultDto = new LisPatientRegisterDto
using (var uow = _unitOfWorkManager.Begin(
requiresNew: false, isTransactional: false
))
{
if (lisRequestNoPrintMode == "0")
{
Age = patientRegisterGroup.FirstOrDefault().Key.Age,
LisRequestNo = input.LisRequestNo,
PatientName = patientRegisterGroup.FirstOrDefault().Key.PatientName,
SexName = _cacheService.GetSexNameAsync(patientRegisterGroup.FirstOrDefault().Key.SexId).Result,
SampleTypeName = _cacheService.GetSampleTypeNameAsync(patientRegisterGroup.FirstOrDefault().FirstOrDefault().lisRequest.SampleTypeId).Result,
AsbitemDetail = patientRegisterGroup.FirstOrDefault().Select(ss => new LisPatientRegisterDetailDto
var query = (from lisRequest in await _lisRequestRepository.GetQueryableAsync()
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on lisRequest.Id equals registerCheckAsbitem.LisRequestId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on registerCheckAsbitem.RegisterCheckId equals registerCheck.Id
join patientRegister in await _patientRegisterRepository.GetQueryableAsync() on registerCheck.PatientRegisterId equals patientRegister.Id
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
where lisRequest.LisRequestNo == input.LisRequestNo
select new
{
lisRequest,
registerCheckAsbitem,
asbitem,
registerCheck,
patientRegister,
patient
}).ToList();
if (query.Count == 0)
{
AsbitemId = ss.registerCheckAsbitem.AsbitemId,
AsbitemName = ss.asbitem.DisplayName,
AsbitemPrice = ss.registerCheckAsbitem.ChargePrice * ss.registerCheckAsbitem.Amount
}).ToList()
};
throw new UserFriendlyException("检验单号不存在");
}
return resultDto;
}
else
{
//人员条码模式
var query = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
join registerCheck in await _registerCheckRepository.GetQueryableAsync()
on patientRegister.Id equals registerCheck.PatientRegisterId
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync()
on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
join lisRequest in await _lisRequestRepository.GetQueryableAsync() on registerCheckAsbitem.LisRequestId equals lisRequest.Id
where patientRegister.PatientRegisterNo == input.LisRequestNo
select new
{
registerCheckAsbitem,
asbitem,
registerCheck,
patientRegister,
patient,
lisRequest
}).ToList();
if (query.Count == 0)
{
throw new UserFriendlyException("人员条码号不存在");
}
var patientRegisterGroup = query.GroupBy(g => g.patientRegister);
var patientRegisterGroup = query.GroupBy(g => g.patientRegister);
var resultDto = new LisPatientRegisterDto
{
Age = patientRegisterGroup.FirstOrDefault().Key.Age,
LisRequestNo = input.LisRequestNo,
PatientName = patientRegisterGroup.FirstOrDefault().Key.PatientName,
SexName = _cacheService.GetSexNameAsync(patientRegisterGroup.FirstOrDefault().Key.SexId).Result,
SampleTypeName = _cacheService.GetSampleTypeNameAsync(patientRegisterGroup.FirstOrDefault().FirstOrDefault().lisRequest.SampleTypeId).Result,
AsbitemDetail = patientRegisterGroup.FirstOrDefault().Select(ss => new LisPatientRegisterDetailDto
{
AsbitemId = ss.registerCheckAsbitem.AsbitemId,
AsbitemName = ss.asbitem.DisplayName,
AsbitemPrice = ss.registerCheckAsbitem.ChargePrice * ss.registerCheckAsbitem.Amount
}).ToList()
};
var resultDto = new LisPatientRegisterDto
return resultDto;
}
else
{
Age = patientRegisterGroup.FirstOrDefault().Key.Age,
LisRequestNo = input.LisRequestNo,
PatientName = patientRegisterGroup.FirstOrDefault().Key.PatientName,
SexName = _cacheService.GetSexNameAsync(patientRegisterGroup.FirstOrDefault().Key.SexId).Result,
SampleTypeName = _cacheService.GetSampleTypeNameAsync(patientRegisterGroup.FirstOrDefault().FirstOrDefault().lisRequest.SampleTypeId).Result,
AsbitemDetail = patientRegisterGroup.FirstOrDefault().Select(ss => new LisPatientRegisterDetailDto
//人员条码模式
var query = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join patient in await _patientRepository.GetQueryableAsync() on patientRegister.PatientId equals patient.Id
join registerCheck in await _registerCheckRepository.GetQueryableAsync()
on patientRegister.Id equals registerCheck.PatientRegisterId
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync()
on registerCheck.Id equals registerCheckAsbitem.RegisterCheckId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
join lisRequest in await _lisRequestRepository.GetQueryableAsync() on registerCheckAsbitem.LisRequestId equals lisRequest.Id
where patientRegister.PatientRegisterNo == input.LisRequestNo
select new
{
registerCheckAsbitem,
asbitem,
registerCheck,
patientRegister,
patient,
lisRequest
}).ToList();
if (query.Count == 0)
{
AsbitemId = ss.registerCheckAsbitem.AsbitemId,
AsbitemName = ss.asbitem.DisplayName,
AsbitemPrice = ss.registerCheckAsbitem.ChargePrice * ss.registerCheckAsbitem.Amount
}).ToList()
};
throw new UserFriendlyException("人员条码号不存在");
}
var patientRegisterGroup = query.GroupBy(g => g.patientRegister);
return resultDto;
var resultDto = new LisPatientRegisterDto
{
Age = patientRegisterGroup.FirstOrDefault().Key.Age,
LisRequestNo = input.LisRequestNo,
PatientName = patientRegisterGroup.FirstOrDefault().Key.PatientName,
SexName = _cacheService.GetSexNameAsync(patientRegisterGroup.FirstOrDefault().Key.SexId).Result,
SampleTypeName = _cacheService.GetSampleTypeNameAsync(patientRegisterGroup.FirstOrDefault().FirstOrDefault().lisRequest.SampleTypeId).Result,
AsbitemDetail = patientRegisterGroup.FirstOrDefault().Select(ss => new LisPatientRegisterDetailDto
{
AsbitemId = ss.registerCheckAsbitem.AsbitemId,
AsbitemName = ss.asbitem.DisplayName,
AsbitemPrice = ss.registerCheckAsbitem.ChargePrice * ss.registerCheckAsbitem.Amount
}).ToList()
};
return resultDto;
}
}
}
}
}

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

@ -460,7 +460,7 @@ namespace Shentun.Peis.PatientRegisters
{
var customerOrgList = await _customerOrgRepository.GetListAsync();
Stopwatch stopwatch = Stopwatch.StartNew();
#region MyRegion
var entlist = from patientRegister in (await _repository.GetQueryableAsync()).Include(x => x.Patient).AsQueryable()
@ -534,20 +534,20 @@ namespace Shentun.Peis.PatientRegisters
{
entlist = entlist.Where(m => m.patientRegister.CustomerOrgRegisterId == input.CustomerOrgRegisterId);
}
#endregion
stopwatch.Stop();
if (input.CustomerOrgGroupIds.Any())
{
entlist = entlist.Where(m => m.patientRegister.CustomerOrgGroupId != null && input.CustomerOrgGroupIds.Contains(m.patientRegister.CustomerOrgGroupId.Value));
}
#endregion
_logger.LogInformation($"stopwatch耗时:{stopwatch.ElapsedMilliseconds}");
Stopwatch stopwatch2 = Stopwatch.StartNew();
int totalCount = entlist.Count();
entlist = entlist.OrderByDescending(o => o.patientRegister.CompleteFlag).ThenBy(o => o.patientRegister.Id).Skip(input.SkipCount * input.MaxResultCount).Take(input.MaxResultCount);
stopwatch2.Stop();
_logger.LogInformation($"stopwatch2耗时:{stopwatch.ElapsedMilliseconds}");
var entdto = entlist.Select(s => new PatientRegisterOrNoDto
{
@ -631,14 +631,7 @@ namespace Shentun.Peis.PatientRegisters
return new PagedResultDto<PatientRegisterOrNoDto>(totalCount, entdto);
//return entdto;
//stopwatch.Stop();
//var s2 = stopwatch.ElapsedMilliseconds;
//return entdto.Take(100).ToList();
}

9
src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs

@ -302,7 +302,7 @@ namespace Shentun.Peis.PrintReports
requiresNew: false, isTransactional: false
))
{
var query = (from patient in await _patientRepository.GetQueryableAsync()
var query2 = (from patient in await _patientRepository.GetQueryableAsync()
join patientRegister in await _patientRegisterRepository.GetQueryableAsync()
on patient.Id equals patientRegister.PatientId
join sex in await _sexRegisterRepository.GetQueryableAsync() on patientRegister.SexId equals sex.Id
@ -332,7 +332,12 @@ namespace Shentun.Peis.PrintReports
sampleGroupName = sampleGroupHaveEmpty != null ? sampleGroupHaveEmpty.DisplayName : "",
samplePrintCount = sampleGroupHaveEmpty != null ? sampleGroupHaveEmpty.SamplePrintCount : 0
}
).ToList();
);
var ggg = query2.ToQueryString();
var query = query2.ToList();
lisRequests = query.Select(o => o.lisRequest).Distinct().ToList();
//发送第三方LIS申请
if (lisRequests != null)

93
src/Shentun.Peis.Application/RegisterCheckPictures/RegisterCheckPictureAppService.cs

@ -149,6 +149,7 @@ namespace Shentun.Peis.RegisterCheckPictures
Random rd = new Random();
string AbsolutePath = _configuration.GetValue<string>("VirtualPath:RealPath");
string AbsoluteName = _configuration.GetValue<string>("VirtualPath:Alias");
List<string> msg = new List<string>();
@ -188,7 +189,7 @@ namespace Shentun.Peis.RegisterCheckPictures
// PicName + "_" + (input.PictureBaseStrs.IndexOf(item) + 1));
string PictureUrl = ImageHelper.Base64StrToImageInAbsolutePath(AbsolutePath, item.FileName, item.PictureBaseStr,
PatientRegisterId,
input.RegisterCheckId.ToString());
input.RegisterCheckId.ToString(), AbsoluteName);
if (string.IsNullOrEmpty(PictureUrl))
{
@ -458,5 +459,95 @@ namespace Shentun.Peis.RegisterCheckPictures
}
/// <summary>
/// 仪器采图接口
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("api/app/RegisterCheckPicture/InstrumentMapping")]
public async Task<List<string>> InstrumentMappingAsync(InstrumentMappingDto input)
{
Random rd = new Random();
string AbsolutePath = _configuration.GetValue<string>("PacsVirtualPath:RealPath");
string AbsoluteName = _configuration.GetValue<string>("PacsVirtualPath:Alias");
List<string> msg = new List<string>();
if (!input.PictureBaseStrs.Any())
{
throw new UserFriendlyException("请求参数有误");
}
string PatientRegisterId = "";
var patientRegisterCompleteFlag = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync()
join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId
where registerCheck.Id == input.RegisterCheckId
select new
{
CompleteFlag = patientRegister.CompleteFlag
}).ToList();
if (patientRegisterCompleteFlag.Count == 0)
throw new UserFriendlyException("体检人员不存在");
if (patientRegisterCompleteFlag.FirstOrDefault().CompleteFlag == PatientRegisterCompleteFlag.PreRegistration)
throw new UserFriendlyException("预登记人员不能导入图片");
if (patientRegisterCompleteFlag.FirstOrDefault().CompleteFlag == PatientRegisterCompleteFlag.SumCheck)
throw new UserFriendlyException("已总检人员不能导入图片");
List<RegisterCheckPicture> entlist_insert = new List<RegisterCheckPicture>();
foreach (var item in input.PictureBaseStrs)
{
string PictureUrl = ImageHelper.Base64StrToImageInAbsolutePath(AbsolutePath, item.FileName, item.PictureBaseStr,
PatientRegisterId,
input.RegisterCheckId.ToString(), AbsoluteName);
if (string.IsNullOrEmpty(PictureUrl))
{
throw new UserFriendlyException("图片数据有误");
}
var ent = await _registerCheckPictureRepository.FirstOrDefaultAsync(m => m.RegisterCheckId == input.RegisterCheckId
&& m.PictureFilename == PictureUrl);
if (ent != null)
{
ent.PictureFilename = PictureUrl;
await _registerCheckPictureRepository.UpdateAsync(ent);
}
else
{
ent = new RegisterCheckPicture
{
DisplayOrder = input.PictureBaseStrs.IndexOf(item) + 1,
IsPrint = 'Y',
PictureFilename = PictureUrl,
RegisterCheckId = input.RegisterCheckId,
PictureFileType = input.PictureFileType,
LocalPathName = item.LocalPathName
};
await _registerCheckPictureRepository.InsertAsync(ent);
}
msg.Add(PictureUrl);
}
return msg;
}
}
}

4
src/Shentun.Peis.DbMigrator/appsettings.json

@ -1,7 +1,7 @@
{
"ConnectionStrings": {
"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
//"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeisTemp;User ID=postgres;Password=shentun123;"
//"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
//"Default": "Host=localhost;Port=5432;Database=ShentunPeis1218;User ID=postgres;Password=wxd123;"
//"Default": "Host=10.1.12.140;Port=5432;Database=ShentunPeis0508;User ID=postgres;Password=st123;"
},

4
src/Shentun.Peis.Domain/ImageHelper.cs

@ -191,7 +191,7 @@ namespace Shentun.Peis
/// <param name="PatientRegisterId">登记ID 作为目录</param>
/// <param name="RegisterCheckId">检查ID 作为目录</param>
/// <returns></returns>
public static string Base64StrToImageInAbsolutePath(string AbsolutePath, string fileName, string base64Str, string PatientRegisterId, string RegisterCheckId)
public static string Base64StrToImageInAbsolutePath(string AbsolutePath, string fileName, string base64Str, string PatientRegisterId, string RegisterCheckId,string AbsoluteName= "CheckPictureImg")
{
var ret = "";
@ -227,7 +227,7 @@ namespace Shentun.Peis
string savaDirectory = $"{AbsolutePath}\\pacs\\{DateTime.Now.Year}\\{DateTime.Now.Month}\\{DateTime.Now.Day}\\{PatientRegisterId}\\{RegisterCheckId}";
savePath = $"{savaDirectory}\\{fileName + ImageSuffix}";
hostPath = $"/CheckPictureImg/pacs/{DateTime.Now.Year}/{DateTime.Now.Month}/{DateTime.Now.Day}/{PatientRegisterId}/{RegisterCheckId}/{fileName + ImageSuffix}";
hostPath = $"/{AbsoluteName}/pacs/{DateTime.Now.Year}/{DateTime.Now.Month}/{DateTime.Now.Day}/{PatientRegisterId}/{RegisterCheckId}/{fileName + ImageSuffix}";
if (!Directory.Exists(savaDirectory))

6
src/Shentun.Peis.Domain/RegisterCheckPictures/RegisterCheckPicture.cs

@ -40,6 +40,12 @@ namespace Shentun.Peis.Models
[Column("picture_file_type")]
[MaxLength(1)]
public char PictureFileType { get; set; }
/// <summary>
/// 本地资源路径
/// </summary>
[Column("local_path_name")]
public string LocalPathName { get; set; }
/// <summary>
/// 显示顺序
/// </summary>

1
src/Shentun.Peis.EntityFrameworkCore/DbMapping/RegisterCheckPictures/RegisterCheckPictureDbMapping.cs

@ -34,6 +34,7 @@ namespace Shentun.Peis.DbMapping
entity.Property(e => e.PictureFileType).HasComment("图片文件类型").HasDefaultValueSql("'0'");
entity.Property(e => e.LocalPathName).HasComment("本地资源路径");
entity.HasOne(d => d.RegisterCheck)
.WithMany(p => p.RegisterCheckPictures)

15439
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240820094537_insert_register_check_picture_local_path_name.Designer.cs
File diff suppressed because it is too large
View File

26
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240820094537_insert_register_check_picture_local_path_name.cs

@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class insert_register_check_picture_local_path_name : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "local_path_name",
table: "register_check_picture",
type: "text",
nullable: true,
comment: "本地资源路径");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "local_path_name",
table: "register_check_picture");
}
}
}

5
src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -9037,6 +9037,11 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid")
.HasColumnName("last_modifier_id");
b.Property<string>("LocalPathName")
.HasColumnType("text")
.HasColumnName("local_path_name")
.HasComment("本地资源路径");
b.Property<char>("PictureFileType")
.ValueGeneratedOnAdd()
.HasMaxLength(1)

10
src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

@ -199,6 +199,9 @@ public class PeisHttpApiHostModule : AbpModule
//虚拟目录
context.Services.AddSingleton(new MyFileProvider(configuration["VirtualPath:RealPath"], configuration["VirtualPath:Alias"]));
//Pacs虚拟目录
context.Services.AddSingleton(new MyFileProvider(configuration["PacsVirtualPath:RealPath"], configuration["PacsVirtualPath:Alias"]));
/*
Configure<AbpAspNetCoreMvcOptions>(options =>
{
@ -551,6 +554,13 @@ public class PeisHttpApiHostModule : AbpModule
RequestPath = configuration["VirtualPath:RequestPath"]
});
//pacs虚拟目录
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(configuration["PacsVirtualPath:RealPath"]),
RequestPath = configuration["PacsVirtualPath:RequestPath"]
});
app.UseRouting();
app.UseCors();

5
src/Shentun.Peis.HttpApi.Host/appsettings.json

@ -39,6 +39,11 @@
"RequestPath": "/CheckPictureImg",
"Alias": "CheckPictureImg"
},
"PacsVirtualPath": {
"RealPath": "F:\\testimg",
"RequestPath": "/PacsCheckPictureImg",
"Alias": "PacsCheckPictureImg"
},
"AdminId": "3a11fe49-5719-0e9e-dd44-0c4aff0900b0",
//"AdminId": "3a0c4180-107c-0c89-b25b-0bd34666dcec",
"PeisReportPdfPath": "E:\\mypeis\\PeisReportPdf\\",

Loading…
Cancel
Save