修改缓存,删除限制
continuous-integration/drone/push Build is passing Details

Test_HIR_Net8
hang 2025-08-27 14:21:39 +08:00
parent 4de4e36e73
commit ed2a777fd4
2 changed files with 14 additions and 0 deletions

View File

@ -23,6 +23,7 @@ using SixLabors.ImageSharp.Formats.Jpeg;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Infrastructure.Extention;
using Newtonsoft.Json;
using FellowOakDicom.Imaging.Codec;
namespace IRaCIS.Core.SCP.Service
{
@ -325,6 +326,9 @@ namespace IRaCIS.Core.SCP.Service
{
await request.File.SaveAsync(ms);
//irc 从路径最后一截取Guid
storeRelativePath = await ossService.UploadToOSSAsync(ms, ossFolderPath, instanceId.ToString(), false);

View File

@ -153,6 +153,11 @@ namespace IRaCIS.Application.Services
var entity = await _hIRHospitalRepository.InsertOrUpdateAsync(addOrEditHIRHospital, true, exp, exp2);
var hospitalInfo = await _hIRHospitalRepository.Where(t => t.IsDefault == true).FirstNotNullAsync();
//更新了联网信息,也要变更缓存是否可以联网,防止修改
await _fusionCache.SetAsync(CacheKeys.Hospital, hospitalInfo, TimeSpan.FromDays(7));
return ResponseOutput.Ok(entity.Id.ToString());
}
@ -161,6 +166,11 @@ namespace IRaCIS.Application.Services
[HttpDelete("{hIRHospitalId:guid}")]
public async Task<IResponseOutput> DeleteHIRHospital(Guid hIRHospitalId)
{
if (_hIRHospitalRepository.Any(t => t.Id == hIRHospitalId && t.IsDefault == true))
{
return ResponseOutput.NotOk(_localizer["Patient_CannotDeleteDefaultHospital"]);
}
var success = await _hIRHospitalRepository.DeleteFromQueryAsync(t => t.Id == hIRHospitalId, true);
return ResponseOutput.Ok();