Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
06d12ce709
|
@ -113,6 +113,12 @@
|
|||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Resources\GeoLite2-City.mmdb">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties properties_4launchsettings_1json__JsonSchema="" />
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 73 MiB |
|
@ -50,6 +50,7 @@
|
|||
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
|
||||
<PackageReference Include="MailKit" Version="4.7.1.1" />
|
||||
<PackageReference Include="Masa.Contrib.Service.MinimalAPIs" Version="1.0.0" />
|
||||
<PackageReference Include="MaxMind.GeoIP2" Version="5.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
|
||||
<PackageReference Include="MimeKit" Version="4.7.1" />
|
||||
<PackageReference Include="MiniExcel" Version="1.34.2" />
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
{
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
public UserOptType? OptType { get; set; }
|
||||
public List<UserOptType> OptTypeList { get; set; }
|
||||
|
||||
public string? IP { get; set; }
|
||||
|
||||
|
|
|
@ -850,7 +850,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inQuery.TargetIdentityUserId != null, t => t.TargetIdentityUserId == inQuery.TargetIdentityUserId)
|
||||
.WhereIf(inQuery.TrialId != null, t => t.ActionIdentityUser.UserTrialList.Any(c => c.TrialId == inQuery.TrialId) || t.TargetIdentityUser.UserTrialList.Any(c => c.TrialId == inQuery.TrialId))
|
||||
.WhereIf(trialCreateTime != null, t => t.CreateTime >= trialCreateTime)
|
||||
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
|
||||
.WhereIf(inQuery.OptTypeList != null && inQuery.OptTypeList.Count>0, t => inQuery.OptTypeList.Contains(t.OptType))
|
||||
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
||||
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
||||
.WhereIf(inQuery.IsLoginUncommonly != null, t => t.IsLoginUncommonly == inQuery.IsLoginUncommonly)
|
||||
|
|
|
@ -16,6 +16,7 @@ using IRaCIS.Core.Infrastructure.Encryption;
|
|||
using IRaCIS.Core.Infrastructure.NewtonsoftJson;
|
||||
using MassTransit;
|
||||
using MassTransit.Mediator;
|
||||
using MaxMind.GeoIP2;
|
||||
using Medallion.Threading;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
|
@ -95,6 +96,46 @@ namespace IRaCIS.Core.Application.Service
|
|||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> NewIP([FromServices] IRepository<UserLog> _userLogRepository)
|
||||
{
|
||||
var path = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "GeoLite2-City.mmdb");
|
||||
|
||||
|
||||
var ipList = _userLogRepository.Select(t => t.IP).Distinct().ToList();
|
||||
|
||||
foreach (var ip in ipList)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var reader = new DatabaseReader(path))
|
||||
{
|
||||
|
||||
var city = reader.City(ip);
|
||||
|
||||
Console.WriteLine(city.Country.IsoCode); // 'US' 'CN'
|
||||
Console.WriteLine(city.Country.Name); // 'United States' 'China'
|
||||
//Console.WriteLine(city.Country.Names["zh-CN"]); // '美国'
|
||||
Console.WriteLine(city.MostSpecificSubdivision.Name); // 'Minnesota' 'Hubei'
|
||||
Console.WriteLine(city.City.Name); // 'Minneapolis' 'WUHan'
|
||||
|
||||
|
||||
Console.WriteLine("----------------");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Console.WriteLine($"{ip}在数据库无法解析 {ex.Message}"); // 44.9733
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IQC 回退到影像上传
|
||||
|
@ -182,11 +223,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> BackImageResize(Guid trialSiteId ,Guid subjectId/* , [FromServices] IRepository<>*/)
|
||||
public async Task<IResponseOutput> BackImageResize(Guid trialSiteId, Guid subjectId/* , [FromServices] IRepository<>*/)
|
||||
{
|
||||
///${params.trialId}/ Image /${params.subjectId}/${params.subjectVisitId}/${ dicomInfo.studyUid}/${ v.seriesUid}.jpg
|
||||
|
||||
var dealSeriesList = await _dicomSeriesRepository.Where(t => t.DicomStudy.Subject.TrialSiteId == trialSiteId && t.SubjectId== subjectId).Select(t => new { t.Id, t.SubjectId, t.TrialId, t.SubjectVisitId, t.StudyInstanceUid, t.SeriesInstanceUid, t.ImageResizePath, t.UpdateUserId, FirstInstancePath = t.DicomInstanceList.First().Path }).ToListAsync();
|
||||
var dealSeriesList = await _dicomSeriesRepository.Where(t => t.DicomStudy.Subject.TrialSiteId == trialSiteId && t.SubjectId == subjectId).Select(t => new { t.Id, t.SubjectId, t.TrialId, t.SubjectVisitId, t.StudyInstanceUid, t.SeriesInstanceUid, t.ImageResizePath, t.UpdateUserId, FirstInstancePath = t.DicomInstanceList.First().Path }).ToListAsync();
|
||||
|
||||
//下载到本地
|
||||
string tempFolderPath = Path.Combine(Directory.GetCurrentDirectory(), $"DownloadTemp_{NewId.NextGuid()}");
|
||||
|
@ -218,7 +259,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
// 保存缩略图为 JPEG
|
||||
image.Save(resizePath, new JpegEncoder());
|
||||
}
|
||||
|
||||
|
||||
var ossFolder = $"{dealSeries.TrialId}/Image/{dealSeries.SubjectId}/{dealSeries.SubjectVisitId}/{dealSeries.StudyInstanceUid}";
|
||||
|
||||
var relativePath = await _IOSSService.UploadToOSSAsync(resizePath, ossFolder, false);
|
||||
|
|
Loading…
Reference in New Issue