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 running
Details
continuous-integration/drone/push Build is running
Details
commit
005b0b9e0d
|
|
@ -18255,6 +18255,11 @@
|
||||||
文件大小,单位字节
|
文件大小,单位字节
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentationAddOrEdit.SEGUpdateTime">
|
||||||
|
<summary>
|
||||||
|
SEGUpdateTime 更新时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentationVersionView.StartTime">
|
<member name="P:IRaCIS.Core.Application.ViewModel.SegmentationVersionView.StartTime">
|
||||||
<summary>
|
<summary>
|
||||||
版本开始时间
|
版本开始时间
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,11 @@ public class SegmentationAddOrEdit
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long FileSize { get; set; } = 0;
|
public long FileSize { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SEGUpdateTime 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? SEGUpdateTime { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SegmentationQuery:PageInput
|
public class SegmentationQuery:PageInput
|
||||||
|
|
|
||||||
|
|
@ -1174,7 +1174,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadModule_TumorExists"]);
|
throw new BusinessValidationFailedException(_localizer["ReadModule_TumorExists"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await _visitTaskRepository.AnyAsync(x => readModuleId == x.SouceReadModuleId))
|
if (await _visitTaskRepository.AnyAsync(x => readModuleId == x.SouceReadModuleId && (x.TaskState==TaskState.Effect||x.ReadingTaskState==ReadingTaskState.HaveSigned)))
|
||||||
{
|
{
|
||||||
//---当前阅片已生成任务,操作失败。
|
//---当前阅片已生成任务,操作失败。
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]);
|
throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]);
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,17 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||||
|
|
||||||
if (addOrEditSegmentation.Id != null)
|
if (addOrEditSegmentation.Id != null)
|
||||||
{
|
{
|
||||||
|
var data= await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == addOrEditSegmentation.Id);
|
||||||
|
if (addOrEditSegmentation.SEGUrl != data.SEGUrl)
|
||||||
|
{
|
||||||
|
addOrEditSegmentation.SEGUpdateTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addOrEditSegmentation.SEGUpdateTime = data.SEGUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
await SaveSegmentationVersionAsync(new SaveSegmentationVersionAsyncInDto() { SegmentationId = addOrEditSegmentation.Id.Value,SEGUrl=addOrEditSegmentation.SEGUrl });
|
await SaveSegmentationVersionAsync(new SaveSegmentationVersionAsyncInDto() { SegmentationId = addOrEditSegmentation.Id.Value, SEGUrl = addOrEditSegmentation.SEGUrl });
|
||||||
}
|
}
|
||||||
var entity = await _segmentationRepository.InsertOrUpdateAsync(addOrEditSegmentation, true);
|
var entity = await _segmentationRepository.InsertOrUpdateAsync(addOrEditSegmentation, true);
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
@ -89,21 +98,30 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task SaveSegmentationVersionAsync(SaveSegmentationVersionAsyncInDto inDto)
|
public async Task SaveSegmentationVersionAsync(SaveSegmentationVersionAsyncInDto inDto)
|
||||||
{
|
{
|
||||||
var data = await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == inDto.SegmentationId);
|
var data = await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == inDto.SegmentationId);
|
||||||
var segmentList = await _segmentRepository.Where(x => x.SegmentationId == inDto.SegmentationId).OrderBy(x=>x.SegmentNumber).ProjectTo<SegmentVersionData>(_mapper.ConfigurationProvider).ToListAsync();
|
// 如果是新增或修改,记录一条版本信息
|
||||||
|
var maxVersion = await _segmentationVersionRepository
|
||||||
|
.Where(x => x.SegmentationId == data.Id)
|
||||||
|
.OrderByDescending(x => x.Version)
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var startTime = maxVersion != null ? maxVersion.CreateTime :(data.SEGUpdateTime==null? DateTime.MinValue: data.SEGUpdateTime.Value);
|
||||||
|
|
||||||
|
var segmentList = await _segmentRepository
|
||||||
|
.Where(x=>x.CreateTime<= startTime && (!x.IsDeleted||x.DeletedTime> startTime))
|
||||||
|
|
||||||
|
.Where(x => x.SegmentationId == inDto.SegmentationId).OrderBy(x=>x.SegmentNumber).IgnoreQueryFilters().ProjectTo<SegmentVersionData>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
if (data.SEGUrl != string.Empty&&(inDto.SEGUrl!=data.SEGUrl||inDto.IsRestore))
|
if (data.SEGUrl != string.Empty&&(inDto.SEGUrl!=data.SEGUrl||inDto.IsRestore))
|
||||||
{
|
{
|
||||||
// 如果是新增或修改,记录一条版本信息
|
|
||||||
var maxVersion = await _segmentationVersionRepository
|
|
||||||
.Where(x => x.SegmentationId == data.Id)
|
|
||||||
.OrderByDescending(x => x.Version)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
var newVersion = maxVersion == null ? 1 : maxVersion.Version + 1;
|
var newVersion = maxVersion == null ? 1 : maxVersion.Version + 1;
|
||||||
var startTime = maxVersion != null ? maxVersion.CreateTime : data.UpdateTime ;
|
|
||||||
|
|
||||||
|
|
||||||
var versionEntity = new SegmentationVersion
|
var versionEntity = new SegmentationVersion
|
||||||
{
|
{
|
||||||
|
|
@ -251,7 +269,7 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||||
public async Task<IResponseOutput> DeleteSegment(Guid segmentId)
|
public async Task<IResponseOutput> DeleteSegment(Guid segmentId)
|
||||||
{
|
{
|
||||||
await DeleteBindingsAndAnswersAsync(null, segmentId);
|
await DeleteBindingsAndAnswersAsync(null, segmentId);
|
||||||
var success = await _segmentRepository.DeleteFromQueryAsync(t => t.Id == segmentId, true);
|
var success = await _segmentRepository.SoftDeleteFromQueryAsync(t => t.Id == segmentId, true);
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,11 @@ public class Segmentation : BaseFullDeleteAuditEntity
|
||||||
[MaxLength]
|
[MaxLength]
|
||||||
public string SEGUrl { get; set; } = string.Empty;
|
public string SEGUrl { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SEGUpdateTime 更新时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? SEGUpdateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件大小,单位字节
|
/// 文件大小,单位字节
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,11 @@ public class SegmentationVersion : BaseAddAuditEntity
|
||||||
|
|
||||||
public class SegmentVersionData: ISegment
|
public class SegmentVersionData: ISegment
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 这个时间很总要要记录
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分割Id
|
/// 分割Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
22238
IRaCIS.Core.Infra.EFCore/Migrations/20260512071158_SEGUpdateTime.Designer.cs
generated
Normal file
22238
IRaCIS.Core.Infra.EFCore/Migrations/20260512071158_SEGUpdateTime.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,29 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class SEGUpdateTime : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "SEGUpdateTime",
|
||||||
|
table: "Segmentation",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "SEGUpdateTime",
|
||||||
|
table: "Segmentation");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9505,6 +9505,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Property<bool>("IsSaved")
|
b.Property<bool>("IsSaved")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("SEGUpdateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
b.Property<string>("SEGUrl")
|
b.Property<string>("SEGUrl")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue