修改
continuous-integration/drone/push Build is passing Details

Test_HIR_Net8
he 2025-04-03 09:57:37 +08:00
parent 5874223866
commit 913084cc8d
1 changed files with 31 additions and 30 deletions

View File

@ -768,7 +768,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
#region 新
try
{
url= url.Replace(_options.CurrentValue.MinIO.ViewEndpoint, "");
if (!string.IsNullOrWhiteSpace(url))
{
string[] strArry = url.Split('/');
@ -789,37 +789,38 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
#region 之前
try
{
HttpClient httpClient = new HttpClient();
if (!string.IsNullOrWhiteSpace(url))
{
string[] strArry = url.Split('/');
savePath = savePath + "/" + strArry[strArry.Length - 1];
}
// 之前需要有绝对路径
//try
//{
// HttpClient httpClient = new HttpClient();
// if (!string.IsNullOrWhiteSpace(url))
// {
// string[] strArry = url.Split('/');
// savePath = savePath + "/" + strArry[strArry.Length - 1];
// }
var t = httpClient.GetByteArrayAsync(url);
t.Wait();
Stream responseStream = new MemoryStream(t.Result);
Stream stream = new FileStream(savePath, FileMode.Create);
byte[] bArr = new byte[1024];
int size = responseStream.Read(bArr, 0, bArr.Length);
while (size > 0)
{
stream.Write(bArr, 0, size);
size = responseStream.Read(bArr, 0, bArr.Length);
}
// var t = httpClient.GetByteArrayAsync(url);
// t.Wait();
// Stream responseStream = new MemoryStream(t.Result);
// Stream stream = new FileStream(savePath, FileMode.Create);
// byte[] bArr = new byte[1024];
// int size = responseStream.Read(bArr, 0, bArr.Length);
// while (size > 0)
// {
// stream.Write(bArr, 0, size);
// size = responseStream.Read(bArr, 0, bArr.Length);
// }
stream.Close();
responseStream.Close();
// stream.Close();
// responseStream.Close();
return savePath;
}
catch (Exception)
{
// return savePath;
//}
//catch (Exception)
//{
throw new BusinessValidationFailedException(_localizer["ReadingCalculate_ImageNotExist"]);
}
// throw new BusinessValidationFailedException(_localizer["ReadingCalculate_ImageNotExist"]);
//}
#endregion
@ -900,9 +901,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
lesionImage.Add(new Dictionary<string, object>()
{
{ "ImageOneMark",getPicNum(true)+ picRowinfo[2*i].VisitTask.TaskName+" "+picRowinfo[2*i].RowMark},
{ "ImageOneUrl" ,await GetWordPictureMaxWL(_options.CurrentValue.MinIO.ViewEndpoint+picRowinfo[2*i].PicturePath ,System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"wwwroot/ReadReoprtTemplate/downLoad/{DownLoadGuid}"),290,390) },
{ "ImageOneUrl" ,await GetWordPictureMaxWL(picRowinfo[2*i].PicturePath ,System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"wwwroot/ReadReoprtTemplate/downLoad/{DownLoadGuid}"),290,390) },
{ "ImageTwoMark",getPicNum(picCount>2*i+1) + (picCount<=2*i+1?string.Empty:picRowinfo[2*i+1].VisitTask.TaskName+" "+picRowinfo[2*i+1].RowMark) },
{ "ImageTwoUrl", picCount<=2*i+1?string.Empty:await GetWordPictureMaxWL(_options.CurrentValue.MinIO.ViewEndpoint+picRowinfo[2*i+1].PicturePath ,System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"wwwroot/ReadReoprtTemplate/downLoad/{DownLoadGuid}"),290, 390) },
{ "ImageTwoUrl", picCount<=2*i+1?string.Empty:await GetWordPictureMaxWL(picRowinfo[2*i+1].PicturePath ,System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"wwwroot/ReadReoprtTemplate/downLoad/{DownLoadGuid}"),290, 390) },
});
}